From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 01:12:24 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EEF6932; Sun, 8 Feb 2015 01:12: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B0416E; Sun, 8 Feb 2015 01:12:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t181CNxO027750; Sun, 8 Feb 2015 01:12:23 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t181CNmf027749; Sun, 8 Feb 2015 01:12:23 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201502080112.t181CNmf027749@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Feb 2015 01:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278368 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 01:12:24 -0000 Author: gonzo Date: Sun Feb 8 01:12:23 2015 New Revision: 278368 URL: https://svnweb.freebsd.org/changeset/base/278368 Log: Act as a bus in attach method: probe and attach devices Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Sat Feb 7 23:25:56 2015 (r278367) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Sun Feb 8 01:12:23 2015 (r278368) @@ -171,6 +171,9 @@ bcm_vchiq_attach(device_t dev) vchiq_init(); + bus_generic_probe(dev); + bus_generic_attach(dev); + return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 01:12:42 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07436A6A; Sun, 8 Feb 2015 01: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E657194; Sun, 8 Feb 2015 01:12:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t181CfMM027825; Sun, 8 Feb 2015 01:12:41 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t181Cf7Y027818; Sun, 8 Feb 2015 01:12:41 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201502080112.t181Cf7Y027818@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Feb 2015 01:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278369 - 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.18-1 Precedence: list List-Id: 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, 08 Feb 2015 01:12:42 -0000 Author: gonzo Date: Sun Feb 8 01:12:40 2015 New Revision: 278369 URL: https://svnweb.freebsd.org/changeset/base/278369 Log: Add VideoCore audio driver for Rasperry Pi (BCM2835) Added: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c (contents, props changed) head/sys/arm/broadcom/bcm2835/vc_vchi_audioserv_defs.h (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/conf/RPI-B Added: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Sun Feb 8 01:12:40 2015 (r278369) @@ -0,0 +1,908 @@ +/*- + * Copyright (c) 2015 Oleksandr Tymoshenko + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + +#include +#include + +#include "mixer_if.h" + +#include "interface/compat/vchi_bsd.h" +#include "interface/vchi/vchi.h" +#include "interface/vchiq_arm/vchiq.h" + +#include "vc_vchi_audioserv_defs.h" + +SND_DECLARE_FILE("$FreeBSD$"); + +#define DEST_AUTO 0 +#define DEST_HEADPHONES 1 +#define DEST_HDMI 2 + +#define VCHIQ_AUDIO_PACKET_SIZE 4000 +#define VCHIQ_AUDIO_BUFFER_SIZE 128000 + +#define VCHIQ_AUDIO_MAX_VOLUME +/* volume in terms of 0.01dB */ +#define VCHIQ_AUDIO_VOLUME_MIN -10239 +#define VCHIQ_AUDIO_VOLUME(db100) (uint32_t)(-((db100) << 8)/100) + +/* dB levels with 5% volume step */ +static int db_levels[] = { + VCHIQ_AUDIO_VOLUME_MIN, -4605, -3794, -3218, -2772, + -2407, -2099, -1832, -1597, -1386, + -1195, -1021, -861, -713, -575, + -446, -325, -210, -102, 0, +}; + +static uint32_t bcm2835_audio_playfmt[] = { + SND_FORMAT(AFMT_U8, 1, 0), + SND_FORMAT(AFMT_U8, 2, 0), + SND_FORMAT(AFMT_S8, 1, 0), + SND_FORMAT(AFMT_S8, 2, 0), + SND_FORMAT(AFMT_S16_LE, 1, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), + SND_FORMAT(AFMT_U16_LE, 1, 0), + SND_FORMAT(AFMT_U16_LE, 2, 0), + 0 +}; + +static struct pcmchan_caps bcm2835_audio_playcaps = {8000, 48000, bcm2835_audio_playfmt, 0}; + +struct bcm2835_audio_info; + +#define PLAYBACK_IDLE 0 +#define PLAYBACK_STARTING 1 +#define PLAYBACK_PLAYING 2 +#define PLAYBACK_STOPPING 3 + +struct bcm2835_audio_chinfo { + struct bcm2835_audio_info *parent; + struct pcm_channel *channel; + struct snd_dbuf *buffer; + uint32_t fmt, spd, blksz; + + uint32_t complete_pos; + uint32_t free_buffer; + uint32_t buffered_ptr; + int playback_state; +}; + +struct bcm2835_audio_info { + device_t dev; + unsigned int bufsz; + struct bcm2835_audio_chinfo pch; + uint32_t dest, volume; + struct mtx *lock; + struct intr_config_hook intr_hook; + + /* VCHI data */ + struct mtx vchi_lock; + + /* MSG reply */ + struct mtx msg_avail_lock; + struct cv msg_avail_cv; + uint32_t msg_result; + + VCHI_INSTANCE_T vchi_instance; + VCHI_CONNECTION_T *vchi_connection; + VCHI_SERVICE_HANDLE_T vchi_handle; + + struct mtx data_lock; + struct cv data_cv; + + /* Unloadign module */ + int unloading; +}; + +#define bcm2835_audio_lock(_ess) snd_mtxlock((_ess)->lock) +#define bcm2835_audio_unlock(_ess) snd_mtxunlock((_ess)->lock) +#define bcm2835_audio_lock_assert(_ess) snd_mtxassert((_ess)->lock) + +#define VCHIQ_VCHI_LOCK(sc) mtx_lock(&(sc)->vchi_lock) +#define VCHIQ_VCHI_UNLOCK(sc) mtx_unlock(&(sc)->vchi_lock) + +static const char * +dest_description(uint32_t dest) +{ + switch (dest) { + case DEST_AUTO: + return "AUTO"; + break; + + case DEST_HEADPHONES: + return "HEADPHONES"; + break; + + case DEST_HDMI: + return "HDMI"; + break; + default: + return "UNKNOWN"; + break; + } +} + +static void +bcm2835_audio_callback(void *param, const VCHI_CALLBACK_REASON_T reason, void *msg_handle) +{ + struct bcm2835_audio_info *sc = (struct bcm2835_audio_info *)param; + int32_t status; + uint32_t msg_len; + VC_AUDIO_MSG_T m; + + if (reason != VCHI_CALLBACK_MSG_AVAILABLE) + return; + + status = vchi_msg_dequeue(sc->vchi_handle, + &m, sizeof m, &msg_len, VCHI_FLAGS_NONE); + if (m.type == VC_AUDIO_MSG_TYPE_RESULT) { + sc->msg_result = m.u.result.success; + cv_signal(&sc->msg_avail_cv); + } else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) { + struct bcm2835_audio_chinfo *ch = m.u.complete.cookie; + + int count = m.u.complete.count & 0xffff; + int perr = (m.u.complete.count & (1U << 30)) != 0; + + ch->complete_pos = (ch->complete_pos + count) % sndbuf_getsize(ch->buffer); + ch->free_buffer += count; + + if (perr || ch->free_buffer >= VCHIQ_AUDIO_PACKET_SIZE) { + chn_intr(ch->channel); + cv_signal(&sc->data_cv); + } + } else + printf("%s: unknown m.type: %d\n", __func__, m.type); +} + +/* VCHIQ stuff */ +static void +bcm2835_audio_init(struct bcm2835_audio_info *sc) +{ + int status; + + /* Initialize and create a VCHI connection */ + status = vchi_initialise(&sc->vchi_instance); + if (status != 0) { + printf("vchi_initialise failed: %d\n", status); + return; + } + + status = vchi_connect(NULL, 0, sc->vchi_instance); + if (status != 0) { + printf("vchi_connect failed: %d\n", status); + return; + } + + SERVICE_CREATION_T params = { + VCHI_VERSION_EX(VC_AUDIOSERV_VER, VC_AUDIOSERV_MIN_VER), + VC_AUDIO_SERVER_NAME, /* 4cc service code */ + sc->vchi_connection, /* passed in fn pointers */ + 0, /* rx fifo size */ + 0, /* tx fifo size */ + bcm2835_audio_callback, /* service callback */ + sc, /* service callback parameter */ + 1, + 1, + 0 /* want crc check on bulk transfers */ + }; + + status = vchi_service_open(sc->vchi_instance, ¶ms, + &sc->vchi_handle); + + if (status == 0) + /* Finished with the service for now */ + vchi_service_release(sc->vchi_handle); + else + sc->vchi_handle = VCHIQ_SERVICE_HANDLE_INVALID; +} + +static void +bcm2835_audio_release(struct bcm2835_audio_info *sc) +{ + int success; + + if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { + vchi_service_use(sc->vchi_handle); + success = vchi_service_close(sc->vchi_handle); + if (success != 0) + printf("vchi_service_close failed: %d\n", success); + sc->vchi_handle = VCHIQ_SERVICE_HANDLE_INVALID; + } + + vchi_disconnect(sc->vchi_instance); +} + +static void +bcm2835_audio_reset_channel(struct bcm2835_audio_chinfo *ch) +{ + ch->free_buffer = VCHIQ_AUDIO_BUFFER_SIZE; + ch->playback_state = 0; + ch->buffered_ptr = 0; + ch->complete_pos = 0; + + sndbuf_reset(ch->buffer); +} + +static void +bcm2835_audio_start(struct bcm2835_audio_chinfo *ch) +{ + VC_AUDIO_MSG_T m; + int ret; + struct bcm2835_audio_info *sc = ch->parent; + + VCHIQ_VCHI_LOCK(sc); + if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { + vchi_service_use(sc->vchi_handle); + + bcm2835_audio_reset_channel(ch); + + m.type = VC_AUDIO_MSG_TYPE_START; + ret = vchi_msg_queue(sc->vchi_handle, + &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + + if (ret != 0) + printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); + + vchi_service_release(sc->vchi_handle); + } + VCHIQ_VCHI_UNLOCK(sc); + +} + +static void +bcm2835_audio_stop(struct bcm2835_audio_chinfo *ch) +{ + VC_AUDIO_MSG_T m; + int ret; + struct bcm2835_audio_info *sc = ch->parent; + + VCHIQ_VCHI_LOCK(sc); + if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { + vchi_service_use(sc->vchi_handle); + + m.type = VC_AUDIO_MSG_TYPE_STOP; + m.u.stop.draining = 0; + + ret = vchi_msg_queue(sc->vchi_handle, + &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + + if (ret != 0) + printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); + + vchi_service_release(sc->vchi_handle); + } + VCHIQ_VCHI_UNLOCK(sc); +} + +static void +bcm2835_audio_open(struct bcm2835_audio_info *sc) +{ + VC_AUDIO_MSG_T m; + int ret; + + VCHIQ_VCHI_LOCK(sc); + if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { + vchi_service_use(sc->vchi_handle); + + m.type = VC_AUDIO_MSG_TYPE_OPEN; + ret = vchi_msg_queue(sc->vchi_handle, + &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + + if (ret != 0) + printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); + + vchi_service_release(sc->vchi_handle); + } + VCHIQ_VCHI_UNLOCK(sc); +} + +static void +bcm2835_audio_update_controls(struct bcm2835_audio_info *sc) +{ + VC_AUDIO_MSG_T m; + int ret, db; + + VCHIQ_VCHI_LOCK(sc); + if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { + vchi_service_use(sc->vchi_handle); + + sc->msg_result = -1; + + m.type = VC_AUDIO_MSG_TYPE_CONTROL; + m.u.control.dest = sc->dest; + if (sc->volume > 99) + sc->volume = 99; + db = db_levels[sc->volume/5]; + m.u.control.volume = VCHIQ_AUDIO_VOLUME(db); + + ret = vchi_msg_queue(sc->vchi_handle, + &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + + if (ret != 0) + printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); + + mtx_lock(&sc->msg_avail_lock); + cv_wait_sig(&sc->msg_avail_cv, &sc->msg_avail_lock); + if (sc->msg_result) + printf("%s failed: %d\n", __func__, sc->msg_result); + mtx_unlock(&sc->msg_avail_lock); + + vchi_service_release(sc->vchi_handle); + } + VCHIQ_VCHI_UNLOCK(sc); +} + +static void +bcm2835_audio_update_params(struct bcm2835_audio_info *sc, struct bcm2835_audio_chinfo *ch) +{ + VC_AUDIO_MSG_T m; + int ret; + + VCHIQ_VCHI_LOCK(sc); + if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { + vchi_service_use(sc->vchi_handle); + + sc->msg_result = -1; + + m.type = VC_AUDIO_MSG_TYPE_CONFIG; + m.u.config.channels = AFMT_CHANNEL(ch->fmt); + m.u.config.samplerate = ch->spd; + m.u.config.bps = AFMT_BIT(ch->fmt); + + ret = vchi_msg_queue(sc->vchi_handle, + &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + + if (ret != 0) + printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); + + mtx_lock(&sc->msg_avail_lock); + cv_wait_sig(&sc->msg_avail_cv, &sc->msg_avail_lock); + if (sc->msg_result) + printf("%s failed: %d\n", __func__, sc->msg_result); + mtx_unlock(&sc->msg_avail_lock); + + vchi_service_release(sc->vchi_handle); + } + VCHIQ_VCHI_UNLOCK(sc); +} + +static __inline uint32_t +vchiq_unbuffered_bytes(struct bcm2835_audio_chinfo *ch) +{ + uint32_t size, ready, readyptr, readyend; + + size = sndbuf_getsize(ch->buffer); + readyptr = sndbuf_getreadyptr(ch->buffer); + ready = sndbuf_getready(ch->buffer); + + readyend = readyptr + ready; + /* Normal case */ + if (ch->buffered_ptr >= readyptr) { + if (readyend > ch->buffered_ptr) + return readyend - ch->buffered_ptr; + else + return 0; + } + else { /* buffered_ptr overflow */ + if (readyend > ch->buffered_ptr + size) + return readyend - ch->buffered_ptr - size; + else + return 0; + } +} + +static void +bcm2835_audio_write_samples(struct bcm2835_audio_chinfo *ch) +{ + struct bcm2835_audio_info *sc = ch->parent; + VC_AUDIO_MSG_T m; + void *buf; + uint32_t count, size; + int ret; + + VCHIQ_VCHI_LOCK(sc); + if (sc->vchi_handle == VCHIQ_SERVICE_HANDLE_INVALID) { + VCHIQ_VCHI_UNLOCK(sc); + return; + } + + vchi_service_use(sc->vchi_handle); + + size = sndbuf_getsize(ch->buffer); + count = vchiq_unbuffered_bytes(ch); + buf = (uint8_t*)sndbuf_getbuf(ch->buffer) + ch->buffered_ptr; + + if (ch->buffered_ptr + count > size) + count = size - ch->buffered_ptr; + + if (count < VCHIQ_AUDIO_PACKET_SIZE) + goto done; + + count = min(count, ch->free_buffer); + count -= count % VCHIQ_AUDIO_PACKET_SIZE; + + m.type = VC_AUDIO_MSG_TYPE_WRITE; + m.u.write.count = count; + m.u.write.max_packet = VCHIQ_AUDIO_PACKET_SIZE; + m.u.write.callback = NULL; + m.u.write.cookie = ch; + if (buf) + m.u.write.silence = 0; + else + m.u.write.silence = 1; + + ret = vchi_msg_queue(sc->vchi_handle, + &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + + if (ret != 0) + printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); + + if (buf) { + while (count > 0) { + int bytes = MIN((int)m.u.write.max_packet, (int)count); + ch->free_buffer -= bytes; + ch->buffered_ptr += bytes; + ch->buffered_ptr = ch->buffered_ptr % size; + ret = vchi_msg_queue(sc->vchi_handle, + buf, bytes, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + if (ret != 0) + printf("%s: vchi_msg_queue failed: %d\n", + __func__, ret); + buf = (char *)buf + bytes; + count -= bytes; + } + } +done: + + vchi_service_release(sc->vchi_handle); + VCHIQ_VCHI_UNLOCK(sc); +} + +static void +bcm2835_audio_worker(void *data) +{ + struct bcm2835_audio_info *sc = (struct bcm2835_audio_info *)data; + struct bcm2835_audio_chinfo *ch = &sc->pch; + mtx_lock(&sc->data_lock); + while(1) { + + if (sc->unloading) + break; + + if ((ch->playback_state == PLAYBACK_PLAYING) && + (vchiq_unbuffered_bytes(ch) >= VCHIQ_AUDIO_PACKET_SIZE) + && (ch->free_buffer >= VCHIQ_AUDIO_PACKET_SIZE)) { + bcm2835_audio_write_samples(ch); + } else { + if (ch->playback_state == PLAYBACK_STOPPING) { + bcm2835_audio_reset_channel(&sc->pch); + ch->playback_state = PLAYBACK_IDLE; + } + + cv_wait_sig(&sc->data_cv, &sc->data_lock); + + if (ch->playback_state == PLAYBACK_STARTING) { + /* Give it initial kick */ + chn_intr(sc->pch.channel); + ch->playback_state = PLAYBACK_PLAYING; + } + } + } + mtx_unlock(&sc->data_lock); + + kproc_exit(0); +} + +static void +bcm2835_audio_create_worker(struct bcm2835_audio_info *sc) +{ + struct proc *newp; + + if (kproc_create(bcm2835_audio_worker, (void*)sc, &newp, 0, 0, + "bcm2835_audio_worker") != 0) { + printf("failed to create bcm2835_audio_worker\n"); + } +} + +/* -------------------------------------------------------------------- */ +/* channel interface for ESS18xx */ +static void * +bcmchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) +{ + struct bcm2835_audio_info *sc = devinfo; + struct bcm2835_audio_chinfo *ch = &sc->pch; + void *buffer; + + if (dir == PCMDIR_REC) + return NULL; + + ch->parent = sc; + ch->channel = c; + ch->buffer = b; + + /* default values */ + ch->spd = 44100; + ch->fmt = SND_FORMAT(AFMT_S16_LE, 2, 0); + ch->blksz = VCHIQ_AUDIO_PACKET_SIZE; + + buffer = malloc(sc->bufsz, M_DEVBUF, M_WAITOK | M_ZERO); + + if (sndbuf_setup(ch->buffer, buffer, sc->bufsz) != 0) { + free(buffer, M_DEVBUF); + return NULL; + } + + bcm2835_audio_update_params(sc, ch); + + return ch; +} + +static int +bcmchan_free(kobj_t obj, void *data) +{ + struct bcm2835_audio_chinfo *ch = data; + void *buffer; + + buffer = sndbuf_getbuf(ch->buffer); + if (buffer) + free(buffer, M_DEVBUF); + + return (0); +} + +static int +bcmchan_setformat(kobj_t obj, void *data, uint32_t format) +{ + struct bcm2835_audio_chinfo *ch = data; + struct bcm2835_audio_info *sc = ch->parent; + + bcm2835_audio_lock(sc); + + ch->fmt = format; + bcm2835_audio_update_params(sc, ch); + + bcm2835_audio_unlock(sc); + + return 0; +} + +static uint32_t +bcmchan_setspeed(kobj_t obj, void *data, uint32_t speed) +{ + struct bcm2835_audio_chinfo *ch = data; + struct bcm2835_audio_info *sc = ch->parent; + + bcm2835_audio_lock(sc); + + ch->spd = speed; + bcm2835_audio_update_params(sc, ch); + + bcm2835_audio_unlock(sc); + + return ch->spd; +} + +static uint32_t +bcmchan_setblocksize(kobj_t obj, void *data, uint32_t blocksize) +{ + struct bcm2835_audio_chinfo *ch = data; + + return ch->blksz; +} + +static int +bcmchan_trigger(kobj_t obj, void *data, int go) +{ + struct bcm2835_audio_chinfo *ch = data; + struct bcm2835_audio_info *sc = ch->parent; + + if (!PCMTRIG_COMMON(go)) + return (0); + + bcm2835_audio_lock(sc); + + switch (go) { + case PCMTRIG_START: + bcm2835_audio_start(ch); + ch->playback_state = PLAYBACK_STARTING; + /* wakeup worker thread */ + cv_signal(&sc->data_cv); + break; + + case PCMTRIG_STOP: + case PCMTRIG_ABORT: + ch->playback_state = 1; + bcm2835_audio_stop(ch); + break; + + default: + break; + } + + bcm2835_audio_unlock(sc); + return 0; +} + +static uint32_t +bcmchan_getptr(kobj_t obj, void *data) +{ + struct bcm2835_audio_chinfo *ch = data; + struct bcm2835_audio_info *sc = ch->parent; + uint32_t ret; + + bcm2835_audio_lock(sc); + + ret = ch->complete_pos - (ch->complete_pos % VCHIQ_AUDIO_PACKET_SIZE); + + bcm2835_audio_unlock(sc); + + return ret; +} + +static struct pcmchan_caps * +bcmchan_getcaps(kobj_t obj, void *data) +{ + + return &bcm2835_audio_playcaps; +} + +static kobj_method_t bcmchan_methods[] = { + KOBJMETHOD(channel_init, bcmchan_init), + KOBJMETHOD(channel_free, bcmchan_free), + KOBJMETHOD(channel_setformat, bcmchan_setformat), + KOBJMETHOD(channel_setspeed, bcmchan_setspeed), + KOBJMETHOD(channel_setblocksize, bcmchan_setblocksize), + KOBJMETHOD(channel_trigger, bcmchan_trigger), + KOBJMETHOD(channel_getptr, bcmchan_getptr), + KOBJMETHOD(channel_getcaps, bcmchan_getcaps), + KOBJMETHOD_END +}; +CHANNEL_DECLARE(bcmchan); + +/************************************************************/ + +static int +bcmmix_init(struct snd_mixer *m) +{ + + mix_setdevs(m, SOUND_MASK_VOLUME); + + return (0); +} + +static int +bcmmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) +{ + struct bcm2835_audio_info *sc = mix_getdevinfo(m); + + switch (dev) { + case SOUND_MIXER_VOLUME: + sc->volume = left; + bcm2835_audio_update_controls(sc); + break; + + default: + break; + } + + return left | (left << 8); +} + +static kobj_method_t bcmmixer_methods[] = { + KOBJMETHOD(mixer_init, bcmmix_init), + KOBJMETHOD(mixer_set, bcmmix_set), + KOBJMETHOD_END +}; + +MIXER_DECLARE(bcmmixer); + +static int +sysctl_bcm2835_audio_dest(SYSCTL_HANDLER_ARGS) +{ + struct bcm2835_audio_info *sc = arg1; + int val; + int err; + + val = sc->dest; + err = sysctl_handle_int(oidp, &val, 0, req); + if (err || !req->newptr) /* error || read request */ + return (err); + + if ((val < 0) || (val > 2)) + return (EINVAL); + + sc->dest = val; + device_printf(sc->dev, "destination set to %s\n", dest_description(val)); + bcm2835_audio_update_controls(sc); + + return (0); +} + +static void +vchi_audio_sysctl_init(struct bcm2835_audio_info *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node; + struct sysctl_oid_list *tree; + + /* + * Add system sysctl tree/handlers. + */ + ctx = device_get_sysctl_ctx(sc->dev); + tree_node = device_get_sysctl_tree(sc->dev); + tree = SYSCTL_CHILDREN(tree_node); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "dest", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + sysctl_bcm2835_audio_dest, "IU", "audio destination, " + "0 - auto, 1 - headphones, 2 - HDMI"); +} + +static void +bcm2835_audio_identify(driver_t *driver, device_t parent) +{ + + BUS_ADD_CHILD(parent, 0, "pcm", 0); +} + +static int +bcm2835_audio_probe(device_t dev) +{ + + device_set_desc(dev, "VCHQI audio"); + return (BUS_PROBE_DEFAULT); +} + + +static void +bcm2835_audio_delayed_init(void *xsc) +{ + struct bcm2835_audio_info *sc; + char status[SND_STATUSLEN]; + + sc = xsc; + + config_intrhook_disestablish(&sc->intr_hook); + + bcm2835_audio_init(sc); + bcm2835_audio_open(sc); + sc->volume = 75; + sc->dest = DEST_AUTO; + + if (mixer_init(sc->dev, &bcmmixer_class, sc)) { + device_printf(sc->dev, "mixer_init failed\n"); + goto no; + } + + if (pcm_register(sc->dev, sc, 1, 1)) { + device_printf(sc->dev, "pcm_register failed\n"); + goto no; + } + + pcm_addchan(sc->dev, PCMDIR_PLAY, &bcmchan_class, sc); + snprintf(status, SND_STATUSLEN, "at VCHIQ"); + pcm_setstatus(sc->dev, status); + + bcm2835_audio_reset_channel(&sc->pch); + bcm2835_audio_create_worker(sc); + + vchi_audio_sysctl_init(sc); + +no: + ; +} + +static int +bcm2835_audio_attach(device_t dev) +{ + struct bcm2835_audio_info *sc; + + sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); + + sc->dev = dev; + sc->bufsz = VCHIQ_AUDIO_BUFFER_SIZE; + + sc->lock = snd_mtxcreate(device_get_nameunit(dev), "bcm2835_audio softc"); + + mtx_init(&sc->vchi_lock, "bcm2835_audio", "vchi_lock", MTX_DEF); + mtx_init(&sc->msg_avail_lock, "msg_avail_mtx", "msg_avail_mtx", MTX_DEF); + cv_init(&sc->msg_avail_cv, "msg_avail_cv"); + mtx_init(&sc->data_lock, "data_mtx", "data_mtx", MTX_DEF); + cv_init(&sc->data_cv, "data_cv"); + sc->vchi_handle = VCHIQ_SERVICE_HANDLE_INVALID; + + /* + * We need interrupts enabled for VCHI to work properly, + * so delay intialization until it happens + */ + sc->intr_hook.ich_func = bcm2835_audio_delayed_init; + sc->intr_hook.ich_arg = sc; + + if (config_intrhook_establish(&sc->intr_hook) != 0) + goto no; + + return 0; + +no: + return ENXIO; +} + +static int +bcm2835_audio_detach(device_t dev) +{ + int r; + struct bcm2835_audio_info *sc; + sc = pcm_getdevinfo(dev); + + /* Stop worker thread */ + sc->unloading = 1; + cv_signal(&sc->data_cv); + + r = pcm_unregister(dev); + if (r) + return r; + + mtx_destroy(&sc->vchi_lock); + mtx_destroy(&sc->msg_avail_lock); + cv_destroy(&sc->msg_avail_cv); + mtx_destroy(&sc->data_lock); + cv_destroy(&sc->data_cv); + + bcm2835_audio_release(sc); + + if (sc->lock) { + snd_mtxfree(sc->lock); + sc->lock = NULL; + } + + free(sc, M_DEVBUF); + + return 0; +} + +static device_method_t bcm2835_audio_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, bcm2835_audio_identify), + DEVMETHOD(device_probe, bcm2835_audio_probe), + DEVMETHOD(device_attach, bcm2835_audio_attach), + DEVMETHOD(device_detach, bcm2835_audio_detach), + + { 0, 0 } +}; + +static driver_t bcm2835_audio_driver = { + "pcm", + bcm2835_audio_methods, + PCM_SOFTC_SIZE, +}; + +DRIVER_MODULE(bcm2835_audio, vchiq, bcm2835_audio_driver, pcm_devclass, 0, 0); +MODULE_DEPEND(bcm2835_audio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); +MODULE_DEPEND(bcm2835_audio, vchiq, 1, 1, 1); +MODULE_VERSION(bcm2835_audio, 1); Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Sun Feb 8 01:12:23 2015 (r278368) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Sun Feb 8 01:12:40 2015 (r278369) @@ -28,6 +28,9 @@ kern/kern_clocksource.c dev/mbox/mbox_if.m standard dev/ofw/ofw_cpu.c standard +arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" + # VideoCore driver contrib/vchiq/interface/compat/vchi_bsd.c optional vchiq \ compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" Added: head/sys/arm/broadcom/bcm2835/vc_vchi_audioserv_defs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/vc_vchi_audioserv_defs.h Sun Feb 8 01:12:40 2015 (r278369) @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2012, Broadcom Europe Ltd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder 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. + * + * $FreeBSD$ + */ + +#ifndef _VC_AUDIO_DEFS_H_ +#define _VC_AUDIO_DEFS_H_ + +#define VC_AUDIOSERV_MIN_VER 1 +#define VC_AUDIOSERV_VER 2 + +/* FourCC code used for VCHI connection */ +#define VC_AUDIO_SERVER_NAME MAKE_FOURCC("AUDS") + +/* Maximum message length */ +#define VC_AUDIO_MAX_MSG_LEN (sizeof( VC_AUDIO_MSG_T )) + +/* + * List of screens that are currently supported + * All message types supported for HOST->VC direction + */ +typedef enum +{ + VC_AUDIO_MSG_TYPE_RESULT, /* Generic result */ + VC_AUDIO_MSG_TYPE_COMPLETE, /* playback of samples complete */ + VC_AUDIO_MSG_TYPE_CONFIG, /* Configure */ + VC_AUDIO_MSG_TYPE_CONTROL, /* control */ + VC_AUDIO_MSG_TYPE_OPEN, /* open */ + VC_AUDIO_MSG_TYPE_CLOSE, /* close/shutdown */ + VC_AUDIO_MSG_TYPE_START, /* start output (i.e. resume) */ + VC_AUDIO_MSG_TYPE_STOP, /* stop output (i.e. pause) */ + VC_AUDIO_MSG_TYPE_WRITE, /* write samples */ + VC_AUDIO_MSG_TYPE_MAX + +} VC_AUDIO_MSG_TYPE; + +static const char *vc_audio_msg_type_names[] = { + "VC_AUDIO_MSG_TYPE_RESULT", + "VC_AUDIO_MSG_TYPE_COMPLETE", + "VC_AUDIO_MSG_TYPE_CONFIG", + "VC_AUDIO_MSG_TYPE_CONTROL", + "VC_AUDIO_MSG_TYPE_OPEN", + "VC_AUDIO_MSG_TYPE_CLOSE", + "VC_AUDIO_MSG_TYPE_START", + "VC_AUDIO_MSG_TYPE_STOP", + "VC_AUDIO_MSG_TYPE_WRITE", + "VC_AUDIO_MSG_TYPE_MAX" +}; + +/* configure the audio */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 03:55:13 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB4FC999; Sun, 8 Feb 2015 03:55: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7B41A6; Sun, 8 Feb 2015 03:55:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t183tDik002514; Sun, 8 Feb 2015 03:55:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t183tDQE002513; Sun, 8 Feb 2015 03:55:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502080355.t183tDQE002513@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Feb 2015 03:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278370 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 03:55:14 -0000 Author: markj Date: Sun Feb 8 03:55:12 2015 New Revision: 278370 URL: https://svnweb.freebsd.org/changeset/base/278370 Log: Fix a typo in r278137: make sure to free provider state. X-MFC-With: r278136 Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Feb 8 01:12:40 2015 (r278369) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Feb 8 03:55:12 2015 (r278370) @@ -16881,7 +16881,7 @@ dtrace_dtr(void *data) #ifdef illumos dtrace_state_destroy(state); #else - if (state == NULL) { + if (state != NULL) { dtrace_state_destroy(state); kmem_free(state, 0); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 08:24:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46C80FBF; Sun, 8 Feb 2015 08:24:25 +0000 (UTC) Received: from vlakno.cz (mail.vlakno.cz [91.217.96.224]) by mx1.freebsd.org (Postfix) with ESMTP id BFD0DAF9; Sun, 8 Feb 2015 08:24:23 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 61DEC1D95B5A; Sun, 8 Feb 2015 09:23:37 +0100 (CET) Date: Sun, 8 Feb 2015 09:23:37 +0100 From: Roman Divacky To: Dimitry Andric Subject: Re: svn commit: r278361 - in head/contrib/llvm: lib/Target/X86 patches Message-ID: <20150208082337.GA81836@vlakno.cz> References: <201502071657.t17GvXW9092528@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502071657.t17GvXW9092528@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 08 Feb 2015 08:24:25 -0000 Fwiw, FastISel is only used for -O0, maybe the right way to "fix" the breakage is to not use -O0 ? On Sat, Feb 07, 2015 at 04:57:33PM +0000, Dimitry Andric wrote: > Author: dim > Date: Sat Feb 7 16:57:32 2015 > New Revision: 278361 > URL: https://svnweb.freebsd.org/changeset/base/278361 > > Log: > Back out r278349 and r278350 for now, since this apparently blows up the > kernel build in sys/dev/hptmv/hptproc.c for some people. > > Reported by: sbruno, Matthew Fuller > > Deleted: > head/contrib/llvm/patches/patch-32-llvm-r224884-invalid-reg-replacement.diff > Modified: > head/contrib/llvm/lib/Target/X86/X86FastISel.cpp > > Modified: head/contrib/llvm/lib/Target/X86/X86FastISel.cpp > ============================================================================== > --- head/contrib/llvm/lib/Target/X86/X86FastISel.cpp Sat Feb 7 14:31:51 2015 (r278360) > +++ head/contrib/llvm/lib/Target/X86/X86FastISel.cpp Sat Feb 7 16:57:32 2015 (r278361) > @@ -2699,9 +2699,6 @@ bool X86FastISel::FastLowerCall(CallLowe > TM.Options.GuaranteedTailCallOpt)) > return false; > > - SmallVector OutVTs; > - SmallVector ArgRegs; > - > // If this is a constant i1/i8/i16 argument, promote to i32 to avoid an extra > // instruction. This is safe because it is common to all FastISel supported > // calling conventions on x86. > @@ -2719,34 +2716,28 @@ bool X86FastISel::FastLowerCall(CallLowe > > // Passing bools around ends up doing a trunc to i1 and passing it. > // Codegen this as an argument + "and 1". > - MVT VT; > - auto *TI = dyn_cast(Val); > - unsigned ResultReg; > - if (TI && TI->getType()->isIntegerTy(1) && CLI.CS && > - (TI->getParent() == CLI.CS->getInstruction()->getParent()) && > - TI->hasOneUse()) { > - Value *PrevVal = TI->getOperand(0); > - ResultReg = getRegForValue(PrevVal); > - > - if (!ResultReg) > - return false; > + if (auto *TI = dyn_cast(Val)) { > + if (TI->getType()->isIntegerTy(1) && CLI.CS && > + (TI->getParent() == CLI.CS->getInstruction()->getParent()) && > + TI->hasOneUse()) { > + Val = cast(Val)->getOperand(0); > + unsigned ResultReg = getRegForValue(Val); > > - if (!isTypeLegal(PrevVal->getType(), VT)) > - return false; > + if (!ResultReg) > + return false; > > - ResultReg = > - FastEmit_ri(VT, VT, ISD::AND, ResultReg, hasTrivialKill(PrevVal), 1); > + MVT ArgVT; > + if (!isTypeLegal(Val->getType(), ArgVT)) > + return false; > > - if (!ResultReg) > - return false; > - } else { > - if (!isTypeLegal(Val->getType(), VT)) > - return false; > - ResultReg = getRegForValue(Val); > - } > + ResultReg = > + FastEmit_ri(ArgVT, ArgVT, ISD::AND, ResultReg, Val->hasOneUse(), 1); > > - ArgRegs.push_back(ResultReg); > - OutVTs.push_back(VT); > + if (!ResultReg) > + return false; > + UpdateValueMap(Val, ResultReg); > + } > + } > } > > // Analyze operands of the call, assigning locations to each operand. > @@ -2758,6 +2749,13 @@ bool X86FastISel::FastLowerCall(CallLowe > if (IsWin64) > CCInfo.AllocateStack(32, 8); > > + SmallVector OutVTs; > + for (auto *Val : OutVals) { > + MVT VT; > + if (!isTypeLegal(Val->getType(), VT)) > + return false; > + OutVTs.push_back(VT); > + } > CCInfo.AnalyzeCallOperands(OutVTs, OutFlags, CC_X86); > > // Get a count of how many bytes are to be pushed on the stack. > @@ -2779,7 +2777,9 @@ bool X86FastISel::FastLowerCall(CallLowe > if (ArgVT == MVT::x86mmx) > return false; > > - unsigned ArgReg = ArgRegs[VA.getValNo()]; > + unsigned ArgReg = getRegForValue(ArgVal); > + if (!ArgReg) > + return false; > > // Promote the value if needed. > switch (VA.getLocInfo()) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 08:34:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 8B0BB30D; Sun, 8 Feb 2015 08:34:29 +0000 (UTC) Date: Sun, 8 Feb 2015 08:34:29 +0000 From: Alexey Dokuchaev To: Devin Teske Subject: Re: svn commit: r278335 - head/sys/boot/forth Message-ID: <20150208083429.GA21530@FreeBSD.org> References: <201502062319.t16NJISs097347@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502062319.t16NJISs097347@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 08 Feb 2015 08:34:29 -0000 On Fri, Feb 06, 2015 at 11:19:18PM +0000, Devin Teske wrote: > New Revision: 278335 > URL: https://svnweb.freebsd.org/changeset/base/278335 > > Log: > Revert SVN r277693. > > Discussed on: src-committers > Approved by: core (emaste) Why it was reverted, if I may ask? ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 08:42:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93D314AC; Sun, 8 Feb 2015 08:42: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FA70D00; Sun, 8 Feb 2015 08:42:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t188gk8D034391; Sun, 8 Feb 2015 08:42:46 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t188gjge034389; Sun, 8 Feb 2015 08:42:45 GMT (envelope-from np@FreeBSD.org) Message-Id: <201502080842.t188gjge034389@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 8 Feb 2015 08:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278371 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 08:42:46 -0000 Author: np Date: Sun Feb 8 08:42:45 2015 New Revision: 278371 URL: https://svnweb.freebsd.org/changeset/base/278371 Log: cxgbe(4): a change to the synchronization rules within the the driver. This is purely cosmetic because the new rules are already followed. MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sun Feb 8 03:55:12 2015 (r278370) +++ head/sys/dev/cxgbe/adapter.h Sun Feb 8 08:42:45 2015 (r278371) @@ -812,7 +812,6 @@ struct adapter { #define ADAPTER_LOCK_ASSERT_OWNED(sc) mtx_assert(&(sc)->sc_lock, MA_OWNED) #define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert(&(sc)->sc_lock, MA_NOTOWNED) -/* XXX: not bulletproof, but much better than nothing */ #define ASSERT_SYNCHRONIZED_OP(sc) \ KASSERT(IS_BUSY(sc) && \ (mtx_owned(&(sc)->sc_lock) || sc->last_op_thr == curthread), \ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Feb 8 03:55:12 2015 (r278370) +++ head/sys/dev/cxgbe/t4_main.c Sun Feb 8 08:42:45 2015 (r278371) @@ -3139,6 +3139,9 @@ mcfail: return (rc); } +/* + * {begin|end}_synchronized_op must be called from the same thread. + */ int begin_synchronized_op(struct adapter *sc, struct port_info *pi, int flags, char *wmesg) @@ -3194,6 +3197,9 @@ done: return (rc); } +/* + * {begin|end}_synchronized_op must be called from the same thread. + */ void end_synchronized_op(struct adapter *sc, int flags) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 08:52:19 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31989645; Sun, 8 Feb 2015 08: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DCB7DCA; Sun, 8 Feb 2015 08:52:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t188qIu7038927; Sun, 8 Feb 2015 08:52:18 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t188qISg038926; Sun, 8 Feb 2015 08:52:18 GMT (envelope-from np@FreeBSD.org) Message-Id: <201502080852.t188qISg038926@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 8 Feb 2015 08:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278372 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 08:52:19 -0000 Author: np Date: Sun Feb 8 08:52:18 2015 New Revision: 278372 URL: https://svnweb.freebsd.org/changeset/base/278372 Log: cxgbe(4): adapter_full_init is always a synchronized operation. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Feb 8 08:42:45 2015 (r278371) +++ head/sys/dev/cxgbe/t4_main.c Sun Feb 8 08:52:18 2015 (r278372) @@ -3432,6 +3432,7 @@ adapter_full_init(struct adapter *sc) { int rc, i; + ASSERT_SYNCHRONIZED_OP(sc); ADAPTER_LOCK_ASSERT_NOTOWNED(sc); KASSERT((sc->flags & FULL_INIT_DONE) == 0, ("%s: FULL_INIT_DONE already", __func__)); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 09:28:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FF4EC0E; Sun, 8 Feb 2015 09:28: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A928F4; Sun, 8 Feb 2015 09:28:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t189Svl0053428; Sun, 8 Feb 2015 09:28:57 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t189Subt053419; Sun, 8 Feb 2015 09:28:56 GMT (envelope-from np@FreeBSD.org) Message-Id: <201502080928.t189Subt053419@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 8 Feb 2015 09:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278374 - in head/sys/dev/cxgbe: . iw_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.18-1 Precedence: list List-Id: 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, 08 Feb 2015 09:28:58 -0000 Author: np Date: Sun Feb 8 09:28:55 2015 New Revision: 278374 URL: https://svnweb.freebsd.org/changeset/base/278374 Log: cxgbe(4): tidy up some of the interaction between the Upper Layer Drivers (ULDs) and the base if_cxgbe driver. Track the per-adapter activation of ULDs in a new "active_ulds" field. This was done pretty arbitrarily before this change -- via TOM_INIT_DONE in adapter->flags for TOM, and the (1 << MAX_NPORTS) bit in adapter->offload_map for iWARP. iWARP and hw-accelerated iSCSI rely on the TOE (supported by the TOM ULD). The rules are: a) If the iWARP and/or iSCSI ULDs are available when TOE is enabled then iWARP and/or iSCSI are enabled too. b) When the iWARP and iSCSI modules are loaded they go looking for adapters with TOE enabled and enable themselves on that adapter. c) You cannot deactivate or unload the TOM module from underneath iWARP or iSCSI. Any such attempt will fail with EBUSY. MFC after: 2 weeks Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/iw_cxgbe/device.c head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sun Feb 8 09:25:06 2015 (r278373) +++ head/sys/dev/cxgbe/adapter.h Sun Feb 8 09:28:55 2015 (r278374) @@ -192,7 +192,7 @@ enum { /* INTR_DIRECT = (1 << 2), No longer used. */ MASTER_PF = (1 << 3), ADAP_SYSCTL_CTX = (1 << 4), - TOM_INIT_DONE = (1 << 5), + /* TOM_INIT_DONE= (1 << 5), No longer used */ BUF_PACKING_OK = (1 << 6), CXGBE_BUSY = (1 << 9), @@ -758,7 +758,8 @@ struct adapter { uint16_t doorbells; int open_device_map; #ifdef TCP_OFFLOAD - int offload_map; + int offload_map; /* ports with IFCAP_TOE enabled */ + int active_ulds; /* ULDs activated on this adapter */ #endif int flags; Modified: head/sys/dev/cxgbe/iw_cxgbe/device.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/device.c Sun Feb 8 09:25:06 2015 (r278373) +++ head/sys/dev/cxgbe/iw_cxgbe/device.c Sun Feb 8 09:28:55 2015 (r278374) @@ -213,7 +213,7 @@ c4iw_activate(struct adapter *sc) ASSERT_SYNCHRONIZED_OP(sc); - if (isset(&sc->offload_map, MAX_NPORTS)) { + if (uld_active(sc, ULD_IWARP)) { KASSERT(0, ("%s: RDMA already eanbled on sc %p", __func__, sc)); return (0); } @@ -265,9 +265,9 @@ c4iw_activate_all(struct adapter *sc, vo if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4iwact") != 0) return; - if (!isset(&sc->offload_map, MAX_NPORTS) && - t4_activate_uld(sc, ULD_IWARP) == 0) - setbit(&sc->offload_map, MAX_NPORTS); + /* Activate iWARP if any port on this adapter has IFCAP_TOE enabled. */ + if (sc->offload_map && !uld_active(sc, ULD_IWARP)) + (void) t4_activate_uld(sc, ULD_IWARP); end_synchronized_op(sc, 0); } @@ -279,9 +279,8 @@ c4iw_deactivate_all(struct adapter *sc, if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4iwdea") != 0) return; - if (isset(&sc->offload_map, MAX_NPORTS) && - t4_deactivate_uld(sc, ULD_IWARP) == 0) - clrbit(&sc->offload_map, MAX_NPORTS); + if (uld_active(sc, ULD_IWARP)) + (void) t4_deactivate_uld(sc, ULD_IWARP); end_synchronized_op(sc, 0); } Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Sun Feb 8 09:25:06 2015 (r278373) +++ head/sys/dev/cxgbe/offload.h Sun Feb 8 09:28:55 2015 (r278374) @@ -127,9 +127,10 @@ struct t4_virt_res { #ifdef TCP_OFFLOAD enum { - ULD_TOM = 1, - ULD_IWARP = 2, - ULD_ISCSI = 3, + ULD_TOM = 0, + ULD_IWARP, + ULD_ISCSI, + ULD_MAX = ULD_ISCSI }; struct adapter; @@ -156,5 +157,6 @@ int t4_unregister_uld(struct uld_info *) int t4_activate_uld(struct adapter *, int); int t4_deactivate_uld(struct adapter *, int); void t4_iscsi_init(struct ifnet *, unsigned int, const unsigned int *); +int uld_active(struct adapter *, int); #endif #endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Feb 8 09:25:06 2015 (r278373) +++ head/sys/dev/cxgbe/t4_main.c Sun Feb 8 09:28:55 2015 (r278374) @@ -7144,7 +7144,7 @@ set_filter_mode(struct adapter *sc, uint } #ifdef TCP_OFFLOAD - if (sc->offload_map) { + if (uld_active(sc, ULD_TOM)) { rc = EBUSY; goto done; } @@ -8236,7 +8236,7 @@ toe_capability(struct port_info *pi, int if (isset(&sc->offload_map, pi->port_id)) return (0); - if (!(sc->flags & TOM_INIT_DONE)) { + if (!uld_active(sc, ULD_TOM)) { rc = t4_activate_uld(sc, ULD_TOM); if (rc == EAGAIN) { log(LOG_WARNING, @@ -8247,16 +8247,22 @@ toe_capability(struct port_info *pi, int return (rc); KASSERT(sc->tom_softc != NULL, ("%s: TOM activated but softc NULL", __func__)); - KASSERT(sc->flags & TOM_INIT_DONE, + KASSERT(uld_active(sc, ULD_TOM), ("%s: TOM activated but flag not set", __func__)); } + /* Activate iWARP and iSCSI too, if the modules are loaded. */ + if (!uld_active(sc, ULD_IWARP)) + (void) t4_activate_uld(sc, ULD_IWARP); + if (!uld_active(sc, ULD_ISCSI)) + (void) t4_activate_uld(sc, ULD_ISCSI); + setbit(&sc->offload_map, pi->port_id); } else { if (!isset(&sc->offload_map, pi->port_id)) return (0); - KASSERT(sc->flags & TOM_INIT_DONE, + KASSERT(uld_active(sc, ULD_TOM), ("%s: TOM never initialized?", __func__)); clrbit(&sc->offload_map, pi->port_id); } @@ -8316,11 +8322,15 @@ done: int t4_activate_uld(struct adapter *sc, int id) { - int rc = EAGAIN; + int rc; struct uld_info *ui; ASSERT_SYNCHRONIZED_OP(sc); + if (id < 0 || id > ULD_MAX) + return (EINVAL); + rc = EAGAIN; /* kldoad the module with this ULD and try again. */ + sx_slock(&t4_uld_list_lock); SLIST_FOREACH(ui, &t4_uld_list, link) { @@ -8328,16 +8338,18 @@ t4_activate_uld(struct adapter *sc, int if (!(sc->flags & FULL_INIT_DONE)) { rc = adapter_full_init(sc); if (rc != 0) - goto done; + break; } rc = ui->activate(sc); - if (rc == 0) + if (rc == 0) { + setbit(&sc->active_ulds, id); ui->refcount++; - goto done; + } + break; } } -done: + sx_sunlock(&t4_uld_list_lock); return (rc); @@ -8346,26 +8358,41 @@ done: int t4_deactivate_uld(struct adapter *sc, int id) { - int rc = EINVAL; + int rc; struct uld_info *ui; ASSERT_SYNCHRONIZED_OP(sc); + if (id < 0 || id > ULD_MAX) + return (EINVAL); + rc = ENXIO; + sx_slock(&t4_uld_list_lock); SLIST_FOREACH(ui, &t4_uld_list, link) { if (ui->uld_id == id) { rc = ui->deactivate(sc); - if (rc == 0) + if (rc == 0) { + clrbit(&sc->active_ulds, id); ui->refcount--; - goto done; + } + break; } } -done: + sx_sunlock(&t4_uld_list_lock); return (rc); } + +int +uld_active(struct adapter *sc, int uld_id) +{ + + MPASS(uld_id >= 0 && uld_id <= ULD_MAX); + + return (isset(&sc->active_ulds, uld_id)); +} #endif /* Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Sun Feb 8 09:25:06 2015 (r278373) +++ head/sys/dev/cxgbe/tom/t4_listen.c Sun Feb 8 09:28:55 2015 (r278374) @@ -523,7 +523,7 @@ t4_listen_start(struct toedev *tod, stru goto done; } - KASSERT(sc->flags & TOM_INIT_DONE, + KASSERT(uld_active(sc, ULD_TOM), ("%s: TOM not initialized", __func__)); #endif Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Sun Feb 8 09:25:06 2015 (r278373) +++ head/sys/dev/cxgbe/tom/t4_tom.c Sun Feb 8 09:28:55 2015 (r278374) @@ -746,7 +746,7 @@ update_clip(struct adapter *sc, void *ar if (begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4tomuc")) return; - if (sc->flags & TOM_INIT_DONE) + if (uld_active(sc, ULD_TOM)) update_clip_table(sc, sc->tom_softc); end_synchronized_op(sc, LOCK_HELD); @@ -1025,7 +1025,6 @@ t4_tom_activate(struct adapter *sc) TOEDEV(sc->port[i]->ifp) = &td->tod; sc->tom_softc = td; - sc->flags |= TOM_INIT_DONE; register_toedev(sc->tom_softc); done: @@ -1048,6 +1047,9 @@ t4_tom_deactivate(struct adapter *sc) if (sc->offload_map != 0) return (EBUSY); /* at least one port has IFCAP_TOE enabled */ + if (uld_active(sc, ULD_IWARP) || uld_active(sc, ULD_ISCSI)) + return (EBUSY); /* both iWARP and iSCSI rely on the TOE. */ + mtx_lock(&td->toep_list_lock); if (!TAILQ_EMPTY(&td->toep_list)) rc = EBUSY; @@ -1068,7 +1070,6 @@ t4_tom_deactivate(struct adapter *sc) unregister_toedev(sc->tom_softc); free_tom_data(sc, td); sc->tom_softc = NULL; - sc->flags &= ~TOM_INIT_DONE; } return (rc); @@ -1122,7 +1123,7 @@ tom_uninit(struct adapter *sc, void *arg return; /* Try to free resources (works only if no port has IFCAP_TOE) */ - if (sc->flags & TOM_INIT_DONE) + if (uld_active(sc, ULD_TOM)) t4_deactivate_uld(sc, ULD_TOM); end_synchronized_op(sc, 0); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 10:58:27 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48E9CD2E; Sun, 8 Feb 2015 10:58: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34955AAD; Sun, 8 Feb 2015 10:58:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t18AwQld096228; Sun, 8 Feb 2015 10:58:26 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t18AwQnd096225; Sun, 8 Feb 2015 10:58:26 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201502081058.t18AwQnd096225@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 8 Feb 2015 10:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278378 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 10:58:27 -0000 Author: trasz Date: Sun Feb 8 10:58:25 2015 New Revision: 278378 URL: https://svnweb.freebsd.org/changeset/base/278378 Log: Make output of "iscsictl -v" and "ctladm islist -v" a little prettier by capitalizing "None". MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl_soft.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Sun Feb 8 10:17:20 2015 (r278377) +++ head/sys/dev/iscsi/icl.c Sun Feb 8 10:58:25 2015 (r278378) @@ -96,7 +96,7 @@ icl_find(const char *name) } TAILQ_FOREACH(im, &sc->sc_modules, im_next) { - if (strcmp(im->im_name, name) == 0) + if (strcasecmp(im->im_name, name) == 0) return (im); } Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Sun Feb 8 10:17:20 2015 (r278377) +++ head/sys/dev/iscsi/icl_soft.c Sun Feb 8 10:58:25 2015 (r278378) @@ -1183,7 +1183,7 @@ icl_soft_new_conn(const char *name, stru #endif ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH; ic->ic_name = name; - ic->ic_offload = "none"; + ic->ic_offload = "None"; return (ic); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 11:55:30 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAAB858A; Sun, 8 Feb 2015 11:55: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5D48F75; Sun, 8 Feb 2015 11:55:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t18BtUDB023862; Sun, 8 Feb 2015 11:55:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t18BtUKr023858; Sun, 8 Feb 2015 11:55:30 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201502081155.t18BtUKr023858@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 8 Feb 2015 11:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278379 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 11:55:31 -0000 Author: dchagin Date: Sun Feb 8 11:55:29 2015 New Revision: 278379 URL: https://svnweb.freebsd.org/changeset/base/278379 Log: Add Neoway WM620 module ID. MFC after: 1 Week Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sun Feb 8 10:58:25 2015 (r278378) +++ head/sys/dev/usb/serial/u3g.c Sun Feb 8 11:55:29 2015 (r278379) @@ -399,6 +399,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMM2, AC8700, 0), U3G_DEV(QUALCOMM2, MF330, 0), U3G_DEV(QUALCOMM2, SIM5218, 0), + U3G_DEV(QUALCOMM2, WM620, 0), U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMM2, GOBI2000_QDL, 0), U3G_DEV(QUALCOMM2, GOBI2000, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Feb 8 10:58:25 2015 (r278378) +++ head/sys/dev/usb/usbdevs Sun Feb 8 11:55:29 2015 (r278379) @@ -3577,6 +3577,7 @@ product QUALCOMM2 CDMA_MSM 0x3196 CDMA T product QUALCOMM2 AC8700 0x6000 AC8700 product QUALCOMM2 VW110L 0x1000 Vertex Wireless 110L modem product QUALCOMM2 SIM5218 0x9000 SIM5218 +product QUALCOMM2 WM620 0x9002 Neoway WM620 product QUALCOMM2 GOBI2000_QDL 0x9204 Qualcomm Gobi 2000 QDL product QUALCOMM2 GOBI2000 0x9205 Qualcomm Gobi 2000 modem product QUALCOMM2 VT80N 0x6500 Venus VT80N From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 16:50:02 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F487DB5; Sun, 8 Feb 2015 16:50: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D49EDD90; Sun, 8 Feb 2015 16:50:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t18Go1Li079149; Sun, 8 Feb 2015 16:50:01 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t18Go1W8079148; Sun, 8 Feb 2015 16:50:01 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502081650.t18Go1W8079148@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 8 Feb 2015 16:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278389 - 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.18-1 Precedence: list List-Id: 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, 08 Feb 2015 16:50:02 -0000 Author: nwhitehorn Date: Sun Feb 8 16:50:00 2015 New Revision: 278389 URL: https://svnweb.freebsd.org/changeset/base/278389 Log: Add some error checking on the supplied page size list. This makes sure that we (a) get the correct large page size to provide to pmap and (b) we can alert the user if running under incorrectly-configured PowerKVM on POWER7 and POWER8 systems. MFC after: 1 week Modified: head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Sun Feb 8 16:30:44 2015 (r278388) +++ head/sys/powerpc/pseries/mmu_phyp.c Sun Feb 8 16:50:00 2015 (r278389) @@ -102,6 +102,7 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t char buf[8]; uint32_t prop[2]; uint32_t nptlp, shift = 0, slb_encoding = 0; + uint32_t lp_size, lp_encoding; phandle_t dev, node, root; int idx, len, res; @@ -148,9 +149,9 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t * We have to use a variable length array on the stack * since we have very limited stack space. */ - cell_t arr[len/sizeof(cell_t)]; - res = OF_getprop(node, "ibm,segment-page-sizes", &arr, - sizeof(arr)); + pcell_t arr[len/sizeof(cell_t)]; + res = OF_getencprop(node, "ibm,segment-page-sizes", arr, + sizeof(arr)); len /= 4; idx = 0; while (len > 0) { @@ -160,18 +161,26 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t idx += 3; len -= 3; while (len > 0 && nptlp) { + lp_size = arr[idx]; + lp_encoding = arr[idx+1]; + if (slb_encoding == SLBV_L && lp_encoding == 0) + break; + idx += 2; len -= 2; nptlp--; } + if (nptlp && slb_encoding == SLBV_L && lp_encoding == 0) + break; } - /* For now we allow shift only to be <= 0x18. */ - if (shift >= 0x18) - shift = 0x18; + if (len == 0) + panic("Standard large pages (SLB[L] = 1, PTE[LP] = 0) " + "not supported by this system. Please enable huge " + "page backing if running under PowerKVM."); moea64_large_page_shift = shift; - moea64_large_page_size = 1ULL << shift; + moea64_large_page_size = 1ULL << lp_size; } moea64_mid_bootstrap(mmup, kernelstart, kernelend); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 16:51:38 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55ACAF02; Sun, 8 Feb 2015 16:51:38 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 10373E2B; Sun, 8 Feb 2015 16:51:37 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 1B5134979; Sun, 8 Feb 2015 16:51:31 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id E8F4EC49A; Sun, 8 Feb 2015 17:51:30 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bryan Drewery Subject: Re: lost change 272451 - CAP_EVENT for tcpdump (Re: svn commit: r276788 - in head: contrib/tcpdump contrib/tcpdump/lbl contrib/tcpdump/missing usr.sbin/tcpdump/tcpdump References: <54D3CE82.2050204@FreeBSD.org> <54D3D703.7020405@FreeBSD.org> Date: Sun, 08 Feb 2015 17:51:30 +0100 In-Reply-To: <54D3D703.7020405@FreeBSD.org> (Bryan Drewery's message of "Thu, 05 Feb 2015 14:48:03 -0600") Message-ID: <86wq3sfist.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Pedro Giffuni , Xin LI , "svn-src-head@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 16:51:38 -0000 Bryan Drewery writes: > The problem is that pf is implemented differently on FreeBSD and OpenBSD > for pid/uid tracking. The code would be overly complex to support both > and I gave up on that. Even getting it to work on FreeBSD required the > _KERNEL define hack for UID_MAX, which our pf uses to note 'no uid value'. First-class stupidity on POSIX's part which defines FOO_MAX for almost every single integer type but not for uid_t or gid_t. FreeBSD has them, but Linux doesn't, so I usually end up doing #ifndef UID_MAX #define UID_MAX ((uid_t)-1) #endif in cross-platform code. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 19:15:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78400755; Sun, 8 Feb 2015 19:15: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63232DFF; Sun, 8 Feb 2015 19:15:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t18JFGSP049963; Sun, 8 Feb 2015 19:15:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t18JFECa049956; Sun, 8 Feb 2015 19:15:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201502081915.t18JFECa049956@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 8 Feb 2015 19:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278397 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 19:15:16 -0000 Author: trasz Date: Sun Feb 8 19:15:14 2015 New Revision: 278397 URL: https://svnweb.freebsd.org/changeset/base/278397 Log: Extend ICL to add receive offload methods. For software ICL backend they are no-ops. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_frontend_iscsi.h head/sys/dev/iscsi/icl_conn_if.m head/sys/dev/iscsi/icl_soft.c head/sys/dev/iscsi/icl_wrappers.h head/sys/dev/iscsi/iscsi.c head/sys/dev/iscsi/iscsi.h Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Feb 8 19:12:38 2015 (r278396) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Feb 8 19:15:14 2015 (r278397) @@ -164,6 +164,12 @@ static void cfiscsi_pdu_handle_task_requ static void cfiscsi_pdu_handle_data_out(struct icl_pdu *request); static void cfiscsi_pdu_handle_logout_request(struct icl_pdu *request); static void cfiscsi_session_terminate(struct cfiscsi_session *cs); +static struct cfiscsi_data_wait *cfiscsi_data_wait_new( + struct cfiscsi_session *cs, union ctl_io *io, + uint32_t initiator_task_tag, + uint32_t *target_transfer_tagp); +static void cfiscsi_data_wait_free(struct cfiscsi_session *cs, + struct cfiscsi_data_wait *cdw); static struct cfiscsi_target *cfiscsi_target_find(struct cfiscsi_softc *softc, const char *name, uint16_t tag); static struct cfiscsi_target *cfiscsi_target_find_or_create( @@ -929,7 +935,7 @@ cfiscsi_pdu_handle_data_out(struct icl_p CFISCSI_SESSION_UNLOCK(cs); done = (io->scsiio.ext_data_filled != cdw->cdw_r2t_end || io->scsiio.ext_data_filled == io->scsiio.kern_data_len); - uma_zfree(cfiscsi_data_wait_zone, cdw); + cfiscsi_data_wait_free(cs, cdw); if (done) io->scsiio.be_move_done(io); else @@ -1067,6 +1073,45 @@ cfiscsi_callout(void *context) cfiscsi_pdu_queue(cp); } +static struct cfiscsi_data_wait * +cfiscsi_data_wait_new(struct cfiscsi_session *cs, union ctl_io *io, + uint32_t initiator_task_tag, uint32_t *target_transfer_tagp) +{ + struct cfiscsi_data_wait *cdw; + int error; + + cdw = uma_zalloc(cfiscsi_data_wait_zone, M_NOWAIT | M_ZERO); + if (cdw == NULL) { + CFISCSI_SESSION_WARN(cs, + "failed to allocate %zd bytes", sizeof(*cdw)); + return (NULL); + } + + error = icl_conn_transfer_setup(cs->cs_conn, io, target_transfer_tagp, + &cdw->cdw_icl_prv); + if (error != 0) { + CFISCSI_SESSION_WARN(cs, + "icl_conn_transfer_setup() failed with error %d", error); + uma_zfree(cfiscsi_data_wait_zone, cdw); + return (NULL); + } + + cdw->cdw_ctl_io = io; + cdw->cdw_target_transfer_tag = *target_transfer_tagp; + cdw->cdw_initiator_task_tag = initiator_task_tag; + + return (cdw); +} + +static void +cfiscsi_data_wait_free(struct cfiscsi_session *cs, + struct cfiscsi_data_wait *cdw) +{ + + icl_conn_transfer_done(cs->cs_conn, cdw->cdw_icl_prv); + uma_zfree(cfiscsi_data_wait_zone, cdw); +} + static void cfiscsi_session_terminate_tasks(struct cfiscsi_session *cs) { @@ -1106,7 +1151,7 @@ cfiscsi_session_terminate_tasks(struct c */ cdw->cdw_ctl_io->scsiio.io_hdr.port_status = 42; cdw->cdw_ctl_io->scsiio.be_move_done(cdw->cdw_ctl_io); - uma_zfree(cfiscsi_data_wait_zone, cdw); + cfiscsi_data_wait_free(cs, cdw); CFISCSI_SESSION_LOCK(cs); } CFISCSI_SESSION_UNLOCK(cs); @@ -2600,13 +2645,8 @@ cfiscsi_datamove_out(union ctl_io *io) target_transfer_tag = atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1); - -#if 0 - CFISCSI_SESSION_DEBUG(cs, "expecting Data-Out with initiator " - "task tag 0x%x, target transfer tag 0x%x", - bhssc->bhssc_initiator_task_tag, target_transfer_tag); -#endif - cdw = uma_zalloc(cfiscsi_data_wait_zone, M_NOWAIT | M_ZERO); + cdw = cfiscsi_data_wait_new(cs, io, bhssc->bhssc_initiator_task_tag, + &target_transfer_tag); if (cdw == NULL) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); @@ -2615,6 +2655,12 @@ cfiscsi_datamove_out(union ctl_io *io) cfiscsi_session_terminate(cs); return; } +#if 0 + CFISCSI_SESSION_DEBUG(cs, "expecting Data-Out with initiator " + "task tag 0x%x, target transfer tag 0x%x", + bhssc->bhssc_initiator_task_tag, target_transfer_tag); +#endif + cdw->cdw_ctl_io = io; cdw->cdw_target_transfer_tag = target_transfer_tag; cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; @@ -2651,7 +2697,7 @@ cfiscsi_datamove_out(union ctl_io *io) icl_pdu_data_segment_length(request)) { done = cfiscsi_handle_data_segment(request, cdw); if (done) { - uma_zfree(cfiscsi_data_wait_zone, cdw); + cfiscsi_data_wait_free(cs, cdw); io->scsiio.be_move_done(io); return; } @@ -2854,7 +2900,7 @@ cfiscsi_task_management_done(union ctl_i TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next); cdw->cdw_ctl_io->scsiio.be_move_done(cdw->cdw_ctl_io); - uma_zfree(cfiscsi_data_wait_zone, cdw); + cfiscsi_data_wait_free(cs, cdw); } CFISCSI_SESSION_UNLOCK(cs); } Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.h Sun Feb 8 19:12:38 2015 (r278396) +++ head/sys/cam/ctl/ctl_frontend_iscsi.h Sun Feb 8 19:15:14 2015 (r278397) @@ -59,6 +59,7 @@ struct cfiscsi_data_wait { size_t cdw_sg_len; uint32_t cdw_r2t_end; uint32_t cdw_datasn; + void *cdw_icl_prv; }; #define CFISCSI_SESSION_STATE_INVALID 0 Modified: head/sys/dev/iscsi/icl_conn_if.m ============================================================================== --- head/sys/dev/iscsi/icl_conn_if.m Sun Feb 8 19:12:38 2015 (r278396) +++ head/sys/dev/iscsi/icl_conn_if.m Sun Feb 8 19:15:14 2015 (r278397) @@ -85,3 +85,27 @@ METHOD void close { METHOD bool connected { struct icl_conn *_ic; }; + +METHOD int task_setup { + struct icl_conn *_ic; + struct ccb_scsiio *_csio; + uint32_t *_task_tag; + void **_prvp; +}; + +METHOD void task_done { + struct icl_conn *_ic; + void *_prv; +}; + +METHOD int transfer_setup { + struct icl_conn *_ic; + union ctl_io *_io; + uint32_t *_transfer_tag; + void **_prvp; +}; + +METHOD void transfer_done { + struct icl_conn *_ic; + void *_prv; +}; Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Sun Feb 8 19:12:38 2015 (r278396) +++ head/sys/dev/iscsi/icl_soft.c Sun Feb 8 19:15:14 2015 (r278397) @@ -98,6 +98,10 @@ static icl_conn_handoff_t icl_soft_conn_ static icl_conn_free_t icl_soft_conn_free; static icl_conn_close_t icl_soft_conn_close; static icl_conn_connected_t icl_soft_conn_connected; +static icl_conn_task_setup_t icl_soft_conn_task_setup; +static icl_conn_task_done_t icl_soft_conn_task_done; +static icl_conn_transfer_setup_t icl_soft_conn_transfer_setup; +static icl_conn_transfer_done_t icl_soft_conn_transfer_done; static kobj_method_t icl_soft_methods[] = { KOBJMETHOD(icl_conn_new_pdu, icl_soft_conn_new_pdu), @@ -111,6 +115,10 @@ static kobj_method_t icl_soft_methods[] KOBJMETHOD(icl_conn_free, icl_soft_conn_free), KOBJMETHOD(icl_conn_close, icl_soft_conn_close), KOBJMETHOD(icl_conn_connected, icl_soft_conn_connected), + KOBJMETHOD(icl_conn_task_setup, icl_soft_conn_task_setup), + KOBJMETHOD(icl_conn_task_done, icl_soft_conn_task_done), + KOBJMETHOD(icl_conn_transfer_setup, icl_soft_conn_transfer_setup), + KOBJMETHOD(icl_conn_transfer_done, icl_soft_conn_transfer_done), { 0, 0 } }; @@ -1435,6 +1443,32 @@ icl_soft_conn_connected(struct icl_conn return (true); } +int +icl_soft_conn_task_setup(struct icl_conn *ic, struct ccb_scsiio *csio, + uint32_t *task_tagp, void **prvp) +{ + + return (0); +} + +void +icl_soft_conn_task_done(struct icl_conn *ic, void *prv) +{ +} + +int +icl_soft_conn_transfer_setup(struct icl_conn *ic, union ctl_io *io, + uint32_t *transfer_tag, void **prvp) +{ + + return (0); +} + +void +icl_soft_conn_transfer_done(struct icl_conn *ic, void *prv) +{ +} + static int icl_soft_limits(size_t *limitp) { Modified: head/sys/dev/iscsi/icl_wrappers.h ============================================================================== --- head/sys/dev/iscsi/icl_wrappers.h Sun Feb 8 19:12:38 2015 (r278396) +++ head/sys/dev/iscsi/icl_wrappers.h Sun Feb 8 19:15:14 2015 (r278397) @@ -112,4 +112,34 @@ icl_conn_connected(struct icl_conn *ic) return (ICL_CONN_CONNECTED(ic)); } +static inline int +icl_conn_task_setup(struct icl_conn *ic, struct ccb_scsiio *csio, + uint32_t *task_tagp, void **prvp) +{ + + return (ICL_CONN_TASK_SETUP(ic, csio, task_tagp, prvp)); +} + +static inline void +icl_conn_task_done(struct icl_conn *ic, void *prv) +{ + + ICL_CONN_TASK_DONE(ic, prv); +} + +static inline int +icl_conn_transfer_setup(struct icl_conn *ic, union ctl_io *io, + uint32_t *transfer_tagp, void **prvp) +{ + + return (ICL_CONN_TRANSFER_SETUP(ic, io, transfer_tagp, prvp)); +} + +static inline void +icl_conn_transfer_done(struct icl_conn *ic, void *prv) +{ + + ICL_CONN_TRANSFER_DONE(ic, prv); +} + #endif /* !ICL_WRAPPERS_H */ Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sun Feb 8 19:12:38 2015 (r278396) +++ head/sys/dev/iscsi/iscsi.c Sun Feb 8 19:15:14 2015 (r278397) @@ -169,7 +169,7 @@ static void iscsi_poll(struct cam_sim *s static struct iscsi_outstanding *iscsi_outstanding_find(struct iscsi_session *is, uint32_t initiator_task_tag); static struct iscsi_outstanding *iscsi_outstanding_add(struct iscsi_session *is, - uint32_t initiator_task_tag, union ccb *ccb); + union ccb *ccb, uint32_t *initiator_task_tagp); static void iscsi_outstanding_remove(struct iscsi_session *is, struct iscsi_outstanding *io); @@ -1993,21 +1993,33 @@ iscsi_outstanding_find_ccb(struct iscsi_ static struct iscsi_outstanding * iscsi_outstanding_add(struct iscsi_session *is, - uint32_t initiator_task_tag, union ccb *ccb) + union ccb *ccb, uint32_t *initiator_task_tagp) { struct iscsi_outstanding *io; + int error; ISCSI_SESSION_LOCK_ASSERT(is); - KASSERT(iscsi_outstanding_find(is, initiator_task_tag) == NULL, - ("initiator_task_tag 0x%x already added", initiator_task_tag)); - io = uma_zalloc(iscsi_outstanding_zone, M_NOWAIT | M_ZERO); if (io == NULL) { - ISCSI_SESSION_WARN(is, "failed to allocate %zd bytes", sizeof(*io)); + ISCSI_SESSION_WARN(is, "failed to allocate %zd bytes", + sizeof(*io)); + return (NULL); + } + + error = icl_conn_task_setup(is->is_conn, &ccb->csio, + initiator_task_tagp, &io->io_icl_prv); + if (error != 0) { + ISCSI_SESSION_WARN(is, + "icl_conn_task_setup() failed with error %d", error); + uma_zfree(iscsi_outstanding_zone, io); return (NULL); } - io->io_initiator_task_tag = initiator_task_tag; + + KASSERT(iscsi_outstanding_find(is, *initiator_task_tagp) == NULL, + ("initiator_task_tag 0x%x already added", *initiator_task_tagp)); + + io->io_initiator_task_tag = *initiator_task_tagp; io->io_ccb = ccb; TAILQ_INSERT_TAIL(&is->is_outstanding, io, io_next); return (io); @@ -2019,6 +2031,7 @@ iscsi_outstanding_remove(struct iscsi_se ISCSI_SESSION_LOCK_ASSERT(is); + icl_conn_task_done(is->is_conn, io->io_icl_prv); TAILQ_REMOVE(&is->is_outstanding, io, io_next); uma_zfree(iscsi_outstanding_zone, io); } @@ -2030,6 +2043,7 @@ iscsi_action_abort(struct iscsi_session struct iscsi_bhs_task_management_request *bhstmr; struct ccb_abort *cab = &ccb->cab; struct iscsi_outstanding *io, *aio; + uint32_t initiator_task_tag; ISCSI_SESSION_LOCK_ASSERT(is); @@ -2057,16 +2071,9 @@ iscsi_action_abort(struct iscsi_session return; } - bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; - bhstmr->bhstmr_opcode = ISCSI_BHS_OPCODE_TASK_REQUEST; - bhstmr->bhstmr_function = 0x80 | BHSTMR_FUNCTION_ABORT_TASK; - - bhstmr->bhstmr_lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); - bhstmr->bhstmr_initiator_task_tag = is->is_initiator_task_tag; - is->is_initiator_task_tag++; - bhstmr->bhstmr_referenced_task_tag = aio->io_initiator_task_tag; + initiator_task_tag = is->is_initiator_task_tag++; - io = iscsi_outstanding_add(is, bhstmr->bhstmr_initiator_task_tag, NULL); + io = iscsi_outstanding_add(is, NULL, &initiator_task_tag); if (io == NULL) { icl_pdu_free(request); ccb->ccb_h.status = CAM_RESRC_UNAVAIL; @@ -2074,6 +2081,14 @@ iscsi_action_abort(struct iscsi_session return; } io->io_datasn = aio->io_initiator_task_tag; + + bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; + bhstmr->bhstmr_opcode = ISCSI_BHS_OPCODE_TASK_REQUEST; + bhstmr->bhstmr_function = 0x80 | BHSTMR_FUNCTION_ABORT_TASK; + bhstmr->bhstmr_lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); + bhstmr->bhstmr_initiator_task_tag = initiator_task_tag; + bhstmr->bhstmr_referenced_task_tag = aio->io_initiator_task_tag; + iscsi_pdu_queue_locked(request); } @@ -2085,6 +2100,7 @@ iscsi_action_scsiio(struct iscsi_session struct ccb_scsiio *csio; struct iscsi_outstanding *io; size_t len; + uint32_t initiator_task_tag; int error; ISCSI_SESSION_LOCK_ASSERT(is); @@ -2115,6 +2131,19 @@ iscsi_action_scsiio(struct iscsi_session return; } + initiator_task_tag = is->is_initiator_task_tag++; + io = iscsi_outstanding_add(is, ccb, &initiator_task_tag); + if (io == NULL) { + icl_pdu_free(request); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); + ISCSI_SESSION_DEBUG(is, "freezing devq"); + } + ccb->ccb_h.status = CAM_RESRC_UNAVAIL | CAM_DEV_QFRZN; + xpt_done(ccb); + return; + } + csio = &ccb->csio; bhssc = (struct iscsi_bhs_scsi_command *)request->ip_bhs; bhssc->bhssc_opcode = ISCSI_BHS_OPCODE_SCSI_COMMAND; @@ -2148,8 +2177,7 @@ iscsi_action_scsiio(struct iscsi_session bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_UNTAGGED; bhssc->bhssc_lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); - bhssc->bhssc_initiator_task_tag = is->is_initiator_task_tag; - is->is_initiator_task_tag++; + bhssc->bhssc_initiator_task_tag = initiator_task_tag; bhssc->bhssc_expected_data_transfer_length = htonl(csio->dxfer_len); KASSERT(csio->cdb_len <= sizeof(bhssc->bhssc_cdb), ("unsupported CDB size %zd", (size_t)csio->cdb_len)); @@ -2159,18 +2187,6 @@ iscsi_action_scsiio(struct iscsi_session else memcpy(&bhssc->bhssc_cdb, csio->cdb_io.cdb_bytes, csio->cdb_len); - io = iscsi_outstanding_add(is, bhssc->bhssc_initiator_task_tag, ccb); - if (io == NULL) { - icl_pdu_free(request); - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(ccb->ccb_h.path, 1); - ISCSI_SESSION_DEBUG(is, "freezing devq"); - } - ccb->ccb_h.status = CAM_RESRC_UNAVAIL | CAM_DEV_QFRZN; - xpt_done(ccb); - return; - } - if (is->is_immediate_data && (csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) { len = csio->dxfer_len; Modified: head/sys/dev/iscsi/iscsi.h ============================================================================== --- head/sys/dev/iscsi/iscsi.h Sun Feb 8 19:12:38 2015 (r278396) +++ head/sys/dev/iscsi/iscsi.h Sun Feb 8 19:15:14 2015 (r278397) @@ -45,6 +45,7 @@ struct iscsi_outstanding { size_t io_received; uint32_t io_initiator_task_tag; uint32_t io_datasn; + void *io_icl_prv; }; struct iscsi_session { From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 19:18:24 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FE5AA3B; Sun, 8 Feb 2015 19:18: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 806A7E2A; Sun, 8 Feb 2015 19:18:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t18JIOIq050579; Sun, 8 Feb 2015 19:18:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t18JIODf050578; Sun, 8 Feb 2015 19:18:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201502081918.t18JIODf050578@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 8 Feb 2015 19:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278398 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 19:18:24 -0000 Author: trasz Date: Sun Feb 8 19:18:23 2015 New Revision: 278398 URL: https://svnweb.freebsd.org/changeset/base/278398 Log: Fix ordering of "*logout" and "*terminate"; no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Feb 8 19:15:14 2015 (r278397) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Feb 8 19:18:23 2015 (r278398) @@ -1702,41 +1702,40 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) } static void -cfiscsi_ioctl_terminate(struct ctl_iscsi *ci) +cfiscsi_ioctl_logout(struct ctl_iscsi *ci) { struct icl_pdu *response; struct iscsi_bhs_asynchronous_message *bhsam; - struct ctl_iscsi_terminate_params *citp; + struct ctl_iscsi_logout_params *cilp; struct cfiscsi_session *cs; struct cfiscsi_softc *softc; int found = 0; - citp = (struct ctl_iscsi_terminate_params *)&(ci->data); + cilp = (struct ctl_iscsi_logout_params *)&(ci->data); softc = &cfiscsi_softc; mtx_lock(&softc->lock); TAILQ_FOREACH(cs, &softc->sessions, cs_next) { - if (citp->all == 0 && cs->cs_id != citp->connection_id && - strcmp(cs->cs_initiator_name, citp->initiator_name) != 0 && - strcmp(cs->cs_initiator_addr, citp->initiator_addr) != 0) + if (cilp->all == 0 && cs->cs_id != cilp->connection_id && + strcmp(cs->cs_initiator_name, cilp->initiator_name) != 0 && + strcmp(cs->cs_initiator_addr, cilp->initiator_addr) != 0) continue; response = icl_pdu_new(cs->cs_conn, M_NOWAIT); if (response == NULL) { - /* - * Oh well. Just terminate the connection. - */ - } else { - bhsam = (struct iscsi_bhs_asynchronous_message *) - response->ip_bhs; - bhsam->bhsam_opcode = ISCSI_BHS_OPCODE_ASYNC_MESSAGE; - bhsam->bhsam_flags = 0x80; - bhsam->bhsam_0xffffffff = 0xffffffff; - bhsam->bhsam_async_event = - BHSAM_EVENT_TARGET_TERMINATES_SESSION; - cfiscsi_pdu_queue(response); + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "Unable to allocate memory"); + mtx_unlock(&softc->lock); + return; } - cfiscsi_session_terminate(cs); + bhsam = + (struct iscsi_bhs_asynchronous_message *)response->ip_bhs; + bhsam->bhsam_opcode = ISCSI_BHS_OPCODE_ASYNC_MESSAGE; + bhsam->bhsam_flags = 0x80; + bhsam->bhsam_async_event = BHSAM_EVENT_TARGET_REQUESTS_LOGOUT; + bhsam->bhsam_parameter3 = htons(10); + cfiscsi_pdu_queue(response); found++; } mtx_unlock(&softc->lock); @@ -1752,40 +1751,41 @@ cfiscsi_ioctl_terminate(struct ctl_iscsi } static void -cfiscsi_ioctl_logout(struct ctl_iscsi *ci) +cfiscsi_ioctl_terminate(struct ctl_iscsi *ci) { struct icl_pdu *response; struct iscsi_bhs_asynchronous_message *bhsam; - struct ctl_iscsi_logout_params *cilp; + struct ctl_iscsi_terminate_params *citp; struct cfiscsi_session *cs; struct cfiscsi_softc *softc; int found = 0; - cilp = (struct ctl_iscsi_logout_params *)&(ci->data); + citp = (struct ctl_iscsi_terminate_params *)&(ci->data); softc = &cfiscsi_softc; mtx_lock(&softc->lock); TAILQ_FOREACH(cs, &softc->sessions, cs_next) { - if (cilp->all == 0 && cs->cs_id != cilp->connection_id && - strcmp(cs->cs_initiator_name, cilp->initiator_name) != 0 && - strcmp(cs->cs_initiator_addr, cilp->initiator_addr) != 0) + if (citp->all == 0 && cs->cs_id != citp->connection_id && + strcmp(cs->cs_initiator_name, citp->initiator_name) != 0 && + strcmp(cs->cs_initiator_addr, citp->initiator_addr) != 0) continue; response = icl_pdu_new(cs->cs_conn, M_NOWAIT); if (response == NULL) { - ci->status = CTL_ISCSI_ERROR; - snprintf(ci->error_str, sizeof(ci->error_str), - "Unable to allocate memory"); - mtx_unlock(&softc->lock); - return; + /* + * Oh well. Just terminate the connection. + */ + } else { + bhsam = (struct iscsi_bhs_asynchronous_message *) + response->ip_bhs; + bhsam->bhsam_opcode = ISCSI_BHS_OPCODE_ASYNC_MESSAGE; + bhsam->bhsam_flags = 0x80; + bhsam->bhsam_0xffffffff = 0xffffffff; + bhsam->bhsam_async_event = + BHSAM_EVENT_TARGET_TERMINATES_SESSION; + cfiscsi_pdu_queue(response); } - bhsam = - (struct iscsi_bhs_asynchronous_message *)response->ip_bhs; - bhsam->bhsam_opcode = ISCSI_BHS_OPCODE_ASYNC_MESSAGE; - bhsam->bhsam_flags = 0x80; - bhsam->bhsam_async_event = BHSAM_EVENT_TARGET_REQUESTS_LOGOUT; - bhsam->bhsam_parameter3 = htons(10); - cfiscsi_pdu_queue(response); + cfiscsi_session_terminate(cs); found++; } mtx_unlock(&softc->lock); @@ -2241,12 +2241,12 @@ cfiscsi_ioctl(struct cdev *dev, case CTL_ISCSI_LIST: cfiscsi_ioctl_list(ci); break; - case CTL_ISCSI_TERMINATE: - cfiscsi_ioctl_terminate(ci); - break; case CTL_ISCSI_LOGOUT: cfiscsi_ioctl_logout(ci); break; + case CTL_ISCSI_TERMINATE: + cfiscsi_ioctl_terminate(ci); + break; case CTL_ISCSI_LIMITS: cfiscsi_ioctl_limits(ci); break; From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 21:00:53 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0ECA3AC3; Sun, 8 Feb 2015 21:00: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF111AFF; Sun, 8 Feb 2015 21:00:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t18L0qU7001959; Sun, 8 Feb 2015 21:00:52 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t18L0qSP001958; Sun, 8 Feb 2015 21:00:52 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201502082100.t18L0qSP001958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 8 Feb 2015 21:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278402 - 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.18-1 Precedence: list List-Id: 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, 08 Feb 2015 21:00:53 -0000 Author: alc Date: Sun Feb 8 21:00:51 2015 New Revision: 278402 URL: https://svnweb.freebsd.org/changeset/base/278402 Log: Preset the object's color, or alignment, to maximize superpage usage. MFC after: 5 days Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Feb 8 20:48:17 2015 (r278401) +++ head/sys/kern/uipc_shm.c Sun Feb 8 21:00:51 2015 (r278402) @@ -531,9 +531,10 @@ shm_alloc(struct ucred *ucred, mode_t mo shmfd->shm_object = vm_pager_allocate(OBJT_DEFAULT, NULL, shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred); KASSERT(shmfd->shm_object != NULL, ("shm_create: vm_pager_allocate")); + shmfd->shm_object->pg_color = 0; VM_OBJECT_WLOCK(shmfd->shm_object); vm_object_clear_flag(shmfd->shm_object, OBJ_ONEMAPPING); - vm_object_set_flag(shmfd->shm_object, OBJ_NOSPLIT); + vm_object_set_flag(shmfd->shm_object, OBJ_COLORED | OBJ_NOSPLIT); VM_OBJECT_WUNLOCK(shmfd->shm_object); vfs_timestamp(&shmfd->shm_birthtime); shmfd->shm_atime = shmfd->shm_mtime = shmfd->shm_ctime = From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 22:24:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21D3FF21; Sun, 8 Feb 2015 22:24: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DD49373; Sun, 8 Feb 2015 22:24:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t18MOIkR042245; Sun, 8 Feb 2015 22:24:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t18MOICZ042244; Sun, 8 Feb 2015 22:24:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201502082224.t18MOICZ042244@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 8 Feb 2015 22:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278414 - head/lib/libedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 22:24:19 -0000 Author: bapt Date: Sun Feb 8 22:24:18 2015 New Revision: 278414 URL: https://svnweb.freebsd.org/changeset/base/278414 Log: Reapply r255891 Modified: head/lib/libedit/readline.c Modified: head/lib/libedit/readline.c ============================================================================== --- head/lib/libedit/readline.c Sun Feb 8 22:24:03 2015 (r278413) +++ head/lib/libedit/readline.c Sun Feb 8 22:24:18 2015 (r278414) @@ -395,6 +395,9 @@ readline(const char *p) char *buf; static int used_event_hook; + if (line == NULL) + return 0; + if (e == NULL || h == NULL) rl_initialize(); From owner-svn-src-head@FreeBSD.ORG Sun Feb 8 23:03:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDB2E608; Sun, 8 Feb 2015 23:03: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BCEA9A3; Sun, 8 Feb 2015 23:03:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t18N3gj5062332; Sun, 8 Feb 2015 23:03:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t18N3ggX062331; Sun, 8 Feb 2015 23:03:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201502082303.t18N3ggX062331@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 8 Feb 2015 23:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278422 - head/lib/libedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 08 Feb 2015 23:03:42 -0000 Author: bapt Date: Sun Feb 8 23:03:41 2015 New Revision: 278422 URL: https://svnweb.freebsd.org/changeset/base/278422 Log: revert r278414 Reported by: bz Modified: head/lib/libedit/readline.c Modified: head/lib/libedit/readline.c ============================================================================== --- head/lib/libedit/readline.c Sun Feb 8 22:47:34 2015 (r278421) +++ head/lib/libedit/readline.c Sun Feb 8 23:03:41 2015 (r278422) @@ -395,9 +395,6 @@ readline(const char *p) char *buf; static int used_event_hook; - if (line == NULL) - return 0; - if (e == NULL || h == NULL) rl_initialize(); From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 02:12:39 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3843D55; Mon, 9 Feb 2015 02:12: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF6E2E9; Mon, 9 Feb 2015 02:12:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t192CdUi051295; Mon, 9 Feb 2015 02:12:39 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t192CdkD051294; Mon, 9 Feb 2015 02:12:39 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502090212.t192CdkD051294@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 9 Feb 2015 02:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278427 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 02:12:39 -0000 Author: nwhitehorn Date: Mon Feb 9 02:12:38 2015 New Revision: 278427 URL: https://svnweb.freebsd.org/changeset/base/278427 Log: Simplify trapcode setup by placing a copy of the generic trap handler at every possible trap address by default. This also makes sure the kernel notices (and panics at) traps from newer CPUs that the kernel was not expecting rather than executing gibberish memory. Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Mon Feb 9 01:45:06 2015 (r278426) +++ head/sys/powerpc/aim/machdep.c Mon Feb 9 02:12:38 2015 (r278427) @@ -256,6 +256,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ vm_offset_t startkernel, endkernel; void *generictrap; size_t trap_offset, trapsize; + vm_offset_t trap; void *kmdp; char *env; register_t msr, scratch; @@ -481,20 +482,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_ #endif /* - * Copy a code snippet to restore 32-bit bridge mode - * to the top of every non-generic trap handler - */ - - trap_offset += (size_t)&restorebridgesize; - bcopy(&restorebridge, (void *)EXC_RST, trap_offset); - bcopy(&restorebridge, (void *)EXC_DSI, trap_offset); - bcopy(&restorebridge, (void *)EXC_ALI, trap_offset); - bcopy(&restorebridge, (void *)EXC_PGM, trap_offset); - bcopy(&restorebridge, (void *)EXC_MCHK, trap_offset); - bcopy(&restorebridge, (void *)EXC_TRC, trap_offset); - bcopy(&restorebridge, (void *)EXC_BPT, trap_offset); - - /* * Set the common trap entry point to the one that * knows to restore 32-bit operation on execution. */ @@ -507,14 +494,35 @@ powerpc_init(vm_offset_t fdt, vm_offset_ #else /* powerpc64 */ cpu_features |= PPC_FEATURE_64; generictrap = &trapcode; - - /* Set TOC base so that the interrupt code can get at it */ - *((void **)TRAP_GENTRAP) = &trapcode2; - *((register_t *)TRAP_TOCBASE) = toc; #endif trapsize = (size_t)&trapcodeend - (size_t)&trapcode; + /* + * Copy generic handler into every possible trap. Special cases will get + * different ones in a minute. + */ + for (trap = EXC_RST; trap < EXC_LAST; trap += 0x20) + bcopy(generictrap, (void *)trap, trapsize); + + #ifndef __powerpc64__ + if (cpu_features & PPC_FEATURE_64) { + /* + * Copy a code snippet to restore 32-bit bridge mode + * to the top of every non-generic trap handler + */ + + trap_offset += (size_t)&restorebridgesize; + bcopy(&restorebridge, (void *)EXC_RST, trap_offset); + bcopy(&restorebridge, (void *)EXC_DSI, trap_offset); + bcopy(&restorebridge, (void *)EXC_ALI, trap_offset); + bcopy(&restorebridge, (void *)EXC_PGM, trap_offset); + bcopy(&restorebridge, (void *)EXC_MCHK, trap_offset); + bcopy(&restorebridge, (void *)EXC_TRC, trap_offset); + bcopy(&restorebridge, (void *)EXC_BPT, trap_offset); + } + #endif + bcopy(&rstcode, (void *)(EXC_RST + trap_offset), (size_t)&rstcodeend - (size_t)&rstcode); @@ -527,31 +535,20 @@ powerpc_init(vm_offset_t fdt, vm_offset_ (size_t)&dblow); bcopy(&dblow, (void *)(EXC_BPT + trap_offset), (size_t)&dbend - (size_t)&dblow); -#else - bcopy(generictrap, (void *)EXC_MCHK, trapsize); - bcopy(generictrap, (void *)EXC_PGM, trapsize); - bcopy(generictrap, (void *)EXC_TRC, trapsize); - bcopy(generictrap, (void *)EXC_BPT, trapsize); #endif bcopy(&alitrap, (void *)(EXC_ALI + trap_offset), (size_t)&aliend - (size_t)&alitrap); bcopy(&dsitrap, (void *)(EXC_DSI + trap_offset), (size_t)&dsiend - (size_t)&dsitrap); - bcopy(generictrap, (void *)EXC_ISI, trapsize); + #ifdef __powerpc64__ + /* Set TOC base so that the interrupt code can get at it */ + *((void **)TRAP_GENTRAP) = &trapcode2; + *((register_t *)TRAP_TOCBASE) = toc; + bcopy(&slbtrap, (void *)EXC_DSE,(size_t)&slbtrapend - (size_t)&slbtrap); bcopy(&slbtrap, (void *)EXC_ISE,(size_t)&slbtrapend - (size_t)&slbtrap); - #endif - bcopy(generictrap, (void *)EXC_EXI, trapsize); - bcopy(generictrap, (void *)EXC_FPU, trapsize); - bcopy(generictrap, (void *)EXC_DECR, trapsize); - bcopy(generictrap, (void *)EXC_SC, trapsize); - bcopy(generictrap, (void *)EXC_FPA, trapsize); - bcopy(generictrap, (void *)EXC_VEC, trapsize); - bcopy(generictrap, (void *)EXC_PERF, trapsize); - bcopy(generictrap, (void *)EXC_VECAST_G4, trapsize); - bcopy(generictrap, (void *)EXC_VECAST_G5, trapsize); - #ifndef __powerpc64__ + #else /* G2-specific TLB miss helper handlers */ bcopy(&imisstrap, (void *)EXC_IMISS, (size_t)&imisssize); bcopy(&dlmisstrap, (void *)EXC_DLMISS, (size_t)&dlmisssize); From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 02:13:37 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BC08E93; Mon, 9 Feb 2015 02:13: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2F30F2; Mon, 9 Feb 2015 02:13:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t192DaUN051520; Mon, 9 Feb 2015 02:13:36 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t192DaRM051519; Mon, 9 Feb 2015 02:13:36 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502090213.t192DaRM051519@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 9 Feb 2015 02:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278428 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 02:13:37 -0000 Author: nwhitehorn Date: Mon Feb 9 02:13:36 2015 New Revision: 278428 URL: https://svnweb.freebsd.org/changeset/base/278428 Log: Technically speaking, using one virtal processor area for all CPUs is a violation of the spec. Make duplicate entries for each CPU. Modified: head/sys/powerpc/pseries/platform_chrp.c Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Mon Feb 9 02:12:38 2015 (r278427) +++ head/sys/powerpc/pseries/platform_chrp.c Mon Feb 9 02:13:36 2015 (r278428) @@ -58,7 +58,7 @@ extern void *ap_pcpu; #endif #ifdef __powerpc64__ -static uint8_t splpar_vpa[640] __aligned(64); +static uint8_t splpar_vpa[MAXCPU][640] __aligned(128); /* XXX: dpcpu */ #endif static vm_offset_t realmaxaddr = VM_MAX_ADDRESS; @@ -124,6 +124,8 @@ chrp_probe(platform_t plat) static int chrp_attach(platform_t plat) { + int i; + #ifdef __powerpc64__ /* XXX: check for /rtas/ibm,hypertas-functions? */ if (!(mfmsr() & PSL_HV)) { @@ -136,14 +138,19 @@ chrp_attach(platform_t plat) cpu_idle_hook = phyp_cpu_idle; /* Set up important VPA fields */ - bzero(splpar_vpa, sizeof(splpar_vpa)); - splpar_vpa[4] = (uint8_t)((sizeof(splpar_vpa) >> 8) & 0xff); - splpar_vpa[5] = (uint8_t)(sizeof(splpar_vpa) & 0xff); - splpar_vpa[0xba] = 1; /* Maintain FPRs */ - splpar_vpa[0xbb] = 1; /* Maintain PMCs */ - splpar_vpa[0xfc] = 0xff; /* Maintain full SLB */ - splpar_vpa[0xfd] = 0xff; - splpar_vpa[0xff] = 1; /* Maintain Altivec */ + for (i = 0; i < MAXCPU; i++) { + bzero(splpar_vpa[i], sizeof(splpar_vpa)); + /* First two: VPA size */ + splpar_vpa[i][4] = + (uint8_t)((sizeof(splpar_vpa[i]) >> 8) & 0xff); + splpar_vpa[i][5] = + (uint8_t)(sizeof(splpar_vpa[i]) & 0xff); + splpar_vpa[i][0xba] = 1; /* Maintain FPRs */ + splpar_vpa[i][0xbb] = 1; /* Maintain PMCs */ + splpar_vpa[i][0xfc] = 0xff; /* Maintain full SLB */ + splpar_vpa[i][0xfd] = 0xff; + splpar_vpa[i][0xff] = 1; /* Maintain Altivec */ + } mb(); /* Set up hypervisor CPU stuff */ @@ -492,11 +499,12 @@ static void chrp_smp_ap_init(platform_t platform) { if (!(mfmsr() & PSL_HV)) { + /* Register VPA */ + phyp_hcall(H_REGISTER_VPA, 1UL, PCPU_GET(cpuid), + splpar_vpa[PCPU_GET(cpuid)]); + /* Set interrupt priority */ phyp_hcall(H_CPPR, 0xff); - - /* Register VPA */ - phyp_hcall(H_REGISTER_VPA, 1UL, PCPU_GET(cpuid), splpar_vpa); } } #else From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 02:17:22 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBE7216A; Mon, 9 Feb 2015 02:17: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF0E3110; Mon, 9 Feb 2015 02:17:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t192HMur052162; Mon, 9 Feb 2015 02:17:22 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t192HMn9052161; Mon, 9 Feb 2015 02:17:22 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502090217.t192HMn9052161@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 9 Feb 2015 02:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278429 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 02:17:23 -0000 Author: nwhitehorn Date: Mon Feb 9 02:17:21 2015 New Revision: 278429 URL: https://svnweb.freebsd.org/changeset/base/278429 Log: Fix an extremely subtle concurrency bug triggered by running on 32-thread POWER8 systems. During thread switch, there was a very small window when the stack pointer was set to the stack pointer of the outgoing thread, but after the lock on that thread had already been released. If, during that window, the outgoing thread were rescheduled on another CPU and begin execution and an exception were taken on the original CPU, the trap handler and the outgoing thread would simultaneously execute on the same stack, causing memory corruption. Fix this by making sure to release the old thread only after cpu_switch() is done with its stack. MFC after: 2 weeks Sponsored by: FreeBSD Foundation Modified: head/sys/powerpc/powerpc/swtch64.S Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Mon Feb 9 02:13:36 2015 (r278428) +++ head/sys/powerpc/powerpc/swtch64.S Mon Feb 9 02:17:21 2015 (r278429) @@ -72,6 +72,8 @@ TOC_ENTRY(blocked_lock) */ ENTRY(cpu_throw) mr %r13, %r4 + li %r14,0 /* Tell cpu_switchin not to release a thread */ + b cpu_switchin /* @@ -139,10 +141,7 @@ ENTRY(cpu_switch) bl pmap_deactivate /* Deactivate the current pmap */ nop - addi %r1,%r1,48 - sync /* Make sure all of that finished */ - std %r16,TD_LOCK(%r14) /* ULE: update old thread's lock */ cpu_switchin: #if defined(SMP) && defined(SCHED_ULE) @@ -154,14 +153,20 @@ blocked_loop: beq- blocked_loop isync #endif + + ld %r17,TD_PCB(%r13) /* Get new PCB */ + ld %r1,PCB_SP(%r17) /* Load the stack pointer */ - mfsprg %r7,0 /* Get the pcpu pointer */ + /* Release old thread now that we have a stack pointer set up */ + cmpdi %r14,0 + beq- 1f + std %r16,TD_LOCK(%r14) /* ULE: update old thread's lock */ + +1: mfsprg %r7,0 /* Get the pcpu pointer */ std %r13,PC_CURTHREAD(%r7) /* Store new current thread */ ld %r17,TD_PCB(%r13) /* Store new current PCB */ std %r17,PC_CURPCB(%r7) - stdu %r1,-48(%r1) - mr %r3,%r13 /* Get new thread ptr */ bl pmap_activate /* Activate the new address space */ nop From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 02:27:35 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 078A950F; Mon, 9 Feb 2015 02:27: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E77CA1F0; Mon, 9 Feb 2015 02:27:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t192RY0m057153; Mon, 9 Feb 2015 02:27:34 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t192RYXZ057149; Mon, 9 Feb 2015 02:27:34 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201502090227.t192RYXZ057149@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 9 Feb 2015 02:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278430 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 02:27:35 -0000 Author: gonzo Date: Mon Feb 9 02:27:33 2015 New Revision: 278430 URL: https://svnweb.freebsd.org/changeset/base/278430 Log: Remove unused variables Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Mon Feb 9 02:17:21 2015 (r278429) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Mon Feb 9 02:27:33 2015 (r278430) @@ -252,7 +252,6 @@ VCHIQ_STATUS_T vchiq_prepare_bulk_data(VCHIQ_BULK_T *bulk, VCHI_MEM_HANDLE_T memhandle, void *offset, int size, int dir) { - PAGELIST_T *pagelist; BULKINFO_T *bi; int ret; @@ -518,7 +517,6 @@ free_pagelist(BULKINFO_T *bi, int actual { vm_page_t*pages; unsigned int num_pages, i; - void *page_address; PAGELIST_T *pagelist; pagelist = bi->pagelist; Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Mon Feb 9 02:17:21 2015 (r278429) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Mon Feb 9 02:27:33 2015 (r278430) @@ -2387,7 +2387,6 @@ vchiq_release_internal(VCHIQ_STATE_T *st VCHIQ_STATUS_T ret = VCHIQ_SUCCESS; char entity[16]; int *entity_uc; - int local_uc, local_entity_uc; if (!arm_state) goto out; From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 02:31:28 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7558C7AF; Mon, 9 Feb 2015 02:31: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 614722B6; Mon, 9 Feb 2015 02:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t192VSFs060752; Mon, 9 Feb 2015 02:31:28 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t192VS6C060751; Mon, 9 Feb 2015 02:31:28 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201502090231.t192VS6C060751@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 9 Feb 2015 02:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278431 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 02:31:28 -0000 Author: gonzo Date: Mon Feb 9 02:31:27 2015 New Revision: 278431 URL: https://svnweb.freebsd.org/changeset/base/278431 Log: Do not mark shared structures as __packed, it leads to race condition If structure packed as __packed clang (and probably gcc) generates code that loads word fields (e.g. tx_pos) byte-by-byte and if it's modified by VideoCore in the same time as ARM loads the value result is going to be mixed combination of bytes from previous value and new one. Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h Mon Feb 9 02:27:33 2015 (r278430) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h Mon Feb 9 02:31:27 2015 (r278431) @@ -280,7 +280,7 @@ typedef struct vchiq_slot_info_struct { /* Use two counters rather than one to avoid the need for a mutex. */ short use_count; short release_count; -} __packed VCHIQ_SLOT_INFO_T; /* XXXGONZO: check it */ +} VCHIQ_SLOT_INFO_T; typedef struct vchiq_service_struct { VCHIQ_SERVICE_BASE_T base; @@ -381,7 +381,7 @@ typedef struct vchiq_shared_state_struct /* Debugging state */ int debug[DEBUG_MAX]; -} __packed VCHIQ_SHARED_STATE_T; +} VCHIQ_SHARED_STATE_T; typedef struct vchiq_slot_zero_struct { int magic; @@ -395,7 +395,7 @@ typedef struct vchiq_slot_zero_struct { VCHIQ_SHARED_STATE_T master; VCHIQ_SHARED_STATE_T slave; VCHIQ_SLOT_INFO_T slots[VCHIQ_MAX_SLOTS]; -} __packed VCHIQ_SLOT_ZERO_T; +} VCHIQ_SLOT_ZERO_T; struct vchiq_state_struct { int id; From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 06:00:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 325864D2; Mon, 9 Feb 2015 06:00:59 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id E9ACAAD2; Mon, 9 Feb 2015 06:00:58 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 13BDA784423; Mon, 9 Feb 2015 17:00:50 +1100 (AEDT) Date: Mon, 9 Feb 2015 17:00:49 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Oleksandr Tymoshenko Subject: Re: svn commit: r278431 - head/sys/contrib/vchiq/interface/vchiq_arm In-Reply-To: <201502090231.t192VS6C060751@svn.freebsd.org> Message-ID: <20150209170045.S1037@besplex.bde.org> References: <201502090231.t192VS6C060751@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=A5NVYcmG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=j7Id98u7Vm7jTOBlUM4A:9 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 06:00:59 -0000 On Mon, 9 Feb 2015, Oleksandr Tymoshenko wrote: > Log: > Do not mark shared structures as __packed, it leads to race condition > > If structure packed as __packed clang (and probably gcc) generates > code that loads word fields (e.g. tx_pos) byte-by-byte and if it's > modified by VideoCore in the same time as ARM loads the value result > is going to be mixed combination of bytes from previous value and > new one. Most uses of __packed are bugs. It gives pessimizations as well as non-atomic accesses for sub-object accesses. I think the full bugs only occur when arch has strict alignment requirements and the alignment of the __packed objects is not known. This means that only lesser bugs occur on x86 (unless you enable alignment checking, but this arguably breaks the ABI). The compiler just generates possibly-misaligned full-width accesses if the arch doesn't have strict alignment requirements. Often the acceses turn out to be aligned at runtime. Otherwise, the hardware does them atomically, with a smaller efficiency penalty than split accesses. Many packed structs should also be declared as __aligned(N). This is rarely done. Old networking code in uses __packed just once, and this also uses __aligned(4) (for struct ip) Newer networking code in (for ipv6) is massively pessimized, with __packed used extensively and __aligned(N) never used with __packed. sctp is worse. It uses its own macro that defeats grepping for __packed. It has 82 instances of this in where ipv6 has only 34. Newer networking should need __packed less than old ones, since no one would misdesign a data struct so that it needs packing now. gcc documents the -Wpacked flag for finding some cases of bogus packing. It is rarely used. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 06:20:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D644D73D; Mon, 9 Feb 2015 06:20: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDE23C3D; Mon, 9 Feb 2015 06:20:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t196KZwO040707; Mon, 9 Feb 2015 06:20:35 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t196KZSk040702; Mon, 9 Feb 2015 06:20:35 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502090620.t196KZSk040702@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Mon, 9 Feb 2015 06:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 06:20:35 -0000 Author: rpaulo Date: Mon Feb 9 06:20:34 2015 New Revision: 278433 URL: https://svnweb.freebsd.org/changeset/base/278433 Log: Merge xz 5.2.0. This brings support for multi-threaded compression. This brings close N times faster compression where N is the number of CPU cores. Because of this, liblzma now depends on libthr. Soon libarchive will be modified to use the new lzma API. Thanks to antoine@ for the exp-run. Differential Revision: https://reviews.freebsd.org/D1786 Reviewed by: bapt Added: head/contrib/xz/src/liblzma/api/lzma/lzma12.h - copied unchanged from r278308, vendor/xz/dist/src/liblzma/api/lzma/lzma12.h head/contrib/xz/src/liblzma/common/block_buffer_encoder.h - copied unchanged from r278308, vendor/xz/dist/src/liblzma/common/block_buffer_encoder.h head/contrib/xz/src/liblzma/common/hardware_cputhreads.c - copied unchanged from r278308, vendor/xz/dist/src/liblzma/common/hardware_cputhreads.c head/contrib/xz/src/liblzma/common/memcmplen.h - copied unchanged from r278308, vendor/xz/dist/src/liblzma/common/memcmplen.h head/contrib/xz/src/liblzma/common/outqueue.c - copied unchanged from r278308, vendor/xz/dist/src/liblzma/common/outqueue.c head/contrib/xz/src/liblzma/common/outqueue.h - copied unchanged from r278308, vendor/xz/dist/src/liblzma/common/outqueue.h head/contrib/xz/src/liblzma/common/stream_encoder_mt.c - copied unchanged from r278308, vendor/xz/dist/src/liblzma/common/stream_encoder_mt.c head/contrib/xz/src/liblzma/liblzma.map - copied unchanged from r278308, vendor/xz/dist/src/liblzma/liblzma.map head/contrib/xz/src/liblzma/validate_map.sh - copied unchanged from r278308, vendor/xz/dist/src/liblzma/validate_map.sh head/contrib/xz/src/xz/mytime.c - copied unchanged from r278308, vendor/xz/dist/src/xz/mytime.c head/contrib/xz/src/xz/mytime.h - copied unchanged from r278308, vendor/xz/dist/src/xz/mytime.h Deleted: head/contrib/xz/src/liblzma/api/lzma/lzma.h head/contrib/xz/src/liblzma/common/stream_encoder.h Modified: head/Makefile.inc1 head/ObsoleteFiles.inc head/contrib/xz/ChangeLog head/contrib/xz/THANKS head/contrib/xz/TODO head/contrib/xz/src/common/mythread.h head/contrib/xz/src/common/sysdefs.h head/contrib/xz/src/common/tuklib_cpucores.c head/contrib/xz/src/common/tuklib_physmem.c head/contrib/xz/src/liblzma/api/lzma.h head/contrib/xz/src/liblzma/api/lzma/base.h head/contrib/xz/src/liblzma/api/lzma/block.h head/contrib/xz/src/liblzma/api/lzma/container.h head/contrib/xz/src/liblzma/api/lzma/filter.h head/contrib/xz/src/liblzma/api/lzma/hardware.h head/contrib/xz/src/liblzma/api/lzma/index.h head/contrib/xz/src/liblzma/api/lzma/index_hash.h head/contrib/xz/src/liblzma/api/lzma/version.h head/contrib/xz/src/liblzma/check/check.h head/contrib/xz/src/liblzma/check/sha256.c head/contrib/xz/src/liblzma/common/alone_decoder.c head/contrib/xz/src/liblzma/common/alone_decoder.h head/contrib/xz/src/liblzma/common/alone_encoder.c head/contrib/xz/src/liblzma/common/auto_decoder.c head/contrib/xz/src/liblzma/common/block_buffer_decoder.c head/contrib/xz/src/liblzma/common/block_buffer_encoder.c head/contrib/xz/src/liblzma/common/block_decoder.c head/contrib/xz/src/liblzma/common/block_decoder.h head/contrib/xz/src/liblzma/common/block_encoder.c head/contrib/xz/src/liblzma/common/block_encoder.h head/contrib/xz/src/liblzma/common/block_header_decoder.c head/contrib/xz/src/liblzma/common/block_header_encoder.c head/contrib/xz/src/liblzma/common/block_util.c head/contrib/xz/src/liblzma/common/common.c head/contrib/xz/src/liblzma/common/common.h head/contrib/xz/src/liblzma/common/easy_buffer_encoder.c head/contrib/xz/src/liblzma/common/easy_encoder.c head/contrib/xz/src/liblzma/common/filter_buffer_decoder.c head/contrib/xz/src/liblzma/common/filter_buffer_encoder.c head/contrib/xz/src/liblzma/common/filter_common.c head/contrib/xz/src/liblzma/common/filter_common.h head/contrib/xz/src/liblzma/common/filter_decoder.c head/contrib/xz/src/liblzma/common/filter_decoder.h head/contrib/xz/src/liblzma/common/filter_encoder.c head/contrib/xz/src/liblzma/common/filter_encoder.h head/contrib/xz/src/liblzma/common/filter_flags_decoder.c head/contrib/xz/src/liblzma/common/index.c head/contrib/xz/src/liblzma/common/index_decoder.c head/contrib/xz/src/liblzma/common/index_encoder.c head/contrib/xz/src/liblzma/common/index_encoder.h head/contrib/xz/src/liblzma/common/index_hash.c head/contrib/xz/src/liblzma/common/stream_buffer_decoder.c head/contrib/xz/src/liblzma/common/stream_buffer_encoder.c head/contrib/xz/src/liblzma/common/stream_decoder.c head/contrib/xz/src/liblzma/common/stream_decoder.h head/contrib/xz/src/liblzma/common/stream_encoder.c head/contrib/xz/src/liblzma/delta/delta_common.c head/contrib/xz/src/liblzma/delta/delta_decoder.c head/contrib/xz/src/liblzma/delta/delta_decoder.h head/contrib/xz/src/liblzma/delta/delta_encoder.c head/contrib/xz/src/liblzma/delta/delta_encoder.h head/contrib/xz/src/liblzma/delta/delta_private.h head/contrib/xz/src/liblzma/liblzma.pc.in head/contrib/xz/src/liblzma/lz/lz_decoder.c head/contrib/xz/src/liblzma/lz/lz_decoder.h head/contrib/xz/src/liblzma/lz/lz_encoder.c head/contrib/xz/src/liblzma/lz/lz_encoder.h head/contrib/xz/src/liblzma/lz/lz_encoder_mf.c head/contrib/xz/src/liblzma/lzma/fastpos.h head/contrib/xz/src/liblzma/lzma/lzma2_decoder.c head/contrib/xz/src/liblzma/lzma/lzma2_decoder.h head/contrib/xz/src/liblzma/lzma/lzma2_encoder.c head/contrib/xz/src/liblzma/lzma/lzma2_encoder.h head/contrib/xz/src/liblzma/lzma/lzma_common.h head/contrib/xz/src/liblzma/lzma/lzma_decoder.c head/contrib/xz/src/liblzma/lzma/lzma_decoder.h head/contrib/xz/src/liblzma/lzma/lzma_encoder.c head/contrib/xz/src/liblzma/lzma/lzma_encoder.h head/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c head/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c head/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h head/contrib/xz/src/liblzma/rangecoder/range_decoder.h head/contrib/xz/src/liblzma/simple/arm.c head/contrib/xz/src/liblzma/simple/armthumb.c head/contrib/xz/src/liblzma/simple/ia64.c head/contrib/xz/src/liblzma/simple/powerpc.c head/contrib/xz/src/liblzma/simple/simple_coder.c head/contrib/xz/src/liblzma/simple/simple_coder.h head/contrib/xz/src/liblzma/simple/simple_decoder.c head/contrib/xz/src/liblzma/simple/simple_decoder.h head/contrib/xz/src/liblzma/simple/simple_private.h head/contrib/xz/src/liblzma/simple/sparc.c head/contrib/xz/src/liblzma/simple/x86.c head/contrib/xz/src/xz/args.c head/contrib/xz/src/xz/args.h head/contrib/xz/src/xz/coder.c head/contrib/xz/src/xz/coder.h head/contrib/xz/src/xz/file_io.c head/contrib/xz/src/xz/file_io.h head/contrib/xz/src/xz/hardware.c head/contrib/xz/src/xz/hardware.h head/contrib/xz/src/xz/list.c head/contrib/xz/src/xz/main.c head/contrib/xz/src/xz/message.c head/contrib/xz/src/xz/options.c head/contrib/xz/src/xz/private.h head/contrib/xz/src/xz/signals.c head/contrib/xz/src/xz/suffix.c head/contrib/xz/src/xz/xz.1 head/lib/Makefile head/lib/liblzma/Makefile head/lib/liblzma/Symbol.map head/lib/liblzma/Versions.def head/lib/liblzma/config.h head/rescue/rescue/Makefile head/share/mk/src.libnames.mk head/usr.bin/xz/Makefile Directory Properties: head/contrib/xz/ (props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Feb 9 02:49:10 2015 (r278432) +++ head/Makefile.inc1 Mon Feb 9 06:20:34 2015 (r278433) @@ -1671,6 +1671,7 @@ _lib_libcapsicum=lib/libcapsicum lib/libcapsicum__L: lib/libnv__L lib/libpjdlog__L: lib/libutil__L +lib/liblzma__L: lib/libthr__L _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} .for _DIR in ${LOCAL_LIB_DIRS} Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Feb 9 02:49:10 2015 (r278432) +++ head/ObsoleteFiles.inc Mon Feb 9 06:20:34 2015 (r278433) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20150209: liblzma header +OLD_FILES+=usr/include/lzma/lzma.h # 20150124: spl.9 and friends OLD_FILES+=usr/share/man/man9/spl.9 OLD_FILES+=usr/share/man/man9/spl0.9 Modified: head/contrib/xz/ChangeLog ============================================================================== --- head/contrib/xz/ChangeLog Mon Feb 9 02:49:10 2015 (r278432) +++ head/contrib/xz/ChangeLog Mon Feb 9 06:20:34 2015 (r278433) @@ -1,66 +1,923 @@ -commit 495aaf3a5b7200a5d2bf449bbbcc0e18834607af +commit a0cd05ee71d330b79ead6eb9222e1b24e1559d3a Author: Lasse Collin -Date: 2014-09-20 20:44:32 +0300 +Date: 2014-12-21 20:48:37 +0200 - Bump version and soname for 5.0.7. + DOS: Update Makefile. + + dos/Makefile | 1 + + 1 file changed, 1 insertion(+) + +commit b85ee0905ec4ab7656d22e63519fdd3bedb21f2e +Author: Lasse Collin +Date: 2014-12-21 19:50:38 +0200 + + Windows: Fix bin_i486 to bin_i686 in build.bash. + + windows/build.bash | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cbafa710918195dbba3db02c3fab4f0538235206 +Author: Lasse Collin +Date: 2014-12-21 18:58:44 +0200 + + Docs: Use lzma_cputhreads() in 04_compress_easy_mt.c. + + doc/examples/04_compress_easy_mt.c | 30 ++++++++++++++++++++++++++---- + 1 file changed, 26 insertions(+), 4 deletions(-) + +commit 8dbb57238d372c7263cfeb3e7f7fd9a73173156a +Author: Lasse Collin +Date: 2014-12-21 18:56:44 +0200 + + Docs: Update docs/examples/00_README.txt. + + doc/examples/00_README.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6 +Author: Lasse Collin +Date: 2014-12-21 18:11:17 +0200 + + Bump version and soname for 5.2.0. + + I know that soname != app version, but I skip AGE=1 + in -version-info to make the soname match the liblzma + version anyway. It doesn't hurt anything as long as + it doesn't conflict with library versioning rules. src/liblzma/Makefile.am | 2 +- - src/liblzma/api/lzma/version.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) + src/liblzma/api/lzma/version.h | 6 +++--- + src/liblzma/liblzma.map | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit 3e8bd1d15e417f2d588e9be50ce027ee3d48b2da +Author: Lasse Collin +Date: 2014-12-21 18:05:03 +0200 + + Avoid variable-length arrays in the debug programs. + + debug/full_flush.c | 3 ++- + debug/sync_flush.c | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit 72f7307cfdceb941aeb2bf30d424cc0d13621786 +Author: Lasse Collin +Date: 2014-12-21 18:01:45 +0200 + + Build: Include 04_compress_easy_mt.c in the tarball. + + Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit 2cb82ff21c62def11f3683a8bb0aaf363102aaa0 +Author: Lasse Collin +Date: 2014-12-21 18:00:38 +0200 + + Fix build when --disable-threads is used. + + src/common/mythread.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit 9b9e3536e458ef958f66b0e8982efc9d36de4d17 +Author: Adrien Nader +Date: 2014-12-21 15:56:15 +0100 + + po/fr: improve wording for help for --lzma1/--lzma2. + + po/fr.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a8b6b569e7fadbf5b5b9139d53bc764015c15027 +Author: Adrien Nader +Date: 2014-12-21 15:55:48 +0100 + + po/fr: missing line in translation of --extreme. + + po/fr.po | 1 + + 1 file changed, 1 insertion(+) + +commit f168a6fd1a888cf4f0caaddcafcb21dadc6ab6e9 +Author: Lasse Collin +Date: 2014-12-21 14:32:33 +0200 + + Update NEWS for 5.2.0. + + NEWS | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + +commit cec2ee863b3a88f4bf039cb00f73c4a4fc93a429 +Author: Lasse Collin +Date: 2014-12-21 14:32:22 +0200 + + Update NEWS for 5.0.8. + + NEWS | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 42e97a32649bf53ce43be2258b902a417c6e7fa1 +Author: Lasse Collin +Date: 2014-12-21 14:07:54 +0200 + + xz: Fix a comment. + + src/xz/options.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 29b95d5d6665cedffa6a9d6d3d914f981e852182 +Author: Lasse Collin +Date: 2014-12-20 20:43:14 +0200 + + Update INSTALL about the dependencies of the scripts. + + INSTALL | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit 3af91040bb42c21afbb81f5568c3313125e61192 +Author: Lasse Collin +Date: 2014-12-20 20:42:33 +0200 + + Windows: Update build instructions. + + INSTALL | 15 +++++++++------ + windows/INSTALL-Windows.txt | 44 +++++++++++++++++++++----------------------- + 2 files changed, 30 insertions(+), 29 deletions(-) + +commit 0152f72bf6289d744823dc6c849538f3a139ad70 +Author: Lasse Collin +Date: 2014-12-20 20:41:48 +0200 + + Windows: Update the build script and README-Windows.txt. + + The 32-bit build is now for i686 or newer because the + prebuilt MinGW-w64 toolchains include i686 code in the + executables even if one uses -march=i486. + + The build script builds 32-bit SSE2 enabled version too. + Run-time detection of SSE2 support would be nice (on any OS) + but it's not implemented in XZ Utils yet. + + windows/README-Windows.txt | 30 ++++++++++++++++-------------- + windows/build.bash | 23 ++++++++++++++--------- + 2 files changed, 30 insertions(+), 23 deletions(-) + +commit 4a1f6133ee5533cee8d91e06fcc22443e5f1881a +Author: Lasse Collin +Date: 2014-12-19 15:51:50 +0200 + + Windows: Define TUKLIB_SYMBOL_PREFIX in config.h. + + It is to keep all symbols in the lzma_ namespace. + + windows/config.h | 3 +++ + 1 file changed, 3 insertions(+) + +commit 7f7d093de79eee0c7dbfd7433647e46302f19f82 +Author: Lasse Collin +Date: 2014-12-16 21:00:09 +0200 + + xz: Update the man page about --threads. + + src/xz/xz.1 | 5 ----- + 1 file changed, 5 deletions(-) + +commit 009823448b82aa5f465668878a544c5842885407 +Author: Lasse Collin +Date: 2014-12-16 20:57:43 +0200 + + xz: Update the man page about --block-size. + + src/xz/xz.1 | 41 +++++++++++++++++++++++++++++++++-------- + 1 file changed, 33 insertions(+), 8 deletions(-) + +commit 7dddfbeb499e528940bc12047355c184644aafe9 +Author: Adrien Nader +Date: 2014-12-10 22:26:57 +0100 + + po/fr: several more translation updates: reword and handle --ignore-check. + + po/fr.po | 50 ++++++++++++++++++++++++++------------------------ + 1 file changed, 26 insertions(+), 24 deletions(-) + +commit 6eca5be40e04ddc4b738d493e4e56835956d8b69 +Author: Adrien Nader +Date: 2014-12-10 22:23:01 +0100 + + po/fr: yet another place where my email address had to be updated. + + po/fr.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d1003673e92ba47edd6aeeb3dbea05c18269d0e7 +Author: Adrien Nader +Date: 2014-12-10 22:22:20 +0100 + + po/fr: fix several typos that have been around since the beginning. + + po/fr.po | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +commit 4c5aa911a0df027e46171e368debc543d2fa72b2 +Author: Adrien Nader +Date: 2014-12-03 20:02:31 +0100 + + po/fr: last batch of new translations for now. + + Four new error messages. + + po/fr.po | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 3e3099e36d27059499e7996fb38a62e8ab01d356 +Author: Adrien Nader +Date: 2014-12-03 20:01:32 +0100 + + po/fr: translations for --threads, --block-size and --block-list. + + po/fr.po | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit e7d96a5933eec4e9d4a62569ee88df0ebb0f1d53 +Author: Adrien Nader +Date: 2014-12-03 20:00:53 +0100 + + po/fr: remove fuzzy marker for error messages that will be kept in English. + + The following is a copy of a comment inside fr.po: + + Note from translator on "file status flags". + The following entry is kept un-translated on purpose. It is difficult to + translate and should only happen in exceptional circumstances which means + that translating would: + - lose some of the meaning + - make it more difficult to look up in search engines; it might happen one + in + a million times, if we dilute the error message in 20 languages, it will be + almost impossible to find an explanation and support for the error. + + po/fr.po | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +commit 46cbb9033af8a21fafe543302d6919746e0d72af +Author: Adrien Nader +Date: 2014-12-03 19:58:25 +0100 + + po/fr: several minor updates and better wording. + + Meaning doesn't change at all: it's only for better wording and/or + formatting of a few strings. + + po/fr.po | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 7ce49d444f04e73145f79c832eb4d510594b074a +Author: Adrien Nader +Date: 2014-12-03 19:56:12 +0100 + + po/fr: update my email address and copyright years. + + po/fr.po | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 214c553ebc3047cd720da1ce5c80cf7c38118d3c +Author: Adrien Nader +Date: 2014-11-26 10:08:26 +0100 + + fr.po: commit file after only "update-po" so actual is readable. + + po/fr.po | 311 ++++++++++++++++++++++++++++++++++++++++----------------------- + 1 file changed, 199 insertions(+), 112 deletions(-) + +commit 1190c641af09cde85f8bd0fbe5c4906f4a29431b +Author: Lasse Collin +Date: 2014-12-02 20:04:07 +0200 + + liblzma: Document how lzma_mt.block_size affects memory usage. + + src/liblzma/api/lzma/container.h | 4 ++++ + 1 file changed, 4 insertions(+) + +commit e4fc1d2f9571fba79ce383595be2ea2a9257def0 +Author: Lasse Collin +Date: 2014-11-28 20:07:18 +0200 + + Update INSTALL about a "make check" failure in test_scripts.sh. + + INSTALL | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +commit 34f9e40a0a0c3bd2c2730cdb9cd550bbb8a3f2fe +Author: Lasse Collin +Date: 2014-11-26 20:12:27 +0200 + + Remove LZMA_UNSTABLE macro. + + src/liblzma/api/lzma/container.h | 4 ---- + src/liblzma/common/common.h | 2 -- + src/xz/private.h | 1 - + 3 files changed, 7 deletions(-) + +commit 6d9c0ce9f2677b159e32b224aba5b535b304a705 +Author: Lasse Collin +Date: 2014-11-26 20:10:33 +0200 + + liblzma: Update lzma_stream_encoder_mt() API docs. + + src/liblzma/api/lzma/container.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 2301f3f05dd9742f42cda8f0f318864f5dc39ab3 +Author: Lasse Collin +Date: 2014-11-25 12:32:05 +0200 + + liblzma: Verify the filter chain in threaded encoder initialization. + + This way an invalid filter chain is detected at the Stream + encoder initialization instead of delaying it to the first + call to lzma_code() which triggers the initialization of + the actual filter encoder(s). + + src/liblzma/common/stream_encoder_mt.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 107a263d5bb63cd3593fd6a5c938706539f84523 +Author: Lasse Collin +Date: 2014-11-17 19:11:49 +0200 + + Build: Update m4/ax_pthread.m4 from Autoconf Archive. + + m4/ax_pthread.m4 | 71 +++++++++++++++++++++++++++++++++++++------------------- + 1 file changed, 47 insertions(+), 24 deletions(-) + +commit b13a781833399ff5726cfc997f3cb2f0acbdbf31 +Author: Lasse Collin +Date: 2014-11-17 18:52:21 +0200 + + Build: Replace obsolete AC_HELP_STRING with AS_HELP_STRING. + + configure.ac | 36 ++++++++++++++++++------------------ + m4/tuklib_integer.m4 | 2 +- + 2 files changed, 19 insertions(+), 19 deletions(-) + +commit 542cac122ed3550148a2af0033af22b757491378 +Author: Lasse Collin +Date: 2014-11-17 18:43:19 +0200 + + Build: Fix Autoconf warnings about escaped backquotes. + + Thanks to Daniel Richard G. for pointing out that it's + good to sometimes run autoreconf -fi with -Wall. + + configure.ac | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 7b03a15cea8cd4f19ed680b51c4bcbae3ce4142f +Author: Lasse Collin +Date: 2014-11-10 18:54:40 +0200 + + xzdiff: Use mkdir if mktemp isn't available. + + src/scripts/xzdiff.in | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +commit f8c13e5e3609581d5dd9f8777985ca07f2390ad7 +Author: Lasse Collin +Date: 2014-11-10 18:45:01 +0200 + + xzdiff: Create a temporary directory to hold a temporary file. + + This avoids the possibility of "File name too long" when + creating a temp file when the input file name is very long. + + This also means that other users on the system can no longer + see the input file names in /tmp (or whatever $TMPDIR is) + since the temporary directory will have a generic name. This + usually doesn't matter since on many systems one can see + the arguments given to all processes anyway. + + The number X chars to mktemp where increased from 6 to 10. + + Note that with some shells temp files or dirs won't be used at all. + + src/scripts/xzdiff.in | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 7716dcf9df7f457500cb657314e7a9aea5fedb06 +Author: Lasse Collin +Date: 2014-11-10 15:38:47 +0200 + + liblzma: Fix lzma_mt.preset in lzma_stream_encoder_mt_memusage(). + + It read the filter chain from a wrong variable. This is a similar + bug that was fixed in 9494fb6d0ff41c585326f00aa8f7fe58f8106a5e. + + src/liblzma/common/stream_encoder_mt.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 230fa4a605542c84b4178a57381695a0af4e779b +Author: Lasse Collin +Date: 2014-11-10 14:49:55 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4e4ae08bc7c1711e399c9f2d26eb375d39d08101 +Author: Lasse Collin +Date: 2014-10-29 21:28:25 +0200 + + Update .gitignore files. + + .gitignore | 2 ++ + m4/.gitignore | 3 +++ + 2 files changed, 5 insertions(+) + +commit c923b140b27d1a055db6284e10fd546ad1a7fcdb +Author: Lasse Collin +Date: 2014-10-29 21:15:35 +0200 + + Build: Prepare to support Automake's subdir-objects. + + Due to a bug in Automake, subdir-objects won't be enabled + for now. + + http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17354 + + Thanks to Daniel Richard G. for the original patches. + + configure.ac | 7 ++++++- + src/Makefile.am | 22 +++++++++++++++++++++- + src/liblzma/Makefile.am | 4 ++-- + src/lzmainfo/Makefile.am | 4 ++-- + src/xz/Makefile.am | 10 +++++----- + src/xzdec/Makefile.am | 8 ++++---- + 6 files changed, 40 insertions(+), 15 deletions(-) + +commit 08c2aa16bea0df82828f665d51fba2e0a5e8997f +Author: Lasse Collin +Date: 2014-10-24 20:09:29 +0300 + + Translations: Update the Italian translation. + + Thanks to Milo Casagrande. + + po/it.po | 452 ++++++++++++++++++++++++++++++++++++++------------------------- + 1 file changed, 275 insertions(+), 177 deletions(-) + +commit 2f9f61aa83539c54ff6c118a2693890f0519b3dd +Author: Lasse Collin +Date: 2014-10-18 18:51:45 +0300 + + Translations: Update the Polish translation. + + Thanks to Jakub Bogusz. + + po/pl.po | 332 ++++++++++++++++++++++++++++++++++++++++----------------------- + 1 file changed, 214 insertions(+), 118 deletions(-) + +commit 4f9d233f67aea25e532824d11b7642cf7dee7a76 +Author: Andre Noll +Date: 2014-10-14 17:30:30 +0200 + + l10n: de.po: Change translator email address. + + Although the old address is still working, the new one should + be preferred. So this commit changes all three places in de.po + accordingly. + + Signed-off-by: Andre Noll + + po/de.po | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 00502b2bedad43f0cc167ac17ae0608837ee196b +Author: Andre Noll +Date: 2014-10-14 17:30:29 +0200 + + l10n: de.po: Update German translation + + Signed-off-by: Andre Noll + + po/de.po | 531 +++++++++++++++++++++++++++++++++------------------------------ + 1 file changed, 281 insertions(+), 250 deletions(-) + +commit 706b0496753fb609e69f1570ec603f11162189d1 +Author: Andre Noll +Date: 2014-10-14 17:30:28 +0200 + + l10n: de.po: Fix typo: Schießen -> Schließen. + + That's a funny one since "schießen" means to shoot :) + + Signed-off-by: Andre Noll + + po/de.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7c32e6a935c3d7ee366abad1679bd5f322f0c7d4 +Author: Lasse Collin +Date: 2014-10-09 19:42:26 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 076258cc458f1e705041ac7a729b15ffe8c5214a +Author: Lasse Collin +Date: 2014-10-09 19:41:51 +0300 + + Add support for AmigaOS/AROS to tuklib_physmem(). + + Thanks to Fredrik Wikstrom. + + m4/tuklib_physmem.m4 | 3 ++- + src/common/tuklib_physmem.c | 7 +++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +commit efa7b0a210e1baa8e128fc98c5443a944c39ad24 +Author: Lasse Collin +Date: 2014-10-09 18:42:14 +0300 + + xzgrep: Avoid passing both -q and -l to grep. + + The behavior of grep -ql varies: + - GNU grep behaves like grep -q. + - OpenBSD grep behaves like grep -l. + + POSIX doesn't make it 100 % clear what behavior is expected. + Anyway, using both -q and -l at the same time makes no sense + so both options simply should never be used at the same time. + + Thanks to Christian Weisgerber. + + src/scripts/xzgrep.in | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 9c5f76098c9986b48d2fc574a0b764f4cde0c538 +Author: Trần Ngá»c Quân +Date: 2014-09-25 09:22:45 +0700 + + l10n: vi.po: Update Vietnamese translation + + Signed-off-by: Trần Ngá»c Quân + + po/vi.po | 136 +++++++++++++++++++++++++++++++++++++++------------------------ + 1 file changed, 84 insertions(+), 52 deletions(-) + +commit c4911f2db36d811896c73c008b4218d8fa9a4730 +Author: Lasse Collin +Date: 2014-09-25 18:38:48 +0300 + + Build: Detect supported compiler warning flags better. + + Clang and nowadays also GCC accept any -Wfoobar option + but then may give a warning that an unknown warning option + was specified. To avoid adding unsupported warning options, + the options are now tested with -Werror. + + Thanks to Charles Diza. + + configure.ac | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 76e75522ed6f5c228d55587dee5a997893f6e474 +Author: Lasse Collin +Date: 2014-09-20 21:01:21 +0300 + + Update NEWS for 5.0.7. + + NEWS | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit d62028b4c1174fc67b6929f126f5eb24c018c700 +Author: Lasse Collin +Date: 2014-09-20 19:42:56 +0300 + + liblzma: Fix a portability problem in Makefile.am. + + POSIX supports $< only in inference rules (suffix rules). + Using it elsewhere is a GNU make extension and doesn't + work e.g. with OpenBSD make. + + Thanks to Christian Weisgerber for the patch. + + src/liblzma/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c35de31d4283edad3e57d37ffe939406542cb7bb +Author: Lasse Collin +Date: 2014-09-14 21:54:09 +0300 + + Bump the version number to 5.1.4beta. + + src/liblzma/api/lzma/version.h | 4 ++-- + src/liblzma/liblzma.map | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit e9e097e22cacdaa23e5414fea7913535449cb340 +Author: Lasse Collin +Date: 2014-09-14 21:50:13 +0300 + + Update NEWS for 5.0.6 and 5.1.4beta. + + NEWS | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 50 insertions(+) + +commit 642f856bb8562ab66704b1e01ac7bc08b6d0a663 +Author: Lasse Collin +Date: 2014-09-14 21:02:41 +0300 + + Update TODO. + + TODO | 38 ++++++++++++++++++++++++++++++++++---- + 1 file changed, 34 insertions(+), 4 deletions(-) + +commit 6b5e3b9eff5b8cedb2aac5f524d4d60fc8a48124 +Author: Lasse Collin +Date: 2014-08-05 22:32:36 +0300 + + xz: Add --ignore-check. + + src/xz/args.c | 7 +++++++ + src/xz/args.h | 1 + + src/xz/coder.c | 10 +++++++++- + src/xz/message.c | 2 ++ + src/xz/xz.1 | 19 +++++++++++++++++++ + 5 files changed, 38 insertions(+), 1 deletion(-) + +commit 9adbc2ff373f979c917cdfd3679ce0ebd59f1040 +Author: Lasse Collin +Date: 2014-08-05 22:15:07 +0300 + + liblzma: Add support for LZMA_IGNORE_CHECK. + + src/liblzma/api/lzma/container.h | 24 ++++++++++++++++++++++++ + src/liblzma/common/common.h | 1 + + src/liblzma/common/stream_decoder.c | 14 ++++++++++++-- + 3 files changed, 37 insertions(+), 2 deletions(-) + +commit 0e0f34b8e4f1c60ecaec15c2105982381cc9c3e6 +Author: Lasse Collin +Date: 2014-08-05 22:03:30 +0300 + + liblzma: Add support for lzma_block.ignore_check. + + Note that this slightly changes how lzma_block_header_decode() + has been documented. Earlier it said that the .version is set + to the lowest required value, but now it says that the .version + field is kept unchanged if possible. In practice this doesn't + affect any old code, because before this commit the only + possible .version was 0. + + src/liblzma/api/lzma/block.h | 50 ++++++++++++++++++++++++------- + src/liblzma/common/block_buffer_encoder.c | 2 +- + src/liblzma/common/block_decoder.c | 18 ++++++++--- + src/liblzma/common/block_encoder.c | 2 +- + src/liblzma/common/block_header_decoder.c | 12 ++++++-- + src/liblzma/common/block_header_encoder.c | 2 +- + src/liblzma/common/block_util.c | 2 +- + 7 files changed, 68 insertions(+), 20 deletions(-) + +commit 71e1437ab585b46f7a25f5a131557d3d1c0cbaa2 +Author: Lasse Collin +Date: 2014-08-04 19:25:58 +0300 + + liblzma: Use lzma_memcmplen() in the BT3 match finder. + + I had missed this when writing the commit + 5db75054e900fa06ef5ade5f2c21dffdd5d16141. + + Thanks to Jun I Jin. + + src/liblzma/lz/lz_encoder_mf.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 41dc9ea06e1414ebe8ef52afc8fc15b6e3282b04 +Author: Lasse Collin +Date: 2014-08-04 00:25:44 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 5dcffdbcc23a68abc3ac3539b30be71bc9b5af84 +Author: Lasse Collin +Date: 2014-08-03 21:32:25 +0300 + + liblzma: SHA-256: Optimize the Maj macro slightly. + + The Maj macro is used where multiple things are added + together, so making Maj a sum of two expressions allows + some extra freedom for the compiler to schedule the + instructions. + + I learned this trick from + . + + src/liblzma/check/sha256.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a9477d1e0c6fd0e47e637d051e7b9e2a5d9af517 +Author: Lasse Collin +Date: 2014-08-03 21:08:12 +0300 + + liblzma: SHA-256: Optimize the way rotations are done. + + This looks weird because the rotations become sequential, + but it helps quite a bit on both 32-bit and 64-bit x86: + + - It requires fewer instructions on two-operand + instruction sets like x86. + + - It requires one register less which matters especially + on 32-bit x86. + + I hope this doesn't hurt other archs. + + I didn't invent this idea myself, but I don't remember where + I saw it first. + + src/liblzma/check/sha256.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +commit 5a76c7c8ee9a0afbeedb1c211db9224260404347 +Author: Lasse Collin +Date: 2014-08-03 20:38:13 +0300 + + liblzma: SHA-256: Remove the GCC #pragma that became unneeded. + + The unrolling in the previous commit should avoid the + situation where a compiler may think that an uninitialized + variable might be accessed. + + src/liblzma/check/sha256.c | 5 ----- + 1 file changed, 5 deletions(-) + +commit 9a096f8e57509775c331950b8351bbca77bdcfa8 +Author: Lasse Collin +Date: 2014-08-03 20:33:38 +0300 + + liblzma: SHA-256: Unroll a little more. + + This way a branch isn't needed for each operation + to choose between blk0 and blk2, and still the code + doesn't grow as much as it would with full unrolling. + + src/liblzma/check/sha256.c | 25 ++++++++++++++++--------- + 1 file changed, 16 insertions(+), 9 deletions(-) + +commit bc7650d87bf27f85f1a2a806dc2db1780e09e6a5 +Author: Lasse Collin +Date: 2014-08-03 19:56:43 +0300 + + liblzma: SHA-256: Do the byteswapping without a temporary buffer. + + src/liblzma/check/sha256.c | 13 +------------ + 1 file changed, 1 insertion(+), 12 deletions(-) + +commit 544aaa3d13554e8640f9caf7db717a96360ec0f6 +Author: Lasse Collin +Date: 2014-07-25 22:38:28 +0300 + + liblzma: Use lzma_memcmplen() in normal mode of LZMA. + + Two locations were not changed yet because the simplest change + assumes that the initial "len" may be greater than "limit". + + src/liblzma/lzma/lzma_encoder_optimum_normal.c | 20 +++++--------------- + 1 file changed, 5 insertions(+), 15 deletions(-) + +commit f48fce093b07aeda95c18850f5e086d9f2383380 +Author: Lasse Collin +Date: 2014-07-25 22:30:38 +0300 + + liblzma: Simplify LZMA fast mode code by using memcmp(). + + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 11 +---------- + 1 file changed, 1 insertion(+), 10 deletions(-) + +commit 6bf5308e34e23dede5b301b1b9b4f131dacd9218 +Author: Lasse Collin +Date: 2014-07-25 22:29:49 +0300 + + liblzma: Use lzma_memcmplen() in fast mode of LZMA. + + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 353212137e51e45b105a3a3fc2e6879f1cf0d492 +Author: Lasse Collin +Date: 2014-07-25 21:16:23 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 5db75054e900fa06ef5ade5f2c21dffdd5d16141 +Author: Lasse Collin +Date: 2014-07-25 21:15:07 +0300 + + liblzma: Use lzma_memcmplen() in the match finders. + + This doesn't change the match finder output. + + src/liblzma/lz/lz_encoder.c | 13 ++++++++++++- + src/liblzma/lz/lz_encoder_mf.c | 33 +++++++++++---------------------- + 2 files changed, 23 insertions(+), 23 deletions(-) + +commit e1c8f1d01f4a4e2136173edab2dc63c71ef038f4 +Author: Lasse Collin +Date: 2014-07-25 20:57:20 +0300 + + liblzma: Add lzma_memcmplen() for fast memory comparison. + + This commit just adds the function. Its uses will be in + separate commits. + + This hasn't been tested much yet and it's perhaps a bit early + to commit it but if there are bugs they should get found quite + quickly. + + Thanks to Jun I Jin from Intel for help and for pointing out + that string comparison needs to be optimized in liblzma. + + configure.ac | 13 +++ + src/liblzma/common/Makefile.inc | 1 + + src/liblzma/common/memcmplen.h | 170 ++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 184 insertions(+) -commit ac6c8921d1d8d2d749d5c97f9a0b0594cc863cea +commit 765735cf52e5123586e74a51b9c073b5257f631f Author: Lasse Collin -Date: 2014-09-20 20:43:29 +0300 +Date: 2014-07-12 21:10:09 +0300 - Update NEWS for 5.0.7. + Update THANKS. - NEWS | 11 +++++++++++ - 1 file changed, 11 insertions(+) + THANKS | 1 + + 1 file changed, 1 insertion(+) -commit d1b0276aafd441a3d4db9dfd5dd9880e9f834d49 +commit 59da01785ef66c7e62f36e70ca808fd2824bb995 Author: Lasse Collin -Date: 2014-09-20 20:21:18 +0300 +Date: 2014-07-12 20:06:08 +0300 - liblzma: Fix invalid Libs.private value in liblzma.pc. + Translations: Add Vietnamese translation. + + Thanks to Trần Ngá»c Quân. - src/liblzma/Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + po/LINGUAS | 1 + + po/vi.po | 1007 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1008 insertions(+) -commit cac72956b1e56788182ac14bfb25519636afd503 +commit 17215f751c354852700e7f8592ccf319570a0721 Author: Lasse Collin -Date: 2014-09-20 19:42:56 +0300 +Date: 2014-06-29 20:54:14 +0300 - liblzma: Fix a portability problem in Makefile.am. - - POSIX supports $< only in inference rules (suffix rules). - Using it elsewhere is a GNU make extension and doesn't - work e.g. with OpenBSD make. + xz: Update the help message of a few options. - Thanks to Christian Weisgerber for the patch. + Updated: --threads, --block-size, and --block-list + Added: --flush-timeout - src/liblzma/Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + src/xz/message.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) -commit 2cdf0875dedca3e89b02ad5ac8aa1109f902ae11 +commit 96864a6ddf91ad693d102ea165f3d7918744d582 Author: Lasse Collin -Date: 2014-09-14 19:35:45 +0300 +Date: 2014-06-18 22:07:06 +0300 - Bump version and soname for 5.0.6. + xz: Use lzma_cputhreads() instead of own copy of tuklib_cpucores(). - src/liblzma/Makefile.am | 2 +- - src/liblzma/api/lzma/version.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) + src/xz/Makefile.am | 1 - + src/xz/hardware.c | 12 +++++++++--- + 2 files changed, 9 insertions(+), 4 deletions(-) -commit 0168b6c8fbc88cae61b1f5fb41d6c33c9e127967 +commit a115cc3748482e277f42a968baa3cd266f031dba Author: Lasse Collin -Date: 2014-09-14 19:33:46 +0300 +Date: 2014-06-18 22:04:24 +0300 - Update NEWS for 5.0.6. + liblzma: Add lzma_cputhreads(). - NEWS | 7 +++++++ - 1 file changed, 7 insertions(+) + src/liblzma/Makefile.am | 8 +++++++- + src/liblzma/api/lzma/hardware.h | 14 ++++++++++++++ + src/liblzma/common/Makefile.inc | 1 + + src/liblzma/common/hardware_cputhreads.c | 22 ++++++++++++++++++++++ + src/liblzma/liblzma.map | 1 + + 5 files changed, 45 insertions(+), 1 deletion(-) -commit 13337714e89d002af7af48d6853f977de985d7de +commit 3ce3e7976904fbab4e6482bafa442856f77a51fa +Author: Lasse Collin +Date: 2014-06-18 19:11:52 +0300 + + xz: Check for filter chain compatibility for --flush-timeout. + + This avoids LZMA_PROG_ERROR from lzma_code() with filter chains + that don't support LZMA_SYNC_FLUSH. + + src/xz/coder.c | 30 +++++++++++++++++++++--------- + 1 file changed, 21 insertions(+), 9 deletions(-) + +commit 381ac14ed79e5d38809f251705be8b3193bba417 Author: Lasse Collin Date: 2014-06-13 19:21:54 +0300 @@ -69,7 +926,7 @@ Date: 2014-06-13 19:21:54 +0300 tests/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -commit ccc728d8290c0464c7af62790b1c5528eceaae35 +commit 4244b65b06d5ecaf6f9dd0387ac7e3166bd2364e Author: Lasse Collin Date: 2014-06-13 18:58:22 +0300 @@ -83,7 +940,7 @@ Date: 2014-06-13 18:58:22 +0300 tests/xzgrep_expected_output | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 11 deletions(-) -commit 948f5865fe65061e215baa8ed63be570bae152ea +commit 1e60f2c0a0ee6c18b02943ce56214799a70aac26 Author: Lasse Collin *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 06:23:23 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 548FA897; Mon, 9 Feb 2015 06:23:23 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26A01CE3; Mon, 9 Feb 2015 06:23:22 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJH00BAZR2T6C20@st11p02mm-asmtp002.mac.com>; Mon, 09 Feb 2015 06:23:20 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-09_01:2015-02-09,2015-02-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502090066 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... From: Rui Paulo In-reply-to: <201502090620.t196KZSk040702@svn.freebsd.org> Date: Sun, 08 Feb 2015 22:23:17 -0800 Content-transfer-encoding: quoted-printable Message-id: References: <201502090620.t196KZSk040702@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.2070.6) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 06:23:23 -0000 On Feb 8, 2015, at 22:20, Rui Paulo wrote: >=20 > Author: rpaulo > Date: Mon Feb 9 06:20:34 2015 > New Revision: 278433 > URL: https://svnweb.freebsd.org/changeset/base/278433 >=20 > Log: > Merge xz 5.2.0. >=20 > This brings support for multi-threaded compression. This brings = close > N times faster compression where N is the number of CPU cores. > Because of this, liblzma now depends on libthr. Gah, terrible wording. I bet I couldn't repeat the word "this" three = times in a row if I wanted to... -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 07:08:54 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D96A11DC; Mon, 9 Feb 2015 07:08: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C561A13C; Mon, 9 Feb 2015 07:08:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1978s8X063074; Mon, 9 Feb 2015 07:08:54 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1978swm063073; Mon, 9 Feb 2015 07:08:54 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502090708.t1978swm063073@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 9 Feb 2015 07:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278434 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 07:08:55 -0000 Author: nwhitehorn Date: Mon Feb 9 07:08:54 2015 New Revision: 278434 URL: https://svnweb.freebsd.org/changeset/base/278434 Log: Fix typo in PTE insertion overflow handling: use the page we're actually returning, not the one we just looked at. Modified: head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Mon Feb 9 06:20:34 2015 (r278433) +++ head/sys/powerpc/pseries/mmu_phyp.c Mon Feb 9 07:08:54 2015 (r278434) @@ -299,7 +299,10 @@ mphyp_pte_spillable_ident(u_int ptegidx, } } - phyp_pft_hcall(H_READ, 0, slot, 0, 0, &to_evict->pte_hi, + if (k == -1) + return (k); + + phyp_pft_hcall(H_READ, 0, k, 0, 0, &to_evict->pte_hi, &to_evict->pte_lo, &junk); return (k); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 07:56:52 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 062AE149; Mon, 9 Feb 2015 07:56: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC83A8B9; Mon, 9 Feb 2015 07:56:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t197upGT086165; Mon, 9 Feb 2015 07:56:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t197upWX086163; Mon, 9 Feb 2015 07:56:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201502090756.t197upWX086163@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Feb 2015 07:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278438 - head/sys/dev/drm2/radeon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 07:56:52 -0000 Author: dim Date: Mon Feb 9 07:56:50 2015 New Revision: 278438 URL: https://svnweb.freebsd.org/changeset/base/278438 Log: After r278004 was committed, Bruce Evans noted that the casts were actually completely unnecessary, here: https://lists.freebsd.org/pipermail/svn-src-all/2015-February/098478.html Remove the casts, and just assign &xxx_io_mc_regs[0][0] directly. Reviewed by: dumbbell MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D1748 Modified: head/sys/dev/drm2/radeon/ni.c head/sys/dev/drm2/radeon/si.c Modified: head/sys/dev/drm2/radeon/ni.c ============================================================================== --- head/sys/dev/drm2/radeon/ni.c Mon Feb 9 07:52:45 2015 (r278437) +++ head/sys/dev/drm2/radeon/ni.c Mon Feb 9 07:56:50 2015 (r278438) @@ -190,23 +190,23 @@ int ni_mc_load_microcode(struct radeon_d switch (rdev->family) { case CHIP_BARTS: - io_mc_regs = (const u32 *)&barts_io_mc_regs; + io_mc_regs = &barts_io_mc_regs[0][0]; ucode_size = BTC_MC_UCODE_SIZE; regs_size = BTC_IO_MC_REGS_SIZE; break; case CHIP_TURKS: - io_mc_regs = (const u32 *)&turks_io_mc_regs; + io_mc_regs = &turks_io_mc_regs[0][0]; ucode_size = BTC_MC_UCODE_SIZE; regs_size = BTC_IO_MC_REGS_SIZE; break; case CHIP_CAICOS: default: - io_mc_regs = (const u32 *)&caicos_io_mc_regs; + io_mc_regs = &caicos_io_mc_regs[0][0]; ucode_size = BTC_MC_UCODE_SIZE; regs_size = BTC_IO_MC_REGS_SIZE; break; case CHIP_CAYMAN: - io_mc_regs = (const u32 *)&cayman_io_mc_regs; + io_mc_regs = &cayman_io_mc_regs[0][0]; ucode_size = CAYMAN_MC_UCODE_SIZE; regs_size = BTC_IO_MC_REGS_SIZE; break; Modified: head/sys/dev/drm2/radeon/si.c ============================================================================== --- head/sys/dev/drm2/radeon/si.c Mon Feb 9 07:52:45 2015 (r278437) +++ head/sys/dev/drm2/radeon/si.c Mon Feb 9 07:56:50 2015 (r278438) @@ -190,18 +190,18 @@ static int si_mc_load_microcode(struct r switch (rdev->family) { case CHIP_TAHITI: - io_mc_regs = (const u32 *)&tahiti_io_mc_regs; + io_mc_regs = &tahiti_io_mc_regs[0][0]; ucode_size = SI_MC_UCODE_SIZE; regs_size = TAHITI_IO_MC_REGS_SIZE; break; case CHIP_PITCAIRN: - io_mc_regs = (const u32 *)&pitcairn_io_mc_regs; + io_mc_regs = &pitcairn_io_mc_regs[0][0]; ucode_size = SI_MC_UCODE_SIZE; regs_size = TAHITI_IO_MC_REGS_SIZE; break; case CHIP_VERDE: default: - io_mc_regs = (const u32 *)&verde_io_mc_regs; + io_mc_regs = &verde_io_mc_regs[0][0]; ucode_size = SI_MC_UCODE_SIZE; regs_size = TAHITI_IO_MC_REGS_SIZE; break; From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 08:05:45 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 945294D8; Mon, 9 Feb 2015 08:05:45 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 668F49BD; Mon, 9 Feb 2015 08:05:44 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJH0049SVRON720@st11p02mm-asmtp001.mac.com>; Mon, 09 Feb 2015 08:04:40 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-09_01:2015-02-09,2015-02-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502090085 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... From: Rui Paulo In-reply-to: <201502090620.t196KZSk040702@svn.freebsd.org> Date: Mon, 09 Feb 2015 00:04:36 -0800 Content-transfer-encoding: quoted-printable Message-id: <49CF99E3-959F-43CE-B606-78FA5FF998A0@me.com> References: <201502090620.t196KZSk040702@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.2070.6) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 08:05:45 -0000 On Feb 8, 2015, at 22:20, Rui Paulo wrote: >=20 > Author: rpaulo > Date: Mon Feb 9 06:20:34 2015 > New Revision: 278433 > URL: https://svnweb.freebsd.org/changeset/base/278433 >=20 > Log: > Merge xz 5.2.0. >=20 > This brings support for multi-threaded compression. This brings = close > N times faster compression where N is the number of CPU cores. > Because of this, liblzma now depends on libthr. For those that want to try it, this patch adds support to multi-threaded = compression when using lzma in libarchive: https://people.freebsd.org/~rpaulo/libarchive-lzma-mt.diff It uses all the available CPU cores by default. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 09:03:21 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A63AF97; Mon, 9 Feb 2015 09:03: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1834E61; Mon, 9 Feb 2015 09:03:20 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t1993F6W010954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Feb 2015 11:03:15 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t1993F6W010954 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t1993F1j010953; Mon, 9 Feb 2015 11:03:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 9 Feb 2015 11:03:15 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r278431 - head/sys/contrib/vchiq/interface/vchiq_arm Message-ID: <20150209090315.GD42409@kib.kiev.ua> References: <201502090231.t192VS6C060751@svn.freebsd.org> <20150209170045.S1037@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150209170045.S1037@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, Oleksandr Tymoshenko , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 09:03:21 -0000 On Mon, Feb 09, 2015 at 05:00:49PM +1100, Bruce Evans wrote: > On Mon, 9 Feb 2015, Oleksandr Tymoshenko wrote: > > > Log: > > Do not mark shared structures as __packed, it leads to race condition > > > > If structure packed as __packed clang (and probably gcc) generates > > code that loads word fields (e.g. tx_pos) byte-by-byte and if it's > > modified by VideoCore in the same time as ARM loads the value result > > is going to be mixed combination of bytes from previous value and > > new one. > > Most uses of __packed are bugs. It gives pessimizations as well as > non-atomic accesses for sub-object accesses. > > I think the full bugs only occur when arch has strict alignment > requirements and the alignment of the __packed objects is not known. > This means that only lesser bugs occur on x86 (unless you enable > alignment checking, but this arguably breaks the ABI). The compiler > just generates possibly-misaligned full-width accesses if the arch > doesn't have strict alignment requirements. Often the acceses turn > out to be aligned at runtime. Otherwise, the hardware does them > atomically, with a smaller efficiency penalty than split accesses. On x86 unaligned access is non-atomic. This was very visible on Core2 CPUs where DPCPU code mishandled the alignment, resulting in the mutexes from the per-cpu areas breaking badly. Modern CPUs should not lock several cache lines simultaneously either. From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 09:17:01 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A034777A; Mon, 9 Feb 2015 09:17: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C9D41FE; Mon, 9 Feb 2015 09:17:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t199H14i024074; Mon, 9 Feb 2015 09:17:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t199H1Bc024073; Mon, 9 Feb 2015 09:17:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201502090917.t199H1Bc024073@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Feb 2015 09:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278442 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 09:17:01 -0000 Author: delphij Date: Mon Feb 9 09:17:00 2015 New Revision: 278442 URL: https://svnweb.freebsd.org/changeset/base/278442 Log: Chase r278433: bump __FreeBSD_version for xz 5.2.0 which adds multi-thread capability to liblzma. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Feb 9 09:14:22 2015 (r278441) +++ head/sys/sys/param.h Mon Feb 9 09:17:00 2015 (r278442) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100058 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100059 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 09:51:13 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A00038F; Mon, 9 Feb 2015 09:51:13 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id DF50F869; Mon, 9 Feb 2015 09:51:12 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id C4EB4D66DAD; Mon, 9 Feb 2015 20:51:04 +1100 (AEDT) Date: Mon, 9 Feb 2015 20:51:02 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r278431 - head/sys/contrib/vchiq/interface/vchiq_arm In-Reply-To: <20150209090315.GD42409@kib.kiev.ua> Message-ID: <20150209203647.L1800@besplex.bde.org> References: <201502090231.t192VS6C060751@svn.freebsd.org> <20150209170045.S1037@besplex.bde.org> <20150209090315.GD42409@kib.kiev.ua> 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=baJSDo/B c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=lNZLphJAkYUQkshLDegA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, Oleksandr Tymoshenko , svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 09:51:13 -0000 On Mon, 9 Feb 2015, Konstantin Belousov wrote: > On Mon, Feb 09, 2015 at 05:00:49PM +1100, Bruce Evans wrote: >> On Mon, 9 Feb 2015, Oleksandr Tymoshenko wrote: >> ... >> I think the full bugs only occur when arch has strict alignment >> requirements and the alignment of the __packed objects is not known. >> This means that only lesser bugs occur on x86 (unless you enable >> alignment checking, but this arguably breaks the ABI). The compiler >> just generates possibly-misaligned full-width accesses if the arch >> doesn't have strict alignment requirements. Often the acceses turn >> out to be aligned at runtime. Otherwise, the hardware does them >> atomically, with a smaller efficiency penalty than split accesses. > > On x86 unaligned access is non-atomic. This was very visible on > Core2 CPUs where DPCPU code mishandled the alignment, resulting in > the mutexes from the per-cpu areas breaking badly. > > Modern CPUs should not lock several cache lines simultaneously either. Interesting. I thought that this was relatively easy to handle in hardware and required for compatibility, so hardware did it. This gives a reason other than efficiency to enable alignment checking so as to find all places that do misaligned accesses. I last tried this more than 20 years ago. Compilers mostly generated aligned accesses. One exception was for copying small (sub)structs. Inlining of the copy assumed maximal alignment or no alignment traps. Library functions are more of a problem. FreeBSD amd64 and i386 memcpy also assume this. Similarly for the MD mem* in the kernel. Mostly things are suitably aligned, so it is the correct optimization to not do extra work to align. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 09:56:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4B025A2; Mon, 9 Feb 2015 09:56: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0E3B8AD; Mon, 9 Feb 2015 09:56:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t199uMjV043365; Mon, 9 Feb 2015 09:56:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t199uMqd043364; Mon, 9 Feb 2015 09:56:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502090956.t199uMqd043364@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 9 Feb 2015 09:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278445 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 09:56:22 -0000 Author: gjb Date: Mon Feb 9 09:56:21 2015 New Revision: 278445 URL: https://svnweb.freebsd.org/changeset/base/278445 Log: Define FREEBSD_VERSION in release/Makefile, derived from sys/sys/param.h. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Feb 9 09:45:58 2015 (r278444) +++ head/release/Makefile Mon Feb 9 09:56:21 2015 (r278445) @@ -54,6 +54,10 @@ TARGET_ARCH= ${TARGET} IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} DISTDIR= dist +# Get the __FreeBSD_version for the build +FREEBSD_VERSION!= awk '/^\#define __FreeBSD_version/ {print $$3}' \ + ${.CURDIR}/../sys/sys/param.h + # Define OSRELEASE by using newvars.sh .if !defined(OSRELEASE) || empty(OSRELEASE) .for _V in TYPE BRANCH REVISION From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 10:09:46 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98A227C6; Mon, 9 Feb 2015 10:09:46 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BF4A9B5; Mon, 9 Feb 2015 10:09:46 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t19A9fCw033052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Feb 2015 12:09:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t19A9fCw033052 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t19A9fSp033051; Mon, 9 Feb 2015 12:09:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 9 Feb 2015 12:09:41 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r278431 - head/sys/contrib/vchiq/interface/vchiq_arm Message-ID: <20150209100940.GF42409@kib.kiev.ua> References: <201502090231.t192VS6C060751@svn.freebsd.org> <20150209170045.S1037@besplex.bde.org> <20150209090315.GD42409@kib.kiev.ua> <20150209203647.L1800@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150209203647.L1800@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, Oleksandr Tymoshenko , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 10:09:46 -0000 On Mon, Feb 09, 2015 at 08:51:02PM +1100, Bruce Evans wrote: > On Mon, 9 Feb 2015, Konstantin Belousov wrote: > > > On Mon, Feb 09, 2015 at 05:00:49PM +1100, Bruce Evans wrote: > >> On Mon, 9 Feb 2015, Oleksandr Tymoshenko wrote: > >> ... > >> I think the full bugs only occur when arch has strict alignment > >> requirements and the alignment of the __packed objects is not known. > >> This means that only lesser bugs occur on x86 (unless you enable > >> alignment checking, but this arguably breaks the ABI). The compiler > >> just generates possibly-misaligned full-width accesses if the arch > >> doesn't have strict alignment requirements. Often the acceses turn > >> out to be aligned at runtime. Otherwise, the hardware does them > >> atomically, with a smaller efficiency penalty than split accesses. > > > > On x86 unaligned access is non-atomic. This was very visible on > > Core2 CPUs where DPCPU code mishandled the alignment, resulting in > > the mutexes from the per-cpu areas breaking badly. > > > > Modern CPUs should not lock several cache lines simultaneously either. > > Interesting. I thought that this was relatively easy to handle in > hardware and required for compatibility, so hardware did it. Trying to lock to cache lines easily results in deadlock. FWIW, multi-socket Intel platforms are already deadlock-prone due to the cache, and have some facilities to debug this. > > This gives a reason other than efficiency to enable alignment checking > so as to find all places that do misaligned accesses. I last tried this > more than 20 years ago. Compilers mostly generated aligned accesses. > One exception was for copying small (sub)structs. Inlining of the copy > assumed maximal alignment or no alignment traps. Library functions are > more of a problem. FreeBSD amd64 and i386 memcpy also assume this. > Similarly for the MD mem* in the kernel. Mostly things are suitably > aligned, so it is the correct optimization to not do extra work to align. I also did experiments with preloadable dso which sets EFLAGS.AC bit. Last time I tried, it broke in the very early libc initialization code, due to unaligned access generated by compiler, as you described. This was with in-tree gcc. Tried with the clang-compiled world, I got SIGBUS due to unaligned access in ld-elf.so.1. AC does not work in ring 0, and Intel re-purposed the bit for kernel recently for 'security' theater. From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 10:42:29 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A9B3EC8; Mon, 9 Feb 2015 10:42: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C610D59; Mon, 9 Feb 2015 10:42:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19AgSDq066656; Mon, 9 Feb 2015 10:42:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19AgS9J066654; Mon, 9 Feb 2015 10:42:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502091042.t19AgS9J066654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 9 Feb 2015 10:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278449 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 10:42:29 -0000 Author: gjb Date: Mon Feb 9 10:42:27 2015 New Revision: 278449 URL: https://svnweb.freebsd.org/changeset/base/278449 Log: Enable multi-threaded xz(1) compression, after r278433. Allow multi-threaded xz(1) to be turned off by specifying NO_XZTHREADS, and allow number of threads to be overridden by specifying XZ_THREADS=N. MFC after: 1 week X-MFC-needs: r278433 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile head/release/Makefile.vm Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Feb 9 10:38:52 2015 (r278448) +++ head/release/Makefile Mon Feb 9 10:42:27 2015 (r278449) @@ -33,6 +33,9 @@ # with xz(1) (extremely time consuming) # WITH_CLOUDWARE: if set, build cloud hosting disk images with the release # TARGET/TARGET_ARCH: architecture of built release +# XZ_FLAGS: Additional arguments to pass to xz(1) +# XZ_THREADS: Number of xz(1) threads to use +# NO_XZTHREADS: Disable multi-threaded xz(1) compression # WORLDDIR?= ${.CURDIR}/.. @@ -40,6 +43,8 @@ PORTSDIR?= /usr/ports DOCDIR?= /usr/doc RELNOTES_LANG?= en_US.ISO8859-1 XZCMD?= /usr/bin/xz +XZ_FLAGS?= +XZ_THREADS?= .if !defined(TARGET) || empty(TARGET) TARGET= ${MACHINE} @@ -58,6 +63,15 @@ DISTDIR= dist FREEBSD_VERSION!= awk '/^\#define __FreeBSD_version/ {print $$3}' \ ${.CURDIR}/../sys/sys/param.h +.if !defined(NO_XZTHREADS) && empty(XZ_THREADS) +XZ_THREADS= 0 +.else +XZ_THREADS= ${XZ_THREADS} +.endif +.if !empty(XZ_THREADS) +XZ_FLAGS+= -T ${XZ_THREADS} +.endif + # Define OSRELEASE by using newvars.sh .if !defined(OSRELEASE) || empty(OSRELEASE) .for _V in TYPE BRANCH REVISION @@ -299,7 +313,7 @@ release-install: .for I in ${IMAGES} cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} . if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) - ${XZCMD} -k ${DESTDIR}/${OSRELEASE}-${I} + ${XZCMD} ${XZ_FLAGS} -k ${DESTDIR}/${OSRELEASE}-${I} . endif .endfor cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Mon Feb 9 10:38:52 2015 (r278448) +++ head/release/Makefile.vm Mon Feb 9 10:42:27 2015 (r278449) @@ -101,7 +101,7 @@ vm-install: # the DESTDIR. . for FORMAT in ${VMFORMATS} # Don't keep the originals. There is a copy in ${.OBJDIR} if needed. - ${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} + ${XZCMD} ${XZ_FLAGS} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} . endfor . endif cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \ From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 10:46:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0670CFF; Mon, 9 Feb 2015 10:46:40 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E66E4D9E; Mon, 9 Feb 2015 10:46:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19AkdcL067272; Mon, 9 Feb 2015 10:46:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19AkdCM067270; Mon, 9 Feb 2015 10:46:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502091046.t19AkdCM067270@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 9 Feb 2015 10:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278450 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 10:46:40 -0000 Author: gjb Date: Mon Feb 9 10:46:39 2015 New Revision: 278450 URL: https://svnweb.freebsd.org/changeset/base/278450 Log: Revert r278445. I was going to use __FreeBSD_version to determine if xz(1) should be multi-threaded by default, but doing this will cause problems if/when the changes are merged from head. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Feb 9 10:42:27 2015 (r278449) +++ head/release/Makefile Mon Feb 9 10:46:39 2015 (r278450) @@ -59,10 +59,6 @@ TARGET_ARCH= ${TARGET} IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} DISTDIR= dist -# Get the __FreeBSD_version for the build -FREEBSD_VERSION!= awk '/^\#define __FreeBSD_version/ {print $$3}' \ - ${.CURDIR}/../sys/sys/param.h - .if !defined(NO_XZTHREADS) && empty(XZ_THREADS) XZ_THREADS= 0 .else From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 11:34:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3273D5A; Mon, 9 Feb 2015 11:34: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA27438E; Mon, 9 Feb 2015 11:34:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19BYkUP090688; Mon, 9 Feb 2015 11:34:46 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19BYkaN090687; Mon, 9 Feb 2015 11:34:46 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201502091134.t19BYkaN090687@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 9 Feb 2015 11:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278452 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 11:34:47 -0000 Author: bz Date: Mon Feb 9 11:34:45 2015 New Revision: 278452 URL: https://svnweb.freebsd.org/changeset/base/278452 Log: Properly hide a variable under #ifdef as it is only used inside the specific #ifdef block otherwise leaving an unused variable and breaking other kernel builds. Modified: head/sys/powerpc/pseries/platform_chrp.c Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Mon Feb 9 11:11:17 2015 (r278451) +++ head/sys/powerpc/pseries/platform_chrp.c Mon Feb 9 11:34:45 2015 (r278452) @@ -124,9 +124,9 @@ chrp_probe(platform_t plat) static int chrp_attach(platform_t plat) { +#ifdef __powerpc64__ int i; -#ifdef __powerpc64__ /* XXX: check for /rtas/ibm,hypertas-functions? */ if (!(mfmsr() & PSL_HV)) { struct mem_region *phys, *avail; From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 12:25:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CECC96DE; Mon, 9 Feb 2015 12:25:43 +0000 (UTC) Date: Mon, 9 Feb 2015 12:25:40 +0000 From: Glen Barber To: Rui Paulo Subject: Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... Message-ID: <20150209122540.GE84467@hub.FreeBSD.org> References: <201502090620.t196KZSk040702@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3Gf/FFewwPeBMqCJ" Content-Disposition: inline In-Reply-To: <201502090620.t196KZSk040702@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 12:25:44 -0000 --3Gf/FFewwPeBMqCJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 09, 2015 at 06:20:35AM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Mon Feb 9 06:20:34 2015 > New Revision: 278433 > URL: https://svnweb.freebsd.org/changeset/base/278433 >=20 > Log: > Merge xz 5.2.0. > =20 > This brings support for multi-threaded compression. This brings close > N times faster compression where N is the number of CPU cores. > Because of this, liblzma now depends on libthr. > =20 This is fantastic, thank you for doing this update. FWIW, compressing VM images (some sparse files, some not) would take upwards of 45 minutes, which after this update, just takes a few minutes. root@releng2:/R2/vmimages # time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.qco= w2 \ time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.raw; \ time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vhd; \ time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vmdk 1027.602u 40.376s 1:09.57 1535.1% 81+192k 0+19774io 0pf+0w 1032.978u 38.823s 1:08.17 1572.2% 81+192k 0+19696io 0pf+0w 1033.908u 38.593s 1:11.70 1495.8% 81+192k 0+19729io 0pf+0w 1091.749u 42.371s 1:04.27 1764.6% 81+192k 0+19751io 0pf+0w Glen --3Gf/FFewwPeBMqCJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJU2KdEAAoJEAMUWKVHj+KTUtEP+wcJ6xOcamqEv2Ye/pIN/5oo yrnBI73D1/84IsPzEfeCANwcgbXyuNC/KXWWo9kQCD8RNEWUBrsWGIqZc4QGALe3 JG+kL86EZlXwYd10/BLfajVOn7RhqET8WUKd9Q2Ns6r3j30UlEqgQZvQ4DVu1s2C hburyqn/SzUk6mLTVwjXqvxef8GKuVReLj2FLWV19hIkcfgZJnJGKXvbCj7n4o2V ZtfHglrKibxDs3ISbNcdh9LVqXvTP4mQQZHYFWG3LJKLhUz6JpJuZNHFe4ZfqVNT 0H681M/n81iVMDYDeRqHi3PKiVL5/9U3C+c7QVSrqWlj+TyZHP73XW9I35p/4glf 0ESriI4EhuPQrsuIu1ihX6wIdkfH16ggJnyUEY1kUhgr7GvqdawXu9IqfVkWC6YU 6FkUfsOwvlzvLAYhWR30uoHLPaQ+xCFRrY1Szz8hbc0kPXTwuPOOeQ8aUF6GeoCq q/sbnY2wvdE7zy7aieQnXlvAtNDDnQzckE96CSdPfqhX9QNKKOx6UK6fCrlIMKfy mB5SVdKjYJmC/4kyrKjEnKonU3u+5HCxR31rlesvNRZomaU5NsIMu5v3zjV6URAs JvU4sB/sEnxHNZ5P2PPNh5JEs8+e/kIcCY02B96Ax5+8XQ3EjQKPVFk1ygUyxJ/o vydxMj0KgLzh+WGQWOpo =CrXP -----END PGP SIGNATURE----- --3Gf/FFewwPeBMqCJ-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 12:31:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65E138DC; Mon, 9 Feb 2015 12:31:02 +0000 (UTC) Date: Mon, 9 Feb 2015 12:30:57 +0000 From: Glen Barber To: Rui Paulo Subject: Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... Message-ID: <20150209123057.GF84467@hub.FreeBSD.org> References: <201502090620.t196KZSk040702@svn.freebsd.org> <20150209122540.GE84467@hub.FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GxcwvYAGnODwn7V8" Content-Disposition: inline In-Reply-To: <20150209122540.GE84467@hub.FreeBSD.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 12:31:03 -0000 --GxcwvYAGnODwn7V8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 09, 2015 at 12:25:40PM +0000, Glen Barber wrote: > On Mon, Feb 09, 2015 at 06:20:35AM +0000, Rui Paulo wrote: > > Author: rpaulo > > Date: Mon Feb 9 06:20:34 2015 > > New Revision: 278433 > > URL: https://svnweb.freebsd.org/changeset/base/278433 > >=20 > > Log: > > Merge xz 5.2.0. > > =20 > > This brings support for multi-threaded compression. This brings close > > N times faster compression where N is the number of CPU cores. > > Because of this, liblzma now depends on libthr. > > =20 >=20 > This is fantastic, thank you for doing this update. >=20 > FWIW, compressing VM images (some sparse files, some not) would take > upwards of 45 minutes, which after this update, just takes a few > minutes. >=20 > root@releng2:/R2/vmimages # time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.q= cow2 \ > time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.raw; \ > time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vhd; \ > time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vmdk > 1027.602u 40.376s 1:09.57 1535.1% 81+192k 0+19774io 0pf+0w > 1032.978u 38.823s 1:08.17 1572.2% 81+192k 0+19696io 0pf+0w > 1033.908u 38.593s 1:11.70 1495.8% 81+192k 0+19729io 0pf+0w > 1091.749u 42.371s 1:04.27 1764.6% 81+192k 0+19751io 0pf+0w >=20 I meant to include that this is on a 48-core machine. Glen --GxcwvYAGnODwn7V8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJU2KiBAAoJEAMUWKVHj+KTEPoQAKPk/fulNsmA7Uw6HagIIsf1 j0I0LZJCyew/oNuDCTOUjb5dpfRoADhnztnemCL4ioXm2uf+NltAn8SWKVCn/wFR 7dPJniyb9mYJE3ZSOeYI6ieYOlsbDiezypFiJxtOugnk9hTeogsOHolZaW//I1R+ k+S/degFYiBPAbnjfzmgeggi5YsHBbmFXI/mYcMggDf7CiWN6fS5yuWVqnsOOPRK 4RFVsRSYJlP0Bg74knT64WSpVpAbGDvVLe8EQcA6wB5gBS8zPQe59DJI29icaXP0 +LCpeM2Y395HL8M3irQH01Aor8zUAkF9jw0JGDFA/fyeUThM4mxDi08JK2f8C+gC VqWSsud2Xjp+9mfTk+aiKISqGGfbnGS4DuBATdSLgxKbfrvkjZr9YQ9fxRRSA6oy 2q7Eel1wYOtBopjFdElZhQcA2mTMzNV5nrc9NXeazjCPTbt058fcMQoasEFOn3zc Dhy1ty8I8BWlJ4ziPI48+E7T4f2gegWNvaJDItDnRpxY6lJrgmxZSWTJdIqAB7fE q/rxWCI3KgCiegrM+XIzXWMNqZugRZVJAdCx8ToO9C6B6KTUN4iUDhnBtt+3rlxX fulXnZij+3KnQn381OHFml2xEiROEzdB+/B0OyduD9Eb1gLDjuFZXTAdV6fTabPA YQx+Pgj0VBPoH3UG90Br =CCHA -----END PGP SIGNATURE----- --GxcwvYAGnODwn7V8-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 13:11:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 449F2351; Mon, 9 Feb 2015 13:11:37 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98C49F4E; Mon, 9 Feb 2015 13:11:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id t19D80RH096398; Mon, 9 Feb 2015 16:09:00 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Mon, 9 Feb 2015 16:08:00 +0300 (MSK) From: Dmitry Morozovsky To: Glen Barber Subject: Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... In-Reply-To: <20150209123057.GF84467@hub.FreeBSD.org> Message-ID: References: <201502090620.t196KZSk040702@svn.freebsd.org> <20150209122540.GE84467@hub.FreeBSD.org> <20150209123057.GF84467@hub.FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Mon, 09 Feb 2015 16:09:07 +0300 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 13:11:37 -0000 Glen, On Mon, 9 Feb 2015, Glen Barber wrote: > > > Log: > > > Merge xz 5.2.0. > > > > > > This brings support for multi-threaded compression. This brings close > > > N times faster compression where N is the number of CPU cores. > > > Because of this, liblzma now depends on libthr. > > > > This is fantastic, thank you for doing this update. > > > > FWIW, compressing VM images (some sparse files, some not) would take > > upwards of 45 minutes, which after this update, just takes a few > > minutes. > > > > root@releng2:/R2/vmimages # time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.qcow2 \ > > time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.raw; \ > > time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vhd; \ > > time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vmdk > > 1027.602u 40.376s 1:09.57 1535.1% 81+192k 0+19774io 0pf+0w > > 1032.978u 38.823s 1:08.17 1572.2% 81+192k 0+19696io 0pf+0w > > 1033.908u 38.593s 1:11.70 1495.8% 81+192k 0+19729io 0pf+0w > > 1091.749u 42.371s 1:04.27 1764.6% 81+192k 0+19751io 0pf+0w > > > > I meant to include that this is on a 48-core machine. Hm, I can't beleive you didn't use pxz ;) Anyway, having this in base, and not depending on external tool, is amazingly great. BTW, Rui, did you some comparative tests with pxz? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 15:58:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C60119DF; Mon, 9 Feb 2015 15:58: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 979B83B2; Mon, 9 Feb 2015 15:58:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19FwSZL013253; Mon, 9 Feb 2015 15:58:28 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19FwSfu013252; Mon, 9 Feb 2015 15:58:28 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502091558.t19FwSfu013252@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 9 Feb 2015 15:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278456 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 15:58:28 -0000 Author: nwhitehorn Date: Mon Feb 9 15:58:27 2015 New Revision: 278456 URL: https://svnweb.freebsd.org/changeset/base/278456 Log: Mark invalid page table entries correctly for PMAP as well as for the hypervisor. This prevents an infinite loop where processes with evicted pages would page fault forever when PMAP decided the evicted pages on which the process was faulting was actually present and did not need to be restored. Found while building LLVM with make -j32. Sponsored by: FreeBSD Foundation Modified: head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Mon Feb 9 13:41:29 2015 (r278455) +++ head/sys/powerpc/pseries/mmu_phyp.c Mon Feb 9 15:58:27 2015 (r278456) @@ -240,6 +240,7 @@ mphyp_pte_unset(mmu_t mmu, uintptr_t slo uint64_t junk; int err; + pvo_pt->pte_hi &= ~LPTE_VALID; err = phyp_pft_hcall(H_REMOVE, 1UL << 31, slot, pvo_pt->pte_hi & LPTE_AVPN_MASK, 0, &pte.pte_hi, &pte.pte_lo, &junk); @@ -265,6 +266,7 @@ mphyp_pte_change(mmu_t mmu, uintptr_t sl /* XXX: optimization using H_PROTECT for common case? */ mphyp_pte_unset(mmu, slot, pvo_pt, vpn); + pvo_pt->pte_hi |= LPTE_VALID; result = phyp_pft_hcall(H_ENTER, H_EXACT, slot, pvo_pt->pte_hi, pvo_pt->pte_lo, &index, &evicted.pte_lo, &junk); if (result != H_SUCCESS) @@ -286,7 +288,7 @@ mphyp_pte_spillable_ident(u_int ptegidx, phyp_pft_hcall(H_READ, 0, slot, 0, 0, &pt.pte_hi, &pt.pte_lo, &junk); - if (pt.pte_hi & LPTE_SWBITS) + if (pt.pte_hi & LPTE_WIRED) continue; /* This is a candidate, so remember it */ @@ -391,7 +393,7 @@ mphyp_pte_insert(mmu_t mmu, u_int ptegid } } - KASSERT(pvo->pvo_pte.lpte.pte_hi == evicted.pte_hi, + KASSERT((pvo->pvo_pte.lpte.pte_hi | LPTE_VALID) == evicted.pte_hi, ("Unable to find PVO for spilled PTE")); /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:00:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99498BB4; Mon, 9 Feb 2015 16:00:50 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E172645; Mon, 9 Feb 2015 16:00:50 +0000 (UTC) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.14.9) with ESMTPSA id t19FobEk032425 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 9 Feb 2015 07:50:37 -0800 Message-ID: <54D8D74C.2000803@freebsd.org> Date: Mon, 09 Feb 2015 07:50:36 -0800 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278452 - head/sys/powerpc/pseries References: <201502091134.t19BYkaN090687@svn.freebsd.org> In-Reply-To: <201502091134.t19BYkaN090687@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVa56PQnebpu3PllVWlq6F7lrUB+0gKXYPHPXDPFc3Q6LLrRQ7iAq4RR9cg8OmuxgT8FPqJDsbY1Cg2KUzx3WwQU7+G+0zNYWKA= X-Sonic-ID: C;+jPSY3Ow5BGy/mS47jkJAQ== M;mMUpZHOw5BGy/mS47jkJAQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:00:50 -0000 Thank you -- sorry for missing this! -Nathan On 02/09/15 03:34, Bjoern A. Zeeb wrote: > Author: bz > Date: Mon Feb 9 11:34:45 2015 > New Revision: 278452 > URL: https://svnweb.freebsd.org/changeset/base/278452 > > Log: > Properly hide a variable under #ifdef as it is only used inside the > specific #ifdef block otherwise leaving an unused variable and breaking > other kernel builds. > > Modified: > head/sys/powerpc/pseries/platform_chrp.c > > Modified: head/sys/powerpc/pseries/platform_chrp.c > ============================================================================== > --- head/sys/powerpc/pseries/platform_chrp.c Mon Feb 9 11:11:17 2015 (r278451) > +++ head/sys/powerpc/pseries/platform_chrp.c Mon Feb 9 11:34:45 2015 (r278452) > @@ -124,9 +124,9 @@ chrp_probe(platform_t plat) > static int > chrp_attach(platform_t plat) > { > +#ifdef __powerpc64__ > int i; > > -#ifdef __powerpc64__ > /* XXX: check for /rtas/ibm,hypertas-functions? */ > if (!(mfmsr() & PSL_HV)) { > struct mem_region *phys, *avail; > From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:03:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76D13DA1; Mon, 9 Feb 2015 16:03: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53F1167A; Mon, 9 Feb 2015 16:03:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19G3uH9017473; Mon, 9 Feb 2015 16:03:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19G3tB1017471; Mon, 9 Feb 2015 16:03:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502091603.t19G3tB1017471@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Feb 2015 16:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278457 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:03:56 -0000 Author: imp Date: Mon Feb 9 16:03:55 2015 New Revision: 278457 URL: https://svnweb.freebsd.org/changeset/base/278457 Log: Enforce that MK_foo options shall be either "yes" or "no" and nothing else. Modified: head/share/mk/bsd.mkopt.mk head/sys/conf/kern.opts.mk Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Mon Feb 9 15:58:27 2015 (r278456) +++ head/share/mk/bsd.mkopt.mk Mon Feb 9 16:03:55 2015 (r278457) @@ -33,7 +33,11 @@ MK_${var}:= no .else MK_${var}:= yes .endif +.else +.if ${MK_${var}} != "yes" && ${MK_${var}} != "no" +.error "Illegal value for MK_${var}: ${MK_${var}}" .endif +.endif # !defined(MK_${var}) .endfor .undef __DEFAULT_YES_OPTIONS @@ -47,6 +51,10 @@ MK_${var}:= yes .else MK_${var}:= no .endif +.else +.if ${MK_${var}} != "yes" && ${MK_${var}} != "no" +.error "Illegal value for MK_${var}: ${MK_${var}}" .endif +.endif # !defined(MK_${var}) .endfor .undef __DEFAULT_NO_OPTIONS Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Mon Feb 9 15:58:27 2015 (r278456) +++ head/sys/conf/kern.opts.mk Mon Feb 9 16:03:55 2015 (r278457) @@ -58,7 +58,11 @@ MK_${var}:= no .else MK_${var}:= yes .endif +.else +.if ${MK_${var}} != "yes" && ${MK_${var}} != "no" +.error "Illegal value for MK_${var}: ${MK_${var}}" .endif +.endif # !defined(MK_${var}) .endfor .undef __DEFAULT_YES_OPTIONS @@ -70,7 +74,11 @@ MK_${var}:= yes .else MK_${var}:= no .endif +.else +.if ${MK_${var}} != "yes" && ${MK_${var}} != "no" +.error "Illegal value for MK_${var}: ${MK_${var}}" .endif +.endif # !defined(MK_${var}) .endfor .undef __DEFAULT_NO_OPTIONS From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:04:00 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5447DE78; Mon, 9 Feb 2015 16: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 413DD67C; Mon, 9 Feb 2015 16:04:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19G40pm017529; Mon, 9 Feb 2015 16:04:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19G40Tx017523; Mon, 9 Feb 2015 16:04:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502091604.t19G40Tx017523@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Feb 2015 16:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278458 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:04:00 -0000 Author: imp Date: Mon Feb 9 16:03:59 2015 New Revision: 278458 URL: https://svnweb.freebsd.org/changeset/base/278458 Log: Pass MODULES_EXTRA to the modules build. While I'm here, also always pass WITHOUT_MODULES down. There's no need to make this conditional. Submitted by: Guy Yur Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Mon Feb 9 16:03:55 2015 (r278457) +++ head/sys/conf/kern.pre.mk Mon Feb 9 16:03:59 2015 (r278458) @@ -186,15 +186,13 @@ SYSTEM_DEP+= ${LDSCRIPT} MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH} MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} +MKMODULESENV+= MODULES_EXTRA=${MODULES_EXTRA} WITHOUT_MODULES=${WITHOUT_MODULES} .if (${KERN_IDENT} == LINT) MKMODULESENV+= ALL_MODULES=LINT .endif .if defined(MODULES_OVERRIDE) MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}" .endif -.if defined(WITHOUT_MODULES) -MKMODULESENV+= WITHOUT_MODULES="${WITHOUT_MODULES}" -.endif .if defined(DEBUG) MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" .endif From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:04:02 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BB1BF4C; Mon, 9 Feb 2015 16:04: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4927667D; Mon, 9 Feb 2015 16:04:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19G42Z6017583; Mon, 9 Feb 2015 16:04:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19G42C6017582; Mon, 9 Feb 2015 16:04:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502091604.t19G42C6017582@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Feb 2015 16:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278459 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:04:02 -0000 Author: imp Date: Mon Feb 9 16:04:01 2015 New Revision: 278459 URL: https://svnweb.freebsd.org/changeset/base/278459 Log: Make sure that we define DTB{OWN,GRP,MODE} so install works. Submitted by: Guy Yur Modified: head/sys/conf/dtb.mk Modified: head/sys/conf/dtb.mk ============================================================================== --- head/sys/conf/dtb.mk Mon Feb 9 16:03:59 2015 (r278458) +++ head/sys/conf/dtb.mk Mon Feb 9 16:04:01 2015 (r278459) @@ -46,6 +46,9 @@ SYSDIR= ${_dir} .PATH: ${SYSDIR}/gnu/dts/${MACHINE} ${SYSDIR}/boot/fdt/dts/${MACHINE} DTBDIR?=/boot/dtb +DTBOWN?=root +DTBGRP?=wheel +DTBMODE?=444 DTB=${DTS:R:S/$/.dtb/} all: ${DTB} From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:04:09 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D738A12C; Mon, 9 Feb 2015 16:04: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4C2E682; Mon, 9 Feb 2015 16:04:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19G49fM017651; Mon, 9 Feb 2015 16:04:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19G49Yh017650; Mon, 9 Feb 2015 16:04:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502091604.t19G49Yh017650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Feb 2015 16:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278460 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:04:09 -0000 Author: imp Date: Mon Feb 9 16:04:08 2015 New Revision: 278460 URL: https://svnweb.freebsd.org/changeset/base/278460 Log: We need to create /boot/dtb since some use cases don't create a full root with BSD.root.mtree, so it often times will not exist. Rather than force the latter for an installkernel, just create the directory with a comment about why. Submitted by: Guy Yur Modified: head/sys/conf/dtb.mk Modified: head/sys/conf/dtb.mk ============================================================================== --- head/sys/conf/dtb.mk Mon Feb 9 16:04:01 2015 (r278459) +++ head/sys/conf/dtb.mk Mon Feb 9 16:04:08 2015 (r278460) @@ -67,6 +67,10 @@ CLEANFILES+=${_dts:R:S/$/.dtb/} realinstall: _dtbinstall .ORDER: beforeinstall _kmodinstall _dtbinstall: +# Need to create this because installkernel doens't invoke mtree with BSD.root.mtree +# to make sure the tree is setup properly. This may break ownership of ${DTBDIR} +# for no-root build. + mkdir -p ${DESTDIR}${DTBDIR} .for _dtb in ${DTB} ${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \ ${_INSTALLFLAGS} ${_dtb} ${DESTDIR}${DTBDIR} From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:10:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0393F964; Mon, 9 Feb 2015 16:10: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E457B758; Mon, 9 Feb 2015 16:10:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19GAUe4019257; Mon, 9 Feb 2015 16:10:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19GAUv5019256; Mon, 9 Feb 2015 16:10:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502091610.t19GAUv5019256@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Feb 2015 16:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278461 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:10:31 -0000 Author: imp Date: Mon Feb 9 16:10:30 2015 New Revision: 278461 URL: https://svnweb.freebsd.org/changeset/base/278461 Log: Fix typo. Submitted by: jhb@ Modified: head/sys/conf/dtb.mk Modified: head/sys/conf/dtb.mk ============================================================================== --- head/sys/conf/dtb.mk Mon Feb 9 16:04:08 2015 (r278460) +++ head/sys/conf/dtb.mk Mon Feb 9 16:10:30 2015 (r278461) @@ -67,7 +67,7 @@ CLEANFILES+=${_dts:R:S/$/.dtb/} realinstall: _dtbinstall .ORDER: beforeinstall _kmodinstall _dtbinstall: -# Need to create this because installkernel doens't invoke mtree with BSD.root.mtree +# Need to create this because installkernel doesn't invoke mtree with BSD.root.mtree # to make sure the tree is setup properly. This may break ownership of ${DTBDIR} # for no-root build. mkdir -p ${DESTDIR}${DTBDIR} From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:16:39 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1F19E70; Mon, 9 Feb 2015 16:16:39 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A88EA82E; Mon, 9 Feb 2015 16:16:39 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B6989B91E; Mon, 9 Feb 2015 11:16:38 -0500 (EST) From: John Baldwin To: Rui Paulo Subject: Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... Date: Mon, 09 Feb 2015 11:16:13 -0500 Message-ID: <46013627.EoFa6fsn0l@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201502090620.t196KZSk040702@svn.freebsd.org> References: <201502090620.t196KZSk040702@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Feb 2015 11:16:38 -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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:16:39 -0000 On Monday, February 09, 2015 06:20:35 AM Rui Paulo wrote: > Author: rpaulo > Date: Mon Feb 9 06:20:34 2015 > New Revision: 278433 > URL: https://svnweb.freebsd.org/changeset/base/278433 > > Log: > Merge xz 5.2.0. > > This brings support for multi-threaded compression. This brings close > N times faster compression where N is the number of CPU cores. > Because of this, liblzma now depends on libthr. > > Soon libarchive will be modified to use the new lzma API. > > Thanks to antoine@ for the exp-run. It looks like this uses hw.ncpu to determine the number of cores. Can you make this cpuset friendly by querying the current process's CPU mask and counting the cores it contains instead? Somethign like: cpuset_t set; cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, &set, sizeof(set)); (I have a CPU_COUNT() macro I should commit that will then let you do:) ncpus = CPU_COUNT(&set); -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:17:42 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 285BFFE8; Mon, 9 Feb 2015 16:17:42 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id 03B7783C; Mon, 9 Feb 2015 16:17:41 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 1BB135A9F25; Mon, 9 Feb 2015 16:17:41 +0000 (UTC) Date: Mon, 9 Feb 2015 16:17:41 +0000 From: Brooks Davis To: Warner Losh Subject: Re: svn commit: r278460 - head/sys/conf Message-ID: <20150209161740.GA39452@spindle.one-eyed-alien.net> References: <201502091604.t19G49Yh017650@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <201502091604.t19G49Yh017650@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:17:42 -0000 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 09, 2015 at 04:04:09PM +0000, Warner Losh wrote: > Author: imp > Date: Mon Feb 9 16:04:08 2015 > New Revision: 278460 > URL: https://svnweb.freebsd.org/changeset/base/278460 >=20 > Log: > We need to create /boot/dtb since some use cases don't create a full > root with BSD.root.mtree, so it often times will not exist. Rather > than force the latter for an installkernel, just create the directory > with a comment about why. > =20 > Submitted by: Guy Yur >=20 > Modified: > head/sys/conf/dtb.mk >=20 > Modified: head/sys/conf/dtb.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/dtb.mk Mon Feb 9 16:04:01 2015 (r278459) > +++ head/sys/conf/dtb.mk Mon Feb 9 16:04:08 2015 (r278460) > @@ -67,6 +67,10 @@ CLEANFILES+=3D${_dts:R:S/$/.dtb/} > realinstall: _dtbinstall > .ORDER: beforeinstall _kmodinstall > _dtbinstall: > +# Need to create this because installkernel doens't invoke mtree with BS= D.root.mtree > +# to make sure the tree is setup properly. This may break ownership of $= {DTBDIR} > +# for no-root build. > + mkdir -p ${DESTDIR}${DTBDIR} You could use -d avoid the ownership issue in the no-root case, but then yo= u'll end up with duplicate ${DTBDIR} entries if you have run installworld. Conditional= creation might be the least bad solution. i.e.: test -d ${DESTDIR}${DTBDIR} || ${INSTALL} -d -u root -g wheel ${DESTDIR}${D= TBDIR} -- Brooks --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTY3aMACgkQXY6L6fI4GtS0gwCeLjEomuYL+W6SbiYM1UXWu2Vu QcoAoLf9iXTRdVnRpyMAWrTG5U4vHz1c =04Gi -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:21:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB5C02E1; Mon, 9 Feb 2015 16:21: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B77538FD; Mon, 9 Feb 2015 16:21:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19GLo2m026890; Mon, 9 Feb 2015 16:21:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19GLoHW026888; Mon, 9 Feb 2015 16:21:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502091621.t19GLoHW026888@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Feb 2015 16:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278462 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:21:50 -0000 Author: imp Date: Mon Feb 9 16:21:49 2015 New Revision: 278462 URL: https://svnweb.freebsd.org/changeset/base/278462 Log: Move these definitions to bsd.own.mk along side the kernel directory / user defines. Make this work with WITH_INSTALL_AS_USER as well. Noticed by: ian@ Modified: head/share/mk/bsd.own.mk head/sys/conf/dtb.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Feb 9 16:10:30 2015 (r278461) +++ head/share/mk/bsd.own.mk Mon Feb 9 16:21:49 2015 (r278462) @@ -141,7 +141,7 @@ _uid!= id -u USER!= id -un .endif _gid!= id -gn -.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE +.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE $xOWN= ${USER} $xGRP= ${_gid} .endfor @@ -164,6 +164,10 @@ KMODDIR?= /boot/kernel KMODOWN?= ${BINOWN} KMODGRP?= ${BINGRP} KMODMODE?= ${BINMODE} +DTBDIR?= /boot/dtb +DTBOWN?= root +DTBGRP?= wheel +DTBMODE?= 444 LIBDIR?= /usr/lib LIBCOMPATDIR?= /usr/lib/compat Modified: head/sys/conf/dtb.mk ============================================================================== --- head/sys/conf/dtb.mk Mon Feb 9 16:10:30 2015 (r278461) +++ head/sys/conf/dtb.mk Mon Feb 9 16:21:49 2015 (r278462) @@ -45,10 +45,6 @@ SYSDIR= ${_dir} .PATH: ${SYSDIR}/gnu/dts/${MACHINE} ${SYSDIR}/boot/fdt/dts/${MACHINE} -DTBDIR?=/boot/dtb -DTBOWN?=root -DTBGRP?=wheel -DTBMODE?=444 DTB=${DTS:R:S/$/.dtb/} all: ${DTB} From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:29:45 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE8F37D8; Mon, 9 Feb 2015 16:29: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAF8397A; Mon, 9 Feb 2015 16:29:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19GTjNR028329; Mon, 9 Feb 2015 16:29:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19GTjCL028328; Mon, 9 Feb 2015 16:29:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502091629.t19GTjCL028328@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Feb 2015 16:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278463 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:29:46 -0000 Author: imp Date: Mon Feb 9 16:29:44 2015 New Revision: 278463 URL: https://svnweb.freebsd.org/changeset/base/278463 Log: Prefer install over mkdir to create the directory. Add test to ensure the directory doesn't exist before creating it. This makes the NO_ROOT case actually work. Suggested by: brooks@ Modified: head/sys/conf/dtb.mk Modified: head/sys/conf/dtb.mk ============================================================================== --- head/sys/conf/dtb.mk Mon Feb 9 16:21:49 2015 (r278462) +++ head/sys/conf/dtb.mk Mon Feb 9 16:29:44 2015 (r278463) @@ -64,9 +64,9 @@ realinstall: _dtbinstall .ORDER: beforeinstall _kmodinstall _dtbinstall: # Need to create this because installkernel doesn't invoke mtree with BSD.root.mtree -# to make sure the tree is setup properly. This may break ownership of ${DTBDIR} -# for no-root build. - mkdir -p ${DESTDIR}${DTBDIR} +# to make sure the tree is setup properly. We don't recreate it to avoid duplicate +# entries in the NO_ROOT case. + test -d ${DESTDIR}${DTBDIR} || ${INSTALL} -d -o ${DTBOWN} -g ${DTBGRP} ${DESTDIR}${DTBDIR} .for _dtb in ${DTB} ${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \ ${_INSTALLFLAGS} ${_dtb} ${DESTDIR}${DTBDIR} From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:41:51 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B969DC0; Mon, 9 Feb 2015 16:41:51 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DB13B5A; Mon, 9 Feb 2015 16:41:50 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJI00DFGJPIBE40@st11p02mm-asmtp001.mac.com>; Mon, 09 Feb 2015 16:41:45 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-09_02:2015-02-09,2015-02-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502090169 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... From: Rui Paulo In-reply-to: <46013627.EoFa6fsn0l@ralph.baldwin.cx> Date: Mon, 09 Feb 2015 08:41:42 -0800 Content-transfer-encoding: quoted-printable Message-id: <663179A3-95DD-4BC2-B645-1187CCF0DAA3@me.com> References: <201502090620.t196KZSk040702@svn.freebsd.org> <46013627.EoFa6fsn0l@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:41:51 -0000 On Feb 9, 2015, at 08:16, John Baldwin wrote: >=20 > On Monday, February 09, 2015 06:20:35 AM Rui Paulo wrote: >> Author: rpaulo >> Date: Mon Feb 9 06:20:34 2015 >> New Revision: 278433 >> URL: https://svnweb.freebsd.org/changeset/base/278433 >>=20 >> Log: >> Merge xz 5.2.0. >>=20 >> This brings support for multi-threaded compression. This brings = close >> N times faster compression where N is the number of CPU cores. >> Because of this, liblzma now depends on libthr. >>=20 >> Soon libarchive will be modified to use the new lzma API. >>=20 >> Thanks to antoine@ for the exp-run. >=20 > It looks like this uses hw.ncpu to determine the number of cores. Can = you=20 > make this cpuset friendly by querying the current process's CPU mask = and=20 > counting the cores it contains instead? >=20 > Somethign like: >=20 > cpuset_t set; >=20 > cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, &set, = sizeof(set)); >=20 > (I have a CPU_COUNT() macro I should commit that will then let you = do:) >=20 > ncpus =3D CPU_COUNT(&set); Yes, makes sense. I'll wait for CPU_COUNT(). -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:44:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA1B7E2; Mon, 9 Feb 2015 16:44:57 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E697BD3; Mon, 9 Feb 2015 16:44:57 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJI00D82JUPPU40@st11p02mm-asmtp001.mac.com>; Mon, 09 Feb 2015 16:44:52 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-09_02:2015-02-09,2015-02-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502090169 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278450 - head/release From: Rui Paulo In-reply-to: <201502091046.t19AkdCM067270@svn.freebsd.org> Date: Mon, 09 Feb 2015 08:44:48 -0800 Content-transfer-encoding: quoted-printable Message-id: References: <201502091046.t19AkdCM067270@svn.freebsd.org> To: Glen Barber X-Mailer: Apple Mail (2.2070.6) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:44:57 -0000 On Feb 9, 2015, at 02:46, Glen Barber wrote: >=20 > Author: gjb > Date: Mon Feb 9 10:46:39 2015 > New Revision: 278450 > URL: https://svnweb.freebsd.org/changeset/base/278450 >=20 > Log: > Revert r278445. >=20 > I was going to use __FreeBSD_version to determine if > xz(1) should be multi-threaded by default, but doing > this will cause problems if/when the changes are merged > from head. You can do "nm -D liblzma" and check for lzma_stream_encoder_mt. Or you = could check if xz(1) has threading support via xz -h (ugly). -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:45:51 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 967E422C; Mon, 9 Feb 2015 16:45:51 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66648BDF; Mon, 9 Feb 2015 16:45:50 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJI00D82JUPPU40@st11p02mm-asmtp001.mac.com>; Mon, 09 Feb 2015 16:45:45 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-09_02:2015-02-09,2015-02-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=18 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502090169 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... From: Rui Paulo In-reply-to: Date: Mon, 09 Feb 2015 08:45:43 -0800 Content-transfer-encoding: 7bit Message-id: <01002F39-EDBC-4CBF-BE87-762ECFB56372@me.com> References: <201502090620.t196KZSk040702@svn.freebsd.org> <20150209122540.GE84467@hub.FreeBSD.org> <20150209123057.GF84467@hub.FreeBSD.org> To: Dmitry Morozovsky X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:45:51 -0000 On Feb 9, 2015, at 05:08, Dmitry Morozovsky wrote: > BTW, Rui, did you some comparative tests with pxz? No, I didn't, but now it should be easy for you to try! :-) -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 16:50:35 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41AF93B0; Mon, 9 Feb 2015 16:50:35 +0000 (UTC) Received: from mail-ie0-f179.google.com (mail-ie0-f179.google.com [209.85.223.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1193FC0E; Mon, 9 Feb 2015 16:50:34 +0000 (UTC) Received: by iebtr6 with SMTP id tr6so17841004ieb.4; Mon, 09 Feb 2015 08:50:28 -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=SVvt11M6WsczupP1a6l3QniM9PzedHlR2I20//a59BY=; b=x7DxYy4viCKDF5rC0XKlckQ2U9/Zxwc8fL7NTg0gi2UH9jN3GipaaQHr0WoEVAH6tv 6djVWs4salvB1/eP0rXITHIQBTVpd3VbCp4Exux0W9qUYItagUC4tBDO/0OsSTXfB+Lr v/nNYWeetnMNKDGFpAw81B7A6TiMWLT4+6j1aKIgjaD1piA6RyEV/bS7a5nwWRydkm0g q7PE7BR29bTVvmEKU/G2J4TdyPpQXXNQr75c2cYvoOPIHL0oqFO2oIrM7T/+q0/iTEFm X9CIFQ6JDHkuWfVyvuWeqiibwg5bQzsZCOuVOe9ewvoyOORRHeB13vrCm0ycEUK7yT9y SXJA== MIME-Version: 1.0 X-Received: by 10.107.31.16 with SMTP id f16mr26617859iof.88.1423500628760; Mon, 09 Feb 2015 08:50:28 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.7 with HTTP; Mon, 9 Feb 2015 08:50:28 -0800 (PST) In-Reply-To: References: <201502091046.t19AkdCM067270@svn.freebsd.org> Date: Mon, 9 Feb 2015 08:50:28 -0800 X-Google-Sender-Auth: kq9bB_dMv80PVM66_K3SdV-cQr0 Message-ID: Subject: Re: svn commit: r278450 - head/release From: Adrian Chadd To: Rui Paulo Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 16:50:35 -0000 ... this is why we should have some kind of version identifier in each tool, or capability lists. Otherwise lulz will ensue like this. -adrian On 9 February 2015 at 08:44, Rui Paulo wrote: > On Feb 9, 2015, at 02:46, Glen Barber wrote: >> >> Author: gjb >> Date: Mon Feb 9 10:46:39 2015 >> New Revision: 278450 >> URL: https://svnweb.freebsd.org/changeset/base/278450 >> >> Log: >> Revert r278445. >> >> I was going to use __FreeBSD_version to determine if >> xz(1) should be multi-threaded by default, but doing >> this will cause problems if/when the changes are merged >> from head. > > You can do "nm -D liblzma" and check for lzma_stream_encoder_mt. Or you could check if xz(1) has threading support via xz -h (ugly). > > -- > Rui Paulo > > > > From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:18:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2AC6B8C; Mon, 9 Feb 2015 17:18: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 844DBF47; Mon, 9 Feb 2015 17:18:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19HICb6051624; Mon, 9 Feb 2015 17:18:12 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19HIA52051615; Mon, 9 Feb 2015 17:18:10 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502091718.t19HIA52051615@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 9 Feb 2015 17:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278464 - in head/usr.sbin/bsdconfig: console includes share timezone/share usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 17:18:12 -0000 Author: dteske Date: Mon Feb 9 17:18:10 2015 New Revision: 278464 URL: https://svnweb.freebsd.org/changeset/base/278464 Log: Replace the only instance of sed(1) in bsdconfig(8) with awk(1). MFC after: 3 days Modified: head/usr.sbin/bsdconfig/console/INDEX head/usr.sbin/bsdconfig/includes/INDEX head/usr.sbin/bsdconfig/share/keymap.subr head/usr.sbin/bsdconfig/timezone/share/continents.subr head/usr.sbin/bsdconfig/timezone/share/countries.subr head/usr.sbin/bsdconfig/usermgmt/share/user.subr Modified: head/usr.sbin/bsdconfig/console/INDEX ============================================================================== --- head/usr.sbin/bsdconfig/console/INDEX Mon Feb 9 16:29:44 2015 (r278463) +++ head/usr.sbin/bsdconfig/console/INDEX Mon Feb 9 17:18:10 2015 (r278464) @@ -46,6 +46,13 @@ menu_help="Customize system console beha # can be i18n'ed but `command' is the name of a script. # menu_selection="console|console" +menu_selection="vt_font|font" +menu_selection="vt_keymap|keymap" +menu_selection="vt_repeat|repeat" +menu_selection="vt_saver|saver" +menu_selection="vt_screenmap|screenmap" +menu_selection="vt_ttys|ttys" +# For backward compatibility menu_selection="syscons_font|font" menu_selection="syscons_keymap|keymap" menu_selection="syscons_repeat|repeat" Modified: head/usr.sbin/bsdconfig/includes/INDEX ============================================================================== --- head/usr.sbin/bsdconfig/includes/INDEX Mon Feb 9 16:29:44 2015 (r278463) +++ head/usr.sbin/bsdconfig/includes/INDEX Mon Feb 9 17:18:10 2015 (r278464) @@ -45,6 +45,7 @@ menu_help="" # can be i18n'ed but `command' is the name of a script. # menu_selection="includes|includes" +menu_selection="api|includes" # # ------------ Items below this line do NOT need i18n translation ------------ Modified: head/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/keymap.subr Mon Feb 9 16:29:44 2015 (r278463) +++ head/usr.sbin/bsdconfig/share/keymap.subr Mon Feb 9 17:18:10 2015 (r278464) @@ -219,7 +219,7 @@ f_keymap_get_all() echo -n "$k " # NOTE: Translate '8x8' to '8x08' before sending to # sort(1) so that things work out as we might expect. - debug= keymap_$k get desc | sed -e 's/8x8/8x08/g' + debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1' done | sort -k2 | awk '{ printf "%s%s", (started ? " " : ""), $1; started = 1 }' Modified: head/usr.sbin/bsdconfig/timezone/share/continents.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/continents.subr Mon Feb 9 16:29:44 2015 (r278463) +++ head/usr.sbin/bsdconfig/timezone/share/continents.subr Mon Feb 9 17:18:10 2015 (r278464) @@ -1,6 +1,6 @@ if [ ! "$_TIMEZONE_CONTINENTS_SUBR" ]; then _TIMEZONE_CONTINENTS_SUBR=1 # -# Copyright (c) 2011-2012 Devin Teske +# Copyright (c) 2011-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -87,7 +87,7 @@ export continent_utc_title ############################################################ FUNCTIONS -# f_continent $cont $property +# f_continent $cont $property [$var_to_set] # # Returns a single property of a given continent. Available properties are: # @@ -102,37 +102,60 @@ export continent_utc_title # (which appears after continent selection). # menu_list Menu-list of regions for this continent. # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_continent() { - local cont="$1" property="$2" - eval echo \"\${continent_${cont}_$property}\" + f_getvar "continent_${1}_$2" $3 } -# f_find_continent $title +# f_find_continent $title [$var_to_set] # # Returns continent identifier given continent title. # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_find_continent() { - local cont - for cont in $CONTINENTS; do - if [ "$1" = "$( f_continent $cont title )" ]; then - echo "$cont" + local __cont __title + for __cont in $CONTINENTS; do + f_continent $__cont title __title + if [ "$1" = "$__title" ]; then + if [ "$2" ]; then + setvar "$2" $__cont + else + echo "$__cont" + fi return $SUCCESS fi done return $FAILURE } -# f_OCEANP $cont +# f_OCEANP $cont [$var_to_set] # # Returns "1" if the first argument is an ocean, otherwise NULL. # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_OCEANP() { case "$1" in arctic|atlantic|indian|pacific) - echo 1 + if [ "$2" ]; then + setvar "$2" 1 + else + echo 1 + fi + ;; + *) + [ "$2" ] && setvar "$2" "" esac } Modified: head/usr.sbin/bsdconfig/timezone/share/countries.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/countries.subr Mon Feb 9 16:29:44 2015 (r278463) +++ head/usr.sbin/bsdconfig/timezone/share/countries.subr Mon Feb 9 17:18:10 2015 (r278464) @@ -1,6 +1,6 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; then _TIMEZONE_COUNTRIES_SUBR=1 # -# Copyright (c) 2011-2012 Devin Teske +# Copyright (c) 2011-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,8 +25,10 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ FUNCTIONS -# f_country $code $property +# f_country $code $property [$var_to_set] # # Returns a single property of a given country. Available properties are: # @@ -44,10 +46,13 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th # descr_N Like name, but for the Nth zone when the country has # multiple zones (nzones > 0) # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_country() { - local code="$1" property="$2" - eval echo \"\${country_${code}_$property}\" + f_getvar "country_${1}_$2" $3 } # f_sort_countries @@ -59,22 +64,42 @@ f_country() # afterward is the sh(1) function which utilizes the below awk script. # f_sort_countries_awk=' +function _asorti(src, dest) { - split($0, array, /[[:space:]]+/) + k = nitems = 0 + for (i in src) dest[++nitems] = i + for (i = 1; i <= nitems; k = i++) { + idx = dest[i] + while ((k > 0) && (dest[k] > idx)) { + dest[k+1] = dest[k]; k-- + } + dest[k+1] = idx + } + return nitems +} +BEGIN { + split(ENVIRON["COUNTRIES"], array, /[[:space:]]+/) for (item in array) { tlc = array[item] - print ENVIRON["country_" tlc "_name"] " " tlc + name = ENVIRON["country_" tlc "_name"] + countries[name] = tlc } + n = _asorti(countries, sorted_countries) + for (i = 1, i <= n; i++) + print countries[sorted_countries[i]] + exit } ' f_sort_countries() { - COUNTRIES=$( echo "$COUNTRIES" | awk "$f_sort_countries_awk" | - sort | awk '{print $NF}' ) - export COUNTRIES + export COUNTRIES # for awk(1) ENVIRON[] visibility + COUNTRIES=$( awk "$f_sort_countries_awk" ) + export COUNTRIES # Pedantic } +############################################################ MAIN + f_dprintf "%s: Successfully loaded." timezone/countries.subr fi # ! $_TIMEZONE_COUNTRIES_SUBR Modified: head/usr.sbin/bsdconfig/usermgmt/share/user.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user.subr Mon Feb 9 16:29:44 2015 (r278463) +++ head/usr.sbin/bsdconfig/usermgmt/share/user.subr Mon Feb 9 17:18:10 2015 (r278464) @@ -830,8 +830,7 @@ f_user_delete() f_eval_catch $funcname \ pw '%s -H 0' "$cmd" else - f_eval_catch $funcname \ - pw '%s -h -' "$cmd" + f_eval_catch $funcname pw '%s -h -' "$cmd" fi fi fi From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:22:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34AB1D44; Mon, 9 Feb 2015 17:22: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1754F82; Mon, 9 Feb 2015 17:22:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19HMuul055700; Mon, 9 Feb 2015 17:22:56 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19HMtAi055691; Mon, 9 Feb 2015 17:22:55 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502091722.t19HMtAi055691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 9 Feb 2015 17:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278465 - in head/usr.sbin/bsdconfig: console includes share timezone/share usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 17:22:57 -0000 Author: dteske Date: Mon Feb 9 17:22:54 2015 New Revision: 278465 URL: https://svnweb.freebsd.org/changeset/base/278465 Log: Revert SVN r278464 -- fingers were in perforce mode (premature commit of future stuffs not yet ready). Modified: head/usr.sbin/bsdconfig/console/INDEX head/usr.sbin/bsdconfig/includes/INDEX head/usr.sbin/bsdconfig/share/keymap.subr head/usr.sbin/bsdconfig/timezone/share/continents.subr head/usr.sbin/bsdconfig/timezone/share/countries.subr head/usr.sbin/bsdconfig/usermgmt/share/user.subr Modified: head/usr.sbin/bsdconfig/console/INDEX ============================================================================== --- head/usr.sbin/bsdconfig/console/INDEX Mon Feb 9 17:18:10 2015 (r278464) +++ head/usr.sbin/bsdconfig/console/INDEX Mon Feb 9 17:22:54 2015 (r278465) @@ -46,13 +46,6 @@ menu_help="Customize system console beha # can be i18n'ed but `command' is the name of a script. # menu_selection="console|console" -menu_selection="vt_font|font" -menu_selection="vt_keymap|keymap" -menu_selection="vt_repeat|repeat" -menu_selection="vt_saver|saver" -menu_selection="vt_screenmap|screenmap" -menu_selection="vt_ttys|ttys" -# For backward compatibility menu_selection="syscons_font|font" menu_selection="syscons_keymap|keymap" menu_selection="syscons_repeat|repeat" Modified: head/usr.sbin/bsdconfig/includes/INDEX ============================================================================== --- head/usr.sbin/bsdconfig/includes/INDEX Mon Feb 9 17:18:10 2015 (r278464) +++ head/usr.sbin/bsdconfig/includes/INDEX Mon Feb 9 17:22:54 2015 (r278465) @@ -45,7 +45,6 @@ menu_help="" # can be i18n'ed but `command' is the name of a script. # menu_selection="includes|includes" -menu_selection="api|includes" # # ------------ Items below this line do NOT need i18n translation ------------ Modified: head/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/keymap.subr Mon Feb 9 17:18:10 2015 (r278464) +++ head/usr.sbin/bsdconfig/share/keymap.subr Mon Feb 9 17:22:54 2015 (r278465) @@ -219,7 +219,7 @@ f_keymap_get_all() echo -n "$k " # NOTE: Translate '8x8' to '8x08' before sending to # sort(1) so that things work out as we might expect. - debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1' + debug= keymap_$k get desc | sed -e 's/8x8/8x08/g' done | sort -k2 | awk '{ printf "%s%s", (started ? " " : ""), $1; started = 1 }' Modified: head/usr.sbin/bsdconfig/timezone/share/continents.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/continents.subr Mon Feb 9 17:18:10 2015 (r278464) +++ head/usr.sbin/bsdconfig/timezone/share/continents.subr Mon Feb 9 17:22:54 2015 (r278465) @@ -1,6 +1,6 @@ if [ ! "$_TIMEZONE_CONTINENTS_SUBR" ]; then _TIMEZONE_CONTINENTS_SUBR=1 # -# Copyright (c) 2011-2014 Devin Teske +# Copyright (c) 2011-2012 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -87,7 +87,7 @@ export continent_utc_title ############################################################ FUNCTIONS -# f_continent $cont $property [$var_to_set] +# f_continent $cont $property # # Returns a single property of a given continent. Available properties are: # @@ -102,60 +102,37 @@ export continent_utc_title # (which appears after continent selection). # menu_list Menu-list of regions for this continent. # -# If $var_to_set is missing or NULL, the value of $var_to_get is printed to -# standard output for capturing in a sub-shell (which is less-recommended -# because of performance degredation; for example, when called in a loop). -# f_continent() { - f_getvar "continent_${1}_$2" $3 + local cont="$1" property="$2" + eval echo \"\${continent_${cont}_$property}\" } -# f_find_continent $title [$var_to_set] +# f_find_continent $title # # Returns continent identifier given continent title. # -# If $var_to_set is missing or NULL, the value of $var_to_get is printed to -# standard output for capturing in a sub-shell (which is less-recommended -# because of performance degredation; for example, when called in a loop). -# f_find_continent() { - local __cont __title - for __cont in $CONTINENTS; do - f_continent $__cont title __title - if [ "$1" = "$__title" ]; then - if [ "$2" ]; then - setvar "$2" $__cont - else - echo "$__cont" - fi + local cont + for cont in $CONTINENTS; do + if [ "$1" = "$( f_continent $cont title )" ]; then + echo "$cont" return $SUCCESS fi done return $FAILURE } -# f_OCEANP $cont [$var_to_set] +# f_OCEANP $cont # # Returns "1" if the first argument is an ocean, otherwise NULL. # -# If $var_to_set is missing or NULL, the value of $var_to_get is printed to -# standard output for capturing in a sub-shell (which is less-recommended -# because of performance degredation; for example, when called in a loop). -# f_OCEANP() { case "$1" in arctic|atlantic|indian|pacific) - if [ "$2" ]; then - setvar "$2" 1 - else - echo 1 - fi - ;; - *) - [ "$2" ] && setvar "$2" "" + echo 1 esac } Modified: head/usr.sbin/bsdconfig/timezone/share/countries.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/countries.subr Mon Feb 9 17:18:10 2015 (r278464) +++ head/usr.sbin/bsdconfig/timezone/share/countries.subr Mon Feb 9 17:22:54 2015 (r278465) @@ -1,6 +1,6 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; then _TIMEZONE_COUNTRIES_SUBR=1 # -# Copyright (c) 2011-2014 Devin Teske +# Copyright (c) 2011-2012 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,10 +25,8 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th # SUCH DAMAGE. # # $FreeBSD$ -# -############################################################ FUNCTIONS -# f_country $code $property [$var_to_set] +# f_country $code $property # # Returns a single property of a given country. Available properties are: # @@ -46,13 +44,10 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th # descr_N Like name, but for the Nth zone when the country has # multiple zones (nzones > 0) # -# If $var_to_set is missing or NULL, the value of $var_to_get is printed to -# standard output for capturing in a sub-shell (which is less-recommended -# because of performance degredation; for example, when called in a loop). -# f_country() { - f_getvar "country_${1}_$2" $3 + local code="$1" property="$2" + eval echo \"\${country_${code}_$property}\" } # f_sort_countries @@ -64,42 +59,22 @@ f_country() # afterward is the sh(1) function which utilizes the below awk script. # f_sort_countries_awk=' -function _asorti(src, dest) { - k = nitems = 0 - for (i in src) dest[++nitems] = i - for (i = 1; i <= nitems; k = i++) { - idx = dest[i] - while ((k > 0) && (dest[k] > idx)) { - dest[k+1] = dest[k]; k-- - } - dest[k+1] = idx - } - return nitems -} -BEGIN { - split(ENVIRON["COUNTRIES"], array, /[[:space:]]+/) + split($0, array, /[[:space:]]+/) for (item in array) { tlc = array[item] - name = ENVIRON["country_" tlc "_name"] - countries[name] = tlc + print ENVIRON["country_" tlc "_name"] " " tlc } - n = _asorti(countries, sorted_countries) - for (i = 1, i <= n; i++) - print countries[sorted_countries[i]] - exit } ' f_sort_countries() { - export COUNTRIES # for awk(1) ENVIRON[] visibility - COUNTRIES=$( awk "$f_sort_countries_awk" ) - export COUNTRIES # Pedantic + COUNTRIES=$( echo "$COUNTRIES" | awk "$f_sort_countries_awk" | + sort | awk '{print $NF}' ) + export COUNTRIES } -############################################################ MAIN - f_dprintf "%s: Successfully loaded." timezone/countries.subr fi # ! $_TIMEZONE_COUNTRIES_SUBR Modified: head/usr.sbin/bsdconfig/usermgmt/share/user.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user.subr Mon Feb 9 17:18:10 2015 (r278464) +++ head/usr.sbin/bsdconfig/usermgmt/share/user.subr Mon Feb 9 17:22:54 2015 (r278465) @@ -830,7 +830,8 @@ f_user_delete() f_eval_catch $funcname \ pw '%s -H 0' "$cmd" else - f_eval_catch $funcname pw '%s -h -' "$cmd" + f_eval_catch $funcname \ + pw '%s -h -' "$cmd" fi fi fi From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:24:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 756AAED5; Mon, 9 Feb 2015 17:24:12 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtp002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47E21BB; Mon, 9 Feb 2015 17:24:12 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJI0052OLNVV550@st11p02mm-asmtp002.mac.com>; Mon, 09 Feb 2015 17:23:57 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-09_02:2015-02-09,2015-02-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502090175 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278450 - head/release From: Rui Paulo In-reply-to: Date: Mon, 09 Feb 2015 09:23:54 -0800 Content-transfer-encoding: quoted-printable Message-id: <04669536-8407-4F8E-936D-8AFA35122671@me.com> References: <201502091046.t19AkdCM067270@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.2070.6) Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 17:24:12 -0000 On Feb 9, 2015, at 08:50, Adrian Chadd wrote: >=20 > ... this is why we should have some kind of version identifier in each > tool, or capability lists. Otherwise lulz will ensue like this. Well, we have: xz --version will output a version string that should be = easy to parse. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 17:53:17 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EC48EEE; Mon, 9 Feb 2015 17:53: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF465643; Mon, 9 Feb 2015 17:53:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19HrGC0069775; Mon, 9 Feb 2015 17:53:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19HrGGB069774; Mon, 9 Feb 2015 17:53:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502091753.t19HrGGB069774@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Feb 2015 17:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278466 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 17:53:17 -0000 Author: ngie Date: Mon Feb 9 17:53:16 2015 New Revision: 278466 URL: https://svnweb.freebsd.org/changeset/base/278466 Log: Remove explicit routing/sendmail rc.d inclusion in FILES Reported by: Guy Yur MFC after: 14 days X-MFC with: r278249 Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Mon Feb 9 17:22:54 2015 (r278465) +++ head/etc/rc.d/Makefile Mon Feb 9 17:53:16 2015 (r278466) @@ -99,7 +99,6 @@ FILES= DAEMON \ rfcomm_pppd_server \ root \ route6d \ - routed \ routing \ rpcbind \ rtadvd \ @@ -107,7 +106,6 @@ FILES= DAEMON \ savecore \ sdpd \ securelevel \ - sendmail \ serial \ sppp \ ${_sshd} \ From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 18:01:32 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40759405; Mon, 9 Feb 2015 18:01:32 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC382793; Mon, 9 Feb 2015 18:01:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id t19I16G6001106; Mon, 9 Feb 2015 21:01:06 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Mon, 9 Feb 2015 21:01:06 +0300 (MSK) From: Dmitry Morozovsky To: Rui Paulo Subject: Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... In-Reply-To: <01002F39-EDBC-4CBF-BE87-762ECFB56372@me.com> Message-ID: References: <201502090620.t196KZSk040702@svn.freebsd.org> <20150209122540.GE84467@hub.FreeBSD.org> <20150209123057.GF84467@hub.FreeBSD.org> <01002F39-EDBC-4CBF-BE87-762ECFB56372@me.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Mon, 09 Feb 2015 21:01:06 +0300 (MSK) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 18:01:32 -0000 Rui, On Mon, 9 Feb 2015, Rui Paulo wrote: > No, I didn't, but now it should be easy for you to try! :-) Unfortunately, the most powerful machine @myhands is 2*8core root@briareus:~# sysctl hw.model hw.model: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz root@briareus:~# sysctl hw.ncpu hw.ncpu: 16 and even this one is mostly loaded with $JOB ;) I'll try comparing with my home fileserver, which is on marck@hamster:~> sysctl hw.model hw.model: Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz marck@hamster:~> sysctl hw.ncpu hw.ncpu: 4 and load is rather moderate, especially if I stop smbd ;) -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:16:20 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1001F8AD; Mon, 9 Feb 2015 19:16:20 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F04D1F8E; Mon, 9 Feb 2015 19:16:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19JGJXv061056; Mon, 9 Feb 2015 19:16:19 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19JGJcO061055; Mon, 9 Feb 2015 19:16:19 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502091916.t19JGJcO061055@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 9 Feb 2015 19:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278467 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 19:16:20 -0000 Author: dteske Date: Mon Feb 9 19:16:19 2015 New Revision: 278467 URL: https://svnweb.freebsd.org/changeset/base/278467 Log: Replace the only instance of sed(1) in bsdconfig(8) with awk(1). MFC after: 3 days Modified: head/usr.sbin/bsdconfig/share/keymap.subr Modified: head/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/keymap.subr Mon Feb 9 17:53:16 2015 (r278466) +++ head/usr.sbin/bsdconfig/share/keymap.subr Mon Feb 9 19:16:19 2015 (r278467) @@ -219,7 +219,7 @@ f_keymap_get_all() echo -n "$k " # NOTE: Translate '8x8' to '8x08' before sending to # sort(1) so that things work out as we might expect. - debug= keymap_$k get desc | sed -e 's/8x8/8x08/g' + debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1' done | sort -k2 | awk '{ printf "%s%s", (started ? " " : ""), $1; started = 1 }' From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:19:14 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BCCEA3D; Mon, 9 Feb 2015 19:19: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 388F3FB5; Mon, 9 Feb 2015 19:19:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19JJE39061445; Mon, 9 Feb 2015 19:19:14 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19JJElS061444; Mon, 9 Feb 2015 19:19:14 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502091919.t19JJElS061444@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Mon, 9 Feb 2015 19:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278468 - head/contrib/xz X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 19:19:14 -0000 Author: rpaulo Date: Mon Feb 9 19:19:13 2015 New Revision: 278468 URL: https://svnweb.freebsd.org/changeset/base/278468 Log: Add a few more instructions to xz/FREEBSD-upgrade. Modified: head/contrib/xz/FREEBSD-upgrade Modified: head/contrib/xz/FREEBSD-upgrade ============================================================================== --- head/contrib/xz/FREEBSD-upgrade Mon Feb 9 19:16:19 2015 (r278467) +++ head/contrib/xz/FREEBSD-upgrade Mon Feb 9 19:19:13 2015 (r278468) @@ -16,6 +16,9 @@ sh -c 'for F in `cat FREEBSD-Xlist | gre You may check if there are any new files that we don't need. +You should run ``configure'' to make sure you use a more recent +config.h. Running ``make check'' in the xz source tree is also useful. + The instructions for importing new release and merging to HEAD can be found at FreeBSD wiki: From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:19:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D60A6B80; Mon, 9 Feb 2015 19:19: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0BD4FC0; Mon, 9 Feb 2015 19:19:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19JJjIc061544; Mon, 9 Feb 2015 19:19:45 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19JJjbg061542; Mon, 9 Feb 2015 19:19:45 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201502091919.t19JJjbg061542@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 9 Feb 2015 19:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278469 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 19:19:45 -0000 Author: rrs Date: Mon Feb 9 19:19:44 2015 New Revision: 278469 URL: https://svnweb.freebsd.org/changeset/base/278469 Log: This fixes two conditions that can incur when migration is being done in the callout code and harmonizes the macro use.: 1) The callout_active() will lie. Basically if a migration is occuring and the callout is about to expire and the migration has been deferred, the callout_active will no longer return true until after the migration. This confuses and breaks callers that are doing callout_init(&c, 1); such as TCP. 2) The migration code had a bug in it where when migrating, if a two calls to callout_reset came in and they both collided with the callout on the wheel about to run, then the second call to callout_reset would corrupt the list the callout wheel uses putting the callout thread into a endless loop. 3) Per imp, I have fixed all the macro occurance in the code that were for the most part being ignored. Phabricator D1711 and looked at by lstewart and jhb and sbruno. Reviewed by: kostikbel, imp, adrian, hselasky MFC after: 3 days Sponsored by: Netflix Inc. Modified: head/sys/kern/kern_timeout.c head/sys/sys/callout.h Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Feb 9 19:19:13 2015 (r278468) +++ head/sys/kern/kern_timeout.c Mon Feb 9 19:19:44 2015 (r278469) @@ -166,26 +166,16 @@ struct callout_cpu { char cc_ktr_event_name[20]; }; -#define cc_exec_curr cc_exec_entity[0].cc_curr -#define cc_exec_next cc_exec_entity[0].cc_next -#define cc_exec_cancel cc_exec_entity[0].cc_cancel -#define cc_exec_waiting cc_exec_entity[0].cc_waiting -#define cc_exec_curr_dir cc_exec_entity[1].cc_curr -#define cc_exec_next_dir cc_exec_entity[1].cc_next -#define cc_exec_cancel_dir cc_exec_entity[1].cc_cancel -#define cc_exec_waiting_dir cc_exec_entity[1].cc_waiting - +#define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr +#define cc_exec_next(cc, dir) cc->cc_exec_entity[dir].cc_next +#define cc_exec_cancel(cc, dir) cc->cc_exec_entity[dir].cc_cancel +#define cc_exec_waiting(cc, dir) cc->cc_exec_entity[dir].cc_waiting #ifdef SMP -#define cc_migration_func cc_exec_entity[0].ce_migration_func -#define cc_migration_arg cc_exec_entity[0].ce_migration_arg -#define cc_migration_cpu cc_exec_entity[0].ce_migration_cpu -#define cc_migration_time cc_exec_entity[0].ce_migration_time -#define cc_migration_prec cc_exec_entity[0].ce_migration_prec -#define cc_migration_func_dir cc_exec_entity[1].ce_migration_func -#define cc_migration_arg_dir cc_exec_entity[1].ce_migration_arg -#define cc_migration_cpu_dir cc_exec_entity[1].ce_migration_cpu -#define cc_migration_time_dir cc_exec_entity[1].ce_migration_time -#define cc_migration_prec_dir cc_exec_entity[1].ce_migration_prec +#define cc_migration_func(cc, dir) cc->cc_exec_entity[dir].ce_migration_func +#define cc_migration_arg(cc, dir) cc->cc_exec_entity[dir].ce_migration_arg +#define cc_migration_cpu(cc, dir) cc->cc_exec_entity[dir].ce_migration_cpu +#define cc_migration_time(cc, dir) cc->cc_exec_entity[dir].ce_migration_time +#define cc_migration_prec(cc, dir) cc->cc_exec_entity[dir].ce_migration_prec struct callout_cpu cc_cpu[MAXCPU]; #define CPUBLOCK MAXCPU @@ -235,16 +225,16 @@ static void cc_cce_cleanup(struct callout_cpu *cc, int direct) { - cc->cc_exec_entity[direct].cc_curr = NULL; - cc->cc_exec_entity[direct].cc_next = NULL; - cc->cc_exec_entity[direct].cc_cancel = false; - cc->cc_exec_entity[direct].cc_waiting = false; + cc_exec_curr(cc, direct) = NULL; + cc_exec_next(cc, direct) = NULL; + cc_exec_cancel(cc, direct) = false; + cc_exec_waiting(cc, direct) = false; #ifdef SMP - cc->cc_exec_entity[direct].ce_migration_cpu = CPUBLOCK; - cc->cc_exec_entity[direct].ce_migration_time = 0; - cc->cc_exec_entity[direct].ce_migration_prec = 0; - cc->cc_exec_entity[direct].ce_migration_func = NULL; - cc->cc_exec_entity[direct].ce_migration_arg = NULL; + cc_migration_cpu(cc, direct) = CPUBLOCK; + cc_migration_time(cc, direct) = 0; + cc_migration_prec(cc, direct) = 0; + cc_migration_func(cc, direct) = NULL; + cc_migration_arg(cc, direct) = NULL; #endif } @@ -256,7 +246,7 @@ cc_cce_migrating(struct callout_cpu *cc, { #ifdef SMP - return (cc->cc_exec_entity[direct].ce_migration_cpu != CPUBLOCK); + return (cc_migration_cpu(cc, direct) != CPUBLOCK); #else return (0); #endif @@ -492,7 +482,7 @@ callout_process(sbintime_t now) #ifdef CALLOUT_PROFILING ++depth_dir; #endif - cc->cc_exec_next_dir = + cc_exec_next(cc, 1) = LIST_NEXT(tmp, c_links.le); cc->cc_bucket = firstb & callwheelmask; LIST_REMOVE(tmp, c_links.le); @@ -501,7 +491,7 @@ callout_process(sbintime_t now) &mpcalls_dir, &lockcalls_dir, NULL, #endif 1); - tmp = cc->cc_exec_next_dir; + tmp = cc_exec_next(cc, 1); } else { tmpn = LIST_NEXT(tmp, c_links.le); LIST_REMOVE(tmp, c_links.le); @@ -585,7 +575,7 @@ callout_lock(struct callout *c) static void callout_cc_add(struct callout *c, struct callout_cpu *cc, sbintime_t sbt, sbintime_t precision, void (*func)(void *), - void *arg, int cpu, int flags) + void *arg, int cpu, int flags, int direct) { int bucket; @@ -606,7 +596,7 @@ callout_cc_add(struct callout *c, struct (u_int)(c->c_precision & 0xffffffff)); LIST_INSERT_HEAD(&cc->cc_callwheel[bucket], c, c_links.le); if (cc->cc_bucket == bucket) - cc->cc_exec_next_dir = c; + cc_exec_next(cc, direct) = c; #ifndef NO_EVENTTIMERS /* * Inform the eventtimers(4) subsystem there's a new callout @@ -679,8 +669,9 @@ softclock_call_cc(struct callout *c, str c->c_flags = CALLOUT_LOCAL_ALLOC; else c->c_flags &= ~CALLOUT_PENDING; - cc->cc_exec_entity[direct].cc_curr = c; - cc->cc_exec_entity[direct].cc_cancel = false; + + cc_exec_curr(cc, direct) = c; + cc_exec_cancel(cc, direct) = false; CC_UNLOCK(cc); if (c_lock != NULL) { class->lc_lock(c_lock, lock_status); @@ -688,12 +679,12 @@ softclock_call_cc(struct callout *c, str * The callout may have been cancelled * while we switched locks. */ - if (cc->cc_exec_entity[direct].cc_cancel) { + if (cc_exec_cancel(cc, direct)) { class->lc_unlock(c_lock); goto skip; } /* The callout cannot be stopped now. */ - cc->cc_exec_entity[direct].cc_cancel = true; + cc_exec_cancel(cc, direct) = true; if (c_lock == &Giant.lock_object) { #ifdef CALLOUT_PROFILING (*gcalls)++; @@ -744,9 +735,9 @@ softclock_call_cc(struct callout *c, str class->lc_unlock(c_lock); skip: CC_LOCK(cc); - KASSERT(cc->cc_exec_entity[direct].cc_curr == c, ("mishandled cc_curr")); - cc->cc_exec_entity[direct].cc_curr = NULL; - if (cc->cc_exec_entity[direct].cc_waiting) { + KASSERT(cc_exec_curr(cc, direct) == c, ("mishandled cc_curr")); + cc_exec_curr(cc, direct) = NULL; + if (cc_exec_waiting(cc, direct)) { /* * There is someone waiting for the * callout to complete. @@ -762,9 +753,9 @@ skip: */ c->c_flags &= ~CALLOUT_DFRMIGRATION; } - cc->cc_exec_entity[direct].cc_waiting = false; + cc_exec_waiting(cc, direct) = false; CC_UNLOCK(cc); - wakeup(&cc->cc_exec_entity[direct].cc_waiting); + wakeup(&cc_exec_waiting(cc, direct)); CC_LOCK(cc); } else if (cc_cce_migrating(cc, direct)) { KASSERT((c_flags & CALLOUT_LOCAL_ALLOC) == 0, @@ -774,11 +765,11 @@ skip: * If the callout was scheduled for * migration just perform it now. */ - new_cpu = cc->cc_exec_entity[direct].ce_migration_cpu; - new_time = cc->cc_exec_entity[direct].ce_migration_time; - new_prec = cc->cc_exec_entity[direct].ce_migration_prec; - new_func = cc->cc_exec_entity[direct].ce_migration_func; - new_arg = cc->cc_exec_entity[direct].ce_migration_arg; + new_cpu = cc_migration_cpu(cc, direct); + new_time = cc_migration_time(cc, direct); + new_prec = cc_migration_prec(cc, direct); + new_func = cc_migration_func(cc, direct); + new_arg = cc_migration_arg(cc, direct); cc_cce_cleanup(cc, direct); /* @@ -787,7 +778,7 @@ skip: * * As first thing, handle deferred callout stops. */ - if ((c->c_flags & CALLOUT_DFRMIGRATION) == 0) { + if (!callout_migrating(c)) { CTR3(KTR_CALLOUT, "deferred cancelled %p func %p arg %p", c, new_func, new_arg); @@ -799,7 +790,7 @@ skip: new_cc = callout_cpu_switch(c, cc, new_cpu); flags = (direct) ? C_DIRECT_EXEC : 0; callout_cc_add(c, new_cc, new_time, new_prec, new_func, - new_arg, new_cpu, flags); + new_arg, new_cpu, flags, direct); CC_UNLOCK(new_cc); CC_LOCK(cc); #else @@ -1007,15 +998,15 @@ callout_reset_sbt_on(struct callout *c, KASSERT(!direct || c->c_lock == NULL, ("%s: direct callout %p has lock", __func__, c)); cc = callout_lock(c); - if (cc->cc_exec_entity[direct].cc_curr == c) { + if (cc_exec_curr(cc, direct) == c) { /* * We're being asked to reschedule a callout which is * currently in progress. If there is a lock then we * can cancel the callout if it has not really started. */ - if (c->c_lock != NULL && !cc->cc_exec_entity[direct].cc_cancel) - cancelled = cc->cc_exec_entity[direct].cc_cancel = true; - if (cc->cc_exec_entity[direct].cc_waiting) { + if (c->c_lock != NULL && cc_exec_cancel(cc, direct)) + cancelled = cc_exec_cancel(cc, direct) = true; + if (cc_exec_waiting(cc, direct)) { /* * Someone has called callout_drain to kill this * callout. Don't reschedule. @@ -1026,11 +1017,30 @@ callout_reset_sbt_on(struct callout *c, CC_UNLOCK(cc); return (cancelled); } +#ifdef SMP + if (callout_migrating(c)) { + /* + * This only occurs when a second callout_reset_sbt_on + * is made after a previous one moved it into + * deferred migration (below). Note we do *not* change + * the prev_cpu even though the previous target may + * be different. + */ + cc_migration_cpu(cc, direct) = cpu; + cc_migration_time(cc, direct) = to_sbt; + cc_migration_prec(cc, direct) = precision; + cc_migration_func(cc, direct) = ftn; + cc_migration_arg(cc, direct) = arg; + cancelled = 1; + CC_UNLOCK(cc); + return (cancelled); + } +#endif } if (c->c_flags & CALLOUT_PENDING) { if ((c->c_flags & CALLOUT_PROCESSED) == 0) { - if (cc->cc_exec_next_dir == c) - cc->cc_exec_next_dir = LIST_NEXT(c, c_links.le); + if (cc_exec_next(cc, direct) == c) + cc_exec_next(cc, direct) = LIST_NEXT(c, c_links.le); LIST_REMOVE(c, c_links.le); } else TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); @@ -1045,15 +1055,29 @@ callout_reset_sbt_on(struct callout *c, * to a more appropriate moment. */ if (c->c_cpu != cpu) { - if (cc->cc_exec_entity[direct].cc_curr == c) { - cc->cc_exec_entity[direct].ce_migration_cpu = cpu; - cc->cc_exec_entity[direct].ce_migration_time - = to_sbt; - cc->cc_exec_entity[direct].ce_migration_prec - = precision; - cc->cc_exec_entity[direct].ce_migration_func = ftn; - cc->cc_exec_entity[direct].ce_migration_arg = arg; - c->c_flags |= CALLOUT_DFRMIGRATION; + if (cc_exec_curr(cc, direct) == c) { + /* + * Pending will have been removed since we are + * actually executing the callout on another + * CPU. That callout should be waiting on the + * lock the caller holds. If we set both + * active/and/pending after we return and the + * lock on the executing callout proceeds, it + * will then see pending is true and return. + * At the return from the actual callout execution + * the migration will occur in softclock_call_cc + * and this new callout will be placed on the + * new CPU via a call to callout_cpu_switch() which + * will get the lock on the right CPU followed + * by a call callout_cc_add() which will add it there. + * (see above in softclock_call_cc()). + */ + cc_migration_cpu(cc, direct) = cpu; + cc_migration_time(cc, direct) = to_sbt; + cc_migration_prec(cc, direct) = precision; + cc_migration_func(cc, direct) = ftn; + cc_migration_arg(cc, direct) = arg; + c->c_flags |= (CALLOUT_DFRMIGRATION | CALLOUT_ACTIVE | CALLOUT_PENDING); CTR6(KTR_CALLOUT, "migration of %p func %p arg %p in %d.%08x to %u deferred", c, c->c_func, c->c_arg, (int)(to_sbt >> 32), @@ -1065,7 +1089,7 @@ callout_reset_sbt_on(struct callout *c, } #endif - callout_cc_add(c, cc, to_sbt, precision, ftn, arg, cpu, flags); + callout_cc_add(c, cc, to_sbt, precision, ftn, arg, cpu, flags, direct); CTR6(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %d.%08x", cancelled ? "re" : "", c, c->c_func, c->c_arg, (int)(to_sbt >> 32), (u_int)(to_sbt & 0xffffffff)); @@ -1095,6 +1119,7 @@ _callout_stop_safe(struct callout *c, in struct callout_cpu *cc, *old_cc; struct lock_class *class; int direct, sq_locked, use_lock; + int not_on_a_list; if (safe) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, @@ -1120,6 +1145,26 @@ _callout_stop_safe(struct callout *c, in again: cc = callout_lock(c); + if ((c->c_flags & (CALLOUT_DFRMIGRATION | CALLOUT_ACTIVE | CALLOUT_PENDING)) == + (CALLOUT_DFRMIGRATION | CALLOUT_ACTIVE | CALLOUT_PENDING)) { + /* + * Special case where this slipped in while we + * were migrating *as* the callout is about to + * execute. The caller probably holds the lock + * the callout wants. + * + * Get rid of the migration first. Then set + * the flag that tells this code *not* to + * try to remove it from any lists (its not + * on one yet). When the callout wheel runs, + * it will ignore this callout. + */ + c->c_flags &= ~(CALLOUT_PENDING|CALLOUT_ACTIVE); + not_on_a_list = 1; + } else { + not_on_a_list = 0; + } + /* * If the callout was migrating while the callout cpu lock was * dropped, just drop the sleepqueue lock and check the states @@ -1128,7 +1173,7 @@ again: if (sq_locked != 0 && cc != old_cc) { #ifdef SMP CC_UNLOCK(cc); - sleepq_release(&old_cc->cc_exec_entity[direct].cc_waiting); + sleepq_release(&cc_exec_waiting(old_cc, direct)); sq_locked = 0; old_cc = NULL; goto again; @@ -1149,13 +1194,12 @@ again: * If it wasn't on the queue and it isn't the current * callout, then we can't stop it, so just bail. */ - if (cc->cc_exec_entity[direct].cc_curr != c) { + if (cc_exec_curr(cc, direct) != c) { CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p", c, c->c_func, c->c_arg); CC_UNLOCK(cc); if (sq_locked) - sleepq_release( - &cc->cc_exec_entity[direct].cc_waiting); + sleepq_release(&cc_exec_waiting(cc, direct)); return (0); } @@ -1166,7 +1210,7 @@ again: * just wait for the current invocation to * finish. */ - while (cc->cc_exec_entity[direct].cc_curr == c) { + while (cc_exec_curr(cc, direct) == c) { /* * Use direct calls to sleepqueue interface * instead of cv/msleep in order to avoid @@ -1187,7 +1231,7 @@ again: if (!sq_locked) { CC_UNLOCK(cc); sleepq_lock( - &cc->cc_exec_entity[direct].cc_waiting); + &cc_exec_waiting(cc, direct)); sq_locked = 1; old_cc = cc; goto again; @@ -1199,15 +1243,15 @@ again: * will be packed up, just let softclock() * take care of it. */ - cc->cc_exec_entity[direct].cc_waiting = true; + cc_exec_waiting(cc, direct) = true; DROP_GIANT(); CC_UNLOCK(cc); sleepq_add( - &cc->cc_exec_entity[direct].cc_waiting, + &cc_exec_waiting(cc, direct), &cc->cc_lock.lock_object, "codrain", SLEEPQ_SLEEP, 0); sleepq_wait( - &cc->cc_exec_entity[direct].cc_waiting, + &cc_exec_waiting(cc, direct), 0); sq_locked = 0; old_cc = NULL; @@ -1217,7 +1261,8 @@ again: CC_LOCK(cc); } } else if (use_lock && - !cc->cc_exec_entity[direct].cc_cancel) { + !cc_exec_cancel(cc, direct)) { + /* * The current callout is waiting for its * lock which we hold. Cancel the callout @@ -1225,7 +1270,7 @@ again: * lock, the callout will be skipped in * softclock(). */ - cc->cc_exec_entity[direct].cc_cancel = true; + cc_exec_cancel(cc, direct) = true; CTR3(KTR_CALLOUT, "cancelled %p func %p arg %p", c, c->c_func, c->c_arg); KASSERT(!cc_cce_migrating(cc, direct), @@ -1233,12 +1278,34 @@ again: CC_UNLOCK(cc); KASSERT(!sq_locked, ("sleepqueue chain locked")); return (1); - } else if ((c->c_flags & CALLOUT_DFRMIGRATION) != 0) { + } else if (callout_migrating(c)) { + /* + * The callout is currently being serviced + * and the "next" callout is scheduled at + * its completion with a migration. We remove + * the migration flag so it *won't* get rescheduled, + * but we can't stop the one thats running so + * we return 0. + */ c->c_flags &= ~CALLOUT_DFRMIGRATION; +#ifdef SMP + /* + * We can't call cc_cce_cleanup here since + * if we do it will remove .ce_curr and + * its still running. This will prevent a + * reschedule of the callout when the + * execution completes. + */ + cc_migration_cpu(cc, direct) = CPUBLOCK; + cc_migration_time(cc, direct) = 0; + cc_migration_prec(cc, direct) = 0; + cc_migration_func(cc, direct) = NULL; + cc_migration_arg(cc, direct) = NULL; +#endif CTR3(KTR_CALLOUT, "postponing stop %p func %p arg %p", c, c->c_func, c->c_arg); CC_UNLOCK(cc); - return (1); + return (0); } CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p", c, c->c_func, c->c_arg); @@ -1247,20 +1314,21 @@ again: return (0); } if (sq_locked) - sleepq_release(&cc->cc_exec_entity[direct].cc_waiting); + sleepq_release(&cc_exec_waiting(cc, direct)); c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING); CTR3(KTR_CALLOUT, "cancelled %p func %p arg %p", c, c->c_func, c->c_arg); - if ((c->c_flags & CALLOUT_PROCESSED) == 0) { - if (cc->cc_exec_next_dir == c) - cc->cc_exec_next_dir = LIST_NEXT(c, c_links.le); - LIST_REMOVE(c, c_links.le); - } else - TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); + if (not_on_a_list == 0) { + if ((c->c_flags & CALLOUT_PROCESSED) == 0) { + if (cc_exec_next(cc, direct) == c) + cc_exec_next(cc, direct) = LIST_NEXT(c, c_links.le); + LIST_REMOVE(c, c_links.le); + } else + TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); + } callout_cc_del(c, cc); - CC_UNLOCK(cc); return (1); } Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Mon Feb 9 19:19:13 2015 (r278468) +++ head/sys/sys/callout.h Mon Feb 9 19:19:44 2015 (r278469) @@ -64,6 +64,7 @@ struct callout_handle { #ifdef _KERNEL #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) +#define callout_migrating(c) ((c)->c_flags & CALLOUT_DFRMIGRATION) #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) #define callout_drain(c) _callout_stop_safe(c, 1) void callout_init(struct callout *, int); From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:21:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4238AD4E; Mon, 9 Feb 2015 19:21: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F46DEF; Mon, 9 Feb 2015 19:21:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19JL0Pu064822; Mon, 9 Feb 2015 19:21:00 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19JL0S8064817; Mon, 9 Feb 2015 19:21:00 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502091921.t19JL0S8064817@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 9 Feb 2015 19:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278470 - head/usr.sbin/bsdconfig/includes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 19:21:00 -0000 Author: dteske Date: Mon Feb 9 19:20:59 2015 New Revision: 278470 URL: https://svnweb.freebsd.org/changeset/base/278470 Log: Add new alias "bsdconfig api" (same as "bsdconfig includes") NB: My fingers like typing "api" a lot more than "includes" MFC after: 3 days Modified: head/usr.sbin/bsdconfig/includes/INDEX Modified: head/usr.sbin/bsdconfig/includes/INDEX ============================================================================== --- head/usr.sbin/bsdconfig/includes/INDEX Mon Feb 9 19:19:44 2015 (r278469) +++ head/usr.sbin/bsdconfig/includes/INDEX Mon Feb 9 19:20:59 2015 (r278470) @@ -45,6 +45,7 @@ menu_help="" # can be i18n'ed but `command' is the name of a script. # menu_selection="includes|includes" +menu_selection="api|includes" # # ------------ Items below this line do NOT need i18n translation ------------ From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:21:55 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 139A0F7F; Mon, 9 Feb 2015 19:21: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3F90102; Mon, 9 Feb 2015 19:21:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19JLsLd065468; Mon, 9 Feb 2015 19:21:54 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19JLs8F065467; Mon, 9 Feb 2015 19:21:54 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502091921.t19JLs8F065467@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 9 Feb 2015 19:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278471 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 19:21:55 -0000 Author: nwhitehorn Date: Mon Feb 9 19:21:54 2015 New Revision: 278471 URL: https://svnweb.freebsd.org/changeset/base/278471 Log: Distribute interrupts across multiple CPUs in SMP configurations instead of sending them all to CPU 0. Modified: head/sys/powerpc/pseries/xics.c Modified: head/sys/powerpc/pseries/xics.c ============================================================================== --- head/sys/powerpc/pseries/xics.c Mon Feb 9 19:20:59 2015 (r278470) +++ head/sys/powerpc/pseries/xics.c Mon Feb 9 19:21:54 2015 (r278471) @@ -197,13 +197,25 @@ xicp_bind(device_t dev, u_int irq, cpuse { struct xicp_softc *sc = device_get_softc(dev); cell_t status, cpu; + int ncpus, i; /* - * This doesn't appear to actually support affinity groups, so just - * use the first CPU. + * This doesn't appear to actually support affinity groups, so pick a + * random CPU. */ CPU_FOREACH(cpu) - if (CPU_ISSET(cpu, &cpumask)) break; + if (CPU_ISSET(cpu, &cpumask)) ncpus++; + + i = mftb() % ncpus; + ncpus = 0; + CPU_FOREACH(cpu) { + if (!CPU_ISSET(cpu, &cpumask)) + continue; + if (ncpus == i) + break; + ncpus++; + } + rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, XICP_PRIORITY, &status); From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:24:45 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48A05233; Mon, 9 Feb 2015 19:24:45 +0000 (UTC) Received: from mail-wg0-x235.google.com (mail-wg0-x235.google.com [IPv6:2a00:1450:400c:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAF83122; Mon, 9 Feb 2015 19:24:44 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id x13so8953939wgg.12; Mon, 09 Feb 2015 11:24:43 -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=zdn0MCwk6aImxTrO9Nr3E9swg1Uo4/bU8ov4+9lrVD8=; b=VNkN0FrmBgZ+wURkchEJzp5hdfebLjoqBh6nmI5WElXYH4VFExynMSZLk+5LDkh4qL Z8k4bx5oIa4G7KVcijJGljyNiUZpKv0oRwdABkrCqAVvfXPExbeYx+oQOTzP4+40WRFr /y6GVFE7M3TUTSUHSqWarroMDZT9Jp2h8Qs4/1rpkLk2yWKzv1Kv/+JDQmOBuXWFwwZF wGqMWk3cLTYCyY9RM2B/uKsnFQ0n4r7rnTUrg/MzI2ZUoVi9G799M3oaBOZaZN6sPP78 2VzNOYY3bLM7R5QWx6VtbDFtK5Xs1QjImcUg1AusDpLsf/lPnRmsSiSFIVxn3uijV4xH MXSQ== X-Received: by 10.180.73.241 with SMTP id o17mr31314441wiv.16.1423509883241; Mon, 09 Feb 2015 11:24:43 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id fo17sm17619088wjc.19.2015.02.09.11.24.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Feb 2015 11:24:42 -0800 (PST) Sender: Baptiste Daroussin Date: Mon, 9 Feb 2015 20:24:40 +0100 From: Baptiste Daroussin To: Devin Teske Subject: Re: svn commit: r278467 - head/usr.sbin/bsdconfig/share Message-ID: <20150209192440.GL29891@ivaldir.etoilebsd.net> References: <201502091916.t19JGJcO061055@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="37cJpJlYZwAfNbm5" Content-Disposition: inline In-Reply-To: <201502091916.t19JGJcO061055@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 19:24:45 -0000 --37cJpJlYZwAfNbm5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 09, 2015 at 07:16:19PM +0000, Devin Teske wrote: > Author: dteske > Date: Mon Feb 9 19:16:19 2015 > New Revision: 278467 > URL: https://svnweb.freebsd.org/changeset/base/278467 >=20 > Log: > Replace the only instance of sed(1) in bsdconfig(8) with awk(1). > =20 > MFC after: 3 days >=20 > Modified: > head/usr.sbin/bsdconfig/share/keymap.subr >=20 > Modified: head/usr.sbin/bsdconfig/share/keymap.subr > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/bsdconfig/share/keymap.subr Mon Feb 9 17:53:16 2015 (r= 278466) > +++ head/usr.sbin/bsdconfig/share/keymap.subr Mon Feb 9 19:16:19 2015 (r= 278467) > @@ -219,7 +219,7 @@ f_keymap_get_all() > echo -n "$k " > # NOTE: Translate '8x8' to '8x08' before sending to > # sort(1) so that things work out as we might expect. > - debug=3D keymap_$k get desc | sed -e 's/8x8/8x08/g' > + debug=3D keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1' > done | sort -k2 | awk '{ > printf "%s%s", (started ? " " : ""), $1; started =3D 1 > }' Out of curiosity what is the point of preferring awk over sed? the awk bina= ry being larger and depending on 2 libraries versus sed only depending on one? Best regards, Bapt --37cJpJlYZwAfNbm5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTZCXgACgkQ8kTtMUmk6EyOJACgjY6q9gMxurf/We39qh9NaglW SNYAoLJpxSASyEcv6T8QY1cVRJu7jt3y =o4o2 -----END PGP SIGNATURE----- --37cJpJlYZwAfNbm5-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:28:13 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FF184B6; Mon, 9 Feb 2015 19:28: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 217FC171; Mon, 9 Feb 2015 19:28:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19JSC3b066300; Mon, 9 Feb 2015 19:28:12 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19JSC5P066293; Mon, 9 Feb 2015 19:28:12 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201502091928.t19JSC5P066293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 9 Feb 2015 19:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278472 - in head/sys: netinet 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 19:28:13 -0000 Author: rrs Date: Mon Feb 9 19:28:11 2015 New Revision: 278472 URL: https://svnweb.freebsd.org/changeset/base/278472 Log: This fixes a bug in the way that the LLE timers for nd6 and arp were being used. They basically would pass in the mutex to the callout_init. Because they used this method to the callout system, it was possible to "stop" the callout. When flushing the table and you stopped the running callout, the callout_stop code would return 1 indicating that it was going to stop the callout (that was about to run on the callout_wheel blocked by the function calling the stop). Now when 1 was returned, it would lower the reference count one extra time for the stopped timer, then a few lines later delete the memory. Of course the callout_wheel was stuck in the lock code and would then crash since it was accessing freed memory. By using callout_init(c, 1) we always get a 0 back and the reference counting bug does not rear its head. We do have to make a few adjustments to the callouts themselves though to make sure it does the proper thing if rescheduled as well as gets the lock. Commented upon by hiren and sbruno See Phabricator D1777 for more details. Commented upon by hiren and sbruno Reviewed by: adrian, jhb and bz Sponsored by: Netflix Inc. Modified: head/sys/netinet/if_ether.c head/sys/netinet/in.c head/sys/netinet6/in6.c head/sys/netinet6/nd6.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Feb 9 19:21:54 2015 (r278471) +++ head/sys/netinet/if_ether.c Mon Feb 9 19:28:11 2015 (r278472) @@ -166,10 +166,28 @@ arptimer(void *arg) struct ifnet *ifp; if (lle->la_flags & LLE_STATIC) { - LLE_WUNLOCK(lle); return; } - + LLE_WLOCK(lle); + if (callout_pending(&lle->la_timer)) { + /* + * Here we are a bit odd here in the treatment of + * active/pending. If the pending bit is set, it got + * rescheduled before I ran. The active + * bit we ignore, since if it was stopped + * in ll_tablefree() and was currently running + * it would have return 0 so the code would + * not have deleted it since the callout could + * not be stopped so we want to go through + * with the delete here now. If the callout + * was restarted, the pending bit will be back on and + * we just want to bail since the callout_reset would + * return 1 and our reference would have been removed + * by arpresolve() below. + */ + LLE_WUNLOCK(lle); + return; + } ifp = lle->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Mon Feb 9 19:21:54 2015 (r278471) +++ head/sys/netinet/in.c Mon Feb 9 19:28:11 2015 (r278472) @@ -962,8 +962,7 @@ in_lltable_new(const struct sockaddr *l3 lle->base.lle_refcnt = 1; lle->base.lle_free = in_lltable_free; LLE_LOCK_INIT(&lle->base); - callout_init_rw(&lle->base.la_timer, &lle->base.lle_lock, - CALLOUT_RETURNUNLOCKED); + callout_init(&lle->base.la_timer, 1); return (&lle->base); } Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Feb 9 19:21:54 2015 (r278471) +++ head/sys/netinet6/in6.c Mon Feb 9 19:28:11 2015 (r278472) @@ -2047,8 +2047,7 @@ in6_lltable_new(const struct sockaddr *l lle->base.lle_refcnt = 1; lle->base.lle_free = in6_lltable_free; LLE_LOCK_INIT(&lle->base); - callout_init_rw(&lle->base.ln_timer_ch, &lle->base.lle_lock, - CALLOUT_RETURNUNLOCKED); + callout_init(&lle->base.ln_timer_ch, 1); return (&lle->base); } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Feb 9 19:21:54 2015 (r278471) +++ head/sys/netinet6/nd6.c Mon Feb 9 19:28:11 2015 (r278472) @@ -473,9 +473,28 @@ nd6_llinfo_timer(void *arg) KASSERT(arg != NULL, ("%s: arg NULL", __func__)); ln = (struct llentry *)arg; - LLE_WLOCK_ASSERT(ln); + LLE_WLOCK(ln); + if (callout_pending(&ln->la_timer)) { + /* + * Here we are a bit odd here in the treatment of + * active/pending. If the pending bit is set, it got + * rescheduled before I ran. The active + * bit we ignore, since if it was stopped + * in ll_tablefree() and was currently running + * it would have return 0 so the code would + * not have deleted it since the callout could + * not be stopped so we want to go through + * with the delete here now. If the callout + * was restarted, the pending bit will be back on and + * we just want to bail since the callout_reset would + * return 1 and our reference would have been removed + * by nd6_llinfo_settimer_locked above since canceled + * would have been 1. + */ + LLE_WUNLOCK(ln); + return; + } ifp = ln->lle_tbl->llt_ifp; - CURVNET_SET(ifp->if_vnet); if (ln->ln_ntick > 0) { From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 19:52:15 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C2B3A5C; Mon, 9 Feb 2015 19:52:15 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 360A664B; Mon, 9 Feb 2015 19:52:15 +0000 (UTC) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:49341 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1YKFUF-000C0Z-IS; Sat, 07 Feb 2015 16:12:31 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: svn commit: r278467 - head/usr.sbin/bsdconfig/share From: Devin Teske In-Reply-To: <20150209192440.GL29891@ivaldir.etoilebsd.net> Date: Mon, 9 Feb 2015 11:51:59 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <1036F58E-88F8-4058-85AE-B4D2ACA04B81@FreeBSD.org> References: <201502091916.t19JGJcO061055@svn.freebsd.org> <20150209192440.GL29891@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1990.1) Sender: devin@shxd.cx Cc: svn-src-head@freebsd.org, Devin Teske , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 19:52:15 -0000 sed was an odd-man out. awk is used almost 200 times, and sed only once. Consider it the removal of an unnecessary dependency. If there were similar cases of a utility only being used once, I would probably do the same thing (e.g., if =E2=80=9Ctr=E2=80=9D was = used only once, I might convert it to =E2=80=9Cawk=E2=80=9D). I=E2=80=99m very big on minimizing dependencies because I use this stuff in embedded situations. Yeah, the sed binary is smaller=E2=80=A6 but it just didn=E2=80=99t make = much sense to me to use sed only once when awk would do just fine (considering awk is a hard-and-fast dependency with almost 200+ occurrences). =E2=80=94=20 Devin P.S. Sorry for top-posting. > On Feb 9, 2015, at 11:24 AM, Baptiste Daroussin = wrote: >=20 > On Mon, Feb 09, 2015 at 07:16:19PM +0000, Devin Teske wrote: >> Author: dteske >> Date: Mon Feb 9 19:16:19 2015 >> New Revision: 278467 >> URL: https://svnweb.freebsd.org/changeset/base/278467 >>=20 >> Log: >> Replace the only instance of sed(1) in bsdconfig(8) with awk(1). >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/usr.sbin/bsdconfig/share/keymap.subr >>=20 >> Modified: head/usr.sbin/bsdconfig/share/keymap.subr >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/bsdconfig/share/keymap.subr Mon Feb 9 = 17:53:16 2015 (r278466) >> +++ head/usr.sbin/bsdconfig/share/keymap.subr Mon Feb 9 = 19:16:19 2015 (r278467) >> @@ -219,7 +219,7 @@ f_keymap_get_all() >> echo -n "$k " >> # NOTE: Translate '8x8' to '8x08' before sending = to >> # sort(1) so that things work out as we might = expect. >> - debug=3D keymap_$k get desc | sed -e = 's/8x8/8x08/g' >> + debug=3D keymap_$k get desc | awk = 'gsub(/8x8/,"8x08")||1' >> done | sort -k2 | awk '{ >> printf "%s%s", (started ? " " : ""), $1; started = =3D 1 >> }' >=20 > Out of curiosity what is the point of preferring awk over sed? the awk = binary > being larger and depending on 2 libraries versus sed only depending on = one? >=20 > Best regards, > Bapt From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 20:19:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6A3D22C; Mon, 9 Feb 2015 20:19:32 +0000 (UTC) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D043A92A; Mon, 9 Feb 2015 20:19:32 +0000 (UTC) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPSA id 1EA80CE2F1; Mon, 9 Feb 2015 12:19:26 -0800 (PST) Date: Mon, 9 Feb 2015 12:19:26 -0800 From: hiren panchasara To: Randall Stewart Subject: Re: svn commit: r278469 - in head/sys: kern sys Message-ID: <20150209201926.GF10438@strugglingcoder.info> References: <201502091919.t19JJjbg061542@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rMWmSaSbD7nr+du9" Content-Disposition: inline In-Reply-To: <201502091919.t19JJjbg061542@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 20:19:33 -0000 --rMWmSaSbD7nr+du9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 02/09/15 at 07:19P, Randall Stewart wrote: > Author: rrs > Date: Mon Feb 9 19:19:44 2015 > New Revision: 278469 > URL: https://svnweb.freebsd.org/changeset/base/278469 >=20 > Log: > This fixes two conditions that can incur when migration > is being done in the callout code and harmonizes the macro > use.: > 1) The callout_active() will lie. Basically if a migration > is occuring and the callout is about to expire and the > migration has been deferred, the callout_active will no > longer return true until after the migration. This confuses > and breaks callers that are doing callout_init(&c, 1); such > as TCP. > 2) The migration code had a bug in it where when migrating, if > a two calls to callout_reset came in and they both collided with > the callout on the wheel about to run, then the second call to > callout_reset would corrupt the list the callout wheel uses > putting the callout thread into a endless loop. > 3) Per imp, I have fixed all the macro occurance in the code that > were for the most part being ignored. > =20 > Phabricator D1711 and looked at by lstewart and jhb and sbruno. > Reviewed by: kostikbel, imp, adrian, hselasky > MFC after: 3 days > Sponsored by: Netflix Inc. Thanks Randall for the fix. For future reference, correct way to specify phabric review is: Differential Revision: https://reviews.freebsd.org/D1711=20 This triggers changes to the review on phabricator with reference to this commit. Cheers, Hiren --rMWmSaSbD7nr+du9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJU2RZNXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lsHAH/REclGA0grPhcrccQAuNRKC0 WDITbuzvrR9CHqs+1Wv1CvxbvcDKijP+itfpZG3k6MJWqjgLm4TUO94UYTq8oqIg tD3Wi/p12D7w5x7FYDgebAXKDEaCdIczv0Aiho4pwF1aoRQ2r9EzRJAuzAzqEFX3 4z6gHqXAkqGEYPKIwPIEO3tPE3JflBqDUhIt64cGrZHGsiaNhhw2zrrgyaga6wFq PS62XDV+y2dDnv/m3i+gz1Vw34uFq6okGf6tYWYYuM62/SBsyT8tO3FbvHlRovUf XeQbgpcPZmuUPhSvnPGT4wWjlftIZFXhA4CFjrcjN8QZipXOizffMlqES98vziQ= =yMIe -----END PGP SIGNATURE----- --rMWmSaSbD7nr+du9-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 20:22:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39427381; Mon, 9 Feb 2015 20:22:51 +0000 (UTC) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2303A9CD; Mon, 9 Feb 2015 20:22:51 +0000 (UTC) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPSA id D5345CE40C; Mon, 9 Feb 2015 12:22:50 -0800 (PST) Date: Mon, 9 Feb 2015 12:22:50 -0800 From: hiren panchasara To: Randall Stewart Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 Message-ID: <20150209202250.GG10438@strugglingcoder.info> References: <201502091928.t19JSC5P066293@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rV8arf8D5Dod9UkK" Content-Disposition: inline In-Reply-To: <201502091928.t19JSC5P066293@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 20:22:51 -0000 --rV8arf8D5Dod9UkK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 02/09/15 at 07:28P, Randall Stewart wrote: > Author: rrs > Date: Mon Feb 9 19:28:11 2015 > New Revision: 278472 > URL: https://svnweb.freebsd.org/changeset/base/278472 >=20 > Log: > This fixes a bug in the way that the LLE timers for nd6 > and arp were being used. They basically would pass in the > mutex to the callout_init. Because they used this method > to the callout system, it was possible to "stop" the callout. > When flushing the table and you stopped the running callout, the > callout_stop code would return 1 indicating that it was going > to stop the callout (that was about to run on the callout_wheel blocked > by the function calling the stop). Now when 1 was returned, it would > lower the reference count one extra time for the stopped timer, then > a few lines later delete the memory. Of course the callout_wheel was > stuck in the lock code and would then crash since it was accessing > freed memory. By using callout_init(c, 1) we always get a 0 back > and the reference counting bug does not rear its head. We do have > to make a few adjustments to the callouts themselves though to make > sure it does the proper thing if rescheduled as well as gets the lock. > =20 > Commented upon by hiren and sbruno > See Phabricator D1777 for more details. > =20 > Commented upon by hiren and sbruno > Reviewed by: adrian, jhb and bz > Sponsored by: Netflix Inc. Thanks for the fix, Randall. When do you plan to MFC this? It'd be nice to have this MFC'd along with D1711 changes so that we do not see panics reported in the review. Cheers, Hiren --rV8arf8D5Dod9UkK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJU2RcYXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lfGsH/RBD/Yeu9OLknO1vN7bS1poh WBrOx3TK0DxjMCECVuigWMucPf1bY6H5kr4GQtjzUihv5nJjanUstgT6WGyHvUn0 4SH+5H9vGT3g4msgMkAK8oQjgbgw2sY7M861v8/TQGlqJ/jkF7x0qr4auHbS/H2/ 4PZO3wveFihye828u6IOwRlFGFoW6g+4CZaFRH74gHskYWywDiloMCOvV/gaw49i HkZb0GNeo22yW/IVhwWa+M91KxNDhQS/e3R+DrI4ta4LdZSUMAyfi4cPy9isy7G8 iw+KM3GbYAemVy5KaJyZG0GTPSw0EZhRJ++DUkMaT4fY5NxEfl4pjoSIjZG/pTc= =+Lmp -----END PGP SIGNATURE----- --rV8arf8D5Dod9UkK-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 20:34:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E38907DF; Mon, 9 Feb 2015 20:34:39 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC76AAD8; Mon, 9 Feb 2015 20:34:39 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D4677B945; Mon, 9 Feb 2015 15:34:37 -0500 (EST) From: John Baldwin To: Randall Stewart Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 Date: Mon, 09 Feb 2015 15:11:21 -0500 Message-ID: <1903622.i3cFFNVYcL@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201502091928.t19JSC5P066293@svn.freebsd.org> References: <201502091928.t19JSC5P066293@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Feb 2015 15:34:37 -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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 20:34:40 -0000 On Monday, February 09, 2015 07:28:12 PM Randall Stewart wrote: > Author: rrs > Date: Mon Feb 9 19:28:11 2015 > New Revision: 278472 > URL: https://svnweb.freebsd.org/changeset/base/278472 > > Log: > This fixes a bug in the way that the LLE timers for nd6 > and arp were being used. They basically would pass in the > mutex to the callout_init. Because they used this method > to the callout system, it was possible to "stop" the callout. > When flushing the table and you stopped the running callout, the > callout_stop code would return 1 indicating that it was going > to stop the callout (that was about to run on the callout_wheel blocked > by the function calling the stop). Now when 1 was returned, it would > lower the reference count one extra time for the stopped timer, then > a few lines later delete the memory. Of course the callout_wheel was > stuck in the lock code and would then crash since it was accessing > freed memory. By using callout_init(c, 1) we always get a 0 back > and the reference counting bug does not rear its head. We do have > to make a few adjustments to the callouts themselves though to make > sure it does the proper thing if rescheduled as well as gets the lock. > > Commented upon by hiren and sbruno > See Phabricator D1777 for more details. > > Commented upon by hiren and sbruno > Reviewed by: adrian, jhb and bz > Sponsored by: Netflix Inc. Eh, I looked at it, but I really, really don't like it. I think callout_init_*() should be preferred to CALLOUT_MPSAFE whenever possible as it is less race-prone. I think this should probably be fixed by adding Hans' callout_drain_async() instead, though this is fine as a temporary workaround. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 20:34:40 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D9F57E1; Mon, 9 Feb 2015 20:34:40 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBD10AD9; Mon, 9 Feb 2015 20:34:39 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 92AA5B97B; Mon, 9 Feb 2015 15:34:38 -0500 (EST) From: John Baldwin To: Randall Stewart Subject: Re: svn commit: r278469 - in head/sys: kern sys Date: Mon, 09 Feb 2015 15:09:46 -0500 Message-ID: <1619204.FQlXD7hmMU@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201502091919.t19JJjbg061542@svn.freebsd.org> References: <201502091919.t19JJjbg061542@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Feb 2015 15:34:38 -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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 20:34:40 -0000 On Monday, February 09, 2015 07:19:45 PM Randall Stewart wrote: > Author: rrs > Date: Mon Feb 9 19:19:44 2015 > New Revision: 278469 > URL: https://svnweb.freebsd.org/changeset/base/278469 > > Log: > This fixes two conditions that can incur when migration > is being done in the callout code and harmonizes the macro > use.: > 1) The callout_active() will lie. Basically if a migration > is occuring and the callout is about to expire and the > migration has been deferred, the callout_active will no > longer return true until after the migration. This confuses > and breaks callers that are doing callout_init(&c, 1); such > as TCP. > 2) The migration code had a bug in it where when migrating, if > a two calls to callout_reset came in and they both collided with > the callout on the wheel about to run, then the second call to > callout_reset would corrupt the list the callout wheel uses > putting the callout thread into a endless loop. > 3) Per imp, I have fixed all the macro occurance in the code that > were for the most part being ignored. > > Phabricator D1711 and looked at by lstewart and jhb and sbruno. > Reviewed by: kostikbel, imp, adrian, hselasky > MFC after: 3 days > Sponsored by: Netflix Inc. Thank you guys for working together to fix the migration race in a way that lets CALLOUT_MPSAFE timers use multiple CPUs still. I do think that callout_drain_async() would also be useful to add. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 20:47:57 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0066F47 for ; Mon, 9 Feb 2015 20:47:56 +0000 (UTC) Received: from relay03.pair.com (relay03.pair.com [209.68.5.17]) by mx1.freebsd.org (Postfix) with SMTP id 6D5D8C97 for ; Mon, 9 Feb 2015 20:47:55 +0000 (UTC) Received: (qmail 61314 invoked from network); 9 Feb 2015 20:41:13 -0000 Received: from 188.182.139.176 (HELO x2.osted.lan) (188.182.139.176) by relay03.pair.com with SMTP; 9 Feb 2015 20:41:13 -0000 X-pair-Authenticated: 188.182.139.176 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id t19KfBHx047323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 9 Feb 2015 21:41:12 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id t19KfBPn047322; Mon, 9 Feb 2015 21:41:11 +0100 (CET) (envelope-from pho) Date: Mon, 9 Feb 2015 21:41:11 +0100 From: Peter Holm To: Randall Stewart Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 Message-ID: <20150209204111.GA47080@x2.osted.lan> References: <201502091928.t19JSC5P066293@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502091928.t19JSC5P066293@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 20:47:57 -0000 On Mon, Feb 09, 2015 at 07:28:12PM +0000, Randall Stewart wrote: > Author: rrs > Date: Mon Feb 9 19:28:11 2015 > New Revision: 278472 > URL: https://svnweb.freebsd.org/changeset/base/278472 > > Log: > This fixes a bug in the way that the LLE timers for nd6 > and arp were being used. They basically would pass in the > mutex to the callout_init. Because they used this method > to the callout system, it was possible to "stop" the callout. > When flushing the table and you stopped the running callout, the > callout_stop code would return 1 indicating that it was going > to stop the callout (that was about to run on the callout_wheel blocked > by the function calling the stop). Now when 1 was returned, it would > lower the reference count one extra time for the stopped timer, then > a few lines later delete the memory. Of course the callout_wheel was > stuck in the lock code and would then crash since it was accessing > freed memory. By using callout_init(c, 1) we always get a 0 back > and the reference counting bug does not rear its head. We do have > to make a few adjustments to the callouts themselves though to make > sure it does the proper thing if rescheduled as well as gets the lock. > > Commented upon by hiren and sbruno > See Phabricator D1777 for more details. > > Commented upon by hiren and sbruno > Reviewed by: adrian, jhb and bz > Sponsored by: Netflix Inc. > > Modified: > head/sys/netinet/if_ether.c > head/sys/netinet/in.c > head/sys/netinet6/in6.c > head/sys/netinet6/nd6.c > Could this be yours? db:0:pho> bt Tracing pid 9629 tid 100639 td 0xfffff8011cce14a0 in6_lltable_lookup() at in6_lltable_lookup+0x11a/frame 0xfffffe081e426200 nd6_output() at nd6_output+0x15d/frame 0xfffffe081e426290 ip6_output() at ip6_output+0x2128/frame 0xfffffe081e426790 tcp_output() at tcp_output+0x2dae/frame 0xfffffe081e426c30 tcp_usr_send() at tcp_usr_send+0x2fe/frame 0xfffffe081e426cb0 sosend_generic() at sosend_generic+0x414/frame 0xfffffe081e426d60 clnt_vc_call() at clnt_vc_call+0x477/frame 0xfffffe081e426ec0 clnt_reconnect_call() at clnt_reconnect_call+0x46c/frame 0xfffffe081e426f70 newnfs_request() at newnfs_request+0x9ba/frame 0xfffffe081e4270d0 nfscl_request() at nfscl_request+0x72/frame 0xfffffe081e427120 nfsrpc_lookup() at nfsrpc_lookup+0x213/frame 0xfffffe081e4272a0 nfs_lookup() at nfs_lookup+0x467/frame 0xfffffe081e4275c0 VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0x10f/frame 0xfffffe081e4275f0 lookup() at lookup+0x5d5/frame 0xfffffe081e427680 namei() at namei+0x536/frame 0xfffffe081e427740 kern_statat() at kern_statat+0xae/frame 0xfffffe081e427900 sys_fstatat() at sys_fstatat+0x2c/frame 0xfffffe081e4279a0 amd64_syscall() at amd64_syscall+0x29c/frame 0xfffffe081e427ab0 http://people.freebsd.org/~pho/stress/log/rrs003.txt - Peter From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 20:59:51 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5ADE3A5; Mon, 9 Feb 2015 20:59:51 +0000 (UTC) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com [209.85.223.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3C54DAC; Mon, 9 Feb 2015 20:59:51 +0000 (UTC) Received: by iecat20 with SMTP id at20so11281984iec.12; Mon, 09 Feb 2015 12:59:44 -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=EhETXsXuParWGWOE+USnKmfJUHcFWUIG3/toq3g8RDI=; b=Al5REdEgRoL2VPkXpzwO6mEHZBAnZaYrqxsKFIHd2QCVcYdloeQ4eCStKqulmDMPh5 Nw6QTfsP4P+3XDnjix1nQ0lirBN+VZima8yZZVPFXOmYZIiO0kMRWkJKGembkFrPFCRK xTwXkYyBEh5GdpVXfwpaIFexIIJ/xQAaXWK4hQ32MVotdi5R7050yfH8pEUqmNL2c5IK FTM2yvb7iF6lsN9mB1m9ysQH6Q69xOwcTQa6+daCcSLZ+BvYpN6/98M0QzZ2ELqCw/IY wcgPCwfGa2Vy3acB4OOc7qkj7i9pak4GNFzbovlTSHhDAOFRuod7wcgk5NR9XP8kiDDL tNuQ== MIME-Version: 1.0 X-Received: by 10.107.19.202 with SMTP id 71mr3912128iot.83.1423515584796; Mon, 09 Feb 2015 12:59:44 -0800 (PST) Received: by 10.50.182.233 with HTTP; Mon, 9 Feb 2015 12:59:44 -0800 (PST) In-Reply-To: <20150209201926.GF10438@strugglingcoder.info> References: <201502091919.t19JJjbg061542@svn.freebsd.org> <20150209201926.GF10438@strugglingcoder.info> Date: Mon, 9 Feb 2015 12:59:44 -0800 Message-ID: Subject: Re: svn commit: r278469 - in head/sys: kern sys From: NGie Cooper To: hiren panchasara Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , Randall Stewart , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 20:59:52 -0000 On Mon, Feb 9, 2015 at 12:19 PM, hiren panchasara wrote: ... > Thanks Randall for the fix. > > For future reference, correct way to specify phabric review is: > Differential Revision: https://reviews.freebsd.org/D1711 > > This triggers changes to the review on phabricator with reference to this > commit. This should be documented in the Committer's Guide: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197500 From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:01:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FC9F504; Mon, 9 Feb 2015 21:01: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09294DBE; Mon, 9 Feb 2015 21:01:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19L11JL010989; Mon, 9 Feb 2015 21:01:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19L0vsv010944; Mon, 9 Feb 2015 21:00:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502092100.t19L0vsv010944@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Feb 2015 21:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278473 - in head/sys: amd64/amd64 amd64/include amd64/vmm contrib/dev/acpica/include i386/i386 i386/include x86/acpica x86/include x86/x86 x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:01:02 -0000 Author: kib Date: Mon Feb 9 21:00:56 2015 New Revision: 278473 URL: https://svnweb.freebsd.org/changeset/base/278473 Log: Add x2APIC support. Enable it by default if CPU is capable. The hw.x2apic_enable tunable allows disabling it from the loader prompt. To closely repeat effects of the uncached memory ops when accessing registers in the xAPIC mode, the x2APIC writes to MSRs are preceeded by mfence, except for the EOI notifications. This is probably too strict, only ICR writes to send IPI require serialization to ensure that other CPUs see the previous actions when IPI is delivered. This may be changed later. In vmm justreturn IPI handler, call doreti_iret instead of doing iretd inline, to handle corner conditions. Note that the patch only switches LAPICs into x2APIC mode. It does not enables FreeBSD to support > 255 CPUs, which requires parsing x2APIC MADT entries and doing interrupts remapping, but is the required step on the way. Reviewed by: neel Tested by: pho (real hardware), neel (on bhyve) Discussed with: jhb, grehan Sponsored by: The FreeBSD Foundation MFC after: 2 months Modified: head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/cpufunc.h head/sys/amd64/vmm/vmm_support.S head/sys/contrib/dev/acpica/include/actbl2.h head/sys/i386/i386/apic_vector.s head/sys/i386/i386/genassym.c head/sys/i386/i386/mp_machdep.c head/sys/i386/include/cpufunc.h head/sys/x86/acpica/madt.c head/sys/x86/include/apicreg.h head/sys/x86/include/apicvar.h head/sys/x86/include/specialreg.h head/sys/x86/x86/io_apic.c head/sys/x86/x86/local_apic.c head/sys/x86/xen/xen_apic.c Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/amd64/amd64/apic_vector.S Mon Feb 9 21:00:56 2015 (r278473) @@ -39,6 +39,7 @@ #include "opt_smp.h" #include +#include #include #include "assym.s" @@ -49,6 +50,22 @@ #define LK #endif + .text + SUPERALIGN_TEXT + /* End Of Interrupt to APIC */ +as_lapic_eoi: + cmpl $0,x2apic_mode + jne 1f + movq lapic_map,%rax + movl $0,LA_EOI(%rax) + ret +1: + movl $MSR_APIC_EOI,%ecx + xorl %eax,%eax + xorl %edx,%edx + wrmsr + ret + /* * I/O Interrupt Entry Point. Rather than having one entry point for * each interrupt source, we use one entry point for each 32-bit word @@ -62,15 +79,22 @@ IDTVEC(vec_name) ; \ PUSH_FRAME ; \ FAKE_MCOUNT(TF_RIP(%rsp)) ; \ - movq lapic, %rdx ; /* pointer to local APIC */ \ + cmpl $0,x2apic_mode ; \ + je 1f ; \ + movl $(MSR_APIC_ISR0 + index),%ecx ; \ + rdmsr ; \ + jmp 2f ; \ +1: ; \ + movq lapic_map, %rdx ; /* pointer to local APIC */ \ movl LA_ISR + 16 * (index)(%rdx), %eax ; /* load ISR */ \ +2: ; \ bsrl %eax, %eax ; /* index of highest set bit in ISR */ \ - jz 1f ; \ + jz 3f ; \ addl $(32 * index),%eax ; \ movq %rsp, %rsi ; \ movl %eax, %edi ; /* pass the IRQ */ \ call lapic_handle_intr ; \ -1: ; \ +3: ; \ MEXITCOUNT ; \ jmp doreti @@ -160,8 +184,7 @@ IDTVEC(xen_intr_upcall) SUPERALIGN_TEXT invltlb_ret: - movq lapic, %rax - movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ + call as_lapic_eoi POP_FRAME jmp doreti_iret @@ -228,8 +251,7 @@ IDTVEC(invlcache) IDTVEC(ipi_intr_bitmap_handler) PUSH_FRAME - movq lapic, %rdx - movl $0, LA_EOI(%rdx) /* End Of Interrupt to APIC */ + call as_lapic_eoi FAKE_MCOUNT(TF_RIP(%rsp)) @@ -245,8 +267,7 @@ IDTVEC(ipi_intr_bitmap_handler) IDTVEC(cpustop) PUSH_FRAME - movq lapic, %rax - movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ + call as_lapic_eoi call cpustop_handler jmp doreti @@ -260,8 +281,7 @@ IDTVEC(cpususpend) PUSH_FRAME call cpususpend_handler - movq lapic, %rax - movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ + call as_lapic_eoi jmp doreti /* @@ -279,7 +299,6 @@ IDTVEC(rendezvous) incq (%rax) #endif call smp_rendezvous_action - movq lapic, %rax - movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ + call as_lapic_eoi jmp doreti #endif /* SMP */ Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/amd64/amd64/genassym.c Mon Feb 9 21:00:56 2015 (r278473) @@ -220,13 +220,8 @@ ASSYM(PC_COMMONTSSP, offsetof(struct pcp ASSYM(PC_TSS, offsetof(struct pcpu, pc_tss)); ASSYM(PC_PM_SAVE_CNT, offsetof(struct pcpu, pc_pm_save_cnt)); -ASSYM(LA_VER, offsetof(struct LAPIC, version)); -ASSYM(LA_TPR, offsetof(struct LAPIC, tpr)); -ASSYM(LA_EOI, offsetof(struct LAPIC, eoi)); -ASSYM(LA_SVR, offsetof(struct LAPIC, svr)); -ASSYM(LA_ICR_LO, offsetof(struct LAPIC, icr_lo)); -ASSYM(LA_ICR_HI, offsetof(struct LAPIC, icr_hi)); -ASSYM(LA_ISR, offsetof(struct LAPIC, isr0)); +ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); +ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL); ASSYM(KCSEL, GSEL(GCODE_SEL, SEL_KPL)); ASSYM(KDSEL, GSEL(GDATA_SEL, SEL_KPL)); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/amd64/amd64/mp_machdep.c Mon Feb 9 21:00:56 2015 (r278473) @@ -705,8 +705,11 @@ init_secondary(void) wrmsr(MSR_STAR, msr); wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D); - /* Disable local APIC just to be sure. */ - lapic_disable(); + /* + * On real hardware, switch to x2apic mode if possible. + * Disable local APIC until BSP directed APs to run. + */ + lapic_xapic_mode(); /* signal our startup to the BSP. */ mp_naps++; Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/amd64/include/cpufunc.h Mon Feb 9 21:00:56 2015 (r278473) @@ -343,6 +343,15 @@ rdmsr(u_int msr) return (low | ((uint64_t)high << 32)); } +static __inline uint32_t +rdmsr32(u_int msr) +{ + uint32_t low; + + __asm __volatile("rdmsr" : "=a" (low) : "c" (msr) : "rdx"); + return (low); +} + static __inline uint64_t rdpmc(u_int pmc) { @@ -826,6 +835,7 @@ u_long rcr2(void); u_long rcr3(void); u_long rcr4(void); uint64_t rdmsr(u_int msr); +uint32_t rdmsr32(u_int msr); uint64_t rdpmc(u_int pmc); uint64_t rdr0(void); uint64_t rdr1(void); Modified: head/sys/amd64/vmm/vmm_support.S ============================================================================== --- head/sys/amd64/vmm/vmm_support.S Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/amd64/vmm/vmm_support.S Mon Feb 9 21:00:56 2015 (r278473) @@ -30,13 +30,14 @@ #include -#define LA_EOI 0xB0 - .text SUPERALIGN_TEXT IDTVEC(justreturn) + pushq %rdx pushq %rax - movq lapic, %rax - movl $0, LA_EOI(%rax) + pushq %rcx + call as_lapic_eoi + popq %rcx popq %rax - iretq + popq %rdx + jmp doreti_iret Modified: head/sys/contrib/dev/acpica/include/actbl2.h ============================================================================== --- head/sys/contrib/dev/acpica/include/actbl2.h Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/contrib/dev/acpica/include/actbl2.h Mon Feb 9 21:00:56 2015 (r278473) @@ -466,6 +466,7 @@ typedef struct acpi_table_dmar /* Masks for Flags field above */ #define ACPI_DMAR_INTR_REMAP (1) +#define ACPI_DMAR_X2APIC_OPT_OUT (2) /* DMAR subtable header */ Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/i386/i386/apic_vector.s Mon Feb 9 21:00:56 2015 (r278473) @@ -39,10 +39,27 @@ #include "opt_smp.h" #include +#include #include #include "assym.s" + .text + SUPERALIGN_TEXT + /* End Of Interrupt to APIC */ +as_lapic_eoi: + cmpl $0,x2apic_mode + jne 1f + movl lapic_map,%eax + movl $0,LA_EOI(%eax) + ret +1: + movl $MSR_APIC_EOI,%ecx + xorl %eax,%eax + xorl %edx,%edx + wrmsr + ret + /* * I/O Interrupt Entry Point. Rather than having one entry point for * each interrupt source, we use one entry point for each 32-bit word @@ -58,16 +75,23 @@ IDTVEC(vec_name) ; \ SET_KERNEL_SREGS ; \ cld ; \ FAKE_MCOUNT(TF_EIP(%esp)) ; \ - movl lapic, %edx ; /* pointer to local APIC */ \ + cmpl $0,x2apic_mode ; \ + je 1f ; \ + movl $(MSR_APIC_ISR0 + index),%ecx ; \ + rdmsr ; \ + jmp 2f ; \ +1: ; \ + movl lapic_map, %edx ;/* pointer to local APIC */ \ movl LA_ISR + 16 * (index)(%edx), %eax ; /* load ISR */ \ +2: ; \ bsrl %eax, %eax ; /* index of highest set bit in ISR */ \ - jz 1f ; \ + jz 3f ; \ addl $(32 * index),%eax ; \ pushl %esp ; \ pushl %eax ; /* pass the IRQ */ \ call lapic_handle_intr ; \ addl $8, %esp ; /* discard parameter */ \ -1: ; \ +3: ; \ MEXITCOUNT ; \ jmp doreti @@ -164,8 +188,7 @@ IDTVEC(xen_intr_upcall) .text SUPERALIGN_TEXT invltlb_ret: - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + call as_lapic_eoi POP_FRAME iret @@ -232,8 +255,7 @@ IDTVEC(ipi_intr_bitmap_handler) SET_KERNEL_SREGS cld - movl lapic, %edx - movl $0, LA_EOI(%edx) /* End Of Interrupt to APIC */ + call as_lapic_eoi FAKE_MCOUNT(TF_EIP(%esp)) @@ -251,9 +273,7 @@ IDTVEC(cpustop) SET_KERNEL_SREGS cld - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ - + call as_lapic_eoi call cpustop_handler POP_FRAME @@ -270,9 +290,7 @@ IDTVEC(cpususpend) SET_KERNEL_SREGS cld - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ - + call as_lapic_eoi call cpususpend_handler POP_FRAME @@ -298,8 +316,7 @@ IDTVEC(rendezvous) #endif call smp_rendezvous_action - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + call as_lapic_eoi POP_FRAME iret @@ -315,8 +332,7 @@ IDTVEC(lazypmap) call pmap_lazyfix_action - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + call as_lapic_eoi POP_FRAME iret #endif /* SMP */ Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/i386/i386/genassym.c Mon Feb 9 21:00:56 2015 (r278473) @@ -219,13 +219,8 @@ ASSYM(PC_CURPMAP, offsetof(struct pcpu, ASSYM(PC_PRIVATE_TSS, offsetof(struct pcpu, pc_private_tss)); #ifdef DEV_APIC -ASSYM(LA_VER, offsetof(struct LAPIC, version)); -ASSYM(LA_TPR, offsetof(struct LAPIC, tpr)); -ASSYM(LA_EOI, offsetof(struct LAPIC, eoi)); -ASSYM(LA_SVR, offsetof(struct LAPIC, svr)); -ASSYM(LA_ICR_LO, offsetof(struct LAPIC, icr_lo)); -ASSYM(LA_ICR_HI, offsetof(struct LAPIC, icr_hi)); -ASSYM(LA_ISR, offsetof(struct LAPIC, isr0)); +ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); +ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL); #endif ASSYM(KCSEL, GSEL(GCODE_SEL, SEL_KPL)); Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/i386/i386/mp_machdep.c Mon Feb 9 21:00:56 2015 (r278473) @@ -719,8 +719,11 @@ init_secondary(void) load_cr0(cr0); CHECK_WRITE(0x38, 5); - /* Disable local APIC just to be sure. */ - lapic_disable(); + /* + * On real hardware, switch to x2apic mode if possible. + * Disable local APIC until BSP directed APs to run. + */ + lapic_xapic_mode(); /* signal our startup to the BSP. */ mp_naps++; Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/i386/include/cpufunc.h Mon Feb 9 21:00:56 2015 (r278473) @@ -346,6 +346,15 @@ rdmsr(u_int msr) return (rv); } +static __inline uint32_t +rdmsr32(u_int msr) +{ + uint32_t low; + + __asm __volatile("rdmsr" : "=a" (low) : "c" (msr) : "edx"); + return (low); +} + static __inline uint64_t rdpmc(u_int pmc) { Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/x86/acpica/madt.c Mon Feb 9 21:00:56 2015 (r278473) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -127,8 +128,27 @@ madt_probe_cpus(void) static int madt_setup_local(void) { + ACPI_TABLE_DMAR *dmartbl; + vm_paddr_t dmartbl_physaddr; madt = pmap_mapbios(madt_physaddr, madt_length); + if ((cpu_feature2 & CPUID2_X2APIC) != 0) { + x2apic_mode = 1; + dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR); + if (dmartbl_physaddr != 0) { + dmartbl = acpi_map_table(dmartbl_physaddr, + ACPI_SIG_DMAR); + if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0) { + x2apic_mode = 0; + if (bootverbose) + printf( + "x2APIC available but disabled by DMAR table\n"); + } + acpi_unmap_table(dmartbl); + } + TUNABLE_INT_FETCH("hw.x2apic_enable", &x2apic_mode); + } + lapic_init(madt->Address); printf("ACPI APIC Table: <%.*s %.*s>\n", (int)sizeof(madt->Header.OemId), madt->Header.OemId, Modified: head/sys/x86/include/apicreg.h ============================================================================== --- head/sys/x86/include/apicreg.h Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/x86/include/apicreg.h Mon Feb 9 21:00:56 2015 (r278473) @@ -193,6 +193,66 @@ struct LAPIC { typedef struct LAPIC lapic_t; +enum LAPIC_REGISTERS { + LAPIC_ID = 0x2, + LAPIC_VERSION = 0x3, + LAPIC_TPR = 0x8, + LAPIC_APR = 0x9, + LAPIC_PPR = 0xa, + LAPIC_EOI = 0xb, + LAPIC_LDR = 0xd, + LAPIC_DFR = 0xe, /* Not in x2APIC */ + LAPIC_SVR = 0xf, + LAPIC_ISR0 = 0x10, + LAPIC_ISR1 = 0x11, + LAPIC_ISR2 = 0x12, + LAPIC_ISR3 = 0x13, + LAPIC_ISR4 = 0x14, + LAPIC_ISR5 = 0x15, + LAPIC_ISR6 = 0x16, + LAPIC_ISR7 = 0x17, + LAPIC_TMR0 = 0x18, + LAPIC_TMR1 = 0x19, + LAPIC_TMR2 = 0x1a, + LAPIC_TMR3 = 0x1b, + LAPIC_TMR4 = 0x1c, + LAPIC_TMR5 = 0x1d, + LAPIC_TMR6 = 0x1e, + LAPIC_TMR7 = 0x1f, + LAPIC_IRR0 = 0x20, + LAPIC_IRR1 = 0x21, + LAPIC_IRR2 = 0x22, + LAPIC_IRR3 = 0x23, + LAPIC_IRR4 = 0x24, + LAPIC_IRR5 = 0x25, + LAPIC_IRR6 = 0x26, + LAPIC_IRR7 = 0x27, + LAPIC_ESR = 0x28, + LAPIC_LVT_CMCI = 0x2f, + LAPIC_ICR_LO = 0x30, + LAPIC_ICR_HI = 0x31, /* Not in x2APIC */ + LAPIC_LVT_TIMER = 0x32, + LAPIC_LVT_THERMAL = 0x33, + LAPIC_LVT_PCINT = 0x34, + LAPIC_LVT_LINT0 = 0x35, + LAPIC_LVT_LINT1 = 0x36, + LAPIC_LVT_ERROR = 0x37, + LAPIC_ICR_TIMER = 0x38, + LAPIC_CCR_TIMER = 0x39, + LAPIC_DCR_TIMER = 0x3e, + LAPIC_SELF_IPI = 0x3f, /* Only in x2APIC */ +}; + +/* + * The LAPIC_SELF_IPI register only exists in x2APIC mode. The + * formula below is applicable only to reserve the memory region, + * i.e. for xAPIC mode, where LAPIC_SELF_IPI finely serves as the + * address past end of the region. + */ +#define LAPIC_MEM_REGION (LAPIC_SELF_IPI * 0x10) + +#define LAPIC_MEM_MUL 0x10 + /****************************************************************************** * I/O APIC structure */ Modified: head/sys/x86/include/apicvar.h ============================================================================== --- head/sys/x86/include/apicvar.h Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/x86/include/apicvar.h Mon Feb 9 21:00:56 2015 (r278473) @@ -189,6 +189,7 @@ int ioapic_set_smi(void *cookie, u_int p struct apic_ops { void (*create)(u_int, int); void (*init)(vm_paddr_t); + void (*xapic_mode)(void); void (*setup)(int); void (*dump)(const char *); void (*disable)(void); @@ -243,6 +244,13 @@ lapic_init(vm_paddr_t addr) } static inline void +lapic_xapic_mode(void) +{ + + apic_ops.xapic_mode(); +} + +static inline void lapic_setup(int boot) { @@ -417,5 +425,11 @@ void lapic_handle_intr(int vector, struc void lapic_handle_timer(struct trapframe *frame); void xen_intr_handle_upcall(struct trapframe *frame); +extern int x2apic_mode; + +#ifdef _SYS_SYSCTL_H_ +SYSCTL_DECL(_hw_apic); +#endif + #endif /* !LOCORE */ #endif /* _X86_APICVAR_H_ */ Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/x86/include/specialreg.h Mon Feb 9 21:00:56 2015 (r278473) @@ -470,6 +470,7 @@ /* * X2APIC MSRs */ +#define MSR_APIC_000 0x800 #define MSR_APIC_ID 0x802 #define MSR_APIC_VERSION 0x803 #define MSR_APIC_TPR 0x808 Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/x86/x86/io_apic.c Mon Feb 9 21:00:56 2015 (r278473) @@ -130,7 +130,6 @@ struct pic ioapic_template = { ioapic_en static int next_ioapic_base; static u_int next_id; -static SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); static int enable_extint; SYSCTL_INT(_hw_apic, OID_AUTO, enable_extint, CTLFLAG_RDTUN, &enable_extint, 0, "Enable the ExtINT pin in the first I/O APIC"); @@ -896,7 +895,7 @@ apic_attach(device_t dev) int i; /* Reserve the local APIC. */ - apic_add_resource(dev, 0, lapic_paddr, sizeof(lapic_t)); + apic_add_resource(dev, 0, lapic_paddr, LAPIC_MEM_REGION); i = 1; STAILQ_FOREACH(io, &ioapic_list, io_next) { apic_add_resource(dev, i, io->io_paddr, IOAPIC_MEM_REGION); Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Feb 9 19:28:11 2015 (r278472) +++ head/sys/x86/x86/local_apic.c Mon Feb 9 21:00:56 2015 (r278473) @@ -49,12 +49,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -154,11 +156,99 @@ static u_int32_t lapic_timer_divisors[] extern inthand_t IDTVEC(rsvd); -volatile lapic_t *lapic; +volatile char *lapic_map; vm_paddr_t lapic_paddr; +int x2apic_mode; static u_long lapic_timer_divisor; static struct eventtimer lapic_et; +SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); +SYSCTL_INT(_hw_apic, OID_AUTO, x2apic_mode, CTLFLAG_RD, &x2apic_mode, 0, ""); + +static uint32_t +lapic_read32(enum LAPIC_REGISTERS reg) +{ + uint32_t res; + + if (x2apic_mode) { + res = rdmsr32(MSR_APIC_000 + reg); + } else { + res = *(volatile uint32_t *)(lapic_map + reg * LAPIC_MEM_MUL); + } + return (res); +} + +static void +lapic_write32(enum LAPIC_REGISTERS reg, uint32_t val) +{ + + if (x2apic_mode) { + mfence(); + wrmsr(MSR_APIC_000 + reg, val); + } else { + *(volatile uint32_t *)(lapic_map + reg * LAPIC_MEM_MUL) = val; + } +} + +static void +lapic_write32_nofence(enum LAPIC_REGISTERS reg, uint32_t val) +{ + + if (x2apic_mode) { + wrmsr(MSR_APIC_000 + reg, val); + } else { + *(volatile uint32_t *)(lapic_map + reg * LAPIC_MEM_MUL) = val; + } +} + +static uint64_t +lapic_read_icr(void) +{ + uint64_t v; + uint32_t vhi, vlo; + + if (x2apic_mode) { + v = rdmsr(MSR_APIC_000 + LAPIC_ICR_LO); + } else { + vhi = lapic_read32(LAPIC_ICR_HI); + vlo = lapic_read32(LAPIC_ICR_LO); + v = ((uint64_t)vhi << 32) | vlo; + } + return (v); +} + +static uint64_t +lapic_read_icr_lo(void) +{ + + return (lapic_read32(LAPIC_ICR_LO)); +} + +static void +lapic_write_icr(uint32_t vhi, uint32_t vlo) +{ + uint64_t v; + + if (x2apic_mode) { + v = ((uint64_t)vhi << 32) | vlo; + mfence(); + wrmsr(MSR_APIC_000 + LAPIC_ICR_LO, v); + } else { + lapic_write32(LAPIC_ICR_HI, vhi); + lapic_write32(LAPIC_ICR_LO, vlo); + } +} + +static void +native_lapic_enable_x2apic(void) +{ + uint64_t apic_base; + + apic_base = rdmsr(MSR_APICBASE); + apic_base |= APICBASE_X2APIC | APICBASE_ENABLED; + wrmsr(MSR_APICBASE, apic_base); +} + static void lapic_enable(void); static void lapic_resume(struct pic *pic, bool suspend_cancelled); static void lapic_timer_oneshot(struct lapic *, @@ -179,6 +269,7 @@ struct pic lapic_pic = { .pic_resume = l /* Forward declarations for apic_ops */ static void native_lapic_create(u_int apic_id, int boot_cpu); static void native_lapic_init(vm_paddr_t addr); +static void native_lapic_xapic_mode(void); static void native_lapic_setup(int boot); static void native_lapic_dump(const char *str); static void native_lapic_disable(void); @@ -213,6 +304,7 @@ static int native_lapic_set_lvt_trigger struct apic_ops apic_ops = { .create = native_lapic_create, .init = native_lapic_init, + .xapic_mode = native_lapic_xapic_mode, .setup = native_lapic_setup, .dump = native_lapic_dump, .disable = native_lapic_disable, @@ -291,11 +383,20 @@ native_lapic_init(vm_paddr_t addr) u_int regs[4]; int i, arat; - /* Map the local APIC and setup the spurious interrupt handler. */ + /* + * Enable x2APIC mode if possible, otherwise map the local + * APIC registers page. + */ KASSERT(trunc_page(addr) == addr, ("local APIC not aligned on a page boundary")); - lapic_paddr = addr; - lapic = pmap_mapdev(addr, sizeof(lapic_t)); + if (x2apic_mode) { + native_lapic_enable_x2apic(); + } else { + lapic_paddr = addr; + lapic_map = pmap_mapdev(addr, PAGE_SIZE); + } + + /* Setup the spurious interrupt handler. */ setidt(APIC_SPURIOUS_INT, IDTVEC(spuriousint), SDT_APIC, SEL_KPL, GSEL_APIC); @@ -398,33 +499,51 @@ native_lapic_dump(const char* str) { uint32_t maxlvt; - maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; + maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT; printf("cpu%d %s:\n", PCPU_GET(cpuid), str); - printf(" ID: 0x%08x VER: 0x%08x LDR: 0x%08x DFR: 0x%08x\n", - lapic->id, lapic->version, lapic->ldr, lapic->dfr); - printf(" lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n", - lapic->lvt_lint0, lapic->lvt_lint1, lapic->tpr, lapic->svr); + printf(" ID: 0x%08x VER: 0x%08x LDR: 0x%08x DFR: 0x%08x", + lapic_read32(LAPIC_ID), lapic_read32(LAPIC_VERSION), + lapic_read32(LAPIC_LDR), x2apic_mode ? 0 : lapic_read32(LAPIC_DFR)); + if ((cpu_feature2 & CPUID2_X2APIC) != 0) + printf(" x2APIC: %d", x2apic_mode); + printf("\n lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n", + lapic_read32(LAPIC_LVT_LINT0), lapic_read32(LAPIC_LVT_LINT1), + lapic_read32(LAPIC_TPR), lapic_read32(LAPIC_SVR)); printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x", - lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error); + lapic_read32(LAPIC_LVT_TIMER), lapic_read32(LAPIC_LVT_THERMAL), + lapic_read32(LAPIC_LVT_ERROR)); if (maxlvt >= APIC_LVT_PMC) - printf(" pmc: 0x%08x", lapic->lvt_pcint); + printf(" pmc: 0x%08x", lapic_read32(LAPIC_LVT_PCINT)); printf("\n"); if (maxlvt >= APIC_LVT_CMCI) - printf(" cmci: 0x%08x\n", lapic->lvt_cmci); + printf(" cmci: 0x%08x\n", lapic_read32(LAPIC_LVT_CMCI)); +} + +static void +native_lapic_xapic_mode(void) +{ + register_t saveintr; + + saveintr = intr_disable(); + if (x2apic_mode) + native_lapic_enable_x2apic(); + native_lapic_disable(); + intr_restore(saveintr); } static void native_lapic_setup(int boot) { struct lapic *la; - u_int32_t maxlvt; + uint32_t maxlvt; register_t saveintr; char buf[MAXCOMLEN + 1]; + saveintr = intr_disable(); + la = &lapics[lapic_id()]; KASSERT(la->la_present, ("missing APIC structure")); - saveintr = intr_disable(); - maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; + maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT; /* Initialize the TPR to allow all interrupts. */ lapic_set_tpr(0); @@ -433,16 +552,21 @@ native_lapic_setup(int boot) lapic_enable(); /* Program LINT[01] LVT entries. */ - lapic->lvt_lint0 = lvt_mode(la, APIC_LVT_LINT0, lapic->lvt_lint0); - lapic->lvt_lint1 = lvt_mode(la, APIC_LVT_LINT1, lapic->lvt_lint1); + lapic_write32(LAPIC_LVT_LINT0, lvt_mode(la, APIC_LVT_LINT0, + lapic_read32(LAPIC_LVT_LINT0))); + lapic_write32(LAPIC_LVT_LINT1, lvt_mode(la, APIC_LVT_LINT1, + lapic_read32(LAPIC_LVT_LINT1))); /* Program the PMC LVT entry if present. */ - if (maxlvt >= APIC_LVT_PMC) - lapic->lvt_pcint = lvt_mode(la, APIC_LVT_PMC, lapic->lvt_pcint); + if (maxlvt >= APIC_LVT_PMC) { + lapic_write32(LAPIC_LVT_PCINT, lvt_mode(la, APIC_LVT_PMC, + LAPIC_LVT_PCINT)); + } /* Program timer LVT and setup handler. */ - la->lvt_timer_cache = lapic->lvt_timer = - lvt_mode(la, APIC_LVT_TIMER, lapic->lvt_timer); + la->lvt_timer_cache = lvt_mode(la, APIC_LVT_TIMER, + lapic_read32(LAPIC_LVT_TIMER)); + lapic_write32(LAPIC_LVT_TIMER, la->lvt_timer_cache); if (boot) { snprintf(buf, sizeof(buf), "cpu%d:timer", PCPU_GET(cpuid)); intrcnt_add(buf, &la->la_timer_count); @@ -460,14 +584,17 @@ native_lapic_setup(int boot) } /* Program error LVT and clear any existing errors. */ - lapic->lvt_error = lvt_mode(la, APIC_LVT_ERROR, lapic->lvt_error); - lapic->esr = 0; + lapic_write32(LAPIC_LVT_ERROR, lvt_mode(la, APIC_LVT_ERROR, + lapic_read32(LAPIC_LVT_ERROR))); + lapic_write32(LAPIC_ESR, 0); /* XXX: Thermal LVT */ /* Program the CMCI LVT entry if present. */ - if (maxlvt >= APIC_LVT_CMCI) - lapic->lvt_cmci = lvt_mode(la, APIC_LVT_CMCI, lapic->lvt_cmci); + if (maxlvt >= APIC_LVT_CMCI) { + lapic_write32(LAPIC_LVT_CMCI, lvt_mode(la, APIC_LVT_CMCI, + lapic_read32(LAPIC_LVT_CMCI))); + } intr_restore(saveintr); } @@ -478,9 +605,9 @@ native_lapic_reenable_pmc(void) #ifdef HWPMC_HOOKS uint32_t value; - value = lapic->lvt_pcint; + value = lapic_read32(LAPIC_LVT_PCINT); value &= ~APIC_LVT_M; - lapic->lvt_pcint = value; + lapic_write32(LAPIC_LVT_PCINT, value); #endif } @@ -491,7 +618,8 @@ lapic_update_pmc(void *dummy) struct lapic *la; la = &lapics[lapic_id()]; - lapic->lvt_pcint = lvt_mode(la, APIC_LVT_PMC, lapic->lvt_pcint); + lapic_write32(LAPIC_LVT_PCINT, lvt_mode(la, APIC_LVT_PMC, + lapic_read32(LAPIC_LVT_PCINT))); } #endif @@ -502,11 +630,11 @@ native_lapic_enable_pmc(void) u_int32_t maxlvt; /* Fail if the local APIC is not present. */ - if (lapic == NULL) + if (!x2apic_mode && lapic_map == NULL) return (0); /* Fail if the PMC LVT is not present. */ - maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; + maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT; if (maxlvt < APIC_LVT_PMC) return (0); @@ -536,11 +664,11 @@ native_lapic_disable_pmc(void) u_int32_t maxlvt; /* Fail if the local APIC is not present. */ - if (lapic == NULL) + if (!x2apic_mode && lapic_map == NULL) return; /* Fail if the PMC LVT is not present. */ - maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; + maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT; if (maxlvt < APIC_LVT_PMC) return; @@ -569,7 +697,8 @@ lapic_et_start(struct eventtimer *et, sb lapic_timer_set_divisor(lapic_timer_divisor); lapic_timer_oneshot(la, APIC_TIMER_MAX_COUNT, 0); DELAY(1000000); - value = APIC_TIMER_MAX_COUNT - lapic->ccr_timer; + value = APIC_TIMER_MAX_COUNT - + lapic_read32(LAPIC_CCR_TIMER); if (value != APIC_TIMER_MAX_COUNT) break; lapic_timer_divisor <<= 1; @@ -613,21 +742,21 @@ native_lapic_disable(void) uint32_t value; /* Software disable the local APIC. */ - value = lapic->svr; + value = lapic_read32(LAPIC_SVR); value &= ~APIC_SVR_SWEN; - lapic->svr = value; + lapic_write32(LAPIC_SVR, value); } static void lapic_enable(void) { - u_int32_t value; + uint32_t value; /* Program the spurious vector to enable the local APIC. */ - value = lapic->svr; + value = lapic_read32(LAPIC_SVR); value &= ~(APIC_SVR_VECTOR | APIC_SVR_FOCUS); - value |= (APIC_SVR_FEN | APIC_SVR_SWEN | APIC_SPURIOUS_INT); - lapic->svr = value; + value |= APIC_SVR_FEN | APIC_SVR_SWEN | APIC_SPURIOUS_INT; + lapic_write32(LAPIC_SVR, value); } /* Reset the local APIC on the BSP during resume. */ @@ -641,27 +770,29 @@ lapic_resume(struct pic *pic, bool suspe static int native_lapic_id(void) { + uint32_t v; - KASSERT(lapic != NULL, ("local APIC is not mapped")); - return (lapic->id >> APIC_ID_SHIFT); + KASSERT(x2apic_mode || lapic_map != NULL, ("local APIC is not mapped")); + v = lapic_read32(LAPIC_ID); + if (!x2apic_mode) + v >>= APIC_ID_SHIFT; + return (v); } static int native_lapic_intr_pending(u_int vector) { - volatile u_int32_t *irr; + uint32_t irr; /* - * The IRR registers are an array of 128-bit registers each of - * which only describes 32 interrupts in the low 32 bits.. Thus, - * we divide the vector by 32 to get the 128-bit index. We then - * multiply that index by 4 to get the equivalent index from - * treating the IRR as an array of 32-bit registers. Finally, we - * modulus the vector by 32 to determine the individual bit to - * test. + * The IRR registers are an array of registers each of which + * only describes 32 interrupts in the low 32 bits. Thus, we + * divide the vector by 32 to get the register index. + * Finally, we modulus the vector by 32 to determine the + * individual bit to test. */ - irr = &lapic->irr0; - return (irr[(vector / 32) * 4] & 1 << (vector % 32)); + irr = lapic_read32(LAPIC_IRR0 + vector / 32); + return (irr & 1 << (vector % 32)); } static void @@ -818,13 +949,13 @@ static void lapic_set_tpr(u_int vector) { #ifdef CHEAP_TPR - lapic->tpr = vector; + lapic_write32(LAPIC_TPR, vector); #else - u_int32_t tpr; + uint32_t tpr; - tpr = lapic->tpr & ~APIC_TPR_PRIO; + tpr = lapic_read32(LAPIC_TPR) & ~APIC_TPR_PRIO; tpr |= vector; - lapic->tpr = tpr; + lapic_write32(LAPIC_TPR, tpr); #endif } @@ -832,7 +963,7 @@ static void native_lapic_eoi(void) { - lapic->eoi = 0; + lapic_write32_nofence(LAPIC_EOI, 0); } void @@ -894,46 +1025,46 @@ lapic_timer_set_divisor(u_int divisor) KASSERT(powerof2(divisor), ("lapic: invalid divisor %u", divisor)); KASSERT(ffs(divisor) <= sizeof(lapic_timer_divisors) / sizeof(u_int32_t), ("lapic: invalid divisor %u", divisor)); - lapic->dcr_timer = lapic_timer_divisors[ffs(divisor) - 1]; + lapic_write32(LAPIC_DCR_TIMER, lapic_timer_divisors[ffs(divisor) - 1]); } static void lapic_timer_oneshot(struct lapic *la, u_int count, int enable_int) { - u_int32_t value; + uint32_t value; value = la->lvt_timer_cache; value &= ~APIC_LVTT_TM; value |= APIC_LVTT_TM_ONE_SHOT; if (enable_int) value &= ~APIC_LVT_M; - lapic->lvt_timer = value; - lapic->icr_timer = count; + lapic_write32(LAPIC_LVT_TIMER, value); + lapic_write32(LAPIC_ICR_TIMER, count); } static void lapic_timer_periodic(struct lapic *la, u_int count, int enable_int) { - u_int32_t value; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:03:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96793707; Mon, 9 Feb 2015 21:03: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82F94E74; Mon, 9 Feb 2015 21:03:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19L3Obw013796; Mon, 9 Feb 2015 21:03:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19L3OAn013792; Mon, 9 Feb 2015 21:03:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201502092103.t19L3OAn013792@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 Feb 2015 21:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278474 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:03:24 -0000 Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision: 278474 URL: https://svnweb.freebsd.org/changeset/base/278474 Log: Use __builtin_popcnt() to implement a BIT_COUNT() operation for bitsets and use this to implement CPU_COUNT() to count the number of CPUs in a cpuset. MFC after: 2 weeks Modified: head/sys/sys/bitset.h head/sys/sys/cpuset.h Modified: head/sys/sys/bitset.h ============================================================================== --- head/sys/sys/bitset.h Mon Feb 9 21:00:56 2015 (r278473) +++ head/sys/sys/bitset.h Mon Feb 9 21:03:23 2015 (r278474) @@ -176,4 +176,14 @@ __bit; \ }) +#define BIT_COUNT(_s, p) __extension__ ({ \ + __size_t __i; \ + int __count; \ + \ + __count = 0; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + __count += __builtin_popcount((p)->__bits[__i]); \ + __count; \ +}) + #endif /* !_SYS_BITSET_H_ */ Modified: head/sys/sys/cpuset.h ============================================================================== --- head/sys/sys/cpuset.h Mon Feb 9 21:00:56 2015 (r278473) +++ head/sys/sys/cpuset.h Mon Feb 9 21:03:23 2015 (r278474) @@ -60,6 +60,7 @@ #define CPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s) #define CPU_COPY_STORE_REL(f, t) BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) #define CPU_FFS(p) BIT_FFS(CPU_SETSIZE, p) +#define CPU_COUNT(p) BIT_COUNT(CPU_SETSIZE, p) /* * Valid cpulevel_t values. From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:15:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C05AEBB1; Mon, 9 Feb 2015 21:15: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92EA6F83; Mon, 9 Feb 2015 21:15:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19LFrKb019582; Mon, 9 Feb 2015 21:15:53 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19LFrEk019578; Mon, 9 Feb 2015 21:15:53 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201502092115.t19LFrEk019578@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Mon, 9 Feb 2015 21:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278475 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:15:53 -0000 Author: brd (doc committer) Date: Mon Feb 9 21:15:52 2015 New Revision: 278475 URL: https://svnweb.freebsd.org/changeset/base/278475 Log: Add tests for `pw usernext'. PR: 197120 Submitted by: Robert O'Neil Approved by: will Added: head/usr.sbin/pw/tests/pw_usernext.sh (contents, props changed) Modified: head/usr.sbin/pw/tests/Makefile Modified: head/usr.sbin/pw/tests/Makefile ============================================================================== --- head/usr.sbin/pw/tests/Makefile Mon Feb 9 21:03:23 2015 (r278474) +++ head/usr.sbin/pw/tests/Makefile Mon Feb 9 21:15:52 2015 (r278475) @@ -11,7 +11,8 @@ ATF_TESTS_SH= pw_etcdir \ pw_groupmod \ pw_useradd \ pw_userdel \ - pw_usermod + pw_usermod \ + pw_usernext .for tp in ${ATF_TESTS_SH} TEST_METADATA.${tp}+= required_user="root" Added: head/usr.sbin/pw/tests/pw_usernext.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/pw_usernext.sh Mon Feb 9 21:15:52 2015 (r278475) @@ -0,0 +1,42 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +# Test usernext after adding a random number of new users. +atf_test_case usernext +usernext_body() { + populate_etc_skel + + var0=1 + LIMIT=`jot -r 1 2 10` + while [ "$var0" -lt "$LIMIT" ] + do + atf_check -s exit:0 ${PW} useradd test$var0 + var0=`expr $var0 + 1` + done + atf_check -s exit:0 -o match:"100${LIMIT}:100${LIMIT}" \ + ${PW} usernext +} + +# Test usernext when multiple users are added to the same group so +# that group id doesn't increment at the same pace as new users. +atf_test_case usernext_assigned_group +usernext_assigned_group_body() { + populate_etc_skel + + var0=1 + LIMIT=`jot -r 1 2 10` + while [ "$var0" -lt "$LIMIT" ] + do + atf_check -s exit:0 ${PW} useradd -n test$var0 -g 0 + var0=`expr $var0 + 1` + done + atf_check -s exit:0 -o match:"100${LIMIT}:1001}" \ + ${PW} usernext +} + +atf_init_test_cases() { + atf_add_test_case usernext + atf_add_test_case usernext_assigned_group +} From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:22:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFAD6ED5; Mon, 9 Feb 2015 21:22:32 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 62A2420E5; Mon, 9 Feb 2015 21:22:32 +0000 (UTC) Message-ID: <54D92517.80203@FreeBSD.org> Date: Mon, 09 Feb 2015 16:22:31 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278474 - head/sys/sys References: <201502092103.t19L3OAn013792@svn.freebsd.org> In-Reply-To: <201502092103.t19L3OAn013792@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:22:32 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 02/09/2015 16:03, John Baldwin wrote: > Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision: 278474 > URL: https://svnweb.freebsd.org/changeset/base/278474 > > Log: Use __builtin_popcnt() to implement a BIT_COUNT() operation > for bitsets and use this to implement CPU_COUNT() to count the > number of CPUs in a cpuset. ... This is wrong. __builtin_popcountl() must be used here. __builtin_popcount() is for *int*. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU2SUTAAoJEHyflib82/FGb3oH/1va9V2zWD+fxz9jzvZzT8ka yqt9dOVpmpztpJ0XtiwCVp42hEtwvjRWefV4Qn7XntNezhF5l4N0BCLN+XmsHhdD eoDCtQKuop+sQM64gqVgQSYBU8oho05mMmvMhIe3zf818X84pr1T6WEHbc+bgXh5 RGOPNRyau7nFldIjWfdwkyUFpiztHkxL94odFU6P6bDiCrfpngyiuOgi7vHf0QTX Ml+9eR1AbCOx69Ntccj35++TqCWY2HKwxdlWXn7D/AXIBwWguzUS3wKOg8Oyd42k 3lPpHU4WYYERtHIY/P1LsPrQV/eB/rEoLTL5RccvEyHDl025QdSAXKwH8ij8Tvk= =HAEQ -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:25:11 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14088268; Mon, 9 Feb 2015 21:25:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2BDC11A; Mon, 9 Feb 2015 21:25:10 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 06FEBB926; Mon, 9 Feb 2015 16:25:10 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r278474 - head/sys/sys Date: Mon, 09 Feb 2015 16:08:59 -0500 Message-ID: <1698688.fEq0HxqPxg@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201502092103.t19L3OAn013792@svn.freebsd.org> References: <201502092103.t19L3OAn013792@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Feb 2015 16:25:10 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:25:11 -0000 On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote: > Author: jhb > Date: Mon Feb 9 21:03:23 2015 > New Revision: 278474 > URL: https://svnweb.freebsd.org/changeset/base/278474 > > Log: > Use __builtin_popcnt() to implement a BIT_COUNT() operation for bitsets > and use this to implement CPU_COUNT() to count the number of CPUs in a > cpuset. > > MFC after: 2 weeks Yes, __builtin_popcnt() works with GCC 4.2. It should also allow the compiler to DTRT in userland uses of this if -msse4.2 is enabled. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:39:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4F1681F; Mon, 9 Feb 2015 21:39: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C190A285; Mon, 9 Feb 2015 21:39:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19LdJsJ034575; Mon, 9 Feb 2015 21:39:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19LdJFm034574; Mon, 9 Feb 2015 21:39:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201502092139.t19LdJFm034574@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 Feb 2015 21:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278476 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:39:19 -0000 Author: jhb Date: Mon Feb 9 21:39:18 2015 New Revision: 278476 URL: https://svnweb.freebsd.org/changeset/base/278476 Log: Use __builtin_popcountl() instead of __builtin_popcount(). Submitted by: jkim Modified: head/sys/sys/bitset.h Modified: head/sys/sys/bitset.h ============================================================================== --- head/sys/sys/bitset.h Mon Feb 9 21:15:52 2015 (r278475) +++ head/sys/sys/bitset.h Mon Feb 9 21:39:18 2015 (r278476) @@ -182,7 +182,7 @@ \ __count = 0; \ for (__i = 0; __i < __bitset_words((_s)); __i++) \ - __count += __builtin_popcount((p)->__bits[__i]); \ + __count += __builtin_popcountl((p)->__bits[__i]); \ __count; \ }) From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:41:05 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50907A01; Mon, 9 Feb 2015 21:41:05 +0000 (UTC) Received: from lakerest.net (lakerest.net [162.235.35.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lakerest.net", Issuer "Stewart" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E1AA02CE; Mon, 9 Feb 2015 21:41:04 +0000 (UTC) Received: from rrss-MacBook-Air.local (173.64-138-239-net.sccoast.net [64.138.239.173]) (authenticated bits=0) by lakerest.net (8.14.4/8.14.3) with ESMTP id t19LUmt6003522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 9 Feb 2015 16:30:49 -0500 (EST) (envelope-from rrs@freebsd.org) Message-ID: <54D92954.1020702@freebsd.org> Date: Mon, 09 Feb 2015 16:40:36 -0500 From: randall User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r278469 - in head/sys: kern sys References: <201502091919.t19JJjbg061542@svn.freebsd.org> <1619204.FQlXD7hmMU@ralph.baldwin.cx> In-Reply-To: <1619204.FQlXD7hmMU@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:41:05 -0000 John: See below.. On 2/9/15 3:09 PM, John Baldwin wrote: > On Monday, February 09, 2015 07:19:45 PM Randall Stewart wrote: >> Author: rrs >> Date: Mon Feb 9 19:19:44 2015 >> New Revision: 278469 >> URL: https://svnweb.freebsd.org/changeset/base/278469 >> >> Log: >> This fixes two conditions that can incur when migration >> is being done in the callout code and harmonizes the macro >> use.: >> 1) The callout_active() will lie. Basically if a migration >> is occuring and the callout is about to expire and the >> migration has been deferred, the callout_active will no >> longer return true until after the migration. This confuses >> and breaks callers that are doing callout_init(&c, 1); such >> as TCP. >> 2) The migration code had a bug in it where when migrating, if >> a two calls to callout_reset came in and they both collided with >> the callout on the wheel about to run, then the second call to >> callout_reset would corrupt the list the callout wheel uses >> putting the callout thread into a endless loop. >> 3) Per imp, I have fixed all the macro occurance in the code that >> were for the most part being ignored. >> >> Phabricator D1711 and looked at by lstewart and jhb and sbruno. >> Reviewed by: kostikbel, imp, adrian, hselasky >> MFC after: 3 days >> Sponsored by: Netflix Inc. > Thank you guys for working together to fix the migration race in a way > that lets CALLOUT_MPSAFE timers use multiple CPUs still. Your very much welcome.. it was a fun bug to track down :-) > > I do think that callout_drain_async() would also be useful to add. Well, I have been thinking about this, and I do think it will be easy to add though I did not want to further pollute the commit with new features. I will see about working on it here in the next few weeks :-) R > From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:45:42 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E68A5BC0; Mon, 9 Feb 2015 21:45:42 +0000 (UTC) Received: from lakerest.net (lakerest.net [162.235.35.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lakerest.net", Issuer "Stewart" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D9EC3B6; Mon, 9 Feb 2015 21:45:42 +0000 (UTC) Received: from rrss-MacBook-Air.local (173.64-138-239-net.sccoast.net [64.138.239.173]) (authenticated bits=0) by lakerest.net (8.14.4/8.14.3) with ESMTP id t19LZgdc003632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 9 Feb 2015 16:35:43 -0500 (EST) (envelope-from rrs@freebsd.org) Message-ID: <54D92A7A.9000300@freebsd.org> Date: Mon, 09 Feb 2015 16:45:30 -0500 From: randall User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 References: <201502091928.t19JSC5P066293@svn.freebsd.org> <1903622.i3cFFNVYcL@ralph.baldwin.cx> In-Reply-To: <1903622.i3cFFNVYcL@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:45:43 -0000 On 2/9/15 3:11 PM, John Baldwin wrote: > Eh, I looked at it, but I really, really don't like it. I think > callout_init_*() should be preferred to CALLOUT_MPSAFE whenever possible as it > is less race-prone. I think this should probably be fixed by adding Hans' > callout_drain_async() instead, though this is fine as a temporary workaround. I know you did not like it, and I think in principle I agree with you that a new callout_drain_async() needs to be introduced to the KPI for callout. That all being said in this one case, I do think the right immediate fix (until thats ready) was to make it MPSAFE like I did. In this particular instance init'ing with the lock was exactly the wrong thing to do with the reference counting that was going on. Yes, we need to get the drain_async.. but that will take more time and more poking at the callout system to make sure its solid before we start switching things to use it. And this I think was panic'ing a *lot* of systems.. R > From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:45:58 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8886CFC; Mon, 9 Feb 2015 21:45:58 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F35D3C7; Mon, 9 Feb 2015 21:45:58 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 55A6B25D3A9F; Mon, 9 Feb 2015 21:45:55 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 85325C76FD0; Mon, 9 Feb 2015 21:45:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Gz2i6IjRf5gd; Mon, 9 Feb 2015 21:45:52 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:fd45:f85d:6c3a:49ac] (unknown [IPv6:fde9:577b:c1a9:4410:fd45:f85d:6c3a:49ac]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E54CEC76FD3; Mon, 9 Feb 2015 21:45:50 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 From: "Bjoern A. Zeeb" In-Reply-To: <201502091928.t19JSC5P066293@svn.freebsd.org> Date: Mon, 9 Feb 2015 21:45:35 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <38B8D2D0-862A-4DF5-9479-8EC234CF830B@FreeBSD.org> References: <201502091928.t19JSC5P066293@svn.freebsd.org> To: Randall Stewart X-Mailer: Apple Mail (2.2070.6) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:45:59 -0000 > On 09 Feb 2015, at 19:28 , Randall Stewart wrote: >=20 > Author: rrs > Date: Mon Feb 9 19:28:11 2015 > New Revision: 278472 > URL: https://svnweb.freebsd.org/changeset/base/278472 >=20 > Log: > This fixes a bug in the way that the LLE timers for nd6 > and arp were being used. They basically would pass in the > mutex to the callout_init. Because they used this method > to the callout system, it was possible to "stop" the callout. > When flushing the table and you stopped the running callout, the > callout_stop code would return 1 indicating that it was going > to stop the callout (that was about to run on the callout_wheel = blocked > by the function calling the stop). Now when 1 was returned, it would > lower the reference count one extra time for the stopped timer, then > a few lines later delete the memory. Of course the callout_wheel was > stuck in the lock code and would then crash since it was accessing > freed memory. By using callout_init(c, 1) we always get a 0 back > and the reference counting bug does not rear its head. We do have > to make a few adjustments to the callouts themselves though to make > sure it does the proper thing if rescheduled as well as gets the = lock. >=20 > Commented upon by hiren and sbruno > See Phabricator D1777 for more details. >=20 > Commented upon by hiren and sbruno > Reviewed by: adrian, jhb and bz I have not reviewed this; as a matter of fact you are aware that I = still wanted to do that. > Sponsored by: Netflix Inc. >=20 > Modified: > head/sys/netinet/if_ether.c > head/sys/netinet/in.c > head/sys/netinet6/in6.c > head/sys/netinet6/nd6.c >=20 > Modified: head/sys/netinet/if_ether.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/netinet/if_ether.c Mon Feb 9 19:21:54 2015 = (r278471) > +++ head/sys/netinet/if_ether.c Mon Feb 9 19:28:11 2015 = (r278472) > @@ -166,10 +166,28 @@ arptimer(void *arg) > struct ifnet *ifp; >=20 > if (lle->la_flags & LLE_STATIC) { > - LLE_WUNLOCK(lle); > return; > } > - > + LLE_WLOCK(lle); > + if (callout_pending(&lle->la_timer)) { > + /* > + * Here we are a bit odd here in the treatment of=20 > + * active/pending. If the pending bit is set, it got > + * rescheduled before I ran. The active > + * bit we ignore, since if it was stopped > + * in ll_tablefree() and was currently running > + * it would have return 0 so the code would > + * not have deleted it since the callout could > + * not be stopped so we want to go through > + * with the delete here now. If the callout > + * was restarted, the pending bit will be back on and > + * we just want to bail since the callout_reset would > + * return 1 and our reference would have been removed > + * by arpresolve() below. > + */ > + LLE_WUNLOCK(lle); > + return; > + } > ifp =3D lle->lle_tbl->llt_ifp; > CURVNET_SET(ifp->if_vnet); >=20 >=20 > Modified: head/sys/netinet/in.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/netinet/in.c Mon Feb 9 19:21:54 2015 = (r278471) > +++ head/sys/netinet/in.c Mon Feb 9 19:28:11 2015 = (r278472) > @@ -962,8 +962,7 @@ in_lltable_new(const struct sockaddr *l3 > lle->base.lle_refcnt =3D 1; > lle->base.lle_free =3D in_lltable_free; > LLE_LOCK_INIT(&lle->base); > - callout_init_rw(&lle->base.la_timer, &lle->base.lle_lock, > - CALLOUT_RETURNUNLOCKED); > + callout_init(&lle->base.la_timer, 1); >=20 > return (&lle->base); > } >=20 > Modified: head/sys/netinet6/in6.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/netinet6/in6.c Mon Feb 9 19:21:54 2015 = (r278471) > +++ head/sys/netinet6/in6.c Mon Feb 9 19:28:11 2015 = (r278472) > @@ -2047,8 +2047,7 @@ in6_lltable_new(const struct sockaddr *l > lle->base.lle_refcnt =3D 1; > lle->base.lle_free =3D in6_lltable_free; > LLE_LOCK_INIT(&lle->base); > - callout_init_rw(&lle->base.ln_timer_ch, &lle->base.lle_lock, > - CALLOUT_RETURNUNLOCKED); > + callout_init(&lle->base.ln_timer_ch, 1); >=20 > return (&lle->base); > } >=20 > Modified: head/sys/netinet6/nd6.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/netinet6/nd6.c Mon Feb 9 19:21:54 2015 = (r278471) > +++ head/sys/netinet6/nd6.c Mon Feb 9 19:28:11 2015 = (r278472) > @@ -473,9 +473,28 @@ nd6_llinfo_timer(void *arg) >=20 > KASSERT(arg !=3D NULL, ("%s: arg NULL", __func__)); > ln =3D (struct llentry *)arg; > - LLE_WLOCK_ASSERT(ln); > + LLE_WLOCK(ln); > + if (callout_pending(&ln->la_timer)) { > + /* > + * Here we are a bit odd here in the treatment of=20 > + * active/pending. If the pending bit is set, it got > + * rescheduled before I ran. The active > + * bit we ignore, since if it was stopped > + * in ll_tablefree() and was currently running > + * it would have return 0 so the code would > + * not have deleted it since the callout could > + * not be stopped so we want to go through > + * with the delete here now. If the callout > + * was restarted, the pending bit will be back on and > + * we just want to bail since the callout_reset would > + * return 1 and our reference would have been removed > + * by nd6_llinfo_settimer_locked above since canceled > + * would have been 1. > + */ > + LLE_WUNLOCK(ln); > + return; > + } > ifp =3D ln->lle_tbl->llt_ifp; > - > CURVNET_SET(ifp->if_vnet); >=20 > if (ln->ln_ntick > 0) { >=20 =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:47:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5466E3D; Mon, 9 Feb 2015 21:47: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A194F3CF; Mon, 9 Feb 2015 21:47:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19LlDmm040435; Mon, 9 Feb 2015 21:47:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19LlDAd040434; Mon, 9 Feb 2015 21:47:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502092147.t19LlDAd040434@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Feb 2015 21:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278477 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:47:13 -0000 Author: hselasky Date: Mon Feb 9 21:47:12 2015 New Revision: 278477 URL: https://svnweb.freebsd.org/changeset/base/278477 Log: Fix DMA address casts. Regression issue after r278279. MFC after: 3 days Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Feb 9 21:39:18 2015 (r278476) +++ head/sys/dev/usb/controller/xhci.c Mon Feb 9 21:47:12 2015 (r278477) @@ -492,7 +492,7 @@ xhci_start_controller(struct xhci_softc XWRITE4(sc, runt, XHCI_ERDP_LO(0), (uint32_t)addr); XWRITE4(sc, runt, XHCI_ERDP_HI(0), (uint32_t)(addr >> 32)); - addr = (uint64_t)buf_res.physaddr; + addr = buf_res.physaddr; DPRINTF("ERSTBA(0)=0x%016llx\n", (unsigned long long)addr); @@ -1114,7 +1114,7 @@ xhci_interrupt_poll(struct xhci_softc *s * register. */ - addr = (uint32_t)buf_res.physaddr; + addr = buf_res.physaddr; addr += (uintptr_t)&((struct xhci_hw_root *)0)->hwr_events[i]; /* try to clear busy bit */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:47:23 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DF06F76; Mon, 9 Feb 2015 21:47:23 +0000 (UTC) Received: from lakerest.net (lakerest.net [162.235.35.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lakerest.net", Issuer "Stewart" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 542043D3; Mon, 9 Feb 2015 21:47:22 +0000 (UTC) Received: from rrss-MacBook-Air.local (173.64-138-239-net.sccoast.net [64.138.239.173]) (authenticated bits=0) by lakerest.net (8.14.4/8.14.3) with ESMTP id t19LbNkt003667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 9 Feb 2015 16:37:29 -0500 (EST) (envelope-from rrs@freebsd.org) Message-ID: <54D92ADE.5000306@freebsd.org> Date: Mon, 09 Feb 2015 16:47:10 -0500 From: randall User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: hiren panchasara Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 References: <201502091928.t19JSC5P066293@svn.freebsd.org> <20150209202250.GG10438@strugglingcoder.info> In-Reply-To: <20150209202250.GG10438@strugglingcoder.info> Content-Type: text/plain; charset=windows-1252; format=flowed 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:47:23 -0000 Hiren: I hope that later this week I can MFC these things in. I would like to see them sync down to 10 Stable so we can get it out in our next Firmware release as well. We have seen a *lot* of strange panics and I am thinking some of it may be related to these two fixes. I will send you an email when I get ready to MFC it. Best wishes R >Thanks for the fix, Randall. When do you plan to MFC this? It'd be nice to have this MFC'd along with D1711 changes so that we do not see panics reported in the review. Cheers, Hiren From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 21:55:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F69D20C; Mon, 9 Feb 2015 21:55:53 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 33E1D3B83; Mon, 9 Feb 2015 21:55:53 +0000 (UTC) Message-ID: <54D92CE8.1030803@FreeBSD.org> Date: Mon, 09 Feb 2015 16:55:52 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: John Baldwin , src-committers@freebsd.org Subject: Re: svn commit: r278474 - head/sys/sys References: <201502092103.t19L3OAn013792@svn.freebsd.org> <1698688.fEq0HxqPxg@ralph.baldwin.cx> In-Reply-To: <1698688.fEq0HxqPxg@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 21:55:53 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 02/09/2015 16:08, John Baldwin wrote: > On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote: >> Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision: 278474 >> URL: https://svnweb.freebsd.org/changeset/base/278474 >> >> Log: Use __builtin_popcnt() to implement a BIT_COUNT() operation >> for bitsets and use this to implement CPU_COUNT() to count the >> number of CPUs in a cpuset. >> >> MFC after: 2 weeks > > Yes, __builtin_popcnt() works with GCC 4.2. It should also allow > the compiler to DTRT in userland uses of this if -msse4.2 is > enabled. Back in 2012, when I submitted a similar patch, bde noted __builtin_popcount*() cannot be used with GCC 4.2 for *kernel* because it emits a library call. http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135 FYI... Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU2SzhAAoJEHyflib82/FGzgoH/2mfCZTX6J84MYpfuJV5dnLQ 97Itozifc8qBNDCOIQ1PZNgxPed9U8Ma0o3Rntfl5X2VeAIc/c5JJhvQITUdhnn7 fyW5FcpvJGpHLcUWlTMT5CrZgmDswi6h1jIsbD6AKoIVNGau5kPhpn4LF7f19YU0 0Vm8L96gGrxjJb3SWdRC4znP1ezTCw3rUEyk2oPZBn69zoat1vBcV7WtathStcBg noIEydo6C5e4EC5SKbTi29aNd1KGafRIukkC8+jnZNCc8nYEVsUEX5SarKYmmpec NTSLfboTJ5YXZGsvIgGzld0Z/Hn54v8O0hhG1QO4kWh3wN40NVgNL0vkeiveqwE= =WDqA -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:06:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF5C750A; Mon, 9 Feb 2015 22:06:06 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 63D123F74; Mon, 9 Feb 2015 22:06:06 +0000 (UTC) Message-ID: <54D92F4D.5020007@FreeBSD.org> Date: Mon, 09 Feb 2015 17:06:05 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: John Baldwin , src-committers@freebsd.org Subject: Re: svn commit: r278474 - head/sys/sys References: <201502092103.t19L3OAn013792@svn.freebsd.org> <1698688.fEq0HxqPxg@ralph.baldwin.cx> <54D92CE8.1030803@FreeBSD.org> In-Reply-To: <54D92CE8.1030803@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 22:06:07 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 02/09/2015 16:55, Jung-uk Kim wrote: > On 02/09/2015 16:08, John Baldwin wrote: >> On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote: >>> Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision: >>> 278474 URL: https://svnweb.freebsd.org/changeset/base/278474 >>> >>> Log: Use __builtin_popcnt() to implement a BIT_COUNT() >>> operation for bitsets and use this to implement CPU_COUNT() to >>> count the number of CPUs in a cpuset. >>> >>> MFC after: 2 weeks > >> Yes, __builtin_popcnt() works with GCC 4.2. It should also >> allow the compiler to DTRT in userland uses of this if -msse4.2 >> is enabled. > > Back in 2012, when I submitted a similar patch, bde noted > __builtin_popcount*() cannot be used with GCC 4.2 for *kernel* > because it emits a library call. > > http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135 BTW, __POPCNT__ macro may be used to detect availability of POPCNT instruction when compiled with Clang. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU2S9NAAoJEHyflib82/FGy+kH/20SFWEXK5lSfWxYMvxMp46W ZjOFW46ZefkUHiDLgPcED4oZd4cmX/KNXns3YSO5lwL4JeFsO+mzTKpmV7llPV22 y1/xHChk3Z3BJwq3lzGZmVeT4Cw2T6Mf4f1PCqfMkijDDsVrkEYBeko+QW3gpGjZ BrjH8EmFLDZ78rmPP/Nsbm8HZNEI89NOGBYEw615kA5ibuZZ0L2T6ybcipysDaxe fYpBcIhm58erXIrlNtYeSX6YyZPHMPJBACjkyPEKk8L7eKYR27++VKZGas8flEze 5x/5n9TftKwei2rHXhuogNqClACsLIBkM6a/Y/PNBMDOQ+0OEu6uDr0a63log00= =zY2U -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:12:37 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEE416B4; Mon, 9 Feb 2015 22:12:37 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 976128A5; Mon, 9 Feb 2015 22:12:37 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B358AB93B; Mon, 9 Feb 2015 17:12:35 -0500 (EST) From: John Baldwin To: Jung-uk Kim Subject: Re: svn commit: r278474 - head/sys/sys Date: Mon, 09 Feb 2015 17:12:02 -0500 Message-ID: <3501684.yzo0NMkRZd@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <54D92CE8.1030803@FreeBSD.org> References: <201502092103.t19L3OAn013792@svn.freebsd.org> <1698688.fEq0HxqPxg@ralph.baldwin.cx> <54D92CE8.1030803@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Feb 2015 17:12:35 -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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 22:12:37 -0000 On Monday, February 09, 2015 04:55:52 PM Jung-uk Kim wrote: > On 02/09/2015 16:08, John Baldwin wrote: > > On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote: > >> Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision: 278474 > >> URL: https://svnweb.freebsd.org/changeset/base/278474 > >> > >> Log: Use __builtin_popcnt() to implement a BIT_COUNT() operation > >> for bitsets and use this to implement CPU_COUNT() to count the > >> number of CPUs in a cpuset. > >> > >> MFC after: 2 weeks > > > > Yes, __builtin_popcnt() works with GCC 4.2. It should also allow > > the compiler to DTRT in userland uses of this if -msse4.2 is > > enabled. > > Back in 2012, when I submitted a similar patch, bde noted > __builtin_popcount*() cannot be used with GCC 4.2 for *kernel* because > it emits a library call. > > http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135 > > FYI... Weird, I though I built a kernel with this in a tree that uses it in the igb(4) driver. We need a CPU_COUNT() no matter what, but if this emits a library call under GCC I will need to add the call. We could also adopt your bitcount header, though I think it is more consistent to keep the loop in BIT_COUNT() and use something that emulates popcountl() rather than directly using bitcount() in BIT_COUNT() (primarily because the rest of sys/bitset.h is structured that way: explicit loops in sys/bitset.h itself). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 22:27:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBC6D968; Mon, 9 Feb 2015 22:27:46 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 73E658F3; Mon, 9 Feb 2015 22:27:46 +0000 (UTC) Message-ID: <54D93461.8010109@FreeBSD.org> Date: Mon, 09 Feb 2015 17:27:45 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r278474 - head/sys/sys References: <201502092103.t19L3OAn013792@svn.freebsd.org> <1698688.fEq0HxqPxg@ralph.baldwin.cx> <54D92CE8.1030803@FreeBSD.org> <3501684.yzo0NMkRZd@ralph.baldwin.cx> In-Reply-To: <3501684.yzo0NMkRZd@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 22:27:47 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 02/09/2015 17:12, John Baldwin wrote: > On Monday, February 09, 2015 04:55:52 PM Jung-uk Kim wrote: >> On 02/09/2015 16:08, John Baldwin wrote: >>> On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote: >>>> Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision: >>>> 278474 URL: https://svnweb.freebsd.org/changeset/base/278474 >>>> >>>> Log: Use __builtin_popcnt() to implement a BIT_COUNT() >>>> operation for bitsets and use this to implement CPU_COUNT() >>>> to count the number of CPUs in a cpuset. >>>> >>>> MFC after: 2 weeks >>> >>> Yes, __builtin_popcnt() works with GCC 4.2. It should also >>> allow the compiler to DTRT in userland uses of this if -msse4.2 >>> is enabled. >> >> Back in 2012, when I submitted a similar patch, bde noted >> __builtin_popcount*() cannot be used with GCC 4.2 for *kernel* >> because it emits a library call. >> >> http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135 >> >> FYI... > > Weird, I though I built a kernel with this in a tree that uses it > in the igb(4) driver. We need a CPU_COUNT() no matter what, but if > this emits a library call under GCC I will need to add the call. > We could also adopt your bitcount header, though I think it is more > consistent to keep the loop in BIT_COUNT() and use something that > emulates popcountl() rather than directly using bitcount() in > BIT_COUNT() (primarily because the rest of sys/bitset.h is > structured that way: explicit loops in sys/bitset.h itself). I think you should back it out for now and move the discussion to arch or hackers. I gave it up at the time but you may have better luck. :-) FYI, the following was the last version of my patch at the time. https://people.freebsd.org/~jkim/bitcount5.diff Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU2TRdAAoJEHyflib82/FGUK8H/jnrTqxqw6k5mK2hL3jslBuK yAQKlfCV+pq3jJm6Ixqxk9vszZUwAMw02mPhxkHEPAB4vzZnnhH18u5cOrB1r7MA NFTva6UKoo5F00GO0yKyK9rGaHXxuoSGjdntEckYJuFxZ8Zh9K1dYIRXGW42f55c JEK9aU8uVtFTov8RF0pVGDqiezWJRGlTrftDwq8tUHfv8pJG2p0Z9rfLYsP1DTx2 fMcb7iz6IIQKO2aUYytXv8UdqkA2VtwOGrqC0nLTL4RF5bC5i61WHRJYxNWJ5+sV XQx9cXutkNIIj7IHIw2kpyvx0ynZGIN/jwpBy0d58aq3jv2wQhzk/F1ID51guNk= =uINd -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 23:04:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6086DF61; Mon, 9 Feb 2015 23:04: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD98DFD; Mon, 9 Feb 2015 23:04:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19N4VlX078489; Mon, 9 Feb 2015 23:04:31 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19N4VB7078488; Mon, 9 Feb 2015 23:04:31 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502092304.t19N4VB7078488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Mon, 9 Feb 2015 23:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278478 - 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 23:04:31 -0000 Author: rpaulo Date: Mon Feb 9 23:04:30 2015 New Revision: 278478 URL: https://svnweb.freebsd.org/changeset/base/278478 Log: Add the ability to print a vendor copyright in dmesg. Modified: head/sys/sys/copyright.h Modified: head/sys/sys/copyright.h ============================================================================== --- head/sys/sys/copyright.h Mon Feb 9 21:47:12 2015 (r278477) +++ head/sys/sys/copyright.h Mon Feb 9 23:04:30 2015 (r278478) @@ -28,6 +28,10 @@ /* Copyrights macros */ +/* Add a FreeBSD vendor copyright here */ +#define COPYRIGHT_Vendor \ + "" + /* FreeBSD */ #define COPYRIGHT_FreeBSD \ "Copyright (c) 1992-2015 The FreeBSD Project.\n" @@ -48,5 +52,6 @@ #define COPYRIGHT_PC98 #endif -char copyright[] = COPYRIGHT_FreeBSD COPYRIGHT_PC98 COPYRIGHT_UCB; +char copyright[] = COPYRIGHT_Vendor COPYRIGHT_FreeBSD COPYRIGHT_PC98 \ + COPYRIGHT_UCB; char trademark[] = TRADEMARK_Foundation; From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 23:08:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FBFC174; Mon, 9 Feb 2015 23:08:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB4DEE25; Mon, 9 Feb 2015 23:08:10 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B466EB91E; Mon, 9 Feb 2015 18:08:09 -0500 (EST) From: John Baldwin To: Jung-uk Kim Subject: Re: svn commit: r278474 - head/sys/sys Date: Mon, 09 Feb 2015 18:08:02 -0500 Message-ID: <5703806.fFzzT9N1y2@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <54D93461.8010109@FreeBSD.org> References: <201502092103.t19L3OAn013792@svn.freebsd.org> <3501684.yzo0NMkRZd@ralph.baldwin.cx> <54D93461.8010109@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Feb 2015 18:08:09 -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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 23:08:11 -0000 On Monday, February 09, 2015 05:27:45 PM Jung-uk Kim wrote: > On 02/09/2015 17:12, John Baldwin wrote: > > On Monday, February 09, 2015 04:55:52 PM Jung-uk Kim wrote: > >> On 02/09/2015 16:08, John Baldwin wrote: > >>> On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote: > >>>> Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision: > >>>> 278474 URL: https://svnweb.freebsd.org/changeset/base/278474 > >>>> > >>>> Log: Use __builtin_popcnt() to implement a BIT_COUNT() > >>>> operation for bitsets and use this to implement CPU_COUNT() > >>>> to count the number of CPUs in a cpuset. > >>>> > >>>> MFC after: 2 weeks > >>> > >>> Yes, __builtin_popcnt() works with GCC 4.2. It should also > >>> allow the compiler to DTRT in userland uses of this if -msse4.2 > >>> is enabled. > >> > >> Back in 2012, when I submitted a similar patch, bde noted > >> __builtin_popcount*() cannot be used with GCC 4.2 for *kernel* > >> because it emits a library call. > >> > >> http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135 > >> > >> FYI... > > > > Weird, I though I built a kernel with this in a tree that uses it > > in the igb(4) driver. We need a CPU_COUNT() no matter what, but if > > this emits a library call under GCC I will need to add the call. > > We could also adopt your bitcount header, though I think it is more > > consistent to keep the loop in BIT_COUNT() and use something that > > emulates popcountl() rather than directly using bitcount() in > > BIT_COUNT() (primarily because the rest of sys/bitset.h is > > structured that way: explicit loops in sys/bitset.h itself). > > I think you should back it out for now and move the discussion to arch > or hackers. I gave it up at the time but you may have better luck. :-) > > FYI, the following was the last version of my patch at the time. > > https://people.freebsd.org/~jkim/bitcount5.diff I could also just make it userland only for now? Rui wants to use it in userland. However, I can back it out if that is preferred. To be honest, I'm not sure how valuable it is at this point to expend a lot of effort to support GCC older than 3.4 (i.e. the non-builtin popcount approach). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 23:13:52 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AF8C30A; Mon, 9 Feb 2015 23:13: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFDAEEE8; Mon, 9 Feb 2015 23:13:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19NDpLN083045; Mon, 9 Feb 2015 23:13:51 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19NDpoS083043; Mon, 9 Feb 2015 23:13:51 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502092313.t19NDpoS083043@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Mon, 9 Feb 2015 23:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278479 - in head: etc 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 23:13:52 -0000 Author: rpaulo Date: Mon Feb 9 23:13:50 2015 New Revision: 278479 URL: https://svnweb.freebsd.org/changeset/base/278479 Log: Notify devd(8) when a process crashed. This change implements a notification (via devctl) to userland when the kernel produces coredumps after a process has crashed. devd can then run a specific command to produce a human readable crash report. The command is most usually a helper that runs gdb/lldb commands on the file/coredump pair. It's possible to use this functionality for implementing automatic generation of crash reports. devd(8) will be notified of the full path of the binary that crashed and the full path of the coredump file. Modified: head/etc/devd.conf head/sys/kern/kern_sig.c Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Mon Feb 9 23:04:30 2015 (r278478) +++ head/etc/devd.conf Mon Feb 9 23:13:50 2015 (r278479) @@ -325,4 +325,16 @@ notify 100 { action "/usr/sbin/automount -c"; }; +# Handle userland coredumps. +# This commented out handler makes it possible to run an +# automated debugging session after the core dump is generated. +# Replace action with a proper coredump handler, but be aware that +# it will run with elevated privileges. +notify 10 { + match "system" "kernel"; + match "subsystem" "signal"; + match "type" "coredump"; + action "logger $comm $core"; +}; + */ Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon Feb 9 23:04:30 2015 (r278478) +++ head/sys/kern/kern_sig.c Mon Feb 9 23:13:50 2015 (r278479) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3237,6 +3238,9 @@ coredump(struct thread *td) void *rl_cookie; off_t limit; int compress; + char *data = NULL; + size_t len; + char *fullpath, *freepath = NULL; #ifdef COMPRESS_USER_CORES compress = compress_user_cores; @@ -3322,9 +3326,36 @@ close: error1 = vn_close(vp, FWRITE, cred, td); if (error == 0) error = error1; + else + goto out; + /* + * Notify the userland helper that a process triggered a core dump. + * This allows the helper to run an automated debugging session. + */ + len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1; + data = malloc(len, M_TEMP, M_NOWAIT); + if (data == NULL) + goto out; + if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) + goto out; + snprintf(data, len, "comm=%s", fullpath); + if (freepath != NULL) { + free(freepath, M_TEMP); + freepath = NULL; + } + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) + goto out; + snprintf(data, len, "%s core=%s", data, fullpath); + devctl_notify("kernel", "signal", "coredump", data); + free(name, M_TEMP); +out: #ifdef AUDIT audit_proc_coredump(td, name, error); #endif + if (freepath != NULL) + free(freepath, M_TEMP); + if (data != NULL) + free(data, M_TEMP); free(name, M_TEMP); return (error); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 23:16:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03AF654B; Mon, 9 Feb 2015 23:16:04 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C45CF09; Mon, 9 Feb 2015 23:16:03 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id em10so4864470wid.1; Mon, 09 Feb 2015 15:16:02 -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=XJyQ+0uX+hHoOWc3bsi/hpLs5CsMNLmiSicE8lCGRis=; b=0mtxc2XRx74XRL14z9tat1wf9DePZB+Rs6XQwfnFlkQ4wbo+05k/dpgUOwCuPNF5uu bX8pR8M/lac8Vz4NbiCmk3qmiUKrrArkJiuCrsfqNN2C40M/uB8204xatbLTSdoudXX3 yCbAXgpOgHddnWEo8MQuas/36Eme8pdAh2TkiFE5ONWn5bUHchl4qLjIQAUxEXDC8rGe NmJ1gd/K5kLand+kKKioEsz+7Rui5okxMGgtT/Kul0Z5zW3QvlAHEEToe9RxOgpm8yQ8 PdM3j5Mu5aQCSIYMQ/QNxnZ4Fm8ar6Pn8xwhyVjz56OazqFrz0LQRA2UxU8WKNdIGCBR vP2Q== MIME-Version: 1.0 X-Received: by 10.181.29.168 with SMTP id jx8mr20670537wid.8.1423523761924; Mon, 09 Feb 2015 15:16:01 -0800 (PST) Received: by 10.27.77.141 with HTTP; Mon, 9 Feb 2015 15:16:01 -0800 (PST) In-Reply-To: <201502092313.t19NDpoS083043@svn.freebsd.org> References: <201502092313.t19NDpoS083043@svn.freebsd.org> Date: Mon, 9 Feb 2015 18:16:01 -0500 Message-ID: Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Benjamin Kaduk To: Rui Paulo Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 23:16:04 -0000 On Mon, Feb 9, 2015 at 6:13 PM, Rui Paulo wrote: > Author: rpaulo > Date: Mon Feb 9 23:13:50 2015 > New Revision: 278479 > URL: https://svnweb.freebsd.org/changeset/base/278479 > > Log: > Notify devd(8) when a process crashed. > > This change implements a notification (via devctl) to userland when > the kernel produces coredumps after a process has crashed. > devd can then run a specific command to produce a human readable crash > report. The command is most usually a helper that runs gdb/lldb > commands on the file/coredump pair. It's possible to use this > functionality for implementing automatic generation of crash reports. > > devd(8) will be notified of the full path of the binary that crashed and > the full path of the coredump file. > What advantage does putting this in devd have over a standalone daemon for crash reporting? Is it just the ease of implementation to leverage the existing infrastructure? -Ben From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 23:17:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFFFD688; Mon, 9 Feb 2015 23:17:38 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 4C44F1E33; Mon, 9 Feb 2015 23:17:38 +0000 (UTC) Message-ID: <54D94011.2080700@FreeBSD.org> Date: Mon, 09 Feb 2015 18:17:37 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r278474 - head/sys/sys References: <201502092103.t19L3OAn013792@svn.freebsd.org> <3501684.yzo0NMkRZd@ralph.baldwin.cx> <54D93461.8010109@FreeBSD.org> <5703806.fFzzT9N1y2@ralph.baldwin.cx> In-Reply-To: <5703806.fFzzT9N1y2@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 23:17:38 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 02/09/2015 18:08, John Baldwin wrote: > On Monday, February 09, 2015 05:27:45 PM Jung-uk Kim wrote: >> On 02/09/2015 17:12, John Baldwin wrote: >>> On Monday, February 09, 2015 04:55:52 PM Jung-uk Kim wrote: >>>> On 02/09/2015 16:08, John Baldwin wrote: >>>>> On Monday, February 09, 2015 09:03:24 PM John Baldwin >>>>> wrote: >>>>>> Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision: >>>>>> 278474 URL: >>>>>> https://svnweb.freebsd.org/changeset/base/278474 >>>>>> >>>>>> Log: Use __builtin_popcnt() to implement a BIT_COUNT() >>>>>> operation for bitsets and use this to implement >>>>>> CPU_COUNT() to count the number of CPUs in a cpuset. >>>>>> >>>>>> MFC after: 2 weeks >>>>> >>>>> Yes, __builtin_popcnt() works with GCC 4.2. It should >>>>> also allow the compiler to DTRT in userland uses of this if >>>>> -msse4.2 is enabled. >>>> >>>> Back in 2012, when I submitted a similar patch, bde noted >>>> __builtin_popcount*() cannot be used with GCC 4.2 for >>>> *kernel* because it emits a library call. >>>> >>>> http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135 >>>> >>>> FYI... >>> >>> Weird, I though I built a kernel with this in a tree that uses >>> it in the igb(4) driver. We need a CPU_COUNT() no matter what, >>> but if this emits a library call under GCC I will need to add >>> the call. We could also adopt your bitcount header, though I >>> think it is more consistent to keep the loop in BIT_COUNT() and >>> use something that emulates popcountl() rather than directly >>> using bitcount() in BIT_COUNT() (primarily because the rest of >>> sys/bitset.h is structured that way: explicit loops in >>> sys/bitset.h itself). >> >> I think you should back it out for now and move the discussion to >> arch or hackers. I gave it up at the time but you may have >> better luck. :-) >> >> FYI, the following was the last version of my patch at the time. >> >> https://people.freebsd.org/~jkim/bitcount5.diff > > I could also just make it userland only for now? Rui wants to use > it in userland. However, I can back it out if that is preferred. I am fine with "#if defined(__clang__) || !define(_KERNEL)" case. > To be honest, I'm not sure how valuable it is at this point to > expend a lot of effort to support GCC older than 3.4 (i.e. the > non-builtin popcount approach). No, I don't care about GCC 3.x any more. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU2UALAAoJEHyflib82/FGy8wH/jviXO8fcvprc1y4DGkc87rD ylBjoHimjsDt6Wr9MixYNZKbTXhd4BIgQVvFphgCshGjBbmkvII9DH/OleSTa/p8 /YJk87dZHE336An+GkXGTshESvLHw3l8hACR5FcussDLswJArBcDMuzbIW9Q7ASY dJsWTajP3r4rBqAtQQGxAmNfIvWC6iUP7mELSIoP8vBbUfO4HVZZWh7u5gqXxXnk dDX4kc7XuGweOtMydIY8bYiQYWb+IqMjnCEuucpJ4yktj3kUr8v9To+xAW6AmX7V OZQjMRzFbVKHPB6gs5fSaNZBD/D6MUpeDAXRQCy52xQB7vCQE1UNrR850upvxxY= =NARs -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 23:21:51 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D21E991; Mon, 9 Feb 2015 23:21:51 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtpout001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1638FFF2; Mon, 9 Feb 2015 23:21:50 +0000 (UTC) Received: from st11p02mm-spool002.mac.com ([17.172.220.247]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTP id <0NJJ00I6K274AK70@st11p02mm-asmtp001.mac.com>; Mon, 09 Feb 2015 23:21:13 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-09_04:2015-02-09,2015-02-09,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502090229 MIME-version: 1.0 Received: from localhost ([17.172.220.163]) by st11p02mm-spool002.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTP id <0NJJ00I8B276QG20@st11p02mm-spool002.mac.com>; Mon, 09 Feb 2015 23:21:06 +0000 (GMT) To: Jung-uk Kim From: Rui Paulo Subject: Re: svn commit: r278474 - head/sys/sys Date: Mon, 09 Feb 2015 23:21:06 +0000 (GMT) X-Mailer: iCloud MailClient15A99 MailServer14H18.17359 X-Originating-IP: [12.218.212.178] Message-id: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 23:21:51 -0000 On Feb 09, 2015, at 03:17 PM, Jung-uk Kim wrote:=0AI am= fine with "#if defined(__clang__) || !define(_KERNEL)" case.=0A=C2=A0=0AW= orks for me. =C2=A0Note, however, that I'm fixing the original problem in = the xz repository first. =C2=A0CPU_COUNT() will only be used by xz after w= e import 5.2.1.= From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 23:23:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29B6CB5C; Mon, 9 Feb 2015 23:23:00 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtpout001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9F9812; Mon, 9 Feb 2015 23:22:59 +0000 (UTC) Received: from st11p02mm-spool002.mac.com ([17.172.220.247]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTP id <0NJJ00K4829MQ500@st11p02mm-asmtp001.mac.com>; Mon, 09 Feb 2015 23:22:35 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-09_04:2015-02-09,2015-02-09,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502090230 MIME-version: 1.0 Received: from localhost ([17.172.220.163]) by st11p02mm-spool002.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTP id <0NJJ00IAJ29MQG20@st11p02mm-spool002.mac.com>; Mon, 09 Feb 2015 23:22:34 +0000 (GMT) To: Benjamin Kaduk From: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Date: Mon, 09 Feb 2015 23:22:34 +0000 (GMT) X-Mailer: iCloud MailClient15A99 MailServer14H18.17359 X-Originating-IP: [12.218.212.178] Message-id: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 23:23:00 -0000 On Feb 09, 2015, at 03:16 PM, Benjamin Kaduk wrote:=0A= =0AOn Mon, Feb 9, 2015 at 6:13 PM, Rui Paulo wrote:=0A= Author: rpaulo=0ADate: Mon Feb=C2=A0 9 23:13:50 2015=0ANew Revision: 27847= 9=0AURL: https://svnweb.freebsd.org/changeset/base/278479=0A=0ALog:=0A=C2=A0= Notify devd(8) when a process crashed.=0A=0A=C2=A0 This change implements= a notification (via devctl) to userland when=0A=C2=A0 the kernel produces= coredumps after a process has crashed.=0A=C2=A0 devd can then run a speci= fic command to produce a human readable crash=0A=C2=A0 report.=C2=A0 The c= ommand is most usually a helper that runs gdb/lldb=0A=C2=A0 commands on th= e file/coredump pair.=C2=A0 It's possible to use this=0A=C2=A0 functionali= ty for implementing automatic generation of crash reports.=0A=0A=C2=A0 dev= d(8) will be notified of the full path of the binary that crashed and=0A=C2= =A0 the full path of the coredump file.=0A=0AWhat advantage does putting t= his in devd have over a standalone daemon for crash reporting?=C2=A0 Is it= just the ease of implementation to leverage the existing infrastructure?=0A= =C2=A0=0AWell, I want to automatically inspect all the programs that crash= ed in a given system. =C2=A0I don't see how you can do that with a standal= one daemon. =C2=A0Or maybe I didn't understand what you meant.= From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 23:28:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FF62DAF; Mon, 9 Feb 2015 23:28:38 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BC09CB; Mon, 9 Feb 2015 23:28:37 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t19NSRqr019482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Feb 2015 01:28:27 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t19NSRqr019482 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t19NSQ9F019481; Tue, 10 Feb 2015 01:28:26 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Feb 2015 01:28:26 +0200 From: Konstantin Belousov To: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Message-ID: <20150209232826.GJ42409@kib.kiev.ua> References: <201502092313.t19NDpoS083043@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502092313.t19NDpoS083043@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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.18-1 Precedence: list List-Id: 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, 09 Feb 2015 23:28:38 -0000 On Mon, Feb 09, 2015 at 11:13:51PM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Mon Feb 9 23:13:50 2015 > New Revision: 278479 > URL: https://svnweb.freebsd.org/changeset/base/278479 > > Log: > Notify devd(8) when a process crashed. > > This change implements a notification (via devctl) to userland when > the kernel produces coredumps after a process has crashed. > devd can then run a specific command to produce a human readable crash > report. The command is most usually a helper that runs gdb/lldb > commands on the file/coredump pair. It's possible to use this > functionality for implementing automatic generation of crash reports. > > devd(8) will be notified of the full path of the binary that crashed and > the full path of the coredump file. Arguably, there should be a knob, probably sysctl, to turn the functionality off. I definitely do not want this on crash boxes used for userspace debugging. Even despite the example handler is inactive. > > Modified: > head/etc/devd.conf > head/sys/kern/kern_sig.c > > Modified: head/etc/devd.conf > ============================================================================== > --- head/etc/devd.conf Mon Feb 9 23:04:30 2015 (r278478) > +++ head/etc/devd.conf Mon Feb 9 23:13:50 2015 (r278479) > @@ -325,4 +325,16 @@ notify 100 { > action "/usr/sbin/automount -c"; > }; > > +# Handle userland coredumps. > +# This commented out handler makes it possible to run an > +# automated debugging session after the core dump is generated. > +# Replace action with a proper coredump handler, but be aware that > +# it will run with elevated privileges. > +notify 10 { > + match "system" "kernel"; > + match "subsystem" "signal"; > + match "type" "coredump"; > + action "logger $comm $core"; > +}; > + > */ > > Modified: head/sys/kern/kern_sig.c > ============================================================================== > --- head/sys/kern/kern_sig.c Mon Feb 9 23:04:30 2015 (r278478) > +++ head/sys/kern/kern_sig.c Mon Feb 9 23:13:50 2015 (r278479) > @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -3237,6 +3238,9 @@ coredump(struct thread *td) > void *rl_cookie; > off_t limit; > int compress; > + char *data = NULL; > + size_t len; > + char *fullpath, *freepath = NULL; > > #ifdef COMPRESS_USER_CORES > compress = compress_user_cores; > @@ -3322,9 +3326,36 @@ close: > error1 = vn_close(vp, FWRITE, cred, td); > if (error == 0) > error = error1; > + else > + goto out; > + /* > + * Notify the userland helper that a process triggered a core dump. > + * This allows the helper to run an automated debugging session. > + */ > + len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1; It is much cleaner to use static const char arrays for the names, and use sizeof() - 1 instead of hard-coding commented constants. > + data = malloc(len, M_TEMP, M_NOWAIT); Why is this allocation M_NOWAIT ? > + if (data == NULL) > + goto out; > + if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) > + goto out; > + snprintf(data, len, "comm=%s", fullpath); > + if (freepath != NULL) { > + free(freepath, M_TEMP); Checks for NULL pointer before free(9) are redundant. > + freepath = NULL; > + } > + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) > + goto out; > + snprintf(data, len, "%s core=%s", data, fullpath); This is weird, and highly depends on the implementation details, supplying the same string as target and source. IMO strcat(9) is enough there. > + devctl_notify("kernel", "signal", "coredump", data); > + free(name, M_TEMP); > +out: > #ifdef AUDIT > audit_proc_coredump(td, name, error); > #endif > + if (freepath != NULL) > + free(freepath, M_TEMP); > + if (data != NULL) > + free(data, M_TEMP); > free(name, M_TEMP); > return (error); > } From owner-svn-src-head@FreeBSD.ORG Mon Feb 9 23:29:17 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B13ECEEB; Mon, 9 Feb 2015 23:29:17 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54EE5D1; Mon, 9 Feb 2015 23:29:17 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id hm9so10060964wib.5; Mon, 09 Feb 2015 15:29: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=0kbzzMjdq7OR9aoUARi1JJPBDFBZeP1pQYXX/o5K4z4=; b=XFkVSTT5iYIeL1OcNUMbJcqLMmrS/pC0mUuWT6L0Yg68NHSWVohg2Shezp3rvwvDEk sb+Kp4Dyn2PfSV60F4HvKaNrN8t1kxm98O7fM8eH2+wyRSzFMay10cXP2aM6Eas2QItZ 0l/9CGeOeac/tkGKZlYoFGG5LBVYlY2Ha6TfPSTaltdJTjL19gVtiRcdqEgjArBSU2dn 7lKeRMcACK8JcyswIObcPC4lHJgGeD2FFGEcA2i8T1JiA0MY372bS1LO3wHSV+aS/z+f UsixR5N5NPD23zNHliiTzVZyjlgjlBj+R7E0yyg+JN5j0ORikTmbT7aeZxIdP0kg4zpJ bv+A== MIME-Version: 1.0 X-Received: by 10.180.198.240 with SMTP id jf16mr39614372wic.27.1423524555334; Mon, 09 Feb 2015 15:29:15 -0800 (PST) Received: by 10.27.77.141 with HTTP; Mon, 9 Feb 2015 15:29:15 -0800 (PST) In-Reply-To: References: Date: Mon, 9 Feb 2015 18:29:15 -0500 Message-ID: Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Benjamin Kaduk To: Rui Paulo Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 09 Feb 2015 23:29:17 -0000 On Mon, Feb 9, 2015 at 6:22 PM, Rui Paulo wrote: > On Feb 09, 2015, at 03:16 PM, Benjamin Kaduk wrote: > > > What advantage does putting this in devd have over a standalone daemon for > crash reporting? Is it just the ease of implementation to leverage the > existing infrastructure? > > > Well, I want to automatically inspect all the programs that crashed in a > given system. I don't see how you can do that with a standalone daemon. > Or maybe I didn't understand what you meant. > I think you have misunderstood what I was trying to ask. We could in principle write a new daemon, call it crash-reporterd for now, and have the kernel notify that daemon whenever any program on the system crashes. But writing the infrastructure to support that would be a bunch of work, and we already have devd set up to get notifications from the kernel, so it is much faster to implement crash reporting in devd, even though crashes in software have nothing to do with device changes. The question boils down to: is the time saved by implementing it this way worth the tradeoff of architectural purity. I don't have an opinion myself, I just want to make sure the question is considered. -Ben From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 00:02:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2993F799; Tue, 10 Feb 2015 00:02:55 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 004AB654; Tue, 10 Feb 2015 00:02:54 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t1A02rAm020819 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Feb 2015 16:02:53 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t1A02r0d020818; Mon, 9 Feb 2015 16:02:53 -0800 (PST) (envelope-from jmg) Date: Mon, 9 Feb 2015 16:02:53 -0800 From: John-Mark Gurney To: Rui Paulo Subject: Re: svn commit: r278478 - head/sys/sys Message-ID: <20150210000252.GO1953@funkthat.com> References: <201502092304.t19N4VB7078488@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502092304.t19N4VB7078488@svn.freebsd.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 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-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Mon, 09 Feb 2015 16:02:53 -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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 00:02:55 -0000 Rui Paulo wrote this message on Mon, Feb 09, 2015 at 23:04 +0000: > Author: rpaulo > Date: Mon Feb 9 23:04:30 2015 > New Revision: 278478 > URL: https://svnweb.freebsd.org/changeset/base/278478 > > Log: > Add the ability to print a vendor copyright in dmesg. Should we change this into a linker set so that any module can add their own vendor copyright w/o having to modify this again? -- 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 Tue Feb 10 00:10:47 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2759B86; Tue, 10 Feb 2015 00:10:46 +0000 (UTC) Received: from smtp2.ore.mailhop.org (smtp2.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE9C76B7; Tue, 10 Feb 2015 00:10:46 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp2.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YKy5f-0000fS-Q6; Mon, 09 Feb 2015 23:50:07 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t19No5Pe076407; Mon, 9 Feb 2015 16:50:05 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19jA7uzpC89wFVU1bjB6EGO Message-ID: <1423525805.16794.24.camel@freebsd.org> Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Ian Lepore To: Benjamin Kaduk Date: Mon, 09 Feb 2015 16:50:05 -0700 In-Reply-To: References: Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo , Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 00:10:47 -0000 On Mon, 2015-02-09 at 18:29 -0500, Benjamin Kaduk wrote: > On Mon, Feb 9, 2015 at 6:22 PM, Rui Paulo wrote: > > > On Feb 09, 2015, at 03:16 PM, Benjamin Kaduk wrote: > > > > > > What advantage does putting this in devd have over a standalone daemon for > > crash reporting? Is it just the ease of implementation to leverage the > > existing infrastructure? > > > > > > Well, I want to automatically inspect all the programs that crashed in a > > given system. I don't see how you can do that with a standalone daemon. > > Or maybe I didn't understand what you meant. > > > > I think you have misunderstood what I was trying to ask. > > We could in principle write a new daemon, call it crash-reporterd for now, > and have the kernel notify that daemon whenever any program on the system > crashes. But writing the infrastructure to support that would be a bunch > of work, and we already have devd set up to get notifications from the > kernel, so it is much faster to implement crash reporting in devd, even > though crashes in software have nothing to do with device changes. > > The question boils down to: is the time saved by implementing it this way > worth the tradeoff of architectural purity. > > I don't have an opinion myself, I just want to make sure the question is > considered. > > -Ben Truth be told, it kind of bugs me. I think adding this to devctl and devd is inappropriate without also renaming those components to reflect their new role, and rewriting the manpages to reflect what they actually do now. If you ponder for a moment what the new role seems to be (generic notification to userland of events happening in the kernel), you end up with names like "keventd" and that makes you wonder whether a new type of knote for kevent, listened for by a new crashd app, would be better. -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 00:12:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33BE7CD2; Tue, 10 Feb 2015 00:12:42 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B7507B1; Tue, 10 Feb 2015 00:12:41 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id 89D081C84AA; Mon, 9 Feb 2015 17:47:11 -0500 (EST) Received: from app.lifanov.com (chat.lifanov.com [206.125.175.13]) by mail.lifanov.com (Postfix) with ESMTPA id BA2711C84A8; Mon, 9 Feb 2015 17:47:10 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 09 Feb 2015 17:47:10 -0500 From: Nikolai Lifanov To: Glen Barber Subject: Re: svn commit: r278450 - head/release In-Reply-To: <201502091046.t19AkdCM067270@svn.freebsd.org> References: <201502091046.t19AkdCM067270@svn.freebsd.org> Message-ID: <150387d27ebf311cb4751fe39c2a080c@mail.lifanov.com> X-Sender: lifanov@mail.lifanov.com User-Agent: Roundcube Webmail/1.0.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 00:12:42 -0000 On 2015-02-09 05:46, Glen Barber wrote: > Author: gjb > Date: Mon Feb 9 10:46:39 2015 > New Revision: 278450 > URL: https://svnweb.freebsd.org/changeset/base/278450 > > Log: > Revert r278445. > > I was going to use __FreeBSD_version to determine if > xz(1) should be multi-threaded by default, but doing > this will cause problems if/when the changes are merged > from head. > > Sponsored by: The FreeBSD Foundation > > Modified: > head/release/Makefile > > Modified: head/release/Makefile > Can you just X-MFC this with xz 5.2.0 import? You can then refer to xz in OBJDIR to get this to work on older releases. - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 00:25:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9AD3F47; Tue, 10 Feb 2015 00:25:12 +0000 (UTC) Date: Tue, 10 Feb 2015 00:25:07 +0000 From: Glen Barber To: Nikolai Lifanov Subject: Re: svn commit: r278450 - head/release Message-ID: <20150210002507.GH84467@hub.FreeBSD.org> References: <201502091046.t19AkdCM067270@svn.freebsd.org> <150387d27ebf311cb4751fe39c2a080c@mail.lifanov.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KR/qxknboQ7+Tpez" Content-Disposition: inline In-Reply-To: <150387d27ebf311cb4751fe39c2a080c@mail.lifanov.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 00:25:14 -0000 --KR/qxknboQ7+Tpez Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 09, 2015 at 05:47:10PM -0500, Nikolai Lifanov wrote: > On 2015-02-09 05:46, Glen Barber wrote: > >Author: gjb > >Date: Mon Feb 9 10:46:39 2015 > >New Revision: 278450 > >URL: https://svnweb.freebsd.org/changeset/base/278450 > > > >Log: > > Revert r278445. > > > > I was going to use __FreeBSD_version to determine if > > xz(1) should be multi-threaded by default, but doing > > this will cause problems if/when the changes are merged > > from head. > > > > Sponsored by: The FreeBSD Foundation > > > >Modified: > > head/release/Makefile > > > >Modified: head/release/Makefile > > >=20 > Can you just X-MFC this with xz 5.2.0 import? > You can then refer to xz in OBJDIR to get this to work on older releases. >=20 That is the intent, but not this commit. The problem is the Makefile would contain things like: .if (${FREEBSD_VERSION} >=3D 1100059) || ((${FREEBSD_VERSION < 1100000 \ && ${FREEBSD_VERSION} >=3D 1000555)) [...]. and other varying levels of ridiculousness. It's bad enough we have to do this in the ports tree. I certainly do not intend to implement this behavior in the src tree. With regards to the OBJDIR, actual releases (not always snapshots) are always built from the same major FreeBSD version or higher. Meaning, code/features that exist in releng/10.1 are available already in stable/10 at the time. In this particular case, I care less about snapshot builds and more about the release builds, which in this particular case, we are far off in the future enough that it is guaranteed the feature needed will be available. Glen --KR/qxknboQ7+Tpez Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJU2U/eAAoJEAMUWKVHj+KThPIP/1n3TghI+4U6SK9/MGACF1vM KgPmkCAlq/PC5tqEsBhgidoLKFUj5IpbbMRj48/p80gXvxqo8Yn1UjRhvt7QymUl OELHVdtt3b8VWMM8bHBwFA5YKayImiezAqAsJhKyYfV2VYSTaaybZd6m64T4KeVR T4ZHHe/2Dr87FEfnXbOwt4gRqtd/75UUJeXoinVD/Dm8gheeHDW/9pE97uQ7nWKK jAd/cJYp7ZJ/XSZC7ZhQIbOZkxqq68UbNrVBaNFc6Yb60UjfqTGzhuCWOp2rgOnF fML7GOgxM+rwnkWHlAgX8GjfV2rw9q4Rj7yOm3O2jp4cH7s2RPJLhM+lHch56gfq waHy1CBRP4LsfeNAEQKlTr+uc5kO1yfKsBbm0Yj0xQ729U6FXB11HVfEEHxugNfy +ZoS0/+tZJyntL7bZkz5oYqrLMHlC4UpIANLBSW6f4OU6YOcBRXsfCwZfXAVadou Y0KkC3TyL3FNM6UhfJfVKssFG7QQcQp7thoDI2P9cDm2rC13laYkKtPWZiH7DObv UDq+rdmuksukBwWeikznq8AZBpD5RzA09xhc1ei5VRfLLlRpoFoBGIL4V/e2fbmS 0tj+3jjnCUq/I7YxYZXhnQMd1tMWqnGkvSghoo12zBwGNXMJlM2ulfLBgT8pbQJd +JnH+QX25Y//CEdIcNhB =R4ia -----END PGP SIGNATURE----- --KR/qxknboQ7+Tpez-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 00:48:52 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A45A42CE; Tue, 10 Feb 2015 00:48: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F86A2ED; Tue, 10 Feb 2015 00:48:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A0mqDY043763; Tue, 10 Feb 2015 00:48:52 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A0mquM043762; Tue, 10 Feb 2015 00:48:52 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201502100048.t1A0mquM043762@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Tue, 10 Feb 2015 00:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278480 - 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 00:48:52 -0000 Author: jamie Date: Tue Feb 10 00:48:51 2015 New Revision: 278480 URL: https://svnweb.freebsd.org/changeset/base/278480 Log: Un-revert the r278323 again - whatever Jenkins/kyua is up it, it has nothing to do with this. Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Mon Feb 9 23:13:50 2015 (r278479) +++ head/etc/rc.d/jail Tue Feb 10 00:48:51 2015 (r278480) @@ -233,8 +233,7 @@ parse_options() fi eval : \${jail_${_j}_procfs_enable:=${jail_procfs_enable:-NO}} if checkyesno jail_${_j}_procfs_enable; then - echo " mount += " \ - "\"procfs ${_rootdir%/}/proc procfs rw 0 0\";" + echo " mount.procfs;" fi eval : \${jail_${_j}_mount_enable:=${jail_mount_enable:-NO}} From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 00:55:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4690654C; Tue, 10 Feb 2015 00: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30F203DA; Tue, 10 Feb 2015 00:55:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A0thmA048212; Tue, 10 Feb 2015 00:55:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A0tgiK048210; Tue, 10 Feb 2015 00:55:42 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502100055.t1A0tgiK048210@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 10 Feb 2015 00:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278481 - in head/sys/powerpc: aim 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 00:55:43 -0000 Author: nwhitehorn Date: Tue Feb 10 00:55:42 2015 New Revision: 278481 URL: https://svnweb.freebsd.org/changeset/base/278481 Log: Set thread priorities on multithreaded CPUs so that threads holding a spinlock are high-priority and threads waiting for a spinlock are set to low priority. Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/include/cpu.h Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Tue Feb 10 00:48:51 2015 (r278480) +++ head/sys/powerpc/aim/machdep.c Tue Feb 10 00:55:42 2015 (r278481) @@ -750,6 +750,7 @@ spinlock_enter(void) td = curthread; if (td->td_md.md_spinlock_count == 0) { + __asm __volatile("or 2,2,2"); /* Set high thread priority */ msr = intr_disable(); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_msr = msr; @@ -768,8 +769,10 @@ spinlock_exit(void) critical_exit(); msr = td->td_md.md_saved_msr; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) + if (td->td_md.md_spinlock_count == 0) { intr_restore(msr); + __asm __volatile("or 6,6,6"); /* Set normal thread priority */ + } } int db_trap_glue(struct trapframe *); /* Called from trap_subr.S */ Modified: head/sys/powerpc/include/cpu.h ============================================================================== --- head/sys/powerpc/include/cpu.h Tue Feb 10 00:48:51 2015 (r278480) +++ head/sys/powerpc/include/cpu.h Tue Feb 10 00:55:42 2015 (r278481) @@ -88,7 +88,7 @@ get_cyclecount(void) } #define cpu_getstack(td) ((td)->td_frame->fixreg[1]) -#define cpu_spinwait() /* nothing */ +#define cpu_spinwait() __asm __volatile("or 27,27,27") /* yield */ extern char btext[]; extern char etext[]; From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 00:57:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75E5269D; Tue, 10 Feb 2015 00:57: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 600E43EB; Tue, 10 Feb 2015 00:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A0vR6K048496; Tue, 10 Feb 2015 00:57:27 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A0vRYM048495; Tue, 10 Feb 2015 00:57:27 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502100057.t1A0vRYM048495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 10 Feb 2015 00:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278482 - 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 00:57:27 -0000 Author: nwhitehorn Date: Tue Feb 10 00:57:26 2015 New Revision: 278482 URL: https://svnweb.freebsd.org/changeset/base/278482 Log: Add error reporting to interrupt CPU binding. Modified: head/sys/powerpc/pseries/xics.c Modified: head/sys/powerpc/pseries/xics.c ============================================================================== --- head/sys/powerpc/pseries/xics.c Tue Feb 10 00:55:42 2015 (r278481) +++ head/sys/powerpc/pseries/xics.c Tue Feb 10 00:57:26 2015 (r278482) @@ -197,12 +197,13 @@ xicp_bind(device_t dev, u_int irq, cpuse { struct xicp_softc *sc = device_get_softc(dev); cell_t status, cpu; - int ncpus, i; + int ncpus, i, error; /* * This doesn't appear to actually support affinity groups, so pick a * random CPU. */ + ncpus = 0; CPU_FOREACH(cpu) if (CPU_ISSET(cpu, &cpumask)) ncpus++; @@ -217,8 +218,10 @@ xicp_bind(device_t dev, u_int irq, cpuse } - rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, XICP_PRIORITY, - &status); + error = rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, + XICP_PRIORITY, &status); + if (error < 0) + panic("Cannot bind interrupt %d to CPU %d", irq, cpu); } static void From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 01:02:03 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D8A4813; Tue, 10 Feb 2015 01:02: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7834E677; Tue, 10 Feb 2015 01:02:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A123Q9052704; Tue, 10 Feb 2015 01:02:03 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A1235B052703; Tue, 10 Feb 2015 01:02:03 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502100102.t1A1235B052703@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 10 Feb 2015 01:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278483 - head/usr.sbin/bsdconfig/networking/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 01:02:03 -0000 Author: dteske Date: Tue Feb 10 01:02:02 2015 New Revision: 278483 URL: https://svnweb.freebsd.org/changeset/base/278483 Log: Comments. MFC after: 3 days Modified: head/usr.sbin/bsdconfig/networking/share/device.subr Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Tue Feb 10 00:57:26 2015 (r278482) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Tue Feb 10 01:02:02 2015 (r278483) @@ -207,7 +207,7 @@ f_dialog_menu_netdev_edit() '3 $msg_ipaddr4' '$ipaddr' '4 $msg_netmask' '$netmask' '5 $msg_options' '$options' - " + " # END-QUOTE eval f_dialog_menu_size height width rows \ \"\$DIALOG_TITLE\" \ \"\$DIALOG_BACKTITLE\" \ From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 01:16:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A56CDB5F; Tue, 10 Feb 2015 01:16: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FDF27E4; Tue, 10 Feb 2015 01:16:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A1GiXi058367; Tue, 10 Feb 2015 01:16:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A1GiUn058365; Tue, 10 Feb 2015 01:16:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201502100116.t1A1GiUn058365@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 10 Feb 2015 01:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278485 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 01:16:44 -0000 Author: np Date: Tue Feb 10 01:16:43 2015 New Revision: 278485 URL: https://svnweb.freebsd.org/changeset/base/278485 Log: cxgbe(4): allow the SET_FILTER_MODE ioctl to change the mode when it's safe to do so. MFC after: 1 month Modified: head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue Feb 10 01:05:51 2015 (r278484) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Feb 10 01:16:43 2015 (r278485) @@ -3111,6 +3111,31 @@ void t4_write_rss_pf_mask(struct adapter &pfmask, 1, A_TP_RSS_PF_MSK); } +static void refresh_vlan_pri_map(struct adapter *adap) +{ + + t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, + &adap->params.tp.vlan_pri_map, 1, + A_TP_VLAN_PRI_MAP); + + /* + * Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field + * shift positions of several elements of the Compressed Filter Tuple + * for this adapter which we need frequently ... + */ + adap->params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN); + adap->params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID); + adap->params.tp.port_shift = t4_filter_field_shift(adap, F_PORT); + adap->params.tp.protocol_shift = t4_filter_field_shift(adap, F_PROTOCOL); + + /* + * If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID + * represents the presense of an Outer VLAN instead of a VNIC ID. + */ + if ((adap->params.tp.ingress_config & F_VNIC) == 0) + adap->params.tp.vnic_shift = -1; +} + /** * t4_set_filter_mode - configure the optional components of filter tuples * @adap: the adapter @@ -3134,6 +3159,8 @@ int t4_set_filter_mode(struct adapter *a return -EINVAL; t4_write_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, &mode_map, 1, A_TP_VLAN_PRI_MAP); + refresh_vlan_pri_map(adap); + return 0; } @@ -5618,33 +5645,10 @@ int __devinit t4_init_tp_params(struct a for (chan = 0; chan < NCHAN; chan++) adap->params.tp.tx_modq[chan] = chan; - /* - * Cache the adapter's Compressed Filter Mode and global Incress - * Configuration. - */ - t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, - &adap->params.tp.vlan_pri_map, 1, - A_TP_VLAN_PRI_MAP); t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, &adap->params.tp.ingress_config, 1, A_TP_INGRESS_CONFIG); - - /* - * Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field - * shift positions of several elements of the Compressed Filter Tuple - * for this adapter which we need frequently ... - */ - adap->params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN); - adap->params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID); - adap->params.tp.port_shift = t4_filter_field_shift(adap, F_PORT); - adap->params.tp.protocol_shift = t4_filter_field_shift(adap, F_PROTOCOL); - - /* - * If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID - * represents the presense of an Outer VLAN instead of a VNIC ID. - */ - if ((adap->params.tp.ingress_config & F_VNIC) == 0) - adap->params.tp.vnic_shift = -1; + refresh_vlan_pri_map(adap); return 0; } Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 10 01:05:51 2015 (r278484) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 10 01:16:43 2015 (r278485) @@ -7116,10 +7116,9 @@ get_filter_mode(struct adapter *sc, uint log(LOG_WARNING, "%s: cached filter mode out of sync %x %x.\n", device_get_nameunit(sc->dev), sc->params.tp.vlan_pri_map, fconf); - sc->params.tp.vlan_pri_map = fconf; } - *mode = fconf_to_mode(sc->params.tp.vlan_pri_map); + *mode = fconf_to_mode(fconf); end_synchronized_op(sc, LOCK_HELD); return (0); @@ -7150,14 +7149,7 @@ set_filter_mode(struct adapter *sc, uint } #endif -#ifdef notyet rc = -t4_set_filter_mode(sc, fconf); - if (rc == 0) - sc->filter_mode = fconf; -#else - rc = ENOTSUP; -#endif - done: end_synchronized_op(sc, LOCK_HELD); return (rc); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 01:25:38 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0E9ACF2; Tue, 10 Feb 2015 01:25:38 +0000 (UTC) Received: from mail-ie0-f174.google.com (mail-ie0-f174.google.com [209.85.223.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7943C8B3; Tue, 10 Feb 2015 01:25:38 +0000 (UTC) Received: by iecrl12 with SMTP id rl12so21183136iec.11; Mon, 09 Feb 2015 17:25:32 -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:content-transfer-encoding; bh=cTi9sUs9AHqg6sUdLMopjIPbokSZ3d2xc63ulsoGn0o=; b=yCc2E1iw7Ik1dO9mzAmvxeUs/wMpAou1HQRiKrrkJ2xB7bF0LfKWnHyjiUDyzC9/7w Pllqn+52ukW2o4Qs2sQ+ghl6Tfzh4RIMCuFpi/TLPoAbOYhx8AmdQTKR7OYv+iH0/Gmr YW+E5yYIcsWmM0s94Hywh1nnSBZuUKwwfdEL3N/STJdVNlP3TozvYAnBpdBK+ht2EqSx 8ABRgBDKlnpoF54eRK6ELaGnlqZjuPIrHszAjggwonoDaOEYLaWY/Qoxjug1RRSK2kQN TxRJOgze4uaBTn5Ze9MtqPTFk5ak7EhF2X4xRO7UnpIOgsFofRikEIvfFszY6ym4Cb3K L/LQ== MIME-Version: 1.0 X-Received: by 10.50.82.68 with SMTP id g4mr20478221igy.26.1423531532001; Mon, 09 Feb 2015 17:25:32 -0800 (PST) Received: by 10.50.182.233 with HTTP; Mon, 9 Feb 2015 17:25:31 -0800 (PST) In-Reply-To: <20150207081025.GT42409@kib.kiev.ua> References: <201502061754.t16HssXU042750@svn.freebsd.org> <343803A3-CFA3-4766-8294-139A6D8C0235@gmail.com> <20150207081025.GT42409@kib.kiev.ua> Date: Mon, 9 Feb 2015 17:25:31 -0800 Message-ID: Subject: Re: svn commit: r278323 - in head: etc/rc.d usr.sbin/jail From: NGie Cooper To: Konstantin Belousov 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 , "jenkins-admin@freebsd.org" , James Gritton X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 01:25:38 -0000 On Sat, Feb 7, 2015 at 12:10 AM, Konstantin Belousov wrote: > On Fri, Feb 06, 2015 at 09:23:47PM -0800, Garrett Cooper wrote: >> pgrep uses /proc to determine whether or not a process is running. If it= ?s not properly mounted or the jail isn?t started properly, that could caus= e the issues seen here. I know because I?ve tried running these tests befor= e in an attempt to fix them, and this was one of the things I ran into. >> > pgrep does not use /proc. You're right. I'm not sure where I got it in my mind that that was the case, but this wasn't it.. From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 01:35:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 767C21D1; Tue, 10 Feb 2015 01:35: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6223E99A; Tue, 10 Feb 2015 01:35:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A1ZRO9067754; Tue, 10 Feb 2015 01:35:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A1ZRhf067753; Tue, 10 Feb 2015 01:35:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502100135.t1A1ZRhf067753@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 Feb 2015 01:35:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278486 - 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 01:35:27 -0000 Author: gjb Date: Tue Feb 10 01:35:26 2015 New Revision: 278486 URL: https://svnweb.freebsd.org/changeset/base/278486 Log: Exclude 'tests' from DEBUG_DISTRIBUTIONS. Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Feb 10 01:16:43 2015 (r278485) +++ head/Makefile.inc1 Tue Feb 10 01:35:26 2015 (r278486) @@ -823,7 +823,7 @@ EXTRA_DISTRIBUTIONS+= tests DEBUG_DISTRIBUTIONS= .if ${MK_DEBUG_FILES} != "no" -DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,doc,,} +DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,doc,,:S,tests,,} .endif MTREE_MAGIC?= mtree 2.0 From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:18:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EAF8133; Tue, 10 Feb 2015 02:18:59 +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)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E3C21D9B; Tue, 10 Feb 2015 02:18:58 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-230-68.lns20.per1.internode.on.net [121.45.230.68]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t1A2IrlU070464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 9 Feb 2015 18:18:55 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <54D96A87.7000600@freebsd.org> Date: Tue, 10 Feb 2015 10:18:47 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: John-Mark Gurney , Rui Paulo Subject: Re: svn commit: r278478 - head/sys/sys References: <201502092304.t19N4VB7078488@svn.freebsd.org> <20150210000252.GO1953@funkthat.com> In-Reply-To: <20150210000252.GO1953@funkthat.com> Content-Type: text/plain; charset=windows-1252; format=flowed 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:18:59 -0000 On 2/10/15 8:02 AM, John-Mark Gurney wrote: > Rui Paulo wrote this message on Mon, Feb 09, 2015 at 23:04 +0000: >> Author: rpaulo >> Date: Mon Feb 9 23:04:30 2015 >> New Revision: 278478 >> URL: https://svnweb.freebsd.org/changeset/base/278478 >> >> Log: >> Add the ability to print a vendor copyright in dmesg. > Should we change this into a linker set so that any module can > add their own vendor copyright w/o having to modify this again? > that is not a stupid idea.. or we could add a copyright element to the sample sysinit code and provide a linked list of things to print out. (a copyright API.. call it from SYINIT, if it's early it queues it.. if you are already booted it prints it right away) From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:23:08 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C538438; Tue, 10 Feb 2015 02:23:08 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D927E4C; Tue, 10 Feb 2015 02:23:08 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJJ00N48AL41Q10@st11p02mm-asmtp002.mac.com>; Tue, 10 Feb 2015 02:22:19 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_01:2015-02-09,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100022 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Rui Paulo In-reply-to: Date: Mon, 09 Feb 2015 18:22:16 -0800 Content-transfer-encoding: quoted-printable Message-id: References: To: Benjamin Kaduk X-Mailer: Apple Mail (2.2070.6) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:23:08 -0000 On Feb 9, 2015, at 15:29, Benjamin Kaduk wrote: > The question boils down to: is the time saved by implementing it this = way worth the tradeoff of architectural purity. Yes, that was a tradeoff. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:24:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A224F58A; Tue, 10 Feb 2015 02:24:56 +0000 (UTC) Date: Tue, 10 Feb 2015 02:24:51 +0000 From: Glen Barber To: Dmitry Morozovsky Subject: Re: svn commit: r278433 - in head: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblz... Message-ID: <20150210022451.GA14325@hub.FreeBSD.org> References: <201502090620.t196KZSk040702@svn.freebsd.org> <20150209122540.GE84467@hub.FreeBSD.org> <20150209123057.GF84467@hub.FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:24:57 -0000 --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 09, 2015 at 04:08:00PM +0300, Dmitry Morozovsky wrote: > > > FWIW, compressing VM images (some sparse files, some not) would take > > > upwards of 45 minutes, which after this update, just takes a few > > > minutes. > > >=20 > > > root@releng2:/R2/vmimages # time xz -T 0 -k FreeBSD-11.0-CURRENT-amd= 64.qcow2 \ > > > time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.raw; \ > > > time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vhd; \ > > > time xz -T 0 -k FreeBSD-11.0-CURRENT-amd64.vmdk > > > 1027.602u 40.376s 1:09.57 1535.1% 81+192k 0+19774io 0pf+0w > > > 1032.978u 38.823s 1:08.17 1572.2% 81+192k 0+19696io 0pf+0w > > > 1033.908u 38.593s 1:11.70 1495.8% 81+192k 0+19729io 0pf+0w > > > 1091.749u 42.371s 1:04.27 1764.6% 81+192k 0+19751io 0pf+0w > > >=20 > >=20 > > I meant to include that this is on a 48-core machine. >=20 > Hm, I can't beleive you didn't use pxz ;) >=20 For RE purposes, using base system utilities supersedes utilities available elsewhere. In my initial tests with pxz, there was an, albeit somewhat predictable, increase in resulting file size as the number of threads increased, while xz in base with the latest update produces output files within +/-1024Kb difference of the unthreaded version. For RE side, there was no real gain in using pxz over xz, because the sacrifice was the output file size. I do not care so much about the time taken to compress the files. I *do* care about the resulting file size, since I (personally) want to be sure that the end user can download the smallest possible file. I was unsure what to expect with the xz(1) update in this regard, and was surprised to see a non-visible difference in the resulting file. > Anyway, having this in base, and not depending on external tool, is=20 > amazingly great. >=20 > BTW, Rui, did you some comparative tests with pxz? >=20 As stated above, pxz (last I tested) produces incrementally larger files as the thread count increases. From what I have seen so far, the latest xz update does not. Glen --wRRV7LY7NUeQGEoC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJU2WvzAAoJEAMUWKVHj+KTcZAP/05b3Ek+OnlbxvpkouzPDLMS LF88/Ru8vcV6vMc4IN/Z8Mgnmb97MC4TYu9oDrn7mj+PY47xKGSsecVNftE4zMuz 4snCCc6htHzD+PSWY4YwPw6BxycuyIp6vchcwNKH0Quhxgzum+K75XxmBmwKfl+7 aPUuFIGfvV2L2PJG0XDf46ZXXDdMyB5Y/XH0khARhbmV2jb/uFhsohc8qsn9ZLY0 R1TanKIrLTGgNiFaS9/uCLkyMHb3f3TBNw6SvNqQ/3OiHfp0GFqNBycPIGdKNTxV extCaKcweIgwpyEZK/7fkttLU5PKKQzPF/QR75azRd5KiUVxGAeg1ZDKbnlEh/3x WLTV4uPCaB8oLcx5bMXIM5EASgvgHG/H7WySEaFbV51EPYvmW1FsjOF//YHMDrIU sxlEvuIzjxnXMREkiByzYschE/f44gsKiPpTkXm/TWRzzooqOkNMBcMuKqHR0d3x WSUoEyN/fD4vFN/VRhTboqIkHoA6C5qzaAu99huVm/BR6fx/TxZJIvLTzI8j3iD+ nub31GyBOwHXiNKe50pp621gKpJhyUowoTpT3aPBIZVzgRfHuQFHCc4ahYZ0yYRT 16/pi8tAIGjrABkwxfPQ4ZiqL1JxJLlD48j9VN1X4NVInsmU+QprQoXDZAO4DHb4 lwPRKg/FzMRXJ8bW8s5i =C+sN -----END PGP SIGNATURE----- --wRRV7LY7NUeQGEoC-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:31:39 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CEB48C3; Tue, 10 Feb 2015 02:31:39 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3FDCF26; Tue, 10 Feb 2015 02:31:38 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJJ00NZZAZY1Q10@st11p02mm-asmtp002.mac.com>; Tue, 10 Feb 2015 02:31:14 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_01:2015-02-09,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100022 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278478 - head/sys/sys From: Rui Paulo In-reply-to: <20150210000252.GO1953@funkthat.com> Date: Mon, 09 Feb 2015 18:31:10 -0800 Content-transfer-encoding: quoted-printable Message-id: References: <201502092304.t19N4VB7078488@svn.freebsd.org> <20150210000252.GO1953@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:31:39 -0000 On Feb 9, 2015, at 16:02, John-Mark Gurney wrote: >=20 > Rui Paulo wrote this message on Mon, Feb 09, 2015 at 23:04 +0000: >> Author: rpaulo >> Date: Mon Feb 9 23:04:30 2015 >> New Revision: 278478 >> URL: https://svnweb.freebsd.org/changeset/base/278478 >>=20 >> Log: >> Add the ability to print a vendor copyright in dmesg. >=20 > Should we change this into a linker set so that any module can > add their own vendor copyright w/o having to modify this again? So you want a copyright module? That seems a bit overkill. :-) An API like Julian mentioned seems like a better idea, but it's not = trivial to implement if you want the Copyright to be the first thing to = be printed. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:36:19 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03A38A2B; Tue, 10 Feb 2015 02:36:19 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA488F44; Tue, 10 Feb 2015 02:36:18 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJJ00N29B7W4W20@st11p02mm-asmtp002.mac.com>; Tue, 10 Feb 2015 02:35:58 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_01:2015-02-09,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100023 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Rui Paulo In-reply-to: <20150209232826.GJ42409@kib.kiev.ua> Date: Mon, 09 Feb 2015 18:35:55 -0800 Content-transfer-encoding: 7bit Message-id: References: <201502092313.t19NDpoS083043@svn.freebsd.org> <20150209232826.GJ42409@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:36:19 -0000 On Feb 9, 2015, at 15:28, Konstantin Belousov wrote: > Arguably, there should be a knob, probably sysctl, to turn the > functionality off. I definitely do not want this on crash boxes used for > userspace debugging. Even despite the example handler is inactive. OK, I can provide a sysctl knob. >> + len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1; > It is much cleaner to use static const char arrays for the names, > and use sizeof() - 1 instead of hard-coding commented constants. OK. I was trying to avoid allocating >2k on the stack. >> + data = malloc(len, M_TEMP, M_NOWAIT); > Why is this allocation M_NOWAIT ? That should be M_WAITOK. >> + freepath = NULL; >> + } >> + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) >> + goto out; >> + snprintf(data, len, "%s core=%s", data, fullpath); > This is weird, and highly depends on the implementation details, supplying > the same string as target and source. IMO strcat(9) is enough there. OK, I'll change it to strcat. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:38:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F8EABF7; Tue, 10 Feb 2015 02:38:20 +0000 (UTC) Received: from smtp2.ore.mailhop.org (smtp2.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2603F57; Tue, 10 Feb 2015 02:38:19 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp2.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YL0iQ-000854-Gn; Tue, 10 Feb 2015 02:38:18 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t1A2cGe3077444; Mon, 9 Feb 2015 19:38:16 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+2BdBjnDUtxZRbX2raYftY Message-ID: <1423535896.80968.5.camel@freebsd.org> Subject: Re: svn commit: r278478 - head/sys/sys From: Ian Lepore To: John-Mark Gurney Date: Mon, 09 Feb 2015 19:38:16 -0700 In-Reply-To: <20150210000252.GO1953@funkthat.com> References: <201502092304.t19N4VB7078488@svn.freebsd.org> <20150210000252.GO1953@funkthat.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:38:20 -0000 On Mon, 2015-02-09 at 16:02 -0800, John-Mark Gurney wrote: > Rui Paulo wrote this message on Mon, Feb 09, 2015 at 23:04 +0000: > > Author: rpaulo > > Date: Mon Feb 9 23:04:30 2015 > > New Revision: 278478 > > URL: https://svnweb.freebsd.org/changeset/base/278478 > > > > Log: > > Add the ability to print a vendor copyright in dmesg. > > Should we change this into a linker set so that any module can > add their own vendor copyright w/o having to modify this again? > As long as that doesn't result in a boot-time cacaphony of voices disclaiming responsibility for being in Bill Paul's head. -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:43:23 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6C9DE8C; Tue, 10 Feb 2015 02:43:23 +0000 (UTC) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EF4D77; Tue, 10 Feb 2015 02:43:23 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id w55so19275413wes.4; Mon, 09 Feb 2015 18:43:21 -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=PJC+/LRGZb1DUfrRrF7cr+lGO1zUM9oVyHf6DnrtnrQ=; b=LTCg2eC6zJPCUCvOIuulFZ1LT/jI2hzF706IsK9bolKAx0H7nKZu69niRQDLM574Gc 0t8YQvX7VecP8H90Bln35MdhXnsg6UOS5bDlMWWAGewZQIH5XezXgxv3e/UGXcoJQ+Aa ofkp6VXAO5FmtBiQf2T8zCyT4EW7OVwchwTLFLeUAlziM3zogO+BTqUFj2+ypF/tHc2B /6KsRp26MDeZs4uf1a6dI18MzooYxIC32dVAaVk24q0QNbMJ8K4Xi8V0HuawhABm6Mp+ YYNlDryCb1AQ31+ZgcUqC5BoeCg7GC3oQJgxGjVy3HPI4mFaPXlKDNth5cuDYGIaexOE 4p8g== X-Received: by 10.194.238.193 with SMTP id vm1mr7652290wjc.124.1423536201668; Mon, 09 Feb 2015 18:43:21 -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 bv16sm16832864wib.0.2015.02.09.18.43.20 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Feb 2015 18:43:20 -0800 (PST) Date: Tue, 10 Feb 2015 03:43:18 +0100 From: Mateusz Guzik To: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Message-ID: <20150210024317.GA21779@dft-labs.eu> References: <201502092313.t19NDpoS083043@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201502092313.t19NDpoS083043@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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:43:23 -0000 On Mon, Feb 09, 2015 at 11:13:51PM +0000, Rui Paulo wrote: > +notify 10 { > + match "system" "kernel"; > + match "subsystem" "signal"; > + match "type" "coredump"; > + action "logger $comm $core"; > +}; > + > */ > [..] > + if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) > + goto out; > + snprintf(data, len, "comm=%s", fullpath); I cannot test it right now, but it looks like immediate privilege escalation. Path is not sanitized in any way and devd passes it to 'sh -c'. So a file named "a.out; /bin/id; meh" or so should result in execution of aforementioned /bin/id. Another note is that currently devctl is record oriented, but this may change at some point and free form userspace text could be used to forge new events. As such is trongly suggest we sanitize this somehow. Maybe a base64 or something. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:52:06 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CEE7229; Tue, 10 Feb 2015 02:52:06 +0000 (UTC) Received: from m2.gritton.org (gritton.org [63.246.134.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D288C166; Tue, 10 Feb 2015 02:52:05 +0000 (UTC) Received: from m2.gritton.org (gritton.org [63.246.134.121]) by m2.gritton.org (8.14.9/8.14.9) with ESMTP id t1A2pwEv027879; Mon, 9 Feb 2015 19:51:58 -0700 (MST) (envelope-from jamie@freebsd.org) Received: (from www@localhost) by m2.gritton.org (8.14.9/8.14.9/Submit) id t1A2pwr6027878; Mon, 9 Feb 2015 19:51:58 -0700 (MST) (envelope-from jamie@freebsd.org) X-Authentication-Warning: gritton.org: www set sender to jamie@freebsd.org using -f To: Garrett Cooper Subject: Re: svn commit: r278323 - in head: etc/rc.d usr.sbin/jail X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 09 Feb 2015 19:51:58 -0700 From: James Gritton In-Reply-To: References: <201502061754.t16HssXU042750@svn.freebsd.org> <343803A3-CFA3-4766-8294-139A6D8C0235@gmail.com> Message-ID: X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.0.3 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , jenkins-admin@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:52:06 -0000 On 2015-02-06 22:23, Garrett Cooper wrote: > On Feb 6, 2015, at 18:38, James Gritton wrote: >> On 2015-02-06 19:23, Garrett Cooper wrote: >>> I think you broke the Jenkins tests runs, and potentially jail >>> support >>> in some edgecases: >>> https://jenkins.freebsd.org/job/FreeBSD_HEAD-tests2/651/ >> >> Where do I go from here? There error you refer to certainly seems >> jail-related, which leads me to guess at something disconnected >> between the matching rc.d/jail and jail(8) change (i.e. using the new >> rc file with the old jail program). But that's really just a wild >> guess. Is there somewhere I look for more information? For example, >> where does Jenkins actually do its thing? >> >> Sorry for being so stupid in this - Jenkins has only been on the very >> edge of my awareness until now. > > I honestly don’t think it’s Jenkins because Jenkins runs in bhyve. I > think you accidentally broke option handling in the jail configuration > (please see my other reply about added “break;†statements). > > ... > > You can verify your changes by doing: > > % (cd /usr/tests/bin/pkill; sudo kyua test) After some testing and looking around, I've decided the problem definitely isn't in rc.d where I thought it might be. I've also decided it's probably not in my patch either. I've run this kyua test on a 10 system (don't have current handy for such things at the moment), and sometimes I would see a failure and sometimes I wouldn't. This was whether I was using the new or old jail code. Later in the day, when the box was less loaded, it seemed to always pass. Looking at the pkill-j_test script, I see jails being created with sleep commands both inside and outside the jail around its creation. I'm guessing this script is very sensitive to timing issues that could be cause by (among other things) system load. The jail commands in this script were also very simple, with the only parameters used being: path, name, ip4.addr, and command. This isn't some kind of esoteric exercising of the jail(8) options, and I would expect if it works at one time it would work at another. I've "hand-run" these particular jail commands and couldn't get them to fail (and the actual content of the jail(8) changes were tests already). I looked at the freebsd-current (I think) list where the Jenkins errors are posted, and it's true it started failing the pkill-j test at the time I made my change. But it's also true that it had failed that test once the day before my change, and then started passing it again. This particular test just seems to be fragile. So I don't have anywhere else to go with this. I'm going to assume jail(8) isn't the problem here. - Jamie From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:53:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 868FC381; Tue, 10 Feb 2015 02:53: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71F55174; Tue, 10 Feb 2015 02:53:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A2rRQ4004794; Tue, 10 Feb 2015 02:53:27 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A2rRn8004793; Tue, 10 Feb 2015 02:53:27 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502100253.t1A2rRn8004793@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 10 Feb 2015 02:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278488 - head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:53:27 -0000 Author: dteske Date: Tue Feb 10 02:53:26 2015 New Revision: 278488 URL: https://svnweb.freebsd.org/changeset/base/278488 Log: Whitespace. MFC after: 3 days Modified: head/usr.sbin/bsdconfig/usermgmt/share/user.subr Modified: head/usr.sbin/bsdconfig/usermgmt/share/user.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user.subr Tue Feb 10 02:02:24 2015 (r278487) +++ head/usr.sbin/bsdconfig/usermgmt/share/user.subr Tue Feb 10 02:53:26 2015 (r278488) @@ -830,8 +830,7 @@ f_user_delete() f_eval_catch $funcname \ pw '%s -H 0' "$cmd" else - f_eval_catch $funcname \ - pw '%s -h -' "$cmd" + f_eval_catch $funcname pw '%s -h -' "$cmd" fi fi fi From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:55:12 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E22B4D4; Tue, 10 Feb 2015 02:55: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECF74183; Tue, 10 Feb 2015 02:55:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A2tBBO005098; Tue, 10 Feb 2015 02:55:11 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A2tBbE005094; Tue, 10 Feb 2015 02:55:11 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502100255.t1A2tBbE005094@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 10 Feb 2015 02:55:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278489 - in head/usr.sbin/bsdconfig/timezone: . share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:55:12 -0000 Author: dteske Date: Tue Feb 10 02:55:10 2015 New Revision: 278489 URL: https://svnweb.freebsd.org/changeset/base/278489 Log: Eliminate sub-shells where possible for performance. MFC after: 7 days Modified: head/usr.sbin/bsdconfig/timezone/share/continents.subr head/usr.sbin/bsdconfig/timezone/share/countries.subr head/usr.sbin/bsdconfig/timezone/timezone Modified: head/usr.sbin/bsdconfig/timezone/share/continents.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/continents.subr Tue Feb 10 02:53:26 2015 (r278488) +++ head/usr.sbin/bsdconfig/timezone/share/continents.subr Tue Feb 10 02:55:10 2015 (r278489) @@ -1,6 +1,6 @@ if [ ! "$_TIMEZONE_CONTINENTS_SUBR" ]; then _TIMEZONE_CONTINENTS_SUBR=1 # -# Copyright (c) 2011-2012 Devin Teske +# Copyright (c) 2011-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -87,7 +87,7 @@ export continent_utc_title ############################################################ FUNCTIONS -# f_continent $cont $property +# f_continent $cont $property [$var_to_set] # # Returns a single property of a given continent. Available properties are: # @@ -102,37 +102,60 @@ export continent_utc_title # (which appears after continent selection). # menu_list Menu-list of regions for this continent. # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_continent() { - local cont="$1" property="$2" - eval echo \"\${continent_${cont}_$property}\" + f_getvar "continent_${1}_$2" $3 } -# f_find_continent $title +# f_find_continent $title [$var_to_set] # # Returns continent identifier given continent title. # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_find_continent() { - local cont - for cont in $CONTINENTS; do - if [ "$1" = "$( f_continent $cont title )" ]; then - echo "$cont" + local __cont __title + for __cont in $CONTINENTS; do + f_continent $__cont title __title + if [ "$1" = "$__title" ]; then + if [ "$2" ]; then + setvar "$2" $__cont + else + echo "$__cont" + fi return $SUCCESS fi done return $FAILURE } -# f_OCEANP $cont +# f_OCEANP $cont [$var_to_set] # # Returns "1" if the first argument is an ocean, otherwise NULL. # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_OCEANP() { case "$1" in arctic|atlantic|indian|pacific) - echo 1 + if [ "$2" ]; then + setvar "$2" 1 + else + echo 1 + fi + ;; + *) + [ "$2" ] && setvar "$2" "" esac } Modified: head/usr.sbin/bsdconfig/timezone/share/countries.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/countries.subr Tue Feb 10 02:53:26 2015 (r278488) +++ head/usr.sbin/bsdconfig/timezone/share/countries.subr Tue Feb 10 02:55:10 2015 (r278489) @@ -1,6 +1,6 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; then _TIMEZONE_COUNTRIES_SUBR=1 # -# Copyright (c) 2011-2012 Devin Teske +# Copyright (c) 2011-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,8 +25,10 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ FUNCTIONS -# f_country $code $property +# f_country $code $property [$var_to_set] # # Returns a single property of a given country. Available properties are: # @@ -44,10 +46,13 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th # descr_N Like name, but for the Nth zone when the country has # multiple zones (nzones > 0) # +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# f_country() { - local code="$1" property="$2" - eval echo \"\${country_${code}_$property}\" + f_getvar "country_${1}_$2" $3 } # f_sort_countries @@ -59,22 +64,42 @@ f_country() # afterward is the sh(1) function which utilizes the below awk script. # f_sort_countries_awk=' +function _asorti(src, dest) { - split($0, array, /[[:space:]]+/) + k = nitems = 0 + for (i in src) dest[++nitems] = i + for (i = 1; i <= nitems; k = i++) { + idx = dest[i] + while ((k > 0) && (dest[k] > idx)) { + dest[k+1] = dest[k]; k-- + } + dest[k+1] = idx + } + return nitems +} +BEGIN { + split(ENVIRON["COUNTRIES"], array, /[[:space:]]+/) for (item in array) { tlc = array[item] - print ENVIRON["country_" tlc "_name"] " " tlc + name = ENVIRON["country_" tlc "_name"] + countries[name] = tlc } + n = _asorti(countries, sorted_countries) + for (i = 1; i <= n; i++) + print countries[sorted_countries[i]] + exit } ' f_sort_countries() { - COUNTRIES=$( echo "$COUNTRIES" | awk "$f_sort_countries_awk" | - sort | awk '{print $NF}' ) - export COUNTRIES + export COUNTRIES # for awk(1) ENVIRON[] visibility + COUNTRIES=$( awk "$f_sort_countries_awk" ) + export COUNTRIES # Pedantic } +############################################################ MAIN + f_dprintf "%s: Successfully loaded." timezone/countries.subr fi # ! $_TIMEZONE_COUNTRIES_SUBR Modified: head/usr.sbin/bsdconfig/timezone/timezone ============================================================================== --- head/usr.sbin/bsdconfig/timezone/timezone Tue Feb 10 02:53:26 2015 (r278488) +++ head/usr.sbin/bsdconfig/timezone/timezone Tue Feb 10 02:55:10 2015 (r278489) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2011-2013 Devin Teske +# Copyright (c) 2011-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -280,8 +280,8 @@ f_make_menus # creates $continen # # Launch application main menu # -defaultctry="" -defaultzone="" +defaultctry= +defaultzone= NEED_CONTINENT=1 NEED_COUNTRY=1 while :; do @@ -299,10 +299,10 @@ while :; do continent=$( eval f_dialog_menutag2item \"\$mtag\" \ $continent_menu_list ) - cont=$( f_find_continent "$continent" ) - cont_title=$( f_continent $cont title ) - nitems=$( f_continent $cont nitems ) - isocean=$( f_OCEANP $cont ) + f_find_continent "$continent" cont + f_continent $cont title cont_title + f_continent $cont nitems nitems + f_OCEANP $cont isocean fi if [ "$NEED_COUNTRY" ]; then @@ -345,7 +345,7 @@ while :; do # # Calculate size of menu # - menu_list=$( f_continent $cont menu_list ) + f_continent $cont menu_list menu_list eval f_dialog_menu_size height width rows \ \"\$title\" \ \"\$btitle\" \ @@ -378,7 +378,7 @@ while :; do fi # Get the country code from the user's selection - tlc=$( f_continent $cont tlc_$tag ) + f_continent $cont tlc_$tag tlc NEED_COUNTRY= fi @@ -387,12 +387,12 @@ while :; do # If the selection has only one zone (nzones == -1), # just set it. # - nzones=$( f_country $tlc nzones ) + f_country $tlc nzones nzones if [ $nzones -lt 0 ]; then - real_cont=$( f_country $tlc cont ) - real_continent=$( f_continent $real_cont name ) - name=$( f_country $tlc name ) - filename=$( f_country $tlc filename ) + f_country $tlc cont real_cont + f_continent $real_cont name real_continent + f_country $tlc name name + f_country $tlc filename filename if ! f_confirm_zone "$real_continent/$filename"; then [ $nitems -eq 1 ] && NEED_CONTINENT=1 @@ -400,13 +400,13 @@ while :; do continue fi else - f_sprintf title "$msg_country_time_zones" \ - "$( f_country $tlc name )" + f_country $tlc name name + f_sprintf title "$msg_country_time_zones" "$name" f_dialog_title "$title" title="$DIALOG_TITLE" btitle="$DIALOG_BACKTITLE" f_dialog_title_restore prompt="$msg_select_zone" - menu_list=$( f_country $tlc menu_list ) + f_country $tlc menu_list menu_list eval f_dialog_menu_size height width rows \ \"\$title\" \"\$btitle\" \"\$prompt\" \"\" $menu_list @@ -435,10 +435,10 @@ while :; do continue fi - real_cont=$( f_country $tlc cont_$n ) - real_continent=$( f_continent $real_cont name ) - name=$( f_country $tlc name ) - filename=$( f_country $tlc filename_$n ) + f_country $tlc cont_$n real_cont + f_continent $real_cont name real_continent + f_country $tlc name name + f_country $tlc filename_$n filename f_confirm_zone "$real_continent/$filename" || continue fi From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 02:58:09 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF7BF624; Tue, 10 Feb 2015 02:58:09 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A28E619C; Tue, 10 Feb 2015 02:58:09 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJJ001BWC801J20@st11p02mm-asmtp002.mac.com>; Tue, 10 Feb 2015 02:57:41 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_01:2015-02-09,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=2 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100027 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Rui Paulo In-reply-to: <20150210024317.GA21779@dft-labs.eu> Date: Mon, 09 Feb 2015 18:57:36 -0800 Content-transfer-encoding: quoted-printable Message-id: References: <201502092313.t19NDpoS083043@svn.freebsd.org> <20150210024317.GA21779@dft-labs.eu> To: Mateusz Guzik X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 02:58:09 -0000 On Feb 9, 2015, at 18:43, Mateusz Guzik wrote: >=20 > On Mon, Feb 09, 2015 at 11:13:51PM +0000, Rui Paulo wrote: >> +notify 10 { >> + match "system" "kernel"; >> + match "subsystem" "signal"; >> + match "type" "coredump"; >> + action "logger $comm $core"; >> +}; >> + >> */ >>=20 > [..] >> + if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) !=3D= 0) >> + goto out; >> + snprintf(data, len, "comm=3D%s", fullpath); >=20 > I cannot test it right now, but it looks like immediate privilege > escalation. >=20 > Path is not sanitized in any way and devd passes it to 'sh -c'. >=20 > So a file named "a.out; /bin/id; meh" or so should result in execution > of aforementioned /bin/id. Well, you can't have a file name with "/" but you're right. > Another note is that currently devctl is record oriented, but this may > change at some point and free form userspace text could be used to = forge > new events. >=20 > As such is trongly suggest we sanitize this somehow. Maybe a base64 or > something. I was trying hard to avoid this issue in unpublished my crash helper, = but I forgot that devd runs execl("sh -c", ....); :-( It might just be easier to inspect the path names and allow only = [a-z][A-Z][0-9] and '/' before sending the devctl message. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 03:11:59 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2301EA40; Tue, 10 Feb 2015 03:11:59 +0000 (UTC) Received: from gw.catspoiler.org (cl-1657.chi-02.us.sixxs.net [IPv6:2001:4978:f:678::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BECF566C; Tue, 10 Feb 2015 03:11:58 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id t1A3BkE0016096; Mon, 9 Feb 2015 19:11:50 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201502100311.t1A3BkE0016096@gw.catspoiler.org> Date: Mon, 9 Feb 2015 19:11:46 -0800 (PST) From: Don Lewis Subject: Re: svn commit: r278479 - in head: etc sys/kern To: mjguzik@gmail.com In-Reply-To: <20150210024317.GA21779@dft-labs.eu> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, rpaulo@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 03:11:59 -0000 On 10 Feb, Mateusz Guzik wrote: > On Mon, Feb 09, 2015 at 11:13:51PM +0000, Rui Paulo wrote: >> +notify 10 { >> + match "system" "kernel"; >> + match "subsystem" "signal"; >> + match "type" "coredump"; >> + action "logger $comm $core"; >> +}; >> + >> */ >> > [..] >> + if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) >> + goto out; >> + snprintf(data, len, "comm=%s", fullpath); > > I cannot test it right now, but it looks like immediate privilege > escalation. > > Path is not sanitized in any way and devd passes it to 'sh -c'. > > So a file named "a.out; /bin/id; meh" or so should result in execution > of aforementioned /bin/id. Then there is the issue of a user-generated core file being fed into the crash analyzer, possibly exploiting bugs in the latter. From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 03:12:12 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7A70B78; Tue, 10 Feb 2015 03:12: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AF27673; Tue, 10 Feb 2015 03:12:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A3CCaY015162; Tue, 10 Feb 2015 03:12:12 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A3CCjV015161; Tue, 10 Feb 2015 03:12:12 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502100312.t1A3CCjV015161@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 10 Feb 2015 03:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278490 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 03:12:12 -0000 Author: dteske Date: Tue Feb 10 03:12:11 2015 New Revision: 278490 URL: https://svnweb.freebsd.org/changeset/base/278490 Log: Add bsdconfig api functions f_dialog_pause()/f_dialog_pause_no_cancel() Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Tue Feb 10 02:55:10 2015 (r278489) +++ head/usr.sbin/bsdconfig/share/dialog.subr Tue Feb 10 03:12:11 2015 (r278490) @@ -1580,6 +1580,56 @@ f_xdialog_info() -1 # timeout of -1 means abort when EOF on stdin } +############################################################ PAUSE FUNCTIONS + +# f_dialog_pause $msg_text $duration [$hline] +# +# Display a message in a widget with a progress bar that runs backward for +# $duration seconds. +# +f_dialog_pause() +{ + local pause_text="$1" duration="$2" hline="$3" height width + f_isinteger "$duration" || return $FAILURE + f_dialog_buttonbox_size height width \ + "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$pause_text" "$hline" + if [ "$USE_XDIALOG" ]; then + $DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --ok-label "$msg_skip" \ + --cancel-label "$msg_cancel" \ + ${noCancel:+--no-cancel} \ + --timeout "$duration" \ + --yesno "$pause_text" \ + $height $width + else + [ $duration -gt 0 ] && duration=$(( $duration - 1 )) + [ $duration -gt 1 ] && duration=$(( $duration - 1 )) + height=$(( $height + 3 )) # Add height for progress bar + $DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --hline "$hline" \ + --ok-label "$msg_skip" \ + --cancel-label "$msg_cancel" \ + ${noCancel:+--no-cancel} \ + --pause "$pause_text" \ + $height $width "$duration" + fi +} + +# f_dialog_pause_no_cancel $msg_text $duration [$hline] +# +# Display a message in a widget with a progress bar that runs backward for +# $duration seconds. No cancel button is provided. Always returns success. +# +f_dialog_pause_no_cancel() +{ + noCancel=1 f_dialog_pause "$@" + return $SUCCESS +} + ############################################################ MSGBOX FUNCTIONS # f_dialog_msgbox $msg_text [$hline] From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 03:14:42 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38146CD2; Tue, 10 Feb 2015 03:14:42 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8D9686; Tue, 10 Feb 2015 03:14:41 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJJ00CNBCZ9DU00@st11p02mm-asmtp001.mac.com>; Tue, 10 Feb 2015 03:14:02 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_02:2015-02-09,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100030 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Rui Paulo In-reply-to: <201502100311.t1A3BkE0016096@gw.catspoiler.org> Date: Mon, 09 Feb 2015 19:13:57 -0800 Content-transfer-encoding: quoted-printable Message-id: References: <201502100311.t1A3BkE0016096@gw.catspoiler.org> To: Don Lewis X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, mjguzik@gmail.com, rpaulo@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 03:14:42 -0000 On Feb 9, 2015, at 19:11, Don Lewis wrote: >=20 > On 10 Feb, Mateusz Guzik wrote: >> On Mon, Feb 09, 2015 at 11:13:51PM +0000, Rui Paulo wrote: >>> +notify 10 { >>> + match "system" "kernel"; >>> + match "subsystem" "signal"; >>> + match "type" "coredump"; >>> + action "logger $comm $core"; >>> +}; >>> + >>> */ >>>=20 >> [..] >>> + if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) !=3D= 0) >>> + goto out; >>> + snprintf(data, len, "comm=3D%s", fullpath); >>=20 >> I cannot test it right now, but it looks like immediate privilege >> escalation. >>=20 >> Path is not sanitized in any way and devd passes it to 'sh -c'. >>=20 >> So a file named "a.out; /bin/id; meh" or so should result in = execution >> of aforementioned /bin/id. >=20 > Then there is the issue of a user-generated core file being fed into = the > crash analyzer, possibly exploiting bugs in the latter. That's why there's a warning in devd.conf: devd will run the helper as = root, so a proper written helper has to drop the privileges very early = or be invoked by devd with lower privileges. My helper just drops = privileges to match the UID/GID of the generated core file before doing = anything else. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 03:15:29 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14BBCE0F; Tue, 10 Feb 2015 03:15:29 +0000 (UTC) Received: from gw.catspoiler.org (cl-1657.chi-02.us.sixxs.net [IPv6:2001:4978:f:678::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A900F68E; Tue, 10 Feb 2015 03:15:28 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id t1A3FGpQ016118; Mon, 9 Feb 2015 19:15:20 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201502100315.t1A3FGpQ016118@gw.catspoiler.org> Date: Mon, 9 Feb 2015 19:15:16 -0800 (PST) From: Don Lewis Subject: Re: svn commit: r278479 - in head: etc sys/kern To: mjguzik@gmail.com In-Reply-To: <201502100311.t1A3BkE0016096@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, rpaulo@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 03:15:29 -0000 On 9 Feb, Don Lewis wrote: > On 10 Feb, Mateusz Guzik wrote: >> On Mon, Feb 09, 2015 at 11:13:51PM +0000, Rui Paulo wrote: >>> +notify 10 { >>> + match "system" "kernel"; >>> + match "subsystem" "signal"; >>> + match "type" "coredump"; >>> + action "logger $comm $core"; >>> +}; >>> + >>> */ >>> >> [..] >>> + if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) >>> + goto out; >>> + snprintf(data, len, "comm=%s", fullpath); >> >> I cannot test it right now, but it looks like immediate privilege >> escalation. >> >> Path is not sanitized in any way and devd passes it to 'sh -c'. >> >> So a file named "a.out; /bin/id; meh" or so should result in execution >> of aforementioned /bin/id. > > Then there is the issue of a user-generated core file being fed into the > crash analyzer, possibly exploiting bugs in the latter. Or worse, the contents of the executable, in particular the debug info, could also be an attack vector. From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 03:15:54 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D22DBF4B; Tue, 10 Feb 2015 03:15: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD952694; Tue, 10 Feb 2015 03:15:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A3Fs0V015659; Tue, 10 Feb 2015 03:15:54 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A3FsNu015658; Tue, 10 Feb 2015 03:15:54 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502100315.t1A3FsNu015658@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 10 Feb 2015 03:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278491 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 03:15:54 -0000 Author: dteske Date: Tue Feb 10 03:15:54 2015 New Revision: 278491 URL: https://svnweb.freebsd.org/changeset/base/278491 Log: Add bsdconfig api function f_dialog_menutag2help() Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Tue Feb 10 03:12:11 2015 (r278490) +++ head/usr.sbin/bsdconfig/share/dialog.subr Tue Feb 10 03:15:54 2015 (r278491) @@ -2116,6 +2116,39 @@ f_dialog_menutag2index_with_help() return $FAILURE } +# f_dialog_menutag2help $tag_chosen $tag1 $item1 $help1 $tag2 $item2 $help2 ... +# +# To use the `--menu' option of dialog(1) with the `--item-help' option, you +# must pass an ordered list of tag/item/help triplets on the command-line. When +# the user selects a menu option the tag for that item is printed to stderr. +# +# This function allows you to dereference the tag chosen by the user back into +# the help associated with said tag (item is discarded/ignored). +# +# Pass the tag chosen by the user as the first argument, followed by the +# ordered list of tag/item/help triplets (HINT: use the same tag/item/help list +# as was passed to dialog(1) for consistency). +# +# If the tag cannot be found, NULL is returned. +# +f_dialog_menutag2help() +{ + local tag="$1" tagn help + shift 1 # tag + + while [ $# -gt 0 ]; do + tagn="$1" + help="$3" + shift 3 # tagn/item/help + + if [ "$tag" = "$tagn" ]; then + echo "$help" + return $SUCCESS + fi + done + return $FAILURE +} + ############################################################ INIT FUNCTIONS # f_dialog_init From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 03:17:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD7CE162; Tue, 10 Feb 2015 03:17: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B97216B3; Tue, 10 Feb 2015 03:17:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A3Hqnr015941; Tue, 10 Feb 2015 03:17:52 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A3Hqlv015940; Tue, 10 Feb 2015 03:17:52 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502100317.t1A3Hqlv015940@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 10 Feb 2015 03:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278492 - head/usr.sbin/bsdconfig/console X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 03:17:52 -0000 Author: dteske Date: Tue Feb 10 03:17:51 2015 New Revision: 278492 URL: https://svnweb.freebsd.org/changeset/base/278492 Log: Add "vt_"* aliases to bsdconfig console entries. NB: "syscons_"* kept for backward compatibility Modified: head/usr.sbin/bsdconfig/console/INDEX Modified: head/usr.sbin/bsdconfig/console/INDEX ============================================================================== --- head/usr.sbin/bsdconfig/console/INDEX Tue Feb 10 03:15:54 2015 (r278491) +++ head/usr.sbin/bsdconfig/console/INDEX Tue Feb 10 03:17:51 2015 (r278492) @@ -46,6 +46,13 @@ menu_help="Customize system console beha # can be i18n'ed but `command' is the name of a script. # menu_selection="console|console" +menu_selection="vt_font|font" +menu_selection="vt_keymap|keymap" +menu_selection="vt_repeat|repeat" +menu_selection="vt_saver|saver" +menu_selection="vt_screenmap|screenmap" +menu_selection="vt_ttys|ttys" +# For backward compatibility menu_selection="syscons_font|font" menu_selection="syscons_keymap|keymap" menu_selection="syscons_repeat|repeat" From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 03:34:44 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72E86429; Tue, 10 Feb 2015 03:34: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D5C888C; Tue, 10 Feb 2015 03:34:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A3Yi77024889; Tue, 10 Feb 2015 03:34:44 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A3YgvC024878; Tue, 10 Feb 2015 03:34:42 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201502100334.t1A3YgvC024878@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 10 Feb 2015 03:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278493 - in head/usr.sbin/bsdconfig: console includes networking/share share usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 03:34:44 -0000 Author: dteske Date: Tue Feb 10 03:34:42 2015 New Revision: 278493 URL: https://svnweb.freebsd.org/changeset/base/278493 Log: Update copyrights. Modified: head/usr.sbin/bsdconfig/console/INDEX head/usr.sbin/bsdconfig/includes/INDEX head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/keymap.subr head/usr.sbin/bsdconfig/usermgmt/share/user.subr Modified: head/usr.sbin/bsdconfig/console/INDEX ============================================================================== --- head/usr.sbin/bsdconfig/console/INDEX Tue Feb 10 03:17:51 2015 (r278492) +++ head/usr.sbin/bsdconfig/console/INDEX Tue Feb 10 03:34:42 2015 (r278493) @@ -1,5 +1,5 @@ # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/bsdconfig/includes/INDEX ============================================================================== --- head/usr.sbin/bsdconfig/includes/INDEX Tue Feb 10 03:17:51 2015 (r278492) +++ head/usr.sbin/bsdconfig/includes/INDEX Tue Feb 10 03:34:42 2015 (r278493) @@ -1,4 +1,4 @@ -# Copyright (c) 2013 Devin Teske +# Copyright (c) 2013-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Tue Feb 10 03:17:51 2015 (r278492) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Tue Feb 10 03:34:42 2015 (r278493) @@ -1,6 +1,6 @@ if [ ! "$_NETWORKING_DEVICE_SUBR" ]; then _NETWORKING_DEVICE_SUBR=1 # -# Copyright (c) 2006-2013 Devin Teske +# Copyright (c) 2006-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Tue Feb 10 03:17:51 2015 (r278492) +++ head/usr.sbin/bsdconfig/share/dialog.subr Tue Feb 10 03:34:42 2015 (r278493) @@ -1,6 +1,6 @@ if [ ! "$_DIALOG_SUBR" ]; then _DIALOG_SUBR=1 # -# Copyright (c) 2006-2014 Devin Teske +# Copyright (c) 2006-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/keymap.subr Tue Feb 10 03:17:51 2015 (r278492) +++ head/usr.sbin/bsdconfig/share/keymap.subr Tue Feb 10 03:34:42 2015 (r278493) @@ -1,6 +1,6 @@ if [ ! "$_KEYMAP_SUBR" ]; then _KEYMAP_SUBR=1 # -# Copyright (c) 2013 Devin Teske +# Copyright (c) 2013-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/bsdconfig/usermgmt/share/user.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user.subr Tue Feb 10 03:17:51 2015 (r278492) +++ head/usr.sbin/bsdconfig/usermgmt/share/user.subr Tue Feb 10 03:34:42 2015 (r278493) @@ -1,7 +1,7 @@ if [ ! "$_USERMGMT_USER_SUBR" ]; then _USERMGMT_USER_SUBR=1 # # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2014 Devin Teske +# Copyright (c) 2012-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 03:40:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A544597; Tue, 10 Feb 2015 03:40:10 +0000 (UTC) Received: from mail-ie0-f176.google.com (mail-ie0-f176.google.com [209.85.223.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCB278AE; Tue, 10 Feb 2015 03:40:09 +0000 (UTC) Received: by iecrd18 with SMTP id rd18so9723156iec.5; Mon, 09 Feb 2015 19:40:02 -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=YXecM0fld6c8tIi0KMhi9r8kuSiRSjBlGs62Es9HX6g=; b=P3Jt8Iqj2nEqT2npDmwb/07Dmnd/8V9G1RomLU1Q96C1Em2N3O43E0KMmkZ9S6heCn zHm2Su6AT9IT5mtxhWfkljxsGyobwoZpz+StHP5YlN+UNiQeWos+U/y43wzOD+2DiJM4 34eJauKUNxoobROrY3tCdF71g8me0PWgYyV6m4OMjFuk7nPUEt6fDFVSGz4mENoAyqvM 1AK/S+pvWig3xyqrETtbRqn3s+vUY86NUmz9Meh9qfoaIbdTZJtYmkmDyaszDY8QIwpN MUtUCu3eRXRtLnVogWBCNgQ6JYoDGta0g7GZTn0B6OnLmbjoeM5KWp/qE6MUuRKYogQS 56ag== MIME-Version: 1.0 X-Received: by 10.43.131.5 with SMTP id ho5mr27966200icc.82.1423539602722; Mon, 09 Feb 2015 19:40:02 -0800 (PST) Received: by 10.50.182.233 with HTTP; Mon, 9 Feb 2015 19:40:02 -0800 (PST) In-Reply-To: <201502100135.t1A1ZRhf067753@svn.freebsd.org> References: <201502100135.t1A1ZRhf067753@svn.freebsd.org> Date: Mon, 9 Feb 2015 19:40:02 -0800 Message-ID: Subject: Re: svn commit: r278486 - head From: NGie Cooper To: Glen Barber 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 03:40:10 -0000 On Mon, Feb 9, 2015 at 5:35 PM, Glen Barber wrote: > Author: gjb > Date: Tue Feb 10 01:35:26 2015 > New Revision: 278486 > URL: https://svnweb.freebsd.org/changeset/base/278486 > > Log: > Exclude 'tests' from DEBUG_DISTRIBUTIONS. > > Sponsored by: The FreeBSD Foundation > > Modified: > head/Makefile.inc1 Hi, Were the tests distribution debug files really blowing up the install size? Thanks! From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 03:49:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 902748C2; Tue, 10 Feb 2015 03:49:26 +0000 (UTC) Date: Tue, 10 Feb 2015 03:49:22 +0000 From: Glen Barber To: NGie Cooper Subject: Re: svn commit: r278486 - head Message-ID: <20150210034922.GB14325@hub.FreeBSD.org> References: <201502100135.t1A1ZRhf067753@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mxv5cy4qt+RJ9ypb" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 03:49:27 -0000 --mxv5cy4qt+RJ9ypb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 09, 2015 at 07:40:02PM -0800, NGie Cooper wrote: > On Mon, Feb 9, 2015 at 5:35 PM, Glen Barber wrote: > > Log: > > Exclude 'tests' from DEBUG_DISTRIBUTIONS. > > >=20 > Were the tests distribution debug files really blowing up the install siz= e? No, considering there are no tests debugging contents that I saw. Glen --mxv5cy4qt+RJ9ypb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJU2X+8AAoJEAMUWKVHj+KTmMAP/0I5wDjN6FiftvqnhCdWB7gh sFrdnGlq4mrvih4ml+bI/Nu+mZOljONzggJZBV6ehe+/pikknerPIxCtyUSB/Gyh GgGJ4d0RNI5ukOoK6F1qSf1o1KPKC0I8C8vXckIHQx6HpNbbSkYAxqNw5ZAZHhMU ymNpQydt1aUfgnGpApWjBkP3m7UuRkmNfDc3yginuJCihGzHKkG8f9IfRVMNG88S FASJRrsoWOEJ1Qs80Ymx00No+q+lU6GDVCYRQ/BTzELCoCHAqCOm7/lZJSvhJEf8 smmy7xO0WeyPB/9hkKQ3OcMEG8G+orjO/maBZ/m4iP0Wo4t0JWTmDQ16+TBxWJQh 1S383tcAuGbO5gmdSH6BhathOfXj7DJEALULTpQXN0PDS0HTyLLmQkTFFv0437Ew CQmxkDKhWKiUWio1c6MP7542ZVUnranFyQ2XRrL3rfbO3GhwDe4i77lwu6KEpoJr DmTTqkvfkdY5m4+dwx09ppVwI0ZPlInU0cEBxqQcB16xFGiwItN72m+S4ONT4Kzr 3gzCVpORhsVxAPuq9081pA9EkUNKDWXx/TZ4wFE4Fvc2cwaIM50LKktqnOi8Gpn8 n8CXDs9uXacyef9TV1X3lwC6iaqwdg7HAW7H93kTpy17NfAAMcLNTu+tlxnP7p7R /iOqDf3HLYrvZPT1mcit =mRnC -----END PGP SIGNATURE----- --mxv5cy4qt+RJ9ypb-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 04:34:40 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A079DEE6; Tue, 10 Feb 2015 04:34:40 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BD4ADA3; Tue, 10 Feb 2015 04:34:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A4YeRZ052514; Tue, 10 Feb 2015 04:34:40 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A4YeLr052513; Tue, 10 Feb 2015 04:34:40 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502100434.t1A4YeLr052513@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 10 Feb 2015 04:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278494 - 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 04:34:40 -0000 Author: rpaulo Date: Tue Feb 10 04:34:39 2015 New Revision: 278494 URL: https://svnweb.freebsd.org/changeset/base/278494 Log: Sanitise the coredump file names sent to devd. While there, add a sysctl to turn this feature off as requested by kib@. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Feb 10 03:34:42 2015 (r278493) +++ head/sys/kern/kern_sig.c Tue Feb 10 04:34:39 2015 (r278494) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "opt_core.h" #include +#include #include #include #include @@ -179,6 +180,10 @@ static int set_core_nodump_flag = 0; SYSCTL_INT(_kern, OID_AUTO, nodump_coredump, CTLFLAG_RW, &set_core_nodump_flag, 0, "Enable setting the NODUMP flag on coredump files"); +static int coredump_devctl = 1; +SYSCTL_INT(_kern, OID_AUTO, coredump_devctl, CTLFLAG_RW, &coredump_devctl, + 0, "Generate a devctl notification when processes coredump"); + /* * Signal properties and actions. * The array below categorizes the signals and their default actions @@ -3217,6 +3222,25 @@ out: return (0); } +static int +coredump_sanitise_path(const char *path) +{ + size_t len, i; + + /* + * Only send a subset of ASCII to devd(8) because it + * might pass these strings to sh -c. + */ + len = strlen(path); + for (i = 0; i < len; i++) + if (!(isalpha(path[i]) || isdigit(path[i])) && + path[i] != '/' && path[i] != '.' && + path[i] != '-') + return (0); + + return (1); +} + /* * Dump a process' core. The main routine does some * policy checking, and creates the name of the coredump; @@ -3238,9 +3262,9 @@ coredump(struct thread *td) void *rl_cookie; off_t limit; int compress; - char *data = NULL; - size_t len; + char data[MAXPATHLEN * 2 + 16]; /* space for devctl notification */ char *fullpath, *freepath = NULL; + size_t len; #ifdef COMPRESS_USER_CORES compress = compress_user_cores; @@ -3332,30 +3356,29 @@ close: * Notify the userland helper that a process triggered a core dump. * This allows the helper to run an automated debugging session. */ - len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1; - data = malloc(len, M_TEMP, M_NOWAIT); - if (data == NULL) + if (coredump_devctl == 0) goto out; if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) goto out; - snprintf(data, len, "comm=%s", fullpath); - if (freepath != NULL) { - free(freepath, M_TEMP); - freepath = NULL; + if (!coredump_sanitise_path(fullpath)) + goto out; + snprintf(data, sizeof(data), "comm=%s ", fullpath); + free(freepath, M_TEMP); + freepath = NULL; + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) { + printf("could not find coredump\n"); + goto out; } - if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) + if (!coredump_sanitise_path(fullpath)) goto out; - snprintf(data, len, "%s core=%s", data, fullpath); + strlcat(data, "core=", sizeof(data)); + len = strlcat(data, fullpath, sizeof(data)); devctl_notify("kernel", "signal", "coredump", data); - free(name, M_TEMP); out: #ifdef AUDIT audit_proc_coredump(td, name, error); #endif - if (freepath != NULL) - free(freepath, M_TEMP); - if (data != NULL) - free(data, M_TEMP); + free(freepath, M_TEMP); free(name, M_TEMP); return (error); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 04:46:53 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5251C131; Tue, 10 Feb 2015 04:46:53 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25B4DE80; Tue, 10 Feb 2015 04:46:52 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJJ0082NH8R3I30@st11p02mm-asmtp002.mac.com>; Tue, 10 Feb 2015 04:46:06 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_02:2015-02-09,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100048 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278494 - head/sys/kern From: Rui Paulo In-reply-to: <201502100434.t1A4YeLr052513@svn.freebsd.org> Date: Mon, 09 Feb 2015 20:46:03 -0800 Content-transfer-encoding: quoted-printable Message-id: <7FCF7F90-C1B2-4C1C-8781-F89F8519D47E@me.com> References: <201502100434.t1A4YeLr052513@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.2070.6) 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 04:46:53 -0000 On Feb 9, 2015, at 20:34, Rui Paulo wrote: >=20 > Author: rpaulo > Date: Tue Feb 10 04:34:39 2015 > New Revision: 278494 > URL: https://svnweb.freebsd.org/changeset/base/278494 >=20 > Log: > Sanitise the coredump file names sent to devd. >=20 > While there, add a sysctl to turn this feature off as requested by > kib@. I wanted to get the sanitiser code in ASAP, but, as suggested by stas@ = offline, we think devd should also provide an action mode that runs a = command outside sh(1) and without using $PATH.=20 -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 05:13:20 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CC9C9AB; Tue, 10 Feb 2015 05:13:20 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DFE2117; Tue, 10 Feb 2015 05:13:19 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJJ00J6SIH6PY20@st11p02mm-asmtp001.mac.com>; Tue, 10 Feb 2015 05:12:45 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_03:2015-02-09,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100052 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278494 - head/sys/kern From: Rui Paulo In-reply-to: <1423544566.80968.9.camel@freebsd.org> Date: Mon, 09 Feb 2015 21:12:42 -0800 Content-transfer-encoding: quoted-printable Message-id: References: <201502100434.t1A4YeLr052513@svn.freebsd.org> <7FCF7F90-C1B2-4C1C-8781-F89F8519D47E@me.com> <1423544566.80968.9.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 05:13:20 -0000 On Feb 9, 2015, at 21:02, Ian Lepore wrote: > Or... we could consider restoring devd to its original relatively = benign > existance handling device-related events, and move handling of crash > dumps into a separate daemon which can shoulder the burden of security > for itself. >=20 > At $work we listen to the devd re-distribute port to handle device > events in our apps, and having an ever-growing flood of stuff that's = got > nothing to do with devices is going to have a negative impact on > applications that do such things. That's perfectly reasonable given that devd handles everything: it gets = notified when a new pty is created, when rctls reach their limit, when = zfs does "something", when devices show up/disappear, when you unplug = the power adapter, when GEOM devices show up/disappear, when your CPU is = too hot, when you press the brightness keys, etc. Some of these use = cases are fine, others aren't. This is pretty much what happened to = udev, if I'm not mistaken. We need a way to avoid reinventing the wheel. I really don't want to = duplicate another /dev/devctl in the kernel. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 06:02:38 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BB00BC; Tue, 10 Feb 2015 06:02:38 +0000 (UTC) Received: from smtp3.ore.mailhop.org (smtp3.ore.mailhop.org [54.149.88.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79D32757; Tue, 10 Feb 2015 06:02:38 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp3.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YL2yG-0001aI-7D; Tue, 10 Feb 2015 05:02:48 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t1A52kqx078246; Mon, 9 Feb 2015 22:02:46 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+MvtkUsfkbB4QM92a5uxkZ Message-ID: <1423544566.80968.9.camel@freebsd.org> Subject: Re: svn commit: r278494 - head/sys/kern From: Ian Lepore To: Rui Paulo Date: Mon, 09 Feb 2015 22:02:46 -0700 In-Reply-To: <7FCF7F90-C1B2-4C1C-8781-F89F8519D47E@me.com> References: <201502100434.t1A4YeLr052513@svn.freebsd.org> <7FCF7F90-C1B2-4C1C-8781-F89F8519D47E@me.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 06:02:38 -0000 On Mon, 2015-02-09 at 20:46 -0800, Rui Paulo wrote: > On Feb 9, 2015, at 20:34, Rui Paulo wrote: > > > > Author: rpaulo > > Date: Tue Feb 10 04:34:39 2015 > > New Revision: 278494 > > URL: https://svnweb.freebsd.org/changeset/base/278494 > > > > Log: > > Sanitise the coredump file names sent to devd. > > > > While there, add a sysctl to turn this feature off as requested by > > kib@. > > I wanted to get the sanitiser code in ASAP, but, as suggested by stas@ offline, we think devd should also provide an action mode that runs a command outside sh(1) and without using $PATH. > > -- > Rui Paulo > > > > > Or... we could consider restoring devd to its original relatively benign existance handling device-related events, and move handling of crash dumps into a separate daemon which can shoulder the burden of security for itself. At $work we listen to the devd re-distribute port to handle device events in our apps, and having an ever-growing flood of stuff that's got nothing to do with devices is going to have a negative impact on applications that do such things. -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 06:13:33 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFBA9487; Tue, 10 Feb 2015 06:13:33 +0000 (UTC) Received: from lakerest.net (lakerest.net [162.235.35.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lakerest.net", Issuer "Stewart" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8509886C; Tue, 10 Feb 2015 06:13:33 +0000 (UTC) Received: from rrss-MacBook-Air.local (173.64-138-239-net.sccoast.net [64.138.239.173]) (authenticated bits=0) by lakerest.net (8.14.4/8.14.3) with ESMTP id t1A639K8009747 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 10 Feb 2015 01:03:10 -0500 (EST) (envelope-from rrs@freebsd.org) Message-ID: <54D9A15D.3030107@freebsd.org> Date: Tue, 10 Feb 2015 01:12:45 -0500 From: randall User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Peter Holm Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 References: <201502091928.t19JSC5P066293@svn.freebsd.org> <20150209204111.GA47080@x2.osted.lan> In-Reply-To: <20150209204111.GA47080@x2.osted.lan> Content-Type: text/plain; charset=windows-1252; format=flowed 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 06:13:33 -0000 Peter: I am not sure what you mean.. :-) The in6_lltable_lookup() is right at the line where the code has done: LLE_WLOCK(lle); lle->la_flags |= LLE_DELETED;<----- Now without seeing the registers and having a bit more details I can't say. My guess is lle is NULL or 0xdeadcode.. If so this may be a different reference counting bug. R On 2/9/15 3:41 PM, Peter Holm wrote: > > Could this be yours? > > db:0:pho> bt > Tracing pid 9629 tid 100639 td 0xfffff8011cce14a0 > in6_lltable_lookup() at in6_lltable_lookup+0x11a/frame > 0xfffffe081e426200 > nd6_output() at nd6_output+0x15d/frame 0xfffffe081e426290 > ip6_output() at ip6_output+0x2128/frame 0xfffffe081e426790 > tcp_output() at tcp_output+0x2dae/frame 0xfffffe081e426c30 > tcp_usr_send() at tcp_usr_send+0x2fe/frame 0xfffffe081e426cb0 > sosend_generic() at sosend_generic+0x414/frame 0xfffffe081e426d60 > clnt_vc_call() at clnt_vc_call+0x477/frame 0xfffffe081e426ec0 > clnt_reconnect_call() at clnt_reconnect_call+0x46c/frame > 0xfffffe081e426f70 > newnfs_request() at newnfs_request+0x9ba/frame 0xfffffe081e4270d0 > nfscl_request() at nfscl_request+0x72/frame 0xfffffe081e427120 > nfsrpc_lookup() at nfsrpc_lookup+0x213/frame 0xfffffe081e4272a0 > nfs_lookup() at nfs_lookup+0x467/frame 0xfffffe081e4275c0 > VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0x10f/frame 0xfffffe081e4275f0 > lookup() at lookup+0x5d5/frame 0xfffffe081e427680 > namei() at namei+0x536/frame 0xfffffe081e427740 > kern_statat() at kern_statat+0xae/frame 0xfffffe081e427900 > sys_fstatat() at sys_fstatat+0x2c/frame 0xfffffe081e4279a0 > amd64_syscall() at amd64_syscall+0x29c/frame 0xfffffe081e427ab0 > > http://people.freebsd.org/~pho/stress/log/rrs003.txt > > - Peter > > From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 06:35:19 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38E5F999; Tue, 10 Feb 2015 06:35: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A751A18; Tue, 10 Feb 2015 06:35:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1A6ZIUw007443; Tue, 10 Feb 2015 06:35:18 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1A6ZHuN007429; Tue, 10 Feb 2015 06:35:17 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502100635.t1A6ZHuN007429@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 10 Feb 2015 06:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278495 - in head/sys: conf powerpc/aim powerpc/conf powerpc/ofw powerpc/wii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 06:35:19 -0000 Author: rpaulo Date: Tue Feb 10 06:35:16 2015 New Revision: 278495 URL: https://svnweb.freebsd.org/changeset/base/278495 Log: Remove FreeBSD/wii. This port failed to gain traction and probably only a couple Wii consoles ran FreeBSD all the way to single user mode with an md(4). IPC support was never implemented, so it was impossible to use any peripheral Any further development, if any, will happen at https://github.com/rpaulo/wii. Discussed with: nathanw (a long time ago), jhibbits Deleted: head/sys/powerpc/conf/WII head/sys/powerpc/wii/ Modified: head/sys/conf/files.powerpc head/sys/conf/options.powerpc head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/conf/NOTES head/sys/powerpc/ofw/ofw_syscons.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Feb 10 04:34:39 2015 (r278494) +++ head/sys/conf/files.powerpc Tue Feb 10 06:35:16 2015 (r278495) @@ -242,9 +242,3 @@ powerpc/psim/iobus.c optional psim powerpc/psim/ata_iobus.c optional ata psim powerpc/psim/openpic_iobus.c optional psim powerpc/psim/uart_iobus.c optional uart psim -powerpc/wii/platform_wii.c optional wii -powerpc/wii/wii_bus.c optional wii -powerpc/wii/wii_pic.c optional wii -powerpc/wii/wii_fb.c optional wii -powerpc/wii/wii_gpio.c optional wii wiigpio -powerpc/wii/wii_ipc.c optional wii Modified: head/sys/conf/options.powerpc ============================================================================== --- head/sys/conf/options.powerpc Tue Feb 10 04:34:39 2015 (r278494) +++ head/sys/conf/options.powerpc Tue Feb 10 06:35:16 2015 (r278495) @@ -24,7 +24,6 @@ PS3 opt_platform.h MAMBO PSERIES PSIM -WII opt_platform.h SC_OFWFB opt_ofwfb.h Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Tue Feb 10 04:34:39 2015 (r278494) +++ head/sys/powerpc/aim/locore32.S Tue Feb 10 06:35:16 2015 (r278495) @@ -118,9 +118,7 @@ __start: bdnz 1b sync isync -#ifdef WII -#include -#endif + /* Zero bss, in case we were started by something unhelpful */ li 0,0 lis 8,_edata@ha Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Tue Feb 10 04:34:39 2015 (r278494) +++ head/sys/powerpc/aim/machdep.c Tue Feb 10 06:35:16 2015 (r278495) @@ -260,9 +260,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_ void *kmdp; char *env; register_t msr, scratch; -#ifdef WII - register_t vers; -#endif uint8_t *cache_check; int cacheline_warn; #ifndef __powerpc64__ @@ -281,16 +278,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_ startkernel = __startkernel; endkernel = __endkernel; -#ifdef WII - /* - * The Wii loader doesn't pass us any environment so, mdp - * points to garbage at this point. The Wii CPU is a 750CL. - */ - vers = mfpvr(); - if ((vers & 0xfffff0e0) == (MPC750 << 16 | MPC750CL)) - mdp = NULL; -#endif - /* Check for ePAPR loader, which puts a magic value into r6 */ if (mdp == (void *)0x65504150) mdp = NULL; @@ -513,13 +500,13 @@ powerpc_init(vm_offset_t fdt, vm_offset_ */ trap_offset += (size_t)&restorebridgesize; - bcopy(&restorebridge, (void *)EXC_RST, trap_offset); - bcopy(&restorebridge, (void *)EXC_DSI, trap_offset); - bcopy(&restorebridge, (void *)EXC_ALI, trap_offset); - bcopy(&restorebridge, (void *)EXC_PGM, trap_offset); - bcopy(&restorebridge, (void *)EXC_MCHK, trap_offset); - bcopy(&restorebridge, (void *)EXC_TRC, trap_offset); - bcopy(&restorebridge, (void *)EXC_BPT, trap_offset); + bcopy(&restorebridge, (void *)EXC_RST, trap_offset); + bcopy(&restorebridge, (void *)EXC_DSI, trap_offset); + bcopy(&restorebridge, (void *)EXC_ALI, trap_offset); + bcopy(&restorebridge, (void *)EXC_PGM, trap_offset); + bcopy(&restorebridge, (void *)EXC_MCHK, trap_offset); + bcopy(&restorebridge, (void *)EXC_TRC, trap_offset); + bcopy(&restorebridge, (void *)EXC_BPT, trap_offset); } #endif @@ -560,7 +547,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ * Restore MSR */ mtmsr(msr); - + /* Warn if cachline size was not determined */ if (cacheline_warn == 1) { printf("WARNING: cacheline size undetermined, setting to 32\n"); @@ -569,7 +556,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ /* * Choose a platform module so we can get the physical memory map. */ - + platform_probe_and_attach(); /* @@ -698,7 +685,7 @@ int ptrace_single_step(struct thread *td) { struct trapframe *tf; - + tf = td->td_frame; tf->srr1 |= PSL_SE; @@ -789,7 +776,7 @@ db_trap_glue(struct trapframe *frame) int type = frame->exc; /* Ignore DTrace traps. */ - if (*(uint32_t *)frame->srr0 == EXC_DTRACE) + if (*(uint32_t *)frame->srr0 == EXC_DTRACE) return (0); if (type == EXC_PGM && (frame->srr1 & 0x20000)) { type = T_BREAKPOINT; Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Tue Feb 10 04:34:39 2015 (r278494) +++ head/sys/powerpc/aim/mmu_oea.c Tue Feb 10 06:35:16 2015 (r278495) @@ -420,7 +420,7 @@ static void tlbia(void) { vm_offset_t va; - + for (va = 0; va < 0x00040000; va += 0x00001000) { __asm __volatile("tlbie %0" :: "r"(va)); powerpc_sync(); @@ -623,17 +623,8 @@ moea_cpu_bootstrap(mmu_t mmup, int ap) isync(); } -#ifdef WII - /* - * Special case for the Wii: don't install the PCI BAT. - */ - if (strcmp(installed_platform(), "wii") != 0) { -#endif - __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); - __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); -#ifdef WII - } -#endif + __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); + __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); isync(); __asm __volatile("mtibatu 1,%0" :: "r"(0)); @@ -706,15 +697,9 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k :: "r"(battable[0].batu), "r"(battable[0].batl)); mtmsr(msr); -#ifdef WII - if (strcmp(installed_platform(), "wii") != 0) { -#endif - /* map pci space */ - __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); - __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); -#ifdef WII - } -#endif + /* map pci space */ + __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); + __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); isync(); /* set global direct map flag */ @@ -885,7 +870,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k */ chosen = OF_finddevice("/chosen"); if (chosen != -1 && OF_getprop(chosen, "mmu", &mmui, 4) != -1 && - (mmu = OF_instance_to_package(mmui)) != -1 && + (mmu = OF_instance_to_package(mmui)) != -1 && (sz = OF_getproplen(mmu, "translations")) != -1) { translations = NULL; for (i = 0; phys_avail[i] != 0; i += 2) { @@ -917,7 +902,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k /* Enter the pages */ for (off = 0; off < translations[i].om_len; off += PAGE_SIZE) - moea_kenter(mmup, translations[i].om_va + off, + moea_kenter(mmup, translations[i].om_va + off, translations[i].om_pa + off); } } @@ -1488,7 +1473,7 @@ void moea_kenter_attr(mmu_t mmu, vm_offset_t va, vm_offset_t pa, vm_memattr_t ma) { u_int pte_lo; - int error; + int error; #if 0 if (va < VM_MIN_KERNEL_ADDRESS) @@ -1637,7 +1622,7 @@ moea_pinit(mmu_t mmu, pmap_t pmap) == NULL) { pmap->pmap_phys = pmap; } - + mtx_lock(&moea_vsid_mutex); /* @@ -1782,7 +1767,7 @@ void moea_release(mmu_t mmu, pmap_t pmap) { int idx, mask; - + /* * Free segment register's VSID */ @@ -1957,7 +1942,7 @@ moea_pvo_enter(pmap_t pm, uma_zone_t zon } else { if (moea_bpvo_pool_index >= BPVO_POOL_SIZE) { panic("moea_enter: bpvo pool exhausted, %d, %d, %d", - moea_bpvo_pool_index, BPVO_POOL_SIZE, + moea_bpvo_pool_index, BPVO_POOL_SIZE, BPVO_POOL_SIZE * sizeof(struct pvo_entry)); } pvo = &moea_bpvo_pool[moea_bpvo_pool_index]; @@ -2307,7 +2292,7 @@ moea_pte_spillable_ident(u_int ptegidx) if (!(pt->pte_lo & PTE_REF)) return (pvo_walk); } - + return (pvo); } @@ -2504,7 +2489,7 @@ moea_bat_mapped(int idx, vm_offset_t pa, */ prot = battable[idx].batl & (BAT_I|BAT_G|BAT_PP_RW); if (prot != (BAT_I|BAT_G|BAT_PP_RW)) - return (EPERM); + return (EPERM); /* * The address should be within the BAT range. Assume that the @@ -2527,7 +2512,7 @@ moea_dev_direct_mapped(mmu_t mmu, vm_pad int i; /* - * This currently does not work for entries that + * This currently does not work for entries that * overlap 256M BAT segments. */ @@ -2560,7 +2545,7 @@ moea_mapdev_attr(mmu_t mmu, vm_offset_t ppa = trunc_page(pa); offset = pa & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); - + /* * If the physical address lies within a valid BAT table entry, * return the 1:1 mapping. This currently doesn't work Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Tue Feb 10 04:34:39 2015 (r278494) +++ head/sys/powerpc/conf/NOTES Tue Feb 10 06:35:16 2015 (r278495) @@ -24,7 +24,6 @@ options POWERMAC #NewWorld Apple Power #options PS3 #Sony Playstation 3 options PSIM #GDB PSIM ppc simulator options MAMBO #IBM Mambo Full System Simulator -#options WII #Nintendo Wii options SC_OFWFB # OFW frame buffer Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Tue Feb 10 04:34:39 2015 (r278494) +++ head/sys/powerpc/ofw/ofw_syscons.c Tue Feb 10 06:35:16 2015 (r278495) @@ -412,7 +412,7 @@ ofwfb_init(int unit, video_adapter_t *ad adp->va_window = (vm_offset_t) ofwfb_static_window; /* - * Enable future font-loading and flag color support, as well as + * Enable future font-loading and flag color support, as well as * adding V_ADP_MODECHANGE so that we ofwfb_set_mode() gets called * when the X server shuts down. This enables us to get the console * back when X disappears. @@ -874,7 +874,7 @@ ofwfb_putc32(video_adapter_t *adp, vm_of addr = (uint32_t *)sc->sc_addr + (row + sc->sc_ymargin)*(sc->sc_stride/4) + col + sc->sc_xmargin; - + fg = ofwfb_pix32(sc, ofwfb_foreground(a)); bg = ofwfb_pix32(sc, ofwfb_background(a)); @@ -1000,12 +1000,6 @@ ofwfb_scidentify(driver_t *driver, devic device_t child; /* - * The Nintendo Wii doesn't have open firmware, so don't probe ofwfb - * because otherwise we will crash. - */ - if (strcmp(installed_platform(), "wii") == 0) - return; - /* * Add with a priority guaranteed to make it last on * the device list */ @@ -1019,7 +1013,7 @@ ofwfb_scprobe(device_t dev) device_set_desc(dev, "System console"); - error = sc_probe_unit(device_get_unit(dev), + error = sc_probe_unit(device_get_unit(dev), device_get_flags(dev) | SC_AUTODETECT_KBD); if (error != 0) return (error); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 08:15:52 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55B799F4; Tue, 10 Feb 2015 08:15:52 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA98C616; Tue, 10 Feb 2015 08:15:51 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t1A8FcfJ037688 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Feb 2015 10:15:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t1A8FcfJ037688 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t1A8Fcvw037686; Tue, 10 Feb 2015 10:15:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Feb 2015 10:15:38 +0200 From: Konstantin Belousov To: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Message-ID: <20150210081538.GK42409@kib.kiev.ua> References: <201502092313.t19NDpoS083043@svn.freebsd.org> <20150209232826.GJ42409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 08:15:52 -0000 On Mon, Feb 09, 2015 at 06:35:55PM -0800, Rui Paulo wrote: > On Feb 9, 2015, at 15:28, Konstantin Belousov wrote: > > Arguably, there should be a knob, probably sysctl, to turn the > > functionality off. I definitely do not want this on crash boxes used for > > userspace debugging. Even despite the example handler is inactive. > > OK, I can provide a sysctl knob. Seen that, thanks. > > >> + len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1; > > It is much cleaner to use static const char arrays for the names, > > and use sizeof() - 1 instead of hard-coding commented constants. > > OK. I was trying to avoid allocating >2k on the stack. Probably I was not clear enough. I do not suggest to change data allocation from malloc to automatic. I mean static const char comm_name[] = "comm="; and then use sizeof(comm_name) - 1 and comm_name instead of string literal. > > >> + data = malloc(len, M_TEMP, M_NOWAIT); > > Why is this allocation M_NOWAIT ? > > That should be M_WAITOK. > > >> + freepath = NULL; > >> + } > >> + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) > >> + goto out; > >> + snprintf(data, len, "%s core=%s", data, fullpath); > > This is weird, and highly depends on the implementation details, supplying > > the same string as target and source. IMO strcat(9) is enough there. > > OK, I'll change it to strcat. > > -- > Rui Paulo > > From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 08:32:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAAAAC74; Tue, 10 Feb 2015 08:32:28 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 327D382A; Tue, 10 Feb 2015 08:32:28 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t1A8WM9x041393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Feb 2015 10:32:22 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t1A8WM9x041393 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t1A8WMxt041392; Tue, 10 Feb 2015 10:32:22 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Feb 2015 10:32:22 +0200 From: Konstantin Belousov To: Rui Paulo Subject: Re: svn commit: r278494 - head/sys/kern Message-ID: <20150210083222.GL42409@kib.kiev.ua> References: <201502100434.t1A4YeLr052513@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502100434.t1A4YeLr052513@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 08:32:28 -0000 On Tue, Feb 10, 2015 at 04:34:40AM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Tue Feb 10 04:34:39 2015 > New Revision: 278494 > URL: https://svnweb.freebsd.org/changeset/base/278494 > > Log: > Sanitise the coredump file names sent to devd. > > While there, add a sysctl to turn this feature off as requested by > kib@. > > Modified: > head/sys/kern/kern_sig.c > > Modified: head/sys/kern/kern_sig.c > ============================================================================== > --- head/sys/kern/kern_sig.c Tue Feb 10 03:34:42 2015 (r278493) > +++ head/sys/kern/kern_sig.c Tue Feb 10 04:34:39 2015 (r278494) > @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); > #include "opt_core.h" > > #include > +#include > #include > #include > #include > @@ -179,6 +180,10 @@ static int set_core_nodump_flag = 0; > SYSCTL_INT(_kern, OID_AUTO, nodump_coredump, CTLFLAG_RW, &set_core_nodump_flag, > 0, "Enable setting the NODUMP flag on coredump files"); > > +static int coredump_devctl = 1; > +SYSCTL_INT(_kern, OID_AUTO, coredump_devctl, CTLFLAG_RW, &coredump_devctl, > + 0, "Generate a devctl notification when processes coredump"); > + > /* > * Signal properties and actions. > * The array below categorizes the signals and their default actions > @@ -3217,6 +3222,25 @@ out: > return (0); > } > > +static int > +coredump_sanitise_path(const char *path) > +{ > + size_t len, i; > + > + /* > + * Only send a subset of ASCII to devd(8) because it > + * might pass these strings to sh -c. > + */ > + len = strlen(path); > + for (i = 0; i < len; i++) You may check for the nul byte, avoiding first iteration over the string. > + if (!(isalpha(path[i]) || isdigit(path[i])) && > + path[i] != '/' && path[i] != '.' && > + path[i] != '-') > + return (0); > + > + return (1); > +} > + > /* > * Dump a process' core. The main routine does some > * policy checking, and creates the name of the coredump; > @@ -3238,9 +3262,9 @@ coredump(struct thread *td) > void *rl_cookie; > off_t limit; > int compress; > - char *data = NULL; > - size_t len; > + char data[MAXPATHLEN * 2 + 16]; /* space for devctl notification */ As I explained in another mail, I did not suggested doing this. > char *fullpath, *freepath = NULL; > + size_t len; > > #ifdef COMPRESS_USER_CORES > compress = compress_user_cores; > @@ -3332,30 +3356,29 @@ close: > * Notify the userland helper that a process triggered a core dump. > * This allows the helper to run an automated debugging session. > */ > - len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1; > - data = malloc(len, M_TEMP, M_NOWAIT); > - if (data == NULL) > + if (coredump_devctl == 0) > goto out; > if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) > goto out; > - snprintf(data, len, "comm=%s", fullpath); > - if (freepath != NULL) { > - free(freepath, M_TEMP); > - freepath = NULL; > + if (!coredump_sanitise_path(fullpath)) > + goto out; > + snprintf(data, sizeof(data), "comm=%s ", fullpath); > + free(freepath, M_TEMP); > + freepath = NULL; > + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) { > + printf("could not find coredump\n"); This printf should be removed. > + goto out; > } > - if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) > + if (!coredump_sanitise_path(fullpath)) > goto out; > - snprintf(data, len, "%s core=%s", data, fullpath); > + strlcat(data, "core=", sizeof(data)); > + len = strlcat(data, fullpath, sizeof(data)); > devctl_notify("kernel", "signal", "coredump", data); > - free(name, M_TEMP); > out: > #ifdef AUDIT > audit_proc_coredump(td, name, error); > #endif > - if (freepath != NULL) > - free(freepath, M_TEMP); > - if (data != NULL) > - free(data, M_TEMP); > + free(freepath, M_TEMP); > free(name, M_TEMP); > return (error); > } And there is double-free somewhere. From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 10:01:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEEA6E2D; Tue, 10 Feb 2015 10:01:56 +0000 (UTC) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4362120F; Tue, 10 Feb 2015 10:01:56 +0000 (UTC) Received: by mail-wi0-f173.google.com with SMTP id bs8so10769911wib.0; Tue, 10 Feb 2015 02:01:54 -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=1yuF1+FFZvYBo1Lu1733g6FHvqyR9OQVXI2KvYiVlaI=; b=i8Ojgtnz/YcpBM/zeldHVv6ZfEEohV52JGI5MlZDM5XVH2Lsorcwh4K8aq4u4ehDOs E8evdVwJ7+G0mEsrTadDOi6NAuT9JP++nwQ4hmR+78DamgoXV/0Fs5gTPnigDB9h8YjK ME+K4+zC8bLSViR3UGfuA8PeiZ7pdbJThb3gjbbwKOXCF8GyPtiRFFg8DND39kFmn7g/ d4vTCTgtfZyRURI3FNHX+L50lk1Ch2egbtaBud+tVyAT4IShccVFQxuqa7OTMAE6uq5o F8JVUqK60eT9riOwim6IDKp4ZUbbpUvO7AlNYQVubNHDcpB893TF/QrA1DSOK9TU4AsL H8Yg== X-Received: by 10.180.103.7 with SMTP id fs7mr35554694wib.81.1423562514782; Tue, 10 Feb 2015 02:01:54 -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 qo10sm18498311wjc.38.2015.02.10.02.01.53 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 10 Feb 2015 02:01:53 -0800 (PST) Date: Tue, 10 Feb 2015 11:01:51 +0100 From: Mateusz Guzik To: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Message-ID: <20150210100151.GA5994@dft-labs.eu> References: <201502092313.t19NDpoS083043@svn.freebsd.org> <20150210024317.GA21779@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 10:01:56 -0000 On Mon, Feb 09, 2015 at 06:57:36PM -0800, Rui Paulo wrote: > On Feb 9, 2015, at 18:43, Mateusz Guzik wrote: > > > > On Mon, Feb 09, 2015 at 11:13:51PM +0000, Rui Paulo wrote: > >> +notify 10 { > >> + match "system" "kernel"; > >> + match "subsystem" "signal"; > >> + match "type" "coredump"; > >> + action "logger $comm $core"; > >> +}; > >> + > >> */ > >> > > [..] > >> + if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) > >> + goto out; > >> + snprintf(data, len, "comm=%s", fullpath); > > > > I cannot test it right now, but it looks like immediate privilege > > escalation. > > > > Path is not sanitized in any way and devd passes it to 'sh -c'. > > > > So a file named "a.out; /bin/id; meh" or so should result in execution > > of aforementioned /bin/id. > > Well, you can't have a file name with "/" but you're right. > I mean the whole path. You are resolving the name along with all dirs, so it's just a matter of some mkdirs. > > Another note is that currently devctl is record oriented, but this may > > change at some point and free form userspace text could be used to forge > > new events. > > > > As such is trongly suggest we sanitize this somehow. Maybe a base64 or > > something. > > I was trying hard to avoid this issue in unpublished my crash helper, but I forgot that devd runs execl("sh -c", ....); :-( > > It might just be easier to inspect the path names and allow only [a-z][A-Z][0-9] and '/' before sending the devctl message. > I'm pretty sure sooner or later people will want something with a space, so I would prefer a reasonably complete solution. A hack like the one yu mention should suffice fr now though (with the addition of a dot). -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 11:31:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5434F306 for ; Tue, 10 Feb 2015 11:31:08 +0000 (UTC) Received: from relay02.pair.com (relay02.pair.com [209.68.5.16]) by mx1.freebsd.org (Postfix) with SMTP id E1D66DC6 for ; Tue, 10 Feb 2015 11:31:07 +0000 (UTC) Received: (qmail 64308 invoked from network); 10 Feb 2015 11:31:00 -0000 Received: from 188.182.139.176 (HELO x2.osted.lan) (188.182.139.176) by relay02.pair.com with SMTP; 10 Feb 2015 11:31:00 -0000 X-pair-Authenticated: 188.182.139.176 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id t1ABUwbE069606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Feb 2015 12:30:59 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id t1ABUwEv069605; Tue, 10 Feb 2015 12:30:58 +0100 (CET) (envelope-from pho) Date: Tue, 10 Feb 2015 12:30:58 +0100 From: Peter Holm To: randall Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 Message-ID: <20150210113058.GA67277@x2.osted.lan> References: <201502091928.t19JSC5P066293@svn.freebsd.org> <20150209204111.GA47080@x2.osted.lan> <54D9A15D.3030107@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54D9A15D.3030107@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 11:31:08 -0000 On Tue, Feb 10, 2015 at 01:12:45AM -0500, randall wrote: > Peter: > > I am not sure what you mean.. :-) > I just realized that the reported panic is in r278471. I'm not able to reproduce the problem with r278472. Sorry for having wasted your time! - Peter From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 11:37:33 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FA46503; Tue, 10 Feb 2015 11:37: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD00EAA; Tue, 10 Feb 2015 11:37:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1ABbWKP047325; Tue, 10 Feb 2015 11:37:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1ABbWAI047324; Tue, 10 Feb 2015 11:37:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201502101137.t1ABbWAI047324@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 Feb 2015 11:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278500 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 11:37:33 -0000 Author: mav Date: Tue Feb 10 11:37:32 2015 New Revision: 278500 URL: https://svnweb.freebsd.org/changeset/base/278500 Log: Do not abort already aborted tasks. This fixes abort of new tasks with the same tags as previously aborted, but still remaining on the queue. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Feb 10 07:56:14 2015 (r278499) +++ head/sys/cam/ctl/ctl.c Tue Feb 10 11:37:32 2015 (r278500) @@ -12286,64 +12286,57 @@ ctl_abort_task(union ctl_io *io) printf("%s\n", sbuf_data(&sb)); #endif - if ((xio->io_hdr.nexus.targ_port == io->io_hdr.nexus.targ_port) - && (xio->io_hdr.nexus.initid.id == - io->io_hdr.nexus.initid.id)) { - /* - * If the abort says that the task is untagged, the - * task in the queue must be untagged. Otherwise, - * we just check to see whether the tag numbers - * match. This is because the QLogic firmware - * doesn't pass back the tag type in an abort - * request. - */ + if ((xio->io_hdr.nexus.targ_port != io->io_hdr.nexus.targ_port) + || (xio->io_hdr.nexus.initid.id != io->io_hdr.nexus.initid.id) + || (xio->io_hdr.flags & CTL_FLAG_ABORT)) + continue; + + /* + * If the abort says that the task is untagged, the + * task in the queue must be untagged. Otherwise, + * we just check to see whether the tag numbers + * match. This is because the QLogic firmware + * doesn't pass back the tag type in an abort + * request. + */ #if 0 - if (((xio->scsiio.tag_type == CTL_TAG_UNTAGGED) - && (io->taskio.tag_type == CTL_TAG_UNTAGGED)) - || (xio->scsiio.tag_num == io->taskio.tag_num)) { + if (((xio->scsiio.tag_type == CTL_TAG_UNTAGGED) + && (io->taskio.tag_type == CTL_TAG_UNTAGGED)) + || (xio->scsiio.tag_num == io->taskio.tag_num)) { #endif - /* - * XXX KDM we've got problems with FC, because it - * doesn't send down a tag type with aborts. So we - * can only really go by the tag number... - * This may cause problems with parallel SCSI. - * Need to figure that out!! - */ - if (xio->scsiio.tag_num == io->taskio.tag_num) { - xio->io_hdr.flags |= CTL_FLAG_ABORT; - found = 1; - if ((io->io_hdr.flags & - CTL_FLAG_FROM_OTHER_SC) == 0 && - !(lun->flags & CTL_LUN_PRIMARY_SC)) { - union ctl_ha_msg msg_info; - - io->io_hdr.flags |= - CTL_FLAG_SENT_2OTHER_SC; - msg_info.hdr.nexus = io->io_hdr.nexus; - msg_info.task.task_action = - CTL_TASK_ABORT_TASK; - msg_info.task.tag_num = - io->taskio.tag_num; - msg_info.task.tag_type = - io->taskio.tag_type; - msg_info.hdr.msg_type = - CTL_MSG_MANAGE_TASKS; - msg_info.hdr.original_sc = NULL; - msg_info.hdr.serializing_sc = NULL; + /* + * XXX KDM we've got problems with FC, because it + * doesn't send down a tag type with aborts. So we + * can only really go by the tag number... + * This may cause problems with parallel SCSI. + * Need to figure that out!! + */ + if (xio->scsiio.tag_num == io->taskio.tag_num) { + xio->io_hdr.flags |= CTL_FLAG_ABORT; + found = 1; + if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) == 0 && + !(lun->flags & CTL_LUN_PRIMARY_SC)) { + union ctl_ha_msg msg_info; + + io->io_hdr.flags |= CTL_FLAG_SENT_2OTHER_SC; + msg_info.hdr.nexus = io->io_hdr.nexus; + msg_info.task.task_action = CTL_TASK_ABORT_TASK; + msg_info.task.tag_num = io->taskio.tag_num; + msg_info.task.tag_type = io->taskio.tag_type; + msg_info.hdr.msg_type = CTL_MSG_MANAGE_TASKS; + msg_info.hdr.original_sc = NULL; + msg_info.hdr.serializing_sc = NULL; #if 0 - printf("Sent Abort to other side\n"); + printf("Sent Abort to other side\n"); #endif - if (CTL_HA_STATUS_SUCCESS != - ctl_ha_msg_send(CTL_HA_CHAN_CTL, - (void *)&msg_info, - sizeof(msg_info), 0)) { - } + if (ctl_ha_msg_send(CTL_HA_CHAN_CTL, + (void *)&msg_info, sizeof(msg_info), 0) != + CTL_HA_STATUS_SUCCESS) { } + } #if 0 - printf("ctl_abort_task: found I/O to abort\n"); + printf("ctl_abort_task: found I/O to abort\n"); #endif - break; - } } } mtx_unlock(&lun->lun_lock); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 12:04:39 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71C1AB4B; Tue, 10 Feb 2015 12:04: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8BB1E4; Tue, 10 Feb 2015 12:04:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AC4dwj061019; Tue, 10 Feb 2015 12:04:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AC4dHJ061018; Tue, 10 Feb 2015 12:04:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502101204.t1AC4dHJ061018@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 Feb 2015 12:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278502 - 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 12:04:39 -0000 Author: gjb Date: Tue Feb 10 12:04:38 2015 New Revision: 278502 URL: https://svnweb.freebsd.org/changeset/base/278502 Log: In scripts/mk-vmimage.sh, prevent incorrect usage() by defaulting VMCONFIG to /dev/null, and additionally ensuring VMCONFIG is not a character device before it is sourced. While here, be sure to exit if usage() is called. This should effectively be no-op, but the usage() output was discovered while investigating a larger issue. MFC after: 1 week X-MFC-with: r277458, r277536, r277606, r277609, r277836, r278118, r278119, r278206 Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/mk-vmimage.sh Modified: head/release/scripts/mk-vmimage.sh ============================================================================== --- head/release/scripts/mk-vmimage.sh Tue Feb 10 11:47:03 2015 (r278501) +++ head/release/scripts/mk-vmimage.sh Tue Feb 10 12:04:38 2015 (r278502) @@ -40,6 +40,7 @@ usage() { main() { local arg + VMCONFIG="/dev/null" while getopts "C:c:d:f:i:o:s:S:" arg; do case "${arg}" in C) @@ -76,10 +77,9 @@ main() { -z "${WORLDDIR}" -o \ -z "${DESTDIR}" -o \ -z "${VMSIZE}" -o \ - -z "${VMIMAGE}" -o \ - -z "${VMCONFIG}" ]; + -z "${VMIMAGE}" ]; then - usage + usage || exit 0 fi if [ -z "${VMBUILDCONF}" ] || [ ! -e "${VMBUILDCONF}" ]; then @@ -89,7 +89,7 @@ main() { . "${VMBUILDCONF}" - if [ ! -z "${VMCONFIG}" ] && [ -e "${VMCONFIG}" ]; then + if [ ! -z "${VMCONFIG}" ] && [ ! -c "${VMCONFIG}" ]; then . "${VMCONFIG}" fi From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 12:08:53 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9690FCD3; Tue, 10 Feb 2015 12:08: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7493B216; Tue, 10 Feb 2015 12:08:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AC8rlE061563; Tue, 10 Feb 2015 12:08:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AC8ruq061561; Tue, 10 Feb 2015 12:08:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502101208.t1AC8ruq061561@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Feb 2015 12:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278503 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 12:08:53 -0000 Author: hselasky Date: Tue Feb 10 12:08:52 2015 New Revision: 278503 URL: https://svnweb.freebsd.org/changeset/base/278503 Log: Revert r274918 and make a better solution. Poll the synchronisation endpoint less frequently to make the sample rate adjustment more accurate. This should resolve problems with the DN32-USB module for Midas audio systems and possibly other similar products from Klark Teknik. MFC after: 3 days Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Tue Feb 10 12:04:38 2015 (r278502) +++ head/sys/dev/sound/usb/uaudio.c Tue Feb 10 12:08:52 2015 (r278503) @@ -111,6 +111,7 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def &uaudio_default_channels, 0, "uaudio default sample channels"); #endif +#define UAUDIO_IRQS (8000 / UAUDIO_NFRAMES) /* interrupts per second */ #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ #define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ #define UAUDIO_RECURSE_LIMIT 255 /* rounds */ @@ -189,7 +190,6 @@ struct uaudio_chan_alt { uint8_t iface_index; uint8_t iface_alt_index; uint8_t channels; - uint8_t enable_sync; }; struct uaudio_chan { @@ -226,11 +226,12 @@ struct uaudio_chan { #define CHAN_OP_STOP 2 #define CHAN_OP_DRAIN 3 - uint8_t last_sync_time; - uint8_t last_sync_state; -#define UAUDIO_SYNC_NONE 0 -#define UAUDIO_SYNC_MORE 1 -#define UAUDIO_SYNC_LESS 2 + /* USB audio feedback endpoint state */ + struct { + uint16_t time; /* I/O interrupt count */ + int16_t constant; /* sample rate adjustment in Hz */ + int16_t remainder; /* current remainder */ + } feedback; }; #define UMIDI_EMB_JACK_MAX 16 /* units */ @@ -1799,14 +1800,6 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; - if (UEP_HAS_SYNCADDR(ed1) && ed1->bSynchAddress != 0) { - DPRINTF("Sync endpoint will be used, if present\n"); - chan_alt->enable_sync = 1; - } else { - DPRINTF("Sync endpoint will not be used\n"); - chan_alt->enable_sync = 0; - } - usbd_set_parent_iface(sc->sc_udev, curidx, sc->sc_mixer_iface_index); @@ -2016,29 +2009,44 @@ uaudio_chan_play_sync_callback(struct us if (temp == 0) break; - /* correctly scale value */ - - temp = (temp * 125ULL) - 64; + temp *= 125ULL; /* auto adjust */ - while (temp < (sample_rate - (sample_rate / 4))) temp *= 2; - + while (temp > (sample_rate + (sample_rate / 2))) temp /= 2; - /* compare */ + /* + * Some USB audio devices only report a sample rate + * different from the nominal one when they want one + * more or less sample. Make sure we catch this case + * by pulling the sample rate offset slowly towards + * zero if the reported value is equal to the sample + * rate. + */ + if (temp > sample_rate) + ch->feedback.constant += 1; + else if (temp < sample_rate) + ch->feedback.constant -= 1; + else if (ch->feedback.constant > 0) + ch->feedback.constant--; + else if (ch->feedback.constant < 0) + ch->feedback.constant++; - DPRINTF("Comparing %d < %d\n", - (int)temp, (int)sample_rate); + DPRINTF("Comparing %d Hz :: %d Hz :: %d samples drift\n", + (int)temp, (int)sample_rate, (int)ch->feedback.constant); - if (temp == sample_rate) - ch->last_sync_state = UAUDIO_SYNC_NONE; - else if (temp > sample_rate) - ch->last_sync_state = UAUDIO_SYNC_MORE; - else - ch->last_sync_state = UAUDIO_SYNC_LESS; + /* + * Range check sync constant. We cannot change the + * number of samples per second by more than the value + * defined by "UAUDIO_IRQS": + */ + if (ch->feedback.constant > UAUDIO_IRQS) + ch->feedback.constant = UAUDIO_IRQS; + else if (ch->feedback.constant < -UAUDIO_IRQS) + ch->feedback.constant = -UAUDIO_IRQS; break; case USB_ST_SETUP: @@ -2082,10 +2090,10 @@ tr_transferred: } chn_intr(ch->pcm_ch); - /* start SYNC transfer, if any */ - if (ch->usb_alt[ch->cur_alt].enable_sync != 0) { - if ((ch->last_sync_time++ & 7) == 0) - usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + /* start the SYNC transfer one time per second, if any */ + if (++(ch->feedback.time) >= UAUDIO_IRQS) { + ch->feedback.time = 0; + usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); } case USB_ST_SETUP: @@ -2120,21 +2128,22 @@ tr_transferred: } if (n == (blockcount - 1)) { - switch (ch->last_sync_state) { - case UAUDIO_SYNC_MORE: + /* + * Update sync remainder and check if + * we should transmit more or less + * data: + */ + ch->feedback.remainder += ch->feedback.constant; + if (ch->feedback.remainder >= UAUDIO_IRQS) { + ch->feedback.remainder -= UAUDIO_IRQS; DPRINTFN(6, "sending one sample more\n"); if ((frame_len + sample_size) <= mfl) frame_len += sample_size; - ch->last_sync_state = UAUDIO_SYNC_NONE; - break; - case UAUDIO_SYNC_LESS: + } else if (ch->feedback.remainder <= -UAUDIO_IRQS) { + ch->feedback.remainder += UAUDIO_IRQS; DPRINTFN(6, "sending one sample less\n"); if (frame_len >= sample_size) frame_len -= sample_size; - ch->last_sync_state = UAUDIO_SYNC_NONE; - break; - default: - break; } } @@ -2452,6 +2461,9 @@ uaudio_chan_start(struct uaudio_chan *ch } usb_proc_explore_unlock(sc->sc_udev); + /* reset feedback endpoint state */ + memset(&ch->feedback, 0, sizeof(ch->feedback)); + if (do_start) { usbd_transfer_start(ch->xfer[0]); usbd_transfer_start(ch->xfer[1]); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 12:38:39 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF037700; Tue, 10 Feb 2015 12:38: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA7A6827; Tue, 10 Feb 2015 12:38:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1ACcd8i076097; Tue, 10 Feb 2015 12:38:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1ACcdE7076096; Tue, 10 Feb 2015 12:38:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502101238.t1ACcdE7076096@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 Feb 2015 12:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278505 - 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 12:38:40 -0000 Author: gjb Date: Tue Feb 10 12:38:39 2015 New Revision: 278505 URL: https://svnweb.freebsd.org/changeset/base/278505 Log: Bump copyright, forgotten in r278502. MFC after: 1 week X-MFC-with: r277458, r277536, r277606, r277609, r277836, r278118, r278119, r278206, r278502 Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/mk-vmimage.sh Modified: head/release/scripts/mk-vmimage.sh ============================================================================== --- head/release/scripts/mk-vmimage.sh Tue Feb 10 12:35:07 2015 (r278504) +++ head/release/scripts/mk-vmimage.sh Tue Feb 10 12:38:39 2015 (r278505) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2014 The FreeBSD Foundation +# Copyright (c) 2014, 2015 The FreeBSD Foundation # All rights reserved. # # This software was developed by Glen Barber under sponsorship From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 13:07:09 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FB57E10; Tue, 10 Feb 2015 13:07: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B142AE2; Tue, 10 Feb 2015 13:07:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AD79KS090254; Tue, 10 Feb 2015 13:07:09 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AD79k8090253; Tue, 10 Feb 2015 13:07:09 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201502101307.t1AD79k8090253@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 10 Feb 2015 13:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278506 - 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 13:07:09 -0000 Author: royger Date: Tue Feb 10 13:07:08 2015 New Revision: 278506 URL: https://svnweb.freebsd.org/changeset/base/278506 Log: rc.d: load the network config file for netif r272959 broke compatibility with mfsBSD that stores the default network config file in /etc/rc.conf.d/network. In order to fix that load the network config file from netif also. Modified: head/etc/rc.d/netif Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Tue Feb 10 12:38:39 2015 (r278505) +++ head/etc/rc.d/netif Tue Feb 10 13:07:08 2015 (r278506) @@ -252,5 +252,8 @@ netif_common() debug "The following interfaces were not configured: $_fail" } +# Load the old "network" config file also for compatibility. +# This is needed for mfsBSD at least. +load_rc_config network load_rc_config $name run_rc_command $* From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 14:11:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 216F0913; Tue, 10 Feb 2015 14:11: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 022C12CC; Tue, 10 Feb 2015 14:11:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AEBOUG023902; Tue, 10 Feb 2015 14:11:24 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AEBO27023898; Tue, 10 Feb 2015 14:11:24 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201502101411.t1AEBO27023898@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 10 Feb 2015 14:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278518 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 14:11:25 -0000 Author: zbb Date: Tue Feb 10 14:11:23 2015 New Revision: 278518 URL: https://svnweb.freebsd.org/changeset/base/278518 Log: Resolve cache line size from CP15 Switch the cache line size during invalidations/flushes to be read from CP15 cache type register. Submitted by: Wojciech Macek Reviewed by: ian, imp Obtained from: Semihalf Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/cpufunc_asm_armv7.S head/sys/arm/arm/elf_trampoline.c head/sys/arm/include/armreg.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Tue Feb 10 13:48:49 2015 (r278517) +++ head/sys/arm/arm/cpufunc.c Tue Feb 10 14:11:23 2015 (r278518) @@ -837,6 +837,11 @@ u_int cpu_reset_needs_v4_MMU_disable; /* defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ defined(CPU_CORTEXA) || defined(CPU_KRAIT) +/* Global cache line sizes, use 32 as default */ +int arm_dcache_min_line_size = 32; +int arm_icache_min_line_size = 32; +int arm_idcache_min_line_size = 32; + static void get_cachetype_cp15(void); /* Additional cache information local to this file. Log2 of some of the @@ -868,6 +873,12 @@ get_cachetype_cp15() goto out; if (CPU_CT_FORMAT(ctype) == CPU_CT_ARMV7) { + /* Resolve minimal cache line sizes */ + arm_dcache_min_line_size = 1 << (CPU_CT_DMINLINE(ctype) + 2); + arm_icache_min_line_size = 1 << (CPU_CT_IMINLINE(ctype) + 2); + arm_idcache_min_line_size = + min(arm_icache_min_line_size, arm_dcache_min_line_size); + __asm __volatile("mrc p15, 1, %0, c0, c0, 1" : "=r" (clevel)); arm_cache_level = clevel; Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Tue Feb 10 13:48:49 2015 (r278517) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Tue Feb 10 14:11:23 2015 (r278518) @@ -41,6 +41,12 @@ __FBSDID("$FreeBSD$"); .word _C_LABEL(arm_cache_loc) .Lcache_type: .word _C_LABEL(arm_cache_type) +.Larmv7_dcache_line_size: + .word _C_LABEL(arm_dcache_min_line_size) +.Larmv7_icache_line_size: + .word _C_LABEL(arm_icache_min_line_size) +.Larmv7_idcache_line_size: + .word _C_LABEL(arm_idcache_min_line_size) .Lway_mask: .word 0x3ff .Lmax_index: @@ -180,14 +186,9 @@ ENTRY(armv7_idcache_wbinv_all) RET END(armv7_idcache_wbinv_all) -/* XXX Temporary set it to 32 for MV cores, however this value should be - * get from Cache Type register - */ -.Larmv7_line_size: - .word 32 - ENTRY(armv7_dcache_wb_range) - ldr ip, .Larmv7_line_size + ldr ip, .Larmv7_dcache_line_size + ldr ip, [ip] sub r3, ip, #1 and r2, r0, r3 add r1, r1, r2 @@ -202,7 +203,8 @@ ENTRY(armv7_dcache_wb_range) END(armv7_dcache_wb_range) ENTRY(armv7_dcache_wbinv_range) - ldr ip, .Larmv7_line_size + ldr ip, .Larmv7_dcache_line_size + ldr ip, [ip] sub r3, ip, #1 and r2, r0, r3 add r1, r1, r2 @@ -221,7 +223,8 @@ END(armv7_dcache_wbinv_range) * must use wb-inv of the entire cache. */ ENTRY(armv7_dcache_inv_range) - ldr ip, .Larmv7_line_size + ldr ip, .Larmv7_dcache_line_size + ldr ip, [ip] sub r3, ip, #1 and r2, r0, r3 add r1, r1, r2 @@ -236,7 +239,8 @@ ENTRY(armv7_dcache_inv_range) END(armv7_dcache_inv_range) ENTRY(armv7_idcache_wbinv_range) - ldr ip, .Larmv7_line_size + ldr ip, .Larmv7_idcache_line_size + ldr ip, [ip] sub r3, ip, #1 and r2, r0, r3 add r1, r1, r2 @@ -264,7 +268,8 @@ ENTRY_NP(armv7_icache_sync_all) END(armv7_icache_sync_all) ENTRY_NP(armv7_icache_sync_range) - ldr ip, .Larmv7_line_size + ldr ip, .Larmv7_icache_line_size + ldr ip, [ip] .Larmv7_sync_next: mcr CP15_ICIMVAU(r0) mcr CP15_DCCMVAC(r0) Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Tue Feb 10 13:48:49 2015 (r278517) +++ head/sys/arm/arm/elf_trampoline.c Tue Feb 10 14:11:23 2015 (r278518) @@ -115,6 +115,10 @@ int arm_pcache_unified; int arm_dcache_align; int arm_dcache_align_mask; +int arm_dcache_min_line_size = 32; +int arm_icache_min_line_size = 32; +int arm_idcache_min_line_size = 32; + u_int arm_cache_level; u_int arm_cache_type[14]; u_int arm_cache_loc; @@ -277,6 +281,13 @@ get_cachetype_cp15() goto out; if (CPU_CT_FORMAT(ctype) == CPU_CT_ARMV7) { + /* Resolve minimal cache line sizes */ + arm_dcache_min_line_size = 1 << (CPU_CT_DMINLINE(ctype) + 2); + arm_icache_min_line_size = 1 << (CPU_CT_IMINLINE(ctype) + 2); + arm_idcache_min_line_size = + (arm_dcache_min_line_size > arm_icache_min_line_size ? + arm_icache_min_line_size : arm_dcache_min_line_size); + __asm __volatile("mrc p15, 1, %0, c0, c0, 1" : "=r" (clevel)); arm_cache_level = clevel; Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Tue Feb 10 13:48:49 2015 (r278517) +++ head/sys/arm/include/armreg.h Tue Feb 10 14:11:23 2015 (r278518) @@ -320,6 +320,9 @@ #define CPU_CT_S (1U << 24) /* split cache */ #define CPU_CT_CTYPE(x) (((x) >> 25) & 0xf) /* cache type */ #define CPU_CT_FORMAT(x) ((x) >> 29) +/* Cache type register definitions for ARM v7 */ +#define CPU_CT_IMINLINE(x) ((x) & 0xf) /* I$ min line size */ +#define CPU_CT_DMINLINE(x) (((x) >> 16) & 0xf) /* D$ min line size */ #define CPU_CT_CTYPE_WT 0 /* write-through */ #define CPU_CT_CTYPE_WB1 1 /* write-back, clean w/ read */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 14:18:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 137A3B53; Tue, 10 Feb 2015 14:18:53 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF1D633D; Tue, 10 Feb 2015 14:18:52 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C43F4B91F; Tue, 10 Feb 2015 09:18:51 -0500 (EST) From: John Baldwin To: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Date: Tue, 10 Feb 2015 09:16:55 -0500 Message-ID: <1516483.e0EXgdk9ur@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201502092313.t19NDpoS083043@svn.freebsd.org> References: <201502092313.t19NDpoS083043@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 Feb 2015 09:18:51 -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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 14:18:53 -0000 On Monday, February 09, 2015 11:13:51 PM Rui Paulo wrote: > Author: rpaulo > Date: Mon Feb 9 23:13:50 2015 > New Revision: 278479 > URL: https://svnweb.freebsd.org/changeset/base/278479 > > Log: > Notify devd(8) when a process crashed. > > This change implements a notification (via devctl) to userland when > the kernel produces coredumps after a process has crashed. > devd can then run a specific command to produce a human readable crash > report. The command is most usually a helper that runs gdb/lldb > commands on the file/coredump pair. It's possible to use this > functionality for implementing automatic generation of crash reports. > > devd(8) will be notified of the full path of the binary that crashed and > the full path of the coredump file. I think this is a very useful feature and I think this is fine to be in the tree as-is for now. My only note is that this is a bit of feature creep for devd (this isn't a device notification, this is a system event notification). As such, I think it might be worth thinking if we (collectively) want to think about having a separate framework at all for system event notification. You could possibly publish other interesting events this way. For example, Isilon currently has a patch to log(9) Witness LORs. I personally think it's a bit hackish and potentially unreliable. A much nicer interface if you want to capture such things would be to publish an event for each logged LOR instead. Machine checks are another example of something that might be nice to publish (though you could possibly make the case that those would not be inappropriate to publish via devd since actual hardware is involved). Disk and PCI errors are another class of thing that it would be nice to publish in an easier to programmaticaly parse manner. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:06:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67289B0B; Tue, 10 Feb 2015 15:06:04 +0000 (UTC) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32920A17; Tue, 10 Feb 2015 15:06:04 +0000 (UTC) Received: by iecvy18 with SMTP id vy18so5849836iec.13; Tue, 10 Feb 2015 07:06:03 -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=ENAtZJ01tzIe+iDxlg2fuOO17ZJ77u3WuNchV3mF88M=; b=RtcDGtclkSu5MZ3Oflv81crJGIF7Y4tAQZs97iIi2xzVm1jGPMEL3GvozgV/78jEFk xv1L9Vdo8GMI03Z6RCsXTSkp35NkESbSoC8YPl7Vr3Ryh6t5mZBStu3B/ga+lf7EDHUk BazrEPIo+ibIdsvjCaxZEWXY52bTrBnuCnFMVywkpdUZl+FR59d8nGeu7nC1yXsv/WRw emzBCITG89bboJ2+I4gcXlgTqVskl2yBu1n+YeIASoP6WmnSH/D1zCQeHqk0uEEuNcBp eWTGlWfrEQ/no+EhxNLJ/f1HO9b5Fzcw1v9nrUfNKQGfeca+i+afFgHpVDltmx2Il5yG AZ+w== MIME-Version: 1.0 X-Received: by 10.50.93.70 with SMTP id cs6mr23380250igb.6.1423580763416; Tue, 10 Feb 2015 07:06:03 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.7 with HTTP; Tue, 10 Feb 2015 07:06:03 -0800 (PST) In-Reply-To: <1516483.e0EXgdk9ur@ralph.baldwin.cx> References: <201502092313.t19NDpoS083043@svn.freebsd.org> <1516483.e0EXgdk9ur@ralph.baldwin.cx> Date: Tue, 10 Feb 2015 07:06:03 -0800 X-Google-Sender-Auth: RLjUcxn0r4as2h-RCd1KabAsj_4 Message-ID: Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 15:06:04 -0000 On 10 February 2015 at 06:16, John Baldwin wrote: > On Monday, February 09, 2015 11:13:51 PM Rui Paulo wrote: >> Author: rpaulo >> Date: Mon Feb 9 23:13:50 2015 >> New Revision: 278479 >> URL: https://svnweb.freebsd.org/changeset/base/278479 >> >> Log: >> Notify devd(8) when a process crashed. >> >> This change implements a notification (via devctl) to userland when >> the kernel produces coredumps after a process has crashed. >> devd can then run a specific command to produce a human readable crash >> report. The command is most usually a helper that runs gdb/lldb >> commands on the file/coredump pair. It's possible to use this >> functionality for implementing automatic generation of crash reports. >> >> devd(8) will be notified of the full path of the binary that crashed and >> the full path of the coredump file. > > I think this is a very useful feature and I think this is fine to be in the > tree as-is for now. My only note is that this is a bit of feature creep for > devd (this isn't a device notification, this is a system event notification). > As such, I think it might be worth thinking if we (collectively) want to think > about having a separate framework at all for system event notification. You > could possibly publish other interesting events this way. For example, Isilon > currently has a patch to log(9) Witness LORs. I personally think it's a bit > hackish and potentially unreliable. A much nicer interface if you want to > capture such things would be to publish an event for each logged LOR instead. > Machine checks are another example of something that might be nice to publish > (though you could possibly make the case that those would not be inappropriate > to publish via devd since actual hardware is involved). Disk and PCI errors > are another class of thing that it would be nice to publish in an easier to > programmaticaly parse manner. Cool, so someone's going to add multi-subscriber support to /dev/devctl ? I think devd grows these things because it's easier than teaching the devctl interface to support multiple listeners. -adrian From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:13:01 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16C70D02; Tue, 10 Feb 2015 15:13:01 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0C84AE9; Tue, 10 Feb 2015 15:13:00 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YLCUe-000Hmi-11; Tue, 10 Feb 2015 18:12:52 +0300 Date: Tue, 10 Feb 2015 18:12:51 +0300 From: Slawa Olhovchenkov To: Adrian Chadd Subject: Re: svn commit: r278479 - in head: etc sys/kern Message-ID: <20150210151251.GA67127@zxy.spb.ru> References: <201502092313.t19NDpoS083043@svn.freebsd.org> <1516483.e0EXgdk9ur@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 15:13:01 -0000 On Tue, Feb 10, 2015 at 07:06:03AM -0800, Adrian Chadd wrote: > On 10 February 2015 at 06:16, John Baldwin wrote: > > On Monday, February 09, 2015 11:13:51 PM Rui Paulo wrote: > >> Author: rpaulo > >> Date: Mon Feb 9 23:13:50 2015 > >> New Revision: 278479 > >> URL: https://svnweb.freebsd.org/changeset/base/278479 > >> > >> Log: > >> Notify devd(8) when a process crashed. > >> > >> This change implements a notification (via devctl) to userland when > >> the kernel produces coredumps after a process has crashed. > >> devd can then run a specific command to produce a human readable crash > >> report. The command is most usually a helper that runs gdb/lldb > >> commands on the file/coredump pair. It's possible to use this > >> functionality for implementing automatic generation of crash reports. > >> > >> devd(8) will be notified of the full path of the binary that crashed and > >> the full path of the coredump file. > > > > I think this is a very useful feature and I think this is fine to be in the > > tree as-is for now. My only note is that this is a bit of feature creep for > > devd (this isn't a device notification, this is a system event notification). > > As such, I think it might be worth thinking if we (collectively) want to think > > about having a separate framework at all for system event notification. You > > could possibly publish other interesting events this way. For example, Isilon > > currently has a patch to log(9) Witness LORs. I personally think it's a bit > > hackish and potentially unreliable. A much nicer interface if you want to > > capture such things would be to publish an event for each logged LOR instead. > > Machine checks are another example of something that might be nice to publish > > (though you could possibly make the case that those would not be inappropriate > > to publish via devd since actual hardware is involved). Disk and PCI errors > > are another class of thing that it would be nice to publish in an easier to > > programmaticaly parse manner. > > Cool, so someone's going to add multi-subscriber support to /dev/devctl ? > > I think devd grows these things because it's easier than teaching the > devctl interface to support multiple listeners. /dev/eventctl and eventd? And, may be, rename /dev/devctl2 to /dev/eventctl too. From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:15:09 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29A3FE66; Tue, 10 Feb 2015 15:15: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1589AB01; Tue, 10 Feb 2015 15:15:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AFF82E052540; Tue, 10 Feb 2015 15:15:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AFF83W052539; Tue, 10 Feb 2015 15:15:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502101515.t1AFF83W052539@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Feb 2015 15:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278519 - 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 15:15:09 -0000 Author: imp Date: Tue Feb 10 15:15:08 2015 New Revision: 278519 URL: https://svnweb.freebsd.org/changeset/base/278519 Log: Properly quote EXTRA_MODULES and WITHOUT_MODULES to ensure that they are passed down properly when there's more than one. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Feb 10 14:11:23 2015 (r278518) +++ head/sys/conf/kern.pre.mk Tue Feb 10 15:15:08 2015 (r278519) @@ -186,7 +186,7 @@ SYSTEM_DEP+= ${LDSCRIPT} MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH} MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} -MKMODULESENV+= MODULES_EXTRA=${MODULES_EXTRA} WITHOUT_MODULES=${WITHOUT_MODULES} +MKMODULESENV+= MODULES_EXTRA="${MODULES_EXTRA}" WITHOUT_MODULES="${WITHOUT_MODULES}" .if (${KERN_IDENT} == LINT) MKMODULESENV+= ALL_MODULES=LINT .endif From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:37:06 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 594F7326; Tue, 10 Feb 2015 15:37:06 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D52AD2E; Tue, 10 Feb 2015 15:37:06 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B66CFB91E; Tue, 10 Feb 2015 10:37:04 -0500 (EST) From: John Baldwin To: Adrian Chadd Subject: Re: svn commit: r278479 - in head: etc sys/kern Date: Tue, 10 Feb 2015 10:36:51 -0500 Message-ID: <2907775.GXqUUp6Hz6@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: References: <201502092313.t19NDpoS083043@svn.freebsd.org> <1516483.e0EXgdk9ur@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 Feb 2015 10:37:04 -0500 (EST) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 15:37:06 -0000 On Tuesday, February 10, 2015 07:06:03 AM Adrian Chadd wrote: > On 10 February 2015 at 06:16, John Baldwin wrote: > > On Monday, February 09, 2015 11:13:51 PM Rui Paulo wrote: > >> Author: rpaulo > >> Date: Mon Feb 9 23:13:50 2015 > >> New Revision: 278479 > >> URL: https://svnweb.freebsd.org/changeset/base/278479 > >> > >> Log: > >> Notify devd(8) when a process crashed. > >> > >> This change implements a notification (via devctl) to userland when > >> the kernel produces coredumps after a process has crashed. > >> devd can then run a specific command to produce a human readable crash > >> report. The command is most usually a helper that runs gdb/lldb > >> commands on the file/coredump pair. It's possible to use this > >> functionality for implementing automatic generation of crash reports. > >> > >> devd(8) will be notified of the full path of the binary that crashed > >> and > >> the full path of the coredump file. > > > > I think this is a very useful feature and I think this is fine to be in > > the > > tree as-is for now. My only note is that this is a bit of feature creep > > for devd (this isn't a device notification, this is a system event > > notification). As such, I think it might be worth thinking if we > > (collectively) want to think about having a separate framework at all for > > system event notification. You could possibly publish other interesting > > events this way. For example, Isilon currently has a patch to log(9) > > Witness LORs. I personally think it's a bit hackish and potentially > > unreliable. A much nicer interface if you want to capture such things > > would be to publish an event for each logged LOR instead. Machine checks > > are another example of something that might be nice to publish (though > > you could possibly make the case that those would not be inappropriate to > > publish via devd since actual hardware is involved). Disk and PCI errors > > are another class of thing that it would be nice to publish in an easier > > to programmaticaly parse manner. > > Cool, so someone's going to add multi-subscriber support to /dev/devctl ? Eh, devd publishes /var/run/devd.pipe already which supports multiple subscribers. I think that was one of the intentional design decisions was to handle multiple subscribers in userland rather than the kernel. > I think devd grows these things because it's easier than teaching the > devctl interface to support multiple listeners. That wasn't really my question. My question was if we want distinct streams or if we want want unified stream. Having a unified stream might very well make sense (and if so we could rename devd to make that more obvious). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:37:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E67AC463; Tue, 10 Feb 2015 15:37:21 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 75FE4D33; Tue, 10 Feb 2015 15:37:21 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 90077D6425D; Wed, 11 Feb 2015 02:37:13 +1100 (AEDT) Date: Wed, 11 Feb 2015 02:37:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim Subject: Re: svn commit: r278474 - head/sys/sys In-Reply-To: <54D92CE8.1030803@FreeBSD.org> Message-ID: <20150211014516.N1511@besplex.bde.org> References: <201502092103.t19L3OAn013792@svn.freebsd.org> <1698688.fEq0HxqPxg@ralph.baldwin.cx> <54D92CE8.1030803@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=Za4kaKlA c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=7oXREgloDtZ4TWZj2REA:9 a=3_mRkF-kOeVxiea6:21 a=zPFTeV5YefL7qYvv:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 15:37:22 -0000 On Mon, 9 Feb 2015, Jung-uk Kim wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 02/09/2015 16:08, John Baldwin wrote: >> On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote: >>> Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision: 278474 >>> URL: https://svnweb.freebsd.org/changeset/base/278474 >>> >>> Log: Use __builtin_popcnt() to implement a BIT_COUNT() operation >>> for bitsets and use this to implement CPU_COUNT() to count the >>> number of CPUs in a cpuset. >>> >>> MFC after: 2 weeks >> >> Yes, __builtin_popcnt() works with GCC 4.2. It should also allow >> the compiler to DTRT in userland uses of this if -msse4.2 is >> enabled. > > Back in 2012, when I submitted a similar patch, bde noted > __builtin_popcount*() cannot be used with GCC 4.2 for *kernel* because > it emits a library call. Also, the gcc library uses a fairly slow implementation (a 256-byte lookup table), even in gcc-4.8. On modern CPUs, this is probably slower than the bit-magic algorithm in . In the usual case where the arch doesn't support popcount in hardware, clang generates inline code that uses much the same bit-magic algorithm as in . It also uses this for its libgcc.a. gcc48 only has library support for 32-bit and 64-bit integers on 64-bit arches. clang also supports a "ti2" (128-bit?) integer type in its libgcc.a. I don't know how to test this. (__int128 works for declaring 128-bit variables, but the only popcount builtins according to the available documentation (strings clang) are *popcount(), *popcountl() and *popcountll(), and ll is the same as l on amd64. The implementation in is a silly optimization. It also supports 16-bit integers but not 64-bit ones. If optimizing popcount was important, then it would be done in libc first and would support 64-bit integers. It would use the builtin iff it is available and doesn't reduce to a library call that is slower than the bit-magic algorithm. This is not easy, since compilers don't even tell you if their builtins reduce to library calls, and whether they do depends on the arch (*). Older compilers also don't tell you if their builtins exist. Some builtins have a type-generic API, but unfortunately this not one. This means that the builtin can barely do as well as the bit-magic inline function for 16-bit integers since you cannot even write the name of the builtin for this case (you have to promote to 32 bits; popcount on this is probably faster than bit-magic, but bit-magic has more bits to look at). Similarly for 128-bit intergers. (*) Since generic amd64 and i386 have no popcount instruction in hardware, using builtin popcount rarely uses the hardware instruction (it takes special -march to get it, and the resulting binaries don't run on generic CPUs). Thus using the builtin works worse than using the old inline function in most cases. Except, the old inline function is only implemented in the kernel, and isn't implemented for 64-bit integers. gcc-4.8 generates the hardware popcount if the arch supports it. Only its library popcounts are slower than clang's. gcc-4.2 presumably doesn't generate the hardware popcount, since it doesn't have a -march for newer CPUs that have it. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:43:14 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4250762A; Tue, 10 Feb 2015 15:43:14 +0000 (UTC) Received: from smtp3.ore.mailhop.org (smtp3.ore.mailhop.org [54.149.88.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19C37E10; Tue, 10 Feb 2015 15:43:13 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp3.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YLCy0-0002b7-4H; Tue, 10 Feb 2015 15:43:12 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t1AFh9NR081932; Tue, 10 Feb 2015 08:43:09 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19DtXoobPm6gQbvIC+dlQaK Message-ID: <1423582989.80968.16.camel@freebsd.org> Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Ian Lepore To: Adrian Chadd Date: Tue, 10 Feb 2015 08:43:09 -0700 In-Reply-To: References: <201502092313.t19NDpoS083043@svn.freebsd.org> <1516483.e0EXgdk9ur@ralph.baldwin.cx> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 15:43:14 -0000 On Tue, 2015-02-10 at 07:06 -0800, Adrian Chadd wrote: > On 10 February 2015 at 06:16, John Baldwin wrote: > > On Monday, February 09, 2015 11:13:51 PM Rui Paulo wrote: > >> Author: rpaulo > >> Date: Mon Feb 9 23:13:50 2015 > >> New Revision: 278479 > >> URL: https://svnweb.freebsd.org/changeset/base/278479 > >> > >> Log: > >> Notify devd(8) when a process crashed. > >> > >> This change implements a notification (via devctl) to userland when > >> the kernel produces coredumps after a process has crashed. > >> devd can then run a specific command to produce a human readable crash > >> report. The command is most usually a helper that runs gdb/lldb > >> commands on the file/coredump pair. It's possible to use this > >> functionality for implementing automatic generation of crash reports. > >> > >> devd(8) will be notified of the full path of the binary that crashed and > >> the full path of the coredump file. > > > > I think this is a very useful feature and I think this is fine to be in the > > tree as-is for now. My only note is that this is a bit of feature creep for > > devd (this isn't a device notification, this is a system event notification). > > As such, I think it might be worth thinking if we (collectively) want to think > > about having a separate framework at all for system event notification. You > > could possibly publish other interesting events this way. For example, Isilon > > currently has a patch to log(9) Witness LORs. I personally think it's a bit > > hackish and potentially unreliable. A much nicer interface if you want to > > capture such things would be to publish an event for each logged LOR instead. > > Machine checks are another example of something that might be nice to publish > > (though you could possibly make the case that those would not be inappropriate > > to publish via devd since actual hardware is involved). Disk and PCI errors > > are another class of thing that it would be nice to publish in an easier to > > programmaticaly parse manner. > > Cool, so someone's going to add multi-subscriber support to /dev/devctl ? > I don't see how you get that from the foregoing at all. Doing fan-out in the kernel is hard, and doing it in userland is easier, so the existing devd model could be an appropriate one to follow for a general "kernel events which are not hardware events" system. > I think devd grows these things because it's easier than teaching the > devctl interface to support multiple listeners. Until recently, devd only grew additional support for things which are device-related, modulo the zfs stuff that I don't know much about. I was under the impression that that also was device-related in some way, such as zfs reporting on device errors or attach/remove and things related to that (like health of the pool(s) affected by the device change). Maybe the zfs stuff was the beginning of the mission creep and still had enough of a device-related fig leaf to not look like creep. But there's no disguising the fact that post-processing core dumps has absolutely nothing to do with devices. -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 15:58:36 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC4FEA20; Tue, 10 Feb 2015 15:58:36 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 822AEF1A; Tue, 10 Feb 2015 15:58:36 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5A5C7B91E; Tue, 10 Feb 2015 10:58:35 -0500 (EST) From: John Baldwin To: Bruce Evans Subject: Re: svn commit: r278474 - head/sys/sys Date: Tue, 10 Feb 2015 10:58:24 -0500 Message-ID: <12119175.I8M1urv6pf@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150211014516.N1511@besplex.bde.org> References: <201502092103.t19L3OAn013792@svn.freebsd.org> <54D92CE8.1030803@FreeBSD.org> <20150211014516.N1511@besplex.bde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 Feb 2015 10:58:35 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jung-uk Kim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 15:58:36 -0000 On Wednesday, February 11, 2015 02:37:05 AM Bruce Evans wrote: > On Mon, 9 Feb 2015, Jung-uk Kim wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA256 > > > > On 02/09/2015 16:08, John Baldwin wrote: > >> On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote: > >>> Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision: 278474 > >>> URL: https://svnweb.freebsd.org/changeset/base/278474 > >>> > >>> Log: Use __builtin_popcnt() to implement a BIT_COUNT() operation > >>> for bitsets and use this to implement CPU_COUNT() to count the > >>> number of CPUs in a cpuset. > >>> > >>> MFC after: 2 weeks > >> > >> Yes, __builtin_popcnt() works with GCC 4.2. It should also allow > >> the compiler to DTRT in userland uses of this if -msse4.2 is > >> enabled. > > > > Back in 2012, when I submitted a similar patch, bde noted > > __builtin_popcount*() cannot be used with GCC 4.2 for *kernel* because > > it emits a library call. > > (*) Since generic amd64 and i386 have no popcount instruction in hardware, > using builtin popcount rarely uses the hardware instruction (it takes > special -march to get it, and the resulting binaries don't run on generic > CPUs). Thus using the builtin works worse than using the old inline > function in most cases. Except, the old inline function is only > implemented in the kernel, and isn't implemented for 64-bit integers. > > gcc-4.8 generates the hardware popcount if the arch supports it. Only > its library popcounts are slower than clang's. gcc-4.2 presumably > doesn't generate the hardware popcount, since it doesn't have a -march > for newer CPUs that have it. I don't really expect CPU_COUNT() to be used in places where performance is of the utmost importance. (For example in igb I use it in attach to enumerate the set of CPUs to bind queues to, but nowhere else.) I can implement a bitcount64 by using bitcount32 on both halves unless someone has a better suggestion and we can use the bitcount routines instead of __builtin_popcountl in BIT_COUNT() for GCC if we care that strongly about it. Alternatively, I'm happy to implement the libcall for GCC 4.2 for the kernel so that __builtin_popcountl() works. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 16:17:17 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7AC811E; Tue, 10 Feb 2015 16:17: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A957A151; Tue, 10 Feb 2015 16:17:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AGHH95081340; Tue, 10 Feb 2015 16:17:17 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AGHH12081338; Tue, 10 Feb 2015 16:17:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201502101617.t1AGHH12081338@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 Feb 2015 16:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278521 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 16:17:18 -0000 Author: trasz Date: Tue Feb 10 16:17:16 2015 New Revision: 278521 URL: https://svnweb.freebsd.org/changeset/base/278521 Log: Restore ABI compatibility, broken in r273127. Note that while this fixes ABI with 10.1, it breaks ABI for 11-CURRENT, so rebuild of automountd(8) is neccessary. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs.c head/sys/fs/autofs/autofs_ioctl.h Modified: head/sys/fs/autofs/autofs.c ============================================================================== --- head/sys/fs/autofs/autofs.c Tue Feb 10 16:01:16 2015 (r278520) +++ head/sys/fs/autofs/autofs.c Tue Feb 10 16:17:16 2015 (r278521) @@ -584,6 +584,34 @@ autofs_ioctl_request(struct autofs_daemo } static int +autofs_ioctl_done_101(struct autofs_daemon_done_101 *add) +{ + struct autofs_request *ar; + + sx_xlock(&autofs_softc->sc_lock); + TAILQ_FOREACH(ar, &autofs_softc->sc_requests, ar_next) { + if (ar->ar_id == add->add_id) + break; + } + + if (ar == NULL) { + sx_xunlock(&autofs_softc->sc_lock); + AUTOFS_DEBUG("id %d not found", add->add_id); + return (ESRCH); + } + + ar->ar_error = add->add_error; + ar->ar_wildcards = true; + ar->ar_done = true; + ar->ar_in_progress = false; + cv_broadcast(&autofs_softc->sc_cv); + + sx_xunlock(&autofs_softc->sc_lock); + + return (0); +} + +static int autofs_ioctl_done(struct autofs_daemon_done *add) { struct autofs_request *ar; @@ -658,6 +686,9 @@ autofs_ioctl(struct cdev *dev, u_long cm case AUTOFSREQUEST: return (autofs_ioctl_request( (struct autofs_daemon_request *)arg)); + case AUTOFSDONE101: + return (autofs_ioctl_done_101( + (struct autofs_daemon_done_101 *)arg)); case AUTOFSDONE: return (autofs_ioctl_done( (struct autofs_daemon_done *)arg)); Modified: head/sys/fs/autofs/autofs_ioctl.h ============================================================================== --- head/sys/fs/autofs/autofs_ioctl.h Tue Feb 10 16:01:16 2015 (r278520) +++ head/sys/fs/autofs/autofs_ioctl.h Tue Feb 10 16:17:16 2015 (r278521) @@ -71,6 +71,21 @@ struct autofs_daemon_request { char adr_options[MAXPATHLEN]; }; +/* + * Compatibility with 10.1-RELEASE automountd(8). + */ +struct autofs_daemon_done_101 { + /* + * Identifier, copied from adr_id. + */ + int add_id; + + /* + * Error number, possibly returned to userland. + */ + int add_error; +}; + struct autofs_daemon_done { /* * Identifier, copied from adr_id. @@ -87,9 +102,15 @@ struct autofs_daemon_done { * Error number, possibly returned to userland. */ int add_error; + + /* + * Reserved for future use. + */ + int add_spare[7]; }; #define AUTOFSREQUEST _IOR('I', 0x01, struct autofs_daemon_request) -#define AUTOFSDONE _IOW('I', 0x02, struct autofs_daemon_done) +#define AUTOFSDONE101 _IOW('I', 0x02, struct autofs_daemon_done_101) +#define AUTOFSDONE _IOW('I', 0x03, struct autofs_daemon_done) #endif /* !AUTOFS_IOCTL_H */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 16:34:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D00B529 for ; Tue, 10 Feb 2015 16:34:27 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B9D437C for ; Tue, 10 Feb 2015 16:34:27 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AGYRdh024155 for ; Tue, 10 Feb 2015 16:34:27 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t1AGYRQp024154 for svn-src-head@freebsd.org; Tue, 10 Feb 2015 16:34:27 GMT (envelope-from bdrewery) Received: (qmail 27866 invoked from network); 10 Feb 2015 10:34:25 -0600 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 10 Feb 2015 10:34:25 -0600 Message-ID: <54DA3312.8050709@FreeBSD.org> Date: Tue, 10 Feb 2015 10:34:26 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278521 - head/sys/fs/autofs References: <201502101617.t1AGHH12081338@svn.freebsd.org> In-Reply-To: <201502101617.t1AGHH12081338@svn.freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hvAL1Kvs7R0oS14cdtKhSDoSC0AADtqkr" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 16:34:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hvAL1Kvs7R0oS14cdtKhSDoSC0AADtqkr Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/10/2015 10:17 AM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue Feb 10 16:17:16 2015 > New Revision: 278521 > URL: https://svnweb.freebsd.org/changeset/base/278521 >=20 > Log: > Restore ABI compatibility, broken in r273127. Note that while this f= ixes > ABI with 10.1, it breaks ABI for 11-CURRENT, so rebuild of automountd= (8) > is neccessary. I was going to say __FreeBSD_version should probably be bumped, but I suppose it's unlikely there are any consumers outside of automountd(8) already. An entry in UPDATING may be worth adding for head noting the rebuild need. We don't all read commit logs. > =20 > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/sys/fs/autofs/autofs.c > head/sys/fs/autofs/autofs_ioctl.h >=20 > Modified: head/sys/fs/autofs/autofs.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/fs/autofs/autofs.c Tue Feb 10 16:01:16 2015 (r278520) > +++ head/sys/fs/autofs/autofs.c Tue Feb 10 16:17:16 2015 (r278521) > @@ -584,6 +584,34 @@ autofs_ioctl_request(struct autofs_daemo > } > =20 > static int > +autofs_ioctl_done_101(struct autofs_daemon_done_101 *add) > +{ > + struct autofs_request *ar; > + > + sx_xlock(&autofs_softc->sc_lock); > + TAILQ_FOREACH(ar, &autofs_softc->sc_requests, ar_next) { > + if (ar->ar_id =3D=3D add->add_id) > + break; > + } > + > + if (ar =3D=3D NULL) { > + sx_xunlock(&autofs_softc->sc_lock); > + AUTOFS_DEBUG("id %d not found", add->add_id); > + return (ESRCH); > + } > + > + ar->ar_error =3D add->add_error; > + ar->ar_wildcards =3D true; > + ar->ar_done =3D true; > + ar->ar_in_progress =3D false; > + cv_broadcast(&autofs_softc->sc_cv); > + > + sx_xunlock(&autofs_softc->sc_lock); > + > + return (0); > +} > + > +static int > autofs_ioctl_done(struct autofs_daemon_done *add) > { > struct autofs_request *ar; > @@ -658,6 +686,9 @@ autofs_ioctl(struct cdev *dev, u_long cm > case AUTOFSREQUEST: > return (autofs_ioctl_request( > (struct autofs_daemon_request *)arg)); > + case AUTOFSDONE101: > + return (autofs_ioctl_done_101( > + (struct autofs_daemon_done_101 *)arg)); > case AUTOFSDONE: > return (autofs_ioctl_done( > (struct autofs_daemon_done *)arg)); >=20 > Modified: head/sys/fs/autofs/autofs_ioctl.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/fs/autofs/autofs_ioctl.h Tue Feb 10 16:01:16 2015 (r278520= ) > +++ head/sys/fs/autofs/autofs_ioctl.h Tue Feb 10 16:17:16 2015 (r278521= ) > @@ -71,6 +71,21 @@ struct autofs_daemon_request { > char adr_options[MAXPATHLEN]; > }; > =20 > +/* > + * Compatibility with 10.1-RELEASE automountd(8). > + */ > +struct autofs_daemon_done_101 { > + /* > + * Identifier, copied from adr_id. > + */ > + int add_id; > + > + /* > + * Error number, possibly returned to userland. > + */ > + int add_error; > +}; > + > struct autofs_daemon_done { > /* > * Identifier, copied from adr_id. > @@ -87,9 +102,15 @@ struct autofs_daemon_done { > * Error number, possibly returned to userland. > */ > int add_error; > + > + /* > + * Reserved for future use. > + */ > + int add_spare[7]; > }; > =20 > #define AUTOFSREQUEST _IOR('I', 0x01, struct autofs_daemon_request) > -#define AUTOFSDONE _IOW('I', 0x02, struct autofs_daemon_done) > +#define AUTOFSDONE101 _IOW('I', 0x02, struct autofs_daemon_done_101) > +#define AUTOFSDONE _IOW('I', 0x03, struct autofs_daemon_done) > =20 > #endif /* !AUTOFS_IOCTL_H */ >=20 --=20 Regards, Bryan Drewery --hvAL1Kvs7R0oS14cdtKhSDoSC0AADtqkr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJU2jMSAAoJEDXXcbtuRpfPNCIIAK9eD/Eufk1wFHncLdi88FAk rZ5lTGSRC0F9ZMnP59mYRpCu9RiYU76Ip+yjQgEE3Ly81/U7PvWROfuOZn6PMbNT f421mNAzrW7EXT9teIfiVV/kS2oQ0cUf04fuWtwIl3sGf4UScw9/0jlI8W37QF8H D71n+msaMwotwAzp1GEW0p7zoR/sGFUgk7dDzFYd5PTzMBLSlkFmdSg3HxT0BtJE wxbHhRwxOSddwbrZkVThjXare2h1TlG3r0NhQ/NsU3EJAluFiQtcF5Piz6Nc1qLj Z2/WSOaFZMipoaV6jaPZO8JiQ/+N0qNKrxvMxOZvNKULfbFuXudr0yImXQo4bPk= =E0jk -----END PGP SIGNATURE----- --hvAL1Kvs7R0oS14cdtKhSDoSC0AADtqkr-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 16:56:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3097E06; Tue, 10 Feb 2015 16:56:33 +0000 (UTC) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E926822; Tue, 10 Feb 2015 16:56:33 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id w55so23379135wes.4; Tue, 10 Feb 2015 08:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=8WxpQETtv5HY2rXceEU9EpulZauCeWPErK59kGFCdBA=; b=Bb/kVKUmiAf4HoS+uJPkMv6Bn1LtbzbOnrbQr052EYkmrkbrSJ5GboxeOM0AYXC51L 8w8M67AWfp5MnaoZ+cFkr2+z2Jq6OYOsJRHKuSTZCKGEi0DRJq3XGajTRCofgTlXxp3D +KVNE1pPZxU5nJHHCatrsSYrKl0Nz1teg97FfqCBWYYUGuXsCH/AaLaO5LCCixlIKHlE UDu+AB8Az4d92o/Yazd8F2sEnhO0ZOcm/rD+1dKZ1J3rTshnZe/kvi3vJFFTTMj8Qz02 XTysl+12qgCNBXchjT/aX+kvEU4R1vsLCKf6cVvXXMetEEIPw41kIa0+wEVZM1TRnVot FATw== X-Received: by 10.194.173.138 with SMTP id bk10mr52406975wjc.112.1423587391728; Tue, 10 Feb 2015 08:56:31 -0800 (PST) Received: from brick.home (ace138.neoplus.adsl.tpnet.pl. [83.25.56.138]) by mx.google.com with ESMTPSA id fd10sm4208832wib.4.2015.02.10.08.56.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Feb 2015 08:56:31 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Tue, 10 Feb 2015 17:56:28 +0100 From: Edward Tomasz Napierala To: Bryan Drewery Subject: Re: svn commit: r278521 - head/sys/fs/autofs Message-ID: <20150210165628.GB59710@brick.home> Mail-Followup-To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201502101617.t1AGHH12081338@svn.freebsd.org> <54DA3312.8050709@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54DA3312.8050709@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 16:56:33 -0000 On 0210T1034, Bryan Drewery wrote: > On 2/10/2015 10:17 AM, Edward Tomasz Napierala wrote: > > Author: trasz > > Date: Tue Feb 10 16:17:16 2015 > > New Revision: 278521 > > URL: https://svnweb.freebsd.org/changeset/base/278521 > > > > Log: > > Restore ABI compatibility, broken in r273127. Note that while this fixes > > ABI with 10.1, it breaks ABI for 11-CURRENT, so rebuild of automountd(8) > > is neccessary. > > I was going to say __FreeBSD_version should probably be bumped, but I > suppose it's unlikely there are any consumers outside of automountd(8) > already. Indeed, I hadn't heard of any. From my point of view it's a private API between autofs(4) and automountd(8). > An entry in UPDATING may be worth adding for head noting the > rebuild need. We don't all read commit logs. Okay. What do you think about the following: 20150210: The autofs(4) ABI was changed in order to restore binary compatibility with 10.1-RELEASE. The automountd(8) daemon needs to be rebuilt to work with the new kernel. From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 17:08:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C63E9198 for ; Tue, 10 Feb 2015 17:08:23 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BC04933 for ; Tue, 10 Feb 2015 17:08:23 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AH8NXZ034343 for ; Tue, 10 Feb 2015 17:08:23 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t1AH8NLu034341 for svn-src-head@freebsd.org; Tue, 10 Feb 2015 17:08:23 GMT (envelope-from bdrewery) Received: (qmail 62297 invoked from network); 10 Feb 2015 11:08:21 -0600 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 10 Feb 2015 11:08:21 -0600 Message-ID: <54DA3B06.9020401@FreeBSD.org> Date: Tue, 10 Feb 2015 11:08:22 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278521 - head/sys/fs/autofs References: <201502101617.t1AGHH12081338@svn.freebsd.org> <54DA3312.8050709@FreeBSD.org> <20150210165628.GB59710@brick.home> In-Reply-To: <20150210165628.GB59710@brick.home> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9riaMH6JBUr3i3W6uXtUPH4HsEQgnTmxC" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 17:08:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9riaMH6JBUr3i3W6uXtUPH4HsEQgnTmxC Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2/10/2015 10:56 AM, Edward Tomasz Napierala wrote: > On 0210T1034, Bryan Drewery wrote: >> On 2/10/2015 10:17 AM, Edward Tomasz Napierala wrote: >>> Author: trasz >>> Date: Tue Feb 10 16:17:16 2015 >>> New Revision: 278521 >>> URL: https://svnweb.freebsd.org/changeset/base/278521 >>> >>> Log: >>> Restore ABI compatibility, broken in r273127. Note that while this= fixes >>> ABI with 10.1, it breaks ABI for 11-CURRENT, so rebuild of automoun= td(8) >>> is neccessary. >> >> I was going to say __FreeBSD_version should probably be bumped, but I >> suppose it's unlikely there are any consumers outside of automountd(8)= >> already. >=20 > Indeed, I hadn't heard of any. From my point of view it's a private > API between autofs(4) and automountd(8). >=20 >> An entry in UPDATING may be worth adding for head noting the >> rebuild need. We don't all read commit logs. >=20 > Okay. What do you think about the following: >=20 > 20150210: > The autofs(4) ABI was changed in order to restore binary compatibility= > with 10.1-RELEASE. The automountd(8) daemon needs to be rebuilt to wo= rk > with the new kernel. >=20 Sounds fine. Thanks! --=20 Regards, Bryan Drewery --9riaMH6JBUr3i3W6uXtUPH4HsEQgnTmxC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJU2jsGAAoJEDXXcbtuRpfPk2kIAJtvsmTkyEhVO7WDXDpU8B2X CHeeZrlWjObDLJnpPQoz6mTqlbrwTuerzL5ZKGYxFmgsU0cVYv1UDkJCI/0YkhFT Gm2i+g211MIzbp7jdytb/ylXgQ8x6K5O1PCngSh5HcdHW5uTfz1IEbXgN1XoeEkf IFxePWuFpEewrh+xOzwIzZefM4yFoZQrnRGLlpKlLRFTr62znXzqpyK+1dMspeUz PBca65pULG9CHTLETbXjopG2ZNecpoPKIDkdjG5zo+ZCndZR757UZKIhnk+6HcOY 7wRWcwIXh0aFqmeqRin0uVZ5r3ryFTQIHv0QfB1s7IeIEZN6tMnHn+n96QXgsD4= =R/On -----END PGP SIGNATURE----- --9riaMH6JBUr3i3W6uXtUPH4HsEQgnTmxC-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 18:00:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 740ABD6; Tue, 10 Feb 2015 18:00: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45832E80; Tue, 10 Feb 2015 18:00:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AI0X78031066; Tue, 10 Feb 2015 18:00:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AI0WI1031062; Tue, 10 Feb 2015 18:00:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502101800.t1AI0WI1031062@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Feb 2015 18:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278523 - in head: sys/kern usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 18:00:33 -0000 Author: kib Date: Tue Feb 10 18:00:32 2015 New Revision: 278523 URL: https://svnweb.freebsd.org/changeset/base/278523 Log: Mountd iterating over the mount points may race with the parallel unmount, which causes error from nmount(2) call when performing MNT_DELEXPORT over the directory which ceased to be a mount point. The race is legitimate and innocent, but results in the chatty mountd. Silence it by providing an distinguished error code for the situation, and ignoring the error in mountd loop. Based on the patch by: Andreas Longwitz Prodded and tested by: bdrewery Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/vfs_mount.c head/usr.sbin/mountd/mountd.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Tue Feb 10 16:34:42 2015 (r278522) +++ head/sys/kern/vfs_mount.c Tue Feb 10 18:00:32 2015 (r278523) @@ -888,12 +888,18 @@ vfs_domount_update( ASSERT_VOP_ELOCKED(vp, __func__); KASSERT((fsflags & MNT_UPDATE) != 0, ("MNT_UPDATE should be here")); + mp = vp->v_mount; if ((vp->v_vflag & VV_ROOT) == 0) { + if (vfs_copyopt(*optlist, "export", &export, sizeof(export)) + == 0) + error = EXDEV; + else + error = EINVAL; vput(vp); - return (EINVAL); + return (error); } - mp = vp->v_mount; + /* * We only allow the filesystem to be reloaded if it * is currently mounted read-only. Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Tue Feb 10 16:34:42 2015 (r278522) +++ head/usr.sbin/mountd/mountd.c Tue Feb 10 18:00:32 2015 (r278523) @@ -1747,8 +1747,12 @@ get_exportlist(void) iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; errmsg[0] = '\0'; + /* + * EXDEV is returned when path exists but is not a + * mount point. May happens if raced with unmount. + */ if (nmount(iov, iovlen, fsp->f_flags) < 0 && - errno != ENOENT && errno != ENOTSUP) { + errno != ENOENT && errno != ENOTSUP && errno != EXDEV) { syslog(LOG_ERR, "can't delete exports for %s: %m %s", fsp->f_mntonname, errmsg); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 18:05:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7002A41E; Tue, 10 Feb 2015 18:05: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C43FF5F; Tue, 10 Feb 2015 18:05:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AI5xHB034844; Tue, 10 Feb 2015 18:05:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AI5xb3034843; Tue, 10 Feb 2015 18:05:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201502101805.t1AI5xb3034843@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 Feb 2015 18:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278524 - 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 18:05:59 -0000 Author: trasz Date: Tue Feb 10 18:05:58 2015 New Revision: 278524 URL: https://svnweb.freebsd.org/changeset/base/278524 Log: Update UPDATING after changing autofs(4) ABI. Suggested by: bdrewery@ Sponsored by: The FreeBSD Foundation Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Feb 10 18:00:32 2015 (r278523) +++ head/UPDATING Tue Feb 10 18:05:58 2015 (r278524) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150210: + The autofs(4) ABI was changed in order to restore binary compatibility + with 10.1-RELEASE. The automountd(8) daemon needs to be rebuilt to work + with the new kernel. + 20150131: The powerpc64 kernel has been changed to a position-independent executable. This can only be booted with a new version of loader(8), From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 18:30:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45D5EAAB; Tue, 10 Feb 2015 18:30:41 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11A21220; Tue, 10 Feb 2015 18:30:40 +0000 (UTC) Received: from st11p02mm-spool002.mac.com ([17.172.220.247]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTP id <0NJK00J8CJERBC20@st11p02mm-asmtp002.mac.com>; Tue, 10 Feb 2015 18:30:31 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_06:2015-02-10,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100174 MIME-version: 1.0 Received: from localhost ([17.172.220.163]) by st11p02mm-spool002.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTP id <0NJK00KL7JERZL80@st11p02mm-spool002.mac.com>; Tue, 10 Feb 2015 18:30:27 +0000 (GMT) To: John Baldwin From: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Date: Tue, 10 Feb 2015 18:30:27 +0000 (GMT) X-Mailer: iCloud MailClient15A99 MailServer14H18.17359 X-Originating-IP: [12.218.212.178] Message-id: <8e5503e1-755c-49e4-ab4d-a0ad1ae91f97@me.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 18:30:41 -0000 On Feb 10, 2015, at 07:37 AM, John Baldwin wrote:=0AThat= wasn't really my question. My question was if we want distinct streams =0A= or if we want want unified stream. Having a unified stream might very well= =0Amake sense (and if so we could rename devd to make that more obvious).= =0A=0AI'm fine with renaming devd to eventd or something else, but Ian was= saying that he's worried about the number of notifications that devd has = to process. =C2=A0I'm not sure that's a real problem at this point, though= . =C2=A0On freefall, devd used 0.07 seconds of CPU time and has been runni= ng for a 1 day and a half. =C2=A0On my BeagleBone, devd used 0.61 seconds = of CPU time and it has been up for 5 days and a half. =C2=A0 On my VM that= has been up for 5 days and a half, it used 4 seconds of CPU time. =C2=A0R= enaming sounds like a good idea and it looks like we could leave the optim= isations to a later time.=0A=0AAnother thing I had in mind (which is more = work) was to abstract the devctl kernel code in an API which could make it= easy to fan out the notifications to multiple /dev devices. =C2=A0However= , that may be overkill.= From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 18:35:47 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2242CE1; Tue, 10 Feb 2015 18:35: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E00E31E; Tue, 10 Feb 2015 18:35:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AIZlPX049131; Tue, 10 Feb 2015 18:35:47 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AIZlnu049130; Tue, 10 Feb 2015 18:35:47 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502101835.t1AIZlnu049130@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 10 Feb 2015 18:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278525 - 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.18-1 Precedence: list List-Id: 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, 10 Feb 2015 18:35:47 -0000 Author: rpaulo Date: Tue Feb 10 18:35:46 2015 New Revision: 278525 URL: https://svnweb.freebsd.org/changeset/base/278525 Log: Remove a printf and an strlen() from the coredump code. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Feb 10 18:05:58 2015 (r278524) +++ head/sys/kern/kern_sig.c Tue Feb 10 18:35:46 2015 (r278525) @@ -3225,14 +3225,13 @@ out: static int coredump_sanitise_path(const char *path) { - size_t len, i; + size_t i; /* * Only send a subset of ASCII to devd(8) because it * might pass these strings to sh -c. */ - len = strlen(path); - for (i = 0; i < len; i++) + for (i = 0; path[i]; i++) if (!(isalpha(path[i]) || isdigit(path[i])) && path[i] != '/' && path[i] != '.' && path[i] != '-') @@ -3365,10 +3364,8 @@ close: snprintf(data, sizeof(data), "comm=%s ", fullpath); free(freepath, M_TEMP); freepath = NULL; - if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) { - printf("could not find coredump\n"); + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) goto out; - } if (!coredump_sanitise_path(fullpath)) goto out; strlcat(data, "core=", sizeof(data)); From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 18:36:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31EFAEFA; Tue, 10 Feb 2015 18:36:42 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E9D9F32F; Tue, 10 Feb 2015 18:36:41 +0000 (UTC) Received: from [192.168.0.7] (cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61]) (authenticated bits=0) by theravensnest.org (8.15.1/8.14.9) with ESMTPSA id t1AIaSeb005471 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Feb 2015 18:36:33 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61] claimed to be [192.168.0.7] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278479 - in head: etc sys/kern From: David Chisnall In-Reply-To: <8e5503e1-755c-49e4-ab4d-a0ad1ae91f97@me.com> Date: Tue, 10 Feb 2015 18:36:23 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <575FA8C1-0204-455C-A35A-787C48066AA5@FreeBSD.org> References: <8e5503e1-755c-49e4-ab4d-a0ad1ae91f97@me.com> To: Rui Paulo X-Mailer: Apple Mail (2.2070.6) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 18:36:42 -0000 On 10 Feb 2015, at 18:30, Rui Paulo wrote: >=20 > Another thing I had in mind (which is more work) was to abstract the = devctl kernel code in an API which could make it easy to fan out the = notifications to multiple /dev devices. However, that may be overkill. This kind of notification is something that kdbus is increasingly being = used for on Linux. The primitive allows events to originate either in = the kernel or in userspace and to be sent either point-to-point or to a = bloom filter set of recipients (so you occasionally get some messages = you're not expecting, but hopefully don't get too many spurious = wakeups). David From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 18:36:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBBD1158; Tue, 10 Feb 2015 18:36:52 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtpout001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98DBE332; Tue, 10 Feb 2015 18:36:52 +0000 (UTC) Received: from st11p02mm-spool001.mac.com ([17.172.220.246]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTP id <0NJK005HFJP54W30@st11p02mm-asmtp001.mac.com>; Tue, 10 Feb 2015 18:36:42 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_06:2015-02-10,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=2 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100174 MIME-version: 1.0 Received: from localhost ([17.172.220.163]) by st11p02mm-spool001.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTP id <0NJK007VOJP51140@st11p02mm-spool001.mac.com>; Tue, 10 Feb 2015 18:36:41 +0000 (GMT) To: Konstantin Belousov From: Rui Paulo Subject: Re: svn commit: r278494 - head/sys/kern Date: Tue, 10 Feb 2015 18:36:41 +0000 (GMT) X-Mailer: iCloud MailClient15A99 MailServer14H18.17359 X-Originating-IP: [12.218.212.178] Message-id: <72be7da9-2c3f-45ec-963a-cea7bff5df5e@me.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 18:36:52 -0000 On Feb 10, 2015, at 12:32 AM, Konstantin Belousov wr= ote:=0A=0AAnd there is double-free somewhere.=0A=C2=A0=0AAre you talking a= bout the Jenkins error? =C2=A0I think that was the free(name) which was th= e result of a mis-merge and which I fixed yesterday. =C2=A0Jenkins build #= 671 seems to be ok.= From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 18:49:14 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6047B496; Tue, 10 Feb 2015 18:49: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3AC649; Tue, 10 Feb 2015 18:49:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AInETj054485; Tue, 10 Feb 2015 18:49:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AInE4M054484; Tue, 10 Feb 2015 18:49:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502101849.t1AInE4M054484@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 Feb 2015 18:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278526 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 18:49:14 -0000 Author: gjb Date: Tue Feb 10 18:49:13 2015 New Revision: 278526 URL: https://svnweb.freebsd.org/changeset/base/278526 Log: Fix a rendering issue in the nullfs(5) manual page. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/nullfs.5 Modified: head/share/man/man5/nullfs.5 ============================================================================== --- head/share/man/man5/nullfs.5 Tue Feb 10 18:35:46 2015 (r278525) +++ head/share/man/man5/nullfs.5 Tue Feb 10 18:49:13 2015 (r278526) @@ -24,15 +24,14 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2008 +.Dd February 10, 2015 .Dt NULLFS 5 .Os .Sh NAME .Nm nullfs .Nd "null file system" .Sh SYNOPSIS -To enable support for -.Nm , +To enable support for this driver, place the following line in the kernel configuration file: .Bd -ragged -offset indent .Cd "options NULLFS" From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 18:51:59 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C34A56D1; Tue, 10 Feb 2015 18:51:59 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79AA374E; Tue, 10 Feb 2015 18:51:59 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YLFub-000Lcl-9U; Tue, 10 Feb 2015 21:51:53 +0300 Date: Tue, 10 Feb 2015 21:51:53 +0300 From: Slawa Olhovchenkov To: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Message-ID: <20150210185153.GA81421@zxy.spb.ru> References: <8e5503e1-755c-49e4-ab4d-a0ad1ae91f97@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8e5503e1-755c-49e4-ab4d-a0ad1ae91f97@me.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 18:51:59 -0000 On Tue, Feb 10, 2015 at 06:30:27PM +0000, Rui Paulo wrote: > On Feb 10, 2015, at 07:37 AM, John Baldwin wrote: > That wasn't really my question. My question was if we want distinct streams > or if we want want unified stream. Having a unified stream might very well > make sense (and if so we could rename devd to make that more obvious). > > I'm fine with renaming devd to eventd or something else, but Ian was > saying that he's worried about the number of notifications that devd > has to process. šI'm not sure that's a real problem at this point, > though. šOn freefall, devd used 0.07 seconds of CPU time and has > been running for a 1 day and a half. šOn my BeagleBone, devd used > 0.61 seconds of CPU time and it has been up for 5 days and a half. š > On my VM that has been up for 5 days and a half, it used 4 seconds > of CPU time. šRenaming sounds like a good idea and it looks like we > could leave the optimisations to a later time. For common case (I am not talk about current devd implementation -- I am don't have any inforamtion/metrics/etc) routing and processing events may be sensitive to delay and ordering: may be exist requirement 'delay not more then 700ns', may be exist requirement 'next event process only after complete process previos event'. And some event handling may be very CPU/disk/etc consumption. Need to good think over and design API and architecure. From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 18:55:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6AAA9C0; Tue, 10 Feb 2015 18:55:58 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9227C774; Tue, 10 Feb 2015 18:55:57 +0000 (UTC) Received: from st11p02mm-spool001.mac.com ([17.172.220.246]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTP id <0NJK00LTFKKGF200@st11p02mm-asmtp002.mac.com>; Tue, 10 Feb 2015 18:55:29 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_06:2015-02-10,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=18 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100177 MIME-version: 1.0 Received: from localhost ([17.172.220.163]) by st11p02mm-spool001.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTP id <0NJK007XPKKG1150@st11p02mm-spool001.mac.com>; Tue, 10 Feb 2015 18:55:28 +0000 (GMT) To: Slawa Olhovchenkov From: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Date: Tue, 10 Feb 2015 18:55:28 +0000 (GMT) X-Mailer: iCloud MailClient15A99 MailServer14H18.17359 X-Originating-IP: [12.218.212.178] Message-id: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 18:55:59 -0000 On Feb 10, 2015, at 10:52 AM, Slawa Olhovchenkov wrote:=0A= For common case (I am not talk about current devd implementation -- I=0Aam= don't have any inforamtion/metrics/etc) routing and processing=0Aevents m= ay be sensitive to delay and ordering: may be exist=0Arequirement 'delay n= ot more then 700ns', may be exist requirement=0A'next event process only a= fter complete process previos event'. And=0Asome event handling may be ver= y CPU/disk/etc consumption. Need to good=0Athink over and design API and a= rchitecure.=0A=C2=A0=0Arouting events do not come over devd (or any other = /dev device): there's a routing socket specifically tailored for that purp= ose. =C2=A0For that type of latency, you probably don't want to be crossin= g the kernel/userland barrier too often (or never).= From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 19:41:36 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53E696C8; Tue, 10 Feb 2015 19:41: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B281CC9; Tue, 10 Feb 2015 19:41:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AJfaVU081966; Tue, 10 Feb 2015 19:41:36 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AJfViu081908; Tue, 10 Feb 2015 19:41:31 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201502101941.t1AJfViu081908@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 10 Feb 2015 19:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278529 - in head: cddl/contrib/opensolaris/lib/libdtrace/arm cddl/contrib/opensolaris/tools/ctf/cvt cddl/lib cddl/lib/libdtrace cddl/usr.sbin lib lib/libproc sys/arm/arm sys/arm/conf s... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 19:41:36 -0000 Author: gnn Date: Tue Feb 10 19:41:30 2015 New Revision: 278529 URL: https://svnweb.freebsd.org/changeset/base/278529 Log: Initial version of DTrace on ARM32. Submitted by: Howard Su based on work by Oleksandr Tymoshenko Reviewed by: ian, andrew, rpaulo, markj Added: head/cddl/contrib/opensolaris/lib/libdtrace/arm/ head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/arm/ head/sys/cddl/contrib/opensolaris/uts/arm/dtrace/ head/sys/cddl/contrib/opensolaris/uts/arm/dtrace/fasttrap_isa.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/arm/sys/ head/sys/cddl/contrib/opensolaris/uts/arm/sys/fasttrap_isa.h (contents, props changed) head/sys/cddl/dev/dtrace/arm/ head/sys/cddl/dev/dtrace/arm/dtrace_asm.S (contents, props changed) head/sys/cddl/dev/dtrace/arm/dtrace_isa.c (contents, props changed) head/sys/cddl/dev/dtrace/arm/dtrace_subr.c (contents, props changed) head/sys/cddl/dev/dtrace/arm/regset.h (contents, props changed) head/sys/cddl/dev/fbt/arm/ head/sys/cddl/dev/fbt/arm/fbt_isa.c (contents, props changed) head/sys/cddl/dev/fbt/arm/fbt_isa.h (contents, props changed) Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c head/cddl/lib/Makefile head/cddl/lib/libdtrace/Makefile head/cddl/usr.sbin/Makefile head/lib/Makefile head/lib/libproc/proc_bkpt.c head/lib/libproc/proc_regs.c head/sys/arm/arm/exception.S head/sys/arm/arm/identcpu.c head/sys/arm/arm/trap.c head/sys/arm/conf/BEAGLEBONE head/sys/arm/include/cpufunc.h head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/lockstat/lockstat.c head/sys/cddl/dev/profile/profile.c head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/dtrace/Makefile Added: head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c Tue Feb 10 19:41:30 2015 (r278529) @@ -0,0 +1,190 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + * Copyright 2014 Howard Su + * Copyright 2015 George V. Neville-Neil + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include +#include + +#include +#include + +#if !defined(sun) +#define PR_MODEL_ILP32 1 +#define PR_MODEL_LP64 2 +#include +#endif + +#define OP(x) ((x) >> 30) +#define OP2(x) (((x) >> 22) & 0x07) +#define COND(x) (((x) >> 25) & 0x0f) +#define A(x) (((x) >> 29) & 0x01) + +#define OP_BRANCH 0 + +#define OP2_BPcc 0x1 +#define OP2_Bicc 0x2 +#define OP2_BPr 0x3 +#define OP2_FBPfcc 0x5 +#define OP2_FBfcc 0x6 + +/*ARGSUSED*/ +int +dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp) +{ + ftp->ftps_type = DTFTP_ENTRY; + ftp->ftps_pc = (uintptr_t)symp->st_value; + ftp->ftps_size = (size_t)symp->st_size; + ftp->ftps_noffs = 1; + ftp->ftps_offs[0] = 0; + + if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) { + dt_dprintf("fasttrap probe creation ioctl failed: %s\n", + strerror(errno)); + return (dt_set_errno(dtp, errno)); + } + + return (1); +} + +int +dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret) +{ + + uint32_t *text; + int i; + int srdepth = 0; + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); + + if ((text = malloc(symp->st_size + 4)) == NULL) { + dt_dprintf("mr sparkle: malloc() failed\n"); + return (DT_PROC_ERR); + } + + if (Pread(P, text, symp->st_size, symp->st_value) != symp->st_size) { + dt_dprintf("mr sparkle: Pread() failed\n"); + free(text); + return (DT_PROC_ERR); + } + + /* + * Leave a dummy instruction in the last slot to simplify edge + * conditions. + */ + text[symp->st_size / 4] = 0; + + ftp->ftps_type = DTFTP_RETURN; + ftp->ftps_pc = symp->st_value; + ftp->ftps_size = symp->st_size; + ftp->ftps_noffs = 0; + + + free(text); + if (ftp->ftps_noffs > 0) { + if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) { + dt_dprintf("fasttrap probe creation ioctl failed: %s\n", + strerror(errno)); + return (dt_set_errno(dtp, errno)); + } + } + + + return (ftp->ftps_noffs); +} + +/*ARGSUSED*/ +int +dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off) +{ + if (off & 0x3) + return (DT_PROC_ALIGN); + + ftp->ftps_type = DTFTP_OFFSETS; + ftp->ftps_pc = (uintptr_t)symp->st_value; + ftp->ftps_size = (size_t)symp->st_size; + ftp->ftps_noffs = 1; + ftp->ftps_offs[0] = off; + + if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) { + dt_dprintf("fasttrap probe creation ioctl failed: %s\n", + strerror(errno)); + return (dt_set_errno(dtp, errno)); + } + + return (1); +} + +/*ARGSUSED*/ +int +dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern) +{ + ulong_t i; + + ftp->ftps_type = DTFTP_OFFSETS; + ftp->ftps_pc = (uintptr_t)symp->st_value; + ftp->ftps_size = (size_t)symp->st_size; + ftp->ftps_noffs = 0; + + /* + * If we're matching against everything, just iterate through each + * instruction in the function, otherwise look for matching offset + * names by constructing the string and comparing it against the + * pattern. + */ + if (strcmp("*", pattern) == 0) { + for (i = 0; i < symp->st_size; i += 4) { + ftp->ftps_offs[ftp->ftps_noffs++] = i; + } + } else { + char name[sizeof (i) * 2 + 1]; + + for (i = 0; i < symp->st_size; i += 4) { + (void) sprintf(name, "%lx", i); + if (gmatch(name, pattern)) + ftp->ftps_offs[ftp->ftps_noffs++] = i; + } + } + + if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) { + dt_dprintf("fasttrap probe creation ioctl failed: %s\n", + strerror(errno)); + return (dt_set_errno(dtp, errno)); + } + + return (ftp->ftps_noffs); +} Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Tue Feb 10 19:04:58 2015 (r278528) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Tue Feb 10 19:41:30 2015 (r278529) @@ -169,12 +169,12 @@ write_objects(iidesc_t *idp, ctf_buf_t * { ushort_t id = (idp ? idp->ii_dtype->t_id : 0); - ctf_buf_write(b, &id, sizeof (id)); - if (target_requires_swap) { SWAP_16(id); } + ctf_buf_write(b, &id, sizeof (id)); + debug(3, "Wrote object %s (%d)\n", (idp ? idp->ii_name : "(null)"), id); } Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Tue Feb 10 19:04:58 2015 (r278528) +++ head/cddl/lib/Makefile Tue Feb 10 19:41:30 2015 (r278529) @@ -27,7 +27,8 @@ _libzpool= libzpool .endif .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" + ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" || \ + ${MACHINE_CPUARCH} == "arm" _drti= drti _libdtrace= libdtrace .endif Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Tue Feb 10 19:04:58 2015 (r278528) +++ head/cddl/lib/libdtrace/Makefile Tue Feb 10 19:41:30 2015 (r278529) @@ -81,6 +81,10 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/ut CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips +.elif ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/arm +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/arm +.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/arm .elif ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Tue Feb 10 19:04:58 2015 (r278528) +++ head/cddl/usr.sbin/Makefile Tue Feb 10 19:41:30 2015 (r278529) @@ -30,6 +30,12 @@ _plockstat= plockstat .endif .endif +.if ${MACHINE_CPUARCH} == "arm" +_dtrace= dtrace +_dtruss= dtruss +_lockstat= lockstat +.endif + .if ${MACHINE_CPUARCH} == "mips" _dtrace= dtrace .endif Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Feb 10 19:04:58 2015 (r278528) +++ head/lib/Makefile Tue Feb 10 19:41:30 2015 (r278529) @@ -284,6 +284,12 @@ _libsmb= libsmb _libsmb= libsmb .endif +.if ${MACHINE_CPUARCH} == "arm" +_libsmb= libsmb +_libproc= libproc +_librtld_db= librtld_db +.endif + .if ${MK_OPENSSL} != "no" _libmp= libmp .endif Modified: head/lib/libproc/proc_bkpt.c ============================================================================== --- head/lib/libproc/proc_bkpt.c Tue Feb 10 19:04:58 2015 (r278528) +++ head/lib/libproc/proc_bkpt.c Tue Feb 10 19:41:30 2015 (r278529) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #elif defined(__powerpc__) #define BREAKPOINT_INSTR 0x7fe00008 /* trap */ #define BREAKPOINT_INSTR_SZ 4 +#elif defined(__arm__) +#define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */ +#define BREAKPOINT_INSTR_SZ 4 #else #error "Add support for your architecture" #endif Modified: head/lib/libproc/proc_regs.c ============================================================================== --- head/lib/libproc/proc_regs.c Tue Feb 10 19:04:58 2015 (r278528) +++ head/lib/libproc/proc_regs.c Tue Feb 10 19:41:30 2015 (r278529) @@ -56,6 +56,8 @@ proc_regget(struct proc_handle *phdl, pr case REG_PC: #if defined(__amd64__) *regvalue = regs.r_rip; +#elif defined(__arm__) + *regvalue = regs.r_pc; #elif defined(__i386__) *regvalue = regs.r_eip; #elif defined(__mips__) @@ -67,6 +69,8 @@ proc_regget(struct proc_handle *phdl, pr case REG_SP: #if defined(__amd64__) *regvalue = regs.r_rsp; +#elif defined(__arm__) + *regvalue = regs.r_sp; #elif defined(__i386__) *regvalue = regs.r_esp; #elif defined(__mips__) @@ -99,6 +103,8 @@ proc_regset(struct proc_handle *phdl, pr case REG_PC: #if defined(__amd64__) regs.r_rip = regvalue; +#elif defined(__arm__) + regs.r_pc = regvalue; #elif defined(__i386__) regs.r_eip = regvalue; #elif defined(__mips__) @@ -110,6 +116,8 @@ proc_regset(struct proc_handle *phdl, pr case REG_SP: #if defined(__amd64__) regs.r_rsp = regvalue; +#elif defined(__arm__) + regs.r_sp = regvalue; #elif defined(__i386__) regs.r_esp = regvalue; #elif defined(__mips__) Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Tue Feb 10 19:04:58 2015 (r278528) +++ head/sys/arm/arm/exception.S Tue Feb 10 19:41:30 2015 (r278529) @@ -48,11 +48,26 @@ #include "assym.s" +#include "opt_kdtrace.h" #include #include #include __FBSDID("$FreeBSD$"); +#ifdef KDTRACE_HOOKS + .bss + .align 4 + .global _C_LABEL(dtrace_invop_jump_addr) +_C_LABEL(dtrace_invop_jump_addr): + .word 0 + .word 0 + + .global _C_LABEL(dtrace_invop_calltrap_addr) +_C_LABEL(dtrace_invop_calltrap_addr): + .word 0 + .word 0 +#endif + .text .align 2 Modified: head/sys/arm/arm/identcpu.c ============================================================================== --- head/sys/arm/arm/identcpu.c Tue Feb 10 19:04:58 2015 (r278528) +++ head/sys/arm/arm/identcpu.c Tue Feb 10 19:41:30 2015 (r278529) @@ -387,7 +387,7 @@ identify_arm_cpu(void) u_int8_t type, linesize; int i; - cpuid = cpu_id(); + cpuid = cpu_ident(); if (cpuid == 0) { printf("Processor failed probe - no CPU ID\n"); Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Tue Feb 10 19:04:58 2015 (r278528) +++ head/sys/arm/arm/trap.c Tue Feb 10 19:41:30 2015 (r278529) @@ -78,6 +78,9 @@ * Created : 28/11/94 */ +#ifdef KDTRACE_HOOKS +#include +#endif #include __FBSDID("$FreeBSD$"); @@ -427,6 +430,13 @@ dab_fatal(struct trapframe *tf, u_int fs { const char *mode; +#ifdef KDTRACE_HOOKS + if (!TRAP_USERMODE(tf)) { + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(tf, far & FAULT_TYPE_MASK)) + return (0); + } +#endif + mode = TRAP_USERMODE(tf) ? "user" : "kernel"; disable_interrupts(PSR_I|PSR_F); Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Tue Feb 10 19:04:58 2015 (r278528) +++ head/sys/arm/conf/BEAGLEBONE Tue Feb 10 19:41:30 2015 (r278529) @@ -27,6 +27,12 @@ include "../ti/am335x/std.am335x" makeoptions WITHOUT_MODULES="ahc" +# DTrace support +options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # all architectures - kernel ELF linker loads CTF data +makeoptions WITH_CTF=1 +makeoptions MODULES_OVERRIDE="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt" + options HZ=100 options SCHED_4BSD # 4BSD scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Tue Feb 10 19:04:58 2015 (r278528) +++ head/sys/arm/include/cpufunc.h Tue Feb 10 19:41:30 2015 (r278529) @@ -175,7 +175,7 @@ struct cpu_functions { extern struct cpu_functions cpufuncs; extern u_int cputype; -#define cpu_id() cpufuncs.cf_id() +#define cpu_ident() cpufuncs.cf_id() #define cpu_cpwait() cpufuncs.cf_cpwait() #define cpu_control(c, e) cpufuncs.cf_control(c, e) Added: head/sys/cddl/contrib/opensolaris/uts/arm/dtrace/fasttrap_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/arm/dtrace/fasttrap_isa.c Tue Feb 10 19:41:30 2015 (r278529) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +/* + * XXX: Placeholder for ARM fasttrap code + */ Added: head/sys/cddl/contrib/opensolaris/uts/arm/sys/fasttrap_isa.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/arm/sys/fasttrap_isa.h Tue Feb 10 19:41:30 2015 (r278529) @@ -0,0 +1,94 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_ISA_H +#define _FASTTRAP_ISA_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This is our reserved trap instruction: ta 0x38 + */ +#define FASTTRAP_INSTR 0x91d02038 + +#define FASTTRAP_SUNWDTRACE_SIZE 128 + +typedef uint32_t fasttrap_instr_t; + +typedef struct fasttrap_machtp { + fasttrap_instr_t ftmt_instr; /* original instruction */ + uintptr_t ftmt_dest; /* destination of DCTI */ + uint8_t ftmt_type; /* emulation type */ + uint8_t ftmt_flags; /* emulation flags */ + uint8_t ftmt_cc; /* which cc to look at */ + uint8_t ftmt_code; /* branch condition */ +} fasttrap_machtp_t; + +#define ftt_instr ftt_mtp.ftmt_instr +#define ftt_dest ftt_mtp.ftmt_dest +#define ftt_type ftt_mtp.ftmt_type +#define ftt_flags ftt_mtp.ftmt_flags +#define ftt_cc ftt_mtp.ftmt_cc +#define ftt_code ftt_mtp.ftmt_code + +#define FASTTRAP_T_COMMON 0x00 /* common case -- no emulation */ +#define FASTTRAP_T_CCR 0x01 /* integer condition code branch */ +#define FASTTRAP_T_FCC 0x02 /* floating-point branch */ +#define FASTTRAP_T_REG 0x03 /* register predicated branch */ +#define FASTTRAP_T_ALWAYS 0x04 /* branch always */ +#define FASTTRAP_T_CALL 0x05 /* call instruction */ +#define FASTTRAP_T_JMPL 0x06 /* jmpl instruction */ +#define FASTTRAP_T_RDPC 0x07 /* rdpc instruction */ +#define FASTTRAP_T_RETURN 0x08 /* return instruction */ + +/* + * For performance rather than correctness. + */ +#define FASTTRAP_T_SAVE 0x10 /* save instruction (func entry only) */ +#define FASTTRAP_T_RESTORE 0x11 /* restore instruction */ +#define FASTTRAP_T_OR 0x12 /* mov instruction */ +#define FASTTRAP_T_SETHI 0x13 /* sethi instruction (includes nop) */ + +#define FASTTRAP_F_ANNUL 0x01 /* branch is annulled */ +#define FASTTRAP_F_RETMAYBE 0x02 /* not definitely a return site */ + +#define FASTTRAP_AFRAMES 3 +#define FASTTRAP_RETURN_AFRAMES 4 +#define FASTTRAP_ENTRY_AFRAMES 3 +#define FASTTRAP_OFFSET_AFRAMES 3 + + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Feb 10 19:04:58 2015 (r278528) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Feb 10 19:41:30 2015 (r278529) @@ -11880,7 +11880,7 @@ err: int i; *factor = 1; -#if defined(__amd64__) || defined(__mips__) || defined(__powerpc__) +#if defined(__amd64__) || defined(__arm__) || defined(__mips__) || defined(__powerpc__) /* * FreeBSD isn't good at limiting the amount of memory we * ask to malloc, so let's place a limit here before trying Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue Feb 10 19:04:58 2015 (r278528) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue Feb 10 19:41:30 2015 (r278529) @@ -2434,6 +2434,13 @@ extern void dtrace_helpers_destroy(proc_ #define DTRACE_INVOP_MFLR_R0 5 #define DTRACE_INVOP_NOP 6 +#elif defined(__arm__) + +#define DTRACE_INVOP_PUSHM 1 +#define DTRACE_INVOP_POPM 2 +#define DTRACE_INVOP_B 3 + + #endif #ifdef __cplusplus Added: head/sys/cddl/dev/dtrace/arm/dtrace_asm.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Tue Feb 10 19:41:30 2015 (r278529) @@ -0,0 +1,197 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#define _ASM +#define _LOCORE +#define LOCORE + +#include +#include + +#include +#include + +#include "assym.s" + +/* +void dtrace_membar_producer(void) +*/ +ENTRY(dtrace_membar_producer) + RET +END(dtrace_membar_producer) + +/* +void dtrace_membar_consumer(void) +*/ +ENTRY(dtrace_membar_consumer) + RET +END(dtrace_membar_consumer) + +/* +dtrace_icookie_t dtrace_interrupt_disable(void) +*/ +ENTRY(dtrace_interrupt_disable) + mrs r0, cpsr + mov r1, r0 + orr r1, r1, #(PSR_I | PSR_F) + msr cpsr_c, r1 + RET +END(dtrace_interrupt_disable) + +/* +void dtrace_interrupt_enable(dtrace_icookie_t cookie) +*/ +ENTRY(dtrace_interrupt_enable) + and r0, r0, #(PSR_I | PSR_F) + mrs r1, cpsr + bic r1, r1, #(PSR_I | PSR_F) + orr r1, r1, r0 + msr cpsr_c, r1 + RET +END(dtrace_interrupt_enable) +/* +uint8_t +dtrace_fuword8_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword8_nocheck) + ldrb r3, [r0] + mov r0, r3 + RET +END(dtrace_fuword8_nocheck) + +/* +uint16_t +dtrace_fuword16_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword16_nocheck) + ldrh r3, [r0] + mov r0, r3 + RET +END(dtrace_fuword16_nocheck) + +/* +uint32_t +dtrace_fuword32_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword32_nocheck) + ldr r3, [r0] + mov r0, r3 + RET +END(dtrace_fuword32_nocheck) + +/* +uint64_t +dtrace_fuword64_nocheck(void *addr) +*/ +ENTRY(dtrace_fuword64_nocheck) + ldm r0, {r2, r3} + + mov r0, r2 + mov r1, r3 +#if defined(__BIG_ENDIAN__) +/* big endian */ + mov r0, r3 + mov r1, r2 +#else +/* little endian */ + mov r0, r2 + mov r1, r3 + +#endif + RET +END(dtrace_fuword64_nocheck) + +/* +void +dtrace_copy(uintptr_t uaddr, uintptr_t kaddr, size_t size) +*/ +ENTRY(dtrace_copy) + stmfd sp!, {r4-r5} /* stack is 8 byte aligned */ + teq r2, #0x00000000 + mov r5, #0x00000000 + beq 2f + +1: ldrb r4, [r0], #0x0001 + add r5, r5, #0x00000001 + strb r4, [r1], #0x0001 + teqne r5, r2 + bne 1b + +2: ldmfd sp!, {r4-r5} /* stack is 8 byte aligned */ + RET +END(dtrace_copy) + +/* +void +dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +XXX: Check for flags? +*/ +ENTRY(dtrace_copystr) + stmfd sp!, {r4-r5} /* stack is 8 byte aligned */ + teq r2, #0x00000000 + mov r5, #0x00000000 + beq 2f + +1: ldrb r4, [r0], #0x0001 + add r5, r5, #0x00000001 + teq r4, #0x00000000 + strb r4, [r1], #0x0001 + teqne r5, r2 + bne 1b + +2: ldmfd sp!, {r4-r5} /* stack is 8 byte aligned */ + RET +END(dtrace_copystr) + +/* +void +vpanic(const char *format, va_list alist) +*/ +ENTRY(vpanic) /* Initial stack layout: */ +vpanic_common: + RET +END(vpanic) + +/* +void +dtrace_vpanic(const char *format, va_list alist) +*/ +ENTRY(dtrace_vpanic) /* Initial stack layout: */ + b vpanic + RET +END(dtrace_vpanic) /* Initial stack layout: */ + +/* +uintptr_t +dtrace_caller(int aframes) +*/ +ENTRY(dtrace_caller) + mov r0, #-1 + RET +END(dtrace_caller) Added: head/sys/cddl/dev/dtrace/arm/dtrace_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/arm/dtrace_isa.c Tue Feb 10 19:41:30 2015 (r278529) @@ -0,0 +1,356 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "regset.h" + +/* + * Wee need some reasonable default to prevent backtrace code + * from wandering too far + */ +#define MAX_FUNCTION_SIZE 0x10000 +#define MAX_PROLOGUE_SIZE 0x100 + + +uint8_t dtrace_fuword8_nocheck(void *); +uint16_t dtrace_fuword16_nocheck(void *); +uint32_t dtrace_fuword32_nocheck(void *); +uint64_t dtrace_fuword64_nocheck(void *); + +void +dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, + uint32_t *intrpc) +{ + u_int32_t *frame, *lastframe; + int scp_offset; + int depth = 0; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + frame = (u_int32_t *)__builtin_frame_address(0);; + lastframe = NULL; + scp_offset = -(get_pc_str_offset() >> 2); + + while ((frame != NULL) && (depth < pcstack_limit)) { + db_addr_t scp; +#if 0 + u_int32_t savecode; + int r; + u_int32_t *rp; +#endif + + /* + * In theory, the SCP isn't guaranteed to be in the function + * that generated the stack frame. We hope for the best. + */ + scp = frame[FR_SCP]; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = scp; + } + +#if 0 + savecode = ((u_int32_t *)scp)[scp_offset]; + if ((savecode & 0x0e100000) == 0x08000000) { + /* Looks like an STM */ + rp = frame - 4; + for (r = 10; r >= 0; r--) { + if (savecode & (1 << r)) { + /* register r == *rp-- */ + } + } + } +#endif + + /* + * Switch to next frame up + */ + if (frame[FR_RFP] == 0) + break; /* Top of stack */ + + lastframe = frame; + frame = (u_int32_t *)(frame[FR_RFP]); + + if (INKERNEL((int)frame)) { + /* staying in kernel */ + if (frame <= lastframe) { + /* bad frame pointer */ + break; + } + } + else + break; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} + +void +dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) +{ + printf("IMPLEMENT ME: %s\n", __func__); +} + +int +dtrace_getustackdepth(void) +{ + printf("IMPLEMENT ME: %s\n", __func__); + return (0); +} + +void +dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) +{ + printf("IMPLEMENT ME: %s\n", __func__); +} + +/*ARGSUSED*/ +uint64_t +dtrace_getarg(int arg, int aframes) +{ +/* struct arm_frame *fp = (struct arm_frame *)dtrace_getfp();*/ + + return (0); +} + +int +dtrace_getstackdepth(int aframes) +{ + u_int32_t *frame, *lastframe; + int scp_offset; + int depth = 1; + + frame = (u_int32_t *)__builtin_frame_address(0);; + lastframe = NULL; + scp_offset = -(get_pc_str_offset() >> 2); + + while (frame != NULL) { + db_addr_t scp; +#if 0 + u_int32_t savecode; + int r; + u_int32_t *rp; +#endif + + /* + * In theory, the SCP isn't guaranteed to be in the function + * that generated the stack frame. We hope for the best. + */ + scp = frame[FR_SCP]; + + depth++; + + /* + * Switch to next frame up + */ + if (frame[FR_RFP] == 0) + break; /* Top of stack */ + + lastframe = frame; + frame = (u_int32_t *)(frame[FR_RFP]); + + if (INKERNEL((int)frame)) { + /* staying in kernel */ + if (frame <= lastframe) { + /* bad frame pointer */ + break; + } + } + else + break; + } + + if (depth < aframes) + return 0; + else + return depth - aframes; + +} + +ulong_t +dtrace_getreg(struct trapframe *rp, uint_t reg) +{ + printf("IMPLEMENT ME: %s\n", __func__); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 20:15:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A09C3BB; Tue, 10 Feb 2015 20:15:51 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 542AC81; Tue, 10 Feb 2015 20:15:50 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t1AKFoaE034106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Feb 2015 12:15:50 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t1AKFoXs034105; Tue, 10 Feb 2015 12:15:50 -0800 (PST) (envelope-from jmg) Date: Tue, 10 Feb 2015 12:15:50 -0800 From: John-Mark Gurney To: John Baldwin Subject: Re: svn commit: r278479 - in head: etc sys/kern Message-ID: <20150210201550.GH1953@funkthat.com> References: <201502092313.t19NDpoS083043@svn.freebsd.org> <1516483.e0EXgdk9ur@ralph.baldwin.cx> <2907775.GXqUUp6Hz6@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2907775.GXqUUp6Hz6@ralph.baldwin.cx> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 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-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Tue, 10 Feb 2015 12:15:50 -0800 (PST) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , Rui Paulo , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 20:15:51 -0000 John Baldwin wrote this message on Tue, Feb 10, 2015 at 10:36 -0500: > > I think devd grows these things because it's easier than teaching the > > devctl interface to support multiple listeners. > > That wasn't really my question. My question was if we want distinct streams > or if we want want unified stream. Having a unified stream might very well > make sense (and if so we could rename devd to make that more obvious). The biggested issue that I see w/ using devd as the gateway is that as we add more events, devd will now have to be woken up for ALL events, even when the even has no listeners for it... If we keep adding events, this will be very bad for laptop battery life... This is becoming a standard pub/sub type problem, and there is plenty of research/programs out there that already does this... As someone mentioned earlier, it seems like using kqueue is starting to make more sense for this type of thing where various programs can select what they get woken up for... -- 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 Tue Feb 10 20:21:01 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0A036DA; Tue, 10 Feb 2015 20:21:01 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57ACE16E; Tue, 10 Feb 2015 20:21:01 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YLHIm-000NVa-A9; Tue, 10 Feb 2015 23:20:56 +0300 Date: Tue, 10 Feb 2015 23:20:56 +0300 From: Slawa Olhovchenkov To: Rui Paulo Subject: Re: svn commit: r278479 - in head: etc sys/kern Message-ID: <20150210202056.GM3698@zxy.spb.ru> References: MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 20:21:01 -0000 On Tue, Feb 10, 2015 at 06:55:28PM +0000, Rui Paulo wrote: > On Feb 10, 2015, at 10:52 AM, Slawa Olhovchenkov wrote: > For common case (I am not talk about current devd implementation -- I > am don't have any inforamtion/metrics/etc) routing and processing > events may be sensitive to delay and ordering: may be exist > requirement 'delay not more then 700ns', may be exist requirement > 'next event process only after complete process previos event'. And > some event handling may be very CPU/disk/etc consumption. Need to good > think over and design API and architecure. > š > routing events do not come over devd (or any other /dev device): > there's a routing socket specifically tailored for that purpose. I am talk abot this: nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x03eb"; match "product" "0x2109"; action "kldload -n uftdi"; }; > šFor that type of latency, you probably don't want to be crossing > the kernel/userland barrier too often (or never). We have action for coredump. And have action for automount (when inserting USB disk). Must be coredump wait for complete mounting USB disk? For flapping USB disk need to start multiple mount script? From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 20:45:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F394D82; Tue, 10 Feb 2015 20:45: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE134651; Tue, 10 Feb 2015 20:45:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AKjeBS011230; Tue, 10 Feb 2015 20:45:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AKjemC011229; Tue, 10 Feb 2015 20:45:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201502102045.t1AKjemC011229@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 10 Feb 2015 20:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278530 - head/lib/libc/nls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 20:45:41 -0000 Author: bdrewery Date: Tue Feb 10 20:45:40 2015 New Revision: 278530 URL: https://svnweb.freebsd.org/changeset/base/278530 Log: When catopen(3) returns an error, it caches the result of that error from r202992. The refcount on the cache entry is not initialized, so any attempt to clean the cache will skip over this item since it likely has a >0 value. This change is currently a NOP. There is work in progress to support freeing the cache which requires this change to avoid a memory leak. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/nls/msgcat.c Modified: head/lib/libc/nls/msgcat.c ============================================================================== --- head/lib/libc/nls/msgcat.c Tue Feb 10 19:41:30 2015 (r278529) +++ head/lib/libc/nls/msgcat.c Tue Feb 10 20:45:40 2015 (r278530) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); np->name = strdup(n); \ np->path = NULL; \ np->catd = NLERR; \ + np->refcount = 0; \ np->lang = (l == NULL) ? NULL : \ strdup(l); \ np->caterrno = e; \ From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 21:33:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 517A0E63; Tue, 10 Feb 2015 21:33: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BB82BB6; Tue, 10 Feb 2015 21:33:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1ALXXw5035613; Tue, 10 Feb 2015 21:33:33 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1ALXWqL035610; Tue, 10 Feb 2015 21:33:32 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201502102133.t1ALXWqL035610@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 10 Feb 2015 21:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278532 - in head/sys/dev: malo mwl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 21:33:33 -0000 Author: marius Date: Tue Feb 10 21:33:32 2015 New Revision: 278532 URL: https://svnweb.freebsd.org/changeset/base/278532 Log: Fix compilation with GCC in the PAE case. MFC after: 3 days Modified: head/sys/dev/malo/if_malo.c head/sys/dev/mwl/if_mwl.c Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Tue Feb 10 21:30:20 2015 (r278531) +++ head/sys/dev/malo/if_malo.c Tue Feb 10 21:33:32 2015 (r278532) @@ -165,7 +165,7 @@ static void malo_bar0_write4(struct malo_softc *sc, bus_size_t off, uint32_t val) { DPRINTF(sc, MALO_DEBUG_FW, "%s: off 0x%jx val 0x%x\n", - __func__, (intmax_t)off, val); + __func__, (uintmax_t)off, val); bus_space_write_4(sc->malo_io0t, sc->malo_io0h, off, val); } @@ -510,9 +510,10 @@ malo_desc_setup(struct malo_softc *sc, c ds = dd->dd_desc; memset(ds, 0, dd->dd_desc_len); - DPRINTF(sc, MALO_DEBUG_RESET, "%s: %s DMA map: %p (%lu) -> %p (%lu)\n", + DPRINTF(sc, MALO_DEBUG_RESET, + "%s: %s DMA map: %p (%lu) -> 0x%jx (%lu)\n", __func__, dd->dd_name, ds, (u_long) dd->dd_desc_len, - (caddr_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len); + (uintmax_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len); return 0; fail2: @@ -877,10 +878,9 @@ malo_printrxbuf(const struct malo_rxbuf const struct malo_rxdesc *ds = bf->bf_desc; uint32_t status = le32toh(ds->status); - printf("R[%2u] (DS.V:%p DS.P:%p) NEXT:%08x DATA:%08x RC:%02x%s\n" + printf("R[%2u] (DS.V:%p DS.P:0x%jx) NEXT:%08x DATA:%08x RC:%02x%s\n" " STAT:%02x LEN:%04x SNR:%02x NF:%02x CHAN:%02x" - " RATE:%02x QOS:%04x\n", - ix, ds, (const struct malo_desc *)bf->bf_daddr, + " RATE:%02x QOS:%04x\n", ix, ds, (uintmax_t)bf->bf_daddr, le32toh(ds->physnext), le32toh(ds->physbuffdata), ds->rxcontrol, ds->rxcontrol != MALO_RXD_CTRL_DRIVER_OWN ? @@ -896,8 +896,7 @@ malo_printtxbuf(const struct malo_txbuf uint32_t status = le32toh(ds->status); printf("Q%u[%3u]", qnum, ix); - printf(" (DS.V:%p DS.P:%p)\n", - ds, (const struct malo_txdesc *)bf->bf_daddr); + printf(" (DS.V:%p DS.P:0x%jx)\n", ds, (uintmax_t)bf->bf_daddr); printf(" NEXT:%08x DATA:%08x LEN:%04x STAT:%08x%s\n", le32toh(ds->physnext), le32toh(ds->pktptr), le16toh(ds->pktlen), status, Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Tue Feb 10 21:30:20 2015 (r278531) +++ head/sys/dev/mwl/if_mwl.c Tue Feb 10 21:33:32 2015 (r278532) @@ -2056,9 +2056,10 @@ mwl_desc_setup(struct mwl_softc *sc, con ds = dd->dd_desc; memset(ds, 0, dd->dd_desc_len); - DPRINTF(sc, MWL_DEBUG_RESET, "%s: %s DMA map: %p (%lu) -> %p (%lu)\n", + DPRINTF(sc, MWL_DEBUG_RESET, + "%s: %s DMA map: %p (%lu) -> 0x%jx (%lu)\n", __func__, dd->dd_name, ds, (u_long) dd->dd_desc_len, - (caddr_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len); + (uintmax_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len); return 0; fail2: @@ -4688,11 +4689,10 @@ mwl_printrxbuf(const struct mwl_rxbuf *b const struct mwl_rxdesc *ds = bf->bf_desc; uint32_t status = le32toh(ds->Status); - printf("R[%2u] (DS.V:%p DS.P:%p) NEXT:%08x DATA:%08x RC:%02x%s\n" + printf("R[%2u] (DS.V:%p DS.P:0x%jx) NEXT:%08x DATA:%08x RC:%02x%s\n" " STAT:%02x LEN:%04x RSSI:%02x CHAN:%02x RATE:%02x QOS:%04x HT:%04x\n", - ix, ds, (const struct mwl_desc *)bf->bf_daddr, - le32toh(ds->pPhysNext), le32toh(ds->pPhysBuffData), - ds->RxControl, + ix, ds, (uintmax_t)bf->bf_daddr, le32toh(ds->pPhysNext), + le32toh(ds->pPhysBuffData), ds->RxControl, ds->RxControl != EAGLE_RXD_CTRL_DRIVER_OWN ? "" : (status & EAGLE_RXD_STATUS_OK) ? " *" : " !", ds->Status, le16toh(ds->PktLen), ds->RSSI, ds->Channel, @@ -4706,8 +4706,7 @@ mwl_printtxbuf(const struct mwl_txbuf *b uint32_t status = le32toh(ds->Status); printf("Q%u[%3u]", qnum, ix); - printf(" (DS.V:%p DS.P:%p)\n", - ds, (const struct mwl_txdesc *)bf->bf_daddr); + printf(" (DS.V:%p DS.P:0x%jx)\n", ds, (uintmax_t)bf->bf_daddr); printf(" NEXT:%08x DATA:%08x LEN:%04x STAT:%08x%s\n", le32toh(ds->pPhysNext), le32toh(ds->PktPtr), le16toh(ds->PktLen), status, From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 22:23:39 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0B068B3; Tue, 10 Feb 2015 22:23:38 +0000 (UTC) Received: from pmta2.delivery10.ore.mailhop.org (pmta2.delivery10.ore.mailhop.org [54.69.62.154]) by mx1.freebsd.org (Postfix) with ESMTP id B87781E8; Tue, 10 Feb 2015 22:23:38 +0000 (UTC) Received: from smtp2.ore.mailhop.org (172.31.36.112) by pmta2.delivery1.ore.mailhop.org id hra2eo20u50d; Tue, 10 Feb 2015 20:32:41 +0000 (envelope-from ) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp2.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YLHU6-000585-TN; Tue, 10 Feb 2015 20:32:39 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t1AKWbcJ083573; Tue, 10 Feb 2015 13:32:37 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19pzzN6L/PMgMaSvJE571gA Message-ID: <1423600357.80968.25.camel@freebsd.org> Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Ian Lepore To: John-Mark Gurney Date: Tue, 10 Feb 2015 13:32:37 -0700 In-Reply-To: <20150210201550.GH1953@funkthat.com> References: <201502092313.t19NDpoS083043@svn.freebsd.org> <1516483.e0EXgdk9ur@ralph.baldwin.cx> <2907775.GXqUUp6Hz6@ralph.baldwin.cx> <20150210201550.GH1953@funkthat.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , "src-committers@freebsd.org" , Rui Paulo , John Baldwin , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 22:23:39 -0000 On Tue, 2015-02-10 at 12:15 -0800, John-Mark Gurney wrote: > John Baldwin wrote this message on Tue, Feb 10, 2015 at 10:36 -0500: > > > I think devd grows these things because it's easier than teaching the > > > devctl interface to support multiple listeners. > > > > That wasn't really my question. My question was if we want distinct streams > > or if we want want unified stream. Having a unified stream might very well > > make sense (and if so we could rename devd to make that more obvious). > > The biggested issue that I see w/ using devd as the gateway is that > as we add more events, devd will now have to be woken up for ALL events, > even when the even has no listeners for it... If we keep adding events, > this will be very bad for laptop battery life... > That's similar to my worry but for our apps at $work the problem extends to them as well... the kernel will wake up devd for lots of events it doesn't need to process, then it fans them out to our app which also gets woken for events that it's not interested in. Big iron in datacenters isn't going to have any problems with this, but embedded systems at the low end are still somewhat cycle-sensitive. The worrisome part is the creep. Right now it's just crashdumps, and that isn't going to add any overhead for $work, because our apps never crash (::grin::). But the floodgates are open and in a couple years it's going to be a lot of new kinds of events and a lot of new cycles consumed processing them in userland. > This is becoming a standard pub/sub type problem, and there is plenty > of research/programs out there that already does this... > > As someone mentioned earlier, it seems like using kqueue is starting > to make more sense for this type of thing where various programs can > select what they get woken up for... > Filtering at the source (or nearer to it) does seem to be one way to get everything that's good about a generic event notification daemon without all of the bad that will accumulate if we just stumble into it without a long term vision. I'm not as familiar with kevent specifics as I'd like to be, so I can't say it's a ready to use off the shelf solution, but it may be part of one. -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 22:23:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A624A9F2; Tue, 10 Feb 2015 22:23: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90F0F1F0; Tue, 10 Feb 2015 22:23:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AMNr2V060625; Tue, 10 Feb 2015 22:23:53 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AMNrW8060624; Tue, 10 Feb 2015 22:23:53 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201502102223.t1AMNrW8060624@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Tue, 10 Feb 2015 22:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278541 - head/usr.bin/w X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 22:23:53 -0000 Author: grembo (ports committer) Date: Tue Feb 10 22:23:52 2015 New Revision: 278541 URL: https://svnweb.freebsd.org/changeset/base/278541 Log: Add xo_finish() to w.c in case it's invoked as uptime Reviewed by: marcel Approved by: marcel Differential Revision: https://reviews.freebsd.org/D1821 Modified: head/usr.bin/w/w.c Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Tue Feb 10 22:05:57 2015 (r278540) +++ head/usr.bin/w/w.c Tue Feb 10 22:23:52 2015 (r278541) @@ -264,7 +264,9 @@ main(int argc, char *argv[]) if (header || wcmd == 0) { pr_header(&now, nusers); if (wcmd == 0) { - xo_close_container("uptime-information"); + xo_close_container("uptime-information"); + xo_finish(); + (void)kvm_close(kd); exit(0); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 23:18:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DCA2153; Tue, 10 Feb 2015 23:18: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7836F98F; Tue, 10 Feb 2015 23:18:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1ANIbUY085220; Tue, 10 Feb 2015 23:18:37 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1ANIb2N085219; Tue, 10 Feb 2015 23:18:37 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502102318.t1ANIb2N085219@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Tue, 10 Feb 2015 23:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278543 - head/games/fortune/datfiles X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 10 Feb 2015 23:18:37 -0000 Author: jmg Date: Tue Feb 10 23:18:36 2015 New Revision: 278543 URL: https://svnweb.freebsd.org/changeset/base/278543 Log: fetch has supported https for a while.. I would convert the url to https, but we still don't install a CA set by default... we even don't install the CA that authenticates www.FreeBSD.org.. Modified: head/games/fortune/datfiles/freebsd-tips Modified: head/games/fortune/datfiles/freebsd-tips ============================================================================== --- head/games/fortune/datfiles/freebsd-tips Tue Feb 10 22:29:07 2015 (r278542) +++ head/games/fortune/datfiles/freebsd-tips Tue Feb 10 23:18:36 2015 (r278543) @@ -443,7 +443,7 @@ on this system. Example entries are in % You can use "pkg info" to see a list of packages you have installed. % -You can use the 'fetch' command to retrieve files over ftp or http. +You can use the 'fetch' command to retrieve files over ftp, http or https. fetch http://www.FreeBSD.org/index.html From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 00:43:43 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B60E307; Wed, 11 Feb 2015 00:43:43 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtpout001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4790D2EF; Wed, 11 Feb 2015 00:43:42 +0000 (UTC) Received: from st11p02mm-spool002.mac.com ([17.172.220.247]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTP id <0NJL0067M0ORQB30@st11p02mm-asmtp001.mac.com>; Wed, 11 Feb 2015 00:43:40 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_07:2015-02-10,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502110005 MIME-version: 1.0 Received: from localhost ([17.172.220.163]) by st11p02mm-spool002.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTP id <0NJL00GZE0ORIA30@st11p02mm-spool002.mac.com>; Wed, 11 Feb 2015 00:43:39 +0000 (GMT) To: Konstantin Belousov From: Rui Paulo Subject: =?utf-8?B?UmU6IHN2biBjb21taXQ6IHIyNzg0NzMgLSBpbiBoZWFkL3N5czogYW1kNjQv?= =?utf-8?B?YW1kNjQgYW1kNjQvaW5jbHVkZSBhbWQ2NC92bW0gY29udHJpYi9kZXYvYWNw?= =?utf-8?B?aWNhL2luY2x1ZGUgaTM4Ni9pMzg2IGkzODYvaW5jbHVkZSB4ODYvYWNwaWNh?= =?utf-8?B?IHg4Ni9pbmNsdWRlIHg4Ni94ODYgeDg2L3hlbg==?= Date: Wed, 11 Feb 2015 00:43:39 +0000 (GMT) X-Mailer: iCloud MailClient15A99 MailServer14H18.17359 X-Originating-IP: [12.218.212.178] Message-id: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-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.18-1 Precedence: list List-Id: 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, 11 Feb 2015 00:43:43 -0000 On Feb 09, 2015, at 01:01 PM, Konstantin Belousov wrote:= =0A=0AAuthor: kib=0ADate: Mon Feb 9 21:00:56 2015=0ANew Revision: 278473=0A= URL: https://svnweb.freebsd.org/changeset/base/278473=0A=0ALog:=0AAdd x2AP= IC support. Enable it by default if CPU is capable. The=0Ahw.x2apic_enable= tunable allows disabling it from the loader prompt.=0A=C2=A0=0AThis break= s VMware Fusion when the host CPU has x2APIC support. =C2=A0In my case, mp= t(4) was unable to receive interrupts and USB was similarly broken. =C2=A0= It's possible that this is a VMware bug, but you might want to avoid turni= ng this on when running under the VMware hypervisor.= From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 00:58:17 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EAEC4F6; Wed, 11 Feb 2015 00:58: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 500793F7; Wed, 11 Feb 2015 00:58:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1B0wGWV032752; Wed, 11 Feb 2015 00:58:16 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1B0wGYZ032751; Wed, 11 Feb 2015 00:58:16 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502110058.t1B0wGYZ032751@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Wed, 11 Feb 2015 00:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278545 - 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.18-1 Precedence: list List-Id: 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, 11 Feb 2015 00:58:17 -0000 Author: rpaulo Date: Wed Feb 11 00:58:15 2015 New Revision: 278545 URL: https://svnweb.freebsd.org/changeset/base/278545 Log: Restore the data array in coredump(), but use a different style to calculate the length. Requested by: kib Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Feb 10 23:48:06 2015 (r278544) +++ head/sys/kern/kern_sig.c Wed Feb 11 00:58:15 2015 (r278545) @@ -3261,9 +3261,11 @@ coredump(struct thread *td) void *rl_cookie; off_t limit; int compress; - char data[MAXPATHLEN * 2 + 16]; /* space for devctl notification */ + char *data = NULL; char *fullpath, *freepath = NULL; size_t len; + static const char comm_name[] = "comm="; + static const char core_name[] = "core="; #ifdef COMPRESS_USER_CORES compress = compress_user_cores; @@ -3357,25 +3359,31 @@ close: */ if (coredump_devctl == 0) goto out; + len = MAXPATHLEN * 2 + sizeof(comm_name) - 1 + + sizeof(' ') + sizeof(core_name) - 1; + data = malloc(len, M_TEMP, M_WAITOK); + if (data == NULL) + goto out; if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) goto out; if (!coredump_sanitise_path(fullpath)) goto out; - snprintf(data, sizeof(data), "comm=%s ", fullpath); + snprintf(data, len, "%s%s ", comm_name, fullpath); free(freepath, M_TEMP); freepath = NULL; if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) goto out; if (!coredump_sanitise_path(fullpath)) goto out; - strlcat(data, "core=", sizeof(data)); - len = strlcat(data, fullpath, sizeof(data)); + strlcat(data, core_name, len); + strlcat(data, fullpath, len); devctl_notify("kernel", "signal", "coredump", data); out: #ifdef AUDIT audit_proc_coredump(td, name, error); #endif free(freepath, M_TEMP); + free(data, M_TEMP); free(name, M_TEMP); return (error); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 05:25:25 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 685A0D6; Wed, 11 Feb 2015 05:25: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 511F62ED; Wed, 11 Feb 2015 05:25:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1B5PPbf059374; Wed, 11 Feb 2015 05:25:25 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1B5PONC059370; Wed, 11 Feb 2015 05:25:24 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201502110525.t1B5PONC059370@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 11 Feb 2015 05:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278551 - in head: share/man/man4 sys/contrib/dev/ral sys/dev/ral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 05:25:25 -0000 Author: kevlo Date: Wed Feb 11 05:25:23 2015 New Revision: 278551 URL: https://svnweb.freebsd.org/changeset/base/278551 Log: Add preliminary support for the Ralink RT5390 and RT5392 chipsets. Committed over the D-Link DWA-525 rev A2 on amd64 with WPA. Modified: head/share/man/man4/ral.4 head/sys/contrib/dev/ral/microcode.h head/sys/contrib/dev/ral/rt2860.fw.uu head/sys/dev/ral/if_ral_pci.c head/sys/dev/ral/rt2860.c head/sys/dev/ral/rt2860reg.h Modified: head/share/man/man4/ral.4 ============================================================================== --- head/share/man/man4/ral.4 Wed Feb 11 02:43:58 2015 (r278550) +++ head/share/man/man4/ral.4 Wed Feb 11 05:25:23 2015 (r278551) @@ -42,7 +42,7 @@ if_ral_load="YES" The .Nm driver supports PCI/PCIe/CardBus wireless adapters based on the Ralink RT2500, -RT2501, RT2600, RT2700, RT2800 and RT3090 chipsets. +RT2501, RT2600, RT2700, RT2800, RT3090 and RT3900E chipsets. .Pp The RT2500 chipset is the first generation of 802.11b/g adapters from Ralink. It consists of two integrated chips, an RT2560 MAC/BBP and an RT2525 radio @@ -104,6 +104,13 @@ interfaces may be operated together with .Cm hostap interface to construct a wireless repeater device. .Pp +The RT3900E chipset is a single-chip 802.11n adapters from Ralink. +The MAC/Baseband Processor can be an RT5390 or RT5392. +The RT5390 chip operates in the 2GHz spectrum and supports 1 transmit path +and 1 receiver path (1T1R). +The RT5392 chip operates in the 2GHz spectrum and supports up to 2 transmit +paths and 2 receiver paths (2T2R). +.Pp The transmit speed is user-selectable or can be adapted automatically by the driver depending on the number of hardware transmission retries. For more information on configuring this device, see @@ -142,6 +149,7 @@ chipsets, including: .It "Compex WLP54G" Ta RT2560 Ta PCI .It "Conceptronic C54RC" Ta RT2560 Ta CardBus .It "Conceptronic C54Ri" Ta RT2560 Ta PCI +.It "D-Link DWA-525 rev A2" Ta RT5392 Ta PCI .It "Digitus DN-7001G-RA" Ta RT2560 Ta CardBus .It "Digitus DN-7006G-RA" Ta RT2560 Ta PCI .It "E-Tech WGPC02" Ta RT2560 Ta CardBus Modified: head/sys/contrib/dev/ral/microcode.h ============================================================================== --- head/sys/contrib/dev/ral/microcode.h Wed Feb 11 02:43:58 2015 (r278550) +++ head/sys/contrib/dev/ral/microcode.h Wed Feb 11 05:25:23 2015 (r278551) @@ -2268,24 +2268,24 @@ static const uint8_t rt2661[] = { }; static const uint8_t rt2860[] = { - 0x02, 0x03, 0x5b, 0x02, 0x02, 0xa6, 0x22, 0x22, 0xff, 0xff, 0xff, + 0x02, 0x02, 0xa3, 0x02, 0x02, 0x2e, 0x22, 0xff, 0xff, 0xff, 0xff, 0x02, 0x01, 0x2c, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0xdd, 0xc0, 0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18, 0xc2, 0xaf, 0x30, 0x45, 0x03, 0x12, 0x10, 0x09, 0x90, 0x04, 0x16, 0xe0, 0x30, 0xe3, 0x03, 0x74, 0x08, 0xf0, 0x90, 0x04, 0x14, 0xe0, 0x20, 0xe7, 0x03, 0x02, 0x00, 0xcb, 0x74, 0x80, 0xf0, 0x90, 0x70, 0x12, - 0xe0, 0xf5, 0x36, 0x90, 0x04, 0x04, 0xe0, 0x24, 0xcf, 0x60, 0x30, + 0xe0, 0xf5, 0x24, 0x90, 0x04, 0x04, 0xe0, 0x24, 0xcf, 0x60, 0x30, 0x14, 0x60, 0x42, 0x24, 0xe2, 0x60, 0x47, 0x14, 0x60, 0x55, 0x24, 0x21, 0x70, 0x60, 0xe5, 0x55, 0x24, 0xfe, 0x60, 0x07, 0x14, 0x60, 0x08, 0x24, 0x02, 0x70, 0x08, 0x7d, 0x01, 0x80, 0x28, 0x7d, 0x02, - 0x80, 0x24, 0x90, 0x70, 0x10, 0xe0, 0xf5, 0x50, 0x85, 0x36, 0x40, + 0x80, 0x24, 0x90, 0x70, 0x10, 0xe0, 0xf5, 0x50, 0x85, 0x24, 0x40, 0xd2, 0x01, 0x80, 0x3e, 0xe5, 0x55, 0x64, 0x03, 0x60, 0x04, 0xe5, - 0x55, 0x70, 0x04, 0x7d, 0x02, 0x80, 0x09, 0x85, 0x36, 0x41, 0xd2, - 0x02, 0x80, 0x29, 0xad, 0x55, 0xaf, 0x36, 0x12, 0x02, 0x82, 0x80, + 0x55, 0x70, 0x04, 0x7d, 0x02, 0x80, 0x09, 0x85, 0x24, 0x41, 0xd2, + 0x02, 0x80, 0x29, 0xad, 0x55, 0xaf, 0x24, 0x12, 0x02, 0x0a, 0x80, 0x20, 0x90, 0x70, 0x10, 0xe0, 0xf5, 0x47, 0x90, 0x70, 0x11, 0xe0, 0xf5, 0x44, 0x12, 0x10, 0x25, 0x80, 0x06, 0x90, 0x70, 0x10, 0xe0, - 0xf5, 0x45, 0xe4, 0xfd, 0xaf, 0x36, 0x12, 0x02, 0x82, 0xd2, 0x04, + 0xf5, 0x45, 0xe4, 0xfd, 0xaf, 0x24, 0x12, 0x02, 0x0a, 0xd2, 0x04, 0x90, 0x70, 0x13, 0xe4, 0xf0, 0x90, 0x70, 0x13, 0xe4, 0xf0, 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xf0, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, @@ -2302,54 +2302,54 @@ static const uint8_t rt2860[] = { 0x15, 0x50, 0x80, 0x02, 0xc2, 0x59, 0xd5, 0x53, 0x07, 0x30, 0x60, 0x04, 0x15, 0x46, 0xd2, 0x04, 0x30, 0x45, 0x03, 0x12, 0x10, 0x0f, 0xc2, 0x8d, 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, - 0xf0, 0xd0, 0xe0, 0x32, 0x90, 0x70, 0x2a, 0xe0, 0x30, 0xe1, 0x43, - 0xc2, 0xaf, 0x90, 0x70, 0x28, 0xe0, 0x90, 0x10, 0x1c, 0xf0, 0x90, - 0x70, 0x29, 0xe0, 0x90, 0x10, 0x1d, 0xf0, 0x90, 0x70, 0x2a, 0xe0, - 0x90, 0x10, 0x1e, 0xf0, 0x90, 0x10, 0x1c, 0xe0, 0xf5, 0x37, 0x90, - 0x10, 0x1e, 0xe0, 0x20, 0xe1, 0xf3, 0x90, 0x10, 0x1c, 0xe0, 0x90, - 0x70, 0x28, 0xf0, 0x90, 0x10, 0x1d, 0xe0, 0x90, 0x70, 0x29, 0xf0, - 0x90, 0x10, 0x1e, 0xe0, 0x90, 0x70, 0x2a, 0xf0, 0xc2, 0x05, 0xd2, - 0xaf, 0x22, 0x12, 0x02, 0xc8, 0x30, 0x45, 0x03, 0x12, 0x10, 0x03, - 0x30, 0x01, 0x06, 0x20, 0x09, 0x03, 0x12, 0x10, 0x1c, 0x30, 0x02, - 0x06, 0x20, 0x0a, 0x03, 0x12, 0x10, 0x1f, 0x30, 0x03, 0x06, 0x20, - 0x0b, 0x03, 0x12, 0x10, 0x1f, 0x30, 0x04, 0x06, 0x20, 0x0c, 0x03, - 0x12, 0x10, 0x22, 0x20, 0x13, 0x09, 0x20, 0x11, 0x06, 0xe5, 0x2b, - 0x45, 0x2c, 0x60, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x92, 0xa9, 0x12, - 0x03, 0x1c, 0x80, 0xbf, 0xc2, 0x43, 0xd2, 0x45, 0xe4, 0xf5, 0x20, - 0xf5, 0x21, 0xf5, 0x53, 0xf5, 0x46, 0xf5, 0x2b, 0xf5, 0x2c, 0xc2, - 0x42, 0xf5, 0x51, 0xf5, 0x52, 0xf5, 0x55, 0x90, 0x04, 0x18, 0x74, - 0x80, 0xf0, 0x90, 0x04, 0x1a, 0x74, 0x08, 0xf0, 0xc2, 0x1a, 0xc2, - 0x18, 0xc2, 0x1b, 0x22, 0xc8, 0xef, 0xc8, 0xe6, 0xfa, 0x08, 0xe6, - 0x4a, 0x60, 0x0c, 0xc8, 0xef, 0xc8, 0x08, 0xe6, 0x16, 0x18, 0x70, - 0x01, 0x16, 0xc3, 0x22, 0xed, 0x24, 0xff, 0xfd, 0xec, 0x34, 0xff, - 0xc8, 0xef, 0xc8, 0xf6, 0x08, 0xc6, 0xed, 0xc6, 0xd3, 0x22, 0xd0, - 0x83, 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, - 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, - 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, - 0xa3, 0xa3, 0x80, 0xdf, 0xef, 0xf4, 0x60, 0x1f, 0xe4, 0xfe, 0x12, - 0x03, 0x67, 0xe0, 0xb4, 0xff, 0x12, 0x12, 0x03, 0x67, 0xef, 0xf0, - 0x74, 0x1c, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5, 0x83, 0xed, - 0xf0, 0x22, 0x0e, 0xbe, 0x04, 0xe3, 0x22, 0xc0, 0xe0, 0xc0, 0xf0, - 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x08, 0xc2, 0xaf, - 0x30, 0x45, 0x03, 0x12, 0x10, 0x06, 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, - 0x82, 0xd0, 0x83, 0xd0, 0xf0, 0xd0, 0xe0, 0x32, 0xc2, 0xaf, 0x12, - 0x00, 0x06, 0x12, 0x02, 0x09, 0x12, 0x02, 0xe1, 0xe4, 0xf5, 0x22, - 0xf5, 0x47, 0x90, 0x04, 0x00, 0x74, 0x80, 0xf0, 0xd2, 0xaf, 0x22, - 0x75, 0x89, 0x02, 0xe4, 0xf5, 0x8c, 0xf5, 0x8a, 0xf5, 0x88, 0xf5, - 0xb8, 0xf5, 0xe8, 0x75, 0x90, 0x18, 0xd2, 0x8c, 0x75, 0xa8, 0x05, - 0x22, 0xef, 0x60, 0x03, 0x1f, 0x80, 0xfa, 0x22, 0xff, 0xc0, 0x26, + 0xf0, 0xd0, 0xe0, 0x32, 0x12, 0x02, 0x50, 0x30, 0x45, 0x03, 0x12, + 0x10, 0x03, 0x30, 0x01, 0x06, 0x20, 0x09, 0x03, 0x12, 0x10, 0x1c, + 0x30, 0x02, 0x06, 0x20, 0x0a, 0x03, 0x12, 0x10, 0x1f, 0x30, 0x03, + 0x06, 0x20, 0x0b, 0x03, 0x12, 0x10, 0x1f, 0x30, 0x04, 0x06, 0x20, + 0x0c, 0x03, 0x12, 0x10, 0x22, 0x20, 0x13, 0x09, 0x20, 0x11, 0x06, + 0xe5, 0x2b, 0x45, 0x2c, 0x60, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x92, + 0xa9, 0x12, 0x02, 0x80, 0x80, 0xbf, 0xc2, 0x43, 0xd2, 0x45, 0xe4, + 0xf5, 0x20, 0xf5, 0x21, 0xf5, 0x53, 0xf5, 0x46, 0xf5, 0x2b, 0xf5, + 0x2c, 0xc2, 0x42, 0xf5, 0x51, 0xf5, 0x52, 0xf5, 0x55, 0x90, 0x04, + 0x18, 0x74, 0x80, 0xf0, 0x90, 0x04, 0x1a, 0x74, 0x08, 0xf0, 0x22, + 0xd0, 0x83, 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, + 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, + 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, + 0xa3, 0xa3, 0xa3, 0x80, 0xdf, 0xef, 0xf4, 0x60, 0x1f, 0xe4, 0xfe, + 0x12, 0x02, 0xaf, 0xe0, 0xb4, 0xff, 0x12, 0x12, 0x02, 0xaf, 0xef, + 0xf0, 0x74, 0x1c, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5, 0x83, + 0xed, 0xf0, 0x22, 0x0e, 0xbe, 0x04, 0xe3, 0x22, 0xc0, 0xe0, 0xc0, + 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x08, 0xc2, + 0xaf, 0x30, 0x45, 0x03, 0x12, 0x10, 0x06, 0xd2, 0xaf, 0xd0, 0xd0, + 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xf0, 0xd0, 0xe0, 0x32, 0xc2, 0xaf, + 0x12, 0x00, 0x06, 0x12, 0x01, 0xbe, 0x12, 0x02, 0x69, 0xe4, 0xf5, + 0x22, 0xf5, 0x47, 0x90, 0x04, 0x00, 0x74, 0x80, 0xf0, 0xd2, 0xaf, + 0x22, 0x75, 0x89, 0x02, 0xe4, 0xf5, 0x8c, 0xf5, 0x8a, 0xf5, 0x88, + 0xf5, 0xb8, 0xf5, 0xe8, 0x75, 0x90, 0x18, 0xd2, 0x8c, 0x75, 0xa8, + 0x05, 0x22, 0x30, 0x45, 0x03, 0x12, 0x10, 0x15, 0xe5, 0x20, 0x70, + 0x03, 0x20, 0x10, 0x03, 0x30, 0x11, 0x03, 0x43, 0x87, 0x01, 0x22, + 0xce, 0xef, 0xce, 0xee, 0x60, 0x08, 0x7f, 0xff, 0x12, 0x02, 0xc5, + 0x1e, 0x80, 0xf5, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, + 0x81, 0x5f, 0x02, 0x01, 0x7a, 0x74, 0x14, 0x2e, 0xf5, 0x82, 0xe4, + 0x34, 0x70, 0xf5, 0x83, 0x22, 0xef, 0x90, 0x02, 0xc3, 0x93, 0x90, + 0x03, 0x00, 0x73, 0x0a, 0x18, 0xef, 0x60, 0x03, 0x1f, 0x80, 0xfa, + 0x22, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x26, 0x74, 0x03, 0xc0, 0xe0, 0xc0, 0x82, 0xc0, 0x83, 0x75, 0x26, 0x0a, 0x22, 0xc0, 0x26, 0x74, 0x03, 0xc0, 0xe0, 0xc0, 0x82, 0xc0, 0x83, - 0x75, 0x26, 0x18, 0x22, 0x30, 0x45, 0x03, 0x12, 0x10, 0x15, 0xe5, - 0x20, 0x70, 0x03, 0x20, 0x10, 0x03, 0x30, 0x11, 0x03, 0x43, 0x87, - 0x01, 0x22, 0xce, 0xef, 0xce, 0xee, 0x60, 0x08, 0x7f, 0xff, 0x12, - 0x02, 0xf8, 0x1e, 0x80, 0xf5, 0x22, 0xc8, 0xef, 0xc8, 0xe6, 0x60, - 0x03, 0x16, 0xc3, 0x22, 0xed, 0x14, 0xf6, 0xd3, 0x22, 0xc8, 0xef, - 0xc8, 0xe6, 0x60, 0x06, 0x16, 0xe6, 0x24, 0xff, 0xb3, 0x22, 0xc3, - 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x5f, 0x02, - 0x01, 0xc5, 0x74, 0x14, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5, - 0x83, 0x22, 0xef, 0x90, 0x03, 0x7b, 0x93, 0x90, 0x03, 0x00, 0x73, - 0x0a, 0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x75, 0x26, 0x18, 0x22, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -2641,318 +2641,318 @@ static const uint8_t rt2860[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x10, 0x28, 0x02, - 0x10, 0x3b, 0x02, 0x10, 0x3c, 0x02, 0x13, 0xbc, 0x02, 0x13, 0xbd, - 0x02, 0x14, 0x72, 0x02, 0x14, 0x73, 0xc3, 0x22, 0xff, 0xff, 0x02, - 0x19, 0x4a, 0x02, 0x1a, 0xf4, 0x02, 0x15, 0x6c, 0x02, 0x14, 0xa7, - 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x01, 0x7a, 0x30, 0x06, - 0x06, 0x20, 0x0e, 0x03, 0x12, 0x1c, 0x2e, 0x22, 0x22, 0x90, 0x04, - 0x14, 0xe0, 0x20, 0xe7, 0x03, 0x02, 0x13, 0xbb, 0x90, 0x70, 0x12, - 0xe0, 0xf5, 0x56, 0x90, 0x04, 0x04, 0xe0, 0x12, 0x02, 0x5c, 0x10, - 0xfb, 0x30, 0x10, 0xd2, 0x31, 0x10, 0x93, 0x33, 0x10, 0xa1, 0x34, - 0x10, 0xb4, 0x35, 0x10, 0xab, 0x36, 0x11, 0x09, 0x50, 0x11, 0x4e, - 0x51, 0x11, 0x57, 0x52, 0x11, 0x57, 0x53, 0x11, 0x57, 0x54, 0x11, - 0x93, 0x55, 0x11, 0xf0, 0x56, 0x12, 0x43, 0x70, 0x12, 0x69, 0x71, - 0x12, 0x92, 0x72, 0x13, 0x3e, 0x73, 0x13, 0x61, 0x80, 0x13, 0x88, - 0x83, 0x13, 0xa0, 0x84, 0x00, 0x00, 0x13, 0xbb, 0xd2, 0x18, 0xd2, - 0x61, 0x75, 0x35, 0x2a, 0x75, 0x32, 0x0b, 0x75, 0x33, 0xb8, 0x22, - 0xc2, 0x18, 0x90, 0x01, 0x14, 0xe0, 0x54, 0xfd, 0xf0, 0x22, 0x90, - 0x70, 0x11, 0xe0, 0xf5, 0x3c, 0x02, 0x13, 0xb5, 0xe5, 0x55, 0xb4, + 0x10, 0x32, 0x02, 0x10, 0x33, 0x02, 0x14, 0xc2, 0x02, 0x14, 0xc3, + 0x02, 0x15, 0x8f, 0x02, 0x15, 0x90, 0xc3, 0x22, 0xff, 0xff, 0x02, + 0x1a, 0x6f, 0x02, 0x1b, 0xec, 0x02, 0x16, 0xbc, 0x02, 0x15, 0xf7, + 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x1d, 0x19, 0x22, 0x22, + 0x90, 0x04, 0x14, 0xe0, 0x20, 0xe7, 0x03, 0x02, 0x14, 0xc1, 0x90, + 0x70, 0x12, 0xe0, 0xf5, 0x56, 0x90, 0x04, 0x04, 0xe0, 0x12, 0x01, + 0xe4, 0x10, 0xda, 0x30, 0x10, 0xb1, 0x31, 0x10, 0x93, 0x35, 0x10, + 0x8a, 0x36, 0x10, 0xe7, 0x40, 0x10, 0xfe, 0x41, 0x11, 0x15, 0x50, + 0x11, 0x5a, 0x51, 0x11, 0x63, 0x52, 0x11, 0x63, 0x53, 0x11, 0x63, + 0x54, 0x11, 0x9f, 0x55, 0x11, 0xfc, 0x56, 0x12, 0x4f, 0x64, 0x12, + 0x6a, 0x72, 0x13, 0x1e, 0x73, 0x13, 0x42, 0x74, 0x14, 0x35, 0x80, + 0x14, 0xa5, 0x83, 0x14, 0x5c, 0x91, 0x00, 0x00, 0x14, 0xc1, 0x90, + 0x70, 0x11, 0xe0, 0xf5, 0x3c, 0x02, 0x14, 0xbb, 0xe5, 0x55, 0xb4, 0x02, 0x0f, 0xe5, 0x58, 0x30, 0xe0, 0x06, 0x90, 0x01, 0x0d, 0x74, 0x08, 0xf0, 0x7d, 0x01, 0x80, 0x02, 0x7d, 0x02, 0xaf, 0x56, 0x12, - 0x02, 0x82, 0x02, 0x13, 0xb5, 0x20, 0x02, 0x03, 0x30, 0x03, 0x0a, - 0x7d, 0x02, 0xaf, 0x56, 0x12, 0x02, 0x82, 0x02, 0x13, 0xb5, 0xe5, - 0x34, 0xd3, 0x94, 0x01, 0x40, 0x0c, 0x90, 0x01, 0x0c, 0xe0, 0x44, + 0x02, 0x0a, 0x02, 0x14, 0xbb, 0x20, 0x02, 0x03, 0x30, 0x03, 0x0a, + 0x7d, 0x02, 0xaf, 0x56, 0x12, 0x02, 0x0a, 0x02, 0x14, 0xbb, 0xe5, + 0x30, 0xd3, 0x94, 0x01, 0x40, 0x0c, 0x90, 0x01, 0x0c, 0xe0, 0x44, 0x02, 0xf0, 0xa3, 0xe0, 0x44, 0x04, 0xf0, 0x85, 0x56, 0x41, 0xd2, - 0x02, 0x22, 0x90, 0x70, 0x11, 0xe0, 0xf4, 0x70, 0x03, 0x02, 0x13, - 0xbb, 0xe0, 0xf5, 0x30, 0x22, 0xe5, 0x34, 0xd3, 0x94, 0x01, 0x40, - 0x07, 0xe5, 0x55, 0x60, 0x03, 0x02, 0x13, 0xbb, 0x90, 0x70, 0x10, - 0xe0, 0x54, 0x7f, 0xff, 0xbf, 0x0a, 0x0d, 0x90, 0x70, 0x11, 0xe0, - 0xb4, 0x08, 0x06, 0x75, 0x4e, 0x01, 0x75, 0x4f, 0x84, 0x90, 0x70, - 0x10, 0xe0, 0x54, 0x7f, 0xff, 0xbf, 0x02, 0x12, 0x90, 0x70, 0x11, - 0xe0, 0x64, 0x08, 0x60, 0x04, 0xe0, 0xb4, 0x20, 0x06, 0x75, 0x4e, - 0x03, 0x75, 0x4f, 0x20, 0xe4, 0xf5, 0x27, 0x22, 0x90, 0x70, 0x11, - 0xe0, 0x24, 0xff, 0x92, 0x47, 0x22, 0xe5, 0x34, 0xd3, 0x94, 0x01, - 0x40, 0x07, 0xe5, 0x55, 0x60, 0x03, 0x02, 0x13, 0x49, 0x90, 0x04, - 0x04, 0xe0, 0x25, 0xe0, 0x24, 0x5d, 0xf5, 0x57, 0x90, 0x70, 0x10, - 0xe0, 0xff, 0x74, 0x47, 0x25, 0x57, 0xf8, 0xc6, 0xef, 0xc6, 0x90, - 0x70, 0x11, 0xe0, 0xff, 0x74, 0x48, 0x25, 0x57, 0xf8, 0xc6, 0xef, - 0xc6, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x02, 0x82, 0x02, 0x13, 0xb5, - 0xe5, 0x34, 0xd3, 0x94, 0x01, 0x40, 0x07, 0xe5, 0x55, 0x60, 0x03, - 0x02, 0x13, 0x49, 0xe5, 0x47, 0x64, 0x07, 0x60, 0x1d, 0xe5, 0x47, - 0x64, 0x08, 0x60, 0x17, 0xe5, 0x47, 0x64, 0x09, 0x60, 0x11, 0xe5, - 0x47, 0x64, 0x0a, 0x60, 0x0b, 0xe5, 0x47, 0x64, 0x0b, 0x60, 0x05, - 0xe5, 0x47, 0xb4, 0x0c, 0x08, 0x90, 0x70, 0x11, 0xe0, 0x54, 0x0f, - 0xf5, 0x3a, 0xe5, 0x47, 0xb4, 0x09, 0x08, 0xe5, 0x3a, 0xb4, 0x03, - 0x03, 0xe4, 0xf5, 0x46, 0xe5, 0x47, 0xb4, 0x0a, 0x08, 0xe5, 0x3a, - 0xb4, 0x01, 0x03, 0xe4, 0xf5, 0x46, 0xe4, 0xfd, 0xaf, 0x56, 0x12, - 0x02, 0x82, 0xd2, 0x04, 0x22, 0x90, 0x70, 0x11, 0xe0, 0xf4, 0xff, - 0x90, 0x70, 0x10, 0xe0, 0x5f, 0xff, 0x90, 0x70, 0x11, 0xe0, 0x55, - 0x27, 0x4f, 0x90, 0x70, 0x18, 0xf0, 0x90, 0x70, 0x11, 0xe0, 0x90, - 0x70, 0x19, 0xf0, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x02, 0x82, 0x30, - 0x15, 0x03, 0xd2, 0x14, 0x22, 0x90, 0x70, 0x18, 0xe0, 0xf5, 0x27, - 0x90, 0x02, 0x29, 0xe0, 0xff, 0x90, 0x70, 0x19, 0xe0, 0xfe, 0xef, - 0x5e, 0x90, 0x02, 0x29, 0xf0, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, - 0x04, 0xe5, 0x27, 0xf4, 0xff, 0x90, 0x02, 0x28, 0xef, 0xf0, 0x22, - 0xe5, 0x34, 0xd3, 0x94, 0x01, 0x40, 0x07, 0xe5, 0x55, 0x60, 0x03, - 0x02, 0x13, 0x49, 0x90, 0x70, 0x10, 0xe0, 0xfe, 0x90, 0x70, 0x11, - 0xe0, 0xfd, 0xed, 0xf8, 0xe6, 0xf5, 0x57, 0xfd, 0xaf, 0x56, 0x12, - 0x02, 0x82, 0x02, 0x13, 0xb5, 0xe5, 0x34, 0xd3, 0x94, 0x01, 0x40, - 0x07, 0xe5, 0x55, 0x60, 0x03, 0x02, 0x13, 0x49, 0x90, 0x70, 0x10, - 0xe0, 0xfe, 0x90, 0x70, 0x11, 0xe0, 0xfd, 0xed, 0xf5, 0x82, 0x8e, - 0x83, 0xe0, 0xf5, 0x57, 0xfd, 0xaf, 0x56, 0x12, 0x02, 0x82, 0x02, - 0x13, 0xb5, 0x90, 0x10, 0x00, 0xe0, 0xf5, 0x57, 0xe4, 0xf5, 0x58, - 0xf5, 0x59, 0x90, 0x10, 0x03, 0xe0, 0xb4, 0x28, 0x05, 0x75, 0x58, - 0x01, 0x80, 0x3c, 0x90, 0x10, 0x03, 0xe0, 0xb4, 0x30, 0x05, 0x75, - 0x58, 0x02, 0x80, 0x30, 0x90, 0x10, 0x03, 0xe0, 0xb4, 0x33, 0x05, - 0x75, 0x58, 0x04, 0x80, 0x24, 0x90, 0x10, 0x03, 0xe0, 0xb4, 0x35, - 0x0c, 0x90, 0x10, 0x02, 0xe0, 0xb4, 0x72, 0x05, 0x75, 0x58, 0x08, - 0x80, 0x11, 0x90, 0x10, 0x03, 0xe0, 0xb4, 0x35, 0x0a, 0x90, 0x10, - 0x02, 0xe0, 0xb4, 0x93, 0x03, 0x75, 0x58, 0x10, 0xe5, 0x58, 0x30, - 0xe1, 0x19, 0x90, 0x05, 0x08, 0xe0, 0x44, 0x01, 0xf0, 0xfd, 0x90, - 0x05, 0x05, 0xe0, 0x54, 0xfb, 0xf0, 0x44, 0x04, 0xf0, 0xed, 0x54, - 0xfe, 0x90, 0x05, 0x08, 0xf0, 0xe4, 0xf5, 0x4e, 0xf5, 0x4f, 0x75, - 0x3a, 0xff, 0xc2, 0x1a, 0xc2, 0x18, 0xc2, 0x1b, 0xf5, 0x34, 0x90, - 0x05, 0xa4, 0x74, 0x11, 0xf0, 0xa3, 0x74, 0xff, 0xf0, 0xa3, 0x74, - 0x03, 0xf0, 0xe4, 0xf5, 0x30, 0xc2, 0x19, 0x90, 0x01, 0x0d, 0xe0, - 0x44, 0x40, 0xf0, 0x75, 0x3c, 0xff, 0xad, 0x57, 0xaf, 0x56, 0x12, - 0x02, 0x82, 0xe4, 0x90, 0x70, 0x32, 0xf0, 0x80, 0x77, 0xe5, 0x34, - 0xd3, 0x94, 0x01, 0x40, 0x0b, 0xe5, 0x55, 0x60, 0x07, 0x7d, 0x03, - 0xaf, 0x56, 0x02, 0x02, 0x82, 0x90, 0x70, 0x10, 0xe0, 0x24, 0xff, - 0x92, 0x93, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x02, 0x82, 0x80, 0x54, - 0xe5, 0x34, 0xd3, 0x94, 0x01, 0x40, 0x0d, 0xe5, 0x55, 0x60, 0x09, - 0x7d, 0x03, 0xaf, 0x56, 0x12, 0x02, 0x82, 0x80, 0x40, 0x90, 0x70, - 0x10, 0xe0, 0x24, 0xff, 0x92, 0x4a, 0xd2, 0x05, 0xad, 0x57, 0xaf, - 0x56, 0x12, 0x02, 0x82, 0x80, 0x2d, 0xe4, 0xf5, 0x34, 0xf5, 0x30, - 0x90, 0x70, 0x10, 0xe0, 0xf4, 0x60, 0x03, 0xe0, 0xf5, 0x34, 0xad, - 0x57, 0xaf, 0x56, 0x12, 0x02, 0x82, 0x80, 0x15, 0xd2, 0x19, 0x05, - 0x2f, 0xe5, 0x2f, 0xb4, 0x1a, 0x03, 0xe4, 0xf5, 0x2f, 0xd2, 0x04, - 0xad, 0x57, 0xaf, 0x56, 0x12, 0x02, 0x82, 0x90, 0x04, 0x14, 0x74, - 0x80, 0xf0, 0x22, 0x22, 0xe5, 0x34, 0xc3, 0x94, 0x03, 0x40, 0x17, - 0xe5, 0x55, 0xb4, 0x02, 0x12, 0xe5, 0x30, 0x60, 0x0e, 0x30, 0x60, - 0x0b, 0x74, 0xfd, 0x25, 0x46, 0xf5, 0x46, 0xd2, 0x04, 0xe4, 0xf5, - 0x53, 0xe5, 0x53, 0x60, 0x03, 0x02, 0x14, 0x71, 0x30, 0x60, 0x21, - 0xb2, 0x4d, 0x30, 0x4d, 0x1c, 0xe5, 0x34, 0xc3, 0x94, 0x03, 0x40, - 0x11, 0xe5, 0x55, 0xb4, 0x02, 0x0c, 0xe5, 0x30, 0x60, 0x08, 0x74, - 0x03, 0x25, 0x46, 0xf5, 0x46, 0x80, 0x02, 0x05, 0x46, 0xc2, 0x04, - 0xe5, 0x4f, 0x45, 0x4e, 0x60, 0x08, 0xe5, 0x4f, 0x15, 0x4f, 0x70, - 0x02, 0x15, 0x4e, 0x30, 0x1a, 0x49, 0x7f, 0x32, 0x7d, 0xb8, 0x7c, - 0x0b, 0x12, 0x02, 0x35, 0x50, 0x06, 0x90, 0x04, 0x10, 0x74, 0x40, - 0xf0, 0x7f, 0x35, 0x7d, 0x32, 0x12, 0x03, 0x3f, 0x50, 0x09, 0x90, - 0x10, 0x04, 0xe0, 0x54, 0xf7, 0xf0, 0xd2, 0x06, 0xe5, 0x35, 0xd3, - 0x94, 0x2d, 0x40, 0x30, 0x30, 0x1b, 0x2d, 0xc2, 0x1b, 0xa2, 0x18, - 0x92, 0x1a, 0x20, 0x1a, 0x24, 0x90, 0x04, 0x09, 0xe0, 0x54, 0xdd, - 0xf0, 0x90, 0x10, 0x04, 0xe0, 0x44, 0x08, 0xf0, 0xc2, 0x61, 0xd2, - 0x03, 0x22, 0xe4, 0xf5, 0x35, 0xa2, 0x18, 0x92, 0x1a, 0x30, 0x1a, - 0x07, 0x90, 0x04, 0x09, 0xe0, 0x44, 0x22, 0xf0, 0x22, 0x22, 0x30, - 0x14, 0x30, 0x90, 0x70, 0x19, 0xe0, 0x55, 0x27, 0xff, 0x90, 0x70, - 0x18, 0xe0, 0x4f, 0xf5, 0x27, 0x90, 0x02, 0x29, 0xe0, 0xff, 0x90, - 0x70, 0x19, 0xe0, 0xfe, 0xef, 0x5e, 0x90, 0x02, 0x29, 0xf0, 0x30, - 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5, 0x27, 0xf4, 0xff, 0x90, - 0x02, 0x28, 0xef, 0xf0, 0xc2, 0x14, 0x22, 0xc2, 0x4b, 0xc2, 0x4c, - 0xe5, 0x44, 0x12, 0x02, 0x5c, 0x14, 0xc9, 0x00, 0x15, 0x57, 0x04, - 0x15, 0x53, 0x08, 0x15, 0x33, 0x10, 0x14, 0xdd, 0x20, 0x14, 0xfd, - 0x60, 0x15, 0x0e, 0xa0, 0x00, 0x00, 0x15, 0x59, 0x85, 0x48, 0x43, - 0x85, 0x4a, 0x42, 0x85, 0x4c, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x60, - 0x03, 0x02, 0x15, 0x59, 0x80, 0x1b, 0xe5, 0x48, 0xc4, 0x54, 0x0f, - 0xf5, 0x43, 0xe5, 0x4a, 0xc4, 0x54, 0x0f, 0xf5, 0x42, 0xe5, 0x4c, - 0xc4, 0x54, 0x0f, 0xf5, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x70, 0x61, - 0x53, 0x43, 0x0f, 0x80, 0x5c, 0x85, 0x49, 0x43, 0x85, 0x4b, 0x42, - 0x85, 0x4d, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x70, 0x4d, 0x80, 0x1b, - 0xe5, 0x49, 0xc4, 0x54, 0x0f, 0xf5, 0x43, 0xe5, 0x4b, 0xc4, 0x54, - 0x0f, 0xf5, 0x42, 0xe5, 0x4d, 0xc4, 0x54, 0x0f, 0xf5, 0x5e, 0xe5, - 0x47, 0x64, 0x06, 0x70, 0x30, 0xe5, 0x43, 0x54, 0x0f, 0x44, 0x10, - 0xf5, 0x43, 0x80, 0x26, 0xe5, 0x47, 0x64, 0x04, 0x60, 0x05, 0xe5, - 0x47, 0xb4, 0x05, 0x06, 0x43, 0x5e, 0x04, 0x75, 0x42, 0x09, 0xe5, - 0x47, 0xb4, 0x06, 0x10, 0xe5, 0x43, 0x54, 0x0f, 0x44, 0x30, 0xf5, - 0x43, 0x80, 0x06, 0xd2, 0x4b, 0x80, 0x02, 0xd2, 0x4c, 0xe4, 0xf5, - 0x2a, 0xe5, 0x42, 0xc4, 0x54, 0xf0, 0xff, 0xe5, 0x43, 0x54, 0x0f, - 0x4f, 0xf5, 0x5f, 0xd2, 0x60, 0x22, 0xd2, 0x15, 0xe5, 0x47, 0x24, - 0xf5, 0x60, 0x0b, 0x24, 0xcb, 0x60, 0x07, 0x24, 0x40, 0x70, 0x06, - 0xc2, 0x15, 0x22, 0x12, 0x19, 0x15, 0x12, 0x15, 0x8e, 0xc2, 0x15, - 0xc2, 0xaf, 0xc2, 0x04, 0xd2, 0xaf, 0x22, 0xc2, 0xaf, 0x90, 0x04, - 0x14, 0xe0, 0x54, 0x0e, 0x60, 0x04, 0xd2, 0x1c, 0x80, 0x08, 0xe5, - 0x4e, 0x45, 0x4f, 0x24, 0xff, 0x92, 0x1c, 0xd2, 0xaf, 0x90, 0x04, - 0x14, 0xe0, 0xa2, 0xe4, 0x92, 0x1d, 0x74, 0x1e, 0xf0, 0xe5, 0x5f, - 0x54, 0x0f, 0xf5, 0x2d, 0xe5, 0x2a, 0x70, 0x13, 0x30, 0x1c, 0x05, - 0xe5, 0x5f, 0x20, 0xe5, 0x0b, 0x30, 0x1d, 0x29, 0xe5, 0x5f, 0x54, - 0x30, 0x64, 0x30, 0x70, 0x21, 0xe5, 0x2a, 0x70, 0x15, 0xe5, 0x34, - 0xc3, 0x94, 0x03, 0x40, 0x09, 0xe5, 0x30, 0x60, 0x05, 0x75, 0x2a, - 0x05, 0x80, 0x07, 0x75, 0x2a, 0x0c, 0x80, 0x02, 0x15, 0x2a, 0xd2, - 0x6c, 0xd2, 0x6d, 0x80, 0x0f, 0xe5, 0x5f, 0x30, 0xe6, 0x06, 0xc2, - 0x6c, 0xd2, 0x6d, 0x80, 0x04, 0xd2, 0x6c, 0xc2, 0x6d, 0xe5, 0x47, - 0x64, 0x03, 0x70, 0x21, 0x30, 0x4b, 0x06, 0xc2, 0x6c, 0xd2, 0x6d, - 0x80, 0x18, 0xe5, 0x2a, 0x70, 0x03, 0x30, 0x4c, 0x11, 0xc2, 0x4c, - 0xe5, 0x2a, 0x70, 0x05, 0x75, 0x2a, 0x07, 0x80, 0x02, 0x15, 0x2a, - 0xd2, 0x6c, 0xd2, 0x6d, 0xe5, 0x47, 0xb4, 0x09, 0x14, 0xe5, 0x44, - 0x20, 0xe3, 0x0b, 0xe5, 0x3a, 0x64, 0x02, 0x60, 0x05, 0xe5, 0x3a, - 0xb4, 0x03, 0x04, 0xc2, 0x6c, 0xd2, 0x6d, 0xe5, 0x47, 0xb4, 0x0a, - 0x13, 0xe5, 0x3a, 0xb4, 0x01, 0x06, 0xc2, 0x6c, 0xd2, 0x6d, 0x80, - 0x08, 0xe5, 0x3a, 0x70, 0x04, 0xd2, 0x6c, 0xc2, 0x6d, 0x20, 0x69, - 0x07, 0xe5, 0x5e, 0x20, 0xe0, 0x02, 0xb2, 0x68, 0x20, 0x6b, 0x07, - 0xe5, 0x5e, 0x20, 0xe1, 0x02, 0xb2, 0x6a, 0x20, 0x6d, 0x07, 0xe5, - 0x5e, 0x20, 0xe2, 0x02, 0xb2, 0x6c, 0x75, 0x2e, 0x40, 0x20, 0x69, - 0x04, 0xa2, 0x68, 0x80, 0x45, 0x30, 0x68, 0x06, 0xe5, 0x46, 0xa2, - 0xe2, 0x80, 0x3c, 0x30, 0x19, 0x1c, 0xe5, 0x5e, 0x20, 0xe0, 0x04, - 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0xe5, 0x2f, 0xb4, 0x19, 0x04, - 0x7e, 0x01, 0x80, 0x02, 0x7e, 0x00, 0xee, 0x6f, 0x24, 0xff, 0x80, - 0x1d, 0xe5, 0x5e, 0x20, 0xe0, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, - 0x00, 0xe5, 0x46, 0x54, 0xf0, 0xfe, 0xbe, 0xf0, 0x04, 0x7e, 0x01, - 0x80, 0x02, 0x7e, 0x00, 0xee, 0x6f, 0x24, 0xff, 0x92, 0x73, 0x92, - 0x72, 0x20, 0x6b, 0x04, 0xa2, 0x6a, 0x80, 0x45, 0x30, 0x6a, 0x06, - 0xe5, 0x46, 0xa2, 0xe2, 0x80, 0x3c, 0x30, 0x19, 0x1c, 0xe5, 0x5e, - 0x20, 0xe1, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0xe5, 0x2f, - 0xb4, 0x19, 0x04, 0x7e, 0x01, 0x80, 0x02, 0x7e, 0x00, 0xee, 0x6f, - 0x24, 0xff, 0x80, 0x1d, 0xe5, 0x5e, 0x20, 0xe1, 0x04, 0x7f, 0x01, + 0x02, 0x22, 0x90, 0x70, 0x11, 0xe0, 0xb4, 0x5a, 0x03, 0xc2, 0x4f, + 0x22, 0xd2, 0x4f, 0x22, 0xe5, 0x30, 0xd3, 0x94, 0x01, 0x50, 0x03, + 0x02, 0x14, 0xc1, 0x90, 0x01, 0x0c, 0xe0, 0x44, 0x02, 0xf0, 0xa3, + 0xe0, 0x44, 0x04, 0xf0, 0x22, 0xe5, 0x30, 0xd3, 0x94, 0x01, 0x50, + 0x03, 0x02, 0x14, 0xc1, 0x90, 0x01, 0x0c, 0xe0, 0x54, 0xfd, 0xf0, + 0xa3, 0xe0, 0x54, 0xfb, 0xf0, 0x22, 0xe5, 0x30, 0xd3, 0x94, 0x01, + 0x40, 0x07, 0xe5, 0x55, 0x60, 0x03, 0x02, 0x14, 0xc1, 0x90, 0x70, + 0x10, 0xe0, 0x54, 0x7f, 0xff, 0xbf, 0x0a, 0x0d, 0x90, 0x70, 0x11, + 0xe0, 0xb4, 0x08, 0x06, 0x75, 0x4e, 0x01, 0x75, 0x4f, 0x84, 0x90, + 0x70, 0x10, 0xe0, 0x54, 0x7f, 0xff, 0xbf, 0x02, 0x12, 0x90, 0x70, + 0x11, 0xe0, 0x64, 0x08, 0x60, 0x04, 0xe0, 0xb4, 0x20, 0x06, 0x75, + 0x4e, 0x03, 0x75, 0x4f, 0x20, 0xe4, 0xf5, 0x3f, 0x22, 0x90, 0x70, + 0x11, 0xe0, 0x24, 0xff, 0x92, 0x47, 0x22, 0xe5, 0x30, 0xd3, 0x94, + 0x01, 0x40, 0x07, 0xe5, 0x55, 0x60, 0x03, 0x02, 0x13, 0x29, 0x90, + 0x04, 0x04, 0xe0, 0x25, 0xe0, 0x24, 0x5d, 0xf5, 0x57, 0x90, 0x70, + 0x10, 0xe0, 0xff, 0x74, 0x47, 0x25, 0x57, 0xf8, 0xc6, 0xef, 0xc6, + 0x90, 0x70, 0x11, 0xe0, 0xff, 0x74, 0x48, 0x25, 0x57, 0xf8, 0xc6, + 0xef, 0xc6, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x02, 0x0a, 0x02, 0x14, + 0xbb, 0xe5, 0x30, 0xd3, 0x94, 0x01, 0x40, 0x07, 0xe5, 0x55, 0x60, + 0x03, 0x02, 0x13, 0x29, 0xe5, 0x47, 0x64, 0x07, 0x60, 0x1d, 0xe5, + 0x47, 0x64, 0x08, 0x60, 0x17, 0xe5, 0x47, 0x64, 0x09, 0x60, 0x11, + 0xe5, 0x47, 0x64, 0x0a, 0x60, 0x0b, 0xe5, 0x47, 0x64, 0x0b, 0x60, + 0x05, 0xe5, 0x47, 0xb4, 0x0c, 0x08, 0x90, 0x70, 0x11, 0xe0, 0x54, + 0x0f, 0xf5, 0x3a, 0xe5, 0x47, 0xb4, 0x09, 0x08, 0xe5, 0x3a, 0xb4, + 0x03, 0x03, 0xe4, 0xf5, 0x46, 0xe5, 0x47, 0xb4, 0x0a, 0x08, 0xe5, + 0x3a, 0xb4, 0x01, 0x03, 0xe4, 0xf5, 0x46, 0xe4, 0xfd, 0xaf, 0x56, + 0x12, 0x02, 0x0a, 0xd2, 0x04, 0x22, 0x90, 0x70, 0x11, 0xe0, 0xf4, + 0xff, 0x90, 0x70, 0x10, 0xe0, 0x5f, 0xff, 0x90, 0x70, 0x11, 0xe0, + 0x55, 0x3f, 0x4f, 0x90, 0x70, 0x18, 0xf0, 0x90, 0x70, 0x11, 0xe0, + 0x90, 0x70, 0x19, 0xf0, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x02, 0x0a, + 0x30, 0x15, 0x03, 0xd2, 0x14, 0x22, 0x90, 0x70, 0x18, 0xe0, 0xf5, + 0x3f, 0x90, 0x02, 0x29, 0xe0, 0xff, 0x90, 0x70, 0x19, 0xe0, 0xfe, + 0xef, 0x5e, 0x90, 0x02, 0x29, 0xf0, 0x30, 0x47, 0x04, 0xaf, 0x3f, + 0x80, 0x04, 0xe5, 0x3f, 0xf4, 0xff, 0x90, 0x02, 0x28, 0xef, 0xf0, + 0x22, 0x90, 0x70, 0x10, 0xe0, 0x24, 0xff, 0x92, 0x1a, 0x75, 0x32, + 0x03, 0x75, 0x33, 0x1f, 0xe4, 0xf5, 0x31, 0xad, 0x57, 0xaf, 0x56, + 0x12, 0x02, 0x0a, 0x02, 0x14, 0xbb, 0x90, 0x10, 0x00, 0xe0, 0xf5, + 0x57, 0xe4, 0xf5, 0x58, 0xf5, 0x59, 0x90, 0x10, 0x03, 0xe0, 0xb4, + 0x28, 0x05, 0x75, 0x58, 0x01, 0x80, 0x3c, 0x90, 0x10, 0x03, 0xe0, + 0xb4, 0x30, 0x05, 0x75, 0x58, 0x02, 0x80, 0x30, 0x90, 0x10, 0x03, + 0xe0, 0xb4, 0x33, 0x05, 0x75, 0x58, 0x04, 0x80, 0x24, 0x90, 0x10, + 0x03, 0xe0, 0xb4, 0x35, 0x0c, 0x90, 0x10, 0x02, 0xe0, 0xb4, 0x72, + 0x05, 0x75, 0x58, 0x08, 0x80, 0x11, 0x90, 0x10, 0x03, 0xe0, 0xb4, + 0x35, 0x0a, 0x90, 0x10, 0x02, 0xe0, 0xb4, 0x93, 0x03, 0x75, 0x58, + 0x10, 0xe5, 0x58, 0x30, 0xe1, 0x19, 0x90, 0x05, 0x08, 0xe0, 0x44, + 0x01, 0xf0, 0xfd, 0x90, 0x05, 0x05, 0xe0, 0x54, 0xfb, 0xf0, 0x44, + 0x04, 0xf0, 0xed, 0x54, 0xfe, 0x90, 0x05, 0x08, 0xf0, 0xe4, 0xf5, + 0x4e, 0xf5, 0x4f, 0x75, 0x3a, 0xff, 0xf5, 0x30, 0x90, 0x05, 0xa4, + 0x74, 0x11, 0xf0, 0xa3, 0x74, 0xff, 0xf0, 0xa3, 0x74, 0x03, 0xf0, + 0xd2, 0x4f, 0x90, 0x01, 0x0d, 0xe0, 0x44, 0x40, 0xf0, 0x75, 0x3c, + 0xff, 0xad, 0x57, 0xaf, 0x56, 0x12, 0x02, 0x0a, 0x90, 0x70, 0x36, + 0x74, 0x37, 0xf0, 0xa3, 0x74, 0x32, 0xf0, 0x90, 0x04, 0x01, 0xe0, + 0x44, 0x01, 0xf0, 0xc2, 0x1a, 0xc2, 0x17, 0x02, 0x14, 0xbb, 0xe5, + 0x30, 0xd3, 0x94, 0x01, 0x40, 0x0b, 0xe5, 0x55, 0x60, 0x07, 0x7d, + 0x03, 0xaf, 0x56, 0x02, 0x02, 0x0a, 0x90, 0x70, 0x10, 0xe0, 0x24, + 0xff, 0x92, 0x93, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x02, 0x0a, 0x02, + 0x14, 0xbb, 0x90, 0x10, 0x00, 0xe0, 0x90, 0x10, 0x2c, 0xf0, 0x90, + 0x10, 0x2f, 0x74, 0x40, 0xf0, 0x90, 0x70, 0x11, 0xe0, 0x54, 0x7f, + 0xf5, 0x57, 0xe0, 0x54, 0x80, 0x90, 0x70, 0x32, 0xf0, 0x90, 0x70, + 0x10, 0xe0, 0xff, 0xe5, 0x57, 0xd3, 0x9f, 0x40, 0x43, 0x90, 0x70, + 0x33, 0xe5, 0x57, 0xf0, 0x90, 0x70, 0x10, 0xe0, 0xff, 0x90, 0x70, + 0x33, 0xe0, 0xc3, 0x9f, 0xd3, 0x94, 0x04, 0x40, 0x73, 0xe0, 0x24, + 0xfc, 0xf0, 0xe0, 0xff, 0x90, 0x70, 0x32, 0xe0, 0x4f, 0x90, 0x05, + 0x00, 0xf0, 0xe5, 0x58, 0x54, 0x0f, 0x60, 0x04, 0x7f, 0x17, 0x80, + 0x02, 0x7f, 0x11, 0x90, 0x05, 0x01, 0xef, 0xf0, 0xa3, 0x74, 0x01, + 0xf0, 0x74, 0x03, 0xf0, 0xff, 0x12, 0x02, 0x94, 0x80, 0xc3, 0x90, + 0x70, 0x33, 0xe5, 0x57, 0xf0, 0x90, 0x70, 0x33, 0xe0, 0xff, 0x90, + 0x70, 0x10, 0xe0, 0xc3, 0x9f, 0xd3, 0x94, 0x04, 0x40, 0x30, 0x90, + 0x70, 0x33, 0xe0, 0x24, 0x04, 0xf0, 0xe0, 0xff, 0x90, 0x70, 0x32, + 0xe0, 0x4f, 0x90, 0x05, 0x00, 0xf0, 0xe5, 0x58, 0x54, 0x0f, 0x60, + 0x04, 0x7f, 0x17, 0x80, 0x02, 0x7f, 0x11, 0x90, 0x05, 0x01, 0xef, + 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0x74, 0x03, 0xf0, 0xff, 0x12, 0x02, + 0x94, 0x80, 0xc0, 0x90, 0x70, 0x10, 0xe0, 0xff, 0x90, 0x70, 0x32, + 0xe0, 0x4f, 0x90, 0x05, 0x00, 0xf0, 0xe5, 0x58, 0x54, 0x0f, 0x60, + 0x04, 0x7f, 0x17, 0x80, 0x02, 0x7f, 0x11, 0x90, 0x05, 0x01, 0xef, + 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0x74, 0x03, 0xf0, 0xff, 0x12, 0x02, + 0x94, 0x90, 0x10, 0x00, 0xe0, 0x90, 0x10, 0x2c, 0xf0, 0x90, 0x10, + 0x2f, 0x74, 0x7f, 0xf0, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x02, 0x0a, + 0x02, 0x14, 0xbb, 0xe5, 0x30, 0xd3, 0x94, 0x01, 0x40, 0x0d, 0xe5, + 0x55, 0x60, 0x09, 0x7d, 0x03, 0xaf, 0x56, 0x12, 0x02, 0x0a, 0x80, + 0x72, 0x90, 0x70, 0x10, 0xe0, 0x24, 0xff, 0x92, 0x4a, 0xd2, 0x05, + 0xad, 0x57, 0xaf, 0x56, 0x12, 0x02, 0x0a, 0x80, 0x5f, 0x90, 0x70, + 0x11, 0xe0, 0x24, 0xff, 0x92, 0x17, 0x90, 0x70, 0x10, 0xe0, 0xf5, + 0x5d, 0xad, 0x57, 0xaf, 0x56, 0x12, 0x02, 0x0a, 0x90, 0x04, 0x14, + 0x74, 0x80, 0xf0, 0x30, 0x17, 0x13, 0x90, 0x10, 0x00, 0xe0, 0x90, + 0x10, 0x2c, 0xf0, 0x90, 0x10, 0x2f, 0xe0, 0x54, 0xf0, 0xf5, 0x57, + 0x45, 0x5d, 0xf0, 0xe4, 0x90, 0x70, 0x13, 0xf0, 0xe5, 0x56, 0xf4, + 0x60, 0x2a, 0x90, 0x70, 0x25, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x02, + 0x2c, 0x74, 0xff, 0xf0, 0x22, 0xe4, 0xf5, 0x30, 0xd2, 0x4f, 0x90, + 0x70, 0x10, 0xe0, 0xf4, 0x60, 0x03, 0xe0, 0xf5, 0x30, 0xad, 0x57, + 0xaf, 0x56, 0x12, 0x02, 0x0a, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, + 0x22, 0x22, 0xe5, 0x33, 0x45, 0x32, 0x60, 0x0a, 0xe5, 0x33, 0x15, + 0x33, 0x70, 0x0a, 0x15, 0x32, 0x80, 0x06, 0x75, 0x32, 0x03, 0x75, + 0x33, 0x1f, 0xe5, 0x33, 0x45, 0x32, 0x60, 0x03, 0x02, 0x15, 0x70, + 0x20, 0x1a, 0x03, 0x02, 0x15, 0x70, 0x74, 0xa0, 0x25, 0x31, 0xf5, + 0x82, 0xe4, 0x34, 0x4c, 0xf5, 0x83, 0xe0, 0x60, 0x7a, 0x7f, 0x7e, + 0x12, 0x15, 0xde, 0xef, 0x54, 0xfe, 0x44, 0x02, 0xfd, 0x7f, 0x7e, + 0x12, 0x15, 0xc4, 0xe5, 0x31, 0x7f, 0x00, 0x25, 0xe0, 0xfe, 0xef, + 0x24, 0x00, 0xf5, 0x82, 0x74, 0x4d, 0x3e, 0xaf, 0x82, 0x90, 0x4c, + 0xa8, 0xf0, 0xa3, 0xef, 0xf0, 0xe4, 0xf5, 0x56, 0xf5, 0x57, 0x7f, + 0x7f, 0x12, 0x15, 0xde, 0x90, 0x4c, 0xa8, 0xe0, 0xfa, 0xa3, 0xe0, + 0x25, 0x57, 0xf5, 0x82, 0xea, 0x35, 0x56, 0xf5, 0x83, 0xef, 0xf0, + 0x05, 0x57, 0xe5, 0x57, 0x70, 0x02, 0x05, 0x56, 0xc3, 0x94, 0x80, + 0xe5, 0x56, 0x94, 0x01, 0x40, 0xd8, 0x7f, 0x7e, 0x12, 0x15, 0xde, + 0xef, 0x44, 0x03, 0xfd, 0x7f, 0x7e, 0x12, 0x15, 0xc4, 0x74, 0xa0, + 0x25, 0x31, 0xf5, 0x82, 0xe4, 0x34, 0x4c, 0xf5, 0x83, 0xe4, 0xf0, + 0x05, 0x31, 0xe5, 0x31, 0xb4, 0x08, 0x03, 0xe4, 0xf5, 0x31, 0xe5, + 0x53, 0x70, 0x1a, 0x30, 0x60, 0x09, 0xb2, 0x4d, 0x30, 0x4d, 0x04, + 0x05, 0x46, 0xc2, 0x04, 0xe5, 0x4f, 0x45, 0x4e, 0x60, 0x08, 0xe5, + 0x4f, 0x15, 0x4f, 0x70, 0x02, 0x15, 0x4e, 0x22, 0x22, 0x30, 0x14, + 0x30, 0x90, 0x70, 0x19, 0xe0, 0x55, 0x3f, 0xff, 0x90, 0x70, 0x18, + 0xe0, 0x4f, 0xf5, 0x3f, 0x90, 0x02, 0x29, 0xe0, 0xff, 0x90, 0x70, + 0x19, 0xe0, 0xfe, 0xef, 0x5e, 0x90, 0x02, 0x29, 0xf0, 0x30, 0x47, + 0x04, 0xaf, 0x3f, 0x80, 0x04, 0xe5, 0x3f, 0xf4, 0xff, 0x90, 0x02, + 0x28, 0xef, 0xf0, 0xc2, 0x14, 0x22, 0x90, 0x10, 0x1c, 0xed, 0xf0, + 0xa3, 0xef, 0xf0, 0xa3, 0x74, 0x0a, 0xf0, 0x90, 0x10, 0x1c, 0xe0, + 0xf5, 0x58, 0x90, 0x10, 0x1e, 0xe0, 0x20, 0xe1, 0xf3, 0x22, 0x90, + 0x10, 0x1d, 0xef, 0xf0, 0xa3, 0x74, 0x0b, 0xf0, 0x90, 0x10, 0x1c, + 0xe0, 0xf5, 0x58, 0x90, 0x10, 0x1e, 0xe0, 0x20, 0xe1, 0xf3, 0xaf, + 0x58, 0x22, 0xc2, 0x4b, 0xc2, 0x4c, 0xe5, 0x44, 0x12, 0x01, 0xe4, + 0x16, 0x19, 0x00, 0x16, 0xa7, 0x04, 0x16, 0xa3, 0x08, 0x16, 0x83, + 0x10, 0x16, 0x2d, 0x20, 0x16, 0x4d, 0x60, 0x16, 0x5e, 0xa0, 0x00, + 0x00, 0x16, 0xa9, 0x85, 0x48, 0x43, 0x85, 0x4a, 0x42, 0x85, 0x4c, + 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x60, 0x03, 0x02, 0x16, 0xa9, 0x80, + 0x1b, 0xe5, 0x48, 0xc4, 0x54, 0x0f, 0xf5, 0x43, 0xe5, 0x4a, 0xc4, + 0x54, 0x0f, 0xf5, 0x42, 0xe5, 0x4c, 0xc4, 0x54, 0x0f, 0xf5, 0x5e, + 0xe5, 0x47, 0x64, 0x06, 0x70, 0x61, 0x53, 0x43, 0x0f, 0x80, 0x5c, + 0x85, 0x49, 0x43, 0x85, 0x4b, 0x42, 0x85, 0x4d, 0x5e, 0xe5, 0x47, + 0x64, 0x06, 0x70, 0x4d, 0x80, 0x1b, 0xe5, 0x49, 0xc4, 0x54, 0x0f, + 0xf5, 0x43, 0xe5, 0x4b, 0xc4, 0x54, 0x0f, 0xf5, 0x42, 0xe5, 0x4d, + 0xc4, 0x54, 0x0f, 0xf5, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x70, 0x30, + 0xe5, 0x43, 0x54, 0x0f, 0x44, 0x10, 0xf5, 0x43, 0x80, 0x26, 0xe5, + 0x47, 0x64, 0x04, 0x60, 0x05, 0xe5, 0x47, 0xb4, 0x05, 0x06, 0x43, + 0x5e, 0x04, 0x75, 0x42, 0x09, 0xe5, 0x47, 0xb4, 0x06, 0x10, 0xe5, + 0x43, 0x54, 0x0f, 0x44, 0x30, 0xf5, 0x43, 0x80, 0x06, 0xd2, 0x4b, + 0x80, 0x02, 0xd2, 0x4c, 0xe4, 0xf5, 0x27, 0xe5, 0x42, 0xc4, 0x54, + 0xf0, 0xff, 0xe5, 0x43, 0x54, 0x0f, 0x4f, 0xf5, 0x5f, 0xd2, 0x60, + 0x22, 0xd2, 0x15, 0xe5, 0x47, 0x24, 0xf5, 0x60, 0x0b, 0x24, 0xcb, + 0x60, 0x07, 0x24, 0x40, 0x70, 0x06, 0xc2, 0x15, 0x22, 0x12, 0x1a, + 0x3a, 0x12, 0x16, 0xde, 0xc2, 0x15, 0xc2, 0xaf, 0xc2, 0x04, 0xd2, + 0xaf, 0x22, 0xc2, 0xaf, 0x90, 0x04, 0x14, 0xe0, 0x54, 0x0e, 0x60, + 0x04, 0xd2, 0x18, 0x80, 0x08, 0xe5, 0x4e, 0x45, 0x4f, 0x24, 0xff, + 0x92, 0x18, 0xd2, 0xaf, 0x90, 0x04, 0x14, 0xe0, 0xa2, 0xe4, 0x92, + 0x19, 0x74, 0x1e, 0xf0, 0xe5, 0x5f, 0x54, 0x0f, 0xf5, 0x2d, 0xe5, + 0x27, 0x70, 0x13, 0x30, 0x18, 0x05, 0xe5, 0x5f, 0x20, 0xe5, 0x0b, + 0x30, 0x19, 0x19, 0xe5, 0x5f, 0x54, 0x30, 0xff, 0xbf, 0x30, 0x11, + 0xe5, 0x27, 0x70, 0x05, 0x75, 0x27, 0x0c, 0x80, 0x02, 0x15, 0x27, + 0xd2, 0x6c, 0xd2, 0x6d, 0x80, 0x0f, 0xe5, 0x5f, 0x30, 0xe6, 0x06, + 0xc2, 0x6c, 0xd2, 0x6d, 0x80, 0x04, 0xd2, 0x6c, 0xc2, 0x6d, 0xe5, + 0x47, 0x64, 0x03, 0x70, 0x21, 0x30, 0x4b, 0x06, 0xc2, 0x6c, 0xd2, + 0x6d, 0x80, 0x18, 0xe5, 0x27, 0x70, 0x03, 0x30, 0x4c, 0x11, 0xc2, + 0x4c, 0xe5, 0x27, 0x70, 0x05, 0x75, 0x27, 0x07, 0x80, 0x02, 0x15, + 0x27, 0xd2, 0x6c, 0xd2, 0x6d, 0xe5, 0x47, 0xb4, 0x09, 0x14, 0xe5, + 0x44, 0x20, 0xe3, 0x0b, 0xe5, 0x3a, 0x64, 0x02, 0x60, 0x05, 0xe5, + 0x3a, 0xb4, 0x03, 0x04, 0xc2, 0x6c, 0xd2, 0x6d, 0xe5, 0x47, 0xb4, + 0x0a, 0x13, 0xe5, 0x3a, 0xb4, 0x01, 0x06, 0xc2, 0x6c, 0xd2, 0x6d, + 0x80, 0x08, 0xe5, 0x3a, 0x70, 0x04, 0xd2, 0x6c, 0xc2, 0x6d, 0x20, + 0x69, 0x07, 0xe5, 0x5e, 0x20, 0xe0, 0x02, 0xb2, 0x68, 0x20, 0x6b, + 0x07, 0xe5, 0x5e, 0x20, 0xe1, 0x02, 0xb2, 0x6a, 0x20, 0x6d, 0x07, + 0xe5, 0x5e, 0x20, 0xe2, 0x02, 0xb2, 0x6c, 0x75, 0x2e, 0x40, 0x20, + 0x69, 0x04, 0xa2, 0x68, 0x80, 0x26, 0x30, 0x68, 0x06, 0xe5, 0x46, + 0xa2, 0xe2, 0x80, 0x1d, 0xe5, 0x5e, 0x20, 0xe0, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0xe5, 0x46, 0x54, 0xf0, 0xfe, 0xbe, 0xf0, 0x04, 0x7e, 0x01, 0x80, 0x02, 0x7e, 0x00, 0xee, 0x6f, 0x24, 0xff, - 0x92, 0x75, 0x92, 0x74, 0x20, 0x6d, 0x04, 0xa2, 0x6c, 0x80, 0x26, - 0xe5, 0x47, 0x64, 0x0a, 0x70, 0x22, 0x30, 0x6c, 0x06, 0xe5, 0x46, - 0xa2, 0xe3, 0x80, 0x17, 0xe5, 0x3a, 0xb4, 0x01, 0x06, 0xe5, 0x46, - 0xa2, 0xe3, 0x80, 0x53, 0xe5, 0x46, 0x20, 0xe4, 0x03, 0x30, 0xe5, - 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x80, 0x45, 0x30, 0x6c, 0x06, 0xe5, - 0x46, 0xa2, 0xe2, 0x80, 0x3c, 0x30, 0x19, 0x1c, 0xe5, 0x5e, 0x20, - 0xe2, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0xe5, 0x2f, 0xb4, - 0x19, 0x04, 0x7e, 0x01, 0x80, 0x02, 0x7e, 0x00, 0xee, 0x6f, 0x24, - 0xff, 0x80, 0x1d, 0xe5, 0x5e, 0x20, 0xe2, 0x04, 0x7f, 0x01, 0x80, - 0x02, 0x7f, 0x00, 0xe5, 0x46, 0x54, 0xf0, 0xfe, 0xbe, 0xf0, 0x04, - 0x7e, 0x01, 0x80, 0x02, 0x7e, 0x00, 0xee, 0x6f, 0x24, 0xff, 0x92, - 0x71, 0x92, 0x70, 0x90, 0x10, 0x00, 0xe0, 0x90, 0x10, 0x2c, 0xf0, - 0x90, 0x10, 0x03, 0xe0, 0xc3, 0x94, 0x30, 0x40, 0x14, 0xa2, 0x71, - 0x92, 0x77, 0xa2, 0x70, 0x92, 0x76, 0xe5, 0x2e, 0x13, 0x13, 0x54, - 0x3f, 0xf5, 0x2e, 0xc2, 0x77, 0xd2, 0x76, 0x90, 0x10, 0x2f, 0xe5, - 0x2e, 0xf0, 0xe5, 0x47, 0x64, 0x06, 0x70, 0x39, 0x90, 0x02, 0x29, - 0xe0, 0x54, 0xfe, 0xf0, 0xe5, 0x43, 0xc4, 0x54, 0x0f, 0x14, 0x60, - 0x0c, 0x24, 0xfe, 0x60, 0x0c, 0x24, 0x03, 0x70, 0x13, 0xc2, 0x38, - 0x80, 0x0f, 0xd2, 0x38, 0x80, 0x0b, 0xe5, 0x46, 0x30, 0xe2, 0x03, - 0xd3, 0x80, 0x01, 0xc3, 0x92, 0x38, 0x30, 0x47, 0x05, 0xaf, 0x27, - 0x02, 0x19, 0x0f, 0xe5, 0x27, 0xf4, 0xff, 0x02, 0x19, 0x0f, 0xe5, - 0x47, 0x64, 0x07, 0x60, 0x0f, 0xe5, 0x47, 0x64, 0x08, 0x60, 0x09, - 0xe5, 0x47, 0x64, 0x09, 0x60, 0x03, 0x02, 0x18, 0x8e, 0x90, 0x02, - 0x29, 0xe0, 0x54, 0xfc, 0xf0, 0xe5, 0x3a, 0x14, 0x60, 0x22, 0x14, - 0x60, 0x25, 0x14, 0x60, 0x2d, 0x24, 0xfc, 0x60, 0x49, 0x24, 0xf9, - 0x60, 0x14, 0x24, 0x0e, 0x70, 0x50, 0xe5, 0x46, 0x13, 0x13, 0x54, - 0x3f, 0x75, 0xf0, 0x03, 0x84, 0xe5, 0xf0, 0x24, 0xff, 0x80, 0x3a, - 0xd2, 0x39, 0xc2, 0x38, 0x80, 0x3e, 0xe5, 0x46, 0x30, 0xe2, 0x03, - 0xd3, 0x80, 0x1d, 0xc3, 0x80, 0x1a, 0xe5, 0x46, 0x30, 0xe2, 0x0d, - 0x54, 0x38, 0xc3, 0x94, 0x30, 0x50, 0x06, 0x7e, 0x00, 0x7f, 0x01, - 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x00, 0xee, 0x4f, 0x24, 0xff, 0x92, - 0x38, 0xc2, 0x39, 0x80, 0x13, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, - 0x80, 0x01, 0xc3, 0x92, 0x39, 0xc2, 0x38, 0x80, 0x04, 0xc2, 0x38, - 0xc2, 0x39, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5, 0x27, - 0xf4, 0xff, 0x02, 0x19, 0x0f, 0xe5, 0x47, 0x64, 0x0c, 0x60, 0x06, - 0xe5, 0x47, 0x64, 0x0b, 0x70, 0x7a, 0x90, 0x02, 0x29, 0xe0, 0x54, - 0xfd, 0xf0, 0xe5, 0x3a, 0x14, 0x60, 0x20, 0x14, 0x60, 0x21, 0x14, - 0x60, 0x2b, 0x24, 0xfc, 0x60, 0x45, 0x24, 0xf9, 0x60, 0x12, 0x24, - 0x0e, 0x70, 0x4a, 0xe5, 0x46, 0x13, 0x13, 0x54, 0x3f, 0x75, 0xf0, - 0x03, 0x84, 0xe5, 0xf0, 0x80, 0x29, 0xd2, 0x39, 0x80, 0x3a, 0xe5, - 0x46, 0x30, 0xe2, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x92, 0x39, 0x80, - 0x2d, 0xe5, 0x46, 0x30, 0xe2, 0x0d, 0x54, 0x38, 0xc3, 0x94, 0x30, - 0x50, 0x06, 0x7e, 0x00, 0x7f, 0x01, 0x80, 0x04, 0x7e, 0x00, 0x7f, - 0x00, 0xee, 0x4f, 0x24, 0xff, 0x92, 0x39, 0x80, 0x0f, 0xe5, 0x46, - 0x30, 0xe2, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x92, 0x39, 0x80, 0x02, - 0xc2, 0x39, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5, 0x27, - 0xf4, 0xff, 0x90, 0x02, 0x28, 0xef, 0xf0, 0x22, 0xe5, 0x47, 0xb4, - 0x0b, 0x10, 0x90, 0x02, 0x29, 0xe0, 0x54, 0xeb, 0xf0, 0xe5, 0x27, - 0x54, 0xeb, 0x45, 0x45, 0xf5, 0x27, 0x22, 0xe4, 0x90, 0x02, 0x29, - 0xf0, 0x30, 0x47, 0x04, 0xaf, 0x45, 0x80, 0x04, 0xe5, 0x45, 0xf4, - 0xff, 0x90, 0x02, 0x28, 0xef, 0xf0, 0x22, 0x8f, 0x50, 0xd2, 0x59, - 0x22, 0x8f, 0x54, 0xd2, 0x58, 0x22, 0xe4, 0xf5, 0x37, 0xc2, 0xaf, - 0xe5, 0x51, 0x14, 0x60, 0x4a, 0x14, 0x60, 0x6b, 0x24, 0x02, 0x60, - 0x03, 0x02, 0x1a, 0xd5, 0xd2, 0x59, 0x75, 0x55, 0x01, 0x20, 0x1a, - 0x1c, 0x90, 0x02, 0x08, 0xe0, 0x54, 0xfe, 0xf0, 0xe0, 0x20, 0xe1, - 0x23, 0x90, 0x04, 0x34, 0xe0, 0xb4, 0x02, 0x1c, 0xa3, 0xe0, 0xb4, - 0x02, 0x17, 0xa3, 0xe0, 0xb4, 0x02, 0x12, 0x7f, 0x20, 0x12, 0x19, - 0x40, 0x90, 0x10, 0x04, 0xe0, 0x54, 0xf3, 0xf0, 0x75, 0x51, 0x01, - 0x02, 0x1a, 0xd5, 0xe5, 0x50, 0x70, 0x06, 0x75, 0x37, 0x03, 0x02, - 0x1a, 0xd5, 0x90, 0x12, 0x00, 0xe0, 0x54, 0x03, 0x70, 0x15, 0x7f, - 0x20, 0x12, 0x19, 0x40, 0x20, 0x1a, 0x07, 0x90, 0x02, 0x08, 0xe0, - 0x54, 0xfb, 0xf0, 0x75, 0x51, 0x02, 0x02, 0x1a, 0xd5, 0xe5, 0x50, - 0x70, 0x03, 0x02, 0x1a, 0xd0, 0x20, 0x1a, 0x15, 0x90, 0x02, 0x08, - 0xe0, 0x30, 0xe3, 0x03, 0x02, 0x1a, 0xcc, 0x90, 0x04, 0x37, 0xe0, - 0x64, 0x22, 0x60, 0x03, 0x02, 0x1a, 0xcc, 0x90, 0x12, 0x04, 0x74, - 0x0a, 0xf0, 0xe5, 0x58, 0x30, 0xe3, 0x15, 0xe4, 0x90, 0x05, 0x00, + 0x92, 0x73, 0x92, 0x72, 0x20, 0x6b, 0x04, 0xa2, 0x6a, 0x80, 0x26, + 0x30, 0x6a, 0x06, 0xe5, 0x46, 0xa2, 0xe2, 0x80, 0x1d, 0xe5, 0x5e, + 0x20, 0xe1, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0xe5, 0x46, + 0x54, 0xf0, 0xfe, 0xbe, 0xf0, 0x04, 0x7e, 0x01, 0x80, 0x02, 0x7e, + 0x00, 0xee, 0x6f, 0x24, 0xff, 0x92, 0x75, 0x92, 0x74, 0x20, 0x6d, + 0x04, 0xa2, 0x6c, 0x80, 0x26, 0xe5, 0x47, 0x64, 0x0a, 0x70, 0x22, + 0x30, 0x6c, 0x06, 0xe5, 0x46, 0xa2, 0xe3, 0x80, 0x17, 0xe5, 0x3a, + 0xb4, 0x01, 0x06, 0xe5, 0x46, 0xa2, 0xe3, 0x80, 0x34, 0xe5, 0x46, + 0x20, 0xe4, 0x03, 0x30, 0xe5, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x80, + 0x26, 0x30, 0x6c, 0x06, 0xe5, 0x46, 0xa2, 0xe2, 0x80, 0x1d, 0xe5, + 0x5e, 0x20, 0xe2, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0xe5, + 0x46, 0x54, 0xf0, 0xfe, 0xbe, 0xf0, 0x04, 0x7e, 0x01, 0x80, 0x02, + 0x7e, 0x00, 0xee, 0x6f, 0x24, 0xff, 0x92, 0x71, 0x92, 0x70, 0x90, + 0x10, 0x00, 0xe0, 0x90, 0x10, 0x2c, 0xf0, 0x90, 0x10, 0x03, 0xe0, + 0xc3, 0x94, 0x30, 0x40, 0x19, 0xe0, 0x64, 0x32, 0x60, 0x14, 0xa2, + 0x71, 0x92, 0x77, 0xa2, 0x70, 0x92, 0x76, 0xe5, 0x2e, 0x13, 0x13, + 0x54, 0x3f, 0xf5, 0x2e, 0xc2, 0x77, 0xd2, 0x76, 0x30, 0x17, 0x0d, + 0x53, 0x2e, 0xf0, 0xe5, 0x2e, 0x45, 0x5d, 0x90, 0x10, 0x2f, 0xf0, + 0x80, 0x06, 0x90, 0x10, 0x2f, 0xe5, 0x2e, 0xf0, 0xe5, 0x47, 0x64, + 0x06, 0x70, 0x47, 0x90, 0x02, 0x28, 0xe0, 0x30, 0x47, 0x03, 0xff, + 0x80, 0x02, 0xf4, 0xff, 0x8f, 0x3f, 0x90, 0x02, 0x29, 0xe0, 0x54, + 0xfe, 0xf0, 0xe5, 0x43, 0xc4, 0x54, 0x0f, 0x14, 0x60, 0x0c, 0x24, + 0xfe, 0x60, 0x0c, 0x24, 0x03, 0x70, 0x13, 0xc2, 0xf8, 0x80, 0x0f, + 0xd2, 0xf8, 0x80, 0x0b, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, 0x80, + 0x01, 0xc3, 0x92, 0xf8, 0x30, 0x47, 0x05, 0xaf, 0x3f, 0x02, 0x1a, + 0x34, 0xe5, 0x3f, 0xf4, 0xff, 0x02, 0x1a, 0x34, 0xe5, 0x47, 0x64, + 0x07, 0x60, 0x0f, 0xe5, 0x47, 0x64, 0x08, 0x60, 0x09, 0xe5, 0x47, + 0x64, 0x09, 0x60, 0x03, 0x02, 0x19, 0xa2, 0x90, 0x02, 0x28, 0xe0, + 0x30, 0x47, 0x03, 0xff, 0x80, 0x02, 0xf4, 0xff, 0x8f, 0x3f, 0x90, + 0x02, 0x29, 0xe0, 0x54, 0xfc, 0xf0, 0xe5, 0x3a, 0x14, 0x60, 0x22, + 0x14, 0x60, 0x25, 0x14, 0x60, 0x2d, 0x24, 0xfc, 0x60, 0x49, 0x24, + 0xf9, 0x60, 0x14, 0x24, 0x0e, 0x70, 0x50, 0xe5, 0x46, 0x13, 0x13, + 0x54, 0x3f, 0x75, 0xf0, 0x03, 0x84, 0xe5, 0xf0, 0x24, 0xff, 0x80, + 0x3a, 0xd2, 0xf9, 0xc2, 0xf8, 0x80, 0x3e, 0xe5, 0x46, 0x30, 0xe2, + 0x03, 0xd3, 0x80, 0x1d, 0xc3, 0x80, 0x1a, 0xe5, 0x46, 0x30, 0xe2, + 0x0d, 0x54, 0x38, 0xc3, 0x94, 0x30, 0x50, 0x06, 0x7e, 0x00, 0x7f, + 0x01, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x00, 0xee, 0x4f, 0x24, 0xff, + 0x92, 0xf8, 0xc2, 0xf9, 0x80, 0x13, 0xe5, 0x46, 0x30, 0xe2, 0x03, + 0xd3, 0x80, 0x01, 0xc3, 0x92, 0xf9, 0xc2, 0xf8, 0x80, 0x04, 0xc2, + 0xf8, 0xc2, 0xf9, 0x30, 0x47, 0x04, 0xaf, 0x3f, 0x80, 0x04, 0xe5, + 0x3f, 0xf4, 0xff, 0x02, 0x1a, 0x34, 0xe5, 0x47, 0x64, 0x0c, 0x60, + 0x09, 0xe5, 0x47, 0x64, 0x0b, 0x60, 0x03, 0x02, 0x1a, 0x39, 0x90, + 0x02, 0x28, 0xe0, 0x30, 0x47, 0x03, 0xff, 0x80, 0x02, 0xf4, 0xff, + 0x8f, 0x3f, 0x90, 0x02, 0x29, 0xe0, 0x54, 0xfd, 0xf0, 0xe5, 0x3a, + 0x14, 0x60, 0x20, 0x14, 0x60, 0x21, 0x14, 0x60, 0x2b, 0x24, 0xfc, + 0x60, 0x45, 0x24, 0xf9, 0x60, 0x12, 0x24, 0x0e, 0x70, 0x4a, 0xe5, + 0x46, 0x13, 0x13, 0x54, 0x3f, 0x75, 0xf0, 0x03, 0x84, 0xe5, 0xf0, + 0x80, 0x29, 0xd2, 0xf9, 0x80, 0x3a, 0xe5, 0x46, 0x30, 0xe2, 0x03, + 0xd3, 0x80, 0x01, 0xc3, 0x92, 0xf9, 0x80, 0x2d, 0xe5, 0x46, 0x30, + 0xe2, 0x0d, 0x54, 0x38, 0xc3, 0x94, 0x30, 0x50, 0x06, 0x7e, 0x00, + 0x7f, 0x01, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x00, 0xee, 0x4f, 0x24, + 0xff, 0x92, 0xf9, 0x80, 0x0f, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, + 0x80, 0x01, 0xc3, 0x92, 0xf9, 0x80, 0x02, 0xc2, 0xf9, 0x30, 0x47, + 0x04, 0xaf, 0x3f, 0x80, 0x04, 0xe5, 0x3f, 0xf4, 0xff, 0x90, 0x02, + 0x28, 0xef, 0xf0, 0x22, 0xe5, 0x47, 0xb4, 0x0b, 0x10, 0x90, 0x02, + 0x29, 0xe0, 0x54, 0xeb, 0xf0, 0xe5, 0x3f, 0x54, 0xeb, 0x45, 0x45, + 0xf5, 0x3f, 0x22, 0xe4, 0x90, 0x02, 0x29, 0xf0, 0x30, 0x47, 0x04, + 0xaf, 0x45, 0x80, 0x04, 0xe5, 0x45, 0xf4, 0xff, 0x90, 0x02, 0x28, + 0xef, 0xf0, 0x22, 0x8f, 0x50, 0xd2, 0x59, 0x22, 0x8f, 0x54, 0xd2, + 0x58, 0x22, 0xe4, 0xf5, 0x25, 0xc2, 0xaf, 0xe5, 0x51, 0x14, 0x60, + 0x4a, 0x14, 0x60, 0x6b, 0x24, 0x02, 0x60, 0x03, 0x02, 0x1b, 0xd0, + 0xd2, 0x59, 0x75, 0x55, 0x01, 0x90, 0x02, 0x08, 0xe0, 0x54, 0xfe, + 0xf0, 0xe0, 0x20, 0xe1, 0x23, 0x90, 0x04, 0x34, 0xe0, 0xb4, 0x02, + 0x1c, 0xa3, 0xe0, 0xb4, 0x02, 0x17, 0xa3, 0xe0, 0xb4, 0x02, 0x12, + 0x7f, 0x20, 0x12, 0x1a, 0x65, 0x90, 0x10, 0x04, 0xe0, 0x54, 0xf3, + 0xf0, 0x75, 0x51, 0x01, 0x02, 0x1b, 0xd0, 0xe5, 0x50, 0x60, 0x03, + 0x02, 0x1b, 0xd0, 0x75, 0x25, 0x03, 0x02, 0x1b, 0xd0, 0x90, 0x12, + 0x00, 0xe0, 0x54, 0x03, 0x70, 0x12, 0x7f, 0x20, 0x12, 0x1a, 0x65, + 0x90, 0x02, 0x08, 0xe0, 0x54, 0xfb, 0xf0, 0x75, 0x51, 0x02, 0x02, + 0x1b, 0xd0, 0xe5, 0x50, 0x60, 0x03, 0x02, 0x1b, 0xd0, 0x02, 0x1b, + 0xcb, 0x90, 0x02, 0x08, 0xe0, 0x30, 0xe3, 0x03, 0x02, 0x1b, 0xc7, + 0x90, 0x04, 0x37, 0xe0, 0x64, 0x22, 0x60, 0x03, 0x02, 0x1b, 0xc7, + 0x90, 0x12, 0x04, 0x74, 0x0a, 0xf0, 0xe5, 0x58, 0x30, 0xe3, 0x1c, + 0x90, 0x00, 0x02, 0xe0, 0x30, 0xe0, 0x15, 0xe4, 0x90, 0x05, 0x00, 0xf0, 0xa3, 0x74, 0x08, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0x74, 0x03, - 0xf0, 0x7f, 0x01, 0x12, 0x03, 0x30, 0x90, 0x13, 0x28, 0xe0, 0x90, + 0xf0, 0x7f, 0x01, 0x12, 0x02, 0x94, 0x90, 0x13, 0x28, 0xe0, 0x90, 0x70, 0x1a, 0xf0, 0x90, 0x13, 0x29, 0xe0, 0x90, 0x70, 0x1b, 0xf0, 0x90, 0x13, 0x2b, 0xe0, 0x90, 0x70, 0x22, 0xf0, 0x90, 0x13, 0x28, 0xe0, 0x54, 0xf0, 0xf0, 0xa3, 0xe0, 0x54, 0xf0, 0xf0, 0x90, 0x13, 0x2b, 0xe0, 0x54, 0xcc, 0xf0, 0xe5, 0x58, 0x30, 0xe3, 0x17, 0xe5, - 0x34, 0x70, 0x13, 0xe5, 0x3c, 0xf4, 0x90, 0x13, 0x2a, 0x60, 0x05, + 0x30, 0x70, 0x13, 0xe5, 0x3c, 0xf4, 0x90, 0x13, 0x2a, 0x60, 0x05, 0xe0, 0x54, 0xf3, 0x80, 0x11, 0xe0, 0x54, 0xfb, 0xf0, 0x80, 0x14, 0xe5, 0x3c, 0xf4, 0x90, 0x13, 0x2a, 0x60, 0x08, 0xe0, 0x54, 0xf2, - 0x45, 0x3c, 0xf0, 0x80, 0x04, 0xe0, 0x54, 0xfa, 0xf0, 0x20, 0x1a, - 0x07, 0x90, 0x04, 0x01, 0xe0, 0x44, 0x10, 0xf0, 0xe5, 0x34, 0xd3, - 0x94, 0x01, 0x40, 0x09, 0xe5, 0x30, 0x70, 0x05, 0x75, 0x8c, 0x40, - 0x80, 0x03, 0x75, 0x8c, 0x80, 0x90, 0x04, 0x01, 0xe0, 0x54, 0xfd, - 0xf0, 0x20, 0x1a, 0x07, 0x90, 0x12, 0x04, 0xe0, 0x44, 0x04, 0xf0, - 0xe5, 0x58, 0x30, 0xe0, 0x06, 0x90, 0x01, 0x0d, 0xe0, 0xf5, 0x31, - 0xe5, 0x34, 0xd3, 0x94, 0x01, 0x40, 0x2c, 0x90, 0x01, 0x0d, 0xe0, - 0x44, 0x01, 0xf0, 0xe5, 0x58, 0x20, 0xe3, 0x0c, 0xe5, 0x34, 0xb4, - 0x03, 0x07, 0x90, 0x12, 0x04, 0xe0, 0x54, 0xfd, 0xf0, 0x20, 0x02, - 0x11, 0x20, 0x03, 0x0e, 0x90, 0x01, 0x0d, 0xe0, 0x54, 0xfb, 0xf0, - 0x90, 0x01, 0x0c, 0xe0, 0x54, 0xfd, 0xf0, 0x75, 0x37, 0x01, 0x75, - 0x55, 0x02, 0xe4, 0xf5, 0x51, 0x80, 0x09, 0xe5, 0x50, 0x70, 0x05, - 0x75, 0x37, 0x03, 0xf5, 0x51, 0xe5, 0x37, 0x60, 0x18, 0xc2, 0x01, - 0xe4, 0xf5, 0x51, 0xc2, 0x59, 0x20, 0x1a, 0x0e, 0xad, 0x37, 0xaf, - 0x40, 0x12, 0x1b, 0xfa, 0xe5, 0x37, 0xb4, 0x03, 0x02, 0xd2, 0x03, - 0xd2, 0xaf, 0x22, 0xc2, 0xaf, 0x30, 0x01, 0x0e, 0xe4, 0xf5, 0x51, - 0xc2, 0x59, 0xc2, 0x01, 0x7d, 0x02, 0xaf, 0x40, 0x12, 0x1b, 0xfa, - 0xe5, 0x52, 0x14, 0x60, 0x56, 0x14, 0x60, 0x33, 0x24, 0x02, 0x60, - 0x03, 0x02, 0x1b, 0xf7, 0xe5, 0x34, 0xd3, 0x94, 0x01, 0x40, 0x1f, - 0x90, 0x01, 0x0c, 0xe0, 0x44, 0x02, 0xf0, 0xa3, 0xe0, 0x44, 0x04, - 0xf0, 0x90, 0x12, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0x32, 0x12, - 0x03, 0x30, 0x90, 0x01, 0x0d, 0xe0, 0x54, 0xfe, 0xf0, 0x75, 0x52, - 0x02, 0x75, 0x55, 0x03, 0xe5, 0x58, 0x30, 0xe0, 0x06, 0x90, 0x01, - 0x0d, 0xe5, 0x31, 0xf0, 0x90, 0x12, 0x04, 0xe0, 0x54, 0xfb, 0xf0, - 0x7f, 0x20, 0x12, 0x19, 0x45, 0x75, 0x52, 0x01, 0x75, 0x55, 0x03, - 0x02, 0x1b, 0xf7, 0xe5, 0x54, 0x60, 0x03, 0x02, 0x1b, 0xf7, 0x90, - 0x04, 0x01, 0xe0, 0x44, 0x0e, 0xf0, 0x20, 0x1a, 0x04, 0xe0, 0x54, + 0x45, 0x3c, 0xf0, 0x80, 0x04, 0xe0, 0x54, 0xfa, 0xf0, 0x90, 0x04, + 0x01, 0xe0, 0x44, 0x10, 0xf0, 0x75, 0x8c, 0x80, 0xe0, 0x54, 0xfd, + 0xf0, 0x90, 0x12, 0x04, 0xe0, 0x44, 0x04, 0xf0, 0xe5, 0x58, 0x30, + 0xe0, 0x06, 0x90, 0x01, 0x0d, 0xe0, 0xf5, 0x2f, 0xe5, 0x30, 0xd3, + 0x94, 0x01, 0x40, 0x17, 0x20, 0x02, 0x14, 0x20, 0x03, 0x11, 0x30, + 0x4f, 0x0e, 0x90, 0x01, 0x0d, 0xe0, 0x54, 0xfb, 0xf0, 0x90, 0x01, + 0x0c, 0xe0, 0x54, 0xfd, 0xf0, 0x75, 0x25, 0x01, 0x75, 0x55, 0x02, + 0xe4, 0xf5, 0x51, 0x80, 0x09, 0xe5, 0x50, 0x70, 0x05, 0x75, 0x25, + 0x03, 0xf5, 0x51, 0xe5, 0x25, 0x60, 0x15, 0xc2, 0x01, 0xe4, 0xf5, + 0x51, 0xc2, 0x59, 0xad, 0x25, 0xaf, 0x40, 0x12, 0x1c, 0xe5, 0xe5, + 0x25, 0xb4, 0x03, 0x02, 0xd2, 0x03, 0xd2, 0xaf, 0x22, 0xc2, 0xaf, + 0x30, 0x01, 0x0e, 0xe4, 0xf5, 0x51, 0xc2, 0x59, 0xc2, 0x01, 0x7d, + 0x02, 0xaf, 0x40, 0x12, 0x1c, 0xe5, 0xe5, 0x52, 0x14, 0x60, 0x48, + 0x14, 0x60, 0x25, 0x24, 0x02, 0x60, 0x03, 0x02, 0x1c, 0xe2, 0xe5, + 0x30, 0xd3, 0x94, 0x01, 0x40, 0x11, 0x90, 0x01, 0x0c, 0xe0, 0x44, + 0x02, 0xf0, 0xa3, 0xe0, 0x44, 0x04, 0xf0, 0x7f, 0x0a, 0x12, 0x02, + 0x94, 0x75, 0x52, 0x02, 0x75, 0x55, 0x03, 0xe5, 0x58, 0x30, 0xe0, + 0x06, 0x90, 0x01, 0x0d, 0xe5, 0x2f, 0xf0, 0x90, 0x12, 0x04, 0xe0, + 0x54, 0xfb, 0xf0, 0x7f, 0x20, 0x12, 0x1a, 0x6a, 0x75, 0x52, 0x01, + 0x75, 0x55, 0x03, 0x02, 0x1c, 0xe2, 0xe5, 0x54, 0x60, 0x03, 0x02, + 0x1c, 0xe2, 0x90, 0x04, 0x01, 0xe0, 0x44, 0x0e, 0xf0, 0xe0, 0x54, 0xef, 0xf0, 0xe4, 0xf5, 0x8c, 0xe5, 0x58, 0x54, 0x18, 0x60, 0x1e, 0x90, 0x70, 0x1a, 0xe0, 0x90, 0x13, 0x28, 0xf0, 0x90, 0x70, 0x1b, 0xe0, 0x90, 0x13, 0x29, 0xf0, 0xa3, 0x74, 0x05, 0xf0, 0x90, 0x70, 0x22, 0xe0, 0x90, 0x13, 0x2b, 0xf0, 0x80, 0x11, 0x90, 0x13, 0x28, 0xe0, 0x44, 0x0f, 0xf0, 0xa3, 0xe0, 0x44, 0x0f, 0xf0, 0xa3, 0xe0, 0x44, 0x05, 0xf0, 0x90, 0x12, 0x04, 0x74, 0x03, 0xf0, 0xe5, 0x58, - 0x30, 0xe3, 0x16, 0x90, 0x05, 0x00, 0x74, 0xe2, 0xf0, 0xa3, 0x74, - 0x08, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0x74, 0x03, 0xf0, 0x7f, 0x01, - 0x12, 0x03, 0x30, 0x20, 0x1a, 0x07, 0x90, 0x02, 0x08, 0xe0, 0x44, - 0x05, 0xf0, 0x90, 0x10, 0x04, 0xe0, 0x44, 0x0c, 0xf0, 0xe4, 0xf5, - 0x52, 0xf5, 0x55, 0x30, 0x02, 0x09, 0xc2, 0x02, 0x7d, 0x01, 0xaf, - 0x41, 0x12, 0x1b, 0xfa, 0x30, 0x03, 0x02, 0xc2, 0x03, 0xd2, 0xaf, - 0x22, 0xef, 0xf4, 0x60, 0x2d, 0xe4, 0xfe, 0x74, 0x14, 0x2e, 0xf5, - 0x82, 0xe4, 0x34, 0x70, 0xf5, 0x83, 0xe0, 0xb4, 0xff, 0x19, 0x74, - 0x14, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5, 0x83, 0xef, 0xf0, - 0x74, 0x1c, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5, 0x83, 0xed, - 0xf0, 0x22, 0x0e, 0xbe, 0x04, 0xd5, 0x22, 0x22, 0x22, 0x30, 0x1a, - 0x77, 0x90, 0x04, 0x37, 0xe0, 0x20, 0xe5, 0x6c, 0x90, 0x04, 0x28, - 0xe0, 0xf5, 0x38, 0xa3, 0xe0, 0xf5, 0x37, 0xf5, 0x39, 0xe4, 0xf5, - 0x25, 0xe5, 0x39, 0x75, 0xf0, 0x80, 0xa4, 0x24, 0x00, 0xff, 0xe5, - 0xf0, 0x34, 0x80, 0xfe, 0xe5, 0x37, 0x65, 0x39, 0x70, 0x05, 0xfc, - 0x7d, 0x28, 0x80, 0x04, 0x7c, 0x00, 0x7d, 0x00, 0xef, 0x2d, 0xff, - 0xee, 0x3c, 0xfe, 0x12, 0x1c, 0xa9, 0x50, 0x07, 0x90, 0x01, 0x14, - 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x39, 0x65, 0x38, 0x60, 0x10, 0xe4, - 0x25, 0x39, 0xff, 0xe4, 0x34, 0x80, 0x8f, 0x82, 0xf5, 0x83, 0xe0, - 0xf5, 0x39, 0x80, 0xbb, 0x90, 0x04, 0x10, 0x74, 0x01, 0xf0, 0x90, - 0x04, 0x28, 0xe5, 0x38, 0xf0, 0xa3, 0xe5, 0x37, 0xf0, 0x90, 0x04, - 0x11, 0x74, 0x01, 0xf0, 0x80, 0x8d, 0xc2, 0x06, 0xd2, 0x1b, 0x22, - 0xe5, 0x25, 0xc3, 0x94, 0x06, 0x50, 0x19, 0x8f, 0x82, 0x8e, 0x83, - 0xe0, 0xb4, 0xff, 0x07, 0x05, 0x25, 0xe4, 0xf5, 0x24, 0x80, 0x2e, - 0xe4, 0xf5, 0x25, 0x8f, 0x82, 0x8e, 0x83, 0xf0, 0x80, 0x24, 0xe5, - 0x24, 0x75, 0xf0, 0x06, 0x84, 0x74, 0x08, 0x25, 0xf0, 0xf5, 0x82, - 0xe4, 0x34, 0x10, 0xf5, 0x83, 0xe0, 0xfd, 0x8f, 0x82, 0x8e, 0x83, - 0xe0, 0x6d, 0x70, 0x06, 0x05, 0x25, 0x05, 0x24, 0x80, 0x03, 0xe4, - 0xf5, 0x25, 0x0f, 0xbf, 0x00, 0x01, 0x0e, 0xef, 0x54, 0x7f, 0x60, - 0x07, 0xe5, 0x25, 0xc3, 0x94, 0x2a, 0x40, 0xab, 0xe5, 0x25, 0xb4, - 0x2a, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x22, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x30, 0xe3, 0x1d, 0x90, 0x00, 0x02, 0xe0, 0x30, 0xe0, 0x16, 0x90, + 0x05, 0x00, 0x74, 0xe2, 0xf0, 0xa3, 0x74, 0x08, 0xf0, 0xa3, 0x74, + 0x01, 0xf0, 0x74, 0x03, 0xf0, 0x7f, 0x01, 0x12, 0x02, 0x94, 0x90, + 0x02, 0x08, 0xe0, 0x44, 0x05, 0xf0, 0x90, 0x10, 0x04, 0xe0, 0x44, + 0x0c, 0xf0, 0xe4, 0xf5, 0x52, 0xf5, 0x55, 0x30, 0x02, 0x09, 0xc2, + 0x02, 0x7d, 0x01, 0xaf, 0x41, 0x12, 0x1c, 0xe5, 0x30, 0x03, 0x02, + 0xc2, 0x03, 0xd2, 0xaf, 0x22, 0xef, 0xf4, 0x60, 0x2d, 0xe4, 0xfe, + 0x74, 0x14, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5, 0x83, 0xe0, + 0xb4, 0xff, 0x19, 0x74, 0x14, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, + 0xf5, 0x83, 0xef, 0xf0, 0x74, 0x1c, 0x2e, 0xf5, 0x82, 0xe4, 0x34, + 0x70, 0xf5, 0x83, 0xed, 0xf0, 0x22, 0x0e, 0xbe, 0x04, 0xd5, 0x22, + 0x22, 0x22, 0x90, 0x70, 0x2a, 0xe0, 0x30, 0xe1, 0x43, 0xc2, 0xaf, + 0x90, 0x70, 0x28, 0xe0, 0x90, 0x10, 0x1c, 0xf0, 0x90, 0x70, 0x29, + 0xe0, 0x90, 0x10, 0x1d, 0xf0, 0x90, 0x70, 0x2a, 0xe0, 0x90, 0x10, + 0x1e, 0xf0, 0x90, 0x10, 0x1c, 0xe0, 0xf5, 0x25, 0x90, 0x10, 0x1e, + 0xe0, 0x20, 0xe1, 0xf3, 0x90, 0x10, 0x1c, 0xe0, 0x90, 0x70, 0x28, + 0xf0, 0x90, 0x10, 0x1d, 0xe0, 0x90, 0x70, 0x29, 0xf0, 0x90, 0x10, + 0x1e, 0xe0, 0x90, 0x70, 0x2a, 0xf0, 0xc2, 0x05, 0xd2, 0xaf, 0x22, + 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3012,5 +3012,5 @@ static const uint8_t rt2860[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x53, 0x88 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x5b, 0xd2 }; Modified: head/sys/contrib/dev/ral/rt2860.fw.uu ============================================================================== --- head/sys/contrib/dev/ral/rt2860.fw.uu Wed Feb 11 02:43:58 2015 (r278550) +++ head/sys/contrib/dev/ral/rt2860.fw.uu Wed Feb 11 05:25:23 2015 (r278551) @@ -15,27 +15,24 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. begin 644 rt2860.fw -M`@-;`@*F(B+___\"`2S______P(`'O______`@#=P.#`\,"#P(+`T'70&,*O -M,$4#$A`)D`06X##C`W0(\)`$%.`@YP,"`,MT@/"0#U1!(0 -M)8`&D'`0X/5%Y/VO-A("@M($D'`3Y/"0#U1!(0 +M)8`&D'`0X/5%Y/VO)!(""M($D'`3Y/"0X"#A\Y`0'."0<"CPD!`=X)!P*?"0$![@D'`J\,(% -MTJ\B$@+(,$4#$A`#,`$&(`D#$A`<,`(&(`H#$A`?,`,&(`L#$A`?,`0&(`P# -M$A`B(!,)(!$&Y2M%+&`#TX`!PY*I$@,<@+_"0])%Y/4@]2'U4_5&]2OU+,)" -M]5'U4O55D`08=(#PD`0:=`CPPAK"&,(;(LCOR.;Z".9*8`S([\@(YA88<`$6 -MPR+M)/_][#3_R._(]@C&[<;3(M"#T(+XY)-P$G0!DW`-HZ.3^'0!D_6"B(/D -M0!`!T@/#2KR)UB0+D]8SUBO6(];CUZ'60&-*,=:@%(N]@`Q^` -M^B+_P"9T`\#@P(+`@W4F"B+`)G0#P.#`@L"#=288(C!%`Q(0%>4@<`,@$`,P -M$0-#AP$BSN_.[F`(?_\2`O@>@/4BR._(YF`#%L,B[13VTR+([\CF8`86YB3_ -MLR+#(GA_Y/;8_76!7P(!Q704+O6"Y#1P]8,B[Y`#>Y.0`P!S"AC_________ +M$A`/PHW2K]#0T(+0@]#PT.`R$@)0,$4#$A`#,`$&(`D#$A`<,`(&(`H#$A`? +M,`,&(`L#$A`?,`0&(`P#$A`B(!,)(!$&Y2M%+&`#TX`!PY*I$@*`@+_"0])% +MY/4@]2'U4_5&]2OU+,)"]5'U4O55D`08=(#PD`0:=`CP(M"#T(+XY)-P$G0! +MDW`-HZ.3^'0!D_6"B(/D0!`!T@/#2KR)UB0+D]8SUBO6(];CU +MZ'60&-*,=:@%(C!%`Q(0%>4@<`,@$`,P$0-#AP$BSN_.[F`(?_\2`L4>@/4B +M>'_D]MC]=8%?`@%Z=!0N]8+D-'#U@R+OD`+#DY`#`',*&.]@`Q^`^B+_____ M____________________________________________________________ +M____P"9T`\#@P(+`@W4F"B+`)G0#P.#`@L"#=288(O__________________ M____________________________________________________________ M____________________________________________________________ M____________________________________________________________ @@ -106,83 +103,86 @@ M_______________________________________ M____________________________________________________________ M____________________________________________________________ M____________________________________________________________ -M_____P(0*`(0.P(0/`(3O`(3O0(4<@(4<\,B__\"&4H"&O0"%6P"%*#U/`(3 -MM>55M`(/Y5@PX`:0`0UT"/!]`8`"?0*O5A("@@(3M2`"`S`#"GT"KU82`H(" -M$[7E--.4`4`,D`$,X$0"\*/@1`3PA59!T@(BD'`1X/1P`P(3N^#U,"+E--.4 -M`4`'Y55@`P(3NY!P$.!4?_^_"@V0!D"&`$X+0@!G5.`W5/(.3U)R*005'9`=@'>5'9`A@%^5'9`E@$>5'9`I@"^5'9`M@!>5' -MM`P(D'`1X%0/]3KE1[0)".4ZM`,#Y/5&Y4>T"@CE.K0!`^3U1N3]KU82`H+2 -M!"*0"0#_D'`9X/[O7I`"*?`P1P2O)X`$Y2?T_Y`"*._P(N4TTY0! -M0`?E56`#`A-)D'`0X/Z0WXYO57_:]6$@*"`A.UY333E`%`!^558`," -M$TF0#][?6"CH/@]5?]KU82`H("$[60$`#@]5?D]5CU69`0`^"T -M*`5U6`&`/)`0`^"T,`5U6`*`,)`0`^"T,P5U6`2`))`0`^"T-0R0$`+@M'(% -M=5@(@!&0$`/@M#4*D!`"X+23`W58$.58,.$9D`4(X$0!\/V0!07@5/OP1`3P -M[53^D`4(\.3U3O5/=3K_PAK"&,(;]320!:1T$?"C=/_PHW0#\.3U,,(9D`$- -MX$1`\'4\_ZU7KU82`H+DD'`R\(!WY333E`%`"^558`=]`Z]6`@*"D'`0X"3_ -MDI/D_:]6$@*"@%3E--.4`4`-Y55@"7T#KU82`H*`0)!P$.`D_Y)*T@6M5Z]6 -M$@*"@"WD]33U,)!P$.#T8`/@]32M5Z]6$@*"@!72&04OY2^T&@/D]2_2!*U7 -MKU82`H*0!!1T@/`B(N4TPY0#0!?E5;0"$N4P8`XP8`MT_25&]4;2!.3U4^53 -M8`,"%'$P8"&R33!-'.4TPY0#0!'E5;0"#.4P8`AT`R5&]4:``@5&P@3E3T5. -M8`CE3Q5/<`(53C`:27\R?;A\"Q("-5`&D`00=$#P?S5],A(#/U`)D!`$X%3W -M\-(&Y373E"U`,#`;+<(;HAB2&B`:))`$">!4W?"0$`3@1`CPPF'2`R+D]36B -M&)(:,!H'D`0)X$0B\"(B,!0PD'`9X%4G_Y!P&.!/]2>0`BG@_Y!P&>#^[UZ0 -M`BGP,$<$KR>`!.4G]/^0`BCO\,(4(L)+PDSE1!("7!3)`!57!!53"!4S$!3= -M(!3]8!4.H```%5F%2$.%2D*%3%[E1V0&8`,"%5F`&^5(Q%0/]4/E2L14#_5" -MY4S$5`_U7N5'9`9P85-##X!Y4=D!G!-@!OE2<14#_5#Y4O$ -M5`_U0N5-Q%0/]5[E1V0&<##E0U0/1!#U0X`FY4=D!&`%Y4>T!09#7@1U0@GE -M1[0&$.5#5`]$,/5#@`;22X`"TDSD]2KE0L14\/_E0U0/3_5?TF`BTA7E1R3U -M8`LDRV`')$!P!L(5(A(9%1(5CL(5PJ_"!-*O(L*OD`04X%0.8`32'(`(Y4Y% -M3R3_DAS2KY`$%."BY)(==![PY5]4#_4MY2IP$S`5?(.4+,!TIY5]4,&0P -M<"'E*G`5Y33#E`-`">4P8`5U*@6`!W4J#(`"%2K2;-)M@`_E7S#F!L)LTFV` -M!-)LPFWE1V0#<"$P2P;";-)M@!CE*G`#,$P1PDSE*G`%=2H'@`(5*M)LTFWE -M1[0)%.5$(.,+Y3ID`F`%Y3JT`P3";-)MY4>T"A/E.K0!!L)LTFV`".4Z<`32 -M;,)M(&D'Y5X@X`*R:"!K!^5>(.$"LFH@;0?E7B#B`K)L=2Y`(&D$HFB`13!H -M!N5&HN*`/#`9'.5>(.`$?P&``G\`Y2^T&01^`8`"?@#N;R3_@!WE7B#@!'\! -M@`)_`.5&5/#^OO`$?@&``GX`[F\D_Y)SDG(@:P2B:H!%,&H&Y4:BXH`\,!D< -MY5X@X01_`8`"?P#E+[09!'X!@`)^`.YO)/^`'>5>(.$$?P&``G\`Y494\/Z^ -M\`1^`8`"?@#N;R3_DG62="!M!*)L@";E1V0*<"(P;`;E1J+C@!?E.K0!!N5& -MHN.`4^5&(.0#,.4#TX`!PX!%,&P&Y4:BXH`\,!D5>(.($?P&``G\`Y494\/Z^\`1^`8`"?@#N;R3_DG&2 -M<)`0`."0$"SPD!`#X,.4,$`4HG&2=Z)PDG;E+A,35#_U+L)WTG:0$"_E+O#E -M1V0&<#F0`BG@5/[PY4/$5`\48`PD_F`,)`-P$\(X@`_2.(`+Y48PX@/3@`'# -MDC@P1P6O)P(9#^4G]/\"&0_E1V0'8`_E1V0(8`GE1V0)8`,"&(Z0`BG@5/SP -MY3H48"(48"448"TD_&!))/E@%"0.<%#E1A,35#]U\`.$Y?`D_X`ZTCG".(`^ -MY48PX@/3@!W#@!KE1C#B#50XPY0P4`9^`'\!@`1^`'\`[D\D_Y(XPCF`$^5& -M,.(#TX`!PY(YPCB`!,(XPCDP1P2O)X`$Y2?T_P(9#^5'9`Q@!N5'9`MP>I`" -M*>!4_?#E.A1@(!1@(11@*R3\8$4D^6`2)`YP2N5&$Q-4/W7P`X3E\(`ITCF` -M.N5&,.(#TX`!PY(Y@"WE1C#B#50XPY0P4`9^`'\!@`1^`'\`[D\D_Y(Y@`_E -M1C#B`].``<.2.8`"PCDP1P2O)X`$Y2?T_Y`"*._P(N5'M`L0D`(IX%3K\.4G -M5.M%1?4G(N20`BGP,$<$KT6`!.5%]/^0`BCO\"*/4-)9(H]4TE@BY/4WPJ_E -M411@2A1@:R0"8`,"&M726755`2`:')`"".!4_O#@(.$CD`0TX+0"'*/@M`(7 -MH^"T`A)_(!(90)`0!.!4\_!U40$"&M7E4'`&=3<#`AK5D!(`X%0#"0!4^_"`%.4\])`3*F`(X%3R13SP@`3@5/KP(!H'D`0!X$00 -M\.4TTY0!0`GE,'`%=8Q`@`-UC("0!`'@5/WP(!H'D!($X$0$\.58,.`&D`$- -MX/4QY333E`%`+)`!#>!$`?#E6"#C#.4TM`,'D!($X%3]\"`"$2`##I`!#>!4 -M^_"0`0S@5/WP=30!#?@(.5LD`0HX/4XH^#U-_4YY/4EY3EU\("D -M)`#_Y?`T@/[E-V4Y<`7\?2B`!'P`?0#O+?_N//X2'*E0!Y`!%.!$`O#E.64X -M8!#D)3G_Y#2`CX+U@^#U.8"[D`00=`'PD`0HY3CPH^4W\)`$$70!\("-P@;2 -M&R+E)<.4!E`9CX*.@^"T_P<%)>3U)(`NY/4ECX*.@_"`).4D=?`&A'0()?#U -M@N0T$/6#X/V/@HZ#X&UP!@4E!22``^3U)0^_``$.[U1_8`?E)<.4*D"KY26T -M*@/3@`'#(@`````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_____P(0*`(0,@(0,P(4P@(4PP(5CP(5D,,B__\"&F\"&^P"%KP"%?#U/`(4N^55M`(/Y5@PX`:0`0UT"/!]`8`"?0*O5A(""@(4NR`" +M`S`#"GT"KU82`@H"%+OE,-.4`4`,D`$,X$0"\*/@1`3PA59!T@(BD'`1X+1: +M`\)/(M)/(N4PTY0!4`,"%,&0`0S@1`+PH^!$!/`BY3#3E`%0`P(4P9`!#.!4 +M_?"CX%3[\"+E,-.4`4`'Y55@`P(4P9!P$.!4?_^_"@V0!D"&`$X+0@!G5.`W5/(.3U/R*005'9`=@'>5'9`A@%^5'9`E@$>5' +M9`I@"^5'9`M@!>5'M`P(D'`1X%0/]3KE1[0)".4ZM`,#Y/5&Y4>T"@CE.K0! +M`^3U1N3]KU82`@K2!"*0"0#_D'`9X/[O7I`"*?`P1P2O/X`$Y3_T +M_Y`"*._P(I!P$.`D_Y(:=3(#=3,?Y/4QK5>O5A(""@(4NY`0`.#U5^3U6/59 +MD!`#X+0H!758`8`\D!`#X+0P!758`H`PD!`#X+0S!758!(`DD!`#X+0U#)`0 +M`N"T<@5U6`B`$9`0`^"T-0J0$`+@M),#=5@0Y5@PX1F0!0C@1`'P_9`%!>!4 +M^_!$!/#M5/Z0!0CPY/5.]4]U.O_U,)`%I'01\*-T__"C=`/PTD^0`0W@1$#P +M=3S_K5>O5A(""I!P-G0W\*-T,O"0!`'@1`'PPAK"%P(4N^4PTY0!0`OE56`' +M?0.O5@(""I!P$.`D_Y*3Y/VO5A(""@(4NY`0`."0$"SPD!`O=$#PD'`1X%1_ +M]5?@5("0<#+PD'`0X/_E5].?0$.0<#/E5_"0``G\1D`4![_"C=`'P=`/P_Q("E(##D'`S +MY5?PD'`SX/^0_PHW0!\'0#\/\2`I2`P)!P$.#_D'`RX$^0!0#PY5A4#V`$?Q>` +M`G\1D`4![_"C=`'P=`/P_Q("E)`0`."0$"SPD!`O='_PY/VO5A(""@(4N^4P +MTY0!0`WE56`)?0.O5A(""H!RD'`0X"3_DDK2!:U7KU82`@J`7Y!P$>`D_Y(7 +MD'`0X/5=K5>O5A(""I`$%'2`\#`7$Y`0`."0$"SPD!`OX%3P]5=%7?#DD'`3 +M\.56]&`JD'`EX$0!\)`"+'3_\"+D]3#23Y!P$.#T8`/@]3"M5Z]6$@(*D`04 +M=(#P(B+E,T4R8`KE,Q4S<`H5,H`&=3(#=3,?Y3-%,F`#`A5P(!H#`A5P=*`E +M,?6"Y#1,]8/@8'I_?A(5WN]4_D0"_7]^$A7$Y3%_`"7@_N\D`/6"=$T^KX*0 +M3*CPH^_PY/56]5=_?Q(5WI!,J.#ZH^`E5_6"ZC56]8/O\`57Y5=P`@56PY2` +MY5:4`4#8?WX2%=[O1`/]?WX2%<1TH"4Q]8+D-$SU@^3P!3'E,;0(`^3U,>53 +M#^[UZ0`BGP,$<$KS^`!.4_]/^0`BCO\,(4(I`0'.WPH^_P +MHW0*\)`0'.#U6)`0'N`@X?,BD!`=[_"C=`OPD!`X"#A\Z]8(L)+ +MPDSE1!(!Y!89`!:G!!:C"!:#$!8M(!9-8!9>H```%JF%2$.%2D*%3%[E1V0& +M8`,"%JF`&^5(Q%0/]4/E2L14#_5"Y4S$5`_U7N5'9`9P85-##X!Y4=D!G!-@!OE2<14#_5#Y4O$5`_U0N5-Q%0/]5[E1V0&<##E0U0/1!#U +M0X`FY4=D!&`%Y4>T!09#7@1U0@GE1[0&$.5#5`]$,/5#@`;22X`"TDSD]2?E +M0L14\/_E0U0/3_5?TF`BTA7E1R3U8`LDRV`')$!P!L(5(A(:.A(6WL(5PJ_" +M!-*O(L*OD`04X%0.8`32&(`(Y4Y%3R3_DAC2KY`$%."BY)(9=![PY5]4#_4M +MY2=P$S`8!>5?(.4+,!D9Y5]4,/^_,!'E)W`%=2<,@`(5)])LTFV`#^5?,.8& +MPFS2;8`$TFS";>5'9`-P(3!+!L)LTFV`&.4G<`,P3!'"3.4G<`5U)P>``A4G +MTFS2;>5'M`D4Y40@XPOE.F0"8`7E.K0#!,)LTFWE1[0*$^4ZM`$&PFS2;8`( +MY3IP!-)LPFT@:0?E7B#@`K)H(&L'Y5X@X0*R:B!M!^5>(.("LFQU+D`@:02B +M:(`F,&@&Y4:BXH`=Y5X@X`1_`8`"?P#E1E3P_K[P!'X!@`)^`.YO)/^25>(.$$?P&``G\`Y494\/Z^\`1^`8`"?@#N;R3_ +MDG62="!M!*)L@";E1V0*<"(P;`;E1J+C@!?E.K0!!N5&HN.`-.5&(.0#,.4# +MTX`!PX`F,&P&Y4:BXH`=Y5X@X@1_`8`"?P#E1E3P_K[P!'X!@`)^`.YO)/^2 +M<9)PD!``X)`0+/"0$`/@PY0P0!G@9#)@%*)QDG>B<))VY2X3$U0_]2["=])V +M,!<-4R[PY2Y%79`0+_"`!I`0+^4N\.5'9`9P1Y`"*.`P1P/_@`+T_X\_D`(I +MX%3^\.5#Q%0/%&`,)/Y@#"0#5' +M9`M@`P(:.9`"*.`P1P/_@`+T_X\_D`(IX%3]\.4Z%&`@%&`A%&`K)/Q@123Y +M8!(D#G!*Y483$U0_=?`#A.7P@"G2^8`ZY48PX@/3@`'#DOF`+>5&,.(-5#C# +ME#!0!GX`?P&`!'X`?P#N3R3_DOF`#^5&,.(#TX`!PY+Y@`+"^3!'!*\_@`3E +M/_3_D`(H[_`BY4>T"Q"0`BG@5.OPY3]4ZT5%]3\BY)`"*?`P1P2O18`$Y47T +M_Y`"*._P(H]0TEDBCU326"+D]27"K^51%&!*%&!K)`)@`P(;T-)9=54!D`(( +MX%3^\.`@X2.0!#3@M`(CX+0"$G\@$AIED!`$X%3S\'51`0(;T.50 +M8`,"&]!U)0,"&]"0$@#@5`-P$G\@$AIED`((X%3[\'51`@(;T.508`,"&]`" +M&\N0`@C@,.,#`AO'D`0WX&0B8`,"&\>0$@1T"O#E6##C')```N`PX!7DD`4` +M\*-T"/"C=`'P=`/P?P$2`I20$RC@D'`:\)`3*>"0!4^_"`%.4\ +M])`3*F`(X%3R13SP@`3@5/KPD`0!X$00\'6,@.!4_?"0$@3@1`3PY5@PX`:0 +M`0W@]2_E,-.4`4`7(`(4(`,1,$\.D`$-X%3[\)`!#.!4_?!U)0%U50+D]5&` +M">50<`5U)0/U4>4E8!7"`>3U4<)9K26O0!(4EM`,"T@/2KR+"KS`!#N3U +M4<)9P@%]`J]`$ASEY5(48$@48"4D`F`#`ASBY3#3E`%`$9`!#.!$`O"CX$0$ +M\'\*$@*4=5("=54#Y5@PX`:0`0WE+_"0$@3@5/OP?R`2&FIU4@%U50,"'.+E +M5&`#`ASBD`0!X$0.\.!4[_#D]8SE6%088!Z0X"#A\Y`0'."0<"CPD!`=X)!P*?"0$![@ +MD'`J\,(%TJ\B(@`````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` @@ -196,7 +196,7 @@ M``````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 07:01:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56028787 for ; Wed, 11 Feb 2015 07:01:24 +0000 (UTC) Received: from mail-yh0-f41.google.com (mail-yh0-f41.google.com [209.85.213.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19911CC for ; Wed, 11 Feb 2015 07:01:23 +0000 (UTC) Received: by mail-yh0-f41.google.com with SMTP id 29so636718yhl.0 for ; Tue, 10 Feb 2015 23:01:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ofmANMu2bYiHvpfvcT2C9oF7Yji8vwW5f+rupiwHfV8=; b=dhL+qU3qkxGEmy8Y5vd7z4c2/utuE2F9c5vIwjUnzczo0Zhto38QFzZLkzd3vIpLRk ok/LWw+UxIV8As4PLxaYeNMHCJ2VIq0trjH78TzuLj6V0wlrJrrgvHAzUxzlRMfCGX9v 28g5QlhYaqTUmmAH75ClIR/h3KMmVXkp+obrvrB9tJ3I2fMol11F0vJw1MFdvzU+sIvY kAVgM8yWwpyfY2syf6ILeT/Au20nkWGthXeSyy1ytIJmx7qLRu9hBEqN1f9nGloXGwPi 8CBvDYxUwB4mgBqyRJ1u8fpQrktlXfbahxxm7LJlAcgWOKpzIcGxgxTRYSCvn8YnnsDk x/2Q== X-Gm-Message-State: ALoCoQkiKrq2FKKN1JT4muWYFLJ4jJVh5fSNoIagFUGar00+gy9y+2ftvfdvdkAOPwuxg/kkeaO6 MIME-Version: 1.0 X-Received: by 10.170.191.211 with SMTP id i202mr836247yke.32.1423638077436; Tue, 10 Feb 2015 23:01:17 -0800 (PST) Received: by 10.170.56.134 with HTTP; Tue, 10 Feb 2015 23:01:17 -0800 (PST) In-Reply-To: <201502110058.t1B0wGYZ032751@svn.freebsd.org> References: <201502110058.t1B0wGYZ032751@svn.freebsd.org> Date: Wed, 11 Feb 2015 08:01:17 +0100 Message-ID: Subject: Re: svn commit: r278545 - head/sys/kern From: Oliver Pinter To: Rui Paulo 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.18-1 Precedence: list List-Id: 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, 11 Feb 2015 07:01:24 -0000 On Wed, Feb 11, 2015 at 1:58 AM, Rui Paulo wrote: > Author: rpaulo > Date: Wed Feb 11 00:58:15 2015 > New Revision: 278545 > URL: https://svnweb.freebsd.org/changeset/base/278545 > > Log: > Restore the data array in coredump(), but use a different style to > calculate the length. > > Requested by: kib > > Modified: > head/sys/kern/kern_sig.c > > Modified: head/sys/kern/kern_sig.c > ============================================================================== > --- head/sys/kern/kern_sig.c Tue Feb 10 23:48:06 2015 (r278544) > +++ head/sys/kern/kern_sig.c Wed Feb 11 00:58:15 2015 (r278545) > @@ -3261,9 +3261,11 @@ coredump(struct thread *td) > void *rl_cookie; > off_t limit; > int compress; > - char data[MAXPATHLEN * 2 + 16]; /* space for devctl notification */ > + char *data = NULL; > char *fullpath, *freepath = NULL; > size_t len; > + static const char comm_name[] = "comm="; > + static const char core_name[] = "core="; > > #ifdef COMPRESS_USER_CORES > compress = compress_user_cores; > @@ -3357,25 +3359,31 @@ close: > */ > if (coredump_devctl == 0) > goto out; > + len = MAXPATHLEN * 2 + sizeof(comm_name) - 1 + > + sizeof(' ') + sizeof(core_name) - 1; > + data = malloc(len, M_TEMP, M_WAITOK); > + if (data == NULL) > + goto out; This check is pointless, as you can see in man 9 malloc: M_WAITOK Indicates that it is OK to wait for resources. If the request cannot be immediately fulfilled, the current process is put to sleep to wait for resources to be released by other processes. The malloc(), realloc(), and reallocf() functions cannot return NULL if M_WAITOK is specified. > if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) > goto out; > if (!coredump_sanitise_path(fullpath)) > goto out; > - snprintf(data, sizeof(data), "comm=%s ", fullpath); > + snprintf(data, len, "%s%s ", comm_name, fullpath); > free(freepath, M_TEMP); > freepath = NULL; > if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) > goto out; > if (!coredump_sanitise_path(fullpath)) > goto out; > - strlcat(data, "core=", sizeof(data)); > - len = strlcat(data, fullpath, sizeof(data)); > + strlcat(data, core_name, len); > + strlcat(data, fullpath, len); > devctl_notify("kernel", "signal", "coredump", data); > out: > #ifdef AUDIT > audit_proc_coredump(td, name, error); > #endif > free(freepath, M_TEMP); > + free(data, M_TEMP); > free(name, M_TEMP); > return (error); > } > _______________________________________________ > 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" From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 07:44:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F48124F; Wed, 11 Feb 2015 07:44: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B10F75A; Wed, 11 Feb 2015 07:44:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1B7irrq025906; Wed, 11 Feb 2015 07:44:53 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1B7irov025905; Wed, 11 Feb 2015 07:44:53 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502110744.t1B7irov025905@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Wed, 11 Feb 2015 07:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278560 - head/contrib/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 07:44:54 -0000 Author: jmg Date: Wed Feb 11 07:44:53 2015 New Revision: 278560 URL: https://svnweb.freebsd.org/changeset/base/278560 Log: add an assert in case the sizeof int ever becomes bigger.. Then we will have issues, at least we'll know where one of them are.. Submitted by: Erich Dollansky Modified: head/contrib/top/utils.c Modified: head/contrib/top/utils.c ============================================================================== --- head/contrib/top/utils.c Wed Feb 11 07:38:07 2015 (r278559) +++ head/contrib/top/utils.c Wed Feb 11 07:44:53 2015 (r278560) @@ -58,6 +58,7 @@ char *str; * ever convert will be 2^32-1, which is 10 * digits. */ +_Static_assert(sizeof(int) <= 4, "buffer too small for this sized int"); char *itoa(val) From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 07:49:01 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF1FE4A0; Wed, 11 Feb 2015 07:49: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB107781; Wed, 11 Feb 2015 07:49:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1B7n1T0026631; Wed, 11 Feb 2015 07:49:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1B7n1DV026630; Wed, 11 Feb 2015 07:49:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502110749.t1B7n1DV026630@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 11 Feb 2015 07:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278561 - 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.18-1 Precedence: list List-Id: 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, 11 Feb 2015 07:49:02 -0000 Author: ngie Date: Wed Feb 11 07:49:00 2015 New Revision: 278561 URL: https://svnweb.freebsd.org/changeset/base/278561 Log: Document caveat with specifying WITHOUT_VI at build/install time when building older releases of FreeBSD Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Feb 11 07:44:53 2015 (r278560) +++ head/UPDATING Wed Feb 11 07:49:00 2015 (r278561) @@ -292,6 +292,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 The lindev device has been removed since /dev/full has been made a standard device. __FreeBSD_version has been bumped. +20140424: + The knob WITHOUT_VI was added to the base system, which controls + building ex(1), vi(1), etc. Older releases of FreeBSD required ex(1) + in order to reorder files share/termcap and didn't build ex(1) as a + build tool, so building/installing with WITH_VI is highly advised for + build hosts for older releases. + + This issue has been fixed in stable/9 and stable/10 in r277022 and + r276991, respectively. + 20140418: The YES_HESIOD knob has been removed. It has been obsolete for a decade. Please move to using WITH_HESIOD instead or your builds From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 08:26:37 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAD6F144; Wed, 11 Feb 2015 08:26: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D64DFBA7; Wed, 11 Feb 2015 08:26:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1B8QbPZ045475; Wed, 11 Feb 2015 08:26:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1B8Qbka045474; Wed, 11 Feb 2015 08:26:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201502110826.t1B8Qbka045474@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 11 Feb 2015 08:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278565 - in head: . share/info X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 08:26:38 -0000 Author: bapt Date: Wed Feb 11 08:26:36 2015 New Revision: 278565 URL: https://svnweb.freebsd.org/changeset/base/278565 Log: Remove remnant from texinfo Deleted: head/share/info/ Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Feb 11 08:20:07 2015 (r278564) +++ head/Makefile.inc1 Wed Feb 11 08:26:36 2015 (r278565) @@ -50,10 +50,6 @@ .include .include -# We must do share/info early so that installation of info `dir' -# entries works correctly. Do it first since it is less likely to -# grow dependencies on include and lib than vice versa. -# # We must do lib/ and libexec/ before bin/, because if installworld # installs a new /bin/sh, the 'make' command will *immediately* # use that new version. And the new (dynamically-linked) /bin/sh @@ -63,7 +59,7 @@ SRCDIR?= ${.CURDIR} .if defined(SUBDIR_OVERRIDE) SUBDIR= ${SUBDIR_OVERRIDE} .else -SUBDIR= share/info lib libexec +SUBDIR= lib libexec SUBDIR+=bin .if ${MK_GAMES} != "no" SUBDIR+=games From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 08:32:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5D754A5; Wed, 11 Feb 2015 08:32:07 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2495BC6E; Wed, 11 Feb 2015 08:32:06 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t1B8W0RH073482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Feb 2015 10:32:00 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t1B8W0RH073482 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t1B8W0VK073481; Wed, 11 Feb 2015 10:32:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 11 Feb 2015 10:32:00 +0200 From: Konstantin Belousov To: Rui Paulo Subject: Re: svn commit: r278473 - in head/sys: amd64/amd64 amd64/include amd64/vmm contrib/dev/acpica/include i386/i386 i386/include x86/acpica x86/include x86/x86 x86/xen Message-ID: <20150211083200.GO42409@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, trasz@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 08:32:07 -0000 On Wed, Feb 11, 2015 at 12:43:39AM +0000, Rui Paulo wrote: > On Feb 09, 2015, at 01:01 PM, Konstantin Belousov wrote: > > Author: kib > Date: Mon Feb 9 21:00:56 2015 > New Revision: 278473 > URL: https://svnweb.freebsd.org/changeset/base/278473 > > Log: > Add x2APIC support. Enable it by default if CPU is capable. The > hw.x2apic_enable tunable allows disabling it from the loader prompt. > š > This breaks VMware Fusion when the host CPU has x2APIC support. šIn > my case, mpt(4) was unable to receive interrupts and USB was similarly > broken. šIt's possible that this is a VMware bug, but you might want to > avoid turning this on when running under the VMware hypervisor. Neel pointed this out to me when the patch was reviewed. He told me that x2APIC does not work in Fusion 5.x, while it seems to be fixed in 7.x. https://communities.vmware.com/message/2173695?tstart=0 Upon further discussion with Neel and Peter, it was suggested that we enable enable x2APIC unconditionally, which seems what is done for Linux benchmarks. Is vmware 5.x is used while there is already at least version 7.x ? I have no idea about vmware product nomenclature and lifecycle. From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 10:37:56 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5C9410C; Wed, 11 Feb 2015 10:37: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0ADCB59; Wed, 11 Feb 2015 10:37:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BAbuFF008696; Wed, 11 Feb 2015 10:37:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BAbuCk008694; Wed, 11 Feb 2015 10:37:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201502111037.t1BAbuCk008694@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 11 Feb 2015 10:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278577 - in head/sys: arm/xscale/ixp425 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.18-1 Precedence: list List-Id: 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, 11 Feb 2015 10:37:57 -0000 Author: andrew Date: Wed Feb 11 10:37:55 2015 New Revision: 278577 URL: https://svnweb.freebsd.org/changeset/base/278577 Log: The cpu_id macro was renamed in r278529, catch up with this new name. Modified: head/sys/arm/xscale/ixp425/if_npe.c head/sys/dev/hwpmc/hwpmc_armv7.c Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Wed Feb 11 09:21:36 2015 (r278576) +++ head/sys/arm/xscale/ixp425/if_npe.c Wed Feb 11 10:37:55 2015 (r278577) @@ -285,7 +285,7 @@ unit2npeid(int unit) }; /* XXX check feature register instead */ return (unit < 3 ? npeidmap[ - (cpu_id() & CPU_ID_CPU_MASK) == CPU_ID_IXP435][unit] : -1); + (cpu_ident() & CPU_ID_CPU_MASK) == CPU_ID_IXP435][unit] : -1); } static int Modified: head/sys/dev/hwpmc/hwpmc_armv7.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_armv7.c Wed Feb 11 09:21:36 2015 (r278576) +++ head/sys/dev/hwpmc/hwpmc_armv7.c Wed Feb 11 10:37:55 2015 (r278577) @@ -555,7 +555,7 @@ armv7_pcpu_init(struct pmc_mdep *md, int armv7_pcpu[cpu] = pac = malloc(sizeof(struct armv7_cpu), M_PMC, M_WAITOK|M_ZERO); - cpuid = cpu_id(); + cpuid = cpu_ident(); pac->cortex_ver = (cpuid >> CPU_ID_CORTEX_VER_SHIFT) & \ CPU_ID_CORTEX_VER_MASK; From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 10:40:51 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34C072E6; Wed, 11 Feb 2015 10:40: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AE43BC5; Wed, 11 Feb 2015 10:40:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BAeo2f011470; Wed, 11 Feb 2015 10:40:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BAeobY011469; Wed, 11 Feb 2015 10:40:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201502111040.t1BAeobY011469@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 11 Feb 2015 10:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278578 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 10:40:51 -0000 Author: andrew Date: Wed Feb 11 10:40:49 2015 New Revision: 278578 URL: https://svnweb.freebsd.org/changeset/base/278578 Log: Remove the non-EABI code from the DDB stack unwinder, we only support the ARM EABI now. Modified: head/sys/arm/arm/db_trace.c Modified: head/sys/arm/arm/db_trace.c ============================================================================== --- head/sys/arm/arm/db_trace.c Wed Feb 11 10:37:55 2015 (r278577) +++ head/sys/arm/arm/db_trace.c Wed Feb 11 10:40:49 2015 (r278578) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef __ARM_EABI__ /* * Definitions for the instruction interpreter. * @@ -453,131 +452,6 @@ db_stack_trace_cmd(struct unwind_state * } } } -#endif - -/* - * APCS stack frames are awkward beasts, so I don't think even trying to use - * a structure to represent them is a good idea. - * - * Here's the diagram from the APCS. Increasing address is _up_ the page. - * - * save code pointer [fp] <- fp points to here - * return link value [fp, #-4] - * return sp value [fp, #-8] - * return fp value [fp, #-12] - * [saved v7 value] - * [saved v6 value] - * [saved v5 value] - * [saved v4 value] - * [saved v3 value] - * [saved v2 value] - * [saved v1 value] - * [saved a4 value] - * [saved a3 value] - * [saved a2 value] - * [saved a1 value] - * - * The save code pointer points twelve bytes beyond the start of the - * code sequence (usually a single STM) that created the stack frame. - * We have to disassemble it if we want to know which of the optional - * fields are actually present. - */ - -#ifndef __ARM_EABI__ /* The frame format is differend in AAPCS */ -static void -db_stack_trace_cmd(db_expr_t addr, db_expr_t count, boolean_t kernel_only) -{ - u_int32_t *frame, *lastframe; - c_db_sym_t sym; - const char *name; - db_expr_t value; - db_expr_t offset; - int scp_offset; - - frame = (u_int32_t *)addr; - lastframe = NULL; - scp_offset = -(get_pc_str_offset() >> 2); - - while (count-- && frame != NULL && !db_pager_quit) { - db_addr_t scp; - u_int32_t savecode; - int r; - u_int32_t *rp; - const char *sep; - - /* - * In theory, the SCP isn't guaranteed to be in the function - * that generated the stack frame. We hope for the best. - */ - scp = frame[FR_SCP]; - - sym = db_search_symbol(scp, DB_STGY_ANY, &offset); - if (sym == C_DB_SYM_NULL) { - value = 0; - name = "(null)"; - } else - db_symbol_values(sym, &name, &value); - db_printf("%s() at ", name); - db_printsym(scp, DB_STGY_PROC); - db_printf("\n"); -#ifdef __PROG26 - db_printf("\tscp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV] & R15_PC); - db_printsym(frame[FR_RLV] & R15_PC, DB_STGY_PROC); - db_printf(")\n"); -#else - db_printf("\tscp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV]); - db_printsym(frame[FR_RLV], DB_STGY_PROC); - db_printf(")\n"); -#endif - db_printf("\trsp=0x%08x rfp=0x%08x", frame[FR_RSP], frame[FR_RFP]); - - savecode = ((u_int32_t *)scp)[scp_offset]; - if ((savecode & 0x0e100000) == 0x08000000) { - /* Looks like an STM */ - rp = frame - 4; - sep = "\n\t"; - for (r = 10; r >= 0; r--) { - if (savecode & (1 << r)) { - db_printf("%sr%d=0x%08x", - sep, r, *rp--); - sep = (frame - rp) % 4 == 2 ? - "\n\t" : " "; - } - } - } - - db_printf("\n"); - - /* - * Switch to next frame up - */ - if (frame[FR_RFP] == 0) - break; /* Top of stack */ - - lastframe = frame; - frame = (u_int32_t *)(frame[FR_RFP]); - - if (INKERNEL((int)frame)) { - /* staying in kernel */ - if (frame <= lastframe) { - db_printf("Bad frame pointer: %p\n", frame); - break; - } - } else if (INKERNEL((int)lastframe)) { - /* switch from user to kernel */ - if (kernel_only) - break; /* kernel stack only */ - } else { - /* in user */ - if (frame <= lastframe) { - db_printf("Bad user frame pointer: %p\n", - frame); - break; - } - } - } -} -#endif /* XXX stubs */ void @@ -600,24 +474,18 @@ db_md_set_watchpoint(db_expr_t addr, db_ int db_trace_thread(struct thread *thr, int count) { -#ifdef __ARM_EABI__ struct unwind_state state; -#endif struct pcb *ctx; if (thr != curthread) { ctx = kdb_thr_ctx(thr); -#ifdef __ARM_EABI__ state.registers[FP] = ctx->pcb_regs.sf_r11; state.registers[SP] = ctx->pcb_regs.sf_sp; state.registers[LR] = ctx->pcb_regs.sf_lr; state.registers[PC] = ctx->pcb_regs.sf_pc; db_stack_trace_cmd(&state); -#else - db_stack_trace_cmd(ctx->pcb_regs.sf_r11, -1, TRUE); -#endif } else db_trace_self(); return (0); @@ -626,7 +494,6 @@ db_trace_thread(struct thread *thr, int void db_trace_self(void) { -#ifdef __ARM_EABI__ struct unwind_state state; uint32_t sp; @@ -639,10 +506,4 @@ db_trace_self(void) state.registers[PC] = (uint32_t)db_trace_self; db_stack_trace_cmd(&state); -#else - db_addr_t addr; - - addr = (db_addr_t)__builtin_frame_address(0); - db_stack_trace_cmd(addr, -1, FALSE); -#endif } From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 12:08:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D3E1586; Wed, 11 Feb 2015 12:08: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 382896C8; Wed, 11 Feb 2015 12:08:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BC8fKS052056; Wed, 11 Feb 2015 12:08:41 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BC8fIm052055; Wed, 11 Feb 2015 12:08:41 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201502111208.t1BC8fIm052055@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 11 Feb 2015 12:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278579 - head/sys/boot/arm/ixp425/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 12:08:41 -0000 Author: gnn Date: Wed Feb 11 12:08:40 2015 New Revision: 278579 URL: https://svnweb.freebsd.org/changeset/base/278579 Log: Summary: Update CPU identification call to recent version. Modified: head/sys/boot/arm/ixp425/boot2/ixp425_board.c Modified: head/sys/boot/arm/ixp425/boot2/ixp425_board.c ============================================================================== --- head/sys/boot/arm/ixp425/boot2/ixp425_board.c Wed Feb 11 10:40:49 2015 (r278578) +++ head/sys/boot/arm/ixp425/boot2/ixp425_board.c Wed Feb 11 12:08:40 2015 (r278579) @@ -74,7 +74,7 @@ board_init(void) { struct board_config **pbp; - cputype = cpu_id() & CPU_ID_CPU_MASK; + cputype = cpu_ident() & CPU_ID_CPU_MASK; SET_FOREACH(pbp, boards) /* XXX pass down redboot board type */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 14:59:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E1E74A9; Wed, 11 Feb 2015 14:59: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5925CBB7; Wed, 11 Feb 2015 14:59:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BExaKG042542; Wed, 11 Feb 2015 14:59:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BExZHk042540; Wed, 11 Feb 2015 14:59:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201502111459.t1BExZHk042540@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Feb 2015 14:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278580 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 14:59:36 -0000 Author: emaste Date: Wed Feb 11 14:59:35 2015 New Revision: 278580 URL: https://svnweb.freebsd.org/changeset/base/278580 Log: libdwarf: Add aarch64 relocation support Reviewed by: andrew, rpaulo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1817 Modified: head/contrib/elftoolchain/libdwarf/libdwarf.h head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf.h ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf.h Wed Feb 11 12:08:40 2015 (r278579) +++ head/contrib/elftoolchain/libdwarf/libdwarf.h Wed Feb 11 14:59:35 2015 (r278580) @@ -439,6 +439,7 @@ enum Dwarf_ISA { DW_ISA_SPARC, DW_ISA_X86, DW_ISA_X86_64, + DW_ISA_AARCH64, DW_ISA_MAX }; Modified: head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Wed Feb 11 12:08:40 2015 (r278579) +++ head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Wed Feb 11 14:59:35 2015 (r278580) @@ -35,6 +35,8 @@ _dwarf_get_reloc_type(Dwarf_P_Debug dbg, assert(dbg != NULL); switch (dbg->dbgp_isa) { + case DW_ISA_AARCH64: + return (is64 ? R_AARCH64_ABS64 : R_AARCH64_ABS32); case DW_ISA_X86: return (R_386_32); case DW_ISA_X86_64: @@ -62,6 +64,12 @@ _dwarf_get_reloc_size(Dwarf_Debug dbg, D switch (dbg->dbg_machine) { case EM_NONE: break; + case EM_AARCH64: + if (rel_type == R_AARCH64_ABS32) + return (4); + else if (rel_type == R_AARCH64_ABS64) + return (8); + break; case EM_ARM: if (rel_type == R_ARM_ABS32) return (4); From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 15:49:15 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F883FC9; Wed, 11 Feb 2015 15:49: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B32D13A; Wed, 11 Feb 2015 15:49:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BFnE4Z066518; Wed, 11 Feb 2015 15:49:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BFnEiC066517; Wed, 11 Feb 2015 15:49:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201502111549.t1BFnEiC066517@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Feb 2015 15:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278582 - head/sys/boot/pc98/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 15:49:15 -0000 Author: jhb Date: Wed Feb 11 15:49:14 2015 New Revision: 278582 URL: https://svnweb.freebsd.org/changeset/base/278582 Log: MFi386: When building some of the boot loaders with clang, and DEBUG_FLAGS or CFLAGS having '-g' in it, clang outputs several assembly directives that are too new for our version of binutils. Therefore, assemble the resulting .s files with clang instead. A more general solution can be implemented when a GNU as-compatible driver for clang's integrated assembler appears. Tested by: gjb Modified: head/sys/boot/pc98/boot2/Makefile Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Wed Feb 11 15:21:25 2015 (r278581) +++ head/sys/boot/pc98/boot2/Makefile Wed Feb 11 15:49:14 2015 (r278582) @@ -92,6 +92,7 @@ boot2.out: ${BTXCRT} boot2.o sio.o ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} boot2.o: boot2.s + ${CC} ${ACFLAGS} -c boot2.s SRCS= boot2.c boot2.h From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 16:04:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF13D557; Wed, 11 Feb 2015 16:04:21 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B44DA374; Wed, 11 Feb 2015 16:04:21 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B9F3FB95B; Wed, 11 Feb 2015 11:04:20 -0500 (EST) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r278473 - in head/sys: amd64/amd64 amd64/include amd64/vmm contrib/dev/acpica/include i386/i386 i386/include x86/acpica x86/include x86/x86 x86/xen Date: Wed, 11 Feb 2015 10:20:03 -0500 Message-ID: <6564436.fIAEJlraDt@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150211083200.GO42409@kib.kiev.ua> References: <20150211083200.GO42409@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 11 Feb 2015 11:04:20 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, trasz@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 16:04:22 -0000 On Wednesday, February 11, 2015 10:32:00 AM Konstantin Belousov wrote: > On Wed, Feb 11, 2015 at 12:43:39AM +0000, Rui Paulo wrote: > > On Feb 09, 2015, at 01:01 PM, Konstantin Belousov wrote: > > > > Author: kib > > Date: Mon Feb 9 21:00:56 2015 > > New Revision: 278473 > > URL: https://svnweb.freebsd.org/changeset/base/278473 > > > > Log: > > Add x2APIC support. Enable it by default if CPU is capable. The > > hw.x2apic_enable tunable allows disabling it from the loader prompt. > > > > This breaks VMware Fusion when the host CPU has x2APIC support. In > > my case, mpt(4) was unable to receive interrupts and USB was similarly > > broken. It's possible that this is a VMware bug, but you might want to > > avoid turning this on when running under the VMware hypervisor. > > Neel pointed this out to me when the patch was reviewed. > He told me that x2APIC does not work in Fusion 5.x, while it seems > to be fixed in 7.x. > https://communities.vmware.com/message/2173695?tstart=0 > > Upon further discussion with Neel and Peter, it was suggested that we > enable enable x2APIC unconditionally, which seems what is done for > Linux benchmarks. > > Is vmware 5.x is used while there is already at least version 7.x ? > I have no idea about vmware product nomenclature and lifecycle. I believe we can ask vmware what version it is when we notice we are running under it (which we already detect for TSC purposes). We could quirk for that case, or even just disable for VM_GUEST_VMWARE for now. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 16:10:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47D5DAEF; Wed, 11 Feb 2015 16:10: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A92E62B; Wed, 11 Feb 2015 16:10:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BGAX4C076189; Wed, 11 Feb 2015 16:10:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BGAW47076185; Wed, 11 Feb 2015 16:10:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201502111610.t1BGAW47076185@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Feb 2015 16:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278584 - in head/sys/cam: ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 16:10:33 -0000 Author: mav Date: Wed Feb 11 16:10:31 2015 New Revision: 278584 URL: https://svnweb.freebsd.org/changeset/base/278584 Log: Add support for General Statistics and Performance log page. CTL already collects most of statistics reported there, so why not. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_private.h head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Feb 11 16:07:28 2015 (r278583) +++ head/sys/cam/ctl/ctl.c Wed Feb 11 16:10:31 2015 (r278584) @@ -4483,6 +4483,8 @@ ctl_init_log_page_index(struct ctl_lun * lun->log_pages.index[1].page_len = k * 2; lun->log_pages.index[2].page_data = &lun->log_pages.lbp_page[0]; lun->log_pages.index[2].page_len = 12*CTL_NUM_LBP_PARAMS; + lun->log_pages.index[3].page_data = (uint8_t *)&lun->log_pages.stat_page; + lun->log_pages.index[3].page_len = sizeof(lun->log_pages.stat_page); return (CTL_RETVAL_COMPLETE); } @@ -4720,6 +4722,9 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft lun->serseq = CTL_LUN_SERSEQ_OFF; lun->ctl_softc = ctl_softc; +#ifdef CTL_TIME_IO + lun->last_busy = getsbinuptime(); +#endif TAILQ_INIT(&lun->ooa_queue); TAILQ_INIT(&lun->blocked_queue); STAILQ_INIT(&lun->error_list); @@ -7085,6 +7090,67 @@ ctl_lbp_log_sense_handler(struct ctl_scs } int +ctl_sap_log_sense_handler(struct ctl_scsiio *ctsio, + struct ctl_page_index *page_index, + int pc) +{ + struct ctl_lun *lun; + struct stat_page *data; + uint64_t rn, wn, rb, wb; + struct bintime rt, wt; + int i; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + data = (struct stat_page *)page_index->page_data; + + scsi_ulto2b(SLP_SAP, data->sap.hdr.param_code); + data->sap.hdr.param_control = SLP_LBIN; + data->sap.hdr.param_len = sizeof(struct scsi_log_stat_and_perf) - + sizeof(struct scsi_log_param_header); + rn = wn = rb = wb = 0; + bintime_clear(&rt); + bintime_clear(&wt); + for (i = 0; i < CTL_MAX_PORTS; i++) { + rn += lun->stats.ports[i].operations[CTL_STATS_READ]; + wn += lun->stats.ports[i].operations[CTL_STATS_WRITE]; + rb += lun->stats.ports[i].bytes[CTL_STATS_READ]; + wb += lun->stats.ports[i].bytes[CTL_STATS_WRITE]; + bintime_add(&rt, &lun->stats.ports[i].time[CTL_STATS_READ]); + bintime_add(&wt, &lun->stats.ports[i].time[CTL_STATS_WRITE]); + } + scsi_u64to8b(rn, data->sap.read_num); + scsi_u64to8b(wn, data->sap.write_num); + if (lun->stats.blocksize > 0) { + scsi_u64to8b(wb / lun->stats.blocksize, + data->sap.recvieved_lba); + scsi_u64to8b(rb / lun->stats.blocksize, + data->sap.transmitted_lba); + } + scsi_u64to8b((uint64_t)rt.sec * 1000 + rt.frac / (UINT64_MAX / 1000), + data->sap.read_int); + scsi_u64to8b((uint64_t)wt.sec * 1000 + wt.frac / (UINT64_MAX / 1000), + data->sap.write_int); + scsi_u64to8b(0, data->sap.weighted_num); + scsi_u64to8b(0, data->sap.weighted_int); + scsi_ulto2b(SLP_IT, data->it.hdr.param_code); + data->it.hdr.param_control = SLP_LBIN; + data->it.hdr.param_len = sizeof(struct scsi_log_idle_time) - + sizeof(struct scsi_log_param_header); +#ifdef CTL_TIME_IO + scsi_u64to8b(lun->idle_time / SBT_1MS, data->it.idle_int); +#endif + scsi_ulto2b(SLP_TI, data->ti.hdr.param_code); + data->it.hdr.param_control = SLP_LBIN; + data->ti.hdr.param_len = sizeof(struct scsi_log_time_interval) - + sizeof(struct scsi_log_param_header); + scsi_ulto4b(3, data->ti.exponent); + scsi_ulto4b(1, data->ti.integer); + + page_index->page_len = sizeof(*data); + return (0); +} + +int ctl_log_sense(struct ctl_scsiio *ctsio) { struct ctl_lun *lun; @@ -11689,6 +11755,12 @@ ctl_scsiio_precheck(struct ctl_softc *so * Every I/O goes into the OOA queue for a * particular LUN, and stays there until completion. */ +#ifdef CTL_TIME_IO + if (TAILQ_EMPTY(&lun->ooa_queue)) { + lun->idle_time += getsbinuptime() - + lun->last_busy; + } +#endif TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links); } @@ -13735,6 +13807,10 @@ ctl_process_done(union ctl_io *io) * Remove this from the OOA queue. */ TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links); +#ifdef CTL_TIME_IO + if (TAILQ_EMPTY(&lun->ooa_queue)) + lun->last_busy = getsbinuptime(); +#endif /* * Run through the blocked queue on this LUN and see if anything Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Wed Feb 11 16:07:28 2015 (r278583) +++ head/sys/cam/ctl/ctl.h Wed Feb 11 16:10:31 2015 (r278584) @@ -181,6 +181,9 @@ int ctl_debugconf_sp_select_handler(stru int ctl_lbp_log_sense_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, int pc); +int ctl_sap_log_sense_handler(struct ctl_scsiio *ctsio, + struct ctl_page_index *page_index, + int pc); int ctl_config_move_done(union ctl_io *io); void ctl_datamove(union ctl_io *io); void ctl_done(union ctl_io *io); Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Wed Feb 11 16:07:28 2015 (r278583) +++ head/sys/cam/ctl/ctl_private.h Wed Feb 11 16:10:31 2015 (r278584) @@ -342,6 +342,8 @@ static const struct ctl_page_index log_p CTL_PAGE_FLAG_NONE, NULL, NULL}, {SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL, CTL_PAGE_FLAG_NONE, ctl_lbp_log_sense_handler, NULL}, + {SLS_STAT_AND_PERF, 0, 0, NULL, + CTL_PAGE_FLAG_NONE, ctl_sap_log_sense_handler, NULL}, }; #define CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/ \ @@ -351,6 +353,11 @@ struct ctl_log_pages { uint8_t pages_page[CTL_NUM_LOG_PAGES]; uint8_t subpages_page[CTL_NUM_LOG_PAGES * 2]; uint8_t lbp_page[12*CTL_NUM_LBP_PARAMS]; + struct stat_page { + struct scsi_log_stat_and_perf sap; + struct scsi_log_idle_time it; + struct scsi_log_time_interval ti; + } stat_page; struct ctl_page_index index[CTL_NUM_LOG_PAGES]; }; @@ -403,6 +410,10 @@ struct ctl_lun { struct ctl_lun_delay_info delay_info; int sync_interval; int sync_count; +#ifdef CTL_TIME_IO + sbintime_t idle_time; + sbintime_t last_busy; +#endif TAILQ_HEAD(ctl_ooaq, ctl_io_hdr) ooa_queue; TAILQ_HEAD(ctl_blockq,ctl_io_hdr) blocked_queue; STAILQ_ENTRY(ctl_lun) links; Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Wed Feb 11 16:07:28 2015 (r278583) +++ head/sys/cam/scsi/scsi_all.h Wed Feb 11 16:10:31 2015 (r278584) @@ -561,6 +561,7 @@ struct scsi_log_sense #define SLS_ERROR_LASTN_PAGE 0x07 #define SLS_LOGICAL_BLOCK_PROVISIONING 0x0c #define SLS_SELF_TEST_PAGE 0x10 +#define SLS_STAT_AND_PERF 0x19 #define SLS_IE_PAGE 0x2f #define SLS_PAGE_CTRL_MASK 0xC0 #define SLS_PAGE_CTRL_THRESHOLD 0x00 @@ -619,6 +620,45 @@ struct scsi_log_param_header { u_int8_t param_len; }; +struct scsi_log_stat_and_perf { + struct scsi_log_param_header hdr; +#define SLP_SAP 0x0001 + uint8_t read_num[8]; + uint8_t write_num[8]; + uint8_t recvieved_lba[8]; + uint8_t transmitted_lba[8]; + uint8_t read_int[8]; + uint8_t write_int[8]; + uint8_t weighted_num[8]; + uint8_t weighted_int[8]; +}; + +struct scsi_log_idle_time { + struct scsi_log_param_header hdr; +#define SLP_IT 0x0002 + uint8_t idle_int[8]; +}; + +struct scsi_log_time_interval { + struct scsi_log_param_header hdr; +#define SLP_TI 0x0003 + uint8_t exponent[4]; + uint8_t integer[4]; +}; + +struct scsi_log_fua_stat_and_perf { + struct scsi_log_param_header hdr; +#define SLP_FUA_SAP 0x0004 + uint8_t fua_read_num[8]; + uint8_t fua_write_num[8]; + uint8_t fuanv_read_num[8]; + uint8_t fuanv_write_num[8]; + uint8_t fua_read_int[8]; + uint8_t fua_write_int[8]; + uint8_t fuanv_read_int[8]; + uint8_t fuanv_write_int[8]; +}; + struct scsi_control_page { u_int8_t page_code; u_int8_t page_length; From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 16:45:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B18B68D; Wed, 11 Feb 2015 16:45:51 +0000 (UTC) Received: from mail-ie0-f181.google.com (mail-ie0-f181.google.com [209.85.223.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6A67A48; Wed, 11 Feb 2015 16:45:50 +0000 (UTC) Received: by ierx19 with SMTP id x19so5342208ier.3; Wed, 11 Feb 2015 08:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=CuvBCI/glPLH9iCpKw+3WZ9EFrlbOluecMZKdVMtxjM=; b=Iv+qJXh5y34Fk0FaR+xp6O7Kde//3neDX1gUfY7Kp40qfEPzj+ouTgKvDhjnUq0zpw luYY7rRW2VQ/BFq577jERD/s4yjbzwC4hdDt2IzCSI+CpKDfxgIwUgKsg8UpgeZCBT+C orS6l1Fb6MTZiE7AnK2KR5k1sS0K0iDWyDhK6eCEo2N1CQiZ1HBBSe11OfgVkU/r9IAj KAconJz/kva1XkQJrt0or8Pb1CO6cHzyWSZ0iCxSHG4VmwXSUyl+Z9YdmuV8IkVgzVRA dlRlHQUOjwa9N2m6aWR8esHRqVcwatSGv5lVOkcsIt1ZdW0fuASlwXZx1VC4gmVehwz5 HLlA== X-Received: by 10.43.92.9 with SMTP id bo9mr4076078icc.54.1423673144112; Wed, 11 Feb 2015 08:45:44 -0800 (PST) MIME-Version: 1.0 Sender: mr.kodiak@gmail.com Received: by 10.64.98.228 with HTTP; Wed, 11 Feb 2015 08:45:13 -0800 (PST) In-Reply-To: <6564436.fIAEJlraDt@ralph.baldwin.cx> References: <20150211083200.GO42409@kib.kiev.ua> <6564436.fIAEJlraDt@ralph.baldwin.cx> From: Bryan Venteicher Date: Wed, 11 Feb 2015 10:45:13 -0600 X-Google-Sender-Auth: N0XN6cR8p9rErrOlUw67bChIQUA Message-ID: Subject: Re: svn commit: r278473 - in head/sys: amd64/amd64 amd64/include amd64/vmm contrib/dev/acpica/include i386/i386 i386/include x86/acpica x86/include x86/x86 x86/xen To: John Baldwin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "src-committers@freebsd.org" , Rui Paulo , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Konstantin Belousov , =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 16:45:51 -0000 On Wed, Feb 11, 2015 at 9:20 AM, John Baldwin wrote: > On Wednesday, February 11, 2015 10:32:00 AM Konstantin Belousov wrote: > > On Wed, Feb 11, 2015 at 12:43:39AM +0000, Rui Paulo wrote: > > > On Feb 09, 2015, at 01:01 PM, Konstantin Belousov > wrote: > > > > > > Author: kib > > > Date: Mon Feb 9 21:00:56 2015 > > > New Revision: 278473 > > > URL: https://svnweb.freebsd.org/changeset/base/278473 > > > > > > Log: > > > Add x2APIC support. Enable it by default if CPU is capable. The > > > hw.x2apic_enable tunable allows disabling it from the loader prompt. > > > > > > This breaks VMware Fusion when the host CPU has x2APIC support. In > > > my case, mpt(4) was unable to receive interrupts and USB was similarly > > > broken. It's possible that this is a VMware bug, but you might want to > > > avoid turning this on when running under the VMware hypervisor. > > > > Neel pointed this out to me when the patch was reviewed. > > He told me that x2APIC does not work in Fusion 5.x, while it seems > > to be fixed in 7.x. > > https://communities.vmware.com/message/2173695?tstart=0 > > > > Upon further discussion with Neel and Peter, it was suggested that we > > enable enable x2APIC unconditionally, which seems what is done for > > Linux benchmarks. > > > > Is vmware 5.x is used while there is already at least version 7.x ? > > I have no idea about vmware product nomenclature and lifecycle. > > I believe we can ask vmware what version it is when we notice we are > running > under it (which we already detect for TSC purposes). We could quirk for > that > case, or even just disable for VM_GUEST_VMWARE for now. > > I'm not too familiar with this stuff, but is this Linux commit [1] relevant? If so, it might be something nice to wrap into my projects/paravirt branch (I've been extremely busy recently, but I hope to get the review comments addressed and merge it into HEAD soon). [1] - https://lkml.org/lkml/2013/1/17/552 -- > John Baldwin > > From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 16:54:49 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EC23BC8; Wed, 11 Feb 2015 16:54:49 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC796B50; Wed, 11 Feb 2015 16:54:48 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t1BGsg0u020673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Feb 2015 18:54:42 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t1BGsg0u020673 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t1BGsgWU020672; Wed, 11 Feb 2015 18:54:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 11 Feb 2015 18:54:42 +0200 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r278473 - in head/sys: amd64/amd64 amd64/include amd64/vmm contrib/dev/acpica/include i386/i386 i386/include x86/acpica x86/include x86/x86 x86/xen Message-ID: <20150211165442.GT42409@kib.kiev.ua> References: <20150211083200.GO42409@kib.kiev.ua> <6564436.fIAEJlraDt@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6564436.fIAEJlraDt@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, trasz@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 16:54:49 -0000 On Wed, Feb 11, 2015 at 10:20:03AM -0500, John Baldwin wrote: > On Wednesday, February 11, 2015 10:32:00 AM Konstantin Belousov wrote: > > On Wed, Feb 11, 2015 at 12:43:39AM +0000, Rui Paulo wrote: > > > On Feb 09, 2015, at 01:01 PM, Konstantin Belousov wrote: > > > > > > Author: kib > > > Date: Mon Feb 9 21:00:56 2015 > > > New Revision: 278473 > > > URL: https://svnweb.freebsd.org/changeset/base/278473 > > > > > > Log: > > > Add x2APIC support. Enable it by default if CPU is capable. The > > > hw.x2apic_enable tunable allows disabling it from the loader prompt. > > > > > > This breaks VMware Fusion when the host CPU has x2APIC support. In > > > my case, mpt(4) was unable to receive interrupts and USB was similarly > > > broken. It's possible that this is a VMware bug, but you might want to > > > avoid turning this on when running under the VMware hypervisor. > > > > Neel pointed this out to me when the patch was reviewed. > > He told me that x2APIC does not work in Fusion 5.x, while it seems > > to be fixed in 7.x. > > https://communities.vmware.com/message/2173695?tstart=0 > > > > Upon further discussion with Neel and Peter, it was suggested that we > > enable enable x2APIC unconditionally, which seems what is done for > > Linux benchmarks. > > > > Is vmware 5.x is used while there is already at least version 7.x ? > > I have no idea about vmware product nomenclature and lifecycle. > > I believe we can ask vmware what version it is when we notice we are running > under it (which we already detect for TSC purposes). We could quirk for that > case, or even just disable for VM_GUEST_VMWARE for now. > Ok, https://lkml.org/lkml/2013/1/17/552 Patch is below. Please, users of VMWare, test it. diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c index f20b735..c3df686 100644 --- a/sys/x86/acpica/madt.c +++ b/sys/x86/acpica/madt.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -40,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -130,6 +132,7 @@ madt_setup_local(void) { ACPI_TABLE_DMAR *dmartbl; vm_paddr_t dmartbl_physaddr; + u_int p[4]; madt = pmap_mapbios(madt_physaddr, madt_length); if ((cpu_feature2 & CPUID2_X2APIC) != 0) { @@ -146,6 +149,16 @@ madt_setup_local(void) } acpi_unmap_table(dmartbl); } + if (vm_guest == VM_GUEST_VMWARE) { + vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p); + if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 || + (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) { + x2apic_mode = 0; + if (bootverbose) + printf( + "x2APIC available but disabled inside VMWare without intr redirection\n"); + } + } TUNABLE_INT_FETCH("hw.x2apic_enable", &x2apic_mode); } diff --git a/sys/x86/include/vmware.h b/sys/x86/include/vmware.h index c72f48d..d3d7e2d 100644 --- a/sys/x86/include/vmware.h +++ b/sys/x86/include/vmware.h @@ -31,8 +31,13 @@ #define VMW_HVMAGIC 0x564d5868 #define VMW_HVPORT 0x5658 + #define VMW_HVCMD_GETVERSION 10 #define VMW_HVCMD_GETHZ 45 +#define VMW_HVCMD_GETVCPU_INFO 68 + +#define VMW_VCPUINFO_LEGACY_X2APIC (1 << 3) +#define VMW_VCPUINFO_VCPU_RESERVED (1 << 31) static __inline void vmware_hvcall(u_int cmd, u_int *p) From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 17:00:33 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E72C5E49; Wed, 11 Feb 2015 17:00: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D278BBD8; Wed, 11 Feb 2015 17:00:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BH0XvA099665; Wed, 11 Feb 2015 17:00:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BH0XPL099664; Wed, 11 Feb 2015 17:00:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201502111700.t1BH0XPL099664@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 11 Feb 2015 17:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278585 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 17:00:34 -0000 Author: trasz Date: Wed Feb 11 17:00:32 2015 New Revision: 278585 URL: https://svnweb.freebsd.org/changeset/base/278585 Log: Fix formatting. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Wed Feb 11 16:10:31 2015 (r278584) +++ head/usr.sbin/ctld/ctl.conf.5 Wed Feb 11 17:00:32 2015 (r278585) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2015 +.Dd February 11, 2015 .Dt CTL.CONF 5 .Os .Sh NAME @@ -228,7 +228,7 @@ An IPv4 or IPv6 address and port to list .\".It Ic listen-iser Ar address .\"An IPv4 or IPv6 address and port to listen on for incoming connections .\"using iSER (iSCSI over RDMA) protocol. -.It Ic redirect Aq Ar address +.It Ic redirect Ar address IPv4 or IPv6 address to redirect initiators to. When configured, all initiators attempting to connect to portal belonging to this @@ -326,7 +326,7 @@ If second argument is not specified, tar Assign specified CTL port (such as "isp0") to the target. On startup ctld configures LUN mapping and enables all assigned ports. Each port can be assigned to only one target. -.It Ic redirect Aq Ar address +.It Ic redirect Ar address IPv4 or IPv6 address to redirect initiators to. When configured, all initiators attempting to connect to this target will get redirected using "Target moved temporarily" login response. From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 17:25:23 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA09658C; Wed, 11 Feb 2015 17:25: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C55E4E8B; Wed, 11 Feb 2015 17:25:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BHPNeT013008; Wed, 11 Feb 2015 17:25:23 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BHPNm1013007; Wed, 11 Feb 2015 17:25:23 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201502111725.t1BHPNm1013007@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Wed, 11 Feb 2015 17:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278586 - head/contrib/binutils/ld/scripttempl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 17:25:24 -0000 Author: tijl Date: Wed Feb 11 17:25:23 2015 New Revision: 278586 URL: https://svnweb.freebsd.org/changeset/base/278586 Log: Fix ldscripts such that ld(1) collects the .fini_array section in the same order as the .init_array section. Finalisation routines need to be called in the opposite order as their corresponding initialisation routines but rtld(1) handles that by calling the function pointers in .fini_array in reverse order. Reviewed by: kib MFC after: 2 weeks Modified: head/contrib/binutils/ld/scripttempl/elf.sc Modified: head/contrib/binutils/ld/scripttempl/elf.sc ============================================================================== --- head/contrib/binutils/ld/scripttempl/elf.sc Wed Feb 11 17:00:32 2015 (r278585) +++ head/contrib/binutils/ld/scripttempl/elf.sc Wed Feb 11 17:25:23 2015 (r278586) @@ -402,8 +402,8 @@ cat < Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B41476E1; Wed, 11 Feb 2015 17:27: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1E3E9E; Wed, 11 Feb 2015 17:27:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BHRcju013298; Wed, 11 Feb 2015 17:27:38 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BHRcGX013297; Wed, 11 Feb 2015 17:27:38 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201502111727.t1BHRcGX013297@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 11 Feb 2015 17:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278587 - head/sys/cddl/dev/fbt/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 17:27:38 -0000 Author: gnn Date: Wed Feb 11 17:27:37 2015 New Revision: 278587 URL: https://svnweb.freebsd.org/changeset/base/278587 Log: Clean up machine dependent code for DTrace on ARM. Submitted by: markj Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/arm/fbt_isa.c Wed Feb 11 17:25:23 2015 (r278586) +++ head/sys/cddl/dev/fbt/arm/fbt_isa.c Wed Feb 11 17:27:37 2015 (r278587) @@ -33,114 +33,21 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -static MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing"); +#include "fbt.h" -#define FBT_PATCHVAL 0xe06a0cfe // illegal instruction +#define FBT_PATCHVAL 0xe06a0cfe /* illegal instruction */ -#define FBT_PUSHM 0xe92d0000 -#define FBT_POPM 0xe8bd0000 -#define FBT_JUMP 0xea000000 - -static d_open_t fbt_open; -static int fbt_unload(void); -static void fbt_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); -static void fbt_provide_module(void *, modctl_t *); -static void fbt_destroy(void *, dtrace_id_t, void *); -static void fbt_enable(void *, dtrace_id_t, void *); -static void fbt_disable(void *, dtrace_id_t, void *); -static void fbt_load(void *); -static void fbt_suspend(void *, dtrace_id_t, void *); -static void fbt_resume(void *, dtrace_id_t, void *); +#define FBT_PUSHM 0xe92d0000 +#define FBT_POPM 0xe8bd0000 +#define FBT_JUMP 0xea000000 #define FBT_ENTRY "entry" #define FBT_RETURN "return" -#define FBT_ADDR2NDX(addr) ((((uintptr_t)(addr)) >> 4) & fbt_probetab_mask) -#define FBT_PROBETAB_SIZE 0x8000 /* 32k entries -- 128K total */ -static struct cdevsw fbt_cdevsw = { - .d_version = D_VERSION, - .d_open = fbt_open, - .d_name = "fbt", -}; - -static dtrace_pattr_t fbt_attr = { -{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, -{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, -{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_ISA }, -{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, -{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_ISA }, -}; - -static dtrace_pops_t fbt_pops = { - NULL, - fbt_provide_module, - fbt_enable, - fbt_disable, - fbt_suspend, - fbt_resume, - fbt_getargdesc, - NULL, - NULL, - fbt_destroy -}; - -typedef struct fbt_probe { - struct fbt_probe *fbtp_hashnext; - uint32_t *fbtp_patchpoint; - int8_t fbtp_rval; - uint32_t fbtp_patchval; - uint32_t fbtp_savedval; - uintptr_t fbtp_roffset; - dtrace_id_t fbtp_id; - const char *fbtp_name; - modctl_t *fbtp_ctl; - int fbtp_loadcnt; - int fbtp_primary; - int fbtp_invop_cnt; - int fbtp_symindx; - struct fbt_probe *fbtp_next; -} fbt_probe_t; - -static struct cdev *fbt_cdev; -static dtrace_provider_id_t fbt_id; -static fbt_probe_t **fbt_probetab; -static int fbt_probetab_size; -static int fbt_probetab_mask; -static int fbt_verbose = 0; - -static int +int fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval) { struct trapframe *frame = (struct trapframe *)stack; @@ -152,9 +59,10 @@ fbt_invop(uintptr_t addr, uintptr_t *sta fbt->fbtp_invop_cnt++; cpu->cpu_dtrace_caller = addr; + /* TODO: Need 5th parameter from stack */ dtrace_probe(fbt->fbtp_id, frame->tf_r0, frame->tf_r1, frame->tf_r2, - frame->tf_r3, 0); // TODO: Need 5th parameter from stack + frame->tf_r3, 0); cpu->cpu_dtrace_caller = 0; @@ -165,15 +73,23 @@ fbt_invop(uintptr_t addr, uintptr_t *sta return (0); } -static int +void +fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val) +{ + + *fbt->fbtp_patchpoint = val; + cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4); +} + +int fbt_provide_module_function(linker_file_t lf, int symindx, linker_symval_t *symval, void *opaque) { char *modname = opaque; const char *name = symval->name; fbt_probe_t *fbt, *retfbt; + uint32_t *instr, *limit; int popm; - u_int32_t *instr, *limit; if (strncmp(name, "dtrace_", 7) == 0 && strncmp(name, "dtrace_safe_", 12) != 0) { @@ -189,11 +105,12 @@ fbt_provide_module_function(linker_file_ if (name[0] == '_' && name[1] == '_') return (0); - instr = (u_int32_t *) symval->value; - limit = (u_int32_t *)(symval->value + symval->size); + instr = (uint32_t *)symval->value; + limit = (uint32_t *)(symval->value + symval->size); for (; instr < limit; instr++) - if ((*instr & 0xffff0000) == FBT_PUSHM && (*instr & 0x4000) != 0) + if ((*instr & 0xffff0000) == FBT_PUSHM && + (*instr & 0x4000) != 0) break; if (instr >= limit) @@ -218,25 +135,23 @@ fbt_provide_module_function(linker_file_ popm = FBT_POPM | ((*instr) & 0x3FFF) | 0x8000; - retfbt = NULL; -again: - for(; instr < limit; instr++) - { - if (*instr == popm) +again: + for (; instr < limit; instr++) { + if (*instr == popm) break; - else if ((*instr & 0xff000000) == FBT_JUMP) - { + else if ((*instr & 0xff000000) == FBT_JUMP) { + uint32_t *target, *start; int offset; - u_int32_t *target, *start; + offset = (*instr & 0xffffff); offset <<= 8; offset /= 64; target = instr + (2 + offset); - start = (u_int32_t *) symval->value; + start = (uint32_t *)symval->value; if (target >= limit || target < start) break; - instr++; //skip delay slot + instr++; /* skip delay slot */ } } @@ -263,7 +178,7 @@ again: fbt->fbtp_symindx = symindx; if ((*instr & 0xff000000) == FBT_JUMP) fbt->fbtp_rval = DTRACE_INVOP_B; - else + else fbt->fbtp_rval = DTRACE_INVOP_POPM; fbt->fbtp_savedval = *instr; fbt->fbtp_patchval = FBT_PATCHVAL; @@ -275,1029 +190,3 @@ again: instr++; goto again; } - -static void -fbt_provide_module(void *arg, modctl_t *lf) -{ - char modname[MAXPATHLEN]; - int i; - size_t len; - - strlcpy(modname, lf->filename, sizeof(modname)); - len = strlen(modname); - if (len > 3 && strcmp(modname + len - 3, ".ko") == 0) - modname[len - 3] = '\0'; - - /* - * Employees of dtrace and their families are ineligible. Void - * where prohibited. - */ - if (strcmp(modname, "dtrace") == 0) - return; - - /* - * The cyclic timer subsystem can be built as a module and DTrace - * depends on that, so it is ineligible too. - */ - if (strcmp(modname, "cyclic") == 0) - return; - - /* - * To register with DTrace, a module must list 'dtrace' as a - * dependency in order for the kernel linker to resolve - * symbols like dtrace_register(). All modules with such a - * dependency are ineligible for FBT tracing. - */ - for (i = 0; i < lf->ndeps; i++) - if (strncmp(lf->deps[i]->filename, "dtrace", 6) == 0) - return; - - if (lf->fbt_nentries) { - /* - * This module has some FBT entries allocated; we're afraid - * to screw with it. - */ - return; - } - - /* - * List the functions in the module and the symbol values. - */ - (void) linker_file_function_listall(lf, fbt_provide_module_function, modname); -} - -static void -fbt_destroy(void *arg, dtrace_id_t id, void *parg) -{ - fbt_probe_t *fbt = parg, *next, *hash, *last; - modctl_t *ctl; - int ndx; - - do { - ctl = fbt->fbtp_ctl; - - ctl->fbt_nentries--; - - /* - * Now we need to remove this probe from the fbt_probetab. - */ - ndx = FBT_ADDR2NDX(fbt->fbtp_patchpoint); - last = NULL; - hash = fbt_probetab[ndx]; - - while (hash != fbt) { - ASSERT(hash != NULL); - last = hash; - hash = hash->fbtp_hashnext; - } - - if (last != NULL) { - last->fbtp_hashnext = fbt->fbtp_hashnext; - } else { - fbt_probetab[ndx] = fbt->fbtp_hashnext; - } - - next = fbt->fbtp_next; - free(fbt, M_FBT); - - fbt = next; - } while (fbt != NULL); -} - -static void -fbt_enable(void *arg, dtrace_id_t id, void *parg) -{ - fbt_probe_t *fbt = parg; - modctl_t *ctl = fbt->fbtp_ctl; - - ctl->nenabled++; - - /* - * Now check that our modctl has the expected load count. If it - * doesn't, this module must have been unloaded and reloaded -- and - * we're not going to touch it. - */ - if (ctl->loadcnt != fbt->fbtp_loadcnt) { - if (fbt_verbose) { - printf("fbt is failing for probe %s " - "(module %s reloaded)", - fbt->fbtp_name, ctl->filename); - } - - return; - } - - for (; fbt != NULL; fbt = fbt->fbtp_next) { - *fbt->fbtp_patchpoint = fbt->fbtp_patchval; - cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4); - } -} - -static void -fbt_disable(void *arg, dtrace_id_t id, void *parg) -{ - fbt_probe_t *fbt = parg; - modctl_t *ctl = fbt->fbtp_ctl; - - ASSERT(ctl->nenabled > 0); - ctl->nenabled--; - - if ((ctl->loadcnt != fbt->fbtp_loadcnt)) - return; - - for (; fbt != NULL; fbt = fbt->fbtp_next) { - *fbt->fbtp_patchpoint = fbt->fbtp_savedval; - cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4); - } -} - -static void -fbt_suspend(void *arg, dtrace_id_t id, void *parg) -{ - fbt_probe_t *fbt = parg; - modctl_t *ctl = fbt->fbtp_ctl; - - ASSERT(ctl->nenabled > 0); - - if ((ctl->loadcnt != fbt->fbtp_loadcnt)) - return; - - for (; fbt != NULL; fbt = fbt->fbtp_next) { - *fbt->fbtp_patchpoint = fbt->fbtp_savedval; - cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4); - } -} - -static void -fbt_resume(void *arg, dtrace_id_t id, void *parg) -{ - fbt_probe_t *fbt = parg; - modctl_t *ctl = fbt->fbtp_ctl; - - ASSERT(ctl->nenabled > 0); - - if ((ctl->loadcnt != fbt->fbtp_loadcnt)) - return; - - for (; fbt != NULL; fbt = fbt->fbtp_next) { - *fbt->fbtp_patchpoint = fbt->fbtp_patchval; - cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4); - } -} - -static int -fbt_ctfoff_init(modctl_t *lf, linker_ctf_t *lc) -{ - const Elf_Sym *symp = lc->symtab;; - const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab; - const uint8_t *ctfdata = lc->ctftab + sizeof(ctf_header_t); - int i; - uint32_t *ctfoff; - uint32_t objtoff = hp->cth_objtoff; - uint32_t funcoff = hp->cth_funcoff; - ushort_t info; - ushort_t vlen; - - /* Sanity check. */ - if (hp->cth_magic != CTF_MAGIC) { - printf("Bad magic value in CTF data of '%s'\n",lf->pathname); - return (EINVAL); - } - - if (lc->symtab == NULL) { - printf("No symbol table in '%s'\n",lf->pathname); - return (EINVAL); - } - - if ((ctfoff = malloc(sizeof(uint32_t) * lc->nsym, M_LINKER, M_WAITOK)) == NULL) - return (ENOMEM); - - *lc->ctfoffp = ctfoff; - - for (i = 0; i < lc->nsym; i++, ctfoff++, symp++) { - if (symp->st_name == 0 || symp->st_shndx == SHN_UNDEF) { - *ctfoff = 0xffffffff; - continue; - } - - switch (ELF_ST_TYPE(symp->st_info)) { - case STT_OBJECT: - if (objtoff >= hp->cth_funcoff || - (symp->st_shndx == SHN_ABS && symp->st_value == 0)) { - *ctfoff = 0xffffffff; - break; - } - - *ctfoff = objtoff; - objtoff += sizeof (ushort_t); - break; - - case STT_FUNC: - if (funcoff >= hp->cth_typeoff) { - *ctfoff = 0xffffffff; - break; - } - - *ctfoff = funcoff; - - info = *((const ushort_t *)(ctfdata + funcoff)); - vlen = CTF_INFO_VLEN(info); - - /* - * If we encounter a zero pad at the end, just skip it. - * Otherwise skip over the function and its return type - * (+2) and the argument list (vlen). - */ - if (CTF_INFO_KIND(info) == CTF_K_UNKNOWN && vlen == 0) - funcoff += sizeof (ushort_t); /* skip pad */ - else - funcoff += sizeof (ushort_t) * (vlen + 2); - break; - - default: - *ctfoff = 0xffffffff; - break; - } - } - - return (0); -} - -static ssize_t -fbt_get_ctt_size(uint8_t version, const ctf_type_t *tp, ssize_t *sizep, - ssize_t *incrementp) -{ - ssize_t size, increment; - - if (version > CTF_VERSION_1 && - tp->ctt_size == CTF_LSIZE_SENT) { - size = CTF_TYPE_LSIZE(tp); - increment = sizeof (ctf_type_t); - } else { - size = tp->ctt_size; - increment = sizeof (ctf_stype_t); - } - - if (sizep) - *sizep = size; - if (incrementp) - *incrementp = increment; - - return (size); -} - -static int -fbt_typoff_init(linker_ctf_t *lc) -{ - const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab; - const ctf_type_t *tbuf; - const ctf_type_t *tend; - const ctf_type_t *tp; - const uint8_t *ctfdata = lc->ctftab + sizeof(ctf_header_t); - int ctf_typemax = 0; - uint32_t *xp; - ulong_t pop[CTF_K_MAX + 1] = { 0 }; - - - /* Sanity check. */ - if (hp->cth_magic != CTF_MAGIC) - return (EINVAL); - - tbuf = (const ctf_type_t *) (ctfdata + hp->cth_typeoff); - tend = (const ctf_type_t *) (ctfdata + hp->cth_stroff); - - int child = hp->cth_parname != 0; - - /* - * We make two passes through the entire type section. In this first - * pass, we count the number of each type and the total number of types. - */ - for (tp = tbuf; tp < tend; ctf_typemax++) { - ushort_t kind = CTF_INFO_KIND(tp->ctt_info); - ulong_t vlen = CTF_INFO_VLEN(tp->ctt_info); - ssize_t size, increment; - - size_t vbytes; - uint_t n; - - (void) fbt_get_ctt_size(hp->cth_version, tp, &size, &increment); - - switch (kind) { - case CTF_K_INTEGER: - case CTF_K_FLOAT: - vbytes = sizeof (uint_t); - break; - case CTF_K_ARRAY: - vbytes = sizeof (ctf_array_t); - break; - case CTF_K_FUNCTION: - vbytes = sizeof (ushort_t) * (vlen + (vlen & 1)); - break; - case CTF_K_STRUCT: - case CTF_K_UNION: - if (size < CTF_LSTRUCT_THRESH) { - ctf_member_t *mp = (ctf_member_t *) - ((uintptr_t)tp + increment); - - vbytes = sizeof (ctf_member_t) * vlen; - for (n = vlen; n != 0; n--, mp++) - child |= CTF_TYPE_ISCHILD(mp->ctm_type); - } else { - ctf_lmember_t *lmp = (ctf_lmember_t *) - ((uintptr_t)tp + increment); - - vbytes = sizeof (ctf_lmember_t) * vlen; - for (n = vlen; n != 0; n--, lmp++) - child |= - CTF_TYPE_ISCHILD(lmp->ctlm_type); - } - break; - case CTF_K_ENUM: - vbytes = sizeof (ctf_enum_t) * vlen; - break; - case CTF_K_FORWARD: - /* - * For forward declarations, ctt_type is the CTF_K_* - * kind for the tag, so bump that population count too. - * If ctt_type is unknown, treat the tag as a struct. - */ - if (tp->ctt_type == CTF_K_UNKNOWN || - tp->ctt_type >= CTF_K_MAX) - pop[CTF_K_STRUCT]++; - else - pop[tp->ctt_type]++; - /*FALLTHRU*/ - case CTF_K_UNKNOWN: - vbytes = 0; - break; - case CTF_K_POINTER: - case CTF_K_TYPEDEF: - case CTF_K_VOLATILE: - case CTF_K_CONST: - case CTF_K_RESTRICT: - child |= CTF_TYPE_ISCHILD(tp->ctt_type); - vbytes = 0; - break; - default: - printf("%s(%d): detected invalid CTF kind -- %u\n", __func__, __LINE__, kind); - return (EIO); - } - tp = (ctf_type_t *)((uintptr_t)tp + increment + vbytes); - pop[kind]++; - } - - /* account for a sentinel value below */ - ctf_typemax++; - *lc->typlenp = ctf_typemax; - - if ((xp = malloc(sizeof(uint32_t) * ctf_typemax, M_LINKER, M_ZERO | M_WAITOK)) == NULL) - return (ENOMEM); - - *lc->typoffp = xp; - - /* type id 0 is used as a sentinel value */ - *xp++ = 0; - - /* - * In the second pass, fill in the type offset. - */ - for (tp = tbuf; tp < tend; xp++) { - ushort_t kind = CTF_INFO_KIND(tp->ctt_info); - ulong_t vlen = CTF_INFO_VLEN(tp->ctt_info); - ssize_t size, increment; - - size_t vbytes; - uint_t n; - - (void) fbt_get_ctt_size(hp->cth_version, tp, &size, &increment); - - switch (kind) { - case CTF_K_INTEGER: - case CTF_K_FLOAT: - vbytes = sizeof (uint_t); - break; - case CTF_K_ARRAY: - vbytes = sizeof (ctf_array_t); - break; - case CTF_K_FUNCTION: - vbytes = sizeof (ushort_t) * (vlen + (vlen & 1)); - break; - case CTF_K_STRUCT: - case CTF_K_UNION: - if (size < CTF_LSTRUCT_THRESH) { - ctf_member_t *mp = (ctf_member_t *) - ((uintptr_t)tp + increment); - - vbytes = sizeof (ctf_member_t) * vlen; - for (n = vlen; n != 0; n--, mp++) - child |= CTF_TYPE_ISCHILD(mp->ctm_type); - } else { - ctf_lmember_t *lmp = (ctf_lmember_t *) - ((uintptr_t)tp + increment); - - vbytes = sizeof (ctf_lmember_t) * vlen; - for (n = vlen; n != 0; n--, lmp++) - child |= - CTF_TYPE_ISCHILD(lmp->ctlm_type); - } - break; - case CTF_K_ENUM: - vbytes = sizeof (ctf_enum_t) * vlen; - break; - case CTF_K_FORWARD: - case CTF_K_UNKNOWN: - vbytes = 0; - break; - case CTF_K_POINTER: - case CTF_K_TYPEDEF: - case CTF_K_VOLATILE: - case CTF_K_CONST: - case CTF_K_RESTRICT: - vbytes = 0; - break; - default: - printf("%s(%d): detected invalid CTF kind -- %u\n", __func__, __LINE__, kind); - return (EIO); - } - *xp = (uint32_t)((uintptr_t) tp - (uintptr_t) ctfdata); - tp = (ctf_type_t *)((uintptr_t)tp + increment + vbytes); - } - - return (0); -} - -/* - * CTF Declaration Stack - * - * In order to implement ctf_type_name(), we must convert a type graph back - * into a C type declaration. Unfortunately, a type graph represents a storage - * class ordering of the type whereas a type declaration must obey the C rules - * for operator precedence, and the two orderings are frequently in conflict. - * For example, consider these CTF type graphs and their C declarations: - * - * CTF_K_POINTER -> CTF_K_FUNCTION -> CTF_K_INTEGER : int (*)() - * CTF_K_POINTER -> CTF_K_ARRAY -> CTF_K_INTEGER : int (*)[] - * - * In each case, parentheses are used to raise operator * to higher lexical - * precedence, so the string form of the C declaration cannot be constructed by - * walking the type graph links and forming the string from left to right. - * - * The functions in this file build a set of stacks from the type graph nodes - * corresponding to the C operator precedence levels in the appropriate order. - * The code in ctf_type_name() can then iterate over the levels and nodes in - * lexical precedence order and construct the final C declaration string. - */ -typedef struct ctf_list { - struct ctf_list *l_prev; /* previous pointer or tail pointer */ - struct ctf_list *l_next; /* next pointer or head pointer */ -} ctf_list_t; - -#define ctf_list_prev(elem) ((void *)(((ctf_list_t *)(elem))->l_prev)) -#define ctf_list_next(elem) ((void *)(((ctf_list_t *)(elem))->l_next)) - -typedef enum { - CTF_PREC_BASE, - CTF_PREC_POINTER, - CTF_PREC_ARRAY, - CTF_PREC_FUNCTION, - CTF_PREC_MAX -} ctf_decl_prec_t; - -typedef struct ctf_decl_node { - ctf_list_t cd_list; /* linked list pointers */ - ctf_id_t cd_type; /* type identifier */ - uint_t cd_kind; /* type kind */ - uint_t cd_n; /* type dimension if array */ -} ctf_decl_node_t; - -typedef struct ctf_decl { - ctf_list_t cd_nodes[CTF_PREC_MAX]; /* declaration node stacks */ - int cd_order[CTF_PREC_MAX]; /* storage order of decls */ - ctf_decl_prec_t cd_qualp; /* qualifier precision */ - ctf_decl_prec_t cd_ordp; /* ordered precision */ - char *cd_buf; /* buffer for output */ - char *cd_ptr; /* buffer location */ - char *cd_end; /* buffer limit */ - size_t cd_len; /* buffer space required */ - int cd_err; /* saved error value */ -} ctf_decl_t; - -/* - * Simple doubly-linked list append routine. This implementation assumes that - * each list element contains an embedded ctf_list_t as the first member. - * An additional ctf_list_t is used to store the head (l_next) and tail - * (l_prev) pointers. The current head and tail list elements have their - * previous and next pointers set to NULL, respectively. - */ -static void -ctf_list_append(ctf_list_t *lp, void *new) -{ - ctf_list_t *p = lp->l_prev; /* p = tail list element */ - ctf_list_t *q = new; /* q = new list element */ - - lp->l_prev = q; - q->l_prev = p; - q->l_next = NULL; - - if (p != NULL) - p->l_next = q; - else - lp->l_next = q; -} - -/* - * Prepend the specified existing element to the given ctf_list_t. The - * existing pointer should be pointing at a struct with embedded ctf_list_t. - */ -static void -ctf_list_prepend(ctf_list_t *lp, void *new) -{ - ctf_list_t *p = new; /* p = new list element */ - ctf_list_t *q = lp->l_next; /* q = head list element */ - - lp->l_next = p; - p->l_prev = NULL; - p->l_next = q; - - if (q != NULL) - q->l_prev = p; - else - lp->l_prev = p; -} - -static void -ctf_decl_init(ctf_decl_t *cd, char *buf, size_t len) -{ - int i; - - bzero(cd, sizeof (ctf_decl_t)); - - for (i = CTF_PREC_BASE; i < CTF_PREC_MAX; i++) - cd->cd_order[i] = CTF_PREC_BASE - 1; - - cd->cd_qualp = CTF_PREC_BASE; - cd->cd_ordp = CTF_PREC_BASE; - - cd->cd_buf = buf; - cd->cd_ptr = buf; - cd->cd_end = buf + len; -} - -static void -ctf_decl_fini(ctf_decl_t *cd) -{ - ctf_decl_node_t *cdp, *ndp; - int i; - - for (i = CTF_PREC_BASE; i < CTF_PREC_MAX; i++) { - for (cdp = ctf_list_next(&cd->cd_nodes[i]); - cdp != NULL; cdp = ndp) { - ndp = ctf_list_next(cdp); - free(cdp, M_FBT); - } - } -} - -static const ctf_type_t * -ctf_lookup_by_id(linker_ctf_t *lc, ctf_id_t type) -{ - const ctf_type_t *tp; - uint32_t offset; - uint32_t *typoff = *lc->typoffp; - - if (type >= *lc->typlenp) { - printf("%s(%d): type %d exceeds max %ld\n",__func__,__LINE__,(int) type,*lc->typlenp); - return(NULL); - } - - /* Check if the type isn't cross-referenced. */ - if ((offset = typoff[type]) == 0) { - printf("%s(%d): type %d isn't cross referenced\n",__func__,__LINE__, (int) type); - return(NULL); - } - - tp = (const ctf_type_t *)(lc->ctftab + offset + sizeof(ctf_header_t)); - - return (tp); -} - -static void -fbt_array_info(linker_ctf_t *lc, ctf_id_t type, ctf_arinfo_t *arp) -{ - const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab; - const ctf_type_t *tp; - const ctf_array_t *ap; - ssize_t increment; - - bzero(arp, sizeof(*arp)); - - if ((tp = ctf_lookup_by_id(lc, type)) == NULL) - return; - - if (CTF_INFO_KIND(tp->ctt_info) != CTF_K_ARRAY) - return; - - (void) fbt_get_ctt_size(hp->cth_version, tp, NULL, &increment); - - ap = (const ctf_array_t *)((uintptr_t)tp + increment); - arp->ctr_contents = ap->cta_contents; - arp->ctr_index = ap->cta_index; - arp->ctr_nelems = ap->cta_nelems; -} - -static const char * -ctf_strptr(linker_ctf_t *lc, int name) -{ - const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab;; - const char *strp = ""; - - if (name < 0 || name >= hp->cth_strlen) - return (strp); - - strp = (const char *)(lc->ctftab + hp->cth_stroff + name + sizeof(ctf_header_t)); - - return (strp); -} - -static void -ctf_decl_push(ctf_decl_t *cd, linker_ctf_t *lc, ctf_id_t type) -{ - ctf_decl_node_t *cdp; - ctf_decl_prec_t prec; - uint_t kind, n = 1; - int is_qual = 0; - - const ctf_type_t *tp; - ctf_arinfo_t ar; - - if ((tp = ctf_lookup_by_id(lc, type)) == NULL) { - cd->cd_err = ENOENT; - return; - } - - switch (kind = CTF_INFO_KIND(tp->ctt_info)) { - case CTF_K_ARRAY: - fbt_array_info(lc, type, &ar); - ctf_decl_push(cd, lc, ar.ctr_contents); - n = ar.ctr_nelems; - prec = CTF_PREC_ARRAY; - break; - - case CTF_K_TYPEDEF: - if (ctf_strptr(lc, tp->ctt_name)[0] == '\0') { - ctf_decl_push(cd, lc, tp->ctt_type); - return; - } - prec = CTF_PREC_BASE; - break; - - case CTF_K_FUNCTION: - ctf_decl_push(cd, lc, tp->ctt_type); - prec = CTF_PREC_FUNCTION; - break; - - case CTF_K_POINTER: - ctf_decl_push(cd, lc, tp->ctt_type); - prec = CTF_PREC_POINTER; - break; - - case CTF_K_VOLATILE: - case CTF_K_CONST: - case CTF_K_RESTRICT: - ctf_decl_push(cd, lc, tp->ctt_type); - prec = cd->cd_qualp; - is_qual++; - break; - - default: - prec = CTF_PREC_BASE; - } - - if ((cdp = malloc(sizeof (ctf_decl_node_t), M_FBT, M_WAITOK)) == NULL) { - cd->cd_err = EAGAIN; - return; - } - - cdp->cd_type = type; - cdp->cd_kind = kind; - cdp->cd_n = n; - - if (ctf_list_next(&cd->cd_nodes[prec]) == NULL) - cd->cd_order[prec] = cd->cd_ordp++; - - /* - * Reset cd_qualp to the highest precedence level that we've seen so - * far that can be qualified (CTF_PREC_BASE or CTF_PREC_POINTER). - */ - if (prec > cd->cd_qualp && prec < CTF_PREC_ARRAY) - cd->cd_qualp = prec; - - /* - * C array declarators are ordered inside out so prepend them. Also by - * convention qualifiers of base types precede the type specifier (e.g. - * const int vs. int const) even though the two forms are equivalent. - */ - if (kind == CTF_K_ARRAY || (is_qual && prec == CTF_PREC_BASE)) - ctf_list_prepend(&cd->cd_nodes[prec], cdp); - else - ctf_list_append(&cd->cd_nodes[prec], cdp); -} - -static void -ctf_decl_sprintf(ctf_decl_t *cd, const char *format, ...) -{ - size_t len = (size_t)(cd->cd_end - cd->cd_ptr); - va_list ap; - size_t n; - - va_start(ap, format); - n = vsnprintf(cd->cd_ptr, len, format, ap); - va_end(ap); - - cd->cd_ptr += MIN(n, len); - cd->cd_len += n; -} - -static ssize_t -fbt_type_name(linker_ctf_t *lc, ctf_id_t type, char *buf, size_t len) -{ - ctf_decl_t cd; - ctf_decl_node_t *cdp; - ctf_decl_prec_t prec, lp, rp; - int ptr, arr; - uint_t k; - - if (lc == NULL && type == CTF_ERR) - return (-1); /* simplify caller code by permitting CTF_ERR */ - - ctf_decl_init(&cd, buf, len); - ctf_decl_push(&cd, lc, type); - - if (cd.cd_err != 0) { - ctf_decl_fini(&cd); - return (-1); - } - - /* - * If the type graph's order conflicts with lexical precedence order - * for pointers or arrays, then we need to surround the declarations at - * the corresponding lexical precedence with parentheses. This can - * result in either a parenthesized pointer (*) as in int (*)() or - * int (*)[], or in a parenthesized pointer and array as in int (*[])(). - */ - ptr = cd.cd_order[CTF_PREC_POINTER] > CTF_PREC_POINTER; - arr = cd.cd_order[CTF_PREC_ARRAY] > CTF_PREC_ARRAY; - - rp = arr ? CTF_PREC_ARRAY : ptr ? CTF_PREC_POINTER : -1; - lp = ptr ? CTF_PREC_POINTER : arr ? CTF_PREC_ARRAY : -1; - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 17:46:36 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0648B8F; Wed, 11 Feb 2015 17:46: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5FAB107; Wed, 11 Feb 2015 17:46:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BHkZMg022492; Wed, 11 Feb 2015 17:46:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BHkZqt022491; Wed, 11 Feb 2015 17:46:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502111746.t1BHkZqt022491@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 11 Feb 2015 17:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278589 - head/usr.sbin/flowctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 17:46:36 -0000 Author: pfg Date: Wed Feb 11 17:46:35 2015 New Revision: 278589 URL: https://svnweb.freebsd.org/changeset/base/278589 Log: flowctl: Replace alloca() with an array. Reviewed by: glebius Modified: head/usr.sbin/flowctl/flowctl.c Modified: head/usr.sbin/flowctl/flowctl.c ============================================================================== --- head/usr.sbin/flowctl/flowctl.c Wed Feb 11 17:41:23 2015 (r278588) +++ head/usr.sbin/flowctl/flowctl.c Wed Feb 11 17:46:35 2015 (r278589) @@ -222,12 +222,10 @@ ctl_show(int argc, char **argv) static void do_show(int version, void (*func)(struct ngnf_show_header *)) { - struct ng_mesg *ng_mesg; + struct ng_mesg ng_mesg[SORCVBUF_SIZE]; struct ngnf_show_header req, *resp; int token, nread; - ng_mesg = alloca(SORCVBUF_SIZE); - req.version = version; req.hash_id = req.list_id = 0; From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 17:56:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 704213B2; Wed, 11 Feb 2015 17:56: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BA48219; Wed, 11 Feb 2015 17:56:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BHuP1C027166; Wed, 11 Feb 2015 17:56:25 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BHuPmD027165; Wed, 11 Feb 2015 17:56:25 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201502111756.t1BHuPmD027165@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 11 Feb 2015 17:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278590 - head/usr.bin/wc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 17:56:25 -0000 Author: marcel Date: Wed Feb 11 17:56:24 2015 New Revision: 278590 URL: https://svnweb.freebsd.org/changeset/base/278590 Log: Close the file list before opening the container that holds the totals, otherwise we end up emitting invalid JSON -- provided libxo does not prevent us from doing that. PR: 197499 Submitted by: allanjude@ Modified: head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Wed Feb 11 17:46:35 2015 (r278589) +++ head/usr.bin/wc/wc.c Wed Feb 11 17:56:24 2015 (r278590) @@ -140,12 +140,14 @@ main(int argc, char *argv[]) } while(*++argv); } + xo_close_list("file"); + if (total > 1) { xo_open_container("total"); show_cnt("total", tlinect, twordct, tcharct, tlongline); xo_close_container("total"); } - xo_close_list("file"); + xo_close_container("wc"); xo_finish(); exit(errors == 0 ? 0 : 1); From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 18:58:28 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6BDB573; Wed, 11 Feb 2015 18:58:28 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtp002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A245AABD; Wed, 11 Feb 2015 18:58:28 +0000 (UTC) Received: from st11p02mm-spool002.mac.com ([17.172.220.247]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTP id <0NJM0072NFCSO200@st11p02mm-asmtp002.mac.com>; Wed, 11 Feb 2015 18:58:09 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-11_04:2015-02-11,2015-02-11,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502110188 MIME-version: 1.0 Received: from localhost ([17.172.220.163]) by st11p02mm-spool002.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTP id <0NJM00IVGFCTD570@st11p02mm-spool002.mac.com>; Wed, 11 Feb 2015 18:58:05 +0000 (GMT) To: Konstantin Belousov From: Rui Paulo Subject: =?utf-8?B?UmU6IHN2biBjb21taXQ6IHIyNzg0NzMgLSBpbiBoZWFkL3N5czogYW1kNjQv?= =?utf-8?B?YW1kNjQgYW1kNjQvaW5jbHVkZSBhbWQ2NC92bW0gY29udHJpYi9kZXYvYWNw?= =?utf-8?B?aWNhL2luY2x1ZGUgaTM4Ni9pMzg2IGkzODYvaW5jbHVkZSB4ODYvYWNwaWNh?= =?utf-8?B?IHg4Ni9pbmNsdWRlIHg4Ni94ODYgeDg2L3hlbg==?= Date: Wed, 11 Feb 2015 18:58:04 +0000 (GMT) X-Mailer: iCloud MailClient15A99 MailServer14H18.17359 X-Originating-IP: [12.218.212.178] Message-id: <104946c8-5e94-408e-9bef-1d7e388076d1@me.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, trasz@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 18:58:29 -0000 On Feb 11, 2015, at 08:55 AM, Konstantin Belousov wr= ote:=0AOk, https://lkml.org/lkml/2013/1/17/552=0A=0APatch is below. Please= , users of VMWare, test it.=0A=C2=A0=0AFixed the problem for me on VMware = Fusion 6.0.5.= From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 19:07:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CA028F8; Wed, 11 Feb 2015 19:07: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 683EDC1B; Wed, 11 Feb 2015 19:07:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BJ76m6060791; Wed, 11 Feb 2015 19:07:06 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BJ761u060790; Wed, 11 Feb 2015 19:07:06 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502111907.t1BJ761u060790@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Wed, 11 Feb 2015 19:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278592 - 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.18-1 Precedence: list List-Id: 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, 11 Feb 2015 19:07:06 -0000 Author: rpaulo Date: Wed Feb 11 19:07:05 2015 New Revision: 278592 URL: https://svnweb.freebsd.org/changeset/base/278592 Log: Remove check against NULL after M_WAITOK. Submitted by: Oliver Pinter Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Wed Feb 11 18:59:46 2015 (r278591) +++ head/sys/kern/kern_sig.c Wed Feb 11 19:07:05 2015 (r278592) @@ -3362,8 +3362,6 @@ close: len = MAXPATHLEN * 2 + sizeof(comm_name) - 1 + sizeof(' ') + sizeof(core_name) - 1; data = malloc(len, M_TEMP, M_WAITOK); - if (data == NULL) - goto out; if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) goto out; if (!coredump_sanitise_path(fullpath)) From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 19:15:01 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22F91C78; Wed, 11 Feb 2015 19:15:01 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3F2AD03; Wed, 11 Feb 2015 19:15:00 +0000 (UTC) Received: from st11p02mm-spool002.mac.com ([17.172.220.247]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTP id <0NJM00FDCG4LV540@st11p02mm-asmtp001.mac.com>; Wed, 11 Feb 2015 19:14:47 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-11_04:2015-02-11,2015-02-11,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502110191 MIME-version: 1.0 Received: from localhost ([17.172.220.163]) by st11p02mm-spool002.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTP id <0NJM00IUIG4LD580@st11p02mm-spool002.mac.com>; Wed, 11 Feb 2015 19:14:45 +0000 (GMT) To: Mark Johnston From: Rui Paulo Subject: =?utf-8?B?UmU6IHN2biBjb21taXQ6IHIyNzgwMTIgLSBoZWFkL2NkZGwvY29udHJpYi9v?= =?utf-8?B?cGVuc29sYXJpcy9jbWQvZHRyYWNlL3Rlc3QvdHN0L2NvbW1vbi91c2R0?= Date: Wed, 11 Feb 2015 19:14:44 +0000 (GMT) X-Mailer: iCloud MailClient15A99 MailServer14H18.17359 X-Originating-IP: [12.218.212.178] Message-id: <79f3f80d-5bdb-448e-9dfb-215cdbfa838f@me.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-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.18-1 Precedence: list List-Id: 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, 11 Feb 2015 19:15:01 -0000 On Jan 31, 2015, at 03:12 PM, Mark Johnston wrote:=0A=0A= Author: markj=0ADate: Sat Jan 31 23:12:29 2015=0ANew Revision: 278012=0AUR= L: https://svnweb.freebsd.org/changeset/base/278012=0A=0ALog:=0AFix mktemp= (1) usage.=0A=0AMFC after: =C2=A01 week=0A=0AModified:=0Ahead/cddl/contrib= /opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh=0A=0AModif= ied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.cor= ruptenv.ksh=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=0A--- head/cddl/contrib/opensolaris/cmd/dtrace/te= st/tst/common/usdt/tst.corruptenv.ksh =C2=A0Sat Jan 31 23:11:57 2015 =C2=A0= =C2=A0(r278011)=0A+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/c= ommon/usdt/tst.corruptenv.ksh =C2=A0 =C2=A0 =C2=A0Sat Jan 31 23:12:29 2015= =C2=A0 =C2=A0(r278012)=0A@@ -48,7 +48,7 @@ fi=0A=0Adtrace=3D"$1"=0Astartd= ir=3D"$PWD"=0A-dir=3D$(mktemp -td drtiXXXXXX)=0A+dir=3D$(mktemp -d -t drti= XXXXXX)=0Aif (( $? !=3D 0 )); then=0A=C2=A0 =C2=A0print -u2 'Could not cre= ate safe temporary directory'=0A=C2=A0 =C2=A0exit 2=0A=C2=A0=0AI hit this = exact same problem in xz-utils when running the test suite. =C2=A0I think = this is a bug in our mktemp and perhaps it's time we move to a version of = mktemp that everyone else uses: mktemp.org.= From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 19:53:45 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA5C6815; Wed, 11 Feb 2015 19:53: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A581C15F; Wed, 11 Feb 2015 19:53:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BJrj9F086426; Wed, 11 Feb 2015 19:53:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BJrjXU086425; Wed, 11 Feb 2015 19:53:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201502111953.t1BJrjXU086425@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Feb 2015 19:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278593 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 19:53:45 -0000 Author: emaste Date: Wed Feb 11 19:53:44 2015 New Revision: 278593 URL: https://svnweb.freebsd.org/changeset/base/278593 Log: libdwarf: Add symbol value when processing .rela relocations Reviewed by: kib, rpaulo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1826 Modified: head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Wed Feb 11 19:07:05 2015 (r278592) +++ head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Wed Feb 11 19:53:44 2015 (r278593) @@ -70,11 +70,15 @@ _dwarf_elf_apply_reloc(Dwarf_Debug dbg, offset = rela.r_offset; size = _dwarf_get_reloc_size(dbg, type); + if (size == 0) + continue; /* Unknown or non-absolute relocation. */ if (endian == ELFDATA2MSB) - _dwarf_write_msb(buf, &offset, rela.r_addend, size); + _dwarf_write_msb(buf, &offset, + sym.st_value + rela.r_addend, size); else - _dwarf_write_lsb(buf, &offset, rela.r_addend, size); + _dwarf_write_lsb(buf, &offset, + sym.st_value + rela.r_addend, size); } } From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 19:57:39 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FF89A60; Wed, 11 Feb 2015 19:57: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B6BF18A; Wed, 11 Feb 2015 19:57:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BJvd6d086969; Wed, 11 Feb 2015 19:57:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BJvdPT086968; Wed, 11 Feb 2015 19:57:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201502111957.t1BJvdPT086968@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Feb 2015 19:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278594 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 19:57:39 -0000 Author: mav Date: Wed Feb 11 19:57:38 2015 New Revision: 278594 URL: https://svnweb.freebsd.org/changeset/base/278594 Log: Add missing asprintf() status checks. MFC after: 2 weeks Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Feb 11 19:53:44 2015 (r278593) +++ head/usr.sbin/ctld/ctld.c Wed Feb 11 19:57:38 2015 (r278594) @@ -1191,8 +1191,11 @@ port_new(struct conf *conf, struct targe { struct port *port; char *name; + int ret; - asprintf(&name, "%s-%s", pg->pg_name, target->t_name); + ret = asprintf(&name, "%s-%s", pg->pg_name, target->t_name); + if (ret <= 0) + log_err(1, "asprintf"); if (port_find(conf, name) != NULL) { log_warnx("duplicate port \"%s\"", name); free(name); @@ -1216,8 +1219,11 @@ port_new_pp(struct conf *conf, struct ta { struct port *port; char *name; + int ret; - asprintf(&name, "%s-%s", pp->pp_name, target->t_name); + ret = asprintf(&name, "%s-%s", pp->pp_name, target->t_name); + if (ret <= 0) + log_err(1, "asprintf"); if (port_find(conf, name) != NULL) { log_warnx("duplicate port \"%s\"", name); free(name); From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:03:24 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08284CB1; Wed, 11 Feb 2015 22:03: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7B7A376; Wed, 11 Feb 2015 22:03:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BM3NYq048604; Wed, 11 Feb 2015 22:03:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BM3NfU048603; Wed, 11 Feb 2015 22:03:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201502112203.t1BM3NfU048603@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Feb 2015 22:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278598 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 22:03:24 -0000 Author: mav Date: Wed Feb 11 22:03:23 2015 New Revision: 278598 URL: https://svnweb.freebsd.org/changeset/base/278598 Log: Do not dereference NULL clearing UA that was not set in r277917. MFC after: 3 days Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Feb 11 20:51:58 2015 (r278597) +++ head/sys/cam/ctl/ctl.c Wed Feb 11 22:03:23 2015 (r278598) @@ -11712,7 +11712,8 @@ ctl_clear_ua(struct ctl_softc *ctl_softc STAILQ_FOREACH(lun, &ctl_softc->lun_list, links) { mtx_lock(&lun->lun_lock); pu = lun->pending_ua[initidx / CTL_MAX_INIT_PER_PORT]; - pu[initidx % CTL_MAX_INIT_PER_PORT] &= ~ua_type; + if (pu != NULL) + pu[initidx % CTL_MAX_INIT_PER_PORT] &= ~ua_type; mtx_unlock(&lun->lun_lock); } } From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:39:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01E6253B; Wed, 11 Feb 2015 22:39: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E102F8E5; Wed, 11 Feb 2015 22:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BMdDLu063692; Wed, 11 Feb 2015 22:39:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BMdDZX063691; Wed, 11 Feb 2015 22:39:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201502112239.t1BMdDZX063691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 11 Feb 2015 22:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278600 - head/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.18-1 Precedence: list List-Id: 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, 11 Feb 2015 22:39:14 -0000 Author: bdrewery Date: Wed Feb 11 22:39:13 2015 New Revision: 278600 URL: https://svnweb.freebsd.org/changeset/base/278600 Log: Correct and clarify comment for __SMBF. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/include/stdio.h Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Wed Feb 11 22:35:32 2015 (r278599) +++ head/include/stdio.h Wed Feb 11 22:39:13 2015 (r278600) @@ -166,7 +166,7 @@ __END_DECLS #define __SRW 0x0010 /* open for reading & writing */ #define __SEOF 0x0020 /* found EOF */ #define __SERR 0x0040 /* found error */ -#define __SMBF 0x0080 /* _buf is from malloc */ +#define __SMBF 0x0080 /* _bf._base is from malloc */ #define __SAPP 0x0100 /* fdopen()ed in append mode */ #define __SSTR 0x0200 /* this is an sprintf/snprintf string */ #define __SOPT 0x0400 /* do fseek() optimization */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 22:59:25 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86A1DBAE; Wed, 11 Feb 2015 22:59: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71CEDAC0; Wed, 11 Feb 2015 22:59:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BMxPYr073205; Wed, 11 Feb 2015 22:59:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BMxPkK073204; Wed, 11 Feb 2015 22:59:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502112259.t1BMxPkK073204@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 11 Feb 2015 22:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278603 - head/usr.bin/svn/svn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 22:59:25 -0000 Author: gjb Date: Wed Feb 11 22:59:24 2015 New Revision: 278603 URL: https://svnweb.freebsd.org/changeset/base/278603 Log: Ensure ORGANIZATION_NAME is quoted when ORGANIZATION could contain strings of two or more words. Reviewed by: peter Reported by: karl@denninger.net PR: 197540 MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/svn/svn/Makefile Modified: head/usr.bin/svn/svn/Makefile ============================================================================== --- head/usr.bin/svn/svn/Makefile Wed Feb 11 22:55:24 2015 (r278602) +++ head/usr.bin/svn/svn/Makefile Wed Feb 11 22:59:24 2015 (r278603) @@ -54,8 +54,13 @@ DPSRCS+= freebsd-organization.h CLEANFILES+= freebsd-organization.h CFLAGS+= -I. -DHAS_ORGANIZATION_NAME freebsd-organization.h: - @echo '#define ORGANIZATION_NAME ${ORGANIZATION}' \ + @echo '#define ORGANIZATION_NAME ${ORGANIZATION}' \ > freebsd-organization.h + @# Remove quotes from ORGANIZATION_NAME if they exist. + @sed -i '' -e 's,",,g' freebsd-organization.h + @# Quote ORGANIZATION_NAME, in case it is two or more words. + @sed -i '' -E 's, , ",' freebsd-organization.h + @sed -i '' -E 's,$$,",' freebsd-organization.h .endif svnlite.1: svn.1 From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 23:28:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38879488; Wed, 11 Feb 2015 23:28: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2359AE0A; Wed, 11 Feb 2015 23:28:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BNSTi4087433; Wed, 11 Feb 2015 23:28:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BNSScH087432; Wed, 11 Feb 2015 23:28:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502112328.t1BNSScH087432@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 Feb 2015 23:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278605 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 23:28:29 -0000 Author: kib Date: Wed Feb 11 23:28:28 2015 New Revision: 278605 URL: https://svnweb.freebsd.org/changeset/base/278605 Log: vm_page_lookup() accepts read-locked object. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/intel_utils.c Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Wed Feb 11 23:05:58 2015 (r278604) +++ head/sys/x86/iommu/intel_utils.c Wed Feb 11 23:28:28 2015 (r278605) @@ -411,11 +411,9 @@ dmar_load_root_entry_ptr(struct dmar_uni */ DMAR_ASSERT_LOCKED(unit); - /* VM_OBJECT_RLOCK(unit->ctx_obj); */ - VM_OBJECT_WLOCK(unit->ctx_obj); + VM_OBJECT_RLOCK(unit->ctx_obj); root_entry = vm_page_lookup(unit->ctx_obj, 0); - /* VM_OBJECT_RUNLOCK(unit->ctx_obj); */ - VM_OBJECT_WUNLOCK(unit->ctx_obj); + VM_OBJECT_RUNLOCK(unit->ctx_obj); dmar_write8(unit, DMAR_RTADDR_REG, VM_PAGE_TO_PHYS(root_entry)); dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd | DMAR_GCMD_SRTP); /* XXXKIB should have a timeout */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 11 23:30:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8B5361A; Wed, 11 Feb 2015 23:30: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3C76EB6; Wed, 11 Feb 2015 23:30:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1BNUlpF090617; Wed, 11 Feb 2015 23:30:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1BNUlnX090615; Wed, 11 Feb 2015 23:30:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502112330.t1BNUlnX090615@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 Feb 2015 23:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278606 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 11 Feb 2015 23:30:47 -0000 Author: kib Date: Wed Feb 11 23:30:46 2015 New Revision: 278606 URL: https://svnweb.freebsd.org/changeset/base/278606 Log: Registers definitions for the new capabilities from the version 2.4 of VT-d specification. Also add definitions for the interrupt remapping table and IEC. Print new capabilities on boot. although there is no hardware which support it. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_reg.h Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Wed Feb 11 23:28:28 2015 (r278605) +++ head/sys/x86/iommu/intel_drv.c Wed Feb 11 23:30:46 2015 (r278606) @@ -375,7 +375,7 @@ dmar_print_caps(device_t dev, struct dma caphi = unit->hw_cap >> 32; device_printf(dev, "cap=%b,", (u_int)unit->hw_cap, "\020\004AFL\005WBF\006PLMR\007PHMR\010CM\027ZLR\030ISOCH"); - printf("%b, ", caphi, "\020\010PSI\027DWD\030DRD"); + printf("%b, ", caphi, "\020\010PSI\027DWD\030DRD\031FL1GP\034PSI"); printf("ndoms=%d, sagaw=%d, mgaw=%d, fro=%d, nfr=%d, superp=%d", DMAR_CAP_ND(unit->hw_cap), DMAR_CAP_SAGAW(unit->hw_cap), DMAR_CAP_MGAW(unit->hw_cap), DMAR_CAP_FRO(unit->hw_cap), @@ -385,8 +385,9 @@ dmar_print_caps(device_t dev, struct dma printf("\n"); ecaphi = unit->hw_ecap >> 32; device_printf(dev, "ecap=%b,", (u_int)unit->hw_ecap, - "\020\001C\002QI\003DI\004IR\005EIM\007PT\010SC"); - printf("%b, ", ecaphi, "\020"); + "\020\001C\002QI\003DI\004IR\005EIM\007PT\010SC\031ECS\032MTS" + "\033NEST\034DIS\035PASID\036PRS\037ERS\040SRS"); + printf("%b, ", ecaphi, "\020\002NWFS\003EAFS"); printf("mhmw=%d, iro=%d\n", DMAR_ECAP_MHMV(unit->hw_ecap), DMAR_ECAP_IRO(unit->hw_ecap)); } Modified: head/sys/x86/iommu/intel_reg.h ============================================================================== --- head/sys/x86/iommu/intel_reg.h Wed Feb 11 23:28:28 2015 (r278605) +++ head/sys/x86/iommu/intel_reg.h Wed Feb 11 23:30:46 2015 (r278606) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 The FreeBSD Foundation + * Copyright (c) 2013-2015 The FreeBSD Foundation * All rights reserved. * * This software was developed by Konstantin Belousov @@ -79,6 +79,47 @@ typedef struct dmar_pte { #define DMAR_PTE_ADDR_MASK 0xffffffffff000 /* Address Mask */ #define DMAR_PTE_TM (1ULL << 62) /* Transient Mapping */ +typedef struct dmar_irte { + uint64_t irte1; + uint64_t irte2; +} dmar_irte_t; +/* Source Validation Type */ +#define DMAR_IRTE2_SVT_NONE (0ULL << (82 - 64)) +#define DMAR_IRTE2_SVT_RID (1ULL << (82 - 64)) +#define DMAR_IRTE2_SVT_BUS (2ULL << (82 - 64)) +/* Source-id Qualifier */ +#define DMAR_IRTE2_SQ_RID (0ULL << (80 - 64)) +#define DMAR_IRTE2_SQ_RID_N2 (1ULL << (80 - 64)) +#define DMAR_IRTE2_SQ_RID_N21 (2ULL << (80 - 64)) +#define DMAR_IRTE2_SQ_RID_N210 (3ULL << (80 - 64)) +/* Source Identifier */ +#define DMAR_IRTE2_SID_RID(x) ((uint64_t)(x)) +#define DMAR_IRTE2_SID_BUS(start, end) ((((uint64_t)(start)) << 8) | (end)) +/* Destination Id */ +#define DMAR_IRTE1_DST_xAPIC(x) (((uint64_t)(x)) << 40) +#define DMAR_IRTE1_DST_x2APIC(x) (((uint64_t)(x)) << 32) +/* Vector */ +#define DMAR_IRTE1_V(x) (((uint64_t)x) << 16) +#define DMAR_IRTE1_IM_POSTED (1ULL << 15) /* Posted */ +/* Delivery Mode */ +#define DMAR_IRTE1_DLM_FM (0ULL << 5) +#define DMAR_IRTE1_DLM_LP (1ULL << 5 +#define DMAR_IRTE1_DLM_SMI (2ULL << 5) +#define DMAR_IRTE1_DLM_NMI (4ULL << 5) +#define DMAR_IRTE1_DLM_INIT (5ULL << 5) +#define DMAR_IRTE1_DLM_ExtINT (7ULL << 5) +/* Trigger Mode */ +#define DMAR_IRTE1_TM_EDGE (0ULL << 4) +#define DMAR_IRTE1_TM_LEVEL (1ULL << 4) +/* Redirection Hint */ +#define DMAR_IRTE1_RH_DIRECT (0ULL << 3) +#define DMAR_IRTE1_RH_SELECT (1ULL << 3) +/* Destination Mode */ +#define DMAR_IRTE1_DM_PHYSICAL (0ULL << 2) +#define DMAR_IRTE1_DM_LOGICAL (1ULL << 2) +#define DMAR_IRTE1_FPD (1ULL << 1) /* Fault Processing Disable */ +#define DMAR_IRTE1_P (1ULL) /* Present */ + /* Version register */ #define DMAR_VER_REG 0 #define DMAR_MAJOR_VER(x) (((x) >> 4) & 0xf) @@ -86,6 +127,8 @@ typedef struct dmar_pte { /* Capabilities register */ #define DMAR_CAP_REG 0x8 +#define DMAR_CAP_PI (1ULL << 59) /* Posted Interrupts */ +#define DMAR_CAP_FL1GP (1ULL << 56) /* First Level 1GByte Page */ #define DMAR_CAP_DRD (1ULL << 55) /* DMA Read Draining */ #define DMAR_CAP_DWD (1ULL << 54) /* DMA Write Draining */ #define DMAR_CAP_MAMV(x) ((u_int)(((x) >> 48) & 0x3f)) @@ -120,6 +163,17 @@ typedef struct dmar_pte { /* Extended Capabilities register */ #define DMAR_ECAP_REG 0x10 +#define DMAR_ECAP_PSS(x) (((x) >> 35) & 0xf) /* PASID Size Supported */ +#define DMAR_ECAP_EAFS (1ULL << 34) /* Extended Accessed Flag */ +#define DMAR_ECAP_NWFS (1ULL << 33) /* No Write Flag */ +#define DMAR_ECAP_SRS (1ULL << 31) /* Supervisor Request */ +#define DMAR_ECAP_ERS (1ULL << 30) /* Execute Request */ +#define DMAR_ECAP_PRS (1ULL << 29) /* Page Request */ +#define DMAR_ECAP_PASID (1ULL << 28) /* Process Address Space Id */ +#define DMAR_ECAP_DIS (1ULL << 27) /* Deferred Invalidate */ +#define DMAR_ECAP_NEST (1ULL << 26) /* Nested Translation */ +#define DMAR_ECAP_MTS (1ULL << 25) /* Memory Type */ +#define DMAR_ECAP_ECS (1ULL << 24) /* Extended Context */ #define DMAR_ECAP_MHMV(x) ((u_int)(((x) >> 20) & 0xf)) /* Maximum Handle Mask Value */ #define DMAR_ECAP_IRO(x) ((u_int)(((x) >> 8) & 0x3ff)) @@ -283,6 +337,11 @@ typedef struct dmar_pte { #define DMAR_IQ_DESCR_IOTLB_DR (1 << 7) /* Drain Reads */ #define DMAR_IQ_DESCR_IOTLB_DID(x) (((uint32_t)(x)) << 16) /* Domain Id */ +#define DMAR_IQ_DESCR_IEC_INV 0x4 /* Invalidate Interrupt Entry Cache */ +#define DMAR_IQ_DESCR_IEC_IDX (1 << 4) /* Index-Selective Invalidation */ +#define DMAR_IQ_DESCR_IEC_IIDX(x) (((uint64_t)x) << 32) /* Interrupt Index */ +#define DMAR_IQ_DESCR_IEC_IM(x) ((x) << 27) /* Index Mask */ + #define DMAR_IQ_DESCR_WAIT_ID 0x5 /* Invalidation Wait Descriptor */ #define DMAR_IQ_DESCR_WAIT_IF (1 << 4) /* Interrupt Flag */ #define DMAR_IQ_DESCR_WAIT_SW (1 << 5) /* Status Write */ @@ -326,5 +385,8 @@ typedef struct dmar_pte { /* Interrupt Remapping Table Address register */ #define DMAR_IRTA_REG 0xb8 +#define DMAR_IRTA_EIME (1 << 11) /* Extended Interrupt Mode + Enable */ +#define DMAR_IRTA_S_MASK 0xf /* Size Mask */ #endif From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 00:17:15 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69F5AEE2; Thu, 12 Feb 2015 00:17: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54A732E1; Thu, 12 Feb 2015 00:17:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1C0HFuS011951; Thu, 12 Feb 2015 00:17:15 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1C0HF0b011950; Thu, 12 Feb 2015 00:17:15 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502120017.t1C0HF0b011950@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 12 Feb 2015 00:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278607 - head/usr.bin/svn/svn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 00:17:15 -0000 Author: gjb Date: Thu Feb 12 00:17:14 2015 New Revision: 278607 URL: https://svnweb.freebsd.org/changeset/base/278607 Log: Reduce number of lines to set ORGANIZATION_NAME in freebsd-organization.h. Patched by: ian PR: 197540 MFC after: 3 days X-MFC-with: r278603 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/svn/svn/Makefile Modified: head/usr.bin/svn/svn/Makefile ============================================================================== --- head/usr.bin/svn/svn/Makefile Wed Feb 11 23:30:46 2015 (r278606) +++ head/usr.bin/svn/svn/Makefile Thu Feb 12 00:17:14 2015 (r278607) @@ -54,13 +54,8 @@ DPSRCS+= freebsd-organization.h CLEANFILES+= freebsd-organization.h CFLAGS+= -I. -DHAS_ORGANIZATION_NAME freebsd-organization.h: - @echo '#define ORGANIZATION_NAME ${ORGANIZATION}' \ + @echo "#define ORGANIZATION_NAME \"$$(eval echo ${ORGANIZATION})\"" \ > freebsd-organization.h - @# Remove quotes from ORGANIZATION_NAME if they exist. - @sed -i '' -e 's,",,g' freebsd-organization.h - @# Quote ORGANIZATION_NAME, in case it is two or more words. - @sed -i '' -E 's, , ",' freebsd-organization.h - @sed -i '' -E 's,$$,",' freebsd-organization.h .endif svnlite.1: svn.1 From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 02:08:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 626D653C; Thu, 12 Feb 2015 02:08: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C538F57; Thu, 12 Feb 2015 02:08:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1C28kuN063375; Thu, 12 Feb 2015 02:08:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1C28jbv063367; Thu, 12 Feb 2015 02:08:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201502120208.t1C28jbv063367@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Feb 2015 02:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278611 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 02:08:46 -0000 Author: emaste Date: Thu Feb 12 02:08:44 2015 New Revision: 278611 URL: https://svnweb.freebsd.org/changeset/base/278611 Log: libdwarf: Handle .rel relocations Some architectures use .rel relocations (for debug data), so they must be handled. This was discovered from ctfconvert on ARM object files. The lack of relocation handling caused all string lookups to return the string at offset 0 in .debug_str, typically "FreeBSD clang version ..." Reviewed by: gnn, imp, rpaulo (earlier version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1819 Modified: head/contrib/elftoolchain/libdwarf/_libdwarf.h head/contrib/elftoolchain/libdwarf/dwarf_reloc.c head/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 head/contrib/elftoolchain/libdwarf/libdwarf.c head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Modified: head/contrib/elftoolchain/libdwarf/_libdwarf.h ============================================================================== --- head/contrib/elftoolchain/libdwarf/_libdwarf.h Thu Feb 12 00:50:54 2015 (r278610) +++ head/contrib/elftoolchain/libdwarf/_libdwarf.h Thu Feb 12 02:08:44 2015 (r278611) @@ -49,7 +49,7 @@ struct _libdwarf_globals { Dwarf_Handler errhand; Dwarf_Ptr errarg; - int applyrela; + int applyreloc; }; extern struct _libdwarf_globals _libdwarf; Modified: head/contrib/elftoolchain/libdwarf/dwarf_reloc.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_reloc.c Thu Feb 12 00:50:54 2015 (r278610) +++ head/contrib/elftoolchain/libdwarf/dwarf_reloc.c Thu Feb 12 02:08:44 2015 (r278611) @@ -33,8 +33,8 @@ dwarf_set_reloc_application(int apply) { int oldapply; - oldapply = _libdwarf.applyrela; - _libdwarf.applyrela = apply; + oldapply = _libdwarf.applyreloc; + _libdwarf.applyreloc = apply; return (oldapply); } Modified: head/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 Thu Feb 12 00:50:54 2015 (r278610) +++ head/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 Thu Feb 12 02:08:44 2015 (r278611) @@ -24,7 +24,7 @@ .\" .\" $Id: dwarf_set_reloc_application.3 2075 2011-10-27 03:47:28Z jkoshy $ .\" -.Dd June 26, 2011 +.Dd February 11, 2015 .Os .Dt DWARF_SET_RELOC_APPLICATION 3 .Sh NAME @@ -47,6 +47,8 @@ handled by the DWARF(3) library. If the argument .Ar apply holds a non-zero value, the library will process all the relevant +.Dq ".rel" +and .Dq ".rela" relocation sections and will apply the relocation records found to their corresponding DWARF sections. Modified: head/contrib/elftoolchain/libdwarf/libdwarf.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf.c Thu Feb 12 00:50:54 2015 (r278610) +++ head/contrib/elftoolchain/libdwarf/libdwarf.c Thu Feb 12 02:08:44 2015 (r278611) @@ -31,5 +31,5 @@ ELFTC_VCSID("$Id: libdwarf.c 2070 2011-1 struct _libdwarf_globals _libdwarf = { .errhand = NULL, .errarg = NULL, - .applyrela = 1 + .applyreloc = 1 }; Modified: head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Thu Feb 12 00:50:54 2015 (r278610) +++ head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Thu Feb 12 02:08:44 2015 (r278611) @@ -50,36 +50,46 @@ static const char *debug_name[] = { }; static void -_dwarf_elf_apply_reloc(Dwarf_Debug dbg, void *buf, Elf_Data *rel_data, - Elf_Data *symtab_data, int endian) +_dwarf_elf_write_reloc(Dwarf_Debug dbg, Elf_Data *symtab_data, int endian, + void *buf, uint64_t offset, GElf_Xword r_info, GElf_Sxword r_addend) { - Dwarf_Unsigned type; - GElf_Rela rela; GElf_Sym sym; - size_t symndx; - uint64_t offset; - int size, j; + int size; + + if (gelf_getsym(symtab_data, GELF_R_SYM(r_info), &sym) == NULL) + return; + if ((size = _dwarf_get_reloc_size(dbg, GELF_R_TYPE(r_info))) == 0) + return; /* Unknown or non-absolute relocation. */ + if (endian == ELFDATA2MSB) + _dwarf_write_msb(buf, &offset, sym.st_value + r_addend, size); + else + _dwarf_write_lsb(buf, &offset, sym.st_value + r_addend, size); +} + +static void +_dwarf_elf_apply_rel_reloc(Dwarf_Debug dbg, void *buf, Elf_Data *rel_data, + Elf_Data *symtab_data, int endian) +{ + GElf_Rel rel; + int j; j = 0; - while (gelf_getrela(rel_data, j++, &rela) != NULL) { - symndx = GELF_R_SYM(rela.r_info); - type = GELF_R_TYPE(rela.r_info); + while (gelf_getrel(rel_data, j++, &rel) != NULL) + _dwarf_elf_write_reloc(dbg, symtab_data, endian, buf, + rel.r_offset, rel.r_info, 0); +} - if (gelf_getsym(symtab_data, symndx, &sym) == NULL) - continue; +static void +_dwarf_elf_apply_rela_reloc(Dwarf_Debug dbg, void *buf, Elf_Data *rel_data, + Elf_Data *symtab_data, int endian) +{ + GElf_Rela rela; + int j; - offset = rela.r_offset; - size = _dwarf_get_reloc_size(dbg, type); - if (size == 0) - continue; /* Unknown or non-absolute relocation. */ - - if (endian == ELFDATA2MSB) - _dwarf_write_msb(buf, &offset, - sym.st_value + rela.r_addend, size); - else - _dwarf_write_lsb(buf, &offset, - sym.st_value + rela.r_addend, size); - } + j = 0; + while (gelf_getrela(rel_data, j++, &rela) != NULL) + _dwarf_elf_write_reloc(dbg, symtab_data, endian, buf, + rela.r_offset, rela.r_info, rela.r_addend); } static int @@ -108,7 +118,8 @@ _dwarf_elf_relocate(Dwarf_Debug dbg, Elf return (DW_DLE_ELF); } - if (sh.sh_type != SHT_RELA || sh.sh_size == 0) + if ((sh.sh_type != SHT_REL && sh.sh_type != SHT_RELA) || + sh.sh_size == 0) continue; if (sh.sh_info == shndx && sh.sh_link == symtab) { @@ -129,8 +140,12 @@ _dwarf_elf_relocate(Dwarf_Debug dbg, Elf } memcpy(ed->ed_alloc, ed->ed_data->d_buf, ed->ed_data->d_size); - _dwarf_elf_apply_reloc(dbg, ed->ed_alloc, rel, - symtab_data, eh.e_ident[EI_DATA]); + if (sh.sh_type == SHT_REL) + _dwarf_elf_apply_rel_reloc(dbg, ed->ed_alloc, + rel, symtab_data, eh.e_ident[EI_DATA]); + else + _dwarf_elf_apply_rela_reloc(dbg, ed->ed_alloc, + rel, symtab_data, eh.e_ident[EI_DATA]); return (DW_DLE_NONE); } @@ -286,7 +301,7 @@ _dwarf_elf_init(Dwarf_Debug dbg, Elf *el } } - if (_libdwarf.applyrela) { + if (_libdwarf.applyreloc) { if (_dwarf_elf_relocate(dbg, elf, &e->eo_data[j], elf_ndxscn(scn), symtab_ndx, symtab_data, error) != DW_DLE_NONE) From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 04:31:18 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87E769FE; Thu, 12 Feb 2015 04:31: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 594D61EC; Thu, 12 Feb 2015 04:31:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1C4VIm3031287; Thu, 12 Feb 2015 04:31:18 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1C4VIVD031286; Thu, 12 Feb 2015 04:31:18 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201502120431.t1C4VIVD031286@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 12 Feb 2015 04:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278615 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 04:31:18 -0000 Author: gonzo Date: Thu Feb 12 04:31:17 2015 New Revision: 278615 URL: https://svnweb.freebsd.org/changeset/base/278615 Log: - Perform bus_dmamap_sync on pagelist structure - Wire pages of bulk transfer buffer when preparing pagelist Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Thu Feb 12 04:15:55 2015 (r278614) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Thu Feb 12 04:31:17 2015 (r278615) @@ -353,6 +353,16 @@ vchiq_platform_handle_timeout(VCHIQ_STAT * Local functions */ +static void +pagelist_page_free(vm_page_t pp) +{ + vm_page_lock(pp); + vm_page_unwire(pp, PQ_INACTIVE); + if (pp->wire_count == 0 && pp->object == NULL) + vm_page_free(pp); + vm_page_unlock(pp); +} + /* There is a potential problem with partial cache lines (pages?) ** at the ends of the block when reading. If the CPU accessed anything in ** the same line (page?) then it may have pulled old data into the cache, @@ -406,8 +416,6 @@ create_pagelist(char __user *buf, size_t NULL, NULL, /* lockfunc, lockarg */ &bi->pagelist_dma_tag); - - err = bus_dmamem_alloc(bi->pagelist_dma_tag, (void **)&pagelist, BUS_DMA_COHERENT | BUS_DMA_WAITOK, &bi->pagelist_dma_map); if (err) { @@ -444,6 +452,13 @@ create_pagelist(char __user *buf, size_t return (-ENOMEM); } + for (i = 0; i < actual_pages; i++) { + vm_page_lock(pages[i]); + vm_page_wire(pages[i]); + vm_page_unhold(pages[i]); + vm_page_unlock(pages[i]); + } + pagelist->length = count; pagelist->type = type; pagelist->offset = offset; @@ -496,9 +511,10 @@ create_pagelist(char __user *buf, size_t g_fragments_base); } - /* XXX: optimize? INV operation for read WBINV for write? */ cpu_dcache_wbinv_range((vm_offset_t)buf, count); + bus_dmamap_sync(bi->pagelist_dma_tag, bi->pagelist_dma_map, BUS_DMASYNC_PREWRITE); + bi->pagelist = pagelist; return 0; @@ -563,12 +579,12 @@ free_pagelist(BULKINFO_T *bi, int actual } for (i = 0; i < num_pages; i++) { - if (pagelist->type != PAGELIST_WRITE) + if (pagelist->type != PAGELIST_WRITE) { vm_page_dirty(pages[i]); + pagelist_page_free(pages[i]); + } } - vm_page_unhold_pages(pages, num_pages); - bus_dmamap_unload(bi->pagelist_dma_tag, bi->pagelist_dma_map); bus_dmamem_free(bi->pagelist_dma_tag, bi->pagelist, bi->pagelist_dma_map); bus_dmamap_destroy(bi->pagelist_dma_tag, bi->pagelist_dma_map); From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 05:35:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5AD4572; Thu, 12 Feb 2015 05:35: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D53E9CB; Thu, 12 Feb 2015 05:35:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1C5Z9xT062039; Thu, 12 Feb 2015 05:35:09 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1C5Z0el061979; Thu, 12 Feb 2015 05:35:00 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201502120535.t1C5Z0el061979@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Thu, 12 Feb 2015 05:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278616 - in head: . contrib/netbsd-tests/games etc etc/mtree etc/root games games/caesar games/fortune/datfiles release/scripts share/man/man4 share/man/man6 share/man/man7 share/mk sh... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 05:35:09 -0000 Author: cperciva Date: Thu Feb 12 05:35:00 2015 New Revision: 278616 URL: https://svnweb.freebsd.org/changeset/base/278616 Log: Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin; update paths; and include everything in the "base" distribution. The "games" distribution being optional made sense when there were more games and we had small disks; but the "games-like" games were moved into the ports tree a dozen years ago and the remaining "utility-like" games occupy less than 0.001% of my laptop's small hard drive. Meanwhile every new user is confronted by the question "do you want games installed" when they they try to install FreeBSD. The next steps will be: 2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor, morse, number, primes, and random, since there is evidence that those are still being used. 3. Merging src/games into src/usr.bin. This change will not be MFCed. Reviewed by: jmg Discussed at: EuroBSDCon Approved by: gjb (release-affecting changes) Modified: head/Makefile.inc1 head/ObsoleteFiles.inc head/contrib/netbsd-tests/games/t_factor.sh head/etc/login.conf head/etc/master.passwd head/etc/mtree/BSD.debug.dist head/etc/mtree/BSD.usr.dist head/etc/root/dot.cshrc head/etc/root/dot.login head/etc/root/dot.profile head/games/Makefile.inc head/games/caesar/rot13.sh head/games/fortune/datfiles/Makefile head/release/scripts/make-manifest.sh head/share/man/man4/led.4 head/share/man/man6/intro.6 head/share/man/man7/hier.7 head/share/mk/bsd.prog.mk head/share/skel/dot.cshrc head/share/skel/dot.login head/share/skel/dot.profile head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/tools/nanobsd/gateworks/Files/root/.profile head/tools/tools/nanobsd/pcengines/Files/root/.cshrc head/tools/tools/nanobsd/pcengines/Files/root/.login head/tools/tools/nanobsd/rescue/Files/root/.cshrc head/usr.bin/whereis/pathnames.h head/usr.bin/whereis/whereis.1 head/usr.bin/whereis/whereis.c head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Feb 12 04:31:17 2015 (r278615) +++ head/Makefile.inc1 Thu Feb 12 05:35:00 2015 (r278616) @@ -189,9 +189,8 @@ OBJTREE= ${MAKEOBJDIRPREFIX} OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} .endif WORLDTMP= ${OBJTREE}${.CURDIR}/tmp -# /usr/games added for fortune which depend on strfile -BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games:${WORLDTMP}/legacy/bin -XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games +BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin +XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin STRICTTMPPATH= ${BPATH}:${XPATH} TMPPATH= ${STRICTTMPPATH}:${PATH} @@ -807,9 +806,6 @@ ITOOLS+=makewhatis # Non-base distributions produced by the base system EXTRA_DISTRIBUTIONS= doc -.if ${MK_GAMES} != "no" -EXTRA_DISTRIBUTIONS+= games -.endif .if defined(LIB32TMP) && ${MK_LIB32} != "no" EXTRA_DISTRIBUTIONS+= lib32 .endif Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Feb 12 04:31:17 2015 (r278615) +++ head/ObsoleteFiles.inc Thu Feb 12 05:35:00 2015 (r278616) @@ -38,6 +38,22 @@ # xargs -n1 | sort | uniq -d; # done +# 20150212: /usr/games moving into /usr/bin +OLD_FILES+=usr/games/bcd +OLD_FILES+=usr/games/caesar +OLD_FILES+=usr/games/factor +OLD_FILES+=usr/games/fortune +OLD_FILES+=usr/games/grdc +OLD_FILES+=usr/games/morse +OLD_FILES+=usr/games/number +OLD_FILES+=usr/games/pom +OLD_FILES+=usr/games/ppt +OLD_FILES+=usr/games/primes +OLD_FILES+=usr/games/random +OLD_FILES+=usr/games/rot13 +OLD_FILES+=usr/games/strfile +OLD_FILES+=usr/games/unstr +OLD_DIRS+=usr/games # 20150209: liblzma header OLD_FILES+=usr/include/lzma/lzma.h # 20150124: spl.9 and friends Modified: head/contrib/netbsd-tests/games/t_factor.sh ============================================================================== --- head/contrib/netbsd-tests/games/t_factor.sh Thu Feb 12 04:31:17 2015 (r278615) +++ head/contrib/netbsd-tests/games/t_factor.sh Thu Feb 12 05:35:00 2015 (r278616) @@ -27,13 +27,13 @@ expect() { echo "${2}" >expout - atf_check -s eq:0 -o file:expout -e empty /usr/games/factor ${1} + atf_check -s eq:0 -o file:expout -e empty /usr/bin/factor ${1} } atf_test_case overflow overflow_head() { atf_set "descr" "Tests for overflow conditions" - atf_set "require.progs" "/usr/games/factor" + atf_set "require.progs" "/usr/bin/factor" } overflow_body() { expect '8675309' '8675309: 8675309' @@ -44,7 +44,7 @@ atf_test_case loop loop_head() { atf_set "descr" "Tests some cases that once locked the program" \ "in an infinite loop" - atf_set "require.progs" "/usr/games/factor" + atf_set "require.progs" "/usr/bin/factor" } loop_body() { expect '99999999999991' '99999999999991: 7 13 769231 1428571' Modified: head/etc/login.conf ============================================================================== --- head/etc/login.conf Thu Feb 12 04:31:17 2015 (r278615) +++ head/etc/login.conf Thu Feb 12 05:35:00 2015 (r278616) @@ -27,7 +27,7 @@ default:\ :copyright=/etc/COPYRIGHT:\ :welcome=/etc/motd:\ :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ - :path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\ + :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\ :nologin=/var/run/nologin:\ :cputime=unlimited:\ :datasize=unlimited:\ Modified: head/etc/master.passwd ============================================================================== --- head/etc/master.passwd Thu Feb 12 04:31:17 2015 (r278615) +++ head/etc/master.passwd Thu Feb 12 05:35:00 2015 (r278616) @@ -7,7 +7,7 @@ operator:*:2:5::0:0:System &:/:/usr/sbin bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin -games:*:7:13::0:0:Games pseudo-user:/usr/games:/usr/sbin/nologin +games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin Modified: head/etc/mtree/BSD.debug.dist ============================================================================== --- head/etc/mtree/BSD.debug.dist Thu Feb 12 04:31:17 2015 (r278615) +++ head/etc/mtree/BSD.debug.dist Thu Feb 12 05:35:00 2015 (r278616) @@ -21,8 +21,6 @@ usr bin .. - games - .. lib clang 3.5.1 Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Feb 12 04:31:17 2015 (r278615) +++ head/etc/mtree/BSD.usr.dist Thu Feb 12 05:35:00 2015 (r278616) @@ -7,8 +7,6 @@ . bin .. - games - .. include .. lib Modified: head/etc/root/dot.cshrc ============================================================================== --- head/etc/root/dot.cshrc Thu Feb 12 04:31:17 2015 (r278615) +++ head/etc/root/dot.cshrc Thu Feb 12 05:35:00 2015 (r278616) @@ -15,7 +15,7 @@ alias ll ls -lAF # A righteous umask umask 22 -set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) +set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi setenv PAGER more Modified: head/etc/root/dot.login ============================================================================== --- head/etc/root/dot.login Thu Feb 12 04:31:17 2015 (r278615) +++ head/etc/root/dot.login Thu Feb 12 05:35:00 2015 (r278616) @@ -6,4 +6,4 @@ # # Uncomment to display a random cookie each login: -# if ( -x /usr/games/fortune ) /usr/games/fortune -s +# if ( -x /usr/bin/fortune ) /usr/bin/fortune -s Modified: head/etc/root/dot.profile ============================================================================== --- head/etc/root/dot.profile Thu Feb 12 04:31:17 2015 (r278615) +++ head/etc/root/dot.profile Thu Feb 12 05:35:00 2015 (r278616) @@ -1,6 +1,6 @@ # $FreeBSD$ # -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin export PATH HOME=/root export HOME Modified: head/games/Makefile.inc ============================================================================== --- head/games/Makefile.inc Thu Feb 12 04:31:17 2015 (r278615) +++ head/games/Makefile.inc Thu Feb 12 05:35:00 2015 (r278616) @@ -1,7 +1,6 @@ # @(#)Makefile.inc 8.1 (Berkeley) 5/31/93 # $FreeBSD$ -BINDIR?= /usr/games +BINDIR?= /usr/bin FILESDIR?= ${SHAREDIR}/games WARNS?= 6 -DISTRIBUTION?= games Modified: head/games/caesar/rot13.sh ============================================================================== --- head/games/caesar/rot13.sh Thu Feb 12 04:31:17 2015 (r278615) +++ head/games/caesar/rot13.sh Thu Feb 12 05:35:00 2015 (r278616) @@ -30,4 +30,4 @@ # @(#)rot13.sh 8.1 (Berkeley) 5/31/93 # $FreeBSD$ -exec /usr/games/caesar 13 "$@" +exec /usr/bin/caesar 13 "$@" Modified: head/games/fortune/datfiles/Makefile ============================================================================== --- head/games/fortune/datfiles/Makefile Thu Feb 12 04:31:17 2015 (r278615) +++ head/games/fortune/datfiles/Makefile Thu Feb 12 05:35:00 2015 (r278616) @@ -15,7 +15,7 @@ FILESDIR= ${SHAREDIR}/games/fortune .for f in ${DB} $f.dat: $f - PATH=$$PATH:/usr/games:${.OBJDIR}/../strfile \ + PATH=$$PATH:/usr/bin:${.OBJDIR}/../strfile \ strfile -Cs ${.ALLSRC} ${.TARGET} .endfor Modified: head/release/scripts/make-manifest.sh ============================================================================== --- head/release/scripts/make-manifest.sh Thu Feb 12 04:31:17 2015 (r278615) +++ head/release/scripts/make-manifest.sh Thu Feb 12 05:35:00 2015 (r278616) @@ -13,7 +13,6 @@ desc_base="Base system (MANDATORY)" desc_kernel="Kernel (MANDATORY)" desc_doc="Additional documentation" doc_default=off -desc_games="Games (fortune, etc.)" desc_lib32="32-bit compatibility libraries" desc_ports="Ports tree" desc_src="System source code" Modified: head/share/man/man4/led.4 ============================================================================== --- head/share/man/man4/led.4 Thu Feb 12 04:31:17 2015 (r278615) +++ head/share/man/man4/led.4 Thu Feb 12 05:35:00 2015 (r278616) @@ -170,7 +170,7 @@ flashes .Pp .Dl *_*__**_ .Bd -literal -/usr/games/morse -l "Soekris rocks" > /dev/led/error +/usr/bin/morse -l "Soekris rocks" > /dev/led/error .Ed .Sh SEE ALSO .Xr morse 6 Modified: head/share/man/man6/intro.6 ============================================================================== --- head/share/man/man6/intro.6 Thu Feb 12 04:31:17 2015 (r278615) +++ head/share/man/man6/intro.6 Thu Feb 12 05:35:00 2015 (r278616) @@ -37,7 +37,7 @@ This section contains information about games. The games are located in -.Pa /usr/games +.Pa /usr/bin if installed. You can get a short overview about all the games with the command: @@ -45,13 +45,18 @@ command: $ apropos '\\(6\\)' .Ed .Sh FILES -.Bl -tag -width /usr/games -compact -.It Pa /usr/games +.Bl -tag -width /usr/bin -compact +.It Pa /usr/bin location of games .El .Sh SEE ALSO .Xr intro 1 .Sh HISTORY +In earlier versions of +.Fx , +games were located in +.Pa /usr/games . +.Pp The .Nm section manual page appeared in Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Thu Feb 12 04:31:17 2015 (r278615) +++ head/share/man/man7/hier.7 Thu Feb 12 05:35:00 2015 (r278616) @@ -187,8 +187,6 @@ common utilities, programming tools, and .It Pa compat/ files needed to support binary compatibility with other operating systems, such as Linux -.It Pa games/ -useful and semi-frivolous programs .It Pa include/ standard C include files .Pp Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Thu Feb 12 04:31:17 2015 (r278615) +++ head/share/mk/bsd.prog.mk Thu Feb 12 05:35:00 2015 (r278616) @@ -62,7 +62,7 @@ PROG_FULL=${PROG}.full ${BINDIR} == "/bin" ||\ ${BINDIR} == "/libexec" ||\ ${BINDIR} == "/sbin" ||\ - ${BINDIR:C%/usr/(bin|bsdinstall|games|libexec|lpr|sendmail|sm.bin|sbin)(/.*)?%/usr/bin%} == "/usr/bin"\ + ${BINDIR:C%/usr/(bin|bsdinstall|libexec|lpr|sendmail|sm.bin|sbin)(/.*)?%/usr/bin%} == "/usr/bin"\ ) DEBUGFILEDIR= ${DEBUGDIR}${BINDIR} .else Modified: head/share/skel/dot.cshrc ============================================================================== --- head/share/skel/dot.cshrc Thu Feb 12 04:31:17 2015 (r278615) +++ head/share/skel/dot.cshrc Thu Feb 12 05:35:00 2015 (r278616) @@ -14,7 +14,7 @@ alias ll ls -lAF # These are normally set through /etc/login.conf. You may override them here # if wanted. -# set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) +# set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) # setenv BLOCKSIZE K # A righteous umask # umask 22 Modified: head/share/skel/dot.login ============================================================================== --- head/share/skel/dot.login Thu Feb 12 04:31:17 2015 (r278615) +++ head/share/skel/dot.login Thu Feb 12 05:35:00 2015 (r278616) @@ -5,4 +5,4 @@ # see also csh(1), environ(7). # -if ( -x /usr/games/fortune ) /usr/games/fortune freebsd-tips +if ( -x /usr/bin/fortune ) /usr/bin/fortune freebsd-tips Modified: head/share/skel/dot.profile ============================================================================== --- head/share/skel/dot.profile Thu Feb 12 04:31:17 2015 (r278615) +++ head/share/skel/dot.profile Thu Feb 12 05:35:00 2015 (r278616) @@ -7,7 +7,7 @@ # These are normally set through /etc/login.conf. You may override them here # if wanted. -# PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH +# PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH # BLOCKSIZE=K; export BLOCKSIZE # Setting TERM is normally done through /etc/ttys. Do only override @@ -21,4 +21,4 @@ PAGER=more; export PAGER # set ENV to a file invoked each time sh is started for interactive use. ENV=$HOME/.shrc; export ENV -if [ -x /usr/games/fortune ] ; then /usr/games/fortune freebsd-tips ; fi +if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune freebsd-tips ; fi Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 12 04:31:17 2015 (r278615) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 12 05:35:00 2015 (r278616) @@ -1606,21 +1606,20 @@ OLD_FILES+=usr/share/man/man8/freebsd-up .endif .if ${MK_GAMES} == no -OLD_FILES+=usr/games/bcd -OLD_FILES+=usr/games/caesar -OLD_FILES+=usr/games/factor -OLD_FILES+=usr/games/fortune -OLD_FILES+=usr/games/grdc -OLD_FILES+=usr/games/morse -OLD_FILES+=usr/games/number -OLD_FILES+=usr/games/pom -OLD_FILES+=usr/games/ppt -OLD_FILES+=usr/games/primes -OLD_FILES+=usr/games/random -OLD_FILES+=usr/games/rot13 -OLD_FILES+=usr/games/strfile -OLD_FILES+=usr/games/unstr -OLD_DIRS+=usr/games +OLD_FILES+=usr/bin/bcd +OLD_FILES+=usr/bin/caesar +OLD_FILES+=usr/bin/factor +OLD_FILES+=usr/bin/fortune +OLD_FILES+=usr/bin/grdc +OLD_FILES+=usr/bin/morse +OLD_FILES+=usr/bin/number +OLD_FILES+=usr/bin/pom +OLD_FILES+=usr/bin/ppt +OLD_FILES+=usr/bin/primes +OLD_FILES+=usr/bin/random +OLD_FILES+=usr/bin/rot13 +OLD_FILES+=usr/bin/strfile +OLD_FILES+=usr/bin/unstr OLD_FILES+=usr/share/games/fortune/fortunes OLD_FILES+=usr/share/games/fortune/fortunes.dat OLD_FILES+=usr/share/games/fortune/freebsd-tips Modified: head/tools/tools/nanobsd/gateworks/Files/root/.profile ============================================================================== --- head/tools/tools/nanobsd/gateworks/Files/root/.profile Thu Feb 12 04:31:17 2015 (r278615) +++ head/tools/tools/nanobsd/gateworks/Files/root/.profile Thu Feb 12 05:35:00 2015 (r278616) @@ -1,6 +1,6 @@ # $FreeBSD: src/etc/root/dot.profile,v 1.21 2007/05/29 06:33:10 dougb Exp $ # -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin export PATH HOME=/root; export HOME TERM=${TERM:-xterm}; export TERM Modified: head/tools/tools/nanobsd/pcengines/Files/root/.cshrc ============================================================================== --- head/tools/tools/nanobsd/pcengines/Files/root/.cshrc Thu Feb 12 04:31:17 2015 (r278615) +++ head/tools/tools/nanobsd/pcengines/Files/root/.cshrc Thu Feb 12 05:35:00 2015 (r278616) @@ -14,7 +14,7 @@ alias ll ls -lA # A righteous umask umask 22 -set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) +set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi setenv PAGER more Modified: head/tools/tools/nanobsd/pcengines/Files/root/.login ============================================================================== --- head/tools/tools/nanobsd/pcengines/Files/root/.login Thu Feb 12 04:31:17 2015 (r278615) +++ head/tools/tools/nanobsd/pcengines/Files/root/.login Thu Feb 12 05:35:00 2015 (r278616) @@ -6,4 +6,4 @@ # # Uncomment to display a random cookie each login: -# [ -x /usr/games/fortune ] && /usr/games/fortune -s +# [ -x /usr/bin/fortune ] && /usr/bin/fortune -s Modified: head/tools/tools/nanobsd/rescue/Files/root/.cshrc ============================================================================== --- head/tools/tools/nanobsd/rescue/Files/root/.cshrc Thu Feb 12 04:31:17 2015 (r278615) +++ head/tools/tools/nanobsd/rescue/Files/root/.cshrc Thu Feb 12 05:35:00 2015 (r278616) @@ -11,7 +11,7 @@ a lm 'll | more' a m more -set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin /usr/local/jdk1.6.0/bin /usr/local/jdk1.5.0/bin $HOME/bin) +set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/X11R6/bin /usr/local/jdk1.6.0/bin /usr/local/jdk1.5.0/bin $HOME/bin) setenv MANPATH "/usr/share/man:/usr/X11R6/man:/usr/local/man" setenv PAGER more Modified: head/usr.bin/whereis/pathnames.h ============================================================================== --- head/usr.bin/whereis/pathnames.h Thu Feb 12 04:31:17 2015 (r278615) +++ head/usr.bin/whereis/pathnames.h Thu Feb 12 05:35:00 2015 (r278616) @@ -25,9 +25,8 @@ * $FreeBSD$ */ -/* Where to look for libexec and games */ +/* Where to look for libexec */ #define PATH_LIBEXEC "/usr/libexec" -#define PATH_GAMES "/usr/games" /* Where to look for sources. */ #define PATH_SOURCES \ Modified: head/usr.bin/whereis/whereis.1 ============================================================================== --- head/usr.bin/whereis/whereis.1 Thu Feb 12 04:31:17 2015 (r278615) +++ head/usr.bin/whereis/whereis.1 Thu Feb 12 05:35:00 2015 (r278616) @@ -65,8 +65,7 @@ The default path searched is the string utility for the .Dq user.cs_path string, with -.Pa /usr/libexec , -.Pa /usr/games +.Pa /usr/libexec and the current user's .Ev $PATH appended. Modified: head/usr.bin/whereis/whereis.c ============================================================================== --- head/usr.bin/whereis/whereis.c Thu Feb 12 04:31:17 2015 (r278615) +++ head/usr.bin/whereis/whereis.c Thu Feb 12 05:35:00 2015 (r278616) @@ -265,7 +265,7 @@ defaults(void) opt_b = opt_m = opt_s = 1; /* -b defaults to default path + /usr/libexec + - * /usr/games + user's path */ + * user's path */ if (!bindirs) { if (sysctlbyname("user.cs_path", (void *)NULL, &s, (void *)NULL, 0) == -1) @@ -276,11 +276,10 @@ defaults(void) err(EX_OSERR, "sysctlbyname(\"user.cs_path\")"); nele = 0; decolonify(b, &bindirs, &nele); - bindirs = realloc(bindirs, (nele + 3) * sizeof(char *)); + bindirs = realloc(bindirs, (nele + 2) * sizeof(char *)); if (bindirs == NULL) abort(); bindirs[nele++] = PATH_LIBEXEC; - bindirs[nele++] = PATH_GAMES; bindirs[nele] = NULL; if ((cp = getenv("PATH")) != NULL) { /* don't destroy the original environment... */ Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Thu Feb 12 04:31:17 2015 (r278615) +++ head/usr.sbin/bsdconfig/include/messages.subr Thu Feb 12 05:35:00 2015 (r278616) @@ -138,7 +138,6 @@ msg_ftp="FTP" msg_ftp_desc="FTP client and server utilities." msg_ftp_passive="FTP Passive" msg_ftp_username="FTP username" -msg_games_desc="Various games and sundry amusements." msg_generating_index_from_pkg_database="Generating INDEX from pkg(8) database\n(this can take a while)..." msg_geography_desc="Geography-related software." msg_german_desc="Ported software for Germanic countries." Modified: head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Thu Feb 12 04:31:17 2015 (r278615) +++ head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Thu Feb 12 05:35:00 2015 (r278616) @@ -303,7 +303,7 @@ fetch_split_files() OUTFILE="${FSMNT}/.fetch-${INSFILE}" fi - DIRS="base catpages dict doc games info manpages proflibs kernels src" + DIRS="base catpages dict doc info manpages proflibs kernels src" if [ "${FBSD_ARCH}" = "amd64" ] then DIRS="${DIRS} lib32" From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 05:37:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 814F374F for ; Thu, 12 Feb 2015 05:37:20 +0000 (UTC) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32BDD9EB for ; Thu, 12 Feb 2015 05:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=from:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=PHjX0GZZQqbXaavng59I17somvQ=; b=hHZSc3xRpK5VORap73 C/fSTgzYkz6/0zzJQ6ZDLBEgMCIDPbPnd/H14AY73ltskrr61DCEwr5lw8CIqWEW F3u1A15NlwWRqdVU8W3b+tuAfKP5j66ttv2lMZ7hXT56pl65SG5oADYt6hrfEbSN a0Q1R9ZDPZaZy8VHAv7nNfJbo= Received: by filter0174p1mdw1.sendgrid.net with SMTP id filter0174p1mdw1.10306.54DC3C0CD 2015-02-12 05:37:18.577162013 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd-033 (SG) with ESMTP id 14b7c4a98b5.38c7.3a8b1c for ; Thu, 12 Feb 2015 05:37:18 +0000 (UTC) Received: (qmail 60460 invoked from network); 12 Feb 2015 05:36:21 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 12 Feb 2015 05:36:21 -0000 Received: (qmail 8312 invoked from network); 12 Feb 2015 05:35:53 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 12 Feb 2015 05:35:53 -0000 Message-ID: <54DC3BB9.1020202@freebsd.org> Date: Wed, 11 Feb 2015 21:35:53 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278616 - in head: . contrib/netbsd-tests/games etc etc/mtree etc/root games games/caesar games/fortune/datfiles release/scripts share/man/man4 share/man/man6 share/man/man7 share/mk sh... References: <201502120535.t1C5Z0el061979@svn.freebsd.org> In-Reply-To: <201502120535.t1C5Z0el061979@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SG-EID: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNFUe/q9yoNOWQ7B8ftHaFngzlrDP3O0rA9Yy5 jcqUJKOQ9/Yj/0qJvZrG6taUq/D6BBsIjFjgSwsB3b0AXjBS0ofuqDNJQsENQiwNid9kGImeynvLBm nbqz0HAGBWfmU3LS4L+Vadqwu8wNvnEUwrmE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 05:37:20 -0000 On 02/11/15 21:35, Colin Percival wrote: > 2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and > caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor, > morse, number, primes, and random, since there is evidence that those are > still being used. If anyone has a desperate need for punch card support and can't possibly install it from the ports tree, please email me *off-list*. I don't want to have too much of a crazy bikeshed discussion about this. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 06:17:14 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EE54B95; Thu, 12 Feb 2015 06:17:14 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 453F3D9B; Thu, 12 Feb 2015 06:17:14 +0000 (UTC) Received: from [64.201.244.132] (port=51305 helo=[10.0.0.105]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1YL84J-000JlW-2D; Tue, 10 Feb 2015 02:29:23 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r278616 - in head: . contrib/netbsd-tests/games etc etc/mtree etc/root games games/caesar games/fortune/datfiles release/scripts share/man/man4 share/man/man6 share/man/man7 share/mk sh... From: Devin Teske X-Mailer: iPhone Mail (12B440) In-Reply-To: <201502120535.t1C5Z0el061979@svn.freebsd.org> Date: Wed, 11 Feb 2015 22:17:05 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201502120535.t1C5Z0el061979@svn.freebsd.org> To: Colin Percival Cc: "svn-src-head@freebsd.org" , Devin Teske , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 06:17:14 -0000 PLEASE! Do NOT remove the grand digital clock (grdc). So many of us over the years have used it as a terminal keeper-aliver :) (an= d as a clock, to boot). I will be very sad if you remove grdc. --=20 Devin > On Feb 11, 2015, at 9:35 PM, Colin Percival wrote: >=20 > Author: cperciva > Date: Thu Feb 12 05:35:00 2015 > New Revision: 278616 > URL: https://svnweb.freebsd.org/changeset/base/278616 >=20 > Log: > Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin= ; > update paths; and include everything in the "base" distribution. >=20 > The "games" distribution being optional made sense when there were more > games and we had small disks; but the "games-like" games were moved into > the ports tree a dozen years ago and the remaining "utility-like" games > occupy less than 0.001% of my laptop's small hard drive. Meanwhile every= > new user is confronted by the question "do you want games installed" when= > they they try to install FreeBSD. >=20 > The next steps will be: >=20 > 2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and= > caesar cipher (caesar, rot13) utilities. I intend to keep fortune, facto= r, > morse, number, primes, and random, since there is evidence that those are= > still being used. >=20 > 3. Merging src/games into src/usr.bin. >=20 > This change will not be MFCed. >=20 > Reviewed by: jmg > Discussed at: EuroBSDCon > Approved by: gjb (release-affecting changes) >=20 > Modified: > head/Makefile.inc1 > head/ObsoleteFiles.inc > head/contrib/netbsd-tests/games/t_factor.sh > head/etc/login.conf > head/etc/master.passwd > head/etc/mtree/BSD.debug.dist > head/etc/mtree/BSD.usr.dist > head/etc/root/dot.cshrc > head/etc/root/dot.login > head/etc/root/dot.profile > head/games/Makefile.inc > head/games/caesar/rot13.sh > head/games/fortune/datfiles/Makefile > head/release/scripts/make-manifest.sh > head/share/man/man4/led.4 > head/share/man/man6/intro.6 > head/share/man/man7/hier.7 > head/share/mk/bsd.prog.mk > head/share/skel/dot.cshrc > head/share/skel/dot.login > head/share/skel/dot.profile > head/tools/build/mk/OptionalObsoleteFiles.inc > head/tools/tools/nanobsd/gateworks/Files/root/.profile > head/tools/tools/nanobsd/pcengines/Files/root/.cshrc > head/tools/tools/nanobsd/pcengines/Files/root/.login > head/tools/tools/nanobsd/rescue/Files/root/.cshrc > head/usr.bin/whereis/pathnames.h > head/usr.bin/whereis/whereis.1 > head/usr.bin/whereis/whereis.c > head/usr.sbin/bsdconfig/include/messages.subr > head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/Makefile.inc1 Thu Feb 12 04:31:17 2015 (r278615) > +++ head/Makefile.inc1 Thu Feb 12 05:35:00 2015 (r278616) > @@ -189,9 +189,8 @@ OBJTREE=3D ${MAKEOBJDIRPREFIX} > OBJTREE=3D ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} > .endif > WORLDTMP=3D ${OBJTREE}${.CURDIR}/tmp > -# /usr/games added for fortune which depend on strfile > -BPATH=3D ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${= WORLDTMP}/legacy/usr/games:${WORLDTMP}/legacy/bin > -XPATH=3D ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/= games > +BPATH=3D ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${= WORLDTMP}/legacy/bin > +XPATH=3D ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin > STRICTTMPPATH=3D ${BPATH}:${XPATH} > TMPPATH=3D ${STRICTTMPPATH}:${PATH} >=20 > @@ -807,9 +806,6 @@ ITOOLS+=3Dmakewhatis >=20 > # Non-base distributions produced by the base system > EXTRA_DISTRIBUTIONS=3D doc > -.if ${MK_GAMES} !=3D "no" > -EXTRA_DISTRIBUTIONS+=3D games > -.endif > .if defined(LIB32TMP) && ${MK_LIB32} !=3D "no" > EXTRA_DISTRIBUTIONS+=3D lib32 > .endif >=20 > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/ObsoleteFiles.inc Thu Feb 12 04:31:17 2015 (r278615) > +++ head/ObsoleteFiles.inc Thu Feb 12 05:35:00 2015 (r278616) > @@ -38,6 +38,22 @@ > # xargs -n1 | sort | uniq -d; > # done >=20 > +# 20150212: /usr/games moving into /usr/bin > +OLD_FILES+=3Dusr/games/bcd > +OLD_FILES+=3Dusr/games/caesar > +OLD_FILES+=3Dusr/games/factor > +OLD_FILES+=3Dusr/games/fortune > +OLD_FILES+=3Dusr/games/grdc > +OLD_FILES+=3Dusr/games/morse > +OLD_FILES+=3Dusr/games/number > +OLD_FILES+=3Dusr/games/pom > +OLD_FILES+=3Dusr/games/ppt > +OLD_FILES+=3Dusr/games/primes > +OLD_FILES+=3Dusr/games/random > +OLD_FILES+=3Dusr/games/rot13 > +OLD_FILES+=3Dusr/games/strfile > +OLD_FILES+=3Dusr/games/unstr > +OLD_DIRS+=3Dusr/games > # 20150209: liblzma header > OLD_FILES+=3Dusr/include/lzma/lzma.h > # 20150124: spl.9 and friends >=20 > Modified: head/contrib/netbsd-tests/games/t_factor.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/contrib/netbsd-tests/games/t_factor.sh Thu Feb 12 04:31:17 201= 5 (r278615) > +++ head/contrib/netbsd-tests/games/t_factor.sh Thu Feb 12 05:35:00 201= 5 (r278616) > @@ -27,13 +27,13 @@ >=20 > expect() { > echo "${2}" >expout > - atf_check -s eq:0 -o file:expout -e empty /usr/games/factor ${1} > + atf_check -s eq:0 -o file:expout -e empty /usr/bin/factor ${1} > } >=20 > atf_test_case overflow > overflow_head() { > atf_set "descr" "Tests for overflow conditions" > - atf_set "require.progs" "/usr/games/factor" > + atf_set "require.progs" "/usr/bin/factor" > } > overflow_body() { > expect '8675309' '8675309: 8675309' > @@ -44,7 +44,7 @@ atf_test_case loop > loop_head() { > atf_set "descr" "Tests some cases that once locked the program" \ > "in an infinite loop" > - atf_set "require.progs" "/usr/games/factor" > + atf_set "require.progs" "/usr/bin/factor" > } > loop_body() { > expect '99999999999991' '99999999999991: 7 13 769231 1428571' >=20 > Modified: head/etc/login.conf > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/etc/login.conf Thu Feb 12 04:31:17 2015 (r278615) > +++ head/etc/login.conf Thu Feb 12 05:35:00 2015 (r278616) > @@ -27,7 +27,7 @@ default:\ > :copyright=3D/etc/COPYRIGHT:\ > :welcome=3D/etc/motd:\ > :setenv=3DMAIL=3D/var/mail/$,BLOCKSIZE=3DK:\ > - :path=3D/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr= /local/bin ~/bin:\ > + :path=3D/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~= /bin:\ > :nologin=3D/var/run/nologin:\ > :cputime=3Dunlimited:\ > :datasize=3Dunlimited:\ >=20 > Modified: head/etc/master.passwd > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/etc/master.passwd Thu Feb 12 04:31:17 2015 (r278615) > +++ head/etc/master.passwd Thu Feb 12 05:35:00 2015 (r278616) > @@ -7,7 +7,7 @@ operator:*:2:5::0:0:System &:/:/usr/sbin > bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin > tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin > kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin > -games:*:7:13::0:0:Games pseudo-user:/usr/games:/usr/sbin/nologin > +games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin > news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin > man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin > sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin >=20 > Modified: head/etc/mtree/BSD.debug.dist > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/etc/mtree/BSD.debug.dist Thu Feb 12 04:31:17 2015 (r278615)= > +++ head/etc/mtree/BSD.debug.dist Thu Feb 12 05:35:00 2015 (r278616)= > @@ -21,8 +21,6 @@ > usr > bin > .. > - games > - .. > lib > clang > 3.5.1 >=20 > Modified: head/etc/mtree/BSD.usr.dist > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/etc/mtree/BSD.usr.dist Thu Feb 12 04:31:17 2015 (r278615) > +++ head/etc/mtree/BSD.usr.dist Thu Feb 12 05:35:00 2015 (r278616) > @@ -7,8 +7,6 @@ > . > bin > .. > - games > - .. > include > .. > lib >=20 > Modified: head/etc/root/dot.cshrc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/etc/root/dot.cshrc Thu Feb 12 04:31:17 2015 (r278615) > +++ head/etc/root/dot.cshrc Thu Feb 12 05:35:00 2015 (r278616) > @@ -15,7 +15,7 @@ alias ll ls -lAF > # A righteous umask > umask 22 >=20 > -set path =3D (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /u= sr/local/bin $HOME/bin) > +set path =3D (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bi= n $HOME/bin) >=20 > setenv EDITOR vi > setenv PAGER more >=20 > Modified: head/etc/root/dot.login > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/etc/root/dot.login Thu Feb 12 04:31:17 2015 (r278615) > +++ head/etc/root/dot.login Thu Feb 12 05:35:00 2015 (r278616) > @@ -6,4 +6,4 @@ > # >=20 > # Uncomment to display a random cookie each login: > -# if ( -x /usr/games/fortune ) /usr/games/fortune -s > +# if ( -x /usr/bin/fortune ) /usr/bin/fortune -s >=20 > Modified: head/etc/root/dot.profile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/etc/root/dot.profile Thu Feb 12 04:31:17 2015 (r278615) > +++ head/etc/root/dot.profile Thu Feb 12 05:35:00 2015 (r278616) > @@ -1,6 +1,6 @@ > # $FreeBSD$ > # > -PATH=3D/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/loca= l/bin:~/bin > +PATH=3D/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin= > export PATH > HOME=3D/root > export HOME >=20 > Modified: head/games/Makefile.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/games/Makefile.inc Thu Feb 12 04:31:17 2015 (r278615) > +++ head/games/Makefile.inc Thu Feb 12 05:35:00 2015 (r278616) > @@ -1,7 +1,6 @@ > # @(#)Makefile.inc 8.1 (Berkeley) 5/31/93 > # $FreeBSD$ >=20 > -BINDIR?=3D /usr/games > +BINDIR?=3D /usr/bin > FILESDIR?=3D ${SHAREDIR}/games > WARNS?=3D 6 > -DISTRIBUTION?=3D games >=20 > Modified: head/games/caesar/rot13.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/games/caesar/rot13.sh Thu Feb 12 04:31:17 2015 (r278615) > +++ head/games/caesar/rot13.sh Thu Feb 12 05:35:00 2015 (r278616) > @@ -30,4 +30,4 @@ > # @(#)rot13.sh 8.1 (Berkeley) 5/31/93 > # $FreeBSD$ >=20 > -exec /usr/games/caesar 13 "$@" > +exec /usr/bin/caesar 13 "$@" >=20 > Modified: head/games/fortune/datfiles/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/games/fortune/datfiles/Makefile Thu Feb 12 04:31:17 2015 (r= 278615) > +++ head/games/fortune/datfiles/Makefile Thu Feb 12 05:35:00 2015 (r= 278616) > @@ -15,7 +15,7 @@ FILESDIR=3D ${SHAREDIR}/games/fortune >=20 > .for f in ${DB} > $f.dat: $f > - PATH=3D$$PATH:/usr/games:${.OBJDIR}/../strfile \ > + PATH=3D$$PATH:/usr/bin:${.OBJDIR}/../strfile \ > strfile -Cs ${.ALLSRC} ${.TARGET} > .endfor >=20 >=20 > Modified: head/release/scripts/make-manifest.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/release/scripts/make-manifest.sh Thu Feb 12 04:31:17 2015 (= r278615) > +++ head/release/scripts/make-manifest.sh Thu Feb 12 05:35:00 2015 (= r278616) > @@ -13,7 +13,6 @@ desc_base=3D"Base system (MANDATORY)" > desc_kernel=3D"Kernel (MANDATORY)" > desc_doc=3D"Additional documentation" > doc_default=3Doff > -desc_games=3D"Games (fortune, etc.)" > desc_lib32=3D"32-bit compatibility libraries" > desc_ports=3D"Ports tree" > desc_src=3D"System source code" >=20 > Modified: head/share/man/man4/led.4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/man4/led.4 Thu Feb 12 04:31:17 2015 (r278615) > +++ head/share/man/man4/led.4 Thu Feb 12 05:35:00 2015 (r278616) > @@ -170,7 +170,7 @@ flashes > .Pp > .Dl *_*__**_ > .Bd -literal > -/usr/games/morse -l "Soekris rocks" > /dev/led/error > +/usr/bin/morse -l "Soekris rocks" > /dev/led/error > .Ed > .Sh SEE ALSO > .Xr morse 6 >=20 > Modified: head/share/man/man6/intro.6 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/man6/intro.6 Thu Feb 12 04:31:17 2015 (r278615) > +++ head/share/man/man6/intro.6 Thu Feb 12 05:35:00 2015 (r278616) > @@ -37,7 +37,7 @@ > This section contains information about games. > The games > are located in > -.Pa /usr/games > +.Pa /usr/bin > if installed. > You can get a short overview about all the games with the > command: > @@ -45,13 +45,18 @@ command: > $ apropos '\\(6\\)' > .Ed > .Sh FILES > -.Bl -tag -width /usr/games -compact > -.It Pa /usr/games > +.Bl -tag -width /usr/bin -compact > +.It Pa /usr/bin > location of games > .El > .Sh SEE ALSO > .Xr intro 1 > .Sh HISTORY > +In earlier versions of > +.Fx , > +games were located in > +.Pa /usr/games . > +.Pp > The > .Nm > section manual page appeared in >=20 > Modified: head/share/man/man7/hier.7 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/man7/hier.7 Thu Feb 12 04:31:17 2015 (r278615) > +++ head/share/man/man7/hier.7 Thu Feb 12 05:35:00 2015 (r278616) > @@ -187,8 +187,6 @@ common utilities, programming tools, and > .It Pa compat/ > files needed to support binary compatibility with other operating systems,= > such as Linux > -.It Pa games/ > -useful and semi-frivolous programs > .It Pa include/ > standard C include files > .Pp >=20 > Modified: head/share/mk/bsd.prog.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/mk/bsd.prog.mk Thu Feb 12 04:31:17 2015 (r278615) > +++ head/share/mk/bsd.prog.mk Thu Feb 12 05:35:00 2015 (r278616) > @@ -62,7 +62,7 @@ PROG_FULL=3D${PROG}.full > ${BINDIR} =3D=3D "/bin" ||\ > ${BINDIR} =3D=3D "/libexec" ||\ > ${BINDIR} =3D=3D "/sbin" ||\ > - ${BINDIR:C%/usr/(bin|bsdinstall|games|libexec|lpr|sendmail|sm.bin|sbi= n)(/.*)?%/usr/bin%} =3D=3D "/usr/bin"\ > + ${BINDIR:C%/usr/(bin|bsdinstall|libexec|lpr|sendmail|sm.bin|sbin)(/.*= )?%/usr/bin%} =3D=3D "/usr/bin"\ > ) > DEBUGFILEDIR=3D ${DEBUGDIR}${BINDIR} > .else >=20 > Modified: head/share/skel/dot.cshrc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/skel/dot.cshrc Thu Feb 12 04:31:17 2015 (r278615) > +++ head/share/skel/dot.cshrc Thu Feb 12 05:35:00 2015 (r278616) > @@ -14,7 +14,7 @@ alias ll ls -lAF >=20 > # These are normally set through /etc/login.conf. You may override them h= ere > # if wanted. > -# set path =3D (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /= usr/local/bin $HOME/bin) > +# set path =3D (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/= bin $HOME/bin) > # setenv BLOCKSIZE K > # A righteous umask > # umask 22 >=20 > Modified: head/share/skel/dot.login > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/skel/dot.login Thu Feb 12 04:31:17 2015 (r278615) > +++ head/share/skel/dot.login Thu Feb 12 05:35:00 2015 (r278616) > @@ -5,4 +5,4 @@ > # see also csh(1), environ(7). > # >=20 > -if ( -x /usr/games/fortune ) /usr/games/fortune freebsd-tips > +if ( -x /usr/bin/fortune ) /usr/bin/fortune freebsd-tips >=20 > Modified: head/share/skel/dot.profile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/skel/dot.profile Thu Feb 12 04:31:17 2015 (r278615) > +++ head/share/skel/dot.profile Thu Feb 12 05:35:00 2015 (r278616) > @@ -7,7 +7,7 @@ >=20 > # These are normally set through /etc/login.conf. You may override them h= ere > # if wanted. > -# PATH=3D/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/lo= cal/bin:$HOME/bin; export PATH > +# PATH=3D/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HO= ME/bin; export PATH > # BLOCKSIZE=3DK; export BLOCKSIZE >=20 > # Setting TERM is normally done through /etc/ttys. Do only override > @@ -21,4 +21,4 @@ PAGER=3Dmore; export PAGER > # set ENV to a file invoked each time sh is started for interactive use. > ENV=3D$HOME/.shrc; export ENV >=20 > -if [ -x /usr/games/fortune ] ; then /usr/games/fortune freebsd-tips ; fi > +if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune freebsd-tips ; fi >=20 > Modified: head/tools/build/mk/OptionalObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 12 04:31:17 2= 015 (r278615) > +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 12 05:35:00 2= 015 (r278616) > @@ -1606,21 +1606,20 @@ OLD_FILES+=3Dusr/share/man/man8/freebsd-up > .endif >=20 > .if ${MK_GAMES} =3D=3D no > -OLD_FILES+=3Dusr/games/bcd > -OLD_FILES+=3Dusr/games/caesar > -OLD_FILES+=3Dusr/games/factor > -OLD_FILES+=3Dusr/games/fortune > -OLD_FILES+=3Dusr/games/grdc > -OLD_FILES+=3Dusr/games/morse > -OLD_FILES+=3Dusr/games/number > -OLD_FILES+=3Dusr/games/pom > -OLD_FILES+=3Dusr/games/ppt > -OLD_FILES+=3Dusr/games/primes > -OLD_FILES+=3Dusr/games/random > -OLD_FILES+=3Dusr/games/rot13 > -OLD_FILES+=3Dusr/games/strfile > -OLD_FILES+=3Dusr/games/unstr > -OLD_DIRS+=3Dusr/games > +OLD_FILES+=3Dusr/bin/bcd > +OLD_FILES+=3Dusr/bin/caesar > +OLD_FILES+=3Dusr/bin/factor > +OLD_FILES+=3Dusr/bin/fortune > +OLD_FILES+=3Dusr/bin/grdc > +OLD_FILES+=3Dusr/bin/morse > +OLD_FILES+=3Dusr/bin/number > +OLD_FILES+=3Dusr/bin/pom > +OLD_FILES+=3Dusr/bin/ppt > +OLD_FILES+=3Dusr/bin/primes > +OLD_FILES+=3Dusr/bin/random > +OLD_FILES+=3Dusr/bin/rot13 > +OLD_FILES+=3Dusr/bin/strfile > +OLD_FILES+=3Dusr/bin/unstr > OLD_FILES+=3Dusr/share/games/fortune/fortunes > OLD_FILES+=3Dusr/share/games/fortune/fortunes.dat > OLD_FILES+=3Dusr/share/games/fortune/freebsd-tips >=20 > Modified: head/tools/tools/nanobsd/gateworks/Files/root/.profile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/tools/tools/nanobsd/gateworks/Files/root/.profile Thu Feb 12 0= 4:31:17 2015 (r278615) > +++ head/tools/tools/nanobsd/gateworks/Files/root/.profile Thu Feb 12 0= 5:35:00 2015 (r278616) > @@ -1,6 +1,6 @@ > # $FreeBSD: src/etc/root/dot.profile,v 1.21 2007/05/29 06:33:10 dougb Exp $= > # > -PATH=3D/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/loca= l/bin:~/bin > +PATH=3D/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin= > export PATH > HOME=3D/root; export HOME > TERM=3D${TERM:-xterm}; export TERM >=20 > Modified: head/tools/tools/nanobsd/pcengines/Files/root/.cshrc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/tools/tools/nanobsd/pcengines/Files/root/.cshrc Thu Feb 12 04:= 31:17 2015 (r278615) > +++ head/tools/tools/nanobsd/pcengines/Files/root/.cshrc Thu Feb 12 05:= 35:00 2015 (r278616) > @@ -14,7 +14,7 @@ alias ll ls -lA > # A righteous umask > umask 22 >=20 > -set path =3D (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /u= sr/local/bin $HOME/bin) > +set path =3D (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bi= n $HOME/bin) >=20 > setenv EDITOR vi > setenv PAGER more >=20 > Modified: head/tools/tools/nanobsd/pcengines/Files/root/.login > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/tools/tools/nanobsd/pcengines/Files/root/.login Thu Feb 12 04:= 31:17 2015 (r278615) > +++ head/tools/tools/nanobsd/pcengines/Files/root/.login Thu Feb 12 05:= 35:00 2015 (r278616) > @@ -6,4 +6,4 @@ > # >=20 > # Uncomment to display a random cookie each login: > -# [ -x /usr/games/fortune ] && /usr/games/fortune -s > +# [ -x /usr/bin/fortune ] && /usr/bin/fortune -s >=20 > Modified: head/tools/tools/nanobsd/rescue/Files/root/.cshrc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/tools/tools/nanobsd/rescue/Files/root/.cshrc Thu Feb 12 04:31:= 17 2015 (r278615) > +++ head/tools/tools/nanobsd/rescue/Files/root/.cshrc Thu Feb 12 05:35:= 00 2015 (r278616) > @@ -11,7 +11,7 @@ > a lm 'll | more' > a m more >=20 > -set path =3D (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /u= sr/local/bin /usr/X11R6/bin /usr/local/jdk1.6.0/bin /usr/local/jdk1.5.0/bin $= HOME/bin) > +set path =3D (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bi= n /usr/X11R6/bin /usr/local/jdk1.6.0/bin /usr/local/jdk1.5.0/bin $HOME/bin) > setenv MANPATH "/usr/share/man:/usr/X11R6/man:/usr/local/man" >=20 > setenv PAGER more >=20 > Modified: head/usr.bin/whereis/pathnames.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/usr.bin/whereis/pathnames.h Thu Feb 12 04:31:17 2015 (r2786= 15) > +++ head/usr.bin/whereis/pathnames.h Thu Feb 12 05:35:00 2015 (r2786= 16) > @@ -25,9 +25,8 @@ > * $FreeBSD$ > */ >=20 > -/* Where to look for libexec and games */ > +/* Where to look for libexec */ > #define PATH_LIBEXEC "/usr/libexec" > -#define PATH_GAMES "/usr/games" >=20 > /* Where to look for sources. */ > #define PATH_SOURCES \ >=20 > Modified: head/usr.bin/whereis/whereis.1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/usr.bin/whereis/whereis.1 Thu Feb 12 04:31:17 2015 (r278615= ) > +++ head/usr.bin/whereis/whereis.1 Thu Feb 12 05:35:00 2015 (r278616= ) > @@ -65,8 +65,7 @@ The default path searched is the string=20 > utility for the > .Dq user.cs_path > string, with > -.Pa /usr/libexec , > -.Pa /usr/games > +.Pa /usr/libexec > and the current user's > .Ev $PATH > appended. >=20 > Modified: head/usr.bin/whereis/whereis.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/usr.bin/whereis/whereis.c Thu Feb 12 04:31:17 2015 (r278615= ) > +++ head/usr.bin/whereis/whereis.c Thu Feb 12 05:35:00 2015 (r278616= ) > @@ -265,7 +265,7 @@ defaults(void) > opt_b =3D opt_m =3D opt_s =3D 1; >=20 > /* -b defaults to default path + /usr/libexec + > - * /usr/games + user's path */ > + * user's path */ > if (!bindirs) { > if (sysctlbyname("user.cs_path", (void *)NULL, &s, > (void *)NULL, 0) =3D=3D -1) > @@ -276,11 +276,10 @@ defaults(void) > err(EX_OSERR, "sysctlbyname(\"user.cs_path\")"); > nele =3D 0; > decolonify(b, &bindirs, &nele); > - bindirs =3D realloc(bindirs, (nele + 3) * sizeof(char *)); > + bindirs =3D realloc(bindirs, (nele + 2) * sizeof(char *)); > if (bindirs =3D=3D NULL) > abort(); > bindirs[nele++] =3D PATH_LIBEXEC; > - bindirs[nele++] =3D PATH_GAMES; > bindirs[nele] =3D NULL; > if ((cp =3D getenv("PATH")) !=3D NULL) { > /* don't destroy the original environment... */ >=20 > Modified: head/usr.sbin/bsdconfig/include/messages.subr > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/bsdconfig/include/messages.subr Thu Feb 12 04:31:17 2= 015 (r278615) > +++ head/usr.sbin/bsdconfig/include/messages.subr Thu Feb 12 05:35:00 2= 015 (r278616) > @@ -138,7 +138,6 @@ msg_ftp=3D"FTP" > msg_ftp_desc=3D"FTP client and server utilities." > msg_ftp_passive=3D"FTP Passive" > msg_ftp_username=3D"FTP username" > -msg_games_desc=3D"Various games and sundry amusements." > msg_generating_index_from_pkg_database=3D"Generating INDEX from pkg(8) dat= abase\n(this can take a while)..." > msg_geography_desc=3D"Geography-related software." > msg_german_desc=3D"Ported software for Germanic countries." >=20 > Modified: head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/pc-sysinstall/backend/functions-extractimage.sh Thu Fe= b 12 04:31:17 2015 (r278615) > +++ head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Thu Fe= b 12 05:35:00 2015 (r278616) > @@ -303,7 +303,7 @@ fetch_split_files() > OUTFILE=3D"${FSMNT}/.fetch-${INSFILE}" > fi >=20 > - DIRS=3D"base catpages dict doc games info manpages proflibs kernels src= " > + DIRS=3D"base catpages dict doc info manpages proflibs kernels src" > if [ "${FBSD_ARCH}" =3D "amd64" ] > then > DIRS=3D"${DIRS} lib32" >=20 From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 07:22:47 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB14871D; Thu, 12 Feb 2015 07:22: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6790623; Thu, 12 Feb 2015 07:22:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1C7MljS013231; Thu, 12 Feb 2015 07:22:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1C7Mlm5013230; Thu, 12 Feb 2015 07:22:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502120722.t1C7Mlm5013230@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 12 Feb 2015 07:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278618 - head/bin/pkill/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 07:22:48 -0000 Author: ngie Date: Thu Feb 12 07:22:46 2015 New Revision: 278618 URL: https://svnweb.freebsd.org/changeset/base/278618 Log: Add debugging output to help track down the recent Jenkins failures Modified: head/bin/pkill/tests/pgrep-j_test.sh Modified: head/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- head/bin/pkill/tests/pgrep-j_test.sh Thu Feb 12 07:21:22 2015 (r278617) +++ head/bin/pkill/tests/pgrep-j_test.sh Thu Feb 12 07:22:46 2015 (r278618) @@ -40,7 +40,7 @@ if [ `id -u` -eq 0 ]; then if [ "$pid1" = "$pid2" ]; then echo "ok 1 - $name" else - echo "not ok 1 - $name" + echo "not ok 1 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" fi [ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) @@ -66,7 +66,7 @@ if [ `id -u` -eq 0 ]; then if [ "$pid1" = "$pid2" ]; then echo "ok 2 - $name" else - echo "not ok 2 - $name" + echo "not ok 2 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" fi [ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) [ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) @@ -87,7 +87,7 @@ if [ `id -u` -eq 0 ]; then if [ "$pid" = "$(cat ${PWD}/${base}_3_1.pid)" ]; then echo "ok 3 - $name" else - echo "not ok 3 - $name" + echo "not ok 3 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" fi rm -f $sleep [ -f ${PWD}/${base}_3_1.pid ] && kill $(cat $PWD/${base}_3_1.pid) From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 10:24:21 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F55BDEE; Thu, 12 Feb 2015 10:24:21 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 161C9B9D; Thu, 12 Feb 2015 10:24:21 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YLqwO-000Hva-5B; Thu, 12 Feb 2015 13:24:12 +0300 Date: Thu, 12 Feb 2015 13:24:12 +0300 From: Slawa Olhovchenkov To: Colin Percival Subject: Re: svn commit: r278616 - in head: . contrib/netbsd-tests/games etc etc/mtree etc/root games games/caesar games/fortune/datfiles release/scripts share/man/man4 share/man/man6 share/man/man7 share/mk sh... Message-ID: <20150212102412.GA67478@zxy.spb.ru> References: <201502120535.t1C5Z0el061979@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502120535.t1C5Z0el061979@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false 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.18-1 Precedence: list List-Id: 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, 12 Feb 2015 10:24:21 -0000 On Thu, Feb 12, 2015 at 05:35:00AM +0000, Colin Percival wrote: > Author: cperciva > Date: Thu Feb 12 05:35:00 2015 > New Revision: 278616 > URL: https://svnweb.freebsd.org/changeset/base/278616 > > Log: > Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin; > update paths; and include everything in the "base" distribution. > > The "games" distribution being optional made sense when there were more > games and we had small disks; but the "games-like" games were moved into > the ports tree a dozen years ago and the remaining "utility-like" games > occupy less than 0.001% of my laptop's small hard drive. Meanwhile every > new user is confronted by the question "do you want games installed" when > they they try to install FreeBSD. > > The next steps will be: > > 2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and > caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor, > morse, number, primes, and random, since there is evidence that those are > still being used. Please, keep pom. From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 10:28:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00FBFF82; Thu, 12 Feb 2015 10:28: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1284BCD; Thu, 12 Feb 2015 10:28:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CASjGw098433; Thu, 12 Feb 2015 10:28:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CASjCv098432; Thu, 12 Feb 2015 10:28:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201502121028.t1CASjCv098432@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Feb 2015 10:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278619 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 10:28:46 -0000 Author: mav Date: Thu Feb 12 10:28:45 2015 New Revision: 278619 URL: https://svnweb.freebsd.org/changeset/base/278619 Log: Make WRITE SAME commands respect physical block size. This change by 2-3 times improves performance of misaligned WRITE SAME commands by avoiding unneeded read-modify-write cycles inside ZFS. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Feb 12 07:22:46 2015 (r278618) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Feb 12 10:28:45 2015 (r278619) @@ -1187,7 +1187,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b struct ctl_be_block_io *beio; struct ctl_be_block_softc *softc; struct ctl_lba_len_flags *lbalen; - uint64_t len_left, lba; + uint64_t len_left, lba, pb, pbo, adj; int i, seglen; uint8_t *buf, *end; @@ -1241,6 +1241,8 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b DPRINTF("WRITE SAME at LBA %jx len %u\n", (uintmax_t)lbalen->lba, lbalen->len); + pb = (uint64_t)be_lun->blocksize << be_lun->pblockexp; + pbo = pb - (uint64_t)be_lun->blocksize * be_lun->pblockoff; len_left = (uint64_t)lbalen->len * be_lun->blocksize; for (i = 0, lba = 0; i < CTLBLK_MAX_SEGS && len_left > 0; i++) { @@ -1248,7 +1250,15 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b * Setup the S/G entry for this chunk. */ seglen = MIN(CTLBLK_MAX_SEG, len_left); - seglen -= seglen % be_lun->blocksize; + if (pb > be_lun->blocksize) { + adj = ((lbalen->lba + lba) * be_lun->blocksize + + seglen - pbo) % pb; + if (seglen > adj) + seglen -= adj; + else + seglen -= seglen % be_lun->blocksize; + } else + seglen -= seglen % be_lun->blocksize; beio->sg_segs[i].len = seglen; beio->sg_segs[i].addr = uma_zalloc(be_lun->lun_zone, M_WAITOK); From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 11:06:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1029065B; Thu, 12 Feb 2015 11:06:37 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id BEAE0F97; Thu, 12 Feb 2015 11:06:36 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 472ED1A23C7; Thu, 12 Feb 2015 22:06:27 +1100 (AEDT) Date: Thu, 12 Feb 2015 22:06:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" Subject: Re: svn commit: r278589 - head/usr.sbin/flowctl In-Reply-To: <201502111746.t1BHkZqt022491@svn.freebsd.org> Message-ID: <20150212212417.U1109@besplex.bde.org> References: <201502111746.t1BHkZqt022491@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=baJSDo/B c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=wQHLCYbhVzbzD75rOj8A:9 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.18-1 Precedence: list List-Id: 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, 12 Feb 2015 11:06:37 -0000 On Wed, 11 Feb 2015, Pedro F. Giffuni wrote: > Log: > flowctl: Replace alloca() with an array. > > Reviewed by: glebius > > Modified: > head/usr.sbin/flowctl/flowctl.c > > Modified: head/usr.sbin/flowctl/flowctl.c > ============================================================================== > --- head/usr.sbin/flowctl/flowctl.c Wed Feb 11 17:41:23 2015 (r278588) > +++ head/usr.sbin/flowctl/flowctl.c Wed Feb 11 17:46:35 2015 (r278589) > @@ -222,12 +222,10 @@ ctl_show(int argc, char **argv) > static void > do_show(int version, void (*func)(struct ngnf_show_header *)) > { > - struct ng_mesg *ng_mesg; > + struct ng_mesg ng_mesg[SORCVBUF_SIZE]; > struct ngnf_show_header req, *resp; > int token, nread; > > - ng_mesg = alloca(SORCVBUF_SIZE); > - > req.version = version; > req.hash_id = req.list_id = 0; It is surprising that this even compiles. It replaces the allocation of 1 (variable-size, using a perhaps-standard form of the struct hack) struct of size SORCVBUF_SIZE with that of SORCVBUF_SIZE (fixed-size) structs, each of too-small size. This accidentally allocates enough storage since 1 * SORCVBUF_SIZE < SORCVBUF_SIZE * sizeof(any). It changes the variable type significantly, from a pointer to 1 struct to the bogus array. In 1 place, the array decays to a pointer to its first element without too much magic. (The magic is larger than usual since the struct hack is used. The first element is too small and is overrun. This works because the pointer isn't really a pointer to a struct.) In 4 places, the array decays to a pointer to its first element more magically. It is surprising that ng_mesg->header means the same thing as ng_mesg[0].header when ng_mesg is an array. Using alloca() was ugly, but correctly reflected what was going on. It is an optimization of mallocing the struct. VLAs don't work as well as alloca() for variable-sized structs. I don't see how they can be used at all. Since we allocate the maximum size needed, we don't even need a VLA, and could almost use u_char buf[SORCVBUF_SIZE] struct ng_mesg *ng_mesg; ng_msg = (struct ng_mesg *)buf; but this doesn't guarantee the necessary alignment like malloc() and alloca() do. It also takes more code than alloca(). To get the necessary alignment, you would have to use some alignment hack, e.g., put buf in a union with the struct (only works for fixed-size allocation), or perhaps use an array not quite as in this commit: struct ng_mesg buf[howmany(SORCVBUF_SIZE, sizeof(struct ng_mesg))]; struct ng_mesg *ng_mesg; ng_msg = &buf[0]; This form works using VLAs (SORCVBUF_SIZE can be variable), but is much uglier than using alloca(). Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 11:27:55 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2195C97; Thu, 12 Feb 2015 11:27: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD573218; Thu, 12 Feb 2015 11:27:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CBRtLS026735; Thu, 12 Feb 2015 11:27:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CBRt9D026734; Thu, 12 Feb 2015 11:27:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201502121127.t1CBRt9D026734@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Feb 2015 11:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278621 - head/usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 11:27:55 -0000 Author: mav Date: Thu Feb 12 11:27:54 2015 New Revision: 278621 URL: https://svnweb.freebsd.org/changeset/base/278621 Log: Fix man page to match real option names. MFC after: 3 days Modified: head/usr.sbin/ctladm/ctladm.8 Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Thu Feb 12 11:10:07 2015 (r278620) +++ head/usr.sbin/ctladm/ctladm.8 Thu Feb 12 11:27:54 2015 (r278621) @@ -1035,11 +1035,11 @@ Set to "off" to allow them be issued in Parallel issue of consecutive operations may confuse logic of the backing file system, hurting performance; but it may improve performance of backing stores without prefetch/write-back. -.It Va psectorsize -.It Va psectoroffset +.It Va pblocksize +.It Va pblockoffset Specify physical block size and offset of the device. -.It Va usectorsize -.It Va usectoroffset +.It Va ublocksize +.It Va ublockoffset Specify UNMAP block size and offset of the device. .It Va rpm .It Va rpm From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 11:57:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CCFE405; Thu, 12 Feb 2015 11:57: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DF976E7; Thu, 12 Feb 2015 11:57:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CBvX5X040891; Thu, 12 Feb 2015 11:57:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CBvWPg040887; Thu, 12 Feb 2015 11:57:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201502121157.t1CBvWPg040887@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 12 Feb 2015 11:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278622 - in head/usr.sbin: ctld iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 11:57:33 -0000 Author: trasz Date: Thu Feb 12 11:57:31 2015 New Revision: 278622 URL: https://svnweb.freebsd.org/changeset/base/278622 Log: Remove unused code. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/keys.c head/usr.sbin/iscsid/iscsid.h head/usr.sbin/iscsid/keys.c Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Thu Feb 12 11:27:54 2015 (r278621) +++ head/usr.sbin/ctld/ctld.h Thu Feb 12 11:57:31 2015 (r278622) @@ -416,7 +416,6 @@ void keys_delete(struct keys *keys); void keys_load(struct keys *keys, const struct pdu *pdu); void keys_save(struct keys *keys, struct pdu *pdu); const char *keys_find(struct keys *keys, const char *name); -int keys_find_int(struct keys *keys, const char *name); void keys_add(struct keys *keys, const char *name, const char *value); void keys_add_int(struct keys *keys, Modified: head/usr.sbin/ctld/keys.c ============================================================================== --- head/usr.sbin/ctld/keys.c Thu Feb 12 11:27:54 2015 (r278621) +++ head/usr.sbin/ctld/keys.c Thu Feb 12 11:57:31 2015 (r278622) @@ -161,26 +161,6 @@ keys_find(struct keys *keys, const char return (NULL); } -int -keys_find_int(struct keys *keys, const char *name) -{ - const char *str; - char *endptr; - int num; - - str = keys_find(keys, name); - if (str == NULL) - return (-1); - - num = strtoul(str, &endptr, 10); - if (*endptr != '\0') { - log_debugx("invalid numeric value \"%s\"", str); - return (-1); - } - - return (num); -} - void keys_add(struct keys *keys, const char *name, const char *value) { Modified: head/usr.sbin/iscsid/iscsid.h ============================================================================== --- head/usr.sbin/iscsid/iscsid.h Thu Feb 12 11:27:54 2015 (r278621) +++ head/usr.sbin/iscsid/iscsid.h Thu Feb 12 11:57:31 2015 (r278622) @@ -116,7 +116,6 @@ void keys_delete(struct keys *key); void keys_load(struct keys *keys, const struct pdu *pdu); void keys_save(struct keys *keys, struct pdu *pdu); const char *keys_find(struct keys *keys, const char *name); -int keys_find_int(struct keys *keys, const char *name); void keys_add(struct keys *keys, const char *name, const char *value); void keys_add_int(struct keys *keys, Modified: head/usr.sbin/iscsid/keys.c ============================================================================== --- head/usr.sbin/iscsid/keys.c Thu Feb 12 11:27:54 2015 (r278621) +++ head/usr.sbin/iscsid/keys.c Thu Feb 12 11:57:31 2015 (r278622) @@ -162,26 +162,6 @@ keys_find(struct keys *keys, const char return (NULL); } -int -keys_find_int(struct keys *keys, const char *name) -{ - const char *str; - char *endptr; - int num; - - str = keys_find(keys, name); - if (str == NULL) - return (-1); - - num = strtoul(str, &endptr, 10); - if (*endptr != '\0') { - log_debugx("invalid numeric value \"%s\"", str); - return (-1); - } - - return (num); -} - void keys_add(struct keys *keys, const char *name, const char *value) { From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 13:31:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87994891; Thu, 12 Feb 2015 13:31: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6848EF9; Thu, 12 Feb 2015 13:31:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CDV9Qq086270; Thu, 12 Feb 2015 13:31:09 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CDV9jR086269; Thu, 12 Feb 2015 13:31:09 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201502121331.t1CDV9jR086269@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 12 Feb 2015 13:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278623 - 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.18-1 Precedence: list List-Id: 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, 12 Feb 2015 13:31:09 -0000 Author: rrs Date: Thu Feb 12 13:31:08 2015 New Revision: 278623 URL: https://svnweb.freebsd.org/changeset/base/278623 Log: This fixes a bug I in-advertantly inserted when I updated the callout code in my last commit. The cc_exec_next is used to track the next when a direct call is being made from callout. It is *never* used in the in-direct method. When macro-izing I made it so that it would separate out direct/vs/non-direct. This is incorrect and can cause panics as Peter Holm has found for me (Thanks so much Peter for all your help in this). What this change does is restore that behavior but also get rid of the cc_next from the array and instead make it be part of the base callout structure. This way no one else will get confused since we will never use it for non-direct. Reviewed by: Peter Holm and more importantly tested by him ;-) MFC after: 3 days. Sponsored by: Netflix Inc. Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Thu Feb 12 11:57:31 2015 (r278622) +++ head/sys/kern/kern_timeout.c Thu Feb 12 13:31:08 2015 (r278623) @@ -135,7 +135,6 @@ u_int callwheelsize, callwheelmask; * the migrating callout is already running. */ struct cc_exec { - struct callout *cc_next; struct callout *cc_curr; #ifdef SMP void (*ce_migration_func)(void *); @@ -155,6 +154,7 @@ struct cc_exec { struct callout_cpu { struct mtx_padalign cc_lock; struct cc_exec cc_exec_entity[2]; + struct callout *cc_next; struct callout *cc_callout; struct callout_list *cc_callwheel; struct callout_tailq cc_expireq; @@ -167,7 +167,7 @@ struct callout_cpu { }; #define cc_exec_curr(cc, dir) cc->cc_exec_entity[dir].cc_curr -#define cc_exec_next(cc, dir) cc->cc_exec_entity[dir].cc_next +#define cc_exec_next(cc) cc->cc_next #define cc_exec_cancel(cc, dir) cc->cc_exec_entity[dir].cc_cancel #define cc_exec_waiting(cc, dir) cc->cc_exec_entity[dir].cc_waiting #ifdef SMP @@ -226,7 +226,6 @@ cc_cce_cleanup(struct callout_cpu *cc, i { cc_exec_curr(cc, direct) = NULL; - cc_exec_next(cc, direct) = NULL; cc_exec_cancel(cc, direct) = false; cc_exec_waiting(cc, direct) = false; #ifdef SMP @@ -482,7 +481,7 @@ callout_process(sbintime_t now) #ifdef CALLOUT_PROFILING ++depth_dir; #endif - cc_exec_next(cc, 1) = + cc_exec_next(cc) = LIST_NEXT(tmp, c_links.le); cc->cc_bucket = firstb & callwheelmask; LIST_REMOVE(tmp, c_links.le); @@ -491,7 +490,8 @@ callout_process(sbintime_t now) &mpcalls_dir, &lockcalls_dir, NULL, #endif 1); - tmp = cc_exec_next(cc, 1); + tmp = cc_exec_next(cc); + cc_exec_next(cc) = NULL; } else { tmpn = LIST_NEXT(tmp, c_links.le); LIST_REMOVE(tmp, c_links.le); @@ -575,7 +575,7 @@ callout_lock(struct callout *c) static void callout_cc_add(struct callout *c, struct callout_cpu *cc, sbintime_t sbt, sbintime_t precision, void (*func)(void *), - void *arg, int cpu, int flags, int direct) + void *arg, int cpu, int flags) { int bucket; @@ -584,8 +584,6 @@ callout_cc_add(struct callout *c, struct sbt = cc->cc_lastscan; c->c_arg = arg; c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); - if (flags & C_DIRECT_EXEC) - c->c_flags |= CALLOUT_DIRECT; c->c_flags &= ~CALLOUT_PROCESSED; c->c_func = func; c->c_time = sbt; @@ -596,7 +594,7 @@ callout_cc_add(struct callout *c, struct (u_int)(c->c_precision & 0xffffffff)); LIST_INSERT_HEAD(&cc->cc_callwheel[bucket], c, c_links.le); if (cc->cc_bucket == bucket) - cc_exec_next(cc, direct) = c; + cc_exec_next(cc) = c; #ifndef NO_EVENTTIMERS /* * Inform the eventtimers(4) subsystem there's a new callout @@ -790,7 +788,7 @@ skip: new_cc = callout_cpu_switch(c, cc, new_cpu); flags = (direct) ? C_DIRECT_EXEC : 0; callout_cc_add(c, new_cc, new_time, new_prec, new_func, - new_arg, new_cpu, flags, direct); + new_arg, new_cpu, flags); CC_UNLOCK(new_cc); CC_LOCK(cc); #else @@ -994,6 +992,14 @@ callout_reset_sbt_on(struct callout *c, */ if (c->c_flags & CALLOUT_LOCAL_ALLOC) cpu = c->c_cpu; + /* + * This flag used to be added by callout_cc_add, but the + * first time you call this we could end up with the + * wrong direct flag if we don't do it before we add. + */ + if (flags & C_DIRECT_EXEC) { + c->c_flags |= CALLOUT_DIRECT; + } direct = (c->c_flags & CALLOUT_DIRECT) != 0; KASSERT(!direct || c->c_lock == NULL, ("%s: direct callout %p has lock", __func__, c)); @@ -1039,8 +1045,8 @@ callout_reset_sbt_on(struct callout *c, } if (c->c_flags & CALLOUT_PENDING) { if ((c->c_flags & CALLOUT_PROCESSED) == 0) { - if (cc_exec_next(cc, direct) == c) - cc_exec_next(cc, direct) = LIST_NEXT(c, c_links.le); + if (cc_exec_next(cc) == c) + cc_exec_next(cc) = LIST_NEXT(c, c_links.le); LIST_REMOVE(c, c_links.le); } else TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); @@ -1089,7 +1095,7 @@ callout_reset_sbt_on(struct callout *c, } #endif - callout_cc_add(c, cc, to_sbt, precision, ftn, arg, cpu, flags, direct); + callout_cc_add(c, cc, to_sbt, precision, ftn, arg, cpu, flags); CTR6(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %d.%08x", cancelled ? "re" : "", c, c->c_func, c->c_arg, (int)(to_sbt >> 32), (u_int)(to_sbt & 0xffffffff)); @@ -1322,8 +1328,8 @@ again: c, c->c_func, c->c_arg); if (not_on_a_list == 0) { if ((c->c_flags & CALLOUT_PROCESSED) == 0) { - if (cc_exec_next(cc, direct) == c) - cc_exec_next(cc, direct) = LIST_NEXT(c, c_links.le); + if (cc_exec_next(cc) == c) + cc_exec_next(cc) = LIST_NEXT(c, c_links.le); LIST_REMOVE(c, c_links.le); } else TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 14:13:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01A5BE5 for ; Thu, 12 Feb 2015 14:13:47 +0000 (UTC) Received: from vfemail.net (nine.vfemail.net [108.76.175.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 967AC7BF for ; Thu, 12 Feb 2015 14:13:40 +0000 (UTC) Received: (qmail 50854 invoked by uid 89); 12 Feb 2015 14:13:07 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 12 Feb 2015 14:13:05 -0000 Received: (qmail 30296 invoked by uid 89); 12 Feb 2015 12:22:42 -0000 Received: by simscan 1.3.1 ppid: 30282, pid: 30291, t: 0.0063s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 12 Feb 2015 12:22:42 -0000 Received: (qmail 18628 invoked by uid 89); 12 Feb 2015 12:22:46 -0000 Received: by simscan 1.4.0 ppid: 18609, pid: 18624, t: 0.5492s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 12 Feb 2015 12:22:46 -0000 From: Jan Beich To: Devin Teske Subject: Re: svn commit: r278616 - in head: . contrib/netbsd-tests/games etc etc/mtree etc/root games games/caesar games/fortune/datfiles release/scripts share/man/man4 share/man/man6 share/man/man7 share/mk sh... In-Reply-To: (Devin Teske's message of "Wed, 11 Feb 2015 22:17:05 -0800") References: <201502120535.t1C5Z0el061979@svn.freebsd.org> Date: Thu, 12 Feb 2015 13:22:37 +0100 Message-ID: <61b7-qpyq-wny@vfemail.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , Colin Percival X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 14:13:48 -0000 --=-=-= Content-Type: text/plain Devin Teske writes: > PLEASE! Do NOT remove the grand digital clock (grdc). > > So many of us over the years have used it as a terminal keeper-aliver :) (and as a clock, to boot). > > I will be very sad if you remove grdc. Aren't there better alternatives in ports? clock-mode in sysutils/tmux, sysutils/tty-clock, sysutils/currtime to name a few. OTOH, grdc(6) lacks a license, unmaintained, has a few PRs with patches. Not to mention it paints the whole terminal black sans the glitchy NCURSES_ASSUMED_COLORS=-1,-1. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJU3JsNXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bbXkH/2xL2vCnYlryEntlgmKNhbSH QDq0WpwL8RkfL2E8pktLMoE7B4qR6WcFwoQw7YzFeghLv+Ie4cW1eRIMlgdXZaH7 hagkmuCtqBWElyxRM0R3/EZbiHzV9WOWfZx7mm40wcuochj9xzFoP5kyEQMEDQbu z4ApZf6yjzefQihqtCPCGJZ9zVfYVwX+5en2a6HF79PMpMuCGMa2VyGzBYmPIvtM f/SJgHNAKUnjTCZPA1IVyWnrwAglZHZARycLZmWxQFlavyXq103r6oxWpL0CvKGo phVxJ2AeUEP87pakHTcDETubsf0z9FMLGulwksAsvrUdqFL5FsjTugsKX/5w7ic= =Fhr9 -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 15:46:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76B6DF62; Thu, 12 Feb 2015 15:46: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57403281; Thu, 12 Feb 2015 15:46:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CFkkQn050079; Thu, 12 Feb 2015 15:46:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CFkj3n050075; Thu, 12 Feb 2015 15:46:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201502121546.t1CFkj3n050075@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Feb 2015 15:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278625 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 15:46:46 -0000 Author: mav Date: Thu Feb 12 15:46:44 2015 New Revision: 278625 URL: https://svnweb.freebsd.org/changeset/base/278625 Log: Make XCOPY and WUT commands respect physical block size/offset. This change by 2-3 times improves performance of misaligned XCOPY and WUT commands by avoiding unneeded read-modify-write cycles inside ZFS. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_tpc.c head/sys/cam/ctl/ctl_tpc.h head/sys/cam/ctl/ctl_tpc_local.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Feb 12 15:34:16 2015 (r278624) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Feb 12 15:46:44 2015 (r278625) @@ -1187,7 +1187,8 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b struct ctl_be_block_io *beio; struct ctl_be_block_softc *softc; struct ctl_lba_len_flags *lbalen; - uint64_t len_left, lba, pb, pbo, adj; + uint64_t len_left, lba; + uint32_t pb, pbo, adj; int i, seglen; uint8_t *buf, *end; @@ -1241,8 +1242,11 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b DPRINTF("WRITE SAME at LBA %jx len %u\n", (uintmax_t)lbalen->lba, lbalen->len); - pb = (uint64_t)be_lun->blocksize << be_lun->pblockexp; - pbo = pb - (uint64_t)be_lun->blocksize * be_lun->pblockoff; + pb = be_lun->blocksize << be_lun->pblockexp; + if (be_lun->pblockoff > 0) + pbo = pb - be_lun->blocksize * be_lun->pblockoff; + else + pbo = 0; len_left = (uint64_t)lbalen->len * be_lun->blocksize; for (i = 0, lba = 0; i < CTLBLK_MAX_SEGS && len_left > 0; i++) { Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Thu Feb 12 15:34:16 2015 (r278624) +++ head/sys/cam/ctl/ctl_tpc.c Thu Feb 12 15:46:44 2015 (r278625) @@ -785,18 +785,25 @@ ctl_copy_operation_abort(struct ctl_scsi } static uint64_t -tpc_resolve(struct tpc_list *list, uint16_t idx, uint32_t *ss) +tpc_resolve(struct tpc_list *list, uint16_t idx, uint32_t *ss, + uint32_t *pb, uint32_t *pbo) { if (idx == 0xffff) { if (ss && list->lun->be_lun) *ss = list->lun->be_lun->blocksize; + if (pb && list->lun->be_lun) + *pb = list->lun->be_lun->blocksize << + list->lun->be_lun->pblockexp; + if (pbo && list->lun->be_lun) + *pbo = list->lun->be_lun->blocksize * + list->lun->be_lun->pblockoff; return (list->lun->lun); } if (idx >= list->ncscd) return (UINT64_MAX); return (tpcl_resolve(list->lun->ctl_softc, - list->init_port, &list->cscd[idx], ss)); + list->init_port, &list->cscd[idx], ss, pb, pbo)); } static int @@ -809,7 +816,7 @@ tpc_process_b2b(struct tpc_list *list) uint64_t sl, dl; off_t srclba, dstlba, numbytes, donebytes, roundbytes; int numlba; - uint32_t srcblock, dstblock; + uint32_t srcblock, dstblock, pb, pbo, adj; if (list->stage == 1) { while ((tior = TAILQ_FIRST(&list->allio)) != NULL) { @@ -834,14 +841,16 @@ tpc_process_b2b(struct tpc_list *list) TAILQ_INIT(&list->allio); seg = (struct scsi_ec_segment_b2b *)list->seg[list->curseg]; - sl = tpc_resolve(list, scsi_2btoul(seg->src_cscd), &srcblock); - dl = tpc_resolve(list, scsi_2btoul(seg->dst_cscd), &dstblock); + sl = tpc_resolve(list, scsi_2btoul(seg->src_cscd), &srcblock, NULL, NULL); + dl = tpc_resolve(list, scsi_2btoul(seg->dst_cscd), &dstblock, &pb, &pbo); if (sl >= CTL_MAX_LUNS || dl >= CTL_MAX_LUNS) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, SSD_ELEM_NONE); return (CTL_RETVAL_ERROR); } + if (pbo > 0) + pbo = pb - pbo; sdstp = &list->cscd[scsi_2btoul(seg->src_cscd)].dtsp; if (scsi_3btoul(sdstp->block_length) != 0) srcblock = scsi_3btoul(sdstp->block_length); @@ -878,7 +887,16 @@ tpc_process_b2b(struct tpc_list *list) prun = &run; list->tbdio = 1; while (donebytes < numbytes) { - roundbytes = MIN(numbytes - donebytes, TPC_MAX_IO_SIZE); + roundbytes = numbytes - donebytes; + if (roundbytes > TPC_MAX_IO_SIZE) { + roundbytes = TPC_MAX_IO_SIZE; + roundbytes -= roundbytes % dstblock; + if (pb > dstblock) { + adj = (dstlba * dstblock + roundbytes - pbo) % pb; + if (roundbytes > adj) + roundbytes -= adj; + } + } tior = malloc(sizeof(*tior), M_CTL, M_WAITOK | M_ZERO); TAILQ_INIT(&tior->run); @@ -891,7 +909,7 @@ tpc_process_b2b(struct tpc_list *list) /*read_op*/ 1, /*byte2*/ 0, /*minimum_cdb_size*/ 0, - /*lba*/ srclba + donebytes / srcblock, + /*lba*/ srclba, /*num_blocks*/ roundbytes / srcblock, /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); @@ -910,7 +928,7 @@ tpc_process_b2b(struct tpc_list *list) /*read_op*/ 0, /*byte2*/ 0, /*minimum_cdb_size*/ 0, - /*lba*/ dstlba + donebytes / dstblock, + /*lba*/ dstlba, /*num_blocks*/ roundbytes / dstblock, /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); @@ -922,6 +940,8 @@ tpc_process_b2b(struct tpc_list *list) TAILQ_INSERT_TAIL(prun, tior, rlinks); prun = &tior->run; donebytes += roundbytes; + srclba += roundbytes / srcblock; + dstlba += roundbytes / dstblock; } while ((tior = TAILQ_FIRST(&run)) != NULL) { @@ -961,7 +981,7 @@ tpc_process_verify(struct tpc_list *list TAILQ_INIT(&list->allio); seg = (struct scsi_ec_segment_verify *)list->seg[list->curseg]; - sl = tpc_resolve(list, scsi_2btoul(seg->src_cscd), NULL); + sl = tpc_resolve(list, scsi_2btoul(seg->src_cscd), NULL, NULL, NULL); if (sl >= CTL_MAX_LUNS) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, @@ -1019,7 +1039,7 @@ tpc_process_register_key(struct tpc_list TAILQ_INIT(&list->allio); seg = (struct scsi_ec_segment_register_key *)list->seg[list->curseg]; - dl = tpc_resolve(list, scsi_2btoul(seg->dst_cscd), NULL); + dl = tpc_resolve(list, scsi_2btoul(seg->dst_cscd), NULL, NULL, NULL); if (dl >= CTL_MAX_LUNS) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, @@ -1090,7 +1110,7 @@ tpc_process_wut(struct tpc_list *list) int drange, srange; off_t doffset, soffset; off_t srclba, dstlba, numbytes, donebytes, roundbytes; - uint32_t srcblock, dstblock; + uint32_t srcblock, dstblock, pb, pbo, adj; if (list->stage > 0) { /* Cleanup after previous rounds. */ @@ -1118,6 +1138,11 @@ tpc_process_wut(struct tpc_list *list) &drange, &doffset) != 0) return (CTL_RETVAL_COMPLETE); dstblock = list->lun->be_lun->blocksize; + pb = dstblock << list->lun->be_lun->pblockexp; + if (list->lun->be_lun->pblockoff > 0) + pbo = pb - dstblock * list->lun->be_lun->pblockoff; + else + pbo = 0; /* Check where we are on source ranges list. */ srcblock = list->token->blocksize; @@ -1131,12 +1156,20 @@ tpc_process_wut(struct tpc_list *list) } srclba = scsi_8btou64(list->token->range[srange].lba) + soffset; - numbytes = srcblock * omin(TPC_MAX_IOCHUNK_SIZE / srcblock, - (scsi_4btoul(list->token->range[srange].length) - soffset)); dstlba = scsi_8btou64(list->range[drange].lba) + doffset; - numbytes = omin(numbytes, - dstblock * omin(TPC_MAX_IOCHUNK_SIZE / dstblock, - (scsi_4btoul(list->range[drange].length) - doffset))); + numbytes = srcblock * + (scsi_4btoul(list->token->range[srange].length) - soffset); + numbytes = omin(numbytes, dstblock * + (scsi_4btoul(list->range[drange].length) - doffset)); + if (numbytes > TPC_MAX_IOCHUNK_SIZE) { + numbytes = TPC_MAX_IOCHUNK_SIZE; + numbytes -= numbytes % dstblock; + if (pb > dstblock) { + adj = (dstlba * dstblock + numbytes - pbo) % pb; + if (numbytes > adj) + numbytes -= adj; + } + } if (numbytes % srcblock != 0 || numbytes % dstblock != 0) { ctl_set_sense(list->ctsio, /*current_error*/ 1, @@ -1157,7 +1190,16 @@ tpc_process_wut(struct tpc_list *list) list->tbdio = 1; TAILQ_INIT(&list->allio); while (donebytes < numbytes) { - roundbytes = MIN(numbytes - donebytes, TPC_MAX_IO_SIZE); + roundbytes = numbytes - donebytes; + if (roundbytes > TPC_MAX_IO_SIZE) { + roundbytes = TPC_MAX_IO_SIZE; + roundbytes -= roundbytes % dstblock; + if (pb > dstblock) { + adj = (dstlba * dstblock + roundbytes - pbo) % pb; + if (roundbytes > adj) + roundbytes -= adj; + } + } tior = malloc(sizeof(*tior), M_CTL, M_WAITOK | M_ZERO); TAILQ_INIT(&tior->run); @@ -1170,7 +1212,7 @@ tpc_process_wut(struct tpc_list *list) /*read_op*/ 1, /*byte2*/ 0, /*minimum_cdb_size*/ 0, - /*lba*/ srclba + donebytes / srcblock, + /*lba*/ srclba, /*num_blocks*/ roundbytes / srcblock, /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); @@ -1189,7 +1231,7 @@ tpc_process_wut(struct tpc_list *list) /*read_op*/ 0, /*byte2*/ 0, /*minimum_cdb_size*/ 0, - /*lba*/ dstlba + donebytes / dstblock, + /*lba*/ dstlba, /*num_blocks*/ roundbytes / dstblock, /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); @@ -1201,6 +1243,8 @@ tpc_process_wut(struct tpc_list *list) TAILQ_INSERT_TAIL(prun, tior, rlinks); prun = &tior->run; donebytes += roundbytes; + srclba += roundbytes / srcblock; + dstlba += roundbytes / dstblock; } while ((tior = TAILQ_FIRST(&run)) != NULL) { Modified: head/sys/cam/ctl/ctl_tpc.h ============================================================================== --- head/sys/cam/ctl/ctl_tpc.h Thu Feb 12 15:34:16 2015 (r278624) +++ head/sys/cam/ctl/ctl_tpc.h Thu Feb 12 15:46:44 2015 (r278625) @@ -32,7 +32,7 @@ void tpc_done(union ctl_io *io); uint64_t tpcl_resolve(struct ctl_softc *softc, int init_port, - struct scsi_ec_cscd *cscd, uint32_t *ss); + struct scsi_ec_cscd *cscd, uint32_t *ss, uint32_t *ps, uint32_t *pso); union ctl_io * tpcl_alloc_io(void); int tpcl_queue(union ctl_io *io, uint64_t lun); Modified: head/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc_local.c Thu Feb 12 15:34:16 2015 (r278624) +++ head/sys/cam/ctl/ctl_tpc_local.c Thu Feb 12 15:46:44 2015 (r278625) @@ -309,7 +309,7 @@ tpcl_done(union ctl_io *io) uint64_t tpcl_resolve(struct ctl_softc *softc, int init_port, - struct scsi_ec_cscd *cscd, uint32_t *ss) + struct scsi_ec_cscd *cscd, uint32_t *ss, uint32_t *ps, uint32_t *pso) { struct scsi_ec_cscd_id *cscdid; struct ctl_port *port; @@ -337,6 +337,12 @@ tpcl_resolve(struct ctl_softc *softc, in lunid = lun->lun; if (ss && lun->be_lun) *ss = lun->be_lun->blocksize; + if (ps && lun->be_lun) + *ps = lun->be_lun->blocksize << + lun->be_lun->pblockexp; + if (pso && lun->be_lun) + *pso = lun->be_lun->blocksize * + lun->be_lun->pblockoff; break; } } From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 17:16:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 401C220E; Thu, 12 Feb 2015 17:16: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12040ED2; Thu, 12 Feb 2015 17:16:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CHGsiA092510; Thu, 12 Feb 2015 17:16:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CHGsbm092509; Thu, 12 Feb 2015 17:16:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502121716.t1CHGsbm092509@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Feb 2015 17:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278627 - head/lib/libthr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 17:16:55 -0000 Author: kib Date: Thu Feb 12 17:16:54 2015 New Revision: 278627 URL: https://svnweb.freebsd.org/changeset/base/278627 Log: Update libthr(3) man page to reflect the work done to support dlopen. Noted and reviewed by: bdrewery Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libthr/libthr.3 Modified: head/lib/libthr/libthr.3 ============================================================================== --- head/lib/libthr/libthr.3 Thu Feb 12 17:01:54 2015 (r278626) +++ head/lib/libthr/libthr.3 Thu Feb 12 17:16:54 2015 (r278627) @@ -1,5 +1,5 @@ .\" Copyright (c) 2005 Robert N. M. Watson -.\" Copyright (c) 2014 The FreeBSD Foundation, Inc. +.\" Copyright (c) 2014,2015 The FreeBSD Foundation, Inc. .\" All rights reserved. .\" .\" Part of this documentation was written by @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 26, 2014 +.Dd February 12, 2015 .Dt LIBTHR 3 .Os .Sh NAME @@ -200,45 +200,25 @@ Bigger values reduce the frequency of th The value must be between 0 and 255. .El .Sh INTERACTION WITH RUN-TIME LINKER -The +On load, .Nm -library must appear before -.Li libc -in the global order of depended objects. -.Pp -Loading -.Nm -with the -.Xr dlopen 3 -call in the process after the program binary is activated -is not supported, and causes miscellaneous and hard-to-diagnose misbehaviour. -This is due to -.Nm -interposing several important -.Li libc -symbols to provide thread-safe services. -In particular, -.Dv errno -and the locking stubs from -.Li libc -are affected. -This requirement is currently not enforced. -.Pp -If the program loads any modules at run-time, and those modules may require -threading services, the main program binary must be linked with -.Li libpthread , -even if it does not require any services from the library. +installs interposing handlers into the hooks exported by +.Li libc . +The interposers provide real locking implementation instead of the +stubs for single-threaded processes in +.Li , +cancellation support and some modifications to the signal operations. .Pp .Nm cannot be unloaded; the .Xr dlclose 3 function does not perform any action when called with a handle for .Nm . -One of the reasons is that the interposing of +One of the reasons is that the internal interposing of .Li libc functions cannot be undone. .Sh SIGNALS -The implementation also interposes the user-installed +The implementation interposes the user-installed .Xr signal 3 handlers. This interposing is done to postpone signal delivery to threads which From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 20:57:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 783D4698; Thu, 12 Feb 2015 20:57: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56251AC3; Thu, 12 Feb 2015 20:57:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CKvwbC098926; Thu, 12 Feb 2015 20:57:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CKvwOC098925; Thu, 12 Feb 2015 20:57:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502122057.t1CKvwOC098925@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 12 Feb 2015 20:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278633 - head/bin/pkill/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 20:57:58 -0000 Author: ngie Date: Thu Feb 12 20:57:57 2015 New Revision: 278633 URL: https://svnweb.freebsd.org/changeset/base/278633 Log: Refactor the tests 1. `id -u` -> 0 is now only checked once; the entire test script is now skipped if this assertion is violated 2. De-dent whitespace, based on 1. 3. Only setup the symlink for $sleep once at the top of the script, and tear it down once at the bottom of the script Modified: head/bin/pkill/tests/pgrep-j_test.sh Modified: head/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- head/bin/pkill/tests/pgrep-j_test.sh Thu Feb 12 20:35:30 2015 (r278632) +++ head/bin/pkill/tests/pgrep-j_test.sh Thu Feb 12 20:57:57 2015 (r278633) @@ -19,79 +19,68 @@ jail_name_to_jid() base=pgrep_j_test +if [ `id -u` -ne 0 ]; then + echo "1..0 # skip Test needs uid 0." + exit 0 +fi + echo "1..3" +sleep=$(pwd)/sleep.txt +ln -sf /bin/sleep $sleep + name="pgrep -j " -if [ `id -u` -eq 0 ]; then - sleep=$(pwd)/sleep.txt - ln -sf /bin/sleep $sleep - jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_1_1.pid $sleep 5 & - - jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_1_2.pid $sleep 5 & - - jid1=$(jail_name_to_jid ${base}_1_1) - jid2=$(jail_name_to_jid ${base}_1_2) - jid="${jid1},${jid2}" - pid1="$(pgrep -f -x -j $jid "$sleep 5" | sort)" - pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_1_1.pid)" \ - $(cat ${PWD}/${base}_1_2.pid) | sort) - if [ "$pid1" = "$pid2" ]; then - echo "ok 1 - $name" - else - echo "not ok 1 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" - fi - [ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) - [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) - rm -f $sleep +jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_1_1.pid $sleep 5 & + +jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_1_2.pid $sleep 5 & + +jid1=$(jail_name_to_jid ${base}_1_1) +jid2=$(jail_name_to_jid ${base}_1_2) +jid="${jid1},${jid2}" +pid1="$(pgrep -f -x -j $jid "$sleep 5" | sort)" +pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_1_1.pid)" \ + $(cat ${PWD}/${base}_1_2.pid) | sort) +if [ "$pid1" = "$pid2" ]; then + echo "ok 1 - $name" else - echo "ok 1 - $name # skip Test needs uid 0." + echo "not ok 1 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" fi +[ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) +[ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) name="pgrep -j any" -if [ `id -u` -eq 0 ]; then - sleep=$(pwd)/sleep.txt - ln -sf /bin/sleep $sleep - jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_2_1.pid $sleep 5 & - - jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_2_2.pid $sleep 5 & - - sleep 2 - pid1="$(pgrep -f -x -j any "$sleep 5" | sort)" - pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_2_1.pid)" \ - $(cat ${PWD}/${base}_2_2.pid) | sort) - if [ "$pid1" = "$pid2" ]; then - echo "ok 2 - $name" - else - echo "not ok 2 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" - fi - [ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) - [ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) - rm -f $sleep +jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_2_1.pid $sleep 5 & + +jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_2_2.pid $sleep 5 & + +sleep 2 +pid1="$(pgrep -f -x -j any "$sleep 5" | sort)" +pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_2_1.pid)" \ + $(cat ${PWD}/${base}_2_2.pid) | sort) +if [ "$pid1" = "$pid2" ]; then + echo "ok 2 - $name" else - echo "ok 2 - $name # skip Test needs uid 0." + echo "not ok 2 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" fi +[ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) +[ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) name="pgrep -j none" -if [ `id -u` -eq 0 ]; then - sleep=$(pwd)/sleep.txt - ln -sf /bin/sleep $sleep - daemon -p ${PWD}/${base}_3_1.pid $sleep 5 & - jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_3_2.pid $sleep 5 & - sleep 2 - pid="$(pgrep -f -x -j none "$sleep 5")" - if [ "$pid" = "$(cat ${PWD}/${base}_3_1.pid)" ]; then - echo "ok 3 - $name" - else - echo "not ok 3 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" - fi - rm -f $sleep - [ -f ${PWD}/${base}_3_1.pid ] && kill $(cat $PWD/${base}_3_1.pid) - [ -f ${PWD}/${base}_3_2.pid ] && kill $(cat $PWD/${base}_3_2.pid) +daemon -p ${PWD}/${base}_3_1.pid $sleep 5 & +jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_3_2.pid $sleep 5 & +sleep 2 +pid="$(pgrep -f -x -j none "$sleep 5")" +if [ "$pid" = "$(cat ${PWD}/${base}_3_1.pid)" ]; then + echo "ok 3 - $name" else - echo "ok 3 - $name # skip Test needs uid 0." + echo "not ok 3 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" fi +[ -f ${PWD}/${base}_3_1.pid ] && kill $(cat $PWD/${base}_3_1.pid) +[ -f ${PWD}/${base}_3_2.pid ] && kill $(cat $PWD/${base}_3_2.pid) + +rm -f $sleep From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 21:07:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B562EB9; Thu, 12 Feb 2015 21:07: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1643AC5A; Thu, 12 Feb 2015 21:07:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CL7gWs004042; Thu, 12 Feb 2015 21:07:42 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CL7gaO004041; Thu, 12 Feb 2015 21:07:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502122107.t1CL7gaO004041@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 12 Feb 2015 21:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278634 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 21:07:43 -0000 Author: pfg Date: Thu Feb 12 21:07:42 2015 New Revision: 278634 URL: https://svnweb.freebsd.org/changeset/base/278634 Log: ulimit(3): Fix broken check. The existing implementation had a broken comparison that could overflow. Replace this with a check that avoids the overflow before it happens. Consistently return a maximum value also on the case of negative arguments since negative is considered an overflow and means infinity for our current setrlimit(). Discussed with: bde (rather extensively) CID: 1199295 MFC after: 1 week Modified: head/lib/libc/gen/ulimit.c Modified: head/lib/libc/gen/ulimit.c ============================================================================== --- head/lib/libc/gen/ulimit.c Thu Feb 12 20:57:57 2015 (r278633) +++ head/lib/libc/gen/ulimit.c Thu Feb 12 21:07:42 2015 (r278634) @@ -53,13 +53,13 @@ ulimit(int cmd, ...) va_start(ap, cmd); arg = va_arg(ap, long); va_end(ap); + if (arg > RLIM_INFINITY / 512 || arg < 0) + arg = RLIM_INFINITY / 512; limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512; /* The setrlimit() function sets errno to EPERM if needed. */ if (setrlimit(RLIMIT_FSIZE, &limit) == -1) return (-1); - if (arg * 512 > LONG_MAX) - return (LONG_MAX); return (arg); } else { errno = EINVAL; From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 21:10:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81AAC1CD; Thu, 12 Feb 2015 21:10: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54D54D07; Thu, 12 Feb 2015 21:10:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CLAXZq004555; Thu, 12 Feb 2015 21:10:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CLAX0g004554; Thu, 12 Feb 2015 21:10:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502122110.t1CLAX0g004554@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 12 Feb 2015 21:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278636 - head/bin/pkill/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 21:10:33 -0000 Author: ngie Date: Thu Feb 12 21:10:32 2015 New Revision: 278636 URL: https://svnweb.freebsd.org/changeset/base/278636 Log: Parameterize out the amount of sleep done in each test Set the value in each test to a different amount to avoid potential side-effects with other instances of the test (or lingering processes) still being present on the system Modified: head/bin/pkill/tests/pgrep-j_test.sh Modified: head/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- head/bin/pkill/tests/pgrep-j_test.sh Thu Feb 12 21:10:24 2015 (r278635) +++ head/bin/pkill/tests/pgrep-j_test.sh Thu Feb 12 21:10:32 2015 (r278636) @@ -30,16 +30,17 @@ sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep name="pgrep -j " +sleep_amount=5 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_1_1.pid $sleep 5 & + command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_1_2.pid $sleep 5 & + command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount & jid1=$(jail_name_to_jid ${base}_1_1) jid2=$(jail_name_to_jid ${base}_1_2) jid="${jid1},${jid2}" -pid1="$(pgrep -f -x -j $jid "$sleep 5" | sort)" +pid1="$(pgrep -f -x -j $jid "$sleep $sleep_amount" | sort)" pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_1_1.pid)" \ $(cat ${PWD}/${base}_1_2.pid) | sort) if [ "$pid1" = "$pid2" ]; then @@ -51,14 +52,15 @@ fi [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) name="pgrep -j any" +sleep_amount=6 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_2_1.pid $sleep 5 & + command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_2_2.pid $sleep 5 & + command=daemon -p ${PWD}/${base}_2_2.pid $sleep $sleep_amount & sleep 2 -pid1="$(pgrep -f -x -j any "$sleep 5" | sort)" +pid1="$(pgrep -f -x -j any "$sleep $sleep_amount" | sort)" pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_2_1.pid)" \ $(cat ${PWD}/${base}_2_2.pid) | sort) if [ "$pid1" = "$pid2" ]; then @@ -70,11 +72,12 @@ fi [ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) name="pgrep -j none" -daemon -p ${PWD}/${base}_3_1.pid $sleep 5 & +sleep_amount=7 +daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount & jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_3_2.pid $sleep 5 & + command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount & sleep 2 -pid="$(pgrep -f -x -j none "$sleep 5")" +pid="$(pgrep -f -x -j none "$sleep $sleep_amount")" if [ "$pid" = "$(cat ${PWD}/${base}_3_1.pid)" ]; then echo "ok 3 - $name" else From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 21:12:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF18D33C; Thu, 12 Feb 2015 21:12:36 +0000 (UTC) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 981E8D25; Thu, 12 Feb 2015 21:12:36 +0000 (UTC) Received: by mail-ig0-f171.google.com with SMTP id h15so6564844igd.4; Thu, 12 Feb 2015 13:12:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=9gAItp56aNt5gwvRMfLqPifFdvexFEJ+Ywvb8nRD37I=; b=x5W15BUgCXlLfMjlwZaU+fC5rQ5Q2oMnO1l6XcV1+znAvGd9e1Nbmp6tQ1lMFhYnrj mGXgZnMAUPBQvqMSLwoTVOuGzcPM4Xgi1/ne3skJT9o48IhleIuL2Y4/MYmfWU3I5YIi EdE3Vv4jzS+F3d5VMJaAnDf5GmMbjSQzz/Ym5A0RvSGwPUhql8pOBPO+0hHBFsYvotkm bakPCH8VEXykLDkr20sJUmlvZ1MmQAl43SHwaxaed5PxAN5i4s4+Ar1s8uLDioB794mu OZCFmem8CodmclXt3+OvBsdP8Y/slH1KLJ9gFv8MjptuGVQmQZjc7pBH1kxXxvNpFPOa Z5jQ== X-Received: by 10.42.77.9 with SMTP id g9mr10917405ick.78.1423775556112; Thu, 12 Feb 2015 13:12:36 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:5de4:da0f:932c:57df? ([2601:8:ab80:7d6:5de4:da0f:932c:57df]) by mx.google.com with ESMTPSA id sd7sm1894115igb.20.2015.02.12.13.12.35 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Feb 2015 13:12:35 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_2D9F087C-03E5-4A8D-AC83-1C2FBCA6D12D"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r278323 - in head: etc/rc.d usr.sbin/jail From: Garrett Cooper In-Reply-To: Date: Thu, 12 Feb 2015 13:12:33 -0800 Message-Id: References: <201502061754.t16HssXU042750@svn.freebsd.org> <343803A3-CFA3-4766-8294-139A6D8C0235@gmail.com> To: James Gritton X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , jenkins-admin@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 21:12:37 -0000 --Apple-Mail=_2D9F087C-03E5-4A8D-AC83-1C2FBCA6D12D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Feb 9, 2015, at 18:51, James Gritton wrote: > On 2015-02-06 22:23, Garrett Cooper wrote: >> On Feb 6, 2015, at 18:38, James Gritton wrote: >>> On 2015-02-06 19:23, Garrett Cooper wrote: >>>> I think you broke the Jenkins tests runs, and potentially jail = support >>>> in some edgecases: >>>> https://jenkins.freebsd.org/job/FreeBSD_HEAD-tests2/651/ >>> Where do I go from here? There error you refer to certainly seems = jail-related, which leads me to guess at something disconnected between = the matching rc.d/jail and jail(8) change (i.e. using the new rc file = with the old jail program). But that's really just a wild guess. Is = there somewhere I look for more information? For example, where does = Jenkins actually do its thing? >>> Sorry for being so stupid in this - Jenkins has only been on the = very edge of my awareness until now. >> I honestly don=92t think it=92s Jenkins because Jenkins runs in = bhyve. I >> think you accidentally broke option handling in the jail = configuration >> (please see my other reply about added =93break;=94 statements). >> ... >> You can verify your changes by doing: >> % (cd /usr/tests/bin/pkill; sudo kyua test) >=20 > After some testing and looking around, I've decided the problem = definitely isn't in rc.d where I thought it might be. I've also decided = it's probably not in my patch either. >=20 > I've run this kyua test on a 10 system (don't have current handy for = such things at the moment), and sometimes I would see a failure and = sometimes I wouldn't. This was whether I was using the new or old jail = code. Later in the day, when the box was less loaded, it seemed to = always pass. Looking at the pkill-j_test script, I see jails being = created with sleep commands both inside and outside the jail around its = creation. I'm guessing this script is very sensitive to timing issues = that could be cause by (among other things) system load. The jail = commands in this script were also very simple, with the only parameters = used being: path, name, ip4.addr, and command. This isn't some kind of = esoteric exercising of the jail(8) options, and I would expect if it = works at one time it would work at another. I've "hand-run" these = particular jail commands and couldn't get them to fail (and the actual = content of the jail(8) changes were tests already). >=20 > I looked at the freebsd-current (I think) list where the Jenkins = errors are posted, and it's true it started failing the pkill-j test at = the time I made my change. But it's also true that it had failed that = test once the day before my change, and then started passing it again. = This particular test just seems to be fragile. >=20 > So I don't have anywhere else to go with this. I'm going to assume = jail(8) isn't the problem here. The tests are racy and make some interesting assumptions. It appears = that WITNESS plays a part in it, and I bet VIMAGE (something that I = don=92t have in my kernel config) plays a part in it too. I say this = because I just ran into the issue when running the tests in a tight loop = on my VMware workstation 7 instance with code from r278636. Doesn=92t surprise me because before r272305, it was failing = consistently on head, so what Craig did in that commit helped, but it = didn=92t fully fix the raciness of the tests. I=92m going to recompile my system with VIMAGE and see if that impacts = performance of the tests, and if so, I=92ll adjust the sleep between = setting up the jailed instances, and waiting for them to be fully = formed. Thanks! $ while : ; do sudo prove -rv pgrep-j_test.sh || break; done pgrep-j_test.sh ..=20 1..3 usage: pgrep [-LSfilnoqvx] [-d delim] [-F pidfile] [-G gid] [-M core] = [-N system] [-P ppid] [-U uid] [-c class] [-g pgrp] [-j jid] [-s sid] [-t tty] [-u euid] pattern ... not ok 1 - pgrep -j # pgrep output: '', pidfile output: '74275 = 74278' ok 2 - pgrep -j any ok 3 - pgrep -j none Failed 1/3 subtests=20 Test Summary Report ------------------- pgrep-j_test.sh (Wstat: 0 Tests: 3 Failed: 1) Failed test: 1 Files=3D1, Tests=3D3, 5 wallclock secs ( 0.04 usr 0.02 sys + 0.02 = cusr 0.55 csys =3D 0.63 CPU) Result: FAIL --Apple-Mail=_2D9F087C-03E5-4A8D-AC83-1C2FBCA6D12D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU3RdBAAoJEMZr5QU6S73eKkUH/2HVmt2Mrte77j6J5Fj5fLsa VxbF+QHPmEhhLShRfJ7XC166WMZdt5Weh2sDbHJ8FgMVny6yYvAbCms5+eoPXgZp /6niDYG8maeUEczCY9PY6gqImmL4EXn1YpQgP4s+Mu5m44HIIZLL5MnZvrbaWFOw WZll/O6eIXow/NRpw+ra6G3mmkC7eDg8IVq0kA2vIjI0c0WdZM53rIf0RQs/5txX GLxyWIWVU6VzNO6jGlLFFDa1dzJE4otNqLJuOTHtHWLmdT0lEnCqntUizPdFL9Gh q/2VG+jptijtOqaGLCompp5hICAoL240WmXnmWhU8xDsshO5ZcHo17Nidb0GCIY= =q2EA -----END PGP SIGNATURE----- --Apple-Mail=_2D9F087C-03E5-4A8D-AC83-1C2FBCA6D12D-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 21:57:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 874AE14F; Thu, 12 Feb 2015 21:57:36 +0000 (UTC) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 517261B2; Thu, 12 Feb 2015 21:57:36 +0000 (UTC) Received: by pdbfl12 with SMTP id fl12so14801662pdb.2; Thu, 12 Feb 2015 13:57:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=3xXYgmKBLDu4oSr5u//CnIZUej2MDHyXyweSpqNhRcI=; b=jCvKHfqPJwqcPWlFBTKHTzgtGxWiMVA197H7m6HjpZTB5tsRZY0Z3vKMyNrf85LePf 8KIT87ABrfl35zdEvDjdUSQACi9zmpieP955BbjZ5J3pE06ujZUX0+ioV5ec0b3InQ90 +zhJwQycj5reudxrxJfhNBuOIb2KAiGsWzX6OHz0BwGmZ2G3n0UZM//faczeWoGKehn8 k+loxcms2gjKvwYkySYCUzR9k6wcuFxSbmSjFlQZet2xg0QEGZE3k6LGD805Y4gksmqq frnCpKePHsJ+zn4uQiUmiH83ua37hsABWcRjXUO0nLROJT5OZG+MODCkMwMA+2FJzmgW yxoA== X-Received: by 10.70.37.202 with SMTP id a10mr10071444pdk.108.1423778255187; Thu, 12 Feb 2015 13:57:35 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:5de4:da0f:932c:57df? ([2601:8:ab80:7d6:5de4:da0f:932c:57df]) by mx.google.com with ESMTPSA id n8sm4668376pdm.62.2015.02.12.13.57.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Feb 2015 13:57:34 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_178185C1-3F5E-47FB-8470-97460255EB0C"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r278323 - in head: etc/rc.d usr.sbin/jail From: Garrett Cooper In-Reply-To: Date: Thu, 12 Feb 2015 13:57:31 -0800 Message-Id: <42AB9765-E63E-494B-A3FE-D9FF696921D9@gmail.com> References: <201502061754.t16HssXU042750@svn.freebsd.org> <343803A3-CFA3-4766-8294-139A6D8C0235@gmail.com> To: James Gritton X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , jenkins-admin@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 21:57:36 -0000 --Apple-Mail=_178185C1-3F5E-47FB-8470-97460255EB0C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Feb 12, 2015, at 13:12, Garrett Cooper wrote: > On Feb 9, 2015, at 18:51, James Gritton wrote: >=20 >> On 2015-02-06 22:23, Garrett Cooper wrote: >>> On Feb 6, 2015, at 18:38, James Gritton wrote: >>>> On 2015-02-06 19:23, Garrett Cooper wrote: >>>>> I think you broke the Jenkins tests runs, and potentially jail = support >>>>> in some edgecases: >>>>> https://jenkins.freebsd.org/job/FreeBSD_HEAD-tests2/651/ >>>> Where do I go from here? There error you refer to certainly seems = jail-related, which leads me to guess at something disconnected between = the matching rc.d/jail and jail(8) change (i.e. using the new rc file = with the old jail program). But that's really just a wild guess. Is = there somewhere I look for more information? For example, where does = Jenkins actually do its thing? >>>> Sorry for being so stupid in this - Jenkins has only been on the = very edge of my awareness until now. >>> I honestly don=92t think it=92s Jenkins because Jenkins runs in = bhyve. I >>> think you accidentally broke option handling in the jail = configuration >>> (please see my other reply about added =93break;=94 statements). >>> ... >>> You can verify your changes by doing: >>> % (cd /usr/tests/bin/pkill; sudo kyua test) >>=20 >> After some testing and looking around, I've decided the problem = definitely isn't in rc.d where I thought it might be. I've also decided = it's probably not in my patch either. >>=20 >> I've run this kyua test on a 10 system (don't have current handy for = such things at the moment), and sometimes I would see a failure and = sometimes I wouldn't. This was whether I was using the new or old jail = code. Later in the day, when the box was less loaded, it seemed to = always pass. Looking at the pkill-j_test script, I see jails being = created with sleep commands both inside and outside the jail around its = creation. I'm guessing this script is very sensitive to timing issues = that could be cause by (among other things) system load. The jail = commands in this script were also very simple, with the only parameters = used being: path, name, ip4.addr, and command. This isn't some kind of = esoteric exercising of the jail(8) options, and I would expect if it = works at one time it would work at another. I've "hand-run" these = particular jail commands and couldn't get them to fail (and the actual = content of the jail(8) changes were tests already). >>=20 >> I looked at the freebsd-current (I think) list where the Jenkins = errors are posted, and it's true it started failing the pkill-j test at = the time I made my change. But it's also true that it had failed that = test once the day before my change, and then started passing it again. = This particular test just seems to be fragile. >>=20 >> So I don't have anywhere else to go with this. I'm going to assume = jail(8) isn't the problem here. >=20 > The tests are racy and make some interesting assumptions. It appears = that WITNESS plays a part in it, and I bet VIMAGE (something that I = don=92t have in my kernel config) plays a part in it too. I say this = because I just ran into the issue when running the tests in a tight loop = on my VMware workstation 7 instance with code from r278636. >=20 > Doesn=92t surprise me because before r272305, it was failing = consistently on head, so what Craig did in that commit helped, but it = didn=92t fully fix the raciness of the tests. >=20 > I=92m going to recompile my system with VIMAGE and see if that impacts = performance of the tests, and if so, I=92ll adjust the sleep between = setting up the jailed instances, and waiting for them to be fully = formed. >=20 > Thanks! >=20 > $ while : ; do sudo prove -rv pgrep-j_test.sh || break; done > pgrep-j_test.sh ..=20 > 1..3 > usage: pgrep [-LSfilnoqvx] [-d delim] [-F pidfile] [-G gid] [-M core] = [-N system] > [-P ppid] [-U uid] [-c class] [-g pgrp] [-j jid] > [-s sid] [-t tty] [-u euid] pattern ... > not ok 1 - pgrep -j # pgrep output: '', pidfile output: '74275 = 74278' > ok 2 - pgrep -j any > ok 3 - pgrep -j none > Failed 1/3 subtests=20 >=20 > Test Summary Report > ------------------- > pgrep-j_test.sh (Wstat: 0 Tests: 3 Failed: 1) > Failed test: 1 > Files=3D1, Tests=3D3, 5 wallclock secs ( 0.04 usr 0.02 sys + 0.02 = cusr 0.55 csys =3D 0.63 CPU) > Result: FAIL This Jenkins run is interesting: = https://jenkins.freebsd.org/job/FreeBSD_HEAD-tests2/686/testReport/junit/b= in.pkill/pgrep-j_test/main/ . The first run passed, but the second one = didn=92t (more output than expected). This error shouldn=92t occur after = r278636, but it definitely confirms the fact that the test is racy, in = other ways. --Apple-Mail=_178185C1-3F5E-47FB-8470-97460255EB0C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU3SHMAAoJEMZr5QU6S73eKSQH/06dNtSuW9SPvq4rTTwfQi9o UnPDeG5F4FUaPYaD0o6J5NKs+6GGcJy03cMBhThbHlJo3TUJU7bZCOUlSX25s4V8 BaR65UonwhkiqUh1GarUMHS1kCAWIwhGTfrx5A23pSt6EHA7CjDv9qxaLnGRwhln i9xWFcDl1yo1/ihxYF/gT1KBhA7GMr1f0ZmqpXGDR6bSplPN2y5INJKuRQ+fXexg rQbDFxoVSmk7A/2W1ln8k6x/TNHhW78KO8mdyvd5Fixw0vt8jfnALS8giHoNW6my RFSqnvytXtrFw98O+Cl1FerCa5RcFBhT7s+WfV+Rgj+HGzgZACGAyt851e6gAGk= =cjq3 -----END PGP SIGNATURE----- --Apple-Mail=_178185C1-3F5E-47FB-8470-97460255EB0C-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 22:06:06 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E94CB386; Thu, 12 Feb 2015 22:06:05 +0000 (UTC) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [IPv6:2607:f8b0:4001:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5EE32EA; Thu, 12 Feb 2015 22:06:05 +0000 (UTC) Received: by mail-ig0-f180.google.com with SMTP id b16so6946587igk.1; Thu, 12 Feb 2015 14:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=5jWkIe7qc4a6BOQX2dDyE2lljVbcQVxUHxmQh7qqsj0=; b=qfmu75iQNlmWopWFKC3IL7pp6uA2oHH8gUNQkAyOjEVI3H47bSOVAwUBvAbDCn6DMN 7vjTmdaD6Qe/CJsXRrAW1VTs062ECoxAhLQJwcIkcv22nX/w4DarkD0EdaaXi95QK4Wk GYSwVhFAitw/3yEHhtRvTJXb4UOhntnh993hPeYUOU0S4F3WQ5oUCEbMAAROfzFFuZ5o S1tyTMPYc/45KrW3b07sKhRRArTWRj+kRoRzEufSVoctw1i6+t8IwmO/vW9PCQFUqKyA gHCPNg2kI+GFMRoQoE2o5uwmLYNB/ln2lPEVAhHz5oufiaeO7wiyT5zKqpoSrj81e/yN o2Lw== X-Received: by 10.107.158.146 with SMTP id h140mr7536225ioe.27.1423778765031; Thu, 12 Feb 2015 14:06:05 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:5de4:da0f:932c:57df? ([2601:8:ab80:7d6:5de4:da0f:932c:57df]) by mx.google.com with ESMTPSA id sd7sm1982425igb.20.2015.02.12.14.06.04 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Feb 2015 14:06:04 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_400BC6BF-32A8-4232-B469-38FA9E43C759"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r278475 - head/usr.sbin/pw/tests From: Garrett Cooper In-Reply-To: <201502092115.t19LFrEk019578@svn.freebsd.org> Date: Thu, 12 Feb 2015 14:06:02 -0800 Message-Id: <39C8D48F-1962-4393-8FF3-C96DDBF6721E@gmail.com> References: <201502092115.t19LFrEk019578@svn.freebsd.org> To: Brad Davis X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , oneil.rs@gmail.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 22:06:06 -0000 --Apple-Mail=_400BC6BF-32A8-4232-B469-38FA9E43C759 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi Brad, On Feb 9, 2015, at 13:15, Brad Davis wrote: > Author: brd (doc committer) > Date: Mon Feb 9 21:15:52 2015 > New Revision: 278475 > URL: https://svnweb.freebsd.org/changeset/base/278475 >=20 > Log: > Add tests for `pw usernext'. >=20 > PR: 197120 > Submitted by: Robert O'Neil > Approved by: will >=20 > Added: > head/usr.sbin/pw/tests/pw_usernext.sh (contents, props changed) > Modified: > head/usr.sbin/pw/tests/Makefile =85 > + var0=3D1 > + LIMIT=3D`jot -r 1 2 10` > + while [ "$var0" -lt "$LIMIT" ] > + do > + atf_check -s exit:0 ${PW} useradd -n test$var0 -g 0 > + var0=3D`expr $var0 + 1` > + done > + atf_check -s exit:0 -o match:"100${LIMIT}:1001}=94 \ This line is incorrect (there=92s a trailing `}` after 1001). Removing it will fix the test, but is assuming that 1001 will always be = the next group correct (it=92s correct in the default install, but IIRC = it wasn=92t correct if you started groups at gid=3D500)? Wouldn=92t it be safer to create a bogus group, get the gid for the = group, then test to ensure that that god is matched? Thanks! --Apple-Mail=_400BC6BF-32A8-4232-B469-38FA9E43C759 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU3SPKAAoJEMZr5QU6S73e/6QH/1HgIs9AuzdL/Ehvh/XI8YL7 pgbLjBYbwm4S/sZt7cMaMhU+idyy54el3Lka5RRccPutdoF+AbG0uQ2FPLzMafoW 26lTVlRNXT7kpc0HWIAhY/z6ru8HG1Hd/Cxs2pLOI1LvEBKiLrDgrb0rnTMAt3hD Yvrk5wsAHR6nCUmNEYzH6s1QSGrOVwKNjMRl5A1O6mlGhPoogH3cLHkinU+dVHzK Ckv/d+ZmAiZHJq1YJ5E51Bd8+xSOGYD+xwQU2CFHdAwycu/2p8OkxIj5DbtccUDl Cpc2Ccykzw3XMZMk/O1KTjeYcA1g1UZdQ9OQJvMEfDGK1MJesrsoJ/biXSFYRPg= =PTxS -----END PGP SIGNATURE----- --Apple-Mail=_400BC6BF-32A8-4232-B469-38FA9E43C759-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 22:20:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BF625D7; Thu, 12 Feb 2015 22:20: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB30068E; Thu, 12 Feb 2015 22:20:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CMKYr2040499; Thu, 12 Feb 2015 22:20:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CMKY8t040498; Thu, 12 Feb 2015 22:20:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502122220.t1CMKY8t040498@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 12 Feb 2015 22:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278640 - 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.18-1 Precedence: list List-Id: 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, 12 Feb 2015 22:20:35 -0000 Author: glebius Date: Thu Feb 12 22:20:34 2015 New Revision: 278640 URL: https://svnweb.freebsd.org/changeset/base/278640 Log: Revise default limit for maximum of netgraph data items. With modern internet speeds the limit can be reached even on a single L2TP link. Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Thu Feb 12 21:20:28 2015 (r278639) +++ head/sys/netgraph/ng_base.c Thu Feb 12 22:20:34 2015 (r278640) @@ -2952,7 +2952,7 @@ uma_zone_t ng_qzone; uma_zone_t ng_qdzone; static int numthreads = 0; /* number of queue threads */ static int maxalloc = 4096;/* limit the damage of a leak */ -static int maxdata = 512; /* limit the damage of a DoS */ +static int maxdata = 4096; /* limit the damage of a DoS */ SYSCTL_INT(_net_graph, OID_AUTO, threads, CTLFLAG_RDTUN, &numthreads, 0, "Number of queue processing threads"); From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 22:28:15 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FC3086D; Thu, 12 Feb 2015 22:28:15 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B5F8D6DA; Thu, 12 Feb 2015 22:28:14 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id A286925D3A92; Thu, 12 Feb 2015 22:28:04 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D69E3C770A1; Thu, 12 Feb 2015 22:28:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 0aNImd3SHO0O; Thu, 12 Feb 2015 22:28:02 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:ccda:6447:f:a] (unknown [IPv6:fde9:577b:c1a9:4410:ccda:6447:f:a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 67B96C7709E; Thu, 12 Feb 2015 22:28:01 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278634 - head/lib/libc/gen From: "Bjoern A. Zeeb" In-Reply-To: <201502122107.t1CL7gaO004041@svn.freebsd.org> Date: Thu, 12 Feb 2015 22:27:41 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201502122107.t1CL7gaO004041@svn.freebsd.org> To: "Pedro F. Giffuni" X-Mailer: Apple Mail (2.2070.6) 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.18-1 Precedence: list List-Id: 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, 12 Feb 2015 22:28:15 -0000 > On 12 Feb 2015, at 21:07 , Pedro F. Giffuni wrote: >=20 > Author: pfg > Date: Thu Feb 12 21:07:42 2015 > New Revision: 278634 > URL: https://svnweb.freebsd.org/changeset/base/278634 >=20 > Log: > ulimit(3): Fix broken check. >=20 > The existing implementation had a broken comparison that could = overflow. > Replace this with a check that avoids the overflow before it happens. >=20 > Consistently return a maximum value also on the case of negative > arguments since negative is considered an overflow and means > infinity for our current setrlimit(). >=20 > Discussed with: bde (rather extensively) >=20 Did this compile? > CID: 1199295 > MFC after: 1 week >=20 > Modified: > head/lib/libc/gen/ulimit.c >=20 > Modified: head/lib/libc/gen/ulimit.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/lib/libc/gen/ulimit.c Thu Feb 12 20:57:57 2015 = (r278633) > +++ head/lib/libc/gen/ulimit.c Thu Feb 12 21:07:42 2015 = (r278634) > @@ -53,13 +53,13 @@ ulimit(int cmd, ...) > va_start(ap, cmd); > arg =3D va_arg(ap, long); > va_end(ap); > + if (arg > RLIM_INFINITY / 512 || arg < 0) > + arg =3D RLIM_INFINITY / 512; > limit.rlim_max =3D limit.rlim_cur =3D (rlim_t)arg * 512; >=20 > /* The setrlimit() function sets errno to EPERM if = needed. */ > if (setrlimit(RLIMIT_FSIZE, &limit) =3D=3D -1) > return (-1); > - if (arg * 512 > LONG_MAX) > - return (LONG_MAX); > return (arg); > } else { > errno =3D EINVAL; >=20 =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 22:36:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B7D3A78; Thu, 12 Feb 2015 22:36:27 +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)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 86BA1814; Thu, 12 Feb 2015 22:36:25 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1CMaNPD025278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 13 Feb 2015 01:36:23 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1CMaNZO025277; Fri, 13 Feb 2015 01:36:23 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 13 Feb 2015 01:36:23 +0300 From: Gleb Smirnoff To: Vsevolod Stakhov Subject: Re: svn commit: r278080 - head/sbin/ifconfig Message-ID: <20150212223623.GC15484@FreeBSD.org> References: <201502021303.t12D35Nf059543@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502021303.t12D35Nf059543@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 12 Feb 2015 22:36:27 -0000 On Mon, Feb 02, 2015 at 01:03:05PM +0000, Vsevolod Stakhov wrote: V> Author: vsevolod (ports committer) V> Date: Mon Feb 2 13:03:04 2015 V> New Revision: 278080 V> URL: https://svnweb.freebsd.org/changeset/base/278080 V> V> Log: V> Reorganize the list of addresses associated with an interface and group them V> based on the address family. This should help to recognize interfaces with V> multiple AF (e.g. ipv4 and ipv6) with many aliases or additional addresses. The V> order of addresses inside a single group is strictly preserved. V> V> Improve the scope_id output for AF_INET6 families, as the V> current approach uses hexadecimal string that is basically the ID of an V> interface, whilst this information is already depicted by getnameinfo(3) call. V> Therefore, now ifconfig just prints the scope of address as it is defined in V> 2.4 of RFC 2373. V> V> PR: 197270 V> Approved by: bapt V> MFC after: 2 weeks What about getifaddrs(3) sorting addresses? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 22:41:10 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF31FDFA for ; Thu, 12 Feb 2015 22:41:10 +0000 (UTC) Received: from nm35-vm3.bullet.mail.bf1.yahoo.com (nm35-vm3.bullet.mail.bf1.yahoo.com [72.30.238.75]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0370C85A for ; Thu, 12 Feb 2015 22:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1423780477; bh=27PcWVplcwiHSJBN0fn7sBBIWZ2Vjvgk8ZYfv3sMzUg=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=L3z/Won4b+EtyEok2u3ZbNHDOOCjTaclKEOcyK7NMuuj7F+oOyeVH666psA2T0YxPwEJofzrWItMLnV0qQFaiGmKEwZhlJy2rsYLzle2m8w63TIzZvzekWkIPJtIpR7hIyOA99ORcAeU7qR4VFLAZg8a80+3i6P9PPZe7dLDRlpK8Fp3y1WqTytQceZuReMw1bn+rECVDOA58scrK0kVyH04+kxeGaySJkNjDea5aathbIYg9RggUws8fvFU2xKo0oDKvzpnXyGsEQ/tQul3PqyPkBg2DSukqNPLbc3CC0v1+x5soHIddgbLkcvOxMIMyOZYi7z9WTaY6WH0eOz+OA== Received: from [66.196.81.174] by nm35.bullet.mail.bf1.yahoo.com with NNFMP; 12 Feb 2015 22:34:37 -0000 Received: from [68.142.230.65] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 12 Feb 2015 22:34:37 -0000 Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP; 12 Feb 2015 22:34:37 -0000 X-Yahoo-Newman-Id: 765987.7100.bm@smtp222.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: cjZ4zaEVM1mRcM1DFQ.ilBd8GX7v0.LW6BNayqKB6HDcB_I Pcvnv2cXdTL1.x05FEAFm6sAz3vIJea7BerqmHTWWepUjNKyJbskrKtXnKE3 288XY77VBQXXNyB4C0TYTb.cczWVQX7XeGs5lYKJ990LFdbnajkHKUWkYToH fbhFTr0vi2PgHCkBUy9yb6KceRoRVjmhJmVI59Z8hH7Cyx300ju_TJId5vK5 lVHvihYo5PbBFlu8tWCDGIst1CoBV4Yzbzq.nZGqCmiGmnqvWXSr7AsNU02k 7W0NlvlMbfxrCv0CLr2T6H5NGGSKliiuBsRoQNq5kVsgQYxadVOzUkIaQxvO itbulE0OJLakPfbuT9I31KTUslv6tQR_jG7dNQ2kvE2GcdK6ADVDxuaWIS6p GtLBfgnQ4ud2svFNxXm87OOxb16E7qehKTguMZDJ2T5TQDg6z91ShMcejUji hERXS.v2cmpRJPJbj4tWhTTGrerBuLRtoLX.0CbwU2ZdDW7LIMrMLJuGdxYa gutHmiOaRblWaRZm7Cfs1ZazX1g-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54DD2A87.2050008@FreeBSD.org> Date: Thu, 12 Feb 2015 17:34:47 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r278634 - head/lib/libc/gen References: <201502122107.t1CL7gaO004041@svn.freebsd.org> In-Reply-To: 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 22:41:11 -0000 On 02/12/15 17:27, Bjoern A. Zeeb wrote: >> On 12 Feb 2015, at 21:07 , Pedro F. Giffuni wrote: >> >> Author: pfg >> Date: Thu Feb 12 21:07:42 2015 >> New Revision: 278634 >> URL: https://svnweb.freebsd.org/changeset/base/278634 >> >> Log: >> ulimit(3): Fix broken check. >> >> The existing implementation had a broken comparison that could overflow. >> Replace this with a check that avoids the overflow before it happens. >> >> Consistently return a maximum value also on the case of negative >> arguments since negative is considered an overflow and means >> infinity for our current setrlimit(). >> >> Discussed with: bde (rather extensively) >> > Did this compile? > Yes! Any log message to share? Pedro. From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 22:44:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A03C6FA; Thu, 12 Feb 2015 22:44:33 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 306C2910; Thu, 12 Feb 2015 22:44:33 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D01EA25D3A92; Thu, 12 Feb 2015 22:44:27 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 23D4EC7709E; Thu, 12 Feb 2015 22:44:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id PqrZB4NLu9XP; Thu, 12 Feb 2015 22:44:25 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:ccda:6447:f:a] (unknown [IPv6:fde9:577b:c1a9:4410:ccda:6447:f:a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id B81ACC770A0; Thu, 12 Feb 2015 22:44:23 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278634 - head/lib/libc/gen From: "Bjoern A. Zeeb" In-Reply-To: <54DD2A87.2050008@FreeBSD.org> Date: Thu, 12 Feb 2015 22:44:13 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.2070.6) 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.18-1 Precedence: list List-Id: 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, 12 Feb 2015 22:44:33 -0000 > On 12 Feb 2015, at 22:34 , Pedro Giffuni wrote: >=20 >=20 > On 02/12/15 17:27, Bjoern A. Zeeb wrote: >>> On 12 Feb 2015, at 21:07 , Pedro F. Giffuni wrote: >>>=20 >>> Author: pfg >>> Date: Thu Feb 12 21:07:42 2015 >>> New Revision: 278634 >>> URL: https://svnweb.freebsd.org/changeset/base/278634 >>>=20 >>> Log: >>> ulimit(3): Fix broken check. >>>=20 >>> The existing implementation had a broken comparison that could = overflow. >>> Replace this with a check that avoids the overflow before it = happens. >>>=20 >>> Consistently return a maximum value also on the case of negative >>> arguments since negative is considered an overflow and means >>> infinity for our current setrlimit(). >>>=20 >>> Discussed with: bde (rather extensively) >>>=20 >> Did this compile? >>=20 >=20 > Yes! Any log message to share? Now I do again; had lost them due to buildworld starting over again: =3D=3D=3D> lib/libc_nonshared (obj,depend,all,install) cc1: warnings being treated as errors /scratch/tmp/bz/head.svn/lib/libc/gen/ulimit.c: In function 'ulimit': /scratch/tmp/bz/head.svn/lib/libc/gen/ulimit.c:56: warning: comparison = is always false due to limited range of data type /scratch/tmp/bz/head.svn/lib/libc/gen/ulimit.c:57: warning: overflow in = implicit constant conversion --- ulimit.So --- *** [ulimit.So] Error code 1 mips.mipsn32 buildworld failed, check _.mips.mipsn32.buildworld for = details mips.mips buildworld failed, check _.mips.mips.buildworld for details powerpc.powerpc buildworld failed, check _.powerpc.powerpc.buildworld = for details mips.mipsel buildworld failed, check _.mips.mipsel.buildworld for = details arm.armeb buildworld failed, check _.arm.armeb.buildworld for details arm.armv6hf buildworld failed, check _.arm.armv6hf.buildworld for = details arm.arm buildworld failed, check _.arm.arm.buildworld for details arm.armv6 buildworld failed, check _.arm.armv6.buildworld for details pc98.i386 buildworld failed, check _.pc98.i386.buildworld for details i386.i386 buildworld failed, check _.i386.i386.buildworld for details powerpc.powerpc64 buildworld failed, check = _.powerpc.powerpc64.buildworld for details amd64.amd64 buildworld failed, check _.amd64.amd64.buildworld for = details From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 23:00:32 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AF1D4A9; Thu, 12 Feb 2015 23:00: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85D2BA34; Thu, 12 Feb 2015 23:00:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CN0W9a060098; Thu, 12 Feb 2015 23:00:32 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CN0WXK060079; Thu, 12 Feb 2015 23:00:32 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201502122300.t1CN0WXK060079@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 12 Feb 2015 23:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278641 - head/tools/tools/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.18-1 Precedence: list List-Id: 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, 12 Feb 2015 23:00:32 -0000 Author: gnn Date: Thu Feb 12 23:00:31 2015 New Revision: 278641 URL: https://svnweb.freebsd.org/changeset/base/278641 Log: Silence a warning. Modified: head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Thu Feb 12 22:20:34 2015 (r278640) +++ head/tools/tools/netmap/pkt-gen.c Thu Feb 12 23:00:31 2015 (r278641) @@ -1817,7 +1817,7 @@ main(int arc, char **argv) } - if (g.ifname == NULL) { + if (strlen(g.ifname) <=0 ) { D("missing ifname"); usage(); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 23:08:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC7E473E; Thu, 12 Feb 2015 23:08: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D84EB20; Thu, 12 Feb 2015 23:08:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1CN8So8062442; Thu, 12 Feb 2015 23:08:28 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1CN8Sg0062438; Thu, 12 Feb 2015 23:08:28 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201502122308.t1CN8Sg0062438@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 12 Feb 2015 23:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278642 - in head/usr.bin: chpass passwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 23:08:28 -0000 Author: bapt Date: Thu Feb 12 23:08:27 2015 New Revision: 278642 URL: https://svnweb.freebsd.org/changeset/base/278642 Log: Use PRECIOUSPROG instead of custom code to handle schg This allows to preserve schg when installed with -DNO_ROOT MFC after: 1 week Modified: head/usr.bin/chpass/Makefile head/usr.bin/passwd/Makefile Modified: head/usr.bin/chpass/Makefile ============================================================================== --- head/usr.bin/chpass/Makefile Thu Feb 12 23:00:31 2015 (r278641) +++ head/usr.bin/chpass/Makefile Thu Feb 12 23:08:27 2015 (r278642) @@ -9,6 +9,7 @@ PROG= chpass SRCS= chpass.c edit.c field.c pw_scan.c table.c util.c BINOWN= root BINMODE=4555 +PRECIOUSPROG= .if ${MK_NIS} != "no" CFLAGS+= -DYP .endif @@ -34,16 +35,4 @@ MLINKS= chpass.1 chfn.1 chpass.1 chsh.1 MLINKS+= chpass.1 ypchpass.1 chpass.1 ypchfn.1 chpass.1 ypchsh.1 .endif -beforeinstall: -.for i in chpass chfn chsh ypchpass ypchfn ypchsh -.if exists(${DESTDIR}${BINDIR}/$i) - -chflags noschg ${DESTDIR}${BINDIR}/$i -.endif -.endfor - -.if !defined(NO_FSCHG) -afterinstall: - -chflags schg ${DESTDIR}${BINDIR}/chpass -.endif - .include Modified: head/usr.bin/passwd/Makefile ============================================================================== --- head/usr.bin/passwd/Makefile Thu Feb 12 23:00:31 2015 (r278641) +++ head/usr.bin/passwd/Makefile Thu Feb 12 23:08:27 2015 (r278642) @@ -7,20 +7,10 @@ PROG = passwd BINOWN = root BINMODE = 4555 LIBADD = pam +PRECIOUSPROG= .if ${MK_NIS} != "no" LINKS = ${BINDIR}/passwd ${BINDIR}/yppasswd MLINKS = passwd.1 yppasswd.1 .endif -beforeinstall: -.for i in passwd yppasswd - [ ! -e ${DESTDIR}${BINDIR}/$i ] || \ - chflags noschg ${DESTDIR}${BINDIR}/$i || true -.endfor - -.if !defined(NO_FSCHG) -afterinstall: - -chflags schg ${DESTDIR}${BINDIR}/passwd -.endif - .include From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 23:14:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC3EE91C for ; Thu, 12 Feb 2015 23:14:01 +0000 (UTC) Received: from nm25-vm1.bullet.mail.bf1.yahoo.com (nm25-vm1.bullet.mail.bf1.yahoo.com [98.139.212.155]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95ED3C2E for ; Thu, 12 Feb 2015 23:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1423782833; bh=XYgtnwpxqbZxGkQUuEsQje6PfmwZVJD1W/dfPZ0G5lM=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=QGTaOAX8ajrbLrjNCVFKlO4IMBrXER75bz9au/hN7QDCdgs/o7Lz3Ym4GYl4icddZ5NPtCTbcdF/dQtH6cux/cFtpd7fH1k3Zyr3Tj4w8KWd/1P9owyHWBwd3po/c4hfatkn5U0atUJiKQttaMojdtghFkbHYkNhh+Q7N6GnV/eC84BoqcI8RSda7bqMfRpZJQNqYJaDqp+Pk2fWpgHePVLpPeVD7ci3kNvJew8X/UwzJ3kvDORQkDKhq4/CCNAJ/rno+eL5DR6diVR2OT1Yf/Mcrn98GlLt7502KdBi50klsB2hsSVnDKD83YObAusFfSREsOmetk8qKKTxJizqJg== Received: from [66.196.81.171] by nm25.bullet.mail.bf1.yahoo.com with NNFMP; 12 Feb 2015 23:13:53 -0000 Received: from [98.139.213.15] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 12 Feb 2015 23:13:53 -0000 Received: from [127.0.0.1] by smtp115.mail.bf1.yahoo.com with NNFMP; 12 Feb 2015 23:13:53 -0000 X-Yahoo-Newman-Id: 294654.33387.bm@smtp115.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: lyhNNCgVM1lO.1UYedRSOCxDz73sDM1x3UdfPhpNxYSc7iz eQjYqG2p..4plhOL3TaiyP1VMfVcjWbZxD5w0Air8lofGRyS52fte6MeR6qW eDU8_UtkYvbBJ2jzElVbTp3mah8ruhzN1CYbM2c2gLaJdA2Hz4B6POebxaH8 iWnwQEubbDEXNMPwEDZu1bzGG_4rKGYZxz23r4bfgnZBFklVNd92VYdDZnpB WlB5spUiluGzkpXL81suoeA3MhjOQXR3jZz_Ecp.TX2KvN1BXPXBZ8NjY2sQ NtcmbcYPGN.b_Irgk_R9bKGwbBmPpuY5M752mHnszCpsxDtH94dGMsB9.B8m IlSEpu1vaqfqIZaeMAXcokL6DMWf_KCiVuMFjr6o1.HEDf0iKsdMcYsQ4tTB XxRScpwWnWnKHOkz0bjSp.xfWRxw93V41AY8f4za7W.HDpIusoe344PddDyf X0P3A.Ps6D3Y.JFUUDiSUxEGCtTSedyUc6wr3X8.upO3UVNWmoKJ2rrltFPY Iq_t9jaYnem0HkUuWXLQWfq3kvig9pJoEci2LB_rjF7ZBc.wSxh1bKFffl.B PznO1lpvrSlNOeNmaP6k6eg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54DD33B9.3000804@FreeBSD.org> Date: Thu, 12 Feb 2015 18:14:01 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r278634 - head/lib/libc/gen References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> In-Reply-To: <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed 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.18-1 Precedence: list List-Id: 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, 12 Feb 2015 23:14:02 -0000 On 02/12/15 17:44, Bjoern A. Zeeb wrote: >> On 12 Feb 2015, at 22:34 , Pedro Giffuni wrote: >> >> >> On 02/12/15 17:27, Bjoern A. Zeeb wrote: >>>> On 12 Feb 2015, at 21:07 , Pedro F. Giffuni wrote: >>>> >>>> Author: pfg >>>> Date: Thu Feb 12 21:07:42 2015 >>>> New Revision: 278634 >>>> URL: https://svnweb.freebsd.org/changeset/base/278634 >>>> >>>> Log: >>>> ulimit(3): Fix broken check. >>>> >>>> The existing implementation had a broken comparison that could overflow. >>>> Replace this with a check that avoids the overflow before it happens. >>>> >>>> Consistently return a maximum value also on the case of negative >>>> arguments since negative is considered an overflow and means >>>> infinity for our current setrlimit(). >>>> >>>> Discussed with: bde (rather extensively) >>>> >>> Did this compile? >>> >> Yes! Any log message to share? > Now I do again; had lost them due to buildworld starting over again: > > ===> lib/libc_nonshared (obj,depend,all,install) > cc1: warnings being treated as errors > /scratch/tmp/bz/head.svn/lib/libc/gen/ulimit.c: In function 'ulimit': > /scratch/tmp/bz/head.svn/lib/libc/gen/ulimit.c:56: warning: comparison is always false due to limited range of data type > /scratch/tmp/bz/head.svn/lib/libc/gen/ulimit.c:57: warning: overflow in implicit constant conversion > --- ulimit.So --- > *** [ulimit.So] Error code 1 > > > mips.mipsn32 buildworld failed, check _.mips.mipsn32.buildworld for details > mips.mips buildworld failed, check _.mips.mips.buildworld for details > powerpc.powerpc buildworld failed, check _.powerpc.powerpc.buildworld for details > mips.mipsel buildworld failed, check _.mips.mipsel.buildworld for details > arm.armeb buildworld failed, check _.arm.armeb.buildworld for details > arm.armv6hf buildworld failed, check _.arm.armv6hf.buildworld for details > arm.arm buildworld failed, check _.arm.arm.buildworld for details > arm.armv6 buildworld failed, check _.arm.armv6.buildworld for details > pc98.i386 buildworld failed, check _.pc98.i386.buildworld for details > i386.i386 buildworld failed, check _.i386.i386.buildworld for details > powerpc.powerpc64 buildworld failed, check _.powerpc.powerpc64.buildworld for details > amd64.amd64 buildworld failed, check _.amd64.amd64.buildworld for details > > Thank you! This will sound strange but I can't confirm, and I can't see anything obviously wrong. I have the revert ready but let me wait for jenkins to catch the failure first. Pedro. From owner-svn-src-head@FreeBSD.ORG Thu Feb 12 23:54:21 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AA5B1BD; Thu, 12 Feb 2015 23:54:21 +0000 (UTC) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [IPv6:2607:f8b0:4001:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45B23FD9; Thu, 12 Feb 2015 23:54:21 +0000 (UTC) Received: by mail-ig0-f180.google.com with SMTP id b16so7428484igk.1; Thu, 12 Feb 2015 15:54:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=7l+EC5YncqI28qlryYUemzMTg2oSNXPnQZlcTG13DMU=; b=0NhOqmWvCWT2TT2kPadgb7+O6vCseFt7ionBzUj1HRFS7zSk2UrX3M+2iKbGMb0hN9 Xjt79YH+gouYjxTchG2RBmNEiMpKbAln96W8pTqcsfy+Yp4fKJ3pnQ1Z/z78hTWNoeaK Hoxm9ZaNnv5udPBk3xqbT25rnIMoByr5ot8fQGFTthycYXoPPqypJPbmKF2JI9h7SX5e dRM3DzlD/E2ywm7KIJMym7TrrqMH65AftBmg/Vf9j0BA6G2swiW8caH/FSlxGey2v/fm HF54BhBipPi2MpEEZbRU3be7SA/ed7N2NiiLCoNcsen1pN17qf96r2DSRbquJmc75GiH RlKQ== X-Received: by 10.50.25.225 with SMTP id f1mr96935igg.29.1423785260758; Thu, 12 Feb 2015 15:54:20 -0800 (PST) Received: from [192.168.20.5] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id c8sm2179024igx.9.2015.02.12.15.54.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Feb 2015 15:54:20 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_96D1A091-68C3-4CF9-9988-2DCF91D6A0B3"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r278634 - head/lib/libc/gen From: Garrett Cooper In-Reply-To: <54DD33B9.3000804@FreeBSD.org> Date: Thu, 12 Feb 2015 15:54:17 -0800 Message-Id: <46E33B5A-CCE9-4A17-9E5C-7DD0A0339227@gmail.com> References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <54DD33B9.3000804@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 12 Feb 2015 23:54:21 -0000 --Apple-Mail=_96D1A091-68C3-4CF9-9988-2DCF91D6A0B3 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=windows-1252 On Feb 12, 2015, at 15:14, Pedro Giffuni wrote: > On 02/12/15 17:44, Bjoern A. Zeeb wrote: >>> On 12 Feb 2015, at 22:34 , Pedro Giffuni wrote: ... > Thank you! > > This will sound strange but I can't confirm, and I can't see anything > obviously wrong. > > I have the revert ready but let me wait for jenkins to catch the > failure first. it broke the Jenkins build as well: https://jenkins.freebsd.org/job/FreeBSD_HEAD/2364/console Thanks! --Apple-Mail=_96D1A091-68C3-4CF9-9988-2DCF91D6A0B3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU3T0pAAoJEMZr5QU6S73e9nQIAJ9YfD6MYjVhNvApYmkgM/SH OyVuIdAzqv6GvX38wIyOQphA2Xjq1bUuafBrmkrKf9dZ/NQm0nQsRGUDejq6hGFR 7D08lEb9tWytKx3gt1acteawZfYknG/7GloCmoF6Y5gngN9xi0kMhQCJrRlFRLyk 5wx4RToNQ17qsrgB/JfG2krxt+fkH3eLaysbodfvDVVbNz0IaGixwmyemz+1pciX hxDoiCspwhfVKOmZoLbDbCcpMfU0XS1eTme/Du/QcJBTPcsS3luwoI6eCAWPu7CN P34lV7RiJB1vrsVYygGWhw7eIOa2sZziaxH8Eg8AGnOmd+Gh5qOLqEEDUegX4nk= =7VMK -----END PGP SIGNATURE----- --Apple-Mail=_96D1A091-68C3-4CF9-9988-2DCF91D6A0B3-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 00:21:55 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C81CEEAB; Fri, 13 Feb 2015 00:21: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2657344; Fri, 13 Feb 2015 00:21:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1D0Ltfq001130; Fri, 13 Feb 2015 00:21:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1D0LtAc001129; Fri, 13 Feb 2015 00:21:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502130021.t1D0LtAc001129@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 13 Feb 2015 00:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278649 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 00:21:55 -0000 Author: pfg Date: Fri Feb 13 00:21:54 2015 New Revision: 278649 URL: https://svnweb.freebsd.org/changeset/base/278649 Log: Revert 278634: This broke the build due to the compiler being too clever. Will be back, with proper compiler workarounds. Modified: head/lib/libc/gen/ulimit.c Modified: head/lib/libc/gen/ulimit.c ============================================================================== --- head/lib/libc/gen/ulimit.c Fri Feb 13 00:17:22 2015 (r278648) +++ head/lib/libc/gen/ulimit.c Fri Feb 13 00:21:54 2015 (r278649) @@ -53,13 +53,13 @@ ulimit(int cmd, ...) va_start(ap, cmd); arg = va_arg(ap, long); va_end(ap); - if (arg > RLIM_INFINITY / 512 || arg < 0) - arg = RLIM_INFINITY / 512; limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512; /* The setrlimit() function sets errno to EPERM if needed. */ if (setrlimit(RLIMIT_FSIZE, &limit) == -1) return (-1); + if (arg * 512 > LONG_MAX) + return (LONG_MAX); return (arg); } else { errno = EINVAL; From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 00:27:26 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F2E327E for ; Fri, 13 Feb 2015 00:27:26 +0000 (UTC) Received: from nm30-vm0.bullet.mail.bf1.yahoo.com (nm30-vm0.bullet.mail.bf1.yahoo.com [98.139.213.126]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C90D3391 for ; Fri, 13 Feb 2015 00:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1423787243; bh=RytAHeBAdaYvuReDUlf1HF3F27c73MnVpjtBPfCDbTA=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=oW4uZHr7W817DSquAiX8avUYda8AZcsEFUsHfMVetfTQDSS0t64H4xwoeFoceQ0ffCXq4V3m2rKAHbmgCN/Lb6MxuFUtKdsyEcYi9zMXmrb6s1OF5lRVwHc0gJuFWiZaB3gF/nUOCFCL722nEcnMYdbFhRXQ6+t+3v2oPcKYTGKSiS1GKOjfMpa1lPJyR/FUpPKbpl2qpdog3miErTWnSWie92w8Rw+0xQltAeMiEJ+SiDSTdBbxNKgjfAm1PpF0lDQ14IHE8nyFnAiMKjokU28vQWAV/k+gq5eKakAURl5t6dqKRzLud0EijbkzioS0Ddz0hQGQPRYd8KY83gbWYg== Received: from [98.139.215.140] by nm30.bullet.mail.bf1.yahoo.com with NNFMP; 13 Feb 2015 00:27:23 -0000 Received: from [98.139.213.8] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 13 Feb 2015 00:27:23 -0000 Received: from [127.0.0.1] by smtp108.mail.bf1.yahoo.com with NNFMP; 13 Feb 2015 00:27:23 -0000 X-Yahoo-Newman-Id: 200040.69148.bm@smtp108.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: .nY_OWIVM1nmoOh4N6SjmDgMxnbQ19NFDby4pnrz1b.u6jq 18INr8TLuPKVAg.6iiA5CkJ4GMH78LwdIkiBMRU7cs95AO_hNOeoz6zqSqWi GdXhq5PiEjQqKvPv1u17_pdyZVsxM48YN7pUWsmYA_caVnwj6Ft9A_M3gP1R ZFqhSykSgIsJGY3j5vVAClFtRHH.aMYYPqNk4JlBHv_CpmRyaAB3BuATeNYg 0_C2mI84WwWeUoCd6JO33VXsPv3tfD9vcjNCeM_dnuOBFzK4HqZK_f3jrsba AfUnyj6mmKZs5NZN0Nnj408USanE9_Fsv8hZSr1cgCrZtahf.K_a4ex8YmzL KdmRAvRIb7c4vtO2i70PBWKJcNR.J_hHrLsPFBxDoyLM_qROeUOW2pHmgsJT 8tiEyT5_aUQ_F90EfVRsQKOfX0Y4Ie8UR3Rd2klFoXX.kI3MvhD9ksKY0MXz PCli61XO6iY8xYbPpFQtg.8pIQTkT7fN7PY1z_BnJjoL4rsOvJqJpxOouHxQ OXVQYu6GJoOcr7WMCYnCVraGQ8TQQQuLy X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54DD44F3.9030108@FreeBSD.org> Date: Thu, 12 Feb 2015 19:27:31 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Garrett Cooper Subject: Re: svn commit: r278634 - head/lib/libc/gen References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <54DD33B9.3000804@FreeBSD.org> <46E33B5A-CCE9-4A17-9E5C-7DD0A0339227@gmail.com> In-Reply-To: <46E33B5A-CCE9-4A17-9E5C-7DD0A0339227@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 00:27:26 -0000 On 02/12/15 18:54, Garrett Cooper wrote: > On Feb 12, 2015, at 15:14, Pedro Giffuni wrote: > >> On 02/12/15 17:44, Bjoern A. Zeeb wrote: >>>> On 12 Feb 2015, at 22:34 , Pedro Giffuni wrote: > ... > >> Thank you! >> >> This will sound strange but I can't confirm, and I can't see anything >> obviously wrong. >> >> I have the revert ready but let me wait for jenkins to catch the >> failure first. > it broke the Jenkins build as well: > > https://jenkins.freebsd.org/job/FreeBSD_HEAD/2364/console > > Thanks! Thank you ... I can reproduce it now. Pedro. From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 01:07:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0C0D4A3; Fri, 13 Feb 2015 01: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC48A977; Fri, 13 Feb 2015 01:07:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1D17DJL021790; Fri, 13 Feb 2015 01:07:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1D17D3q021789; Fri, 13 Feb 2015 01:07:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502130107.t1D17D3q021789@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 Feb 2015 01:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278653 - head/bin/pkill/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 01:07:14 -0000 Author: ngie Date: Fri Feb 13 01:07:12 2015 New Revision: 278653 URL: https://svnweb.freebsd.org/changeset/base/278653 Log: Call wait to ensure that background processes have died This is being done to establish parity with pgrep-j_test Modified: head/bin/pkill/tests/pgrep-j_test.sh Modified: head/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- head/bin/pkill/tests/pgrep-j_test.sh Fri Feb 13 00:49:47 2015 (r278652) +++ head/bin/pkill/tests/pgrep-j_test.sh Fri Feb 13 01:07:12 2015 (r278653) @@ -50,6 +50,7 @@ else fi [ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) +wait name="pgrep -j any" sleep_amount=6 @@ -70,6 +71,7 @@ else fi [ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) [ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) +wait name="pgrep -j none" sleep_amount=7 From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 01:07:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9E265E2; Fri, 13 Feb 2015 01:07:51 +0000 (UTC) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9B5297F; Fri, 13 Feb 2015 01:07:51 +0000 (UTC) Received: by pdjy10 with SMTP id y10so15653309pdj.13; Thu, 12 Feb 2015 17:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=tAKPtvvrGdICZaukQ0QrJusYdUBFWU8ZXBJyZpF63uE=; b=GKvEW+xZzTtEUD/xfWKaS65AlW1Ylu0nWl648tcdkwI5m6GmGgICWtaL7SAyrcrCca bgCt2VTWsf3fH41SSOsiERqPzND5jJxULzcTNcjgdyA4UyBNYt4l3XGriQEHEVMZLtV8 hnQJuTqWUbYPwYqeuVJFxmM7ItsgqJAwqRfYl49WJRU5pSgqTNPGNXygSNvABjAdcYWM Uj2LdWgyiYstOSte7H36QNsnjntrlPYFq3xoGdFwZY5M5NwbrPPrBuhWoQSFdsg9P6Bh 03oOyp+3OHZ2dzKTNBqEdpfz6yT/PjOeCarfzPVQSvLKOemBRX8OlmgbQyXkSpodebYU 3B5g== X-Received: by 10.68.57.228 with SMTP id l4mr10920336pbq.43.1423789665388; Thu, 12 Feb 2015 17:07:45 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:5de4:da0f:932c:57df? ([2601:8:ab80:7d6:5de4:da0f:932c:57df]) by mx.google.com with ESMTPSA id uy8sm4917541pbc.31.2015.02.12.17.07.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Feb 2015 17:07:44 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_A2D93F56-ACC3-4CF3-BBF2-9BFF6155836B"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r278653 - head/bin/pkill/tests From: Garrett Cooper In-Reply-To: <201502130107.t1D17D3q021789@svn.freebsd.org> Date: Thu, 12 Feb 2015 17:07:41 -0800 Message-Id: References: <201502130107.t1D17D3q021789@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1878.6) 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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 01:07:52 -0000 --Apple-Mail=_A2D93F56-ACC3-4CF3-BBF2-9BFF6155836B Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Feb 12, 2015, at 17:07, Garrett Cooper wrote: > Author: ngie > Date: Fri Feb 13 01:07:12 2015 > New Revision: 278653 > URL: https://svnweb.freebsd.org/changeset/base/278653 > > Log: > Call wait to ensure that background processes have died > > This is being done to establish parity with pgrep-j_test I meant pkill-j_test. --Apple-Mail=_A2D93F56-ACC3-4CF3-BBF2-9BFF6155836B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU3U5eAAoJEMZr5QU6S73eHAAH/1zauBohtUd9gz6gvpv/rgIX CJaEJJ/JQYkBZEHXBClZk6qyyehpDWMFzbOYNNWb09JU4LLkFEZY1Bl3jJyatMzl DmrOtlITpnGtKyPGhIG87lqraPwFESQwbb5uVKqUGh1N6WJJyE1SCNh5V21sj4xA pXG0wyxuQZd24su9vN+G1TyllCEPdry0GbE4go1m2kJlL0VCbGVUffqgQYD/n1nj KuSOwAb5kTOZoR9CwwkBvPtBdDCBvEzHlwSYH/zhoKUhfWptKpY7Y+6DVFxwaI7K ep5VANqY62Frtff9h3JpX8WA83Ji9aen2IrcoZqS7F3vfySy0m3qQmJ9MPszlOA= =oRPn -----END PGP SIGNATURE----- --Apple-Mail=_A2D93F56-ACC3-4CF3-BBF2-9BFF6155836B-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 01:20:39 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16307CE1; Fri, 13 Feb 2015 01:20: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01D08A80; Fri, 13 Feb 2015 01:20:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1D1KcOW026986; Fri, 13 Feb 2015 01:20:38 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1D1KceQ026984; Fri, 13 Feb 2015 01:20:38 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502130120.t1D1KceQ026984@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Fri, 13 Feb 2015 01:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278654 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 01:20:39 -0000 Author: jmg Date: Fri Feb 13 01:20:37 2015 New Revision: 278654 URL: https://svnweb.freebsd.org/changeset/base/278654 Log: add support for specifying an initial buffer size when fetching a sysctl... This is useful for kern.arandom which (without -B) will happily return 0 bytes, which isn't too useful or random... fix spelling (thanks igor!) of settable while I'm here... Modified: head/sbin/sysctl/sysctl.8 head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.8 ============================================================================== --- head/sbin/sysctl/sysctl.8 Fri Feb 13 01:07:12 2015 (r278653) +++ head/sbin/sysctl/sysctl.8 Fri Feb 13 01:20:37 2015 (r278654) @@ -28,7 +28,7 @@ .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 13, 2012 +.Dd February 12, 2015 .Dt SYSCTL 8 .Os .Sh NAME @@ -37,11 +37,13 @@ .Sh SYNOPSIS .Nm .Op Fl bdehiNnoRTqx +.Op Fl B Ar bufsize .Op Fl f Ar filename .Ar name Ns Op = Ns Ar value .Ar ... .Nm .Op Fl bdehNnoRTqx +.Op Fl B Ar bufsize .Fl a .Sh DESCRIPTION The @@ -68,6 +70,15 @@ the command line. Force the value of the variable(s) to be output in raw, binary format. No names are printed and no terminating newlines are output. This is mostly useful with a single variable. +.It Fl B Ar bufsize +Set the buffer size to read from the +.Nm +to +.Ar bufsize . +This is necessary for a +.Nm +that has variable length, and the probe value of 0 is a valid length, such as +.Va kern.arandom . .It Fl d Print the description of the variable instead of its value. .It Fl e @@ -128,7 +139,7 @@ Suppress some warnings generated by .Nm to standard error. .It Fl T -Display only variables that are setable via loader (CTLFLAG_TUN). +Display only variables that are settable via loader (CTLFLAG_TUN). .It Fl W Display only writable variables that are not statistical. Useful for determining the set of runtime tunable sysctls. Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Fri Feb 13 01:07:12 2015 (r278653) +++ head/sbin/sysctl/sysctl.c Fri Feb 13 01:20:37 2015 (r278654) @@ -71,7 +71,7 @@ static const char rcsid[] = static const char *conffile; -static int aflag, bflag, dflag, eflag, hflag, iflag; +static int aflag, bflag, Bflag, dflag, eflag, hflag, iflag; static int Nflag, nflag, oflag, qflag, Tflag, Wflag, xflag; static int oidfmt(int *, int, char *, u_int *); @@ -112,8 +112,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehiNnoqTWx] [-f filename] name[=value] ...", - " sysctl [-bdehNnoqTWx] -a"); + "usage: sysctl [-bdehiNnoqTWx] [ -B ] [-f filename] name[=value] ...", + " sysctl [-bdehNnoqTWx] [ -B ] -a"); exit(1); } @@ -127,7 +127,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "Aabdef:hiNnoqTwWxX")) != -1) { + while ((ch = getopt(argc, argv, "AabB:def:hiNnoqTwWxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -139,6 +139,9 @@ main(int argc, char **argv) case 'b': bflag = 1; break; + case 'B': + Bflag = strtol(optarg, NULL, 0); + break; case 'd': dflag = 1; break; @@ -222,7 +225,7 @@ parse(const char *string, int lineno) unsigned int uintval; long longval; unsigned long ulongval; - size_t newsize = 0; + size_t newsize = Bflag; int64_t i64val; uint64_t u64val; int mib[CTL_MAXNAME]; @@ -815,9 +818,13 @@ show_var(int *oid, int nlen) return (0); } /* find an estimate of how much we need for this var */ - j = 0; - i = sysctl(oid, nlen, 0, &j, 0, 0); - j += j; /* we want to be sure :-) */ + if (Bflag) + j = Bflag; + else { + j = 0; + i = sysctl(oid, nlen, 0, &j, 0, 0); + j += j; /* we want to be sure :-) */ + } val = oval = malloc(j + 1); if (val == NULL) { From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 01:35:55 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E1163B0; Fri, 13 Feb 2015 01:35: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECFEAC62; Fri, 13 Feb 2015 01:35:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1D1Zsq7035827; Fri, 13 Feb 2015 01:35:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1D1Zs6x035825; Fri, 13 Feb 2015 01:35:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502130135.t1D1Zs6x035825@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Feb 2015 01:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278655 - in head/sys: amd64/amd64 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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 01:35:55 -0000 Author: markj Date: Fri Feb 13 01:35:53 2015 New Revision: 278655 URL: https://svnweb.freebsd.org/changeset/base/278655 Log: Add support for decoding multibyte NOPs. Differential Revision: https://reviews.freebsd.org/D1830 Reviewed by: jhb, kib MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison Modified: head/sys/amd64/amd64/db_disasm.c head/sys/i386/i386/db_disasm.c Modified: head/sys/amd64/amd64/db_disasm.c ============================================================================== --- head/sys/amd64/amd64/db_disasm.c Fri Feb 13 01:20:37 2015 (r278654) +++ head/sys/amd64/amd64/db_disasm.c Fri Feb 13 01:35:53 2015 (r278655) @@ -250,6 +250,26 @@ static const struct inst db_inst_0f0x[] /*0f*/ { "", FALSE, NONE, 0, 0 }, }; +static const struct inst db_inst_0f1x[] = { +/*10*/ { "", FALSE, NONE, 0, 0 }, +/*11*/ { "", FALSE, NONE, 0, 0 }, +/*12*/ { "", FALSE, NONE, 0, 0 }, +/*13*/ { "", FALSE, NONE, 0, 0 }, +/*14*/ { "", FALSE, NONE, 0, 0 }, +/*15*/ { "", FALSE, NONE, 0, 0 }, +/*16*/ { "", FALSE, NONE, 0, 0 }, +/*17*/ { "", FALSE, NONE, 0, 0 }, + +/*18*/ { "", FALSE, NONE, 0, 0 }, +/*19*/ { "", FALSE, NONE, 0, 0 }, +/*1a*/ { "", FALSE, NONE, 0, 0 }, +/*1b*/ { "", FALSE, NONE, 0, 0 }, +/*1c*/ { "", FALSE, NONE, 0, 0 }, +/*1d*/ { "", FALSE, NONE, 0, 0 }, +/*1e*/ { "", FALSE, NONE, 0, 0 }, +/*1f*/ { "nopl", TRUE, SDEP, 0, "nopw" }, +}; + static const struct inst db_inst_0f2x[] = { /*20*/ { "mov", TRUE, LONG, op2(CR,El), 0 }, /*21*/ { "mov", TRUE, LONG, op2(DR,El), 0 }, @@ -431,7 +451,7 @@ static const struct inst db_inst_0fcx[] static const struct inst * const db_inst_0f[] = { db_inst_0f0x, - 0, + db_inst_0f1x, db_inst_0f2x, db_inst_0f3x, db_inst_0f4x, Modified: head/sys/i386/i386/db_disasm.c ============================================================================== --- head/sys/i386/i386/db_disasm.c Fri Feb 13 01:20:37 2015 (r278654) +++ head/sys/i386/i386/db_disasm.c Fri Feb 13 01:35:53 2015 (r278655) @@ -195,6 +195,26 @@ static const struct inst db_inst_0f0x[] /*0f*/ { "", FALSE, NONE, 0, 0 }, }; +static const struct inst db_inst_0f1x[] = { +/*10*/ { "", FALSE, NONE, 0, 0 }, +/*11*/ { "", FALSE, NONE, 0, 0 }, +/*12*/ { "", FALSE, NONE, 0, 0 }, +/*13*/ { "", FALSE, NONE, 0, 0 }, +/*14*/ { "", FALSE, NONE, 0, 0 }, +/*15*/ { "", FALSE, NONE, 0, 0 }, +/*16*/ { "", FALSE, NONE, 0, 0 }, +/*17*/ { "", FALSE, NONE, 0, 0 }, + +/*18*/ { "", FALSE, NONE, 0, 0 }, +/*19*/ { "", FALSE, NONE, 0, 0 }, +/*1a*/ { "", FALSE, NONE, 0, 0 }, +/*1b*/ { "", FALSE, NONE, 0, 0 }, +/*1c*/ { "", FALSE, NONE, 0, 0 }, +/*1d*/ { "", FALSE, NONE, 0, 0 }, +/*1e*/ { "", FALSE, NONE, 0, 0 }, +/*1f*/ { "nopl", TRUE, SDEP, 0, "nopw" }, +}; + static const struct inst db_inst_0f2x[] = { /*20*/ { "mov", TRUE, LONG, op2(CR,El), 0 }, /*21*/ { "mov", TRUE, LONG, op2(DR,El), 0 }, @@ -356,7 +376,7 @@ static const struct inst db_inst_0fcx[] static const struct inst * const db_inst_0f[] = { db_inst_0f0x, - 0, + db_inst_0f1x, db_inst_0f2x, db_inst_0f3x, db_inst_0f4x, From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 02:10:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EC48181; Fri, 13 Feb 2015 02:10: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A1DEF95; Fri, 13 Feb 2015 02:10:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1D2AAYT050872; Fri, 13 Feb 2015 02:10:10 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1D2AAIG050871; Fri, 13 Feb 2015 02:10:10 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201502130210.t1D2AAIG050871@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 13 Feb 2015 02:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278657 - head/sys/contrib/vchiq/interface/compat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 02:10:10 -0000 Author: gonzo Date: Fri Feb 13 02:10:09 2015 New Revision: 278657 URL: https://svnweb.freebsd.org/changeset/base/278657 Log: Fix build without INVARIANTS/INVARIANT_SUPPORT: - Replace "emulation" of return in lmutex_lock_interruptible macros by proper static/inline function. Submitted by: Guy Yur Modified: head/sys/contrib/vchiq/interface/compat/vchi_bsd.h Modified: head/sys/contrib/vchiq/interface/compat/vchi_bsd.h ============================================================================== --- head/sys/contrib/vchiq/interface/compat/vchi_bsd.h Fri Feb 13 02:02:12 2015 (r278656) +++ head/sys/contrib/vchiq/interface/compat/vchi_bsd.h Fri Feb 13 02:10:09 2015 (r278657) @@ -151,10 +151,16 @@ struct mutex { #define lmutex_init(lock) mtx_init(&(lock)->mtx, #lock, NULL, MTX_DEF) #define lmutex_lock(lock) mtx_lock(&(lock)->mtx) -#define lmutex_lock_interruptible(lock) (mtx_lock(&(lock)->mtx),0) #define lmutex_unlock(lock) mtx_unlock(&(lock)->mtx) #define lmutex_destroy(lock) mtx_destroy(&(lock)->mtx) +static __inline int +lmutex_lock_interruptible(struct mutex *lock) +{ + mtx_lock(&(lock)->mtx); + return 0; +} + /* * Rwlock API */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 02:24:57 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6338B8E0; Fri, 13 Feb 2015 02:24:57 +0000 (UTC) Received: from mx0.deglitch.com (unknown [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 10F8F19E; Fri, 13 Feb 2015 02:24:57 +0000 (UTC) Received: from dhcp-250-37.sj.pi-coral.com (unknown [12.218.212.178]) by mx0.deglitch.com (Postfix) with ESMTPSA id 1AAD08FC27; Fri, 13 Feb 2015 06:24:42 +0400 (MSK) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278616 - in head: . contrib/netbsd-tests/games etc etc/mtree etc/root games games/caesar games/fortune/datfiles release/scripts share/man/man4 share/man/man6 share/man/man7 share/mk sh... From: Stanislav Sedov In-Reply-To: Date: Thu, 12 Feb 2015 18:24:39 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <583B4182-BDCA-48C6-BEFA-6D0C09268CB1@freebsd.org> References: <201502120535.t1C5Z0el061979@svn.freebsd.org> To: Devin Teske X-Mailer: Apple Mail (2.2070.6) Cc: "svn-src-head@freebsd.org" , Devin Teske , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Colin Percival X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 02:24:57 -0000 > On Feb 11, 2015, at 10:17 PM, Devin Teske wrote: >=20 > PLEASE! Do NOT remove the grand digital clock (grdc). >=20 > So many of us over the years have used it as a terminal keeper-aliver = :) (and as a clock, to boot). >=20 > I will be very sad if you remove grdc. >=20 +1 I=E2=80=99d also vote for keeping rot13 and caesar as it is routinely = useful. They are quite small and does not require a lot of maintaining work to keep around. Just my 0.02. -- ST4096-RIPE From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 03:18:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65D9D227; Fri, 13 Feb 2015 03:18: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 521DA970; Fri, 13 Feb 2015 03:18:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1D3IUYX083843; Fri, 13 Feb 2015 03:18:30 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1D3IUDc083842; Fri, 13 Feb 2015 03:18:30 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502130318.t1D3IUDc083842@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Fri, 13 Feb 2015 03:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278658 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 03:18:30 -0000 Author: rpaulo Date: Fri Feb 13 03:18:29 2015 New Revision: 278658 URL: https://svnweb.freebsd.org/changeset/base/278658 Log: Teach libproc how to find debugging symbols in /usr/lib/debug. MFC after: 1 week Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Fri Feb 13 02:10:09 2015 (r278657) +++ head/lib/libproc/proc_sym.c Fri Feb 13 03:18:29 2015 (r278658) @@ -82,6 +82,21 @@ fail: strlcpy(buf, symbol, len); } +static int +find_dbg_obj(const char *path) +{ + int fd; + char dbg_path[PATH_MAX]; + + snprintf(dbg_path, sizeof(dbg_path), + "/usr/lib/debug/%s.debug", path); + fd = open(dbg_path, O_RDONLY); + if (fd > 0) + return (fd); + else + return (open(path, O_RDONLY)); +} + static void proc_rdl2prmap(rd_loadobj_t *rdl, prmap_t *map) { @@ -295,7 +310,7 @@ proc_addr2sym(struct proc_handle *p, uin if ((map = proc_addr2map(p, addr)) == NULL) return (-1); - if ((fd = open(map->pr_mapname, O_RDONLY, 0)) < 0) { + if ((fd = find_dbg_obj(map->pr_mapname)) < 0) { DPRINTF("ERROR: open %s failed", map->pr_mapname); goto err0; } @@ -443,7 +458,7 @@ proc_name2sym(struct proc_handle *p, con DPRINTFX("ERROR: couldn't find object %s", object); goto err0; } - if ((fd = open(map->pr_mapname, O_RDONLY, 0)) < 0) { + if ((fd = find_dbg_obj(map->pr_mapname)) < 0) { DPRINTF("ERROR: open %s failed", map->pr_mapname); goto err0; } @@ -539,7 +554,7 @@ proc_iter_symbyaddr(struct proc_handle * if ((map = proc_name2map(p, object)) == NULL) return (-1); - if ((fd = open(map->pr_mapname, O_RDONLY)) < 0) { + if ((fd = find_dbg_obj(map->pr_mapname)) < 0) { DPRINTF("ERROR: open %s failed", map->pr_mapname); goto err0; } From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 04:56:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06E592E6; Fri, 13 Feb 2015 04:56:50 +0000 (UTC) Received: from pmta2.delivery3.ore.mailhop.org (pmta2.delivery3.ore.mailhop.org [54.213.22.21]) by mx1.freebsd.org (Postfix) with ESMTP id DA4F81FE; Fri, 13 Feb 2015 04:56:49 +0000 (UTC) Received: from smtp6.ore.mailhop.org (172.31.18.134) by pmta2.delivery1.ore.mailhop.org id hrm21g20u50m; Fri, 13 Feb 2015 04:56:54 +0000 (envelope-from ) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp6.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YM8J6-0005GN-SS; Fri, 13 Feb 2015 04:56:49 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t1D4ulbS002363; Thu, 12 Feb 2015 21:56:47 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19wpa79PxqAaOIptyxuy1GC Message-ID: <1423803407.80968.126.camel@freebsd.org> Subject: Re: svn commit: r278642 - in head/usr.bin: chpass passwd From: Ian Lepore To: Baptiste Daroussin Date: Thu, 12 Feb 2015 21:56:47 -0700 In-Reply-To: <201502122308.t1CN8Sg0062438@svn.freebsd.org> References: <201502122308.t1CN8Sg0062438@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 04:56:50 -0000 On Thu, 2015-02-12 at 23:08 +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Thu Feb 12 23:08:27 2015 > New Revision: 278642 > URL: https://svnweb.freebsd.org/changeset/base/278642 > > Log: > Use PRECIOUSPROG instead of custom code to handle schg > > This allows to preserve schg when installed with -DNO_ROOT > > MFC after: 1 week > > Modified: > head/usr.bin/chpass/Makefile > head/usr.bin/passwd/Makefile > > Modified: head/usr.bin/chpass/Makefile > ============================================================================== > --- head/usr.bin/chpass/Makefile Thu Feb 12 23:00:31 2015 (r278641) > +++ head/usr.bin/chpass/Makefile Thu Feb 12 23:08:27 2015 (r278642) > @@ -9,6 +9,7 @@ PROG= chpass > SRCS= chpass.c edit.c field.c pw_scan.c table.c util.c > BINOWN= root > BINMODE=4555 > +PRECIOUSPROG= > .if ${MK_NIS} != "no" > CFLAGS+= -DYP > .endif > @@ -34,16 +35,4 @@ MLINKS= chpass.1 chfn.1 chpass.1 chsh.1 > MLINKS+= chpass.1 ypchpass.1 chpass.1 ypchfn.1 chpass.1 ypchsh.1 > .endif > > -beforeinstall: > -.for i in chpass chfn chsh ypchpass ypchfn ypchsh > -.if exists(${DESTDIR}${BINDIR}/$i) > - -chflags noschg ${DESTDIR}${BINDIR}/$i > -.endif > -.endfor > - It looks like the removal of this beforeinstall target is causing failure to re-install over an existing copy of the program. -- Ian From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 07:19:09 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F23D4C25; Fri, 13 Feb 2015 07:19:08 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id B220532B; Fri, 13 Feb 2015 07:19:08 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id CAA87D63AE1; Fri, 13 Feb 2015 18:18:55 +1100 (AEDT) Date: Fri, 13 Feb 2015 18:18:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Bjoern A. Zeeb" Subject: Re: svn commit: r278634 - head/lib/libc/gen In-Reply-To: <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> Message-ID: <20150213172738.C1007@besplex.bde.org> References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@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=baJSDo/B c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=2IwoPmx0YhHHISiYWswA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 07:19:09 -0000 On Thu, 12 Feb 2015, Bjoern A. Zeeb wrote: >> On 12 Feb 2015, at 22:34 , Pedro Giffuni wrote: >> >> >> On 02/12/15 17:27, Bjoern A. Zeeb wrote: >>>> On 12 Feb 2015, at 21:07 , Pedro F. Giffuni wrote: >>>> ... >>>> Log: >>>> ulimit(3): Fix broken check. >>>> ... >>> Did this compile? >> >> Yes! Any log message to share? > > Now I do again; had lost them due to buildworld starting over again: > > ===> lib/libc_nonshared (obj,depend,all,install) > cc1: warnings being treated as errors > /scratch/tmp/bz/head.svn/lib/libc/gen/ulimit.c: In function 'ulimit': > /scratch/tmp/bz/head.svn/lib/libc/gen/ulimit.c:56: warning: comparison is always false due to limited range of data type > /scratch/tmp/bz/head.svn/lib/libc/gen/ulimit.c:57: warning: overflow in implicit constant conversion > --- ulimit.So --- > *** [ulimit.So] Error code 1 Grump. The first warning inhibits doing clean range checking. Considered the following simplified case: long arg; /* * We want to know if arg is representable as an rlim_t. This is * remarkably difficult. The following doesn't work due to * compiler zeal and other bugs: */ if (arg > RLIM_INFINITY) err(...); The check is false on all arches since RLIM_INFINITY happens to be >= LONG_MAX, and excessively zealous compilers warn. This omits complications for negative args (see below). There are also system bugs for negative args. POSIX specifies that rlim_t shall be an unsigned type, but in FreeBSD it is still a signed type like it always was. FreeBSD is also missing POSIX's magic values RLIM_SAVED_{MAX,CUR} for handling unrepresentable values. After fixing the type, these could be used for the historical mishandling of historical negative values and might even allow binary compatibility for those values. The second warning is about a bug. A last-minute change made the error handling the same for all negative values (representable or not) as for unrepresentable positive values. But that doesn't work, since it give an overflow in live code as well as in dead code. We also depend on the compiler understanding the range checking and not warning for overflows in dead code. The unsimplified code for this is: if (arg > RLIM_INFINITY / 512) arg = RLIM_INFINITY / 512; or equivalently: arg = MIN(arg, RLIM_INFINITY / 512); The check is vacuously false on 64-bit arches only. The assignment overflows on 32-bit arches only. So zealous compilers have something to warn about in both lines. We want a warning for only the second line iff it is live and overflows. This requires the compiler to understand when the first line is vacuously false so that the second line is dead, but not warn about the first line. Other common forms of the range check shouldn't work any better: if ((rlim_t)arg > RLIM_INFINITY) If rlim_t were unsigned as specified by POSIX, then this cast would probably just be a bug. Otherwise, it should have no effect in the vacuously false case. We depend on it having no effect so that the compiler knows when the following code is dead. rlim_t tmp; tmp = arg; if (tmp != arg) err(1, "arg not representable by rlim_t"); The compiler should still be able to see when the comparison is vacuously false. This form of the comparison is also more difficult to write when the limit is not simply the maximum for the type. Here we want to multiply by 512, but there may be no type that can hold the result. This shows that the MIN() macro is hard to used with mixed types and zealous compilers. Using doesn't avoid many of the problems in the imin() family. With this family, you have to translate all typedefed types to basic types and promote to a larger common type, if any. This tends to hide the original values, so the zealous compilers are not smart enough to warn. However, smart ones should see inside: arg = llmin(arg, RLIM_INFINITY / 512); and warn for it too. Add complications for portability to BSD and POSIX for the full mess. Translation of typedefed types for the imin() family becomes impossible because there is no suitable larger common type in some cases; using MIN() gives unwanted (un)sign extension in these cases. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 07:47:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B4B879A for ; Fri, 13 Feb 2015 07:47:08 +0000 (UTC) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D333982C for ; Fri, 13 Feb 2015 07:47:07 +0000 (UTC) Received: by mail-lb0-f177.google.com with SMTP id z11so13990313lbi.8 for ; Thu, 12 Feb 2015 23:47:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=KtQZ5dY+TGbi79Pf1BisU3fXQw+kypXWRQt36r+BzDQ=; b=L/RXLLbn1uVxsv3wxpldn8H3kxpMrv7PLKyXHGXC24hrQqgmEdOpfbpW+VIyH7gf0j H3dx2LU6mfpZfABk+clun385VOS+vRmZYQk4lwUisXfpMXkN1qD8a0xUeU6BGnd0Bsb2 VvS5CNRdoyReUse+KAQWyxqMYFDpQJFApb6uKy0A2ruZQJdRY/OAWKf2fjLaPngsKBY3 qaABx/SP2/vqpZIaTv2CKr+Zx9tlxQnCj3kzntscK0nR+ZnJDwSqSko+KZ7azlsxFa43 Y2uAOzq653dVtpWVGu3s4i9lRkDPfDKtreH2j3K8f3yeNB0R+YkJpKjyIjoxZjEUsTjB 3OgQ== X-Gm-Message-State: ALoCoQlCOX4wrXUmIOPY1EgYl2DWSpcu3aX3nTLdvxoE+PbFUT3YdHGuPlnHyYPwDe/Qt0BQTLx6 X-Received: by 10.112.162.167 with SMTP id yb7mr6617731lbb.76.1423813620208; Thu, 12 Feb 2015 23:47:00 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id i10sm1218905lah.25.2015.02.12.23.46.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 23:46:59 -0800 (PST) Message-ID: <54DDABF2.9000201@freebsd.org> Date: Fri, 13 Feb 2015 10:46:58 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Bruce Evans , "Bjoern A. Zeeb" Subject: Re: svn commit: r278634 - head/lib/libc/gen References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <20150213172738.C1007@besplex.bde.org> In-Reply-To: <20150213172738.C1007@besplex.bde.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 07:47:08 -0000 On 13.02.2015 10:18, Bruce Evans wrote: > if (arg > RLIM_INFINITY) > err(...); Checking for RLIM_INFINITY is wrong here, since it is ulong long max, considering arg = va_arg(ap, long); and ulimit(3) stating that arg is always plain long. Proper check will be if (arg < 0) { errno = EINVAL; return (-1); } if (arg > LONG_MAX / 512) arg = LONG_MAX / 512; That all. In pure theoretical case RLIM_INFINITY is less than LONG_MAX, it is job of underlying setrlimit(2) to return error. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 07:51:27 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CDFBCA4; Fri, 13 Feb 2015 07: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88545872; Fri, 13 Feb 2015 07:51:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1D7pRAK012803; Fri, 13 Feb 2015 07:51:27 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1D7pRI7012802; Fri, 13 Feb 2015 07:51:27 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201502130751.t1D7pRI7012802@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Feb 2015 07:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278664 - head/usr.bin/chpass X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 07:51:27 -0000 Author: bapt Date: Fri Feb 13 07:51:26 2015 New Revision: 278664 URL: https://svnweb.freebsd.org/changeset/base/278664 Log: Partially revert 278642 On reinstall (overwrite) install(1) does not handle chflags Reported by: ian Modified: head/usr.bin/chpass/Makefile Modified: head/usr.bin/chpass/Makefile ============================================================================== --- head/usr.bin/chpass/Makefile Fri Feb 13 07:51:15 2015 (r278663) +++ head/usr.bin/chpass/Makefile Fri Feb 13 07:51:26 2015 (r278664) @@ -9,7 +9,6 @@ PROG= chpass SRCS= chpass.c edit.c field.c pw_scan.c table.c util.c BINOWN= root BINMODE=4555 -PRECIOUSPROG= .if ${MK_NIS} != "no" CFLAGS+= -DYP .endif @@ -35,4 +34,16 @@ MLINKS= chpass.1 chfn.1 chpass.1 chsh.1 MLINKS+= chpass.1 ypchpass.1 chpass.1 ypchfn.1 chpass.1 ypchsh.1 .endif +beforeinstall: +.for i in chpass chfn chsh ypchpass ypchfn ypchsh +.if exists(${DESTDIR}${BINDIR}/$i) + -chflags noschg ${DESTDIR}${BINDIR}/$i +.endif +.endfor + +.if !defined(NO_FSCHG) +afterinstall: + -chflags schg ${DESTDIR}${BINDIR}/chpass +.endif + .include From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 08:00:00 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 393FA416 for ; Fri, 13 Feb 2015 08:00:00 +0000 (UTC) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3DDF95D for ; Fri, 13 Feb 2015 07:59:59 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id p9so13223042lbv.3 for ; Thu, 12 Feb 2015 23:59:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=JUvn3V0OKwYFRANUVsZEQitc9lo9XzGNLYL+ElyRAnI=; b=SEIqNG+OmFA/acdcFVBPXehqkIjDCq9DnOqbQP0QV1vMBxXv5jd6E3mav/rxNH2V4z UILJLLwz43CxHSBXK1SQ75I3jpX/kd2QeW0COEId/LfvblHj+4wQMtdDbdR08WHTNYmn +84XovYAoWZw3LFhLOgfNVCYqXo2PAXh2pSQ/7GGeyQ3selqXJwSp6qsdke3Tfrpg1qm jHq5Z9edIRq7Z2b62Ka/tsFGykmxfIM4IgB2iTjieRQwQ33BK4btdppx/V8ja0R8epiy zK5pB4gi+RWU/nBLlFKb9xORM7LES0BPCsei7p3vv0ufFoUZqSnVjTlV+37MKfoXxsML is4w== X-Gm-Message-State: ALoCoQlKowv3j/Ic1Qb1F0qQSoEwpgc60oyMtSqOuAK9HdidCvbWq00UONfSMKQ3Q6ME+kxctacx X-Received: by 10.152.8.33 with SMTP id o1mr6860983laa.56.1423814392210; Thu, 12 Feb 2015 23:59:52 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id lf1sm1175004lab.8.2015.02.12.23.59.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 23:59:51 -0800 (PST) Message-ID: <54DDAEF6.3060900@freebsd.org> Date: Fri, 13 Feb 2015 10:59:50 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Bruce Evans , "Bjoern A. Zeeb" Subject: Re: svn commit: r278634 - head/lib/libc/gen References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <20150213172738.C1007@besplex.bde.org> <54DDABF2.9000201@freebsd.org> In-Reply-To: <54DDABF2.9000201@freebsd.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 08:00:00 -0000 We even don't need to check arg excepting for < 0, because what is needed is rlimt_t and not arg. So this version will be better: rlimt_t targ; if (arg < 0) { errno = EINVAL; return (-1); } targ = arg; if (targ > RLIM_INFINITY / 512) targ = RLIM_INFINITY / 512; limit.rlim_max = limit.rlim_cur = targ * 512 On 13.02.2015 10:46, Andrey Chernov wrote: > On 13.02.2015 10:18, Bruce Evans wrote: >> if (arg > RLIM_INFINITY) >> err(...); > > Checking for RLIM_INFINITY is wrong here, since it is ulong long max, > considering > arg = va_arg(ap, long); > and ulimit(3) stating that arg is always plain long. > > Proper check will be > > if (arg < 0) { > errno = EINVAL; > return (-1); > } > if (arg > LONG_MAX / 512) > arg = LONG_MAX / 512; > > That all. In pure theoretical case RLIM_INFINITY is less than LONG_MAX, > it is job of underlying setrlimit(2) to return error. > -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 09:02:16 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3FE0F95; Fri, 13 Feb 2015 09:02: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F623FA3; Fri, 13 Feb 2015 09:02:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1D92GKS046623; Fri, 13 Feb 2015 09:02:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1D92Gin046622; Fri, 13 Feb 2015 09:02:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201502130902.t1D92Gin046622@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Feb 2015 09:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278669 - head/usr.bin/passwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 09:02:16 -0000 Author: bapt Date: Fri Feb 13 09:02:15 2015 New Revision: 278669 URL: https://svnweb.freebsd.org/changeset/base/278669 Log: Revert r278642 install(1) does not handle chflags on hardlinks Modified: head/usr.bin/passwd/Makefile Modified: head/usr.bin/passwd/Makefile ============================================================================== --- head/usr.bin/passwd/Makefile Fri Feb 13 08:42:01 2015 (r278668) +++ head/usr.bin/passwd/Makefile Fri Feb 13 09:02:15 2015 (r278669) @@ -7,10 +7,20 @@ PROG = passwd BINOWN = root BINMODE = 4555 LIBADD = pam -PRECIOUSPROG= .if ${MK_NIS} != "no" LINKS = ${BINDIR}/passwd ${BINDIR}/yppasswd MLINKS = passwd.1 yppasswd.1 .endif +beforeinstall: +.for i in passwd yppasswd + [ ! -e ${DESTDIR}${BINDIR}/$i ] || \ + chflags noschg ${DESTDIR}${BINDIR}/$i || true +.endfor + +.if !defined(NO_FSCHG) +afterinstall: + -chflags schg ${DESTDIR}${BINDIR}/passwd +.endif + .include From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 11:00:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F3102BA; Fri, 13 Feb 2015 11:00: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10D62E26; Fri, 13 Feb 2015 11:00:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DB0D4p099639; Fri, 13 Feb 2015 11:00:13 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DB0DWn099638; Fri, 13 Feb 2015 11:00:13 GMT (envelope-from br@FreeBSD.org) Message-Id: <201502131100.t1DB0DWn099638@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Feb 2015 11:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278670 - head/sys/dev/dwc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 11:00:14 -0000 Author: br Date: Fri Feb 13 11:00:13 2015 New Revision: 278670 URL: https://svnweb.freebsd.org/changeset/base/278670 Log: o Correct the condition in reset procedure o Setup interrupt hander after reset, not before This fixes operation on ODROID-C1 (Amlogic S805) Submitted by: John Wehle Modified: head/sys/dev/dwc/if_dwc.c Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Fri Feb 13 09:02:15 2015 (r278669) +++ head/sys/dev/dwc/if_dwc.c Fri Feb 13 11:00:13 2015 (r278670) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #define WRITE4(_sc, _reg, _val) \ bus_write_4((_sc)->res[0], _reg, _val) +#define MAC_RESET_TIMEOUT 100 #define WATCHDOG_TIMEOUT_SECS 5 #define STATS_HARVEST_INTERVAL 2 #define MII_CLK_VAL 2 @@ -1103,19 +1104,6 @@ dwc_attach(device_t dev) sc->bst = rman_get_bustag(sc->res[0]); sc->bsh = rman_get_bushandle(sc->res[0]); - mtx_init(&sc->mtx, device_get_nameunit(sc->dev), - MTX_NETWORK_LOCK, MTX_DEF); - - callout_init_mtx(&sc->dwc_callout, &sc->mtx, 0); - - /* Setup interrupt handler. */ - error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_NET | INTR_MPSAFE, - NULL, dwc_intr, sc, &sc->intr_cookie); - if (error != 0) { - device_printf(dev, "could not setup interrupt handler.\n"); - return (ENXIO); - } - /* Read MAC before reset */ if (dwc_get_hwaddr(sc, macaddr)) { device_printf(sc->dev, "can't get mac\n"); @@ -1127,12 +1115,12 @@ dwc_attach(device_t dev) reg |= (BUS_MODE_SWR); WRITE4(sc, BUS_MODE, reg); - for (i = 0; i < 100; i++) { + for (i = 0; i < MAC_RESET_TIMEOUT; i++) { if ((READ4(sc, BUS_MODE) & BUS_MODE_SWR) == 0) break; DELAY(10); } - if (i == 0) { + if (i >= MAC_RESET_TIMEOUT) { device_printf(sc->dev, "Can't reset DWC.\n"); return (ENXIO); } @@ -1156,6 +1144,19 @@ dwc_attach(device_t dev) WRITE4(sc, RX_DESCR_LIST_ADDR, sc->rxdesc_ring_paddr); WRITE4(sc, TX_DESCR_LIST_ADDR, sc->txdesc_ring_paddr); + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), + MTX_NETWORK_LOCK, MTX_DEF); + + callout_init_mtx(&sc->dwc_callout, &sc->mtx, 0); + + /* Setup interrupt handler. */ + error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_NET | INTR_MPSAFE, + NULL, dwc_intr, sc, &sc->intr_cookie); + if (error != 0) { + device_printf(dev, "could not setup interrupt handler.\n"); + return (ENXIO); + } + /* Set up the ethernet interface. */ sc->ifp = ifp = if_alloc(IFT_ETHER); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 11:13:09 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1F6E763; Fri, 13 Feb 2015 11:13: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82E83F41; Fri, 13 Feb 2015 11:13:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DBD9Hm008275; Fri, 13 Feb 2015 11:13:09 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DBD9wD008274; Fri, 13 Feb 2015 11:13:09 GMT (envelope-from br@FreeBSD.org) Message-Id: <201502131113.t1DBD9wD008274@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Feb 2015 11:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278671 - head/sys/dev/smc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 11:13:09 -0000 Author: br Date: Fri Feb 13 11:13:08 2015 New Revision: 278671 URL: https://svnweb.freebsd.org/changeset/base/278671 Log: o Correct the calculation how many pages we need o Ensure we use correct bank for MSK register o Save and restore current bank in interrupt handler o Stop TX watchdog on fatal errors o Use right register for EPH status This fixes operation on ARMv8 Foundation Model Reviewed by: benno@ Modified: head/sys/dev/smc/if_smc.c Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Fri Feb 13 11:00:13 2015 (r278670) +++ head/sys/dev/smc/if_smc.c Fri Feb 13 11:13:08 2015 (r278671) @@ -527,7 +527,7 @@ smc_start_locked(struct ifnet *ifp) * Work out how many 256 byte "pages" we need. We have to include the * control data for the packet in this calculation. */ - npages = (len * PKT_CTRL_DATA_LEN) >> 8; + npages = (len + PKT_CTRL_DATA_LEN) >> 8; if (npages == 0) npages = 1; @@ -805,12 +805,24 @@ static int smc_intr(void *context) { struct smc_softc *sc; - + uint32_t curbank; + sc = (struct smc_softc *)context; + + /* + * Save current bank and restore later in this function + */ + curbank = (smc_read_2(sc, BSR) & BSR_BANK_MASK); + /* * Block interrupts in order to let smc_task_intr to kick in */ + smc_select_bank(sc, 2); smc_write_1(sc, MSK, 0); + + /* Restore bank */ + smc_select_bank(sc, curbank); + taskqueue_enqueue_fast(sc->smc_tq, &sc->smc_intr); return (FILTER_HANDLED); } @@ -844,13 +856,19 @@ smc_task_intr(void *context, int pending */ packet = smc_read_1(sc, FIFO_TX); if ((packet & FIFO_EMPTY) == 0) { + callout_stop(&sc->smc_watchdog); + smc_select_bank(sc, 2); smc_write_1(sc, PNR, packet); smc_write_2(sc, PTR, 0 | PTR_READ | PTR_AUTO_INCR); - tcr = smc_read_2(sc, DATA0); + smc_select_bank(sc, 0); + tcr = smc_read_2(sc, EPHSR); +#if 0 if ((tcr & EPHSR_TX_SUC) == 0) device_printf(sc->smc_dev, "bad packet\n"); +#endif + smc_select_bank(sc, 2); smc_mmu_wait(sc); smc_write_2(sc, MMUCR, MMUCR_CMD_RELEASE_PKT); @@ -921,6 +939,7 @@ smc_task_intr(void *context, int pending /* * Update the interrupt mask. */ + smc_select_bank(sc, 2); if ((ifp->if_capenable & IFCAP_POLLING) == 0) smc_write_1(sc, MSK, sc->smc_mask); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 13:26:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4D3B469; Fri, 13 Feb 2015 13:26: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FCF0EDE; Fri, 13 Feb 2015 13:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DDQPI8071264; Fri, 13 Feb 2015 13:26:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DDQOKH071261; Fri, 13 Feb 2015 13:26:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201502131326.t1DDQOKH071261@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Feb 2015 13:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278672 - in head/sys: cam/ctl 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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 13:26:25 -0000 Author: mav Date: Fri Feb 13 13:26:23 2015 New Revision: 278672 URL: https://svnweb.freebsd.org/changeset/base/278672 Log: Teach CTL to ask GEOM devices about BIO_DELETE support. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/sys/disk.h Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Fri Feb 13 11:13:08 2015 (r278671) +++ head/sys/cam/ctl/ctl_backend_block.c Fri Feb 13 13:26:23 2015 (r278672) @@ -1874,7 +1874,7 @@ ctl_be_block_open_dev(struct ctl_be_bloc struct cdev *dev; struct cdevsw *devsw; char *value; - int error, atomic, maxio; + int error, atomic, maxio, unmap; off_t ps, pss, po, pos, us, uss, uo, uos; params = &be_lun->params; @@ -1899,7 +1899,6 @@ ctl_be_block_open_dev(struct ctl_be_bloc maxio = CTLBLK_MAX_IO_SIZE; } be_lun->lun_flush = ctl_be_block_flush_dev; - be_lun->unmap = ctl_be_block_unmap_dev; be_lun->getattr = ctl_be_block_getattr_dev; error = VOP_GETATTR(be_lun->vn, &vattr, NOCRED); @@ -2030,6 +2029,24 @@ ctl_be_block_open_dev(struct ctl_be_bloc be_lun->atomicblock = atomic / be_lun->blocksize; be_lun->opttxferlen = maxio / be_lun->blocksize; + + if (be_lun->dispatch == ctl_be_block_dispatch_zvol) { + unmap = 1; + } else { + struct diocgattr_arg arg; + + strlcpy(arg.name, "GEOM::candelete", sizeof(arg.name)); + arg.len = sizeof(arg.value.i); + error = devsw->d_ioctl(dev, DIOCGATTR, + (caddr_t)&arg, FREAD, curthread); + unmap = (error == 0) ? arg.value.i : 0; + } + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "unmap"); + if (value != NULL) + unmap = (strcmp(value, "on") == 0); + if (unmap) + be_lun->unmap = ctl_be_block_unmap_dev; + return (0); } @@ -2182,7 +2199,7 @@ ctl_be_block_create(struct ctl_be_block_ char num_thread_str[16]; char tmpstr[32]; char *value; - int retval, num_threads, unmap; + int retval, num_threads; int tmp_num_threads; params = &req->reqdata.create; @@ -2275,16 +2292,12 @@ ctl_be_block_create(struct ctl_be_block_ } num_threads = tmp_num_threads; } - unmap = (be_lun->dispatch == ctl_be_block_dispatch_zvol); - value = ctl_get_opt(&be_lun->ctl_be_lun.options, "unmap"); - if (value != NULL) - unmap = (strcmp(value, "on") == 0); be_lun->flags = CTL_BE_BLOCK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; if (be_lun->vn == NULL) be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_OFFLINE; - if (unmap) + if (be_lun->unmap != NULL) be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP; if (be_lun->dispatch != ctl_be_block_dispatch_dev) be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_SERSEQ_READ; @@ -2668,6 +2681,8 @@ ctl_be_block_modify(struct ctl_be_block_ * XXX: Note that this field is being updated without locking, * which might cause problems on 32-bit architectures. */ + if (be_lun->unmap != NULL) + be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP; be_lun->ctl_be_lun.maxlba = (be_lun->size_blocks == 0) ? 0 : (be_lun->size_blocks - 1); be_lun->ctl_be_lun.blocksize = be_lun->blocksize; Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Fri Feb 13 11:13:08 2015 (r278671) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Fri Feb 13 13:26:23 2015 (r278672) @@ -588,10 +588,10 @@ ctl_backend_ramdisk_create(struct ctl_be be_lun->softc = softc; - unmap = 0; + unmap = 1; value = ctl_get_opt(&be_lun->ctl_be_lun.options, "unmap"); if (value != NULL && strcmp(value, "on") == 0) - unmap = 1; + unmap = (strcmp(value, "on") == 0); be_lun->flags = CTL_BE_RAMDISK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; Modified: head/sys/sys/disk.h ============================================================================== --- head/sys/sys/disk.h Fri Feb 13 11:13:08 2015 (r278671) +++ head/sys/sys/disk.h Fri Feb 13 13:26:23 2015 (r278672) @@ -131,6 +131,7 @@ struct diocgattr_arg { union { char str[DISK_IDENT_SIZE]; off_t off; + int i; } value; }; #define DIOCGATTR _IOWR('d', 142, struct diocgattr_arg) From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 13:55:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 250F5B43; Fri, 13 Feb 2015 13:55:36 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id D692B217; Fri, 13 Feb 2015 13:55:35 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 5DA8D1047985; Sat, 14 Feb 2015 00:55:31 +1100 (AEDT) Date: Sat, 14 Feb 2015 00:55:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov Subject: Re: svn commit: r278634 - head/lib/libc/gen In-Reply-To: <54DDABF2.9000201@freebsd.org> Message-ID: <20150214000829.K2210@besplex.bde.org> References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <20150213172738.C1007@besplex.bde.org> <54DDABF2.9000201@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=A5NVYcmG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=tmheVFKbtrcjo9yeMgsA:9 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, Pedro Giffuni , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 13:55:36 -0000 On Fri, 13 Feb 2015, Andrey Chernov wrote: > On 13.02.2015 10:18, Bruce Evans wrote: >> if (arg > RLIM_INFINITY) >> err(...); > > Checking for RLIM_INFINITY is wrong here, since it is ulong long max, No, it is correct. rlim_t is neither unsigned not specificially ulong long. It is int64_t, which happens to be long long on some arches. I already explained that this doesn't conform to POSIX. More details: - POSIX reqires rlim_t to be an unsigned type. This would be uint64_t in FreeBSD if FreeBSD conformed. - POSIX doesn't seem to specify the type of RLIM_INFINITY. It may be much smaller than the max for the type, so its natural type might be smaller. FreeBSD uses the max for the type, then casts the value to the type. The cast does little or nothing except to break use of RLIM_INFINITY in cpp arithmetic. This is exactly what is not wanted here -- fixing the problem miight need #if expressions to comparing RLIM_INFINITY with LONG_MAX. - FreeBSD also doesn't implement POSIX's RLIM_SAVED_MAX and RLIM_SAVED_CUR. These are for handling unrepresentable values, and might be the best way to handle the unrepresentable values that can be asked for by ulimit(3) even more easily than by setrlimit(2). Note that POSIX allows almost any handling for unrepresentable values in ulimit(3). The values can be mapped to any garbage and returned. The attempted fixes are mainly to return the same garbage that is mapped to. > considering > arg = va_arg(ap, long); > and ulimit(3) stating that arg is always plain long. This is a broken as designed API, since long is logically different from rlim_t, and ulimit()'s ulimits are 512-blocks while rlim_t's units are bytes, so a scale factor is needed and there would be representability problems even if the types were the same. This gives unrepresentable values in 3 ways: - on amd64, the types are the same. LONG_MAX in 512-blocks is 512 too large to represent in bytes. But RLIM_INFINITY in bytes is easy to represent in 512-blocks. - on amd64, the garbage arg LONG_MIN in 512-blocks is also 512 times too large (in absolute value) to represent in bytes. So large negative values need special handling to preserve their garbageness until this can be classified. (Early versions of the fixed tried to push this to setrlimit(), since ulimit()'s bad API enourages converting garbage to garbage like setrlimit() will do instead of returning an error. I also want the handling of large negative garbage args to be not too different from the handling of small negative garbage args.) - on i386, rlim_t is larger. RLIM_INFINITY in bytes 2**23 times too large to represent in 512-blocks. (This case was already handled correctly.) > Proper check will be > > if (arg < 0) { > errno = EINVAL; > return (-1); > } No, this takes more code, and gives error handling that is not supported by ulimit(3). EINVAL for ulimit(3) is only specified or documented to mean that the command (the first arg) was invalid). > if (arg > LONG_MAX / 512) > arg = LONG_MAX / 512; This is wrong, since arg > LONG_MAX is not an error when rlim_t is much larger than long (as on amd64). Breaking this would break getting and setting the default limit of RLIM_INFINITY. This is already broken on i386 and slightly broken on amd64: - "get" using ulimit(3) cannot return RLIM_INFINITY since RLIM_INFINITY is not a multiple of 512. Rounding down is specified to occur, and does occur. Then: - on amd64, RLIM_INFINITY / 512 is returned - on i386, RLIM_INFINITY / 512 is unrepresentable as a long. The return value is explicitly unspecified. It can be any undocumented garbage. FreeBSD returns the undocumented clamped value LONG_MAX. - "set" of the value returned by "get" cannot restore the original value: - on amd64, it sets the value to RLIM_INFINITY / 512 * 512 = RLIM_INFINITY rounded down to a multiple of 512 - on i386, it sets the value to LONG_MAX * 512. This is about 2**23 times smaller than the original value. > That all. In pure theoretical case RLIM_INFINITY is less than LONG_MAX, > it is job of underlying setrlimit(2) to return error. No, this cannot be handled by setrlimit(2), since the LONG_MAX cannot even be passed to setrlimit() then (if RLIM_INFINITY is the max for its type and not artificially low). This case occurs in practice (except ulimit(3) should never be used, and its only known "users" are Coverity and programmers finding and fixing bugs in it. My (arg > RLIM_INFINITY) check is simplified to show a general problem with range checking. For ulimit(), we actually need to check (arg * 512 > RLIM_INFINITY), except we write this as arg > RLIM_INFINITY since the multiplication might overflow. The multiplication does overflow on amd64 when arg == LONG_MAX. The overflow case is precisely when we cannot pass the scaled arg to setrlimit(2). Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 13:55:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 447CAC3E; Fri, 13 Feb 2015 13:55: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16DC4218; Fri, 13 Feb 2015 13:55:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DDtcxn085522; Fri, 13 Feb 2015 13:55:38 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DDtc32085521; Fri, 13 Feb 2015 13:55:38 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201502131355.t1DDtc32085521@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Fri, 13 Feb 2015 13:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278673 - head/sys/dev/vt/font X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 13:55:39 -0000 Author: danfe (ports committer) Date: Fri Feb 13 13:55:38 2015 New Revision: 278673 URL: https://svnweb.freebsd.org/changeset/base/278673 Log: Improve vt(4) default mouse pointer image. Previous one looked rather ugly, especially on native monitor resolutions. This one essentially matches X11 default pointer. Differential Revision: https://reviews.freebsd.org/D1801 No objection from: emaste Approved by: adrian, dumbbell Modified: head/sys/dev/vt/font/vt_mouse_cursor.c Modified: head/sys/dev/vt/font/vt_mouse_cursor.c ============================================================================== --- head/sys/dev/vt/font/vt_mouse_cursor.c Fri Feb 13 13:26:23 2015 (r278672) +++ head/sys/dev/vt/font/vt_mouse_cursor.c Fri Feb 13 13:55:38 2015 (r278673) @@ -35,36 +35,42 @@ __FBSDID("$FreeBSD$"); #ifndef SC_NO_CUTPASTE struct vt_mouse_cursor vt_default_mouse_pointer = { .map = { - 0x00, /* "__ " */ - 0x40, /* "_*_ " */ - 0x60, /* "_**_ " */ - 0x70, /* "_***_ " */ - 0x78, /* "_****_ " */ - 0x7c, /* "_*****_ " */ - 0x7e, /* "_******_" */ - 0x68, /* "_**_****" */ - 0x4c, /* "_*__**_ " */ - 0x0c, /* " _ _**_ " */ - 0x06, /* " _**_" */ - 0x06, /* " _**_" */ - 0x00, /* " ____" */ + 0x00, 0x00, /* "__ " */ + 0x40, 0x00, /* "_*_ " */ + 0x60, 0x00, /* "_**_ " */ + 0x70, 0x00, /* "_***_ " */ + 0x78, 0x00, /* "_****_ " */ + 0x7c, 0x00, /* "_*****_ " */ + 0x7e, 0x00, /* "_******_ " */ + 0x7f, 0x00, /* "_*******_ " */ + 0x7f, 0x80, /* "_********_" */ + 0x7c, 0x00, /* "_*****____" */ + 0x6c, 0x00, /* "_**_**_ " */ + 0x46, 0x00, /* "_*_ _**_ " */ + 0x06, 0x00, /* "__ _**_ " */ + 0x03, 0x00, /* " _**_ " */ + 0x03, 0x00, /* " _**_ " */ + 0x00, 0x00, /* " __ " */ }, .mask = { - 0xc0, /* "__ " */ - 0xe0, /* "___ " */ - 0xf0, /* "____ " */ - 0xf8, /* "_____ " */ - 0xfc, /* "______ " */ - 0xfe, /* "_______ " */ - 0xff, /* "________" */ - 0xff, /* "________" */ - 0xfe, /* "_______ " */ - 0x5e, /* " _ ____ " */ - 0x0f, /* " ____" */ - 0x0f, /* " ____" */ - 0x0f, /* " ____" */ + 0xc0, 0x00, /* "__ " */ + 0xe0, 0x00, /* "___ " */ + 0xf0, 0x00, /* "____ " */ + 0xf8, 0x00, /* "_____ " */ + 0xfc, 0x00, /* "______ " */ + 0xfe, 0x00, /* "_______ " */ + 0xff, 0x00, /* "________ " */ + 0xff, 0x80, /* "_________ " */ + 0xff, 0xc0, /* "__________" */ + 0xff, 0xc0, /* "__________" */ + 0xfe, 0x00, /* "_______ " */ + 0xef, 0x00, /* "___ ____ " */ + 0xcf, 0x00, /* "__ ____ " */ + 0x07, 0x80, /* " ____ " */ + 0x07, 0x80, /* " ____ " */ + 0x03, 0x00, /* " __ " */ }, - .width = 8, - .height = 13, + .width = 10, + .height = 16, }; #endif From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 14:29:53 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 226D16DB; Fri, 13 Feb 2015 14:29:53 +0000 (UTC) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id D3A5C7ED; Fri, 13 Feb 2015 14:29:52 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 61F0F3C72E7; Sat, 14 Feb 2015 01:29:50 +1100 (AEDT) Date: Sat, 14 Feb 2015 01:29:50 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov Subject: Re: svn commit: r278634 - head/lib/libc/gen In-Reply-To: <54DDAEF6.3060900@freebsd.org> Message-ID: <20150214005543.X2210@besplex.bde.org> References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <20150213172738.C1007@besplex.bde.org> <54DDABF2.9000201@freebsd.org> <54DDAEF6.3060900@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=Za4kaKlA c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=uJTURyrQue8Ndf2tMUgA:9 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, Pedro Giffuni , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 14:29:53 -0000 On Fri, 13 Feb 2015, Andrey Chernov wrote: > We even don't need to check arg excepting for < 0, because what is > needed is rlimt_t and not arg. So this version will be better: > > rlimt_t targ; > > if (arg < 0) { > errno = EINVAL; > return (-1); > } This is reasonable, but not encouraged by the API or compatible with what setrlimit() does with negative args. (setrlimit() still uses my hack from 1994, of converting negative args to RLIM_INFINITY. In 4.4BSD, it doesn't even check for negative args, and mostly stores them unchanged; then undefined behaviour tends to occur when the stored values are used without further checking.) In POSIX, rlim_t is an unsigned integer type, so negative args are impossible for it and all negative args here are unrepresentable as an rlim_t. We can convert them to any garbage. The historical garbage is as good as anything. > targ = arg; Unnecessary overflow before checking in the theoretical case where rlim_t is smaller than long. > if (targ > RLIM_INFINITY / 512) > targ = RLIM_INFINITY / 512; When overflow doesn't occur, using targ instead of arg in the comparison does nothing except possibly confuse the compiler into not generating a tautologous-compare warning. Assigning RLIM_INFINITY to an rlim_t instead of to a long is one way to way to fix the overflow case for the latter, > limit.rlim_max = limit.rlim_cur = targ * 512 However, I don't like using rlim_t for the scaled value that is not an rlimit. An incomplete fix with handling of negative values restored is something like: intmax_t targ; targ = arg; if (targ > RLIM_INFINITY / 512) targ = RLIM_INFINITY / 512; limit.rlim_max = limit.rlim_cur = targ * 512 This is still incomplete. The comparison is still obviously tautologous when intmax_t == rlim_t (the amd64 case). If intmax_t is larger than long (the i386 case) or even rlim_t (the notyet case), then it is slightly less obviously tautologous. This can be fixed by sprinkling volatiles, e.g. for targ. Range checking in expr(1) needed much more delicate fixes including sprinkling volatiles. There the problem was that the compiler saw that the behaviour was either undefined or tautologously true or false. Optimization then allows it to remove tautologous checks. The warnings about tautologous checks must have been turned off, or perhaps broken when undefined behaviour is required for the tautologies, else we should have seen the warnings before the optimizations. The warnings are needed even more with the optimizations, to give a hint that necessary code is being removed. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 14:54:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CDFEE95; Fri, 13 Feb 2015 14:54:26 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id CE2B3A83; Fri, 13 Feb 2015 14:54:25 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 88D04D43936; Sat, 14 Feb 2015 01:54:18 +1100 (AEDT) Date: Sat, 14 Feb 2015 01:54:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans Subject: Re: svn commit: r278634 - head/lib/libc/gen In-Reply-To: <20150214005543.X2210@besplex.bde.org> Message-ID: <20150214015036.Y2552@besplex.bde.org> References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <20150213172738.C1007@besplex.bde.org> <54DDABF2.9000201@freebsd.org> <54DDAEF6.3060900@freebsd.org> <20150214005543.X2210@besplex.bde.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=baJSDo/B c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=OUp92IgwhtU7bb92HiYA:9 a=CjuIK1q_8ugA:10 Cc: "Bjoern A. Zeeb" , src-committers@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org, Pedro Giffuni , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 14:54:26 -0000 On Sat, 14 Feb 2015, Bruce Evans wrote: > ... > However, I don't like using rlim_t for the scaled value that is not > an rlimit. > > An incomplete fix with handling of negative values restored is something > like: > > intmax_t targ; > > targ = arg; > if (targ > RLIM_INFINITY / 512) > targ = RLIM_INFINITY / 512; > limit.rlim_max = limit.rlim_cur = targ * 512 > > This is still incomplete. The comparison is still obviously tautologous > when intmax_t == rlim_t (the amd64 case). If intmax_t is larger than > long (the i386 case) or even rlim_t (the notyet case), then it is slightly > less obviously tautologous. This can be fixed by sprinkling volatiles, > e.g. for targ. Oops, I forgot to restore handling of negatives. Also with volatile: volatile intmax_t targ; targ = arg; if (targ > RLIM_INFINITY / 512 || targ < 0) targ = RLIM_INFINITY / 512; limit.rlim_max = limit.rlim_cur = targ * 512; This has not been tested. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 16:07:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E01FA79 for ; Fri, 13 Feb 2015 16:07:40 +0000 (UTC) Received: from nm44-vm7.bullet.mail.bf1.yahoo.com (nm44-vm7.bullet.mail.bf1.yahoo.com [216.109.115.31]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D452326F for ; Fri, 13 Feb 2015 16:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1423843264; bh=MjH1ZtrmLjf1z/uuXaINgd1QGTTmDHyixjh4kVxTlzI=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=KpgU7nBztT0fC0r7zqaTeKxQPym3Xmp9hM1Yx3+ajr99xTv69P5dLsv0prJ7/7lwM0bI0J29FN98Ic/AWAY+q65KOKvq1Ru0W1l7hXDdZOJx7DP0j3gh+jtoSSB5U1JFBArGZFrk8b3ug4IuRtv7oEXReYKSleT/ji9pOHlGO+B2PBggB74Z6lK+mIsi9l51shP3CTNxDTkJwpYaTF2NdkPMsfrsyFGUzR4M6iFHjCWz3uN62jxY7Ov+TDI3D4SdY75Cw1dvELNQ41rB0dJQK2L8jb99HN2qaDwUwHtJBy0Tqm0jHrU7grZPPIIGxE5JbupD7loy8HktymmdkqK/MA== Received: from [98.139.215.143] by nm44.bullet.mail.bf1.yahoo.com with NNFMP; 13 Feb 2015 16:01:04 -0000 Received: from [98.139.211.195] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 13 Feb 2015 16:01:04 -0000 Received: from [127.0.0.1] by smtp204.mail.bf1.yahoo.com with NNFMP; 13 Feb 2015 16:01:04 -0000 X-Yahoo-Newman-Id: 516109.36204.bm@smtp204.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: swiegUsVM1lTZrJU3SZTlJ8mgMNuLl_U_SFabpCfWK._vFO P3gmscn4lXkhIDD9wGIsKjHjS4J9gL6IYIy_okl57UsTRNU2ABwRSHWcpeyn DkFyL_eXWJaBx8QF_lSO6LscyK9VJBUusUppp.xPeuQnbOInfFRyUGGs50z1 r9ovX1r2Uf7aWoh6Nq5eJsbxEsneDUl_pnUA6rXLPHD.ajh0gPfmOHnDU0bC 2l65Dv6stM2HwJX6cgl0c6m_pI5H7tQNVnEp_Gix_dZ7EY1x82Ax29atdqFl Pf5yoJ7_vjy0cUqYLwe3bKxgOZb4Ww1OWDXEOICDHf16XjFp0daVjWyO4WP2 UfERUxHXlSnvExq118n6P1E.aup1VmMEr5OreaWa0Kt7DaOo6j3nS3fVBjpf dcRBQApyY42Pzn1ZC97gb9.pJuLN4qkWb8fZmRHDGeuNmgBmcmyz2S9PEYX3 w3bd2jQPHeWKlQpIDVmCqh.bXToBjGrTYV4Cxp21BEojRCV_SnUh6OK0eRod R.nV8bp5gpTxxfOFczxv52HjViViz.BL4 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54DE1FC9.4000503@FreeBSD.org> Date: Fri, 13 Feb 2015 11:01:13 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Bruce Evans , Andrey Chernov Subject: Re: svn commit: r278634 - head/lib/libc/gen References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <20150213172738.C1007@besplex.bde.org> <54DDABF2.9000201@freebsd.org> <54DDAEF6.3060900@freebsd.org> <20150214005543.X2210@besplex.bde.org> In-Reply-To: <20150214005543.X2210@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 16:07:40 -0000 On 02/13/15 09:29, Bruce Evans wrote: > On Fri, 13 Feb 2015, Andrey Chernov wrote: > >> We even don't need to check arg excepting for < 0, because what is >> needed is rlimt_t and not arg. So this version will be better: >> >> rlimt_t targ; >> >> if (arg < 0) { >> errno = EINVAL; >> return (-1); >> } > > > This is reasonable, but not encouraged by the API or compatible with > what setrlimit() does with negative args. (setrlimit() still uses > my hack from 1994, of converting negative args to RLIM_INFINITY. In > 4.4BSD, it doesn't even check for negative args, and mostly stores > them unchanged; then undefined behaviour tends to occur when the > stored values are used without further checking.) > Actually I think the above check would be OK according to POSIX: ... The /ulimit/() function shall fail and the limit shall be unchanged if: [EINVAL] The /cmd/ argument is not valid. ... ... > An incomplete fix with handling of negative values restored is something > like: > > intmax_t targ; > > targ = arg; > if (targ > RLIM_INFINITY / 512) > targ = RLIM_INFINITY / 512; > limit.rlim_max = limit.rlim_cur = targ * 512 > > This is still incomplete. The comparison is still obviously tautologous > when intmax_t == rlim_t (the amd64 case). If intmax_t is larger than > long (the i386 case) or even rlim_t (the notyet case), then it is > slightly > less obviously tautologous. This can be fixed by sprinkling volatiles, > e.g. for targ. > I am passing this (with the check for negative values and __intmax_t) through the tinderbox. FWIW, I had something else that managed to compile but is *very* ugly and can cause an effect similar to tear gas on sensitive eyes ;). Pedro. From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 16:35:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E36187DF; Fri, 13 Feb 2015 16:35: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE6E27C3; Fri, 13 Feb 2015 16:35:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DGZDsZ063219; Fri, 13 Feb 2015 16:35:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DGZCUD063215; Fri, 13 Feb 2015 16:35:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502131635.t1DGZCUD063215@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 Feb 2015 16:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278681 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 16:35:14 -0000 Author: hselasky Date: Fri Feb 13 16:35:12 2015 New Revision: 278681 URL: https://svnweb.freebsd.org/changeset/base/278681 Log: Add more functions to the Linux kernel compatibility layer. Add some missing includes which are needed when the header files are not included in a particular order. MFC after: 1 month Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/gfp.h head/sys/ofed/include/linux/kernel.h head/sys/ofed/include/linux/kref.h head/sys/ofed/include/linux/pci.h Modified: head/sys/ofed/include/linux/gfp.h ============================================================================== --- head/sys/ofed/include/linux/gfp.h Fri Feb 13 16:21:36 2015 (r278680) +++ head/sys/ofed/include/linux/gfp.h Fri Feb 13 16:35:12 2015 (r278681) @@ -105,6 +105,13 @@ __free_pages(struct page *m, unsigned in kmem_free(kmem_arena, (vm_offset_t)page_address(m), size); } +static inline void free_pages(uintptr_t addr, unsigned int order) +{ + if (addr == 0) + return; + __free_pages(virt_to_page((void *)addr), order); +} + /* * Alloc pages allocates directly from the buddy allocator on linux so * order specifies a power of two bucket of pages and the results @@ -124,6 +131,16 @@ alloc_pages(gfp_t gfp_mask, unsigned int return (virt_to_page(page)); } +static inline uintptr_t __get_free_pages(gfp_t gfp_mask, unsigned int order) +{ + struct page *page; + + page = alloc_pages(gfp_mask, order); + if (page == NULL) + return (0); + return ((uintptr_t)page_address(page)); +} + #define alloc_pages_node(node, mask, order) alloc_pages(mask, order) #define kmalloc_node(chunk, mask, node) kmalloc(chunk, mask) Modified: head/sys/ofed/include/linux/kernel.h ============================================================================== --- head/sys/ofed/include/linux/kernel.h Fri Feb 13 16:21:36 2015 (r278680) +++ head/sys/ofed/include/linux/kernel.h Fri Feb 13 16:35:12 2015 (r278681) @@ -68,6 +68,7 @@ #undef ALIGN #define ALIGN(x, y) roundup2((x), (y)) #define DIV_ROUND_UP howmany +#define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) #define printk(X...) printf(X) @@ -175,6 +176,7 @@ #define round_down(x, y) ((x) & ~__round_mask(x, y)) #define num_possible_cpus() mp_ncpus +#define num_online_cpus() mp_ncpus typedef struct pm_message { int event; Modified: head/sys/ofed/include/linux/kref.h ============================================================================== --- head/sys/ofed/include/linux/kref.h Fri Feb 13 16:21:36 2015 (r278680) +++ head/sys/ofed/include/linux/kref.h Fri Feb 13 16:35:12 2015 (r278681) @@ -29,6 +29,7 @@ #ifndef _LINUX_KREF_H_ #define _LINUX_KREF_H_ +#include #include struct kref { Modified: head/sys/ofed/include/linux/pci.h ============================================================================== --- head/sys/ofed/include/linux/pci.h Fri Feb 13 16:21:36 2015 (r278680) +++ head/sys/ofed/include/linux/pci.h Fri Feb 13 16:35:12 2015 (r278681) @@ -270,6 +270,14 @@ pci_set_master(struct pci_dev *pdev) } static inline int +pci_clear_master(struct pci_dev *pdev) +{ + + pci_disable_busmaster(pdev->dev.bsddev); + return (0); +} + +static inline int pci_request_region(struct pci_dev *pdev, int bar, const char *res_name) { int rid; @@ -458,6 +466,30 @@ pci_enable_msix(struct pci_dev *pdev, st return (0); } +#define pci_enable_msix_range linux_pci_enable_msix_range +static inline int +pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, + int minvec, int maxvec) +{ + int nvec = maxvec; + int rc; + + if (maxvec < minvec) + return (-ERANGE); + + do { + rc = pci_enable_msix(dev, entries, nvec); + if (rc < 0) { + return (rc); + } else if (rc > 0) { + if (rc < minvec) + return (-ENOSPC); + nvec = rc; + } + } while (rc); + return (nvec); +} + static inline int pci_channel_offline(struct pci_dev *pdev) { return false; From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 16:47:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4271C3; Fri, 13 Feb 2015 16:47:03 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 8B16A91B; Fri, 13 Feb 2015 16:47:03 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id A2C59D635B3; Sat, 14 Feb 2015 03:47:00 +1100 (AEDT) Date: Sat, 14 Feb 2015 03:46:53 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pedro Giffuni Subject: Re: svn commit: r278634 - head/lib/libc/gen In-Reply-To: <54DE1FC9.4000503@FreeBSD.org> Message-ID: <20150214032839.E3221@besplex.bde.org> References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <20150213172738.C1007@besplex.bde.org> <54DDABF2.9000201@freebsd.org> <54DDAEF6.3060900@freebsd.org> <20150214005543.X2210@besplex.bde.org> <54DE1FC9.4000503@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=Za4kaKlA c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=CDFkk6uA_NIjEHA-TEwA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 16:47:04 -0000 On Fri, 13 Feb 2015, Pedro Giffuni wrote: > On 02/13/15 09:29, Bruce Evans wrote: >> On Fri, 13 Feb 2015, Andrey Chernov wrote: >> >>> We even don't need to check arg excepting for < 0, because what is >>> needed is rlimt_t and not arg. So this version will be better: >>> >>> rlimt_t targ; >>> >>> if (arg < 0) { >>> errno = EINVAL; >>> return (-1); >>> } >> >> >> This is reasonable, but not encouraged by the API or compatible with >> what setrlimit() does with negative args. (setrlimit() still uses >> my hack from 1994, of converting negative args to RLIM_INFINITY. In >> 4.4BSD, it doesn't even check for negative args, and mostly stores >> them unchanged; then undefined behaviour tends to occur when the >> stored values are used without further checking.) > > Actually I think the above check would be OK according to POSIX: > ... > > The /ulimit/() function shall fail and the limit shall be unchanged if: > > [EINVAL] > The /cmd/ argument is not valid. > ... I already partly explained that this is (part of) why POSIX discourages returning EINVAL for the /data/ argument. EINVAL is for the /cmd/ argument. No errno is specified for the /data/ argument. Instead, the implementation is implicitly encourage to (if the requested value is unrepresentable) invent some representable value and return the result of setting it. We still often get EPERM if our invented value cannot be set due to EPERM. Rounding makes EPERM even more likely than ususal. E.g., if we start with RLIM_INFINITY and get and set it using some implementations of this function, then rounding reduces the hard rlimit. Then if a slightly different implementation tries to increase the hard rlimit hack to RLIM_INFINITY, then this fails with EPERM (except for root). Some preliminary attempts to fix the warning would have caused this EPERM error for almost all error cases, since non-error cases rounded down but error cases attempted to raise to RLIM_INFINITY. > ... >> An incomplete fix with handling of negative values restored is something >> like: >> >> intmax_t targ; >> >> targ = arg; >> if (targ > RLIM_INFINITY / 512) >> targ = RLIM_INFINITY / 512; >> limit.rlim_max = limit.rlim_cur = targ * 512 >> >> This is still incomplete. The comparison is still obviously tautologous >> when intmax_t == rlim_t (the amd64 case). If intmax_t is larger than >> long (the i386 case) or even rlim_t (the notyet case), then it is slightly >> less obviously tautologous. This can be fixed by sprinkling volatiles, >> e.g. for targ. > > I am passing this (with the check for negative values and __intmax_t) > through the tinderbox. > FWIW, I had something else that managed to compile but is *very* > ugly and can cause an effect similar to tear gas on sensitive eyes ;). I also forgot to include for the declaration of intmax_t. Use of double underscores in applications is also bad for the eyes. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 17:01:19 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8195290A for ; Fri, 13 Feb 2015 17:01:19 +0000 (UTC) Received: from nm19-vm0.bullet.mail.bf1.yahoo.com (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3642DB51 for ; Fri, 13 Feb 2015 17:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1423846871; bh=8VEP4ncQ0nnFdBznWxRUSZKXGWQSf4QHRoWcUOezw6Q=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=BOJhJ/TUfpSDroUIDhpgp0cjGBqPOMtLSVYvXoTZCUOHjN8zZe2VlxcsB6zN+4pLG8nkbu46hpAR3uAhwyjf10Kxfq5rIzAy3F+yY8O7pq78uBklSZpP5tf+JYZbo4e9kk19gVg7oMeYjud+kU6Y7N6yQLjX9NtZydWYCcdLyG9iRPsggYJeOs4IwPUGzIU6IP8h5yi21YbzZkYgw9qrvgXzJOI8Y9ksbvrIhqDFJYchcimYwjvoCxbk5aKvQW6U2vT6kHeyXyXg5l9EOHH+U4TSAK1qtCEaTRdivuhVBiJdj4MFG/+DnjRzrEYNCQDGhipEFb9SC31OX94IKFFNzg== Received: from [66.196.81.170] by nm19.bullet.mail.bf1.yahoo.com with NNFMP; 13 Feb 2015 17:01:11 -0000 Received: from [98.139.213.12] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 13 Feb 2015 17:01:11 -0000 Received: from [127.0.0.1] by smtp112.mail.bf1.yahoo.com with NNFMP; 13 Feb 2015 17:01:11 -0000 X-Yahoo-Newman-Id: 774838.3979.bm@smtp112.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: N3v7OnAVM1kPKbuydZglnKZqsh4._opaXsqJtfmcfHyTd98 .g9gYSOJQrF7KMi1cr.j8C.MESMM8IcMpvqJubHvbU9UGNwxVqEb7Nm5n3X1 oMcLThajWvZyrPyB8tLJ8sAfnps58nHaWeBSTYA6zgUYXgRL7O4wBdLLULhn PGbQNs29K5Am2L_N_.bPdOlY1ExFT2ED6LLiDiDCW1m6H_wkiQr4MJyIQANZ Nfml0QQ59ifR3sYq_Na.0W0sR_bpMjCaVjA5.58DScPsFT4b5Qs2P_M3guW8 J6gQSyZJO6HvfnXfB3HK678mv3wSKrMEH2EIrxEwSruNPlhmtzIRydI9cNiU d9jJXd7MeEF2jPP9KryLQdhy5uQHGaqs1rExShY0zZWC0gclZu5Bg4a1_9Uw _UGrpp2JxgVx_Wh_DmjL1QTgR9Otch5.ZNbbjDqRUicPTTteG03uDJvP2Nfj .6M6n_DKZ0vfgpPcygGaNDKle4wVB54w5JgbOWI1KlYr4BqEPLZRADOTbfYK ZxX5tkOwmSBchTdf9FwILKf_VMnUb.Q-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54DE2DE3.7050004@FreeBSD.org> Date: Fri, 13 Feb 2015 12:01:23 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r278634 - head/lib/libc/gen References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <20150213172738.C1007@besplex.bde.org> <54DDABF2.9000201@freebsd.org> <54DDAEF6.3060900@freebsd.org> <20150214005543.X2210@besplex.bde.org> <54DE1FC9.4000503@FreeBSD.org> <20150214032839.E3221@besplex.bde.org> In-Reply-To: <20150214032839.E3221@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 17:01:19 -0000 On 02/13/15 11:46, Bruce Evans wrote: > On Fri, 13 Feb 2015, Pedro Giffuni wrote: > >> On 02/13/15 09:29, Bruce Evans wrote: >>> On Fri, 13 Feb 2015, Andrey Chernov wrote: >>> >>>> We even don't need to check arg excepting for < 0, because what is >>>> needed is rlimt_t and not arg. So this version will be better: >>>> >>>> rlimt_t targ; >>>> >>>> if (arg < 0) { >>>> errno = EINVAL; >>>> return (-1); >>>> } >>> >>> >>> This is reasonable, but not encouraged by the API or compatible with >>> what setrlimit() does with negative args. (setrlimit() still uses >>> my hack from 1994, of converting negative args to RLIM_INFINITY. In >>> 4.4BSD, it doesn't even check for negative args, and mostly stores >>> them unchanged; then undefined behaviour tends to occur when the >>> stored values are used without further checking.) >> >> Actually I think the above check would be OK according to POSIX: >> ... >> >> The /ulimit/() function shall fail and the limit shall be unchanged if: >> >> [EINVAL] >> The /cmd/ argument is not valid. >> ... > > I already partly explained that this is (part of) why POSIX discourages > returning EINVAL for the /data/ argument. EINVAL is for the /cmd/ > argument. No errno is specified for the /data/ argument. Instead, > the implementation is implicitly encourage to (if the requested value > is unrepresentable) invent some representable value and return the > result of setting it. We still often get EPERM if our invented value > cannot be set due to EPERM. Rounding makes EPERM even more likely > than ususal. E.g., if we start with RLIM_INFINITY and get and set it > using some implementations of this function, then rounding reduces > the hard rlimit. Then if a slightly different implementation tries > to increase the hard rlimit hack to RLIM_INFINITY, then this fails > with EPERM (except for root). Some preliminary attempts to fix the > warning would have caused this EPERM error for almost all error > cases, since non-error cases rounded down but error cases attempted > to raise to RLIM_INFINITY. > Oops.. OK, I am pretty bad reading specifications. >> ... >>> An incomplete fix with handling of negative values restored is >>> something >>> like: >>> >>> intmax_t targ; >>> >>> targ = arg; >>> if (targ > RLIM_INFINITY / 512) >>> targ = RLIM_INFINITY / 512; >>> limit.rlim_max = limit.rlim_cur = targ * 512 >>> >>> This is still incomplete. The comparison is still obviously >>> tautologous >>> when intmax_t == rlim_t (the amd64 case). If intmax_t is larger than >>> long (the i386 case) or even rlim_t (the notyet case), then it is >>> slightly >>> less obviously tautologous. This can be fixed by sprinkling volatiles, >>> e.g. for targ. >> >> I am passing this (with the check for negative values and __intmax_t) >> through the tinderbox. >> FWIW, I had something else that managed to compile but is *very* >> ugly and can cause an effect similar to tear gas on sensitive eyes ;). > > I also forgot to include for the declaration of intmax_t. > Use of double underscores in applications is also bad for the eyes. > OK. The patch passes tinderbox. The only missing thing is what to do about arg (iff it has to be adjusted). Pedro. From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 17:33:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23A7926E; Fri, 13 Feb 2015 17:33: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9D8DF68; Fri, 13 Feb 2015 17:33:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DHXSTI091387; Fri, 13 Feb 2015 17:33:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DHXSVb091385; Fri, 13 Feb 2015 17:33:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201502131733.t1DHXSVb091385@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Feb 2015 17:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278682 - 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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 17:33:29 -0000 Author: jhb Date: Fri Feb 13 17:33:27 2015 New Revision: 278682 URL: https://svnweb.freebsd.org/changeset/base/278682 Log: Make the extra dependencies in DPADD be dependencies of PROG_FULL and SHLIB_NAME_FULL so that the full binary is relinked when a dependency changes. Right now the existing full binary is left as-is and only the objcopy to remove debug symbols is run. Differential Revision: https://reviews.freebsd.org/D1834 Reviewed by: emaste MFC after: 3 days Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Feb 13 16:35:12 2015 (r278681) +++ head/share/mk/bsd.lib.mk Fri Feb 13 17:33:27 2015 (r278682) @@ -286,7 +286,7 @@ _EXTRADEPEND: mv $$TMP ${DEPENDFILE} .if !defined(NO_EXTRADEPEND) && defined(SHLIB_NAME) .if defined(DPADD) && !empty(DPADD) - echo ${SHLIB_NAME}: ${DPADD} >> ${DEPENDFILE} + echo ${SHLIB_NAME_FULL}: ${DPADD} >> ${DEPENDFILE} .endif .endif Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Fri Feb 13 16:35:12 2015 (r278681) +++ head/share/mk/bsd.prog.mk Fri Feb 13 17:33:27 2015 (r278682) @@ -168,15 +168,15 @@ CLEANFILES+= ${OBJS} _EXTRADEPEND: .if defined(LDFLAGS) && !empty(LDFLAGS:M-nostdlib) .if defined(DPADD) && !empty(DPADD) - echo ${PROG}: ${DPADD} >> ${DEPENDFILE} + echo ${PROG_FULL}: ${DPADD} >> ${DEPENDFILE} .endif .else - echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} + echo ${PROG_FULL}: ${LIBC} ${DPADD} >> ${DEPENDFILE} .if defined(PROG_CXX) .if ${COMPILER_TYPE} == "clang" && empty(CXXFLAGS:M-stdlib=libstdc++) - echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} + echo ${PROG_FULL}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} .else - echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} + echo ${PROG_FULL}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} .endif .endif .endif From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 17:37:22 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE492568 for ; Fri, 13 Feb 2015 17:37:22 +0000 (UTC) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70222FBE for ; Fri, 13 Feb 2015 17:37:22 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id em10so13806052wid.5 for ; Fri, 13 Feb 2015 09:37:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=MjfUn5/Yua0Y4hAHzYSRJxn4ihXWwTkQ0d583IPBVys=; b=kXYD6Su0AwxNo+8p18BCYr16cuFMcTklQ9ul3aJt2NORI7cThQ+sTrs9r/G0hce57Y JVEz9ZElGz315f2XJ/CAYpCU/sErzasQOGvF9Nn/HHwU4FcpM+WM9nxymMa49OzAns5J NN/7rqyHJA4zEyIzvUvnn0bAKLMubQdFP3oW18LT6X3ZDq9EK1xD5uksMvRfKoDknnuh mKyy/LksBGetNcBPzXCyxNM4CQ05fiIoodeNSC/qVZQiD8nj61ATLBuQ0ExaRN3L269h tNFMq2n/2QhMXWWhYHuKUTXMgIQui8krRte6akERJrBScW3mGy9ZV01IEEBdy+vONAVK n/HA== X-Gm-Message-State: ALoCoQld53OZhleiI1BPwO2Y/i3i0Kntsqs4CGl/u06tEwrSSPjEVO6M2g4wHuRXhQ12jUaxVopY X-Received: by 10.180.78.4 with SMTP id x4mr9210518wiw.86.1423849040662; Fri, 13 Feb 2015 09:37:20 -0800 (PST) Received: from [46.246.76.54] ([46.246.76.54]) by mx.google.com with ESMTPSA id uo6sm10900004wjc.49.2015.02.13.09.37.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Feb 2015 09:37:19 -0800 (PST) Message-ID: <54DE364E.4060203@freebsd.org> Date: Fri, 13 Feb 2015 20:37:18 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r278634 - head/lib/libc/gen References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <20150213172738.C1007@besplex.bde.org> <54DDABF2.9000201@freebsd.org> <54DDAEF6.3060900@freebsd.org> <20150214005543.X2210@besplex.bde.org> In-Reply-To: <20150214005543.X2210@besplex.bde.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Pedro Giffuni , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 17:37:23 -0000 On 13.02.2015 17:29, Bruce Evans wrote: >> if (arg < 0) { >> errno = EINVAL; >> return (-1); >> } > > > This is reasonable, but not encouraged by the API or compatible with > what setrlimit() does with negative args. (setrlimit() still uses > my hack from 1994, of converting negative args to RLIM_INFINITY. In > 4.4BSD, it doesn't even check for negative args, and mostly stores > them unchanged; then undefined behaviour tends to occur when the > stored values are used without further checking.) This hack should be removed from setrlimit() to catch real error. Any syscall should do basic arguments validation. This is true about ulimit() too, so it is not a syscall. If overflow happens before passing arg, it is better to report it than to convert blindly to RLIM_INFINITY. Somebody may decrement long limit value by fixed chunks and go beyond zero. I.e. situation is completely opposite: he means 0 limit, but you set it to INFINITY. So it is always better to report error to leave caller deal with it. If he needs a bigger than long limit, he should use setrlimit() directly, not ulimit(). -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 18:29:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E2B071D; Fri, 13 Feb 2015 18:29:02 +0000 (UTC) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46EC8810; Fri, 13 Feb 2015 18:29:01 +0000 (UTC) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPSA id A5D37D08EF; Fri, 13 Feb 2015 10:29:01 -0800 (PST) Date: Fri, 13 Feb 2015 10:29:01 -0800 From: hiren panchasara To: peter@holm.cc, Randall Stewart Subject: Re: svn commit: r278623 - head/sys/kern Message-ID: <20150213182901.GC19044@strugglingcoder.info> References: <201502121331.t1CDV9jR086269@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GZVR6ND4mMseVXL/" Content-Disposition: inline In-Reply-To: <201502121331.t1CDV9jR086269@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 18:29:02 -0000 --GZVR6ND4mMseVXL/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 02/12/15 at 01:31P, Randall Stewart wrote: > Author: rrs > Date: Thu Feb 12 13:31:08 2015 > New Revision: 278623 > URL: https://svnweb.freebsd.org/changeset/base/278623 >=20 > Log: > This fixes a bug I in-advertantly inserted when I updated the callout > code in my last commit. The cc_exec_next is used to track the next > when a direct call is being made from callout. It is *never* used > in the in-direct method. When macro-izing I made it so that it > would separate out direct/vs/non-direct. This is incorrect and can > cause panics as Peter Holm has found for me (Thanks so much Peter for > all your help in this). What this change does is restore that behavior > but also get rid of the cc_next from the array and instead make it > be part of the base callout structure. This way no one else will get > confused since we will never use it for non-direct. > =20 > Reviewed by: Peter Holm and more importantly tested by him ;-) > MFC after: 3 days. > Sponsored by: Netflix Inc. Can I get more info/backtraces for the panic, please? Cheers, Hiren --GZVR6ND4mMseVXL/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJU3kJsXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/l0h4H/1rAFBQoF4rXpfI2JpMlmeA2 bYWKWzH6bATUhvAGKIVf/8kq7qqlXyjPDjm/uEd9qT4IOTZzuCKYZXqmFONa/IPb dql5CBS3bKwyqlQBUywtylKIkXDWKFqHaKO2twMUrjLQ9V9AD6LqbmbBVyuLldNe yNr16DKjfvfY7xEbduRZY1kGq+hbzFFMdIdGZadWiY1CmDFrOuAEKZUwioGigjGt UxJ4gfeEnvGBdQIQ0cdKTt4IybGg3mCzSKyEuPzZ5gHPdSnhSfYWn9rQQKaNGwFy 2gtsZFydLUrfddq8alm2wjVz5Ooj7sc12PP9/f3JaiWzunDHzAZylirGXB4bjBU= =9MGv -----END PGP SIGNATURE----- --GZVR6ND4mMseVXL/-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 18:32:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 875238BF; Fri, 13 Feb 2015 18:32: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72D7A8D2; Fri, 13 Feb 2015 18:32:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DIWumk020186; Fri, 13 Feb 2015 18:32:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DIWu65020185; Fri, 13 Feb 2015 18:32:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502131832.t1DIWu65020185@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Feb 2015 18:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278690 - head/usr.sbin/gssd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 18:32:56 -0000 Author: markj Date: Fri Feb 13 18:32:55 2015 New Revision: 278690 URL: https://svnweb.freebsd.org/changeset/base/278690 Log: Check for an error from daemon(3), and correct the check for an error from socket(2). MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/gssd/gssd.c Modified: head/usr.sbin/gssd/gssd.c ============================================================================== --- head/usr.sbin/gssd/gssd.c Fri Feb 13 18:16:08 2015 (r278689) +++ head/usr.sbin/gssd/gssd.c Fri Feb 13 18:32:55 2015 (r278690) @@ -193,7 +193,8 @@ main(int argc, char **argv) gssd_load_mech(); if (!debug_level) { - daemon(0, 0); + if (daemon(0, 0) != 0) + err(1, "Can't daemonize"); signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGHUP, SIG_IGN); @@ -206,7 +207,7 @@ main(int argc, char **argv) strcpy(sun.sun_path, _PATH_GSSDSOCK); sun.sun_len = SUN_LEN(&sun); fd = socket(AF_LOCAL, SOCK_STREAM, 0); - if (!fd) { + if (fd < 0) { if (debug_level == 0) { syslog(LOG_ERR, "Can't create local gssd socket"); exit(1); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 18:34:05 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29C99A0D; Fri, 13 Feb 2015 18:34: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1575D8E0; Fri, 13 Feb 2015 18:34:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DIY4vr020423; Fri, 13 Feb 2015 18:34:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DIY4XM020422; Fri, 13 Feb 2015 18:34:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502131834.t1DIY4XM020422@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Feb 2015 18:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278691 - head/usr.sbin/gssd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 18:34:05 -0000 Author: markj Date: Fri Feb 13 18:34:04 2015 New Revision: 278691 URL: https://svnweb.freebsd.org/changeset/base/278691 Log: Add an auto-generated file to CLEANFILES. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/gssd/Makefile Modified: head/usr.sbin/gssd/Makefile ============================================================================== --- head/usr.sbin/gssd/Makefile Fri Feb 13 18:32:55 2015 (r278690) +++ head/usr.sbin/gssd/Makefile Fri Feb 13 18:34:04 2015 (r278691) @@ -16,7 +16,7 @@ LIBADD+= krb5 roken CFLAGS+= -DWITHOUT_KERBEROS .endif -CLEANFILES= gssd_svc.c gssd.h +CLEANFILES= gssd_svc.c gssd_xdr.c gssd.h RPCSRC= ${.CURDIR}/../../sys/kgssapi/gssd.x RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C -M From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 19:11:16 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC230A98 for ; Fri, 13 Feb 2015 19:11:16 +0000 (UTC) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id 7DDEACC8 for ; Fri, 13 Feb 2015 19:11:16 +0000 (UTC) Received: (qmail 78425 invoked from network); 13 Feb 2015 19:11:08 -0000 Received: from 188.182.139.176 (HELO x2.osted.lan) (188.182.139.176) by relay00.pair.com with SMTP; 13 Feb 2015 19:11:08 -0000 X-pair-Authenticated: 188.182.139.176 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id t1DJB7vw031266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 13 Feb 2015 20:11:07 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id t1DJB65f031265; Fri, 13 Feb 2015 20:11:06 +0100 (CET) (envelope-from pho) Date: Fri, 13 Feb 2015 20:11:06 +0100 From: Peter Holm To: hiren panchasara Subject: Re: svn commit: r278623 - head/sys/kern Message-ID: <20150213191106.GA30783@x2.osted.lan> References: <201502121331.t1CDV9jR086269@svn.freebsd.org> <20150213182901.GC19044@strugglingcoder.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150213182901.GC19044@strugglingcoder.info> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 19:11:16 -0000 On Fri, Feb 13, 2015 at 10:29:01AM -0800, hiren panchasara wrote: > On 02/12/15 at 01:31P, Randall Stewart wrote: > > Author: rrs > > Date: Thu Feb 12 13:31:08 2015 > > New Revision: 278623 > > URL: https://svnweb.freebsd.org/changeset/base/278623 > > > > Log: > > This fixes a bug I in-advertantly inserted when I updated the callout > > code in my last commit. The cc_exec_next is used to track the next > > when a direct call is being made from callout. It is *never* used > > in the in-direct method. When macro-izing I made it so that it > > would separate out direct/vs/non-direct. This is incorrect and can > > cause panics as Peter Holm has found for me (Thanks so much Peter for > > all your help in this). What this change does is restore that behavior > > but also get rid of the cc_next from the array and instead make it > > be part of the base callout structure. This way no one else will get > > confused since we will never use it for non-direct. > > > > Reviewed by: Peter Holm and more importantly tested by him ;-) > > MFC after: 3 days. > > Sponsored by: Netflix Inc. > > Can I get more info/backtraces for the panic, please? > Sure. These two panics were seen: http://people.freebsd.org/~pho/stress/log/rrs004.txt http://people.freebsd.org/~pho/stress/log/rrs005.txt - Peter From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 19:44:05 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FD82EA1; Fri, 13 Feb 2015 19:44: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A65FFE5; Fri, 13 Feb 2015 19:44:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DJi5Wf053952; Fri, 13 Feb 2015 19:44:05 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DJi5Fn053951; Fri, 13 Feb 2015 19:44:05 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502131944.t1DJi5Fn053951@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Fri, 13 Feb 2015 19:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278695 - head/sys/dev/oce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 19:44:05 -0000 Author: jmg Date: Fri Feb 13 19:44:04 2015 New Revision: 278695 URL: https://svnweb.freebsd.org/changeset/base/278695 Log: srandom has no influence on read_random, at least not this late... Modified: head/sys/dev/oce/oce_mbox.c Modified: head/sys/dev/oce/oce_mbox.c ============================================================================== --- head/sys/dev/oce/oce_mbox.c Fri Feb 13 19:06:22 2015 (r278694) +++ head/sys/dev/oce/oce_mbox.c Fri Feb 13 19:44:04 2015 (r278695) @@ -811,7 +811,6 @@ oce_config_nic_rss(POCE_SOFTC sc, uint32 fwcmd->params.req.flush = OCE_FLUSH; fwcmd->params.req.if_id = LE_32(if_id); - srandom(arc4random()); /* random entropy seed */ read_random(fwcmd->params.req.hash, sizeof(fwcmd->params.req.hash)); rc = oce_rss_itbl_init(sc, fwcmd); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 19:58:54 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69A8745E; Fri, 13 Feb 2015 19:58: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54C6C172; Fri, 13 Feb 2015 19:58:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DJws5c059547; Fri, 13 Feb 2015 19:58:54 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DJws4S059546; Fri, 13 Feb 2015 19:58:54 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201502131958.t1DJws4S059546@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 13 Feb 2015 19:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278697 - 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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 19:58:54 -0000 Author: alc Date: Fri Feb 13 19:58:53 2015 New Revision: 278697 URL: https://svnweb.freebsd.org/changeset/base/278697 Log: Preset the object's color, or alignment, to maximize superpage usage. MFC after: 5 days Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Fri Feb 13 19:52:16 2015 (r278696) +++ head/sys/kern/sysv_shm.c Fri Feb 13 19:58:53 2015 (r278697) @@ -706,9 +706,10 @@ shmget_allocate_segment(td, uap, mode) #endif return (ENOMEM); } + shm_object->pg_color = 0; VM_OBJECT_WLOCK(shm_object); vm_object_clear_flag(shm_object, OBJ_ONEMAPPING); - vm_object_set_flag(shm_object, OBJ_NOSPLIT); + vm_object_set_flag(shm_object, OBJ_COLORED | OBJ_NOSPLIT); VM_OBJECT_WUNLOCK(shm_object); shmseg->object = shm_object; From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 20:49:44 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF66F60E; Fri, 13 Feb 2015 20:49: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA5B88E2; Fri, 13 Feb 2015 20:49:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DKniTw083947; Fri, 13 Feb 2015 20:49:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DKnil1083945; Fri, 13 Feb 2015 20:49:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502132049.t1DKnil1083945@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 Feb 2015 20:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278704 - 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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 20:49:44 -0000 Author: ngie Date: Fri Feb 13 20:49:43 2015 New Revision: 278704 URL: https://svnweb.freebsd.org/changeset/base/278704 Log: Unbreak rcorder when MK_UNBOUND == no by moving local_unbound from REQUIRE: in NETWORKING to BEFORE: in the script MFC after: 2 weeks Modified: head/etc/rc.d/NETWORKING head/etc/rc.d/local_unbound Modified: head/etc/rc.d/NETWORKING ============================================================================== --- head/etc/rc.d/NETWORKING Fri Feb 13 20:38:39 2015 (r278703) +++ head/etc/rc.d/NETWORKING Fri Feb 13 20:49:43 2015 (r278704) @@ -6,7 +6,7 @@ # PROVIDE: NETWORKING NETWORK # REQUIRE: netif netoptions routing ppp ipfw stf # REQUIRE: defaultroute routed route6d mroute6d resolv bridge -# REQUIRE: static_arp static_ndp local_unbound +# REQUIRE: static_arp static_ndp # This is a dummy dependency, for services which require networking # to be operational before starting. Modified: head/etc/rc.d/local_unbound ============================================================================== --- head/etc/rc.d/local_unbound Fri Feb 13 20:38:39 2015 (r278703) +++ head/etc/rc.d/local_unbound Fri Feb 13 20:49:43 2015 (r278704) @@ -5,6 +5,7 @@ # PROVIDE: local_unbound # REQUIRE: FILESYSTEMS netif resolv +# BEFORE: NETWORKING # KEYWORD: shutdown . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 20:52:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9BE598E; Fri, 13 Feb 2015 20:52: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94B659C0; Fri, 13 Feb 2015 20:52:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DKqO4Y087850; Fri, 13 Feb 2015 20:52:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DKqOCm087848; Fri, 13 Feb 2015 20:52:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502132052.t1DKqOCm087848@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 Feb 2015 20:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278706 - 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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 20:52:24 -0000 Author: ngie Date: Fri Feb 13 20:52:23 2015 New Revision: 278706 URL: https://svnweb.freebsd.org/changeset/base/278706 Log: Unbreak rcorder when MK_UTX == no by moving utx from REQUIRE: in LOGIN to BEFORE: in utx MFC after: 1 week Modified: head/etc/rc.d/LOGIN head/etc/rc.d/utx Modified: head/etc/rc.d/LOGIN ============================================================================== --- head/etc/rc.d/LOGIN Fri Feb 13 20:49:49 2015 (r278705) +++ head/etc/rc.d/LOGIN Fri Feb 13 20:52:23 2015 (r278706) @@ -4,7 +4,7 @@ # # PROVIDE: LOGIN -# REQUIRE: DAEMON utx +# REQUIRE: DAEMON # This is a dummy dependency to ensure user services such as xdm, # inetd, cron and kerberos are started after everything else, in case Modified: head/etc/rc.d/utx ============================================================================== --- head/etc/rc.d/utx Fri Feb 13 20:49:49 2015 (r278705) +++ head/etc/rc.d/utx Fri Feb 13 20:52:23 2015 (r278706) @@ -5,6 +5,7 @@ # PROVIDE: utx # REQUIRE: DAEMON FILESYSTEMS +# BEFORE: LOGIN # KEYWORD: shutdown . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 21:21:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B03553B4; Fri, 13 Feb 2015 21:21:33 +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)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C9BACC0; Fri, 13 Feb 2015 21:21:32 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1DLLScN033116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Feb 2015 00:21:28 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1DLLSfp033115; Sat, 14 Feb 2015 00:21:28 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Feb 2015 00:21:28 +0300 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 Message-ID: <20150213212128.GG15484@FreeBSD.org> References: <201502091928.t19JSC5P066293@svn.freebsd.org> <1903622.i3cFFNVYcL@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1903622.i3cFFNVYcL@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: src-committers@freebsd.org, Eric van Gyzen , svn-src-all@freebsd.org, Randall Stewart , svn-src-head@freebsd.org, zont@FreeBSD.org, rstone@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 21:21:33 -0000 On Mon, Feb 09, 2015 at 03:11:21PM -0500, John Baldwin wrote: J> On Monday, February 09, 2015 07:28:12 PM Randall Stewart wrote: J> > Author: rrs J> > Date: Mon Feb 9 19:28:11 2015 J> > New Revision: 278472 J> > URL: https://svnweb.freebsd.org/changeset/base/278472 J> > J> > Log: J> > This fixes a bug in the way that the LLE timers for nd6 J> > and arp were being used. They basically would pass in the J> > mutex to the callout_init. Because they used this method J> > to the callout system, it was possible to "stop" the callout. J> > When flushing the table and you stopped the running callout, the J> > callout_stop code would return 1 indicating that it was going J> > to stop the callout (that was about to run on the callout_wheel blocked J> > by the function calling the stop). Now when 1 was returned, it would J> > lower the reference count one extra time for the stopped timer, then J> > a few lines later delete the memory. Of course the callout_wheel was J> > stuck in the lock code and would then crash since it was accessing J> > freed memory. By using callout_init(c, 1) we always get a 0 back J> > and the reference counting bug does not rear its head. We do have J> > to make a few adjustments to the callouts themselves though to make J> > sure it does the proper thing if rescheduled as well as gets the lock. J> > J> > Commented upon by hiren and sbruno J> > See Phabricator D1777 for more details. J> > J> > Commented upon by hiren and sbruno J> > Reviewed by: adrian, jhb and bz J> > Sponsored by: Netflix Inc. J> J> Eh, I looked at it, but I really, really don't like it. I think J> callout_init_*() should be preferred to CALLOUT_MPSAFE whenever possible as it J> is less race-prone. I think this should probably be fixed by adding Hans' J> callout_drain_async() instead, though this is fine as a temporary workaround. I second concerns. Please look at kern/165863 and r238990 that fixed it. Transition from CALLOUT_MPSAFE to callout_init_rw() was intentional and fixed races. I added to Cc guys who helped to track down that races. May be someone still has test scripts at hand. AFAIR, there were some that allowed to put a box down quite quickly. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 22:08:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3B33FE3 for ; Fri, 13 Feb 2015 22:08:18 +0000 (UTC) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8015514B for ; Fri, 13 Feb 2015 22:08:18 +0000 (UTC) Received: by pdjg10 with SMTP id g10so22114604pdj.1 for ; Fri, 13 Feb 2015 14:08:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=wmRCk1tX0Mu0rXZ0fEYiO7RHCqMArGNnUPEAFUFCJTI=; b=LhQILhYt7Z/PuXUApTIm+7iausmRwbkg66vQQKD1RQnBqgIamHwiO/EPav5w4CEl2s 4Ekiy+WOLuYEY9Fe9zGBmwyhlmX8tsMkN2mYpRCUHgN4umKawNAetbzqsAEHnVqjCCPC SVt8G2eLCVa4VWhwXD8E4nNGn2jnm4H0xDkNw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=wmRCk1tX0Mu0rXZ0fEYiO7RHCqMArGNnUPEAFUFCJTI=; b=AT+jSqcgZ0TZhQiSfaX4JWU+OH/Dh0UKyHMiTxLSSp1OI56mvxb8TApXuDiSkprfGU mrGTYSE51/4XiShXi8L2VN0oVLozOH3ycWV5iCf1Cldjwe5h568PpFnVIv+zgxiZraiV Daxa2vhoNL7Q1u0QKZwJv8kiCyCyaQMzMTsxVRvfvczvj/xWtMlfOvGXLou7y7P/5U5c XT5+GrNrXhp/gSWsSNMaKKdcm5I65etkKdb45k5y2TT/H801LMxgIK75ykjw+OH/DYES BqiJwZN5fWXZN+36x1rwpZM6SL9FYSIgk7x0qSYgVgHZXFLU2+6tAkMzfioFv2Mowh2S RWJg== X-Gm-Message-State: ALoCoQkwGh5lz+6jNQCW3qnzBFJq2T4iyyv8TGZ9QEL3fkKTdsCQ/E4mAMUiAAts8t9xQCUySean X-Received: by 10.66.66.7 with SMTP id b7mr2165859pat.9.1423865297980; Fri, 13 Feb 2015 14:08:17 -0800 (PST) Received: from [10.64.24.11] ([69.53.236.236]) by mx.google.com with ESMTPSA id bi11sm7711793pdb.8.2015.02.13.14.08.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Feb 2015 14:08:16 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 From: Randall Stewart In-Reply-To: <20150213212128.GG15484@FreeBSD.org> Date: Fri, 13 Feb 2015 17:08:12 -0500 Message-Id: <1655B9AB-AC55-49EE-ADB6-F355F578915A@netflix.com> References: <201502091928.t19JSC5P066293@svn.freebsd.org> <1903622.i3cFFNVYcL@ralph.baldwin.cx> <20150213212128.GG15484@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: src-committers@freebsd.org, John Baldwin , Eric van Gyzen , svn-src-all@freebsd.org, Randall Stewart , svn-src-head@freebsd.org, zont@FreeBSD.org, rstone@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 22:08:18 -0000 On Feb 13, 2015, at 4:21 PM, Gleb Smirnoff wrote: > On Mon, Feb 09, 2015 at 03:11:21PM -0500, John Baldwin wrote: > J> On Monday, February 09, 2015 07:28:12 PM Randall Stewart wrote: > J> > Author: rrs > J> > Date: Mon Feb 9 19:28:11 2015 > J> > New Revision: 278472 > J> > URL: https://svnweb.freebsd.org/changeset/base/278472 > J> >=20 > J> > Log: > J> > This fixes a bug in the way that the LLE timers for nd6 > J> > and arp were being used. They basically would pass in the > J> > mutex to the callout_init. Because they used this method > J> > to the callout system, it was possible to "stop" the callout. > J> > When flushing the table and you stopped the running callout, = the > J> > callout_stop code would return 1 indicating that it was going > J> > to stop the callout (that was about to run on the callout_wheel = blocked > J> > by the function calling the stop). Now when 1 was returned, it = would > J> > lower the reference count one extra time for the stopped timer, = then > J> > a few lines later delete the memory. Of course the = callout_wheel was > J> > stuck in the lock code and would then crash since it was = accessing > J> > freed memory. By using callout_init(c, 1) we always get a 0 = back > J> > and the reference counting bug does not rear its head. We do = have > J> > to make a few adjustments to the callouts themselves though to = make > J> > sure it does the proper thing if rescheduled as well as gets = the lock. > J> >=20 > J> > Commented upon by hiren and sbruno > J> > See Phabricator D1777 for more details. > J> >=20 > J> > Commented upon by hiren and sbruno > J> > Reviewed by: adrian, jhb and bz > J> > Sponsored by: Netflix Inc. > J>=20 > J> Eh, I looked at it, but I really, really don't like it. I think=20 > J> callout_init_*() should be preferred to CALLOUT_MPSAFE whenever = possible as it=20 > J> is less race-prone. I think this should probably be fixed by = adding Hans'=20 > J> callout_drain_async() instead, though this is fine as a temporary = workaround. >=20 > I second concerns. Please look at kern/165863 and r238990 that fixed = it. > Transition from CALLOUT_MPSAFE to callout_init_rw() was intentional > and fixed races. >=20 > I added to Cc guys who helped to track down that races. May be someone = still > has test scripts at hand. AFAIR, there were some that allowed to put a = box > down quite quickly. Well without it we can also put a box down quickly.. at least Sbruno and = Hiren seem to be able to.. you end up with deleted memory being accessed by the callout = code. I can look at kern/165863 and 238990.. let me go see what I can see ;0 >=20 > --=20 > Totus tuus, Glebius. -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 22:25:31 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24E0A4EC; Fri, 13 Feb 2015 22:25:31 +0000 (UTC) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BA7837D; Fri, 13 Feb 2015 22:25:30 +0000 (UTC) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPSA id 31E6DCF892; Fri, 13 Feb 2015 14:25:24 -0800 (PST) Date: Fri, 13 Feb 2015 14:25:23 -0800 From: hiren panchasara To: Peter Holm Subject: Re: svn commit: r278623 - head/sys/kern Message-ID: <20150213222523.GD19044@strugglingcoder.info> References: <201502121331.t1CDV9jR086269@svn.freebsd.org> <20150213182901.GC19044@strugglingcoder.info> <20150213191106.GA30783@x2.osted.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="F8dlzb82+Fcn6AgP" Content-Disposition: inline In-Reply-To: <20150213191106.GA30783@x2.osted.lan> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 22:25:31 -0000 --F8dlzb82+Fcn6AgP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 02/13/15 at 08:11P, Peter Holm wrote: > On Fri, Feb 13, 2015 at 10:29:01AM -0800, hiren panchasara wrote: > > On 02/12/15 at 01:31P, Randall Stewart wrote: > > > Author: rrs > > > Date: Thu Feb 12 13:31:08 2015 > > > New Revision: 278623 > > > URL: https://svnweb.freebsd.org/changeset/base/278623 > > >=20 > > > Log: > > > This fixes a bug I in-advertantly inserted when I updated the callo= ut > > > code in my last commit. The cc_exec_next is used to track the next > > > when a direct call is being made from callout. It is *never* used > > > in the in-direct method. When macro-izing I made it so that it > > > would separate out direct/vs/non-direct. This is incorrect and can > > > cause panics as Peter Holm has found for me (Thanks so much Peter f= or > > > all your help in this). What this change does is restore that behav= ior > > > but also get rid of the cc_next from the array and instead make it > > > be part of the base callout structure. This way no one else will get > > > confused since we will never use it for non-direct. > > > =20 > > > Reviewed by: Peter Holm and more importantly tested by him ;-) > > > MFC after: 3 days. > > > Sponsored by: Netflix Inc. > >=20 > > Can I get more info/backtraces for the panic, please? > >=20 >=20 > Sure. >=20 > These two panics were seen: >=20 > http://people.freebsd.org/~pho/stress/log/rrs004.txt > http://people.freebsd.org/~pho/stress/log/rrs005.txt Thank you, Peter. cheers Hiren --F8dlzb82+Fcn6AgP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJU3nnTXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lwnoIAIIEExjvNO8cBGXP6h+KmODm uhOTSbSLiSFwdNsZCySIWRo/HAJ0rwACKvP+1hp4YHzQfpNt8LXyELVa6hGN+Dtj 1ieRG1X0Prx7mvFjEzXlOpsDiCJ5UCs+MSn8HdJttXCRiOsCqmsdzlxRMyolahHe 3E1seziYoGoNs+0Hic2zGzso+hFDzTGtWqIMBfZPJKkRVB4tsMdYTUbMqRInpDNt jaryLhi5FvfDpyGqUMHDQB1VbWJjq9dzxK9RjAbZKdSasZOeaBV0AnvGoCenmAve rEhFYzdLNw6YSf9IjDCN2EdXYonhFk2BQapNlLSVJjVKgKI8g6YOAzOq6G2AH7M= =R9L8 -----END PGP SIGNATURE----- --F8dlzb82+Fcn6AgP-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 22:27:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4DEF660 for ; Fri, 13 Feb 2015 22:27:46 +0000 (UTC) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B6E33A4 for ; Fri, 13 Feb 2015 22:27:46 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id kq14so21680981pab.3 for ; Fri, 13 Feb 2015 14:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=rYFPt1hjx02a79I+zHK+Hiro5J6ZtyyGELeL1DBgHHs=; b=Hs9W8FonpsDskpCepsl3JyahvEx0rqFyV5Lsslx+jD05ztidE2JuIs50q9tcjljPiy XZkgqN9kX1DAcDlVzJQyHRHUGW0m7HYFzeINEHwOtxSRFjoJlQhyp0VkwJ75atXAV5ZQ tVfAJg0vm03LB/LE06yDecfnsl37HSwmqF5Lc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=rYFPt1hjx02a79I+zHK+Hiro5J6ZtyyGELeL1DBgHHs=; b=do4eyfyCXMhq0vcyeEJdqIVlNEFKUIPVPob04zE2cs5GuMCGOZRNssK4XICkV/0+k1 vtak+c5Y6YG76rmab9AfTEBU0wE0jVgciW0JH9uIOdHznoqgZy4HQDokNmNUnnNrksMy hD1q+g/x0rJhfDXp1iXF8ay7de+ZxhN2lPdPDPxwOiSbXU8KxH4FpgQPXl443SkpmrFO bYInIbqCaT+Mc2QBlGtN93M3/6gjXEZoW2UT7w3MzRIaMrz41zwvrGjtETIUlik1MUvd /ghPA07NWhrQ7BtMe5h44PxnrsunqJrJFIE03Fv3xcL563/Wj0GfJFyTnkgFpCTfqwvc 6ZSQ== X-Gm-Message-State: ALoCoQnD0E5lMjrgqoJIhvZYirZJSjq2IanjjefGG6ZxMLSV9Asgj6hn4ZK+t2hlgCAqHDIEixz8 X-Received: by 10.69.27.42 with SMTP id jd10mr19020947pbd.97.1423866466011; Fri, 13 Feb 2015 14:27:46 -0800 (PST) Received: from [10.64.24.11] ([69.53.236.236]) by mx.google.com with ESMTPSA id c9sm7667877pdm.51.2015.02.13.14.27.42 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Feb 2015 14:27:44 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 From: Randall Stewart In-Reply-To: <20150213212128.GG15484@FreeBSD.org> Date: Fri, 13 Feb 2015 17:27:40 -0500 Message-Id: <89BA29F2-C617-40DE-90E5-F3EC9C17AEC8@netflix.com> References: <201502091928.t19JSC5P066293@svn.freebsd.org> <1903622.i3cFFNVYcL@ralph.baldwin.cx> <20150213212128.GG15484@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: src-committers@freebsd.org, John Baldwin , Eric van Gyzen , svn-src-all@freebsd.org, Randall Stewart , svn-src-head@freebsd.org, zont@FreeBSD.org, rstone@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 22:27:46 -0000 Gleb: Ok here is the diff of the arp timer function that this changed made = (238990): **************************** arptimer(void *arg) { + struct llentry *lle =3D (struct llentry *)arg; struct ifnet *ifp; - struct llentry *lle; - int pkts_dropped; + size_t pkts_dropped; =20 - KASSERT(arg !=3D NULL, ("%s: arg NULL", __func__)); - lle =3D (struct llentry *)arg; + if (lle->la_flags & LLE_STATIC) { + LLE_WUNLOCK(lle); + return; + } + ifp =3D lle->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); + + if (lle->la_flags !=3D LLE_DELETED) { + int evt; + + if (lle->la_flags & LLE_VALID) + evt =3D LLENTRY_EXPIRED; + else + evt =3D LLENTRY_TIMEDOUT; + EVENTHANDLER_INVOKE(lle_event, lle, evt); + } + + callout_stop(&lle->la_timer); + + /* XXX: LOR avoidance. We still have ref on lle. */ + LLE_WUNLOCK(lle); IF_AFDATA_LOCK(ifp); LLE_WLOCK(lle); - if (lle->la_flags & LLE_STATIC) - LLE_WUNLOCK(lle); - else { - if (!callout_pending(&lle->la_timer) && - callout_active(&lle->la_timer)) { - callout_stop(&lle->la_timer); - LLE_REMREF(lle); =20 - if (lle->la_flags !=3D LLE_DELETED) { - int evt; - - if (lle->la_flags & LLE_VALID) - evt =3D LLENTRY_EXPIRED; - else - evt =3D LLENTRY_TIMEDOUT; - EVENTHANDLER_INVOKE(lle_event, lle, = evt); - } - - pkts_dropped =3D llentry_free(lle); - ARPSTAT_ADD(dropped, pkts_dropped); - ARPSTAT_INC(timeouts); - } else { -#ifdef DIAGNOSTIC - struct sockaddr *l3addr =3D L3_ADDR(lle); - log(LOG_INFO, - "arptimer issue: %p, IPv4 address: = \"%s\"\n", lle, - inet_ntoa( - ((const struct sockaddr_in = *)l3addr)->sin_addr)); -#endif - LLE_WUNLOCK(lle); - } - } + LLE_REMREF(lle); + pkts_dropped =3D llentry_free(lle); IF_AFDATA_UNLOCK(ifp); + ARPSTAT_ADD(dropped, pkts_dropped); + ARPSTAT_INC(timeouts); CURVNET_RESTORE(); } ****************************** And I can see *what* the problem was.. If you look at the lines: - if (!callout_pending(&lle->la_timer) && - callout_active(&lle->la_timer)) { This is the *incorrect* way to write this code it should have been: if (callout_pending(&lle->la_timer) && !callout_active(&lle->la_timer)) { To properly do the MPSAFE thing.. take a look at the callout manual.. So the original author just mixed up the test..=20 The idea is after you get the lock you check if its pending again, if so someone has restarted it.. and if its not active, then someone has stopped it. They check if it was *not* pending.. which is almost always the case since the callout code removes the pending flag and thats what you want to be there. So not pending would always be true..=20 I don=92t see that this old code did the callout_deactive().. but I = think the callout_stop() does that I guess.. I think the problem was that the original code was wrong and that the fix yes, avoided one race but put in another. I do think a callout_async_drain is the right thing, but that will take = a while to get right. Peter Holm (thank you so much) has been pounding on this, = if you could find another test to add.. that would be great. I think this will = work the way it is.. R On Feb 13, 2015, at 4:21 PM, Gleb Smirnoff wrote: > 165863 -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 22:55:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1233C97; Fri, 13 Feb 2015 22:55: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB61E873; Fri, 13 Feb 2015 22:55:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DMtQjq047109; Fri, 13 Feb 2015 22:55:26 GMT (envelope-from thomas@FreeBSD.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DMtQ3K047108; Fri, 13 Feb 2015 22:55:26 GMT (envelope-from thomas@FreeBSD.org) Message-Id: <201502132255.t1DMtQ3K047108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: thomas set sender to thomas@FreeBSD.org using -f From: Thomas Quinot Date: Fri, 13 Feb 2015 22:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278728 - head/usr.sbin/freebsd-update X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 22:55:27 -0000 Author: thomas Date: Fri Feb 13 22:55:25 2015 New Revision: 278728 URL: https://svnweb.freebsd.org/changeset/base/278728 Log: (backup_kernel_finddir, backup_kernel, install_files): Add missing references to $BASEDIR, in order to allow correct operation when updating a system mounted at another location than / (e.g. when updating an alternate Boot Environment). Reviewed by: cperciva MFC after: 1 week Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Fri Feb 13 22:32:02 2015 (r278727) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Fri Feb 13 22:55:25 2015 (r278728) @@ -2634,14 +2634,14 @@ backup_kernel_finddir () { while true ; do # Pathname does not exist, so it is OK use that name # for backup directory. - if [ ! -e $BACKUPKERNELDIR ]; then + if [ ! -e $BASEDIR/$BACKUPKERNELDIR ]; then return 0 fi # If directory do exist, we only use if it has our # marker file. - if [ -d $BACKUPKERNELDIR -a \ - -e $BACKUPKERNELDIR/.freebsd-update ]; then + if [ -d $BASEDIR/$BACKUPKERNELDIR -a \ + -e $BASEDIR/$BACKUPKERNELDIR/.freebsd-update ]; then return 0 fi @@ -2649,7 +2649,7 @@ backup_kernel_finddir () { # the end and try again. CNT=$((CNT + 1)) if [ $CNT -gt 9 ]; then - echo "Could not find valid backup dir ($BACKUPKERNELDIR)" + echo "Could not find valid backup dir ($BASEDIR/$BACKUPKERNELDIR)" exit 1 fi BACKUPKERNELDIR="`echo $BACKUPKERNELDIR | sed -Ee 's/[0-9]\$//'`" @@ -2676,17 +2676,17 @@ backup_kernel () { # Remove old kernel backup files. If $BACKUPKERNELDIR was # "not ours", backup_kernel_finddir would have exited, so # deleting the directory content is as safe as we can make it. - if [ -d $BACKUPKERNELDIR ]; then - rm -fr $BACKUPKERNELDIR + if [ -d $BASEDIR/$BACKUPKERNELDIR ]; then + rm -fr $BASEDIR/$BACKUPKERNELDIR fi # Create directories for backup. - mkdir -p $BACKUPKERNELDIR - mtree -cdn -p "${KERNELDIR}" | \ - mtree -Ue -p "${BACKUPKERNELDIR}" > /dev/null + mkdir -p $BASEDIR/$BACKUPKERNELDIR + mtree -cdn -p "${BASEDIR}/${KERNELDIR}" | \ + mtree -Ue -p "${BASEDIR}/${BACKUPKERNELDIR}" > /dev/null # Mark the directory as having been created by freebsd-update. - touch $BACKUPKERNELDIR/.freebsd-update + touch $BASEDIR/$BACKUPKERNELDIR/.freebsd-update if [ $? -ne 0 ]; then echo "Could not create kernel backup directory" exit 1 @@ -2704,8 +2704,8 @@ backup_kernel () { fi # Backup all the kernel files using hardlinks. - (cd $KERNELDIR && find . -type f $FINDFILTER -exec \ - cp -pl '{}' ${BACKUPKERNELDIR}/'{}' \;) + (cd ${BASEDIR}/${KERNELDIR} && find . -type f $FINDFILTER -exec \ + cp -pl '{}' ${BASEDIR}/${BACKUPKERNELDIR}/'{}' \;) # Re-enable patchname expansion. set +f @@ -2803,7 +2803,7 @@ install_files () { # Update linker.hints if necessary if [ -s INDEX-OLD -o -s INDEX-NEW ]; then - kldxref -R /boot/ 2>/dev/null + kldxref -R ${BASEDIR}/boot/ 2>/dev/null fi # We've finished updating the kernel. @@ -2854,14 +2854,14 @@ Kernel updates have been installed. Ple install_delete INDEX-OLD INDEX-NEW || return 1 # Rebuild /etc/spwd.db and /etc/pwd.db if necessary. - if [ /etc/master.passwd -nt /etc/spwd.db ] || - [ /etc/master.passwd -nt /etc/pwd.db ]; then - pwd_mkdb /etc/master.passwd + if [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/spwd.db ] || + [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/pwd.db ]; then + pwd_mkdb -d ${BASEDIR}/etc ${BASEDIR}/etc/master.passwd fi # Rebuild /etc/login.conf.db if necessary. - if [ /etc/login.conf -nt /etc/login.conf.db ]; then - cap_mkdb /etc/login.conf + if [ ${BASEDIR}/etc/login.conf -nt ${BASEDIR}/etc/login.conf.db ]; then + cap_mkdb ${BASEDIR}/etc/login.conf fi # We've finished installing the world and deleting old files From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 23:19:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14A8BF45; Fri, 13 Feb 2015 23:19: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F37E4A3B; Fri, 13 Feb 2015 23:19:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DNJZ1M057046; Fri, 13 Feb 2015 23:19:35 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DNJZuP057045; Fri, 13 Feb 2015 23:19:35 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201502132319.t1DNJZuP057045@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 13 Feb 2015 23:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278729 - 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.18-1 Precedence: list List-Id: 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, 13 Feb 2015 23:19:36 -0000 Author: sjg Date: Fri Feb 13 23:19:35 2015 New Revision: 278729 URL: https://svnweb.freebsd.org/changeset/base/278729 Log: sbspace: size of bleft, mleft must match sockbuf fields to avoid overflow on amd64 Submitted by: anshukla@juniper.net Obtained from: Juniper Networks Modified: head/sys/sys/sockbuf.h Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Fri Feb 13 22:55:25 2015 (r278728) +++ head/sys/sys/sockbuf.h Fri Feb 13 23:19:35 2015 (r278729) @@ -212,7 +212,7 @@ sbused(struct sockbuf *sb) static inline long sbspace(struct sockbuf *sb) { - long bleft, mleft; + int bleft, mleft; /* size should match sockbuf fields */ #if 0 SOCKBUF_LOCK_ASSERT(sb); From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 23:35:59 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DB57600; Fri, 13 Feb 2015 23:35: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E7EAC23; Fri, 13 Feb 2015 23:35:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DNZxNu066157; Fri, 13 Feb 2015 23:35:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DNZxr9066156; Fri, 13 Feb 2015 23:35:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201502132335.t1DNZxr9066156@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 13 Feb 2015 23:35:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278733 - head/lib/libiconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 23:35:59 -0000 Author: bdrewery Date: Fri Feb 13 23:35:58 2015 New Revision: 278733 URL: https://svnweb.freebsd.org/changeset/base/278733 Log: Remove disconnected (and broken) directory libiconv. It was added in the initial citrus import in r219019 but never used as iconv is just built with libc. A libiconv.so was handled by lib/libiconv_compat for a while but removed in r257583. Deleted: head/lib/libiconv/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 23:38:22 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF5F79B2; Fri, 13 Feb 2015 23:38:22 +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)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6199AC47; Fri, 13 Feb 2015 23:38:21 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1DNcCtw033825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Feb 2015 02:38:12 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1DNcB49033824; Sat, 14 Feb 2015 02:38:11 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Feb 2015 02:38:11 +0300 From: Gleb Smirnoff To: Randall Stewart Subject: Re: svn commit: r278472 - in head/sys: netinet netinet6 Message-ID: <20150213233811.GH15484@FreeBSD.org> References: <201502091928.t19JSC5P066293@svn.freebsd.org> <1903622.i3cFFNVYcL@ralph.baldwin.cx> <20150213212128.GG15484@FreeBSD.org> <89BA29F2-C617-40DE-90E5-F3EC9C17AEC8@netflix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <89BA29F2-C617-40DE-90E5-F3EC9C17AEC8@netflix.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: src-committers@freebsd.org, John Baldwin , Eric van Gyzen , svn-src-all@freebsd.org, Randall Stewart , svn-src-head@freebsd.org, zont@FreeBSD.org, rstone@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 23:38:23 -0000 Randall, thanks a lot for investigating that. On Fri, Feb 13, 2015 at 05:27:40PM -0500, Randall Stewart wrote: R> Gleb: R> R> Ok here is the diff of the arp timer function that this changed made (238990): R> **************************** R> arptimer(void *arg) R> { R> + struct llentry *lle = (struct llentry *)arg; R> struct ifnet *ifp; R> - struct llentry *lle; R> - int pkts_dropped; R> + size_t pkts_dropped; R> R> - KASSERT(arg != NULL, ("%s: arg NULL", __func__)); R> - lle = (struct llentry *)arg; R> + if (lle->la_flags & LLE_STATIC) { R> + LLE_WUNLOCK(lle); R> + return; R> + } R> + R> ifp = lle->lle_tbl->llt_ifp; R> CURVNET_SET(ifp->if_vnet); R> + R> + if (lle->la_flags != LLE_DELETED) { R> + int evt; R> + R> + if (lle->la_flags & LLE_VALID) R> + evt = LLENTRY_EXPIRED; R> + else R> + evt = LLENTRY_TIMEDOUT; R> + EVENTHANDLER_INVOKE(lle_event, lle, evt); R> + } R> + R> + callout_stop(&lle->la_timer); R> + R> + /* XXX: LOR avoidance. We still have ref on lle. */ R> + LLE_WUNLOCK(lle); R> IF_AFDATA_LOCK(ifp); R> LLE_WLOCK(lle); R> - if (lle->la_flags & LLE_STATIC) R> - LLE_WUNLOCK(lle); R> - else { R> - if (!callout_pending(&lle->la_timer) && R> - callout_active(&lle->la_timer)) { R> - callout_stop(&lle->la_timer); R> - LLE_REMREF(lle); R> R> - if (lle->la_flags != LLE_DELETED) { R> - int evt; R> - R> - if (lle->la_flags & LLE_VALID) R> - evt = LLENTRY_EXPIRED; R> - else R> - evt = LLENTRY_TIMEDOUT; R> - EVENTHANDLER_INVOKE(lle_event, lle, evt); R> - } R> - R> - pkts_dropped = llentry_free(lle); R> - ARPSTAT_ADD(dropped, pkts_dropped); R> - ARPSTAT_INC(timeouts); R> - } else { R> -#ifdef DIAGNOSTIC R> - struct sockaddr *l3addr = L3_ADDR(lle); R> - log(LOG_INFO, R> - "arptimer issue: %p, IPv4 address: \"%s\"\n", lle, R> - inet_ntoa( R> - ((const struct sockaddr_in *)l3addr)->sin_addr)); R> -#endif R> - LLE_WUNLOCK(lle); R> - } R> - } R> + LLE_REMREF(lle); R> + pkts_dropped = llentry_free(lle); R> IF_AFDATA_UNLOCK(ifp); R> + ARPSTAT_ADD(dropped, pkts_dropped); R> + ARPSTAT_INC(timeouts); R> CURVNET_RESTORE(); R> } R> ****************************** R> R> And I can see *what* the problem was.. If you look at the lines: R> - if (!callout_pending(&lle->la_timer) && R> - callout_active(&lle->la_timer)) { R> R> This is the *incorrect* way to write this code it should have been: R> if (callout_pending(&lle->la_timer) && R> !callout_active(&lle->la_timer)) { R> R> To properly do the MPSAFE thing.. take a look at the callout manual.. R> So the original author just mixed up the test.. R> R> The idea is after you get the lock you check if its pending again, if R> so someone has restarted it.. and if its not active, then someone has R> stopped it. R> R> They check if it was *not* pending.. which is almost always the case R> since the callout code removes the pending flag and thats what you want R> to be there. So not pending would always be true.. R> R> I don’t see that this old code did the callout_deactive().. but I think R> the callout_stop() does that I guess.. R> R> I think the problem was that the original code was wrong and that R> the fix yes, avoided one race but put in another. R> R> I do think a callout_async_drain is the right thing, but that will take a while R> to get right. Peter Holm (thank you so much) has been pounding on this, if you R> could find another test to add.. that would be great. I think this will work R> the way it is.. R> R> R R> R> R> R> R> R> R> On Feb 13, 2015, at 4:21 PM, Gleb Smirnoff wrote: R> R> > 165863 R> R> -------- R> Randall Stewart R> rrs@netflix.com R> 803-317-4952 R> R> R> R> R> -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 23:56:35 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6085BE98 for ; Fri, 13 Feb 2015 23:56:35 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24F44E0B for ; Fri, 13 Feb 2015 23:56:35 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DNuZah052982 for ; Fri, 13 Feb 2015 23:56:35 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t1DNuYKJ052978 for svn-src-head@freebsd.org; Fri, 13 Feb 2015 23:56:34 GMT (envelope-from bdrewery) Received: (qmail 49879 invoked from network); 13 Feb 2015 17:56:33 -0600 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 13 Feb 2015 17:56:33 -0600 Message-ID: <54DE8F32.2090500@FreeBSD.org> Date: Fri, 13 Feb 2015 17:56:34 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: phabric-admin@FreeBSD.org Subject: Phabricator + 'Reviewed by' [was Re: svn commit: r278472 - in head/sys: netinet netinet6] References: <201502091928.t19JSC5P066293@svn.freebsd.org> <38B8D2D0-862A-4DF5-9479-8EC234CF830B@FreeBSD.org> In-Reply-To: <38B8D2D0-862A-4DF5-9479-8EC234CF830B@FreeBSD.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CHPCqFm4vFQ6uQJe43XLi1G1hE8sR8FNn" Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 23:56:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CHPCqFm4vFQ6uQJe43XLi1G1hE8sR8FNn Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/9/2015 3:45 PM, Bjoern A. Zeeb wrote: >> Commented upon by hiren and sbruno >> See Phabricator D1777 for more details. >> >> Commented upon by hiren and sbruno >> Reviewed by: adrian, jhb and bz > I have not reviewed this; as a matter of fact you are aware that I sti= ll wanted to do that. >=20 Something about Phabricator is not jiving with our commit terminology. This has happened before as well with other commits. I'm sure everyone is good-intentioned as well. There's not 1 person on D1777 who has 'accepted' it. That is what warrants a 'Reviewed by' to me. It's clear to me, but seems unclear to others. I really think the reviewer list needs to be split up. Rather than using icons, use separate lists. Reviewers requested: accepted: commented: changes requested:. --=20 Regards, Bryan Drewery --CHPCqFm4vFQ6uQJe43XLi1G1hE8sR8FNn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJU3o83AAoJEDXXcbtuRpfPbO4IAK82RIVhFWKAH8z5hdPgzTlL X//0xTRpXCrTrUH0v/ZYsEyrZ7AtquybHaZ+QPYoL/vFwnst24FvXkOe2DReDMD0 ej0h7bmYHzhPP9i5sKNLr/xRZ/ngj09pgDL0UHhJJ5Ax60nDvtpIvSQdkAl6gGad 2SdXhYVy596406WfjWA95gf1a2Mc6npoQ+lCO8BobOKnwsu140xIYIGP4bAtIpKb kgW9YKo491n4UzWg7FgqpH1im13DNTdzl9CgJa+UxkfW1CF8sO0ER/sjmH3B3KCn zSsaydw85xOdFhygRuNcHfW3NWhCaiYVH27i6KZ2Dx9KuFCMxrJmelw/Z8x1vV0= =7Ofk -----END PGP SIGNATURE----- --CHPCqFm4vFQ6uQJe43XLi1G1hE8sR8FNn-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 13 23:57:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CBE9FEB; Fri, 13 Feb 2015 23:57: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0744DE1C; Fri, 13 Feb 2015 23:57:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DNvKp0075916; Fri, 13 Feb 2015 23:57:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DNvKda075915; Fri, 13 Feb 2015 23:57:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502132357.t1DNvKda075915@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 13 Feb 2015 23:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278737 - head/usr.sbin/flowctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 13 Feb 2015 23:57:21 -0000 Author: glebius Date: Fri Feb 13 23:57:20 2015 New Revision: 278737 URL: https://svnweb.freebsd.org/changeset/base/278737 Log: Use less ugly code to allocate buffer of SORCVBUF_SIZE. Modified: head/usr.sbin/flowctl/flowctl.c Modified: head/usr.sbin/flowctl/flowctl.c ============================================================================== --- head/usr.sbin/flowctl/flowctl.c Fri Feb 13 23:43:59 2015 (r278736) +++ head/usr.sbin/flowctl/flowctl.c Fri Feb 13 23:57:20 2015 (r278737) @@ -222,10 +222,12 @@ ctl_show(int argc, char **argv) static void do_show(int version, void (*func)(struct ngnf_show_header *)) { - struct ng_mesg ng_mesg[SORCVBUF_SIZE]; + char buf[SORCVBUF_SIZE]; + struct ng_mesg *ng_mesg; struct ngnf_show_header req, *resp; int token, nread; + ng_mesg = (struct ng_mesg *)buf; req.version = version; req.hash_id = req.list_id = 0; From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 00:03:45 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10541222; Sat, 14 Feb 2015 00: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5137ECA; Sat, 14 Feb 2015 00:03:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1E03iR5080908; Sat, 14 Feb 2015 00:03:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1E03i00080903; Sat, 14 Feb 2015 00:03:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502140003.t1E03i00080903@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 14 Feb 2015 00:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278738 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 00:03:45 -0000 Author: markj Date: Sat Feb 14 00:03:43 2015 New Revision: 278738 URL: https://svnweb.freebsd.org/changeset/base/278738 Log: Tweak the fds test program so that it actually compiles. Also use 0 instead of -1 for the bogus ioctl command so that dmesg doesn't get spammed with sign extension warnings when the test program runs. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Fri Feb 13 23:57:20 2015 (r278737) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Sat Feb 14 00:03:43 2015 (r278738) @@ -26,6 +26,8 @@ #pragma ident "%Z%%M% %I% %E% SMI" +#include + #include #include #include @@ -69,7 +71,7 @@ main(int argc, char *argv[]) */ if (sigsetjmp(env, 1) == 0) { for (;;) - (void) ioctl(-1, -1, NULL); + (void) ioctl(-1, 0, NULL); } /* @@ -80,20 +82,19 @@ main(int argc, char *argv[]) fds[n++] = open(file, O_WRONLY); fds[n++] = open(file, O_RDWR); - fds[n++] = open(file, O_RDWR | O_APPEND | O_CREAT | O_DSYNC | - O_LARGEFILE | O_NOCTTY | O_NONBLOCK | O_NDELAY | O_RSYNC | - O_SYNC | O_TRUNC | O_XATTR, 0666); + fds[n++] = open(file, O_RDWR | O_APPEND | O_CREAT | + O_NOCTTY | O_NONBLOCK | O_NDELAY | O_SYNC | O_TRUNC | 0666); fds[n++] = open(file, O_RDWR); (void) lseek(fds[n - 1], 123, SEEK_SET); /* * Once we have all the file descriptors in the state we want to test, - * issue a bogus ioctl() on each fd with cmd -1 and arg NULL to whack + * issue a bogus ioctl() on each fd with cmd 0 and arg NULL to whack * our DTrace script into recording the content of the fds[] array. */ for (i = 0; i < n; i++) - (void) ioctl(fds[i], -1, NULL); + (void) ioctl(fds[i], 0, NULL); assert(n <= sizeof (fds) / sizeof (fds[0])); exit(0); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d Fri Feb 13 23:57:20 2015 (r278737) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d Sat Feb 14 00:03:43 2015 (r278738) @@ -36,7 +36,7 @@ syscall::ioctl:entry } syscall::ioctl:entry -/pid == $1 && arg0 != -1u && arg1 == -1u && arg2 == NULL/ +/pid == $1 && arg0 != -1u && arg1 == 0 && arg2 == NULL/ { printf("fds[%d] fi_name = %s\n", arg0, fds[arg0].fi_name); printf("fds[%d] fi_dirname = %s\n", arg0, fds[arg0].fi_dirname); From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 00:05:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99A39389; Sat, 14 Feb 2015 00:05:43 +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)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 218C4EDB; Sat, 14 Feb 2015 00:05:42 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1E05emp034273 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Feb 2015 03:05:40 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1E05eut034272; Sat, 14 Feb 2015 03:05:40 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Feb 2015 03:05:40 +0300 From: Gleb Smirnoff To: julian@FreeBSD.org, mav@FreeBSD.org Subject: Re: svn commit: r278640 - head/sys/netgraph Message-ID: <20150214000540.GI15484@FreeBSD.org> References: <201502122220.t1CMKY8t040498@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502122220.t1CMKY8t040498@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 00:05:43 -0000 Hi! On Thu, Feb 12, 2015 at 10:20:34PM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Thu Feb 12 22:20:34 2015 T> New Revision: 278640 T> URL: https://svnweb.freebsd.org/changeset/base/278640 T> T> Log: T> Revise default limit for maximum of netgraph data items. T> With modern internet speeds the limit can be reached even T> on a single L2TP link. Actually any ng_item of data type requires an mbuf to be connected to it, and thus I suggest to use mbuf limits to drive ng_item limits. If we got an item leak with mbufs being properly freed, then we've got a bug to fix, and any limit won't work in long run time. I never evidenced such a bug, but there complaints on hitting limit at traffic bursts. As said, with previous 512 item limit I experienced that even on a laptop. Any objections on removing the limit, guys? T> Modified: T> head/sys/netgraph/ng_base.c T> T> Modified: head/sys/netgraph/ng_base.c T> ============================================================================== T> --- head/sys/netgraph/ng_base.c Thu Feb 12 21:20:28 2015 (r278639) T> +++ head/sys/netgraph/ng_base.c Thu Feb 12 22:20:34 2015 (r278640) T> @@ -2952,7 +2952,7 @@ uma_zone_t ng_qzone; T> uma_zone_t ng_qdzone; T> static int numthreads = 0; /* number of queue threads */ T> static int maxalloc = 4096;/* limit the damage of a leak */ T> -static int maxdata = 512; /* limit the damage of a DoS */ T> +static int maxdata = 4096; /* limit the damage of a DoS */ T> T> SYSCTL_INT(_net_graph, OID_AUTO, threads, CTLFLAG_RDTUN, &numthreads, T> 0, "Number of queue processing threads"); T> -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 00:23:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74C755F2; Sat, 14 Feb 2015 00:23: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FFE8CA; Sat, 14 Feb 2015 00:23:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1E0Nslq090571; Sat, 14 Feb 2015 00:23:54 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1E0Nspc090570; Sat, 14 Feb 2015 00:23:54 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201502140023.t1E0Nspc090570@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 14 Feb 2015 00:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278739 - head/lib/libc/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 00:23:54 -0000 Author: delphij Date: Sat Feb 14 00:23:53 2015 New Revision: 278739 URL: https://svnweb.freebsd.org/changeset/base/278739 Log: Disallow pattern spaces which would cause intermediate calculations to overflow size_t. Obtained from: DragonFly (2841837793bd095a82f477e9c370cfe6cfb3862c dillon) Security: CERT VU#695940 MFC after: 3 days Modified: head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Sat Feb 14 00:03:43 2015 (r278738) +++ head/lib/libc/regex/regcomp.c Sat Feb 14 00:23:53 2015 (r278739) @@ -192,6 +192,7 @@ regcomp(regex_t * __restrict preg, struct parse *p = &pa; int i; size_t len; + size_t maxlen; #ifdef REDEBUG # define GOODFLAGS(f) (f) #else @@ -213,7 +214,23 @@ regcomp(regex_t * __restrict preg, g = (struct re_guts *)malloc(sizeof(struct re_guts)); if (g == NULL) return(REG_ESPACE); + /* + * Limit the pattern space to avoid a 32-bit overflow on buffer + * extension. Also avoid any signed overflow in case of conversion + * so make the real limit based on a 31-bit overflow. + * + * Likely not applicable on 64-bit systems but handle the case + * generically (who are we to stop people from using ~715MB+ + * patterns?). + */ + maxlen = ((size_t)-1 >> 1) / sizeof(sop) * 2 / 3; + if (len >= maxlen) { + free((char *)g); + return(REG_ESPACE); + } p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */ + assert(p->ssize >= len); + p->strip = (sop *)malloc(p->ssize * sizeof(sop)); p->slen = 0; if (p->strip == NULL) { From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 00:36:59 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 714A3AD2 for ; Sat, 14 Feb 2015 00:36:59 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 513061EB for ; Sat, 14 Feb 2015 00:36:59 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t1E0axpn073298 for ; Sat, 14 Feb 2015 00:36:59 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t1E0axvr073297 for svn-src-head@freebsd.org; Sat, 14 Feb 2015 00:36:59 GMT (envelope-from bdrewery) Received: (qmail 1477 invoked from network); 13 Feb 2015 18:36:54 -0600 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 13 Feb 2015 18:36:54 -0600 Message-ID: <54DE98AC.6030309@FreeBSD.org> Date: Fri, 13 Feb 2015 18:37:00 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278739 - head/lib/libc/regex References: <201502140023.t1E0Nspc090570@svn.freebsd.org> In-Reply-To: <201502140023.t1E0Nspc090570@svn.freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uTloE2vHloF2tHifITEeF6uufJiomIxOU" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 00:36:59 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uTloE2vHloF2tHifITEeF6uufJiomIxOU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/13/2015 6:23 PM, Xin LI wrote: > Author: delphij > Date: Sat Feb 14 00:23:53 2015 > New Revision: 278739 > URL: https://svnweb.freebsd.org/changeset/base/278739 >=20 > Log: > Disallow pattern spaces which would cause intermediate calculations t= o > overflow size_t. > =20 > Obtained from: DragonFly (2841837793bd095a82f477e9c370cfe6cfb3862c di= llon) > Security: CERT VU#695940 > MFC after: 3 days >=20 > Modified: > head/lib/libc/regex/regcomp.c >=20 > Modified: head/lib/libc/regex/regcomp.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/lib/libc/regex/regcomp.c Sat Feb 14 00:03:43 2015 (r278738) > +++ head/lib/libc/regex/regcomp.c Sat Feb 14 00:23:53 2015 (r278739) > @@ -192,6 +192,7 @@ regcomp(regex_t * __restrict preg, > struct parse *p =3D &pa; > int i; > size_t len; > + size_t maxlen; > #ifdef REDEBUG > # define GOODFLAGS(f) (f) > #else > @@ -213,7 +214,23 @@ regcomp(regex_t * __restrict preg, > g =3D (struct re_guts *)malloc(sizeof(struct re_guts)); > if (g =3D=3D NULL) > return(REG_ESPACE); > + /* > + * Limit the pattern space to avoid a 32-bit overflow on buffer > + * extension. Also avoid any signed overflow in case of conversion > + * so make the real limit based on a 31-bit overflow. > + * > + * Likely not applicable on 64-bit systems but handle the case > + * generically (who are we to stop people from using ~715MB+ > + * patterns?). > + */ > + maxlen =3D ((size_t)-1 >> 1) / sizeof(sop) * 2 / 3; > + if (len >=3D maxlen) { > + free((char *)g); I was planning to submit a patch for review to remove all of this casting / and discuss. In this example the malloc is casted to struct re_gets* but the free is casted to char *. Why different and why cast in free at all? --=20 Regards, Bryan Drewery --uTloE2vHloF2tHifITEeF6uufJiomIxOU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJU3pitAAoJEDXXcbtuRpfPTRYH/2m4BQpQq5cS9w9U2P4vo/al Ka4lJYfbB6kY6QvEWO3A6OmvBwSGQFgm3nfSO8+Gc6o0ObkHvlJvuoaaYOEGyaBJ JJ3d4jfME10R+H11SI/f19BWZJxDCdwOdV0yF3lmTG1pGM/XCNHt8vfZmKCONp3z LOKrdZ4QU4ErI5HYkPBOPYrT7CD+Sv9744Um/ME1UE3ahOBDILMqgJxtvKVV+iCB /j3LzzH0nVpc79KWRnEDgzJQP8PJqVsZPrKf2ynpqb6YRN16zuWxV3qs61TYlewZ zfkImFbcNzIuWU/hg/gO2Q7hstCMyBHr59QvaUh5xRMB/un3xOci7TAyq6DR37s= =0uVo -----END PGP SIGNATURE----- --uTloE2vHloF2tHifITEeF6uufJiomIxOU-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 00:39:22 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EAADC38 for ; Sat, 14 Feb 2015 00:39:22 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E2451FF for ; Sat, 14 Feb 2015 00:39:22 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t1E0dMW8073337 for ; Sat, 14 Feb 2015 00:39:22 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t1E0dLJ2073334 for svn-src-head@freebsd.org; Sat, 14 Feb 2015 00:39:21 GMT (envelope-from bdrewery) Received: (qmail 47521 invoked from network); 13 Feb 2015 18:39:20 -0600 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 13 Feb 2015 18:39:20 -0600 Message-ID: <54DE993E.2050704@FreeBSD.org> Date: Fri, 13 Feb 2015 18:39:26 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278739 - head/lib/libc/regex References: <201502140023.t1E0Nspc090570@svn.freebsd.org> <54DE98AC.6030309@FreeBSD.org> In-Reply-To: <54DE98AC.6030309@FreeBSD.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XV4t4u5GLRr2JBPaELjg2ekmusK66dkmG" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 00:39:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XV4t4u5GLRr2JBPaELjg2ekmusK66dkmG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/13/2015 6:37 PM, Bryan Drewery wrote: > On 2/13/2015 6:23 PM, Xin LI wrote: >> Author: delphij >> Date: Sat Feb 14 00:23:53 2015 >> New Revision: 278739 >> URL: https://svnweb.freebsd.org/changeset/base/278739 >> >> Log: >> Disallow pattern spaces which would cause intermediate calculations = to >> overflow size_t. >> =20 >> Obtained from: DragonFly (2841837793bd095a82f477e9c370cfe6cfb3862c d= illon) >> Security: CERT VU#695940 >> MFC after: 3 days >> >> Modified: >> head/lib/libc/regex/regcomp.c >> >> Modified: head/lib/libc/regex/regcomp.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/lib/libc/regex/regcomp.c Sat Feb 14 00:03:43 2015 (r278738) >> +++ head/lib/libc/regex/regcomp.c Sat Feb 14 00:23:53 2015 (r278739) >> @@ -192,6 +192,7 @@ regcomp(regex_t * __restrict preg, >> struct parse *p =3D &pa; >> int i; >> size_t len; >> + size_t maxlen; >> #ifdef REDEBUG >> # define GOODFLAGS(f) (f) >> #else >> @@ -213,7 +214,23 @@ regcomp(regex_t * __restrict preg, >> g =3D (struct re_guts *)malloc(sizeof(struct re_guts)); >> if (g =3D=3D NULL) >> return(REG_ESPACE); >> + /* >> + * Limit the pattern space to avoid a 32-bit overflow on buffer >> + * extension. Also avoid any signed overflow in case of conversion >> + * so make the real limit based on a 31-bit overflow. >> + * >> + * Likely not applicable on 64-bit systems but handle the case >> + * generically (who are we to stop people from using ~715MB+ >> + * patterns?). >> + */ >> + maxlen =3D ((size_t)-1 >> 1) / sizeof(sop) * 2 / 3; >> + if (len >=3D maxlen) { >> + free((char *)g); >=20 > I was planning to submit a patch for review to remove all of this > casting / and discuss. To be clear, I only mean in free(3) calls. >=20 > In this example the malloc is casted to struct re_gets* but the free is= > casted to char *. Why different and why cast in free at all? >=20 >=20 >=20 --=20 Regards, Bryan Drewery --XV4t4u5GLRr2JBPaELjg2ekmusK66dkmG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJU3pk+AAoJEDXXcbtuRpfP9ekH/3LbKjYD+FTCcFbK76jSwXia /EOPoJFpXT4IUV/PJqLh3F1BVZ0bKD0Q7niqSvkemw63bFnH5qRaYzhFLLv4+6ix hCeOrZo+dA+UPZ9utfXTv/TTOnLWX3z5BPR52GK84ISqZqWyO+Zb494o9iGJNZKy BAZsXPqj16Q68E7BNfN3aVbN6bGD0I1JV9bgJDnHgK00a9YUoiDffuD9lHVAZOay yMlokROC2rBGBKe01GuCp/xs3rHuw56oJLT86eqopzvrCvLvEv708W9nRuo5j3ML JMFlGKzbef1NDmXanfM4yDYF7fZOK/qZlSbBihes0AHn47DgWqy5bDI22eTa2b4= =utS4 -----END PGP SIGNATURE----- --XV4t4u5GLRr2JBPaELjg2ekmusK66dkmG-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 01:04:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CEB71B6; Sat, 14 Feb 2015 01:04:12 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C0E7687; Sat, 14 Feb 2015 01:04:12 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [12.229.62.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 9BCE9246E4; Fri, 13 Feb 2015 17:04:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1423875851; x=1423890251; bh=dK/tH0sfF0DN8F/p1oaLXQauAevD6+XC0TEyKn2fBek=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=y16E6aiAMI3jBYYOHIH54ItfsmwkkyIgQGfWwFGZgJe1ad+Vn0K6f95ZsDDRxBKuy 1HIp9qTEhPNYEDx7IjOuOveQrJeSg7tFILusE4VBCtj02wTwZfUPDL6OoQ7HbdiMAb kTibit5cQXysdeGQBip7xFJ8p/pUWlfRXd8qO+WU= Message-ID: <54DE9F0B.50805@delphij.net> Date: Fri, 13 Feb 2015 17:04:11 -0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Bryan Drewery , Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278739 - head/lib/libc/regex References: <201502140023.t1E0Nspc090570@svn.freebsd.org> <54DE98AC.6030309@FreeBSD.org> In-Reply-To: <54DE98AC.6030309@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 01:04:12 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 02/13/15 16:37, Bryan Drewery wrote: > On 2/13/2015 6:23 PM, Xin LI wrote: >> Author: delphij Date: Sat Feb 14 00:23:53 2015 New Revision: >> 278739 URL: https://svnweb.freebsd.org/changeset/base/278739 >> >> Log: Disallow pattern spaces which would cause intermediate >> calculations to overflow size_t. >> >> Obtained from: DragonFly >> (2841837793bd095a82f477e9c370cfe6cfb3862c dillon) Security: CERT >> VU#695940 MFC after: 3 days >> >> Modified: head/lib/libc/regex/regcomp.c >> >> Modified: head/lib/libc/regex/regcomp.c >> ============================================================================== >> >> - --- head/lib/libc/regex/regcomp.c Sat Feb 14 00:03:43 2015 (r278738) >> +++ head/lib/libc/regex/regcomp.c Sat Feb 14 00:23:53 2015 >> (r278739) @@ -192,6 +192,7 @@ regcomp(regex_t * __restrict preg, >> struct parse *p = &pa; int i; size_t len; + size_t maxlen; #ifdef >> REDEBUG # define GOODFLAGS(f) (f) #else @@ -213,7 +214,23 @@ >> regcomp(regex_t * __restrict preg, g = (struct re_guts >> *)malloc(sizeof(struct re_guts)); if (g == NULL) >> return(REG_ESPACE); + /* + * Limit the pattern space to avoid a >> 32-bit overflow on buffer + * extension. Also avoid any signed >> overflow in case of conversion + * so make the real limit based >> on a 31-bit overflow. + * + * Likely not applicable on 64-bit >> systems but handle the case + * generically (who are we to stop >> people from using ~715MB+ + * patterns?). + */ + maxlen = >> ((size_t)-1 >> 1) / sizeof(sop) * 2 / 3; + if (len >= maxlen) { + >> free((char *)g); > > I was planning to submit a patch for review to remove all of this > casting / and discuss. > > In this example the malloc is casted to struct re_gets* but the > free is casted to char *. Why different and why cast in free at > all? No, I don't think there is legitimate reason to do casts in these places (both malloc and free's), these casts are not functional, and should be eliminated per style(9). In DragonFly, I think the cast was done mainly to match what's done in the rest of regex code, which is the traditional BSD way of handling third party code. If, however, you would like to remove them altogether, please feel free to do so once it's considered ready to go, as regex(3) is mostly unmaintained nowadays, and there is no upstream anymore. PS: Gabor have proposed to replace Spencer regex(3) with TRE but that was never finished, which would require some work (probably a good SoC project?). My $0.02 recommendation is to leave the code as-is for now. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1.1 (FreeBSD) iQIcBAEBCgAGBQJU3p8IAAoJEJW2GBstM+nsF7gP/j/5V5BsPObh1aOSkM4fSsd+ l68ZuBw+YbCcbFs7EMjpFx7prqL+KyZ29Cq5blpROVMz94cV6jmqVE8O2D1WXNbk V6E4DxX//T2SfHjLnTPKBGn3Pdx/Gi3sLpkzGhAwqhPOVXCS56sOFt2fuAMfC7oq k9OOLUHjtcocEG7p/xk0fRhM9GLylnIdpZqGVugb+QmxI9coo6DgsFXddKSnLzwe D15j73sxQ9zgfWu3LThIFm1oE9MvbllUn/kiilZNPrfKljOoANiz2NwbY2kNBeM5 jjM1YpYKsqGuLEZx0UA0GnAJe7jW5yrMGxCTImLd/K9AWg48YzaB+76oQ6JQgSWh 6prDpse7BNdzSeTBf8VCX0fyLW7XWHDqCl3f2L3ZL/mF6zydVFfsKCfgYiHeUJzl 3e5GlVSyszz/fK0QPcau7KVO+FT/1dmbMBRDFhlC4ziITLvPe2ycxE15DvrhcVGM ifVTTEpH0tUv/e3Ac9lW9siENdssVfx9kx/pY5mfVU3bTntYCK8bGM7Nk7ayJQz5 A2C8oJP1bE41mqjGDihi0+aiZHmuW6WvPeRwM0okGuH7Lma4gQZrzs8hN826evY1 DueeYGrinqx5T8uN/HEQRkgFfyE/n5YDJvOwOmKQlOlz+m0hF7nX3kSTwUMZAmEZ o8rTmSN9k2e5Mu/0Ejd5 =8I1d -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 04:28:55 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5C6287E; Sat, 14 Feb 2015 04:28: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0044BF3; Sat, 14 Feb 2015 04:28:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1E4StaE003537; Sat, 14 Feb 2015 04:28:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1E4SqDr003523; Sat, 14 Feb 2015 04:28:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502140428.t1E4SqDr003523@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 Feb 2015 04:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278741 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 04:28:55 -0000 Author: adrian Date: Sat Feb 14 04:28:51 2015 New Revision: 278741 URL: https://svnweb.freebsd.org/changeset/base/278741 Log: Update the AR9300 HAL to the latest public available HAL from QCA. I've been sitting on this for a year or so now; I've finally tested it on enough devices to be reasonably sure it won't cause too much drama. But, if you see issues, please email me. Tested (all STA mode): PCIe: * AR9380 * AR9390 * AR9580 * AR9462 * AR9485 SoC: * QCA9550 * AR9331 * AR9342 Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_keycache.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_osprey22.ini head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9340.ini head/sys/contrib/dev/ath/ath_hal/ar9300/ar9580.ini Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sat Feb 14 04:28:51 2015 (r278741) @@ -576,6 +576,9 @@ struct ath_hal_9300 { u_int8_t ah_tx_chainmask; /* tx chain mask */ u_int8_t ah_rx_chainmask; /* rx chain mask */ + /* optional tx chainmask */ + u_int8_t ah_tx_chainmaskopt; + u_int8_t ah_tx_cal_chainmask; /* tx cal chain mask */ u_int8_t ah_rx_cal_chainmask; /* rx cal chain mask */ @@ -845,6 +848,7 @@ struct ath_hal_9300 { HAL_BOOL ah_aic_enabled; u_int32_t ah_aic_sram[ATH_AIC_MAX_BT_CHANNEL]; #endif + #endif /* ATH_SUPPORT_MCI */ u_int8_t ah_cac_quiet_enabled; #if ATH_WOW_OFFLOAD @@ -852,6 +856,14 @@ struct ath_hal_9300 { u_int32_t ah_mcast_filter_u32_set; #endif HAL_BOOL ah_reduced_self_gen_mask; + HAL_BOOL ah_chip_reset_done; + HAL_BOOL ah_abort_txdma_norx; + /* store previous passive RX Cal info */ + HAL_BOOL ah_skip_rx_iq_cal; + HAL_BOOL ah_rx_cal_complete; /* previous rx cal completed or not */ + u_int32_t ah_rx_cal_chan; /* chan on which rx cal is done */ + u_int32_t ah_rx_cal_chan_flag; + u_int32_t ah_rx_cal_corr[AR9300_MAX_CHAINS]; /* Local additions for FreeBSD */ /* @@ -877,7 +889,6 @@ struct ath_hal_9300 { struct ar9300NfLimits nf_2GHz; struct ar9300NfLimits nf_5GHz; struct ar9300NfLimits *nfp; - }; #define AH9300(_ah) ((struct ath_hal_9300 *)(_ah)) @@ -1194,7 +1205,8 @@ extern HAL_BOOL ar9300_get_channel_edge extern HAL_BOOL ar9300_fill_capability_info(struct ath_hal *ah); extern void ar9300_beacon_init(struct ath_hal *ah, - u_int32_t next_beacon, u_int32_t beacon_period, HAL_OPMODE opmode); + u_int32_t next_beacon, u_int32_t beacon_period, + u_int32_t beacon_period_fraction, HAL_OPMODE opmode); extern void ar9300_set_sta_beacon_timers(struct ath_hal *ah, const HAL_BEACON_STATE *); @@ -1217,12 +1229,19 @@ extern HAL_BOOL ar9300_set_key_cache_en extern HAL_BOOL ar9300_set_key_cache_entry(struct ath_hal *ah, u_int16_t entry, const HAL_KEYVAL *k, const u_int8_t *mac, int xor_key); extern HAL_BOOL ar9300_print_keycache(struct ath_hal *ah); +#if ATH_SUPPORT_KEYPLUMB_WAR +extern HAL_BOOL ar9300_check_key_cache_entry(struct ath_hal *ah, u_int16_t entry, + const HAL_KEYVAL *k, int xorKey); +#endif extern void ar9300_get_mac_address(struct ath_hal *ah, u_int8_t *mac); extern HAL_BOOL ar9300_set_mac_address(struct ath_hal *ah, const u_int8_t *); extern void ar9300_get_bss_id_mask(struct ath_hal *ah, u_int8_t *mac); extern HAL_BOOL ar9300_set_bss_id_mask(struct ath_hal *, const u_int8_t *); extern HAL_STATUS ar9300_select_ant_config(struct ath_hal *ah, u_int32_t cfg); +extern u_int32_t ar9300_ant_ctrl_common_get(struct ath_hal *ah, HAL_BOOL is_2ghz); +extern HAL_BOOL ar9300_ant_swcom_sel(struct ath_hal *ah, u_int8_t ops, + u_int32_t *common_tbl1, u_int32_t *common_tbl2); extern HAL_BOOL ar9300_set_regulatory_domain(struct ath_hal *ah, u_int16_t reg_domain, HAL_STATUS *stats); extern u_int ar9300_get_wireless_modes(struct ath_hal *ah); @@ -1397,6 +1416,8 @@ extern HAL_BOOL ar9300_set_tx_power_limi u_int16_t extra_txpow, u_int16_t tpc_in_db); extern void ar9300_chain_noise_floor(struct ath_hal *ah, int16_t *nf_buf, struct ieee80211_channel *chan, int is_scan); +extern int16_t ar9300_get_nf_from_reg(struct ath_hal *ah, struct ieee80211_channel *chan, int wait_time); +extern int ar9300_get_rx_nf_offset(struct ath_hal *ah, struct ieee80211_channel *chan, int8_t *nf_pwr, int8_t *nf_cal); extern HAL_BOOL ar9300_load_nf(struct ath_hal *ah, int16_t nf[]); extern HAL_RFGAIN ar9300_get_rfgain(struct ath_hal *ah); @@ -1681,6 +1702,8 @@ extern void ar9300_tx99_start(struct ath extern void ar9300_tx99_stop(struct ath_hal *ah); #endif /* ATH_SUPPORT_HTC */ #endif /* ATH_TX99_DIAG */ +extern HAL_BOOL ar9300_set_ctl_pwr(struct ath_hal *ah, u_int8_t *ctl_array); +extern void ar9300_set_txchainmaskopt(struct ath_hal *ah, u_int8_t mask); enum { AR9300_COEFF_TX_TYPE = 0, Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sat Feb 14 04:28:51 2015 (r278741) @@ -302,6 +302,7 @@ static const struct ath_hal_private ar93 ar9300_get_desc_info, /* ah_get_desc_info */ ar9300_select_ant_config, /* ah_select_ant_config */ ar9300_ant_ctrl_common_get, /* ah_ant_ctrl_common_get */ + ar9300_ant_swcom_sel, /* ah_ant_swcom_sel */ ar9300_enable_tpc, /* ah_enable_tpc */ AH_NULL, /* ah_olpc_temp_compensation */ #if ATH_SUPPORT_CRDC @@ -319,7 +320,9 @@ static const struct ath_hal_private ar93 ar9300_set_key_cache_entry, /* ah_set_key_cache_entry */ ar9300_set_key_cache_entry_mac, /* ah_set_key_cache_entry_mac */ ar9300_print_keycache, /* ah_print_key_cache */ - +#if ATH_SUPPORT_KEYPLUMB_WAR + ar9300_check_key_cache_entry, /* ah_check_key_cache_entry */ +#endif /* Power Management Functions */ ar9300_set_power_mode, /* ah_set_power_mode */ ar9300_set_sm_power_mode, /* ah_set_sm_ps_mode */ @@ -342,6 +345,8 @@ static const struct ath_hal_private ar93 /* Get Channel Noise */ ath_hal_get_chan_noise, /* ah_get_chan_noise */ ar9300_chain_noise_floor, /* ah_get_chain_noise_floor */ + ar9300_get_nf_from_reg, /* ah_get_nf_from_reg */ + ar9300_get_rx_nf_offset, /* ah_get_rx_nf_offset */ /* Beacon Functions */ ar9300_beacon_init, /* ah_beacon_init */ @@ -499,11 +504,11 @@ static const struct ath_hal_private ar93 #else AH_NULL, AH_NULL, - ar9300TX99TgtChannelPwrUpdate, /* ah_tx99channelpwrupdate */ - ar9300TX99TgtStart, /* ah_tx99start */ - ar9300TX99TgtStop, /* ah_tx99stop */ - ar9300TX99TgtChainmskSetup, /* ah_tx99_chainmsk_setup */ - ar9300TX99SetSingleCarrier, /* ah_tx99_set_single_carrier */ + ar9300_tx99_channel_pwr_update, /* ah_tx99channelpwrupdate */ + ar9300_tx99_start, /* ah_tx99start */ + ar9300_tx99_stop, /* ah_tx99stop */ + ar9300_tx99_chainmsk_setup, /* ah_tx99_chainmsk_setup */ + ar9300_tx99_set_single_carrier, /* ah_tx99_set_single_carrier */ #endif #endif ar9300_chk_rssi_update_tx_pwr, @@ -525,6 +530,8 @@ static const struct ath_hal_private ar93 ar9300_dump_keycache, /* ah_dump_keycache */ ar9300_is_ani_noise_spur, /* ah_is_ani_noise_spur */ ar9300_set_hw_beacon_proc, /* ah_set_hw_beacon_proc */ + ar9300_set_ctl_pwr, /* ah_set_ctl_pwr */ + ar9300_set_txchainmaskopt, /* ah_set_txchainmaskopt */ }, ar9300_get_channel_edges, /* ah_get_channel_edges */ @@ -838,6 +845,18 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC /* Enable RIFS */ ahp->ah_rifs_enabled = AH_TRUE; + /* by default, stop RX also in abort txdma, due to + "Unable to stop TxDMA" msg observed */ + ahp->ah_abort_txdma_norx = AH_TRUE; + + /* do not use optional tx chainmask by default */ + ahp->ah_tx_chainmaskopt = 0; + + ahp->ah_skip_rx_iq_cal = AH_FALSE; + ahp->ah_rx_cal_complete = AH_FALSE; + ahp->ah_rx_cal_chan = 0; + ahp->ah_rx_cal_chan_flag = 0; + HALDEBUG(ah, HAL_DEBUG_RESET, "%s: This Mac Chip Rev 0x%02x.%x is \n", __func__, ahpriv->ah_macVersion, Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c Sat Feb 14 04:28:51 2015 (r278741) @@ -34,7 +34,8 @@ extern u_int32_t ar9300_num_tx_pending(s */ void ar9300_beacon_init(struct ath_hal *ah, - u_int32_t next_beacon, u_int32_t beacon_period, HAL_OPMODE opmode) + u_int32_t next_beacon, u_int32_t beacon_period, + u_int32_t beacon_period_fraction, HAL_OPMODE opmode) { u_int32_t beacon_period_usec; @@ -52,6 +53,11 @@ ar9300_beacon_init(struct ath_hal *ah, beacon_period_usec = ONE_EIGHTH_TU_TO_USEC(beacon_period & HAL_BEACON_PERIOD_TU8); + + /* Add the fraction adjustment lost due to unit conversions. */ + beacon_period_usec += beacon_period_fraction; + + OS_REG_WRITE(ah, AR_BEACON_PERIOD, beacon_period_usec); OS_REG_WRITE(ah, AR_DMA_BEACON_PERIOD, beacon_period_usec); OS_REG_WRITE(ah, AR_SWBA_PERIOD, beacon_period_usec); Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Sat Feb 14 04:28:51 2015 (r278741) @@ -1200,6 +1200,44 @@ ar9300_noise_floor_cal_or_power_get(stru return nf_use; } +/* + * Return the Rx NF offset for specific channel. + * The values saved in EEPROM/OTP/Flash is converted through the following way: + * ((_p) - NOISE_PWR_DATA_OFFSET) << 2 + * So we need to convert back to the original values. + */ +int ar9300_get_rx_nf_offset(struct ath_hal *ah, struct ieee80211_channel *chan, int8_t *nf_pwr, int8_t *nf_cal) { + HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan); + int8_t rx_nf_pwr, rx_nf_cal; + int i; + //HALASSERT(ichan); + + /* Fill 0 if valid internal channel is not found */ + if (ichan == AH_NULL) { + OS_MEMZERO(nf_pwr, sizeof(nf_pwr[0])*OSPREY_MAX_CHAINS); + OS_MEMZERO(nf_cal, sizeof(nf_cal[0])*OSPREY_MAX_CHAINS); + return -1; + } + + for (i = 0; i < OSPREY_MAX_CHAINS; i++) { + if ((rx_nf_pwr = ar9300_noise_floor_cal_or_power_get(ah, ichan->channel, i, 0)) == 1) { + nf_pwr[i] = 0; + } else { + //printk("%s: raw nf_pwr[%d] = %d\n", __func__, i, rx_nf_pwr); + nf_pwr[i] = NOISE_PWR_DBM_2_INT(rx_nf_pwr); + } + + if ((rx_nf_cal = ar9300_noise_floor_cal_or_power_get(ah, ichan->channel, i, 1)) == 1) { + nf_cal[i] = 0; + } else { + //printk("%s: raw nf_cal[%d] = %d\n", __func__, i, rx_nf_cal); + nf_cal[i] = NOISE_PWR_DBM_2_INT(rx_nf_cal); + } + } + + return 0; +} + int32_t ar9300_rx_gain_index_get(struct ath_hal *ah) { ar9300_eeprom_t *eep = &AH9300(ah)->ah_eeprom; @@ -1530,6 +1568,61 @@ u_int16_t ar9300_ant_ctrl_chain_get(stru return 0; } +/* + * Select the usage of antenna via the RF switch. + * Default values are loaded from eeprom. + */ +HAL_BOOL ar9300_ant_swcom_sel(struct ath_hal *ah, u_int8_t ops, + u_int32_t *common_tbl1, u_int32_t *common_tbl2) +{ + ar9300_eeprom_t *eep = &AH9300(ah)->ah_eeprom; + struct ath_hal_private *ap = AH_PRIVATE(ah); + const struct ieee80211_channel *curchan = ap->ah_curchan; + enum { + ANT_SELECT_OPS_GET, + ANT_SELECT_OPS_SET, + }; + + if (AR_SREV_JUPITER(ah) || AR_SREV_SCORPION(ah)) + return AH_FALSE; + + if (!curchan) + return AH_FALSE; + +#define AR_SWITCH_TABLE_COM_ALL (0xffff) +#define AR_SWITCH_TABLE_COM_ALL_S (0) +#define AR_SWITCH_TABLE_COM2_ALL (0xffffff) +#define AR_SWITCH_TABLE_COM2_ALL_S (0) + switch (ops) { + case ANT_SELECT_OPS_GET: + *common_tbl1 = OS_REG_READ_FIELD(ah, AR_PHY_SWITCH_COM, + AR_SWITCH_TABLE_COM_ALL); + *common_tbl2 = OS_REG_READ_FIELD(ah, AR_PHY_SWITCH_COM_2, + AR_SWITCH_TABLE_COM2_ALL); + break; + case ANT_SELECT_OPS_SET: + OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM, + AR_SWITCH_TABLE_COM_ALL, *common_tbl1); + OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM_2, + AR_SWITCH_TABLE_COM2_ALL, *common_tbl2); + + /* write back to eeprom */ + if (IEEE80211_IS_CHAN_2GHZ(curchan)) { + eep->modal_header_2g.ant_ctrl_common = *common_tbl1; + eep->modal_header_2g.ant_ctrl_common2 = *common_tbl2; + } else { + eep->modal_header_5g.ant_ctrl_common = *common_tbl1; + eep->modal_header_5g.ant_ctrl_common2 = *common_tbl2; + } + + break; + default: + break; + } + + return AH_TRUE; +} + HAL_BOOL ar9300_ant_ctrl_apply(struct ath_hal *ah, HAL_BOOL is_2ghz) { u_int32_t value; @@ -2412,16 +2505,31 @@ ar9300_eeprom_set_power_per_rate_table( HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan); #endif - tx_chainmask = chainmask ? chainmask : ahp->ah_tx_chainmask; + if (chainmask) + tx_chainmask = chainmask; + else + tx_chainmask = ahp->ah_tx_chainmaskopt ? + ahp->ah_tx_chainmaskopt :ahp->ah_tx_chainmask; ar9300_get_channel_centers(ah, chan, ¢ers); +#if 1 if (IEEE80211_IS_CHAN_2GHZ(chan)) { ahp->twice_antenna_gain = p_eep_data->modal_header_2g.antenna_gain; } else { ahp->twice_antenna_gain = p_eep_data->modal_header_5g.antenna_gain; } +#else + if (IEEE80211_IS_CHAN_2GHZ(chan)) { + ahp->twice_antenna_gain = AH_MAX(p_eep_data->modal_header_2g.antenna_gain, + AH_PRIVATE(ah)->ah_antenna_gain_2g); + } else { + ahp->twice_antenna_gain = AH_MAX(p_eep_data->modal_header_5g.antenna_gain, + AH_PRIVATE(ah)->ah_antenna_gain_5g); + } +#endif + /* Save max allowed antenna gain to ease future lookups */ ahp->twice_antenna_reduction = twice_antenna_reduction; @@ -2958,7 +3066,8 @@ ar9300_eeprom_set_transmit_power(struct } max_power_level = target_power_val_t2[i]; /* Adjusting the ah_max_power_level based on chains and antennaGain*/ - switch (ar9300_get_ntxchains(ahp->ah_tx_chainmask)) + switch (ar9300_get_ntxchains(((ahp->ah_tx_chainmaskopt > 0) ? + ahp->ah_tx_chainmaskopt : ahp->ah_tx_chainmask))) { case 1: break; Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sat Feb 14 04:28:51 2015 (r278741) @@ -606,7 +606,7 @@ ar9300_freebsd_beacon_init(struct ath_ha uint32_t beacon_period) { - ar9300_beacon_init(ah, next_beacon, beacon_period, + ar9300_beacon_init(ah, next_beacon, beacon_period, 0, AH_PRIVATE(ah)->ah_opmode); } Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h Sat Feb 14 04:28:51 2015 (r278741) @@ -35,6 +35,7 @@ #define ATH_SUPPORT_PAPRD 1 #define ATH_SUPPORT_TxBF 0 #define AH_PRIVATE_DIAG 1 +#define ATH_SUPPORT_KEYPLUMB_WAR 0 /* XXX need to reverify these; they came in with qcamain */ #define ATH_SUPPORT_FAST_CC 0 Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_keycache.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_keycache.c Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_keycache.c Sat Feb 14 04:28:51 2015 (r278741) @@ -436,3 +436,156 @@ void ar9300_dump_keycache(struct ath_hal } #undef AH_KEY_REG_SIZE } + +#if ATH_SUPPORT_KEYPLUMB_WAR +/* + * Check the contents of the specified key cache entry + * and any associated MIC entry. + */ + HAL_BOOL +ar9300_check_key_cache_entry(struct ath_hal *ah, u_int16_t entry, + const HAL_KEYVAL *k, int xorKey) +{ + const HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; + u_int32_t key0, key1, key2, key3, key4; + u_int32_t keyType; + u_int32_t xorMask = xorKey ? + (KEY_XOR << 24 | KEY_XOR << 16 | KEY_XOR << 8 | KEY_XOR) : 0; + struct ath_hal_9300 *ahp = AH9300(ah); + + + if (entry >= pCap->hal_key_cache_size) { + HALDEBUG(ah, HAL_DEBUG_KEYCACHE, + "%s: entry %u out of range\n", __func__, entry); + return AH_FALSE; + } + switch (k->kv_type) { + case HAL_CIPHER_AES_OCB: + keyType = AR_KEYTABLE_TYPE_AES; + break; + case HAL_CIPHER_AES_CCM: + if (!pCap->hal_cipher_aes_ccm_support) { + HALDEBUG(ah, HAL_DEBUG_KEYCACHE, "%s: AES-CCM not supported by " + "mac rev 0x%x\n", + __func__, AH_PRIVATE(ah)->ah_macRev); + return AH_FALSE; + } + keyType = AR_KEYTABLE_TYPE_CCM; + break; + case HAL_CIPHER_TKIP: + keyType = AR_KEYTABLE_TYPE_TKIP; + if (IS_MIC_ENABLED(ah) && entry + 64 >= pCap->hal_key_cache_size) { + HALDEBUG(ah, HAL_DEBUG_KEYCACHE, + "%s: entry %u inappropriate for TKIP\n", + __func__, entry); + return AH_FALSE; + } + break; + case HAL_CIPHER_WEP: + if (k->kv_len < 40 / NBBY) { + HALDEBUG(ah, HAL_DEBUG_KEYCACHE, "%s: WEP key length %u too small\n", + __func__, k->kv_len); + return AH_FALSE; + } + if (k->kv_len <= 40 / NBBY) { + keyType = AR_KEYTABLE_TYPE_40; + } else if (k->kv_len <= 104 / NBBY) { + keyType = AR_KEYTABLE_TYPE_104; + } else { + keyType = AR_KEYTABLE_TYPE_128; + } + break; + case HAL_CIPHER_CLR: + keyType = AR_KEYTABLE_TYPE_CLR; + return AH_TRUE; + default: + HALDEBUG(ah, HAL_DEBUG_KEYCACHE, "%s: cipher %u not supported\n", + __func__, k->kv_type); + return AH_TRUE; + } + + key0 = LE_READ_4(k->kv_val + 0) ^ xorMask; + key1 = (LE_READ_2(k->kv_val + 4) ^ xorMask) & 0xffff; + key2 = LE_READ_4(k->kv_val + 6) ^ xorMask; + key3 = (LE_READ_2(k->kv_val + 10) ^ xorMask) & 0xffff; + key4 = LE_READ_4(k->kv_val + 12) ^ xorMask; + if (k->kv_len <= 104 / NBBY) { + key4 &= 0xff; + } + + /* + * Note: key cache hardware requires that each double-word + * pair be written in even/odd order (since the destination is + * a 64-bit register). Don't reorder these writes w/o + * considering this! + */ + if (keyType == AR_KEYTABLE_TYPE_TKIP && IS_MIC_ENABLED(ah)) { + u_int16_t micentry = entry + 64; /* MIC goes at slot+64 */ + + + /* + * Invalidate the encrypt/decrypt key until the MIC + * key is installed so pending rx frames will fail + * with decrypt errors rather than a MIC error. + */ + if ((OS_REG_READ(ah, AR_KEYTABLE_KEY0(entry)) == key0) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY1(entry)) == key1) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY2(entry)) == key2) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY3(entry)) == key3) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY4(entry)) == key4) && + ((OS_REG_READ(ah, AR_KEYTABLE_TYPE(entry)) & AR_KEY_TYPE) == (keyType & AR_KEY_TYPE))) + { + + /* + * since the AR_MISC_MODE register was written with the contents of + * ah_miscMode (if any) in ar9300Attach, just check ah_miscMode and + * save a pci read per key set. + */ + if (ahp->ah_misc_mode & AR_PCU_MIC_NEW_LOC_ENA) { + u_int32_t mic0,mic1,mic2,mic3,mic4; + /* + * both RX and TX mic values can be combined into + * one cache slot entry. + * 8*N + 800 31:0 RX Michael key 0 + * 8*N + 804 15:0 TX Michael key 0 [31:16] + * 8*N + 808 31:0 RX Michael key 1 + * 8*N + 80C 15:0 TX Michael key 0 [15:0] + * 8*N + 810 31:0 TX Michael key 1 + * 8*N + 814 15:0 reserved + * 8*N + 818 31:0 reserved + * 8*N + 81C 14:0 reserved + * 15 key valid == 0 + */ + /* RX mic */ + mic0 = LE_READ_4(k->kv_mic + 0); + mic2 = LE_READ_4(k->kv_mic + 4); + /* TX mic */ + mic1 = LE_READ_2(k->kv_txmic + 2) & 0xffff; + mic3 = LE_READ_2(k->kv_txmic + 0) & 0xffff; + mic4 = LE_READ_4(k->kv_txmic + 4); + if ((OS_REG_READ(ah, AR_KEYTABLE_KEY0(micentry)) == mic0) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY1(micentry)) == mic1) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY2(micentry)) == mic2) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY3(micentry)) == mic3) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY4(micentry)) == mic4) && + ((OS_REG_READ(ah, AR_KEYTABLE_TYPE(micentry)) & AR_KEY_TYPE) == (AR_KEYTABLE_TYPE_CLR & AR_KEY_TYPE))) { + return AH_TRUE; + } + + } else { + return AH_TRUE; + } + } + } else { + if ((OS_REG_READ(ah, AR_KEYTABLE_KEY0(entry)) == key0) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY1(entry)) == key1) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY2(entry)) == key2) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY3(entry)) == key3) && + (OS_REG_READ(ah, AR_KEYTABLE_KEY4(entry)) == key4) && + ((OS_REG_READ(ah, AR_KEYTABLE_TYPE(entry)) & AR_KEY_TYPE) == (keyType & AR_KEY_TYPE))) { + return AH_TRUE; + } + } + return AH_FALSE; +} +#endif Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Sat Feb 14 04:28:51 2015 (r278741) @@ -1697,10 +1697,10 @@ ar9300_get_bb_panic_info(struct ath_hal /* Suppress BB Status mesg following signature */ switch (bb_panic->status) { - case 0x04000539: - case 0x04008009: - case 0x04000b09: - case 0x1300000a: + case 0x04000539: + case 0x04008009: + case 0x04000b09: + case 0x1300000a: return -1; } @@ -3718,8 +3718,6 @@ ar9300_tx99_start(struct ath_hal *ah, u_ /* Disable AGC to A2 */ OS_REG_WRITE(ah, AR_PHY_TEST, (OS_REG_READ(ah, AR_PHY_TEST) | PHY_AGC_CLR)); - OS_REG_WRITE(ah, 0x9864, OS_REG_READ(ah, 0x9864) | 0x7f000); - OS_REG_WRITE(ah, 0x9924, OS_REG_READ(ah, 0x9924) | 0x7f00fe); OS_REG_WRITE(ah, AR_DIAG_SW, OS_REG_READ(ah, AR_DIAG_SW) &~ AR_DIAG_RX_DIS); OS_REG_WRITE(ah, AR_CR, AR_CR_RXD); /* set receive disable */ @@ -3763,3 +3761,47 @@ ar9300SetDfs3StreamFix(struct ath_hal *a { return AH_FALSE; } + +HAL_BOOL +ar9300_set_ctl_pwr(struct ath_hal *ah, u_int8_t *ctl_array) +{ + struct ath_hal_9300 *ahp = AH9300(ah); + ar9300_eeprom_t *p_eep_data = &ahp->ah_eeprom; + u_int8_t *ctl_index; + u_int32_t offset = 0; + + if (!ctl_array) + return AH_FALSE; + + /* copy 2G ctl freqbin and power data */ + ctl_index = p_eep_data->ctl_index_2g; + OS_MEMCPY(ctl_index + OSPREY_NUM_CTLS_2G, ctl_array, + OSPREY_NUM_CTLS_2G * OSPREY_NUM_BAND_EDGES_2G + /* ctl_freqbin_2G */ + OSPREY_NUM_CTLS_2G * sizeof(OSP_CAL_CTL_DATA_2G)); /* ctl_power_data_2g */ + offset = (OSPREY_NUM_CTLS_2G * OSPREY_NUM_BAND_EDGES_2G) + + ( OSPREY_NUM_CTLS_2G * sizeof(OSP_CAL_CTL_DATA_2G)); + + + /* copy 2G ctl freqbin and power data */ + ctl_index = p_eep_data->ctl_index_5g; + OS_MEMCPY(ctl_index + OSPREY_NUM_CTLS_5G, ctl_array + offset, + OSPREY_NUM_CTLS_5G * OSPREY_NUM_BAND_EDGES_5G + /* ctl_freqbin_5G */ + OSPREY_NUM_CTLS_5G * sizeof(OSP_CAL_CTL_DATA_5G)); /* ctl_power_data_5g */ + + return AH_FALSE; +} + +void +ar9300_set_txchainmaskopt(struct ath_hal *ah, u_int8_t mask) +{ + struct ath_hal_9300 *ahp = AH9300(ah); + + /* optional txchainmask should be subset of primary txchainmask */ + if ((mask & ahp->ah_tx_chainmask) != mask) { + ahp->ah_tx_chainmaskopt = 0; + ath_hal_printf(ah, "Error: ah_tx_chainmask=%d, mask=%d\n", ahp->ah_tx_chainmask, mask); + return; + } + + ahp->ah_tx_chainmaskopt = mask; +} Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_osprey22.ini ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_osprey22.ini Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_osprey22.ini Sat Feb 14 04:28:51 2015 (r278741) @@ -881,7 +881,7 @@ static const u_int32_t ar9300_osprey_2p2 { 0x00008258 , 0x00000000 }, { 0x0000825c , 0x40000000 }, { 0x00008260 , 0x00080922 }, - { 0x00008264 , 0x9bc00010 }, + { 0x00008264 , 0x9d400010 }, { 0x00008268 , 0xffffffff }, { 0x0000826c , 0x0000ffff }, { 0x00008270 , 0x00000000 }, @@ -1171,7 +1171,7 @@ static const u_int32_t ar9300_osprey_2p2 { 0x000010b0 , 0x00000e60 , 0x00001cc0 , 0x00007c70 , 0x00003e38 }, { 0x00008014 , 0x03e803e8 , 0x07d007d0 , 0x10801600 , 0x08400b00 }, { 0x0000801c , 0x128d8027 , 0x128d804f , 0x12e00057 , 0x12e0002b }, - { 0x00008120 , 0x08f04800 , 0x08f04800 , 0x08f04810 , 0x08f04810 }, + { 0x00008120 , 0x18f04800 , 0x18f04800 , 0x18f04810 , 0x18f04810 }, { 0x000081d0 , 0x00003210 , 0x00003210 , 0x0000320a , 0x0000320a }, { 0x00008318 , 0x00003e80 , 0x00007d00 , 0x00006880 , 0x00003440 }, }; Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Sat Feb 14 04:28:51 2015 (r278741) @@ -469,7 +469,7 @@ u_int32_t ar9300_wow_offload_handshake(s OS_REG_SET_BIT(ah, AR_MBOX_CTRL_STATUS, AR_MBOX_WOW_REQ); OS_REG_SET_BIT(ah, AR_MBOX_CTRL_STATUS, AR_MBOX_INT_EMB_CPU); - if (!ath_hal_wait(ah, AR_MBOX_CTRL_STATUS, AR_MBOX_WOW_CONF, AR_MBOX_WOW_CONF, bt_handshake_timeout_us)) { + if (!ath_hal_waitfor(ah, AR_MBOX_CTRL_STATUS, AR_MBOX_WOW_CONF, AR_MBOX_WOW_CONF, bt_handshake_timeout_us)) { HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "%s: WoW offload handshake failed", __func__); return 0; } @@ -678,6 +678,7 @@ ar9300_set_power_mode(struct ath_hal *ah OS_REG_WRITE(ah, AR_RTC_KEEP_AWAKE, 0x2); } #endif + ahp->ah_chip_full_sleep = AH_FALSE; break; case HAL_PM_FULL_SLEEP: #if ATH_SUPPORT_MCI @@ -987,7 +988,7 @@ ar9300_set_power_mode_wow_sleep(struct a OS_REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV); OS_REG_WRITE(ah, AR_CR, AR_CR_RXD); /* Set receive disable bit */ - if (!ath_hal_wait(ah, AR_CR, AR_CR_RXE, 0, AH_WAIT_TIMEOUT)) { + if (!ath_hal_waitfor(ah, AR_CR, AR_CR_RXE, 0, AH_WAIT_TIMEOUT)) { HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, "%s: dma failed to stop in 10ms\n" "AR_CR=0x%08x\nAR_DIAG_SW=0x%08x\n", __func__, OS_REG_READ(ah, AR_CR), OS_REG_READ(ah, AR_DIAG_SW)); Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c Sat Feb 14 04:28:51 2015 (r278741) @@ -68,6 +68,7 @@ ar9300_proc_rx_desc_fast(struct ath_hal rxs->rs_status = 0; rxs->rs_flags = 0; + rxs->rs_phyerr = 0; rxs->rs_datalen = rxsp->status2 & AR_data_len; rxs->rs_tstamp = rxsp->status3; @@ -129,17 +130,16 @@ ar9300_proc_rx_desc_fast(struct ath_hal * Consequently we filter them out here so we don't * confuse and/or complicate drivers. */ + if (rxsp->status11 & AR_crc_err) { rxs->rs_status |= HAL_RXERR_CRC; /* - * ignore CRC flag for spectral phy reports + * ignore CRC flag for phy reports */ if (rxsp->status11 & AR_phyerr) { u_int phyerr = MS(rxsp->status11, AR_phy_err_code); - if (phyerr == HAL_PHYERR_SPECTRAL) { - rxs->rs_status |= HAL_RXERR_PHY; - rxs->rs_phyerr = phyerr; - } + rxs->rs_status |= HAL_RXERR_PHY; + rxs->rs_phyerr = phyerr; } } else if (rxsp->status11 & AR_phyerr) { u_int phyerr; @@ -165,7 +165,9 @@ ar9300_proc_rx_desc_fast(struct ath_hal rxs->rs_status |= HAL_RXERR_MIC; } } - +#if 0 + rxs->rs_channel = AH_PRIVATE(ah)->ah_curchan->channel; +#endif return HAL_OK; } Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sat Feb 14 01:33:11 2015 (r278740) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sat Feb 14 04:28:51 2015 (r278741) @@ -31,7 +31,6 @@ #define FIX_NOISE_FLOOR 1 - /* Additional Time delay to wait after activiting the Base band */ #define BASE_ACTIVATE_DELAY 100 /* usec */ #define RTC_PLL_SETTLE_DELAY 100 /* usec */ @@ -325,6 +324,7 @@ int16_t ar9300_get_min_cca_pwr(struct at int16_t nf; // struct ath_hal_private *ahpriv = AH_PRIVATE(ah); + if ((OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) == 0) { nf = MS(OS_REG_READ(ah, AR_PHY_CCA_0), AR9280_PHY_MINCCA_PWR); if (nf & 0x100) { @@ -402,6 +402,33 @@ void ar9300_chain_noise_floor(struct ath } } +/* + * Return the current NF value in register. + * If the current NF cal is not completed, return 0. + */ +int16_t ar9300_get_nf_from_reg(struct ath_hal *ah, struct ieee80211_channel *chan, int wait_time) +{ + int16_t nfarray[HAL_NUM_NF_READINGS] = {0}; + int is_2g = 0; + HAL_CHANNEL_INTERNAL *ichan = NULL; + + ichan = ath_hal_checkchannel(ah, chan); + if (ichan == NULL) + return (0); + + if (wait_time <= 0) { + return 0; + } + + if (!ath_hal_waitfor(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF, 0, wait_time)) { + ath_hal_printf(ah, "%s: NF cal is not complete in %dus", __func__, wait_time); + return 0; + } + is_2g = !! (IS_CHAN_2GHZ(ichan)); + ar9300_upload_noise_floor(ah, is_2g, nfarray); + + return nfarray[0]; +} /* * Pick up the medium one in the noise floor buffer and update the @@ -415,6 +442,7 @@ ar9300_get_nf_hist_mid(struct ath_hal *a int16_t sort[HAL_NF_CAL_HIST_LEN_FULL]; /* upper bound for hist_len */ int i, j; + for (i = 0; i < hist_len; i++) { sort[i] = h->nf_cal_buffer[i][reading]; HALDEBUG(ah, HAL_DEBUG_NFCAL, @@ -451,7 +479,7 @@ ar9300_reset_nf_hist_buff(struct ath_hal HAL_CHAN_NFCAL_HIST *h = &ichan->nf_cal_hist; HAL_NFCAL_HIST_FULL *home = &AH_PRIVATE(ah)->nf_cal_hist; int i; - + /* * Copy the value for the channel in question into the home-channel * NF history buffer. The channel NF is probably a value filled in by @@ -538,6 +566,7 @@ get_noise_floor_thresh(struct ath_hal *a { struct ath_hal_9300 *ahp = AH9300(ah); + switch (chan->channel_flags & CHANNEL_ALL_NOTURBO) { case CHANNEL_A: case CHANNEL_A_HT20: @@ -1609,6 +1638,7 @@ ar9300_set_reset(struct ath_hal *ah, int { u_int32_t rst_flags; u_int32_t tmp_reg; + struct ath_hal_9300 *ahp = AH9300(ah); HALASSERT(type == HAL_RESET_WARM || type == HAL_RESET_COLD); @@ -1802,6 +1832,7 @@ ar9300_set_reset(struct ath_hal *ah, int ar9300_attach_hw_platform(ah); + ahp->ah_chip_reset_done = 1; return AH_TRUE; } @@ -2312,10 +2343,22 @@ ar9300_per_calibration(struct ath_hal *a static void ar9300_start_nf_cal(struct ath_hal *ah) { + struct ath_hal_9300 *ahp = AH9300(ah); OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF); OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF); OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); AH9300(ah)->nf_tsf32 = ar9300_get_tsf32(ah); + +/* + * We are reading the NF values before we start the NF operation, because + * of that we are getting very high values like -45. + * This triggers the CW_INT detected and EACS module triggers the channel change + * chip_reset_done value is used to fix this issue. + * chip_reset_flag is set during the RTC reset. + * chip_reset_flag is cleared during the starting NF operation. + * if flag is set we will clear the flag and will not read the NF values. + */ + ahp->ah_chip_reset_done = 0; } /* ar9300_calibration @@ -2409,7 +2452,7 @@ ar9300_calibration(struct ath_hal *ah, s ar9300_load_nf(ah, nf_buf); /* start NF calibration, without updating BB NF register*/ - ar9300_start_nf_cal(ah); + ar9300_start_nf_cal(ah); } } return AH_TRUE; @@ -2459,12 +2502,15 @@ ar9300_iq_calibration(struct ath_hal *ah u_int32_t q_coff_denom, i_coff_denom; int32_t q_coff, i_coff; int iq_corr_neg, i; + HAL_CHANNEL_INTERNAL *ichan; static const u_int32_t offset_array[3] = { AR_PHY_RX_IQCAL_CORR_B0, AR_PHY_RX_IQCAL_CORR_B1, AR_PHY_RX_IQCAL_CORR_B2, }; + ichan = ath_hal_checkchannel(ah, AH_PRIVATE(ah)->ah_curchan); + for (i = 0; i < num_chains; i++) { power_meas_i = ahp->ah_total_power_meas_i[i]; power_meas_q = ahp->ah_total_power_meas_q[i]; @@ -2537,6 +2583,19 @@ ar9300_iq_calibration(struct ath_hal *ah OS_REG_RMW_FIELD(ah, offset_array[i], AR_PHY_RX_IQCAL_CORR_IQCORR_Q_Q_COFF, q_coff); + /* store the RX cal results */ + if (ichan != NULL) { + ahp->ah_rx_cal_corr[i] = OS_REG_READ(ah, offset_array[i]) & 0x7fff; + ahp->ah_rx_cal_complete = AH_TRUE; + ahp->ah_rx_cal_chan = ichan->channel; +// ahp->ah_rx_cal_chan_flag = ichan->channel_flags &~ CHANNEL_PASSIVE; + ahp->ah_rx_cal_chan_flag = 0; /* XXX */ + } else { + /* XXX? Is this what I should do? */ + ahp->ah_rx_cal_complete = AH_FALSE; + + } + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "Register offset (0x%04x) QI COFF (bitfields 0x%08x) " "after update = 0x%x\n", @@ -2563,6 +2622,55 @@ ar9300_iq_calibration(struct ath_hal *ah } /* + * When coming back from offchan, we do not perform RX IQ Cal. + * But the chip reset will clear all previous results + * We store the previous results and restore here. + */ +static void +ar9300_rx_iq_cal_restore(struct ath_hal *ah) +{ + struct ath_hal_9300 *ahp = AH9300(ah); + u_int32_t i_coff, q_coff; + HAL_BOOL is_restore = AH_FALSE; + int i; + static const u_int32_t offset_array[3] = { + AR_PHY_RX_IQCAL_CORR_B0, + AR_PHY_RX_IQCAL_CORR_B1, + AR_PHY_RX_IQCAL_CORR_B2, + }; + + for (i=0; iah_rx_cal_corr[i]) { + i_coff = (ahp->ah_rx_cal_corr[i] & + AR_PHY_RX_IQCAL_CORR_IQCORR_Q_I_COFF) >> + AR_PHY_RX_IQCAL_CORR_IQCORR_Q_I_COFF_S; + q_coff = (ahp->ah_rx_cal_corr[i] & + AR_PHY_RX_IQCAL_CORR_IQCORR_Q_Q_COFF) >> + AR_PHY_RX_IQCAL_CORR_IQCORR_Q_Q_COFF_S; + + OS_REG_RMW_FIELD(ah, offset_array[i], + AR_PHY_RX_IQCAL_CORR_IQCORR_Q_I_COFF, i_coff); + OS_REG_RMW_FIELD(ah, offset_array[i], + AR_PHY_RX_IQCAL_CORR_IQCORR_Q_Q_COFF, q_coff); + + is_restore = AH_TRUE; + } + } + + if (is_restore) + OS_REG_SET_BIT(ah, + AR_PHY_RX_IQCAL_CORR_B0, AR_PHY_RX_IQCAL_CORR_IQCORR_ENABLE); + + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, + "%s: IQ Cal and Correction (offset 0x%04x) enabled " + "(bit position 0x%08x). New Value 0x%08x\n", + __func__, + (unsigned) (AR_PHY_RX_IQCAL_CORR_B0), + AR_PHY_RX_IQCAL_CORR_IQCORR_ENABLE, + OS_REG_READ(ah, AR_PHY_RX_IQCAL_CORR_B0)); +} + +/* * Set a limit on the overall output power. Used for dynamic * transmit power control and the like. * @@ -3739,6 +3847,13 @@ ar9300_init_cal_internal(struct ath_hal #endif /* end - Init time calibrations */ + /* Do not do RX cal in case of offchan, or cal data already exists on same channel*/ + if (ahp->ah_skip_rx_iq_cal) { + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, + "Skip RX IQ Cal\n"); + return AH_TRUE; + } + /* If Cals are supported, add them to list via INIT/INSERT_CAL */ if (AH_TRUE == ar9300_is_cal_supp(ah, chan, IQ_MISMATCH_CAL)) { INIT_CAL(&ahp->ah_iq_cal_data); @@ -3839,6 +3954,8 @@ ar9300_set_dma(struct ath_hal *ah) { u_int32_t regval; struct ath_hal_9300 *ahp = AH9300(ah); + struct ath_hal_private *ahpriv = AH_PRIVATE(ah); + HAL_CAPABILITIES *pCap = &ahpriv->ah_caps; #if 0 /* @@ -3898,9 +4015,14 @@ ar9300_set_dma(struct ath_hal *ah) /* * Enable HPQ for UAPSD */ - if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) { - OS_REG_WRITE(ah, AR_HP_Q_CONTROL, - AR_HPQ_ENABLE | AR_HPQ_UAPSD | AR_HPQ_UAPSD_TRIGGER_EN); + if (pCap->halHwUapsdTrig == AH_TRUE) { + /* Only enable this if HAL capabilities says it is OK */ + if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) { + OS_REG_WRITE(ah, AR_HP_Q_CONTROL, + AR_HPQ_ENABLE | AR_HPQ_UAPSD | AR_HPQ_UAPSD_TRIGGER_EN); + } + } else { + /* use default value from ini file - which disable HPQ queue usage */ } /* @@ -4319,6 +4441,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPM HAL_BOOL stopped, cal_ret; HAL_BOOL apply_last_iqcorr = AH_FALSE; + if (OS_REG_READ(ah, AR_IER) == AR_IER_ENABLE) { HALDEBUG(AH_NULL, HAL_DEBUG_UNMASKABLE, "** Reset called with WLAN " "interrupt enabled %08x **\n", ar9300_get_interrupts(ah)); @@ -4347,6 +4470,11 @@ ar9300_reset(struct ath_hal *ah, HAL_OPM ahp->ah_rx_chainmask = rxchainmask & ap->ah_caps.halRxChainMask; ahp->ah_tx_cal_chainmask = ap->ah_caps.halTxChainMask; ahp->ah_rx_cal_chainmask = ap->ah_caps.halRxChainMask; + + /* + * Keep the previous optinal txchainmask value + */ + HALASSERT(ar9300_check_op_mode(opmode)); OS_MARK(ah, AH_MARK_RESET, b_channel_change); @@ -4453,7 +4581,21 @@ ar9300_reset(struct ath_hal *ah, HAL_OPM #if 0 /* Get the value from the previous NF cal and update history buffer */ if (curchan && (ahp->ah_chip_full_sleep != AH_TRUE)) { - ar9300_store_new_nf(ah, curchan, is_scan); + + if(ahp->ah_chip_reset_done){ + ahp->ah_chip_reset_done = 0; + } else { + /* + * is_scan controls updating NF for home channel or off channel. + * Home -> Off, update home channel + * Off -> Home, update off channel + * Home -> Home, uppdate home channel + */ + if (ap->ah_curchan->channel != chan->channel) + ar9300_store_new_nf(ah, curchan, !is_scan); + else + ar9300_store_new_nf(ah, curchan, is_scan); + } } #endif @@ -4464,7 +4606,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPM AH9300(ah)->nfp = IS_CHAN_2GHZ(ichan) ? &ahp->nf_2GHz : &ahp->nf_5GHz; /* - * XXX For now, don't apply the last IQ correction. + * XXX FreeBSD For now, don't apply the last IQ correction. * * This should be done when scorpion is enabled on FreeBSD; just be * sure to fix this channel match code so it uses net80211 flags @@ -4501,6 +4643,31 @@ ar9300_reset(struct ath_hal *ah, HAL_OPM } #endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 05:10:37 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53BA5CD7 for ; Sat, 14 Feb 2015 05:10:37 +0000 (UTC) Received: from mail-ig0-f170.google.com (mail-ig0-f170.google.com [209.85.213.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1205DF05 for ; Sat, 14 Feb 2015 05:10:37 +0000 (UTC) Received: by mail-ig0-f170.google.com with SMTP id l13so20290919iga.1 for ; Fri, 13 Feb 2015 21:10:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=DJ4uwISgdh++lxmqrFNw56J5Ippi2HfE76X9IShEKIs=; b=IVn2kGD1amk1KOpmdELHoO+1R1gmGWVI0TZFKThRsBMKiDupQeIKi8mj15hzu1OkyJ M1m4ODMTGtLK4iGvo2dByGWWvR3RhY4UH+40+BulifmrF2kebL7+GFdNMpiWtBdieRal JswzqCSsA+bzCTlmXSRAmdeuC4gx21e5CGK2yXHi883uxBqCQUOYt+XFvh91BArRHGlz bn1KoMRtPwNBTF2aSuXWJueA0rSf7Zef0T55w6oDR21zp3dsuqQupV9NKKxT74sGVpo3 N+GPJPHYuH/3Du5JKC1EteZrfHhb84jOqi4bkwE3ZSzPDp+BrMaCA5mGPNhx9INUm1FA XPXw== X-Gm-Message-State: ALoCoQls+B2IYEiCsNgfJslziraJiwyfqasS6zZPViTJebTdO3xnl4f0QH1XujvJ54fUeEWAYPpg X-Received: by 10.107.151.80 with SMTP id z77mr3491571iod.51.1423890630008; Fri, 13 Feb 2015 21:10:30 -0800 (PST) Received: from sol.firepipe.net ([2601:1:adc0:2c1:7271:bcff:fe83:9550]) by mx.google.com with ESMTPSA id h19sm4516900igq.10.2015.02.13.21.10.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Feb 2015 21:10:29 -0800 (PST) Sender: Will Andrews Date: Fri, 13 Feb 2015 22:10:27 -0700 From: Will Andrews To: John Baldwin Subject: Re: svn commit: r278321 - head/sys/dev/ipmi Message-ID: <20150214051026.GB45601@sol.firepipe.net> References: <201502061645.t16GjBHI010251@svn.freebsd.org> <1747329.Lge6tErVCv@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0eh6TmSyL6TZE2Uz" Content-Disposition: inline In-Reply-To: <1747329.Lge6tErVCv@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, wca@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 05:10:37 -0000 --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 06, 2015 at 12:00:02PM -0500, John Baldwin wrote: > I think we should further change this to only allow the watchdog to be us= ed=20 > with KCS and SMIC so that watchdog requests never sleep. I think that we= =20 > could then revert r272366 as to my knowledge this was the only watchdog d= river=20 > that could sleep? No objection from me. :) --=20 wca --0eh6TmSyL6TZE2Uz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTe2MEACgkQF47idPgWcsWTAACfZSOY4TsXotNpD3M4oEb4arHb vmUAnRcPPoJ7K7AFa720RkTiQrD9MUDg =JEwb -----END PGP SIGNATURE----- --0eh6TmSyL6TZE2Uz-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 06:19:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88C15159; Sat, 14 Feb 2015 06:19: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73F0D6B1; Sat, 14 Feb 2015 06:19:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1E6JPu2054198; Sat, 14 Feb 2015 06:19:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1E6JPVV054197; Sat, 14 Feb 2015 06:19:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502140619.t1E6JPVV054197@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 Feb 2015 06:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278742 - head/bin/pkill/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 06:19:25 -0000 Author: ngie Date: Sat Feb 14 06:19:24 2015 New Revision: 278742 URL: https://svnweb.freebsd.org/changeset/base/278742 Log: Simplify jail_name_to_jid and try to be more fault tolerant when scanning for the jail ID (poll up to 10 times for the jail IDs to become available) If the scan fails, the code will fall through and fail as it does with Jenkins today Modified: head/bin/pkill/tests/pgrep-j_test.sh Modified: head/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- head/bin/pkill/tests/pgrep-j_test.sh Sat Feb 14 04:28:51 2015 (r278741) +++ head/bin/pkill/tests/pgrep-j_test.sh Sat Feb 14 06:19:24 2015 (r278742) @@ -4,17 +4,7 @@ jail_name_to_jid() { local check_name="$1" - ( - line="$(jls -n 2> /dev/null | grep name=$check_name )" - for nv in $line; do - local name="${nv%=*}" - if [ "${name}" = "jid" ]; then - eval $nv - echo $jid - break - fi - done - ) + jls -j "$check_name" -s 2>/dev/null | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g' } base=pgrep_j_test @@ -37,10 +27,19 @@ jail -c path=/ name=${base}_1_1 ip4.addr jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount & -jid1=$(jail_name_to_jid ${base}_1_1) -jid2=$(jail_name_to_jid ${base}_1_2) -jid="${jid1},${jid2}" -pid1="$(pgrep -f -x -j $jid "$sleep $sleep_amount" | sort)" +for i in `seq 1 10`; do + jid1=$(jail_name_to_jid ${base}_1_1) + jid2=$(jail_name_to_jid ${base}_1_2) + jid="${jid1},${jid2}" + case "$jid" in + [0-9]+,[0-9]+) + break + ;; + esac + sleep 0.1 +done + +pid1="$(pgrep -f -x -j "$jid" "$sleep $sleep_amount" | sort)" pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_1_1.pid)" \ $(cat ${PWD}/${base}_1_2.pid) | sort) if [ "$pid1" = "$pid2" ]; then From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 09:00:13 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BED61C3D; Sat, 14 Feb 2015 09:00: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 907E363E; Sat, 14 Feb 2015 09:00:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1E90DFK029860; Sat, 14 Feb 2015 09:00:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1E90D2p029856; Sat, 14 Feb 2015 09:00:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502140900.t1E90D2p029856@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Feb 2015 09:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278749 - in head/sys/x86: acpica 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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 09:00:13 -0000 Author: kib Date: Sat Feb 14 09:00:12 2015 New Revision: 278749 URL: https://svnweb.freebsd.org/changeset/base/278749 Log: Detect whether x2APIC on VMWare is usable without interrupt redirection support. Older versions of the hypervisor mis-interpret the cpuid format in ioapic registers when x2APIC is turned on, but IR is not used by the guest OS. Based on: Linux commit 4cca6ea04d31c22a7d0436949c072b27bde41f86 Tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 months Modified: head/sys/x86/acpica/madt.c head/sys/x86/include/vmware.h Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Sat Feb 14 08:52:52 2015 (r278748) +++ head/sys/x86/acpica/madt.c Sat Feb 14 09:00:12 2015 (r278749) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -40,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -130,6 +132,7 @@ madt_setup_local(void) { ACPI_TABLE_DMAR *dmartbl; vm_paddr_t dmartbl_physaddr; + u_int p[4]; madt = pmap_mapbios(madt_physaddr, madt_length); if ((cpu_feature2 & CPUID2_X2APIC) != 0) { @@ -146,6 +149,16 @@ madt_setup_local(void) } acpi_unmap_table(dmartbl); } + if (vm_guest == VM_GUEST_VMWARE) { + vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p); + if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 || + (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) { + x2apic_mode = 0; + if (bootverbose) + printf( + "x2APIC available but disabled inside VMWare without intr redirection\n"); + } + } TUNABLE_INT_FETCH("hw.x2apic_enable", &x2apic_mode); } Modified: head/sys/x86/include/vmware.h ============================================================================== --- head/sys/x86/include/vmware.h Sat Feb 14 08:52:52 2015 (r278748) +++ head/sys/x86/include/vmware.h Sat Feb 14 09:00:12 2015 (r278749) @@ -31,8 +31,13 @@ #define VMW_HVMAGIC 0x564d5868 #define VMW_HVPORT 0x5658 + #define VMW_HVCMD_GETVERSION 10 #define VMW_HVCMD_GETHZ 45 +#define VMW_HVCMD_GETVCPU_INFO 68 + +#define VMW_VCPUINFO_LEGACY_X2APIC (1 << 3) +#define VMW_VCPUINFO_VCPU_RESERVED (1 << 31) static __inline void vmware_hvcall(u_int cmd, u_int *p) From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 09:47:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2DD859E; Sat, 14 Feb 2015 09:47:09 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 6654EAB8; Sat, 14 Feb 2015 09:47:09 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id C550A1A3965; Sat, 14 Feb 2015 20:46:59 +1100 (AEDT) Date: Sat, 14 Feb 2015 20:46:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff Subject: Re: svn commit: r278737 - head/usr.sbin/flowctl In-Reply-To: <201502132357.t1DNvKda075915@svn.freebsd.org> Message-ID: <20150214193210.N945@besplex.bde.org> References: <201502132357.t1DNvKda075915@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=Za4kaKlA c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=Qn7aHUtcSh8-iNL0V9sA:9 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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 09:47:09 -0000 On Fri, 13 Feb 2015, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Feb 13 23:57:20 2015 > New Revision: 278737 > URL: https://svnweb.freebsd.org/changeset/base/278737 > > Log: > Use less ugly code to allocate buffer of SORCVBUF_SIZE. Less ugly, but wrong. The version that used alloca() was correct. > Modified: head/usr.sbin/flowctl/flowctl.c > ============================================================================== > --- head/usr.sbin/flowctl/flowctl.c Fri Feb 13 23:43:59 2015 (r278736) > +++ head/usr.sbin/flowctl/flowctl.c Fri Feb 13 23:57:20 2015 (r278737) > @@ -222,10 +222,12 @@ ctl_show(int argc, char **argv) > static void > do_show(int version, void (*func)(struct ngnf_show_header *)) > { > - struct ng_mesg ng_mesg[SORCVBUF_SIZE]; > + char buf[SORCVBUF_SIZE]; alloca(), like malloc(), gave a buffer suitably aligned for any object. This only gives a buffer suitably aligned for char objects. It may accidentally be suitably aligned for other objects. The accident often happens because objects on the stack are usually given larger alignment than necessary. Depending on this is unportable at best. > + struct ng_mesg *ng_mesg; > struct ngnf_show_header req, *resp; > int token, nread; > > + ng_mesg = (struct ng_mesg *)buf; The new bug is detected at high warning levels. WARNS >= 4 gives -Wcast-align unless the MK option to break this warning is configured. The bug is detected by -Wcast0align even on amd64. The bug is not detected by default because flowctl has many other warnings at the default WARNS of 6 (mainly -Wcast-align and -Wsign-compare ones), so it breaks the warnings using WARNGS?=2. I think arches with strict alignment requirements have a warning about this without -Wcast-align, but couldn't find one on ia64. Certainly, related warnings turned up on ia64 when they didn't on amd64 with the same WARNS. The runtime bug can be fixed using __aligned(__ALIGN_MUMBLE). This exposes a bug in -Wcast-align -- it still warns although the char buffer is obviously aligned. Compilers should also know that the buffer is suitably aligned when they just allocated it on the stack and the alignment happens to be enough. But in this case, compilers should also know that the suitable alignment is only accidental, and still warn unless portability warnings are supressed. This and the non-spurious warning can be broken using another cast: ng_mesg = (struct ng_mesg *)(void *)buf; This depends on the compiler being too stupid to remember the alignment of the original char buffer. This fixed version is still worse than the old one using alloca(), because it is longer and more complicated. alloca(), like malloc(), returns a void * so that the compiler cannot know the alignment of the buffer (except it can for alloca() because it just allocated the buffer -- it must do a (void *) cast internally and forget the actual alignment, just like the above cast does but with more intentional forgetfulness). We are basically using a home made alloca(N) for the easier case where N is constant. Using VLAs and also the C99 feature of declarations anwhere, and extensions like __aligned(), we can almost implement a full alloca() using the fixed version of this change: /* * XXX need extended statement-expression so that __buf doesn't go out * of scope after the right brace. */ #define my_alloca(n) __extension__ ({ /* XXX need unique name. */ \ char __buf[__roundup2((n), MUMBLE)] __aligned(MUMBLE); \ \ (void *)__buf; \ }) Bruce From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 10:52:44 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04C8F149; Sat, 14 Feb 2015 10:52:44 +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 BA9B6B6; Sat, 14 Feb 2015 10:52:43 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id B80E4425F2A; Sat, 14 Feb 2015 21:52:28 +1100 (AEDT) Date: Sat, 14 Feb 2015 21:52:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bryan Drewery Subject: Re: svn commit: r278739 - head/lib/libc/regex In-Reply-To: <54DE993E.2050704@FreeBSD.org> Message-ID: <20150214213333.H945@besplex.bde.org> References: <201502140023.t1E0Nspc090570@svn.freebsd.org> <54DE98AC.6030309@FreeBSD.org> <54DE993E.2050704@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=Za4kaKlA c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=LdbmYFKm0H1EIkHWzn8A:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 10:52:44 -0000 On Fri, 13 Feb 2015, Bryan Drewery wrote: > On 2/13/2015 6:37 PM, Bryan Drewery wrote: >> On 2/13/2015 6:23 PM, Xin LI wrote: >>> Author: delphij >>> Date: Sat Feb 14 00:23:53 2015 >>> New Revision: 278739 >>> URL: https://svnweb.freebsd.org/changeset/base/278739 >>> >>> Log: >>> Disallow pattern spaces which would cause intermediate calculations to >>> overflow size_t. >>> ... >>> Modified: head/lib/libc/regex/regcomp.c >>> ============================================================================== >>> --- head/lib/libc/regex/regcomp.c Sat Feb 14 00:03:43 2015 (r278738) >>> +++ head/lib/libc/regex/regcomp.c Sat Feb 14 00:23:53 2015 (r278739) >>> @@ -192,6 +192,7 @@ regcomp(regex_t * __restrict preg, >>> struct parse *p = &pa; >>> int i; >>> size_t len; >>> + size_t maxlen; >>> #ifdef REDEBUG >>> # define GOODFLAGS(f) (f) >>> #else >>> @@ -213,7 +214,23 @@ regcomp(regex_t * __restrict preg, >>> g = (struct re_guts *)malloc(sizeof(struct re_guts)); >>> if (g == NULL) >>> return(REG_ESPACE); >>> + /* >>> + * Limit the pattern space to avoid a 32-bit overflow on buffer >>> + * extension. Also avoid any signed overflow in case of conversion >>> + * so make the real limit based on a 31-bit overflow. >>> + * >>> + * Likely not applicable on 64-bit systems but handle the case >>> + * generically (who are we to stop people from using ~715MB+ >>> + * patterns?). >>> + */ >>> + maxlen = ((size_t)-1 >> 1) / sizeof(sop) * 2 / 3; >>> + if (len >= maxlen) { >>> + free((char *)g); >> >> I was planning to submit a patch for review to remove all of this >> casting / and discuss. > > To be clear, I only mean in free(3) calls. But they are least bogus for the free() calls. >> In this example the malloc is casted to struct re_gets* but the free is >> casted to char *. Why different and why cast in free at all? Because this code attempted to be portable to K&R compilers (including broken ones, but with no standard it was hard to tell what was broken). With no prototypes, the arg to free() had to be cast. (Except, all pointers have the same representation except on exotic machines, so the cast was rarely necessary then or now.) With no void * in K&R1, free() took a char * arg and the cast had to be to that. STDC have the grandfather kludge of requiring char * and void * to be almost interchangable, so you can probably cast to either. I forget if it requires char * and void * to have the same representation, so that you can certainly cast to either. Even more than the same representation is required -- they must be passed in the same way. Old programs cast the result of malloc() to break warnings about malloc() not being declared, or possibly for portability to broken compilers which require the cast. Actually, it was unclear if they were broken -- before void * existed, malloc() returned char *, and it is not so clear for old char * as for not so old void * that automatic conversion from char * to any pointer type does or should happen (without a warning). New C++ programs require the cast even for void *. I don't like this. I also don't like the spelling of the sizeof arg in: g = (struct re_guts *)malloc(sizeof(struct re_guts)); It is clearer to write: g = malloc(sizeof(*g)); This works for any pointer g. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 11:47:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88A6BC6A; Sat, 14 Feb 2015 11:47: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6992575A; Sat, 14 Feb 2015 11:47:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EBlgdh009375; Sat, 14 Feb 2015 11:47:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EBle1t009369; Sat, 14 Feb 2015 11:47:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502141147.t1EBle1t009369@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Feb 2015 11:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278751 - in head/lib: libc/gen libc/include libc/sys libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 11:47:42 -0000 Author: kib Date: Sat Feb 14 11:47:40 2015 New Revision: 278751 URL: https://svnweb.freebsd.org/changeset/base/278751 Log: Properly interpose libc spinlocks, was missed in r276630. In particular, stdio locking was affected. Reported and tested by: "Matthew D. Fuller" Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libc/gen/_spinlock_stub.c head/lib/libc/include/libc_private.h head/lib/libc/sys/interposing_table.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_spinlock.c head/lib/libthr/thread/thr_syscalls.c Modified: head/lib/libc/gen/_spinlock_stub.c ============================================================================== --- head/lib/libc/gen/_spinlock_stub.c Sat Feb 14 10:56:03 2015 (r278750) +++ head/lib/libc/gen/_spinlock_stub.c Sat Feb 14 11:47:40 2015 (r278751) @@ -33,51 +33,48 @@ __FBSDID("$FreeBSD$"); #include #include "spinlock.h" +#include "libc_private.h" long _atomic_lock_stub(volatile long *); void _spinlock_stub(spinlock_t *); void _spinunlock_stub(spinlock_t *); void _spinlock_debug_stub(spinlock_t *, char *, int); -/* - * Declare weak definitions in case the application is not linked - * with libpthread. - */ __weak_reference(_atomic_lock_stub, _atomic_lock); -__weak_reference(_spinlock_stub, _spinlock); -__weak_reference(_spinunlock_stub, _spinunlock); -__weak_reference(_spinlock_debug_stub, _spinlock_debug); - -/* - * This function is a stub for the _atomic_lock function in libpthread. - */ + long _atomic_lock_stub(volatile long *lck __unused) { return (0L); } +__weak_reference(_spinlock, _spinlock_debug); +#pragma weak _spinlock +void +_spinlock(spinlock_t *lck) +{ + + ((void (*)(spinlock_t *lck))__libc_interposing[INTERPOS_spinlock]) + (lck); -/* - * This function is a stub for the spinlock function in libpthread. - */ +} + +#pragma weak _spinlock void -_spinlock_stub(spinlock_t *lck __unused) +_spinunlock(spinlock_t *lck) { + + ((void (*)(spinlock_t *lck))__libc_interposing[INTERPOS_spinunlock]) + (lck); + } -/* - * This function is a stub for the spinunlock function in libpthread. - */ void -_spinunlock_stub(spinlock_t *lck __unused) +__libc_spinlock_stub(spinlock_t *lck __unused) { } -/* - * This function is a stub for the debug spinlock function in libpthread. - */ void -_spinlock_debug_stub(spinlock_t *lck __unused, char *fname __unused, int lineno __unused) +__libc_spinunlock_stub(spinlock_t *lck __unused) { } Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Sat Feb 14 10:56:03 2015 (r278750) +++ head/lib/libc/include/libc_private.h Sat Feb 14 11:47:40 2015 (r278751) @@ -95,6 +95,9 @@ do { \ _SPINUNLOCK(&__stdio_thread_lock); \ } while (0) +void __libc_spinlock_stub(struct _spinlock *); +void __libc_spinunlock_stub(struct _spinlock *); + /* * Indexes into the pthread jump table. * @@ -216,6 +219,8 @@ enum { INTERPOS_write, INTERPOS_writev, INTERPOS__pthread_mutex_init_calloc_cb, + INTERPOS_spinlock, + INTERPOS_spinunlock, INTERPOS_MAX }; Modified: head/lib/libc/sys/interposing_table.c ============================================================================== --- head/lib/libc/sys/interposing_table.c Sat Feb 14 10:56:03 2015 (r278750) +++ head/lib/libc/sys/interposing_table.c Sat Feb 14 11:47:40 2015 (r278751) @@ -73,6 +73,8 @@ interpos_func_t __libc_interposing[INTER SLOT(write, __sys_write), SLOT(writev, __sys_writev), SLOT(_pthread_mutex_init_calloc_cb, _pthread_mutex_init_calloc_cb_stub), + SLOT(spinlock, __libc_spinlock_stub), + SLOT(spinunlock, __libc_spinunlock_stub), }; #undef SLOT Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Sat Feb 14 10:56:03 2015 (r278750) +++ head/lib/libthr/thread/thr_private.h Sat Feb 14 11:47:40 2015 (r278751) @@ -928,6 +928,10 @@ int __thr_sigwait(const sigset_t *set, i int __thr_sigwaitinfo(const sigset_t *set, siginfo_t *info); int __thr_swapcontext(ucontext_t *oucp, const ucontext_t *ucp); +struct _spinlock; +void __thr_spinunlock(struct _spinlock *lck); +void __thr_spinlock(struct _spinlock *lck); + struct tcb *_tcb_ctor(struct pthread *, int); void _tcb_dtor(struct tcb *); Modified: head/lib/libthr/thread/thr_spinlock.c ============================================================================== --- head/lib/libthr/thread/thr_spinlock.c Sat Feb 14 10:56:03 2015 (r278750) +++ head/lib/libthr/thread/thr_spinlock.c Sat Feb 14 11:47:40 2015 (r278751) @@ -61,7 +61,7 @@ static void init_spinlock(spinlock_t *lc */ void -_spinunlock(spinlock_t *lck) +__thr_spinunlock(spinlock_t *lck) { struct spinlock_extra *_extra; @@ -70,7 +70,7 @@ _spinunlock(spinlock_t *lck) } void -_spinlock(spinlock_t *lck) +__thr_spinlock(spinlock_t *lck) { struct spinlock_extra *_extra; @@ -84,12 +84,6 @@ _spinlock(spinlock_t *lck) THR_UMUTEX_LOCK(_get_curthread(), &_extra->lock); } -void -_spinlock_debug(spinlock_t *lck, char *fname __unused, int lineno __unused) -{ - _spinlock(lck); -} - static void init_spinlock(spinlock_t *lck) { Modified: head/lib/libthr/thread/thr_syscalls.c ============================================================================== --- head/lib/libthr/thread/thr_syscalls.c Sat Feb 14 10:56:03 2015 (r278750) +++ head/lib/libthr/thread/thr_syscalls.c Sat Feb 14 11:47:40 2015 (r278751) @@ -597,6 +597,8 @@ __thr_interpose_libc(void) SLOT(wait4); SLOT(write); SLOT(writev); + SLOT(spinlock); + SLOT(spinunlock); #undef SLOT *(__libc_interposing_slot( INTERPOS__pthread_mutex_init_calloc_cb)) = From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 15:14:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12791239; Sat, 14 Feb 2015 15:14: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1789BB8; Sat, 14 Feb 2015 15:14:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EFEfUR007560; Sat, 14 Feb 2015 15:14:41 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EFEfR6007559; Sat, 14 Feb 2015 15:14:41 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201502141514.t1EFEfR6007559@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sat, 14 Feb 2015 15:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278758 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 15:14:42 -0000 Author: tijl Date: Sat Feb 14 15:14:41 2015 New Revision: 278758 URL: https://svnweb.freebsd.org/changeset/base/278758 Log: The ld(1) flag is -Bsymbolic not -Wsymbolic. Modified: head/lib/libc/gen/dlopen.3 Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Sat Feb 14 14:13:00 2015 (r278757) +++ head/lib/libc/gen/dlopen.3 Sat Feb 14 15:14:41 2015 (r278758) @@ -32,7 +32,7 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd December 21, 2011 +.Dd February 14, 2015 .Dt DLOPEN 3 .Os .Sh NAME @@ -236,7 +236,7 @@ as follows, in the given order: The referencing object itself (or the object from which the call to .Fn dlsym is made), if that object was linked using the -.Fl Wsymbolic +.Fl Bsymbolic option to .Xr ld 1 . .It From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 15:17:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB71E3A7 for ; Sat, 14 Feb 2015 15:17:41 +0000 (UTC) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49E34BD5 for ; Sat, 14 Feb 2015 15:17:40 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id h11so17846838wiw.3 for ; Sat, 14 Feb 2015 07:17:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=fByIv+lLXfVOk77sKYYRxYbOFRT14cV4Sb5K0D82J9A=; b=SnImND6Xkdst1TRW73l+BM9Ob2MvlOScn7w5doghOsQU6HIkp1odkwE3Iwijd1mF+U sT77yA7BPCY6hMHs4elylmYkZI57aM+0obO+pjUhiMFixINU8TJMdWvFKY2QZu0AFMvE 9juiFaXdSt7vPUY3HKYA3a3hYgV+J3iiA7jnJN5bVginTziUMk4981DvgVPSBM1BLd6A 6e7fkd/o1Lwn5J2iLds/wA3XDE5GMkfM3VUC3BU83y+q9sLmWM7qFo1EojkHOas3QpP9 WYKmj9QMYTb2bxplTEnbrumKoUH4YrQ7ocb5r8zrD059xpMWlpYEg8683jfMa2mjWQ7+ LCOw== X-Gm-Message-State: ALoCoQlFoJlXjdPJM/RkrL5PVYJSZn3YsprkY41WQujkTtdKVBy+2xfu/UNaNextycNbK7SwDbVO X-Received: by 10.194.192.4 with SMTP id hc4mr30545318wjc.59.1423927058746; Sat, 14 Feb 2015 07:17:38 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id fo15sm11430605wic.19.2015.02.14.07.17.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Feb 2015 07:17:37 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <54DF6709.6030204@freebsd.org> Date: Sat, 14 Feb 2015 15:17:29 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Bryan Drewery , phabric-admin@FreeBSD.org Subject: Re: Phabricator + 'Reviewed by' [was Re: svn commit: r278472 - in head/sys: netinet netinet6] References: <201502091928.t19JSC5P066293@svn.freebsd.org> <38B8D2D0-862A-4DF5-9479-8EC234CF830B@FreeBSD.org> <54DE8F32.2090500@FreeBSD.org> In-Reply-To: <54DE8F32.2090500@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 15:17:41 -0000 On 13/02/2015 23:56, Bryan Drewery wrote: > On 2/9/2015 3:45 PM, Bjoern A. Zeeb wrote: >>> Commented upon by hiren and sbruno >>> See Phabricator D1777 for more details. >>> >>> Commented upon by hiren and sbruno >>> Reviewed by: adrian, jhb and bz >> I have not reviewed this; as a matter of fact you are aware that I still wanted to do that. >> > Something about Phabricator is not jiving with our commit terminology. > This has happened before as well with other commits. I'm sure everyone > is good-intentioned as well. > > There's not 1 person on D1777 who has 'accepted' it. That is what > warrants a 'Reviewed by' to me. > > It's clear to me, but seems unclear to others. I really think the > reviewer list needs to be split up. Rather than using icons, use > separate lists. Reviewers requested: accepted: commented: changes > requested:. I don't think it needs to be split up, that feels unnecessary, if someone hasn't accepted it then they haven't review it period IMO. From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 16:23:05 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7863B44B; Sat, 14 Feb 2015 16:23: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 628321F1; Sat, 14 Feb 2015 16:23:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EGN5Eg040189; Sat, 14 Feb 2015 16:23:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EGN56A040188; Sat, 14 Feb 2015 16:23:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502141623.t1EGN56A040188@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 Feb 2015 16:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278759 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 16:23:05 -0000 Author: adrian Date: Sat Feb 14 16:23:04 2015 New Revision: 278759 URL: https://svnweb.freebsd.org/changeset/base/278759 Log: Remove the reserved pin 11 from the HAL check. The QCA9565 can have RFKILL on GPIO Pin 11, and thus we need to configure it up correctly or the NIC may not function. I'm not sure why the AR9382 can't use GPIO 8 / GPIO 11 ; it's likely hooked up to some external LNA or filter. The real solution is to make it only block pin 8 / pin 11 for AR9382, but the AR9382 probes like an AR9380. Sigh. Submitted by: Anthony Jenkins Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c Sat Feb 14 15:14:41 2015 (r278758) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c Sat Feb 14 16:23:04 2015 (r278759) @@ -162,7 +162,6 @@ ar9300_gpio_cfg_output( HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); if ((gpio == AR9382_GPIO_PIN_8_RESERVED) || - (gpio == AR9382_GPIO_PIN_11_RESERVED) || (gpio == AR9382_GPIO_9_INPUT_ONLY)) { return AH_FALSE; @@ -348,7 +347,6 @@ ar9300_gpio_cfg_input(struct ath_hal *ah HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); if ((gpio == AR9382_GPIO_PIN_8_RESERVED) || - (gpio == AR9382_GPIO_PIN_11_RESERVED) || (gpio > AR9382_MAX_GPIO_INPUT_PIN_NUM)) { return AH_FALSE; @@ -378,7 +376,6 @@ ar9300_gpio_set(struct ath_hal *ah, u_in { HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); if ((gpio == AR9382_GPIO_PIN_8_RESERVED) || - (gpio == AR9382_GPIO_PIN_11_RESERVED) || (gpio == AR9382_GPIO_9_INPUT_ONLY)) { return AH_FALSE; @@ -397,8 +394,7 @@ ar9300_gpio_get(struct ath_hal *ah, u_in { u_int32_t gpio_in; HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); - if ((gpio == AR9382_GPIO_PIN_8_RESERVED) || - (gpio == AR9382_GPIO_PIN_11_RESERVED)) + if ((gpio == AR9382_GPIO_PIN_8_RESERVED)) { return 0xffffffff; } @@ -453,7 +449,6 @@ ar9300_gpio_set_intr(struct ath_hal *ah, HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); if ((gpio == AR9382_GPIO_PIN_8_RESERVED) || - (gpio == AR9382_GPIO_PIN_11_RESERVED) || (gpio > AR9382_MAX_GPIO_INPUT_PIN_NUM)) { return; @@ -549,8 +544,7 @@ ar9300_gpio_get_mask(struct ath_hal *ah) if (AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_AR9380_PCIE) { mask = (1 << AR9382_MAX_GPIO_PIN_NUM) - 1; - mask &= ~(1 << AR9382_GPIO_PIN_8_RESERVED | - 1 << AR9382_GPIO_PIN_11_RESERVED); + mask &= ~(1 << AR9382_GPIO_PIN_8_RESERVED); } return mask; } @@ -562,8 +556,7 @@ ar9300_gpio_set_mask(struct ath_hal *ah, if (AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_AR9380_PCIE) { invalid = ~((1 << AR9382_MAX_GPIO_PIN_NUM) - 1); - invalid |= 1 << AR9382_GPIO_PIN_8_RESERVED | - 1 << AR9382_GPIO_PIN_11_RESERVED; + invalid |= 1 << AR9382_GPIO_PIN_8_RESERVED; } if (mask & invalid) { ath_hal_printf(ah, "%s: invalid GPIO mask 0x%x\n", __func__, mask); From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 17:02:52 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39837563; Sat, 14 Feb 2015 17:02: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ACBFA74; Sat, 14 Feb 2015 17:02:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EH2pl6059260; Sat, 14 Feb 2015 17:02:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EH2pVa059259; Sat, 14 Feb 2015 17:02:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201502141702.t1EH2pVa059259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 Feb 2015 17:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278760 - 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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 17:02:52 -0000 Author: jhb Date: Sat Feb 14 17:02:51 2015 New Revision: 278760 URL: https://svnweb.freebsd.org/changeset/base/278760 Log: Add two new counters for vnode life cycle events: - vfs.recycles counts the number of vnodes forcefully recycled to avoid exceeding kern.maxvnodes. - vfs.vnodes_created counts the number of vnodes created by successful calls to getnewvnode(). Differential Revision: https://reviews.freebsd.org/D1671 Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Feb 14 16:23:04 2015 (r278759) +++ head/sys/kern/vfs_subr.c Sat Feb 14 17:02:51 2015 (r278760) @@ -122,6 +122,10 @@ static unsigned long numvnodes; SYSCTL_ULONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, "Number of vnodes in existence"); +static u_long vnodes_created; +SYSCTL_ULONG(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created, + 0, "Number of vnodes created by getnewvnode"); + /* * Conversion tables for conversion from vnode types to inode formats * and back. @@ -156,6 +160,10 @@ static int vlru_allow_cache_src; SYSCTL_INT(_vfs, OID_AUTO, vlru_allow_cache_src, CTLFLAG_RW, &vlru_allow_cache_src, 0, "Allow vlru to reclaim source vnode"); +static u_long recycles_count; +SYSCTL_ULONG(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, 0, + "Number of vnodes recycled to avoid exceding kern.maxvnodes"); + /* * Various variables used for debugging the new implementation of * reassignbuf(). @@ -788,6 +796,7 @@ vlrureclaim(struct mount *mp) } KASSERT((vp->v_iflag & VI_DOOMED) == 0, ("VI_DOOMED unexpectedly detected in vlrureclaim()")); + atomic_add_long(&recycles_count, 1); vgonel(vp); VOP_UNLOCK(vp, 0); vdropl(vp); @@ -988,8 +997,10 @@ vtryrecycle(struct vnode *vp) __func__, vp); return (EBUSY); } - if ((vp->v_iflag & VI_DOOMED) == 0) + if ((vp->v_iflag & VI_DOOMED) == 0) { + atomic_add_long(&recycles_count, 1); vgonel(vp); + } VOP_UNLOCK(vp, LK_INTERLOCK); vn_finished_write(vnmp); return (0); @@ -1093,6 +1104,7 @@ getnewvnode(const char *tag, struct moun atomic_add_long(&numvnodes, 1); mtx_unlock(&vnode_free_list_mtx); alloc: + atomic_add_long(&vnodes_created, 1); vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK|M_ZERO); /* * Setup locks. From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 17:12:32 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A689EB33; Sat, 14 Feb 2015 17:12: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91A45B5D; Sat, 14 Feb 2015 17:12:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EHCWLD064053; Sat, 14 Feb 2015 17:12:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EHCWn9064051; Sat, 14 Feb 2015 17:12:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201502141712.t1EHCWn9064051@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 Feb 2015 17:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278761 - in head: sys/kern usr.bin/gcore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 17:12:32 -0000 Author: jhb Date: Sat Feb 14 17:12:31 2015 New Revision: 278761 URL: https://svnweb.freebsd.org/changeset/base/278761 Log: Include OBJT_PHYS VM objects in ELF core dumps. In particular this includes the shared page allowing debuggers to use the signal trampoline code to identify signal frames in core dumps. Differential Revision: https://reviews.freebsd.org/D1828 Reviewed by: alc, kib MFC after: 1 week Modified: head/sys/kern/imgact_elf.c head/usr.bin/gcore/elfcore.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Feb 14 17:02:51 2015 (r278760) +++ head/sys/kern/imgact_elf.c Sat Feb 14 17:12:31 2015 (r278761) @@ -1401,7 +1401,8 @@ each_writable_segment(td, func, closure) object = backing_object; } ignore_entry = object->type != OBJT_DEFAULT && - object->type != OBJT_SWAP && object->type != OBJT_VNODE; + object->type != OBJT_SWAP && object->type != OBJT_VNODE && + object->type != OBJT_PHYS; VM_OBJECT_RUNLOCK(object); if (ignore_entry) continue; Modified: head/usr.bin/gcore/elfcore.c ============================================================================== --- head/usr.bin/gcore/elfcore.c Sat Feb 14 17:02:51 2015 (r278760) +++ head/usr.bin/gcore/elfcore.c Sat Feb 14 17:12:31 2015 (r278761) @@ -511,7 +511,8 @@ readmap(pid_t pid) ((pflags & PFLAGS_FULL) == 0 && kve->kve_type != KVME_TYPE_DEFAULT && kve->kve_type != KVME_TYPE_VNODE && - kve->kve_type != KVME_TYPE_SWAP)) + kve->kve_type != KVME_TYPE_SWAP && + kve->kve_type != KVME_TYPE_PHYS)) continue; ent = calloc(1, sizeof(*ent)); From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 17:43:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB0FEDC5; Sat, 14 Feb 2015 17:43: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B614DE86; Sat, 14 Feb 2015 17:43:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EHht3T079095; Sat, 14 Feb 2015 17:43:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EHhtOL079094; Sat, 14 Feb 2015 17:43:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502141743.t1EHhtOL079094@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 Feb 2015 17:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278762 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 17:43:55 -0000 Author: adrian Date: Sat Feb 14 17:43:54 2015 New Revision: 278762 URL: https://svnweb.freebsd.org/changeset/base/278762 Log: Quieten a clang warning. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c Sat Feb 14 17:12:31 2015 (r278761) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c Sat Feb 14 17:43:54 2015 (r278762) @@ -394,7 +394,7 @@ ar9300_gpio_get(struct ath_hal *ah, u_in { u_int32_t gpio_in; HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); - if ((gpio == AR9382_GPIO_PIN_8_RESERVED)) + if (gpio == AR9382_GPIO_PIN_8_RESERVED) { return 0xffffffff; } From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 17:44:25 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30FBEEFB; Sat, 14 Feb 2015 17:44: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BC53E8A; Sat, 14 Feb 2015 17:44:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EHiOSb079240; Sat, 14 Feb 2015 17:44:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EHiOu3079239; Sat, 14 Feb 2015 17:44:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502141744.t1EHiOu3079239@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 Feb 2015 17:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278763 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 17:44:25 -0000 Author: adrian Date: Sat Feb 14 17:44:24 2015 New Revision: 278763 URL: https://svnweb.freebsd.org/changeset/base/278763 Log: Comment out a double declaration of this particular function name. It trips up gcc builds. Pointy-hat-from: jenkins, kib Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sat Feb 14 17:43:54 2015 (r278762) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sat Feb 14 17:44:24 2015 (r278763) @@ -1239,7 +1239,9 @@ extern HAL_BOOL ar9300_set_mac_address( extern void ar9300_get_bss_id_mask(struct ath_hal *ah, u_int8_t *mac); extern HAL_BOOL ar9300_set_bss_id_mask(struct ath_hal *, const u_int8_t *); extern HAL_STATUS ar9300_select_ant_config(struct ath_hal *ah, u_int32_t cfg); +#if 0 extern u_int32_t ar9300_ant_ctrl_common_get(struct ath_hal *ah, HAL_BOOL is_2ghz); +#endif extern HAL_BOOL ar9300_ant_swcom_sel(struct ath_hal *ah, u_int8_t ops, u_int32_t *common_tbl1, u_int32_t *common_tbl2); extern HAL_BOOL ar9300_set_regulatory_domain(struct ath_hal *ah, From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 17:45:54 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7FFC1BE; Sat, 14 Feb 2015 17:45: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1F95EA5; Sat, 14 Feb 2015 17:45:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EHjsYK079626; Sat, 14 Feb 2015 17:45:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EHjs3a079624; Sat, 14 Feb 2015 17:45:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502141745.t1EHjs3a079624@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 Feb 2015 17:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278764 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 17:45:55 -0000 Author: adrian Date: Sat Feb 14 17:45:53 2015 New Revision: 278764 URL: https://svnweb.freebsd.org/changeset/base/278764 Log: More fixes to wpi(4), again not by me! Woo! - Use IEEE80211_F_DATAPAD; - (c->ic_flags & IEEE80211_CHAN_PASSIVE) -> IEEE80211_IS_CHAN_PASSIVE(c); - Convert ackfailcnt to int (there is dereference to *(int *) in ieee80211_ratectl_tx_complete()); - Fix & move cleanup to the end in wpi_rx_done(); - Add missed lock in wpi_update_beacon(); - Try to fix powersave. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sat Feb 14 17:44:24 2015 (r278763) +++ head/sys/dev/wpi/if_wpi.c Sat Feb 14 17:45:53 2015 (r278764) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); * * A similar thing happens with the tx rings. The difference is the firmware * stop processing buffers once the queue is full and until confirmation - * of a successful transmition (tx_intr) has occurred. + * of a successful transmition (tx_done) has occurred. * * The command ring operates in the same manner as the tx queues. * @@ -447,6 +447,8 @@ wpi_attach(device_t dev) ic->ic_cryptocaps = IEEE80211_CRYPTO_AES_CCM; + ic->ic_flags |= IEEE80211_F_DATAPAD; + /* * Read in the eeprom and also setup the channels for * net80211. We don't set the rates as net80211 does this for us @@ -1378,8 +1380,7 @@ wpi_read_eeprom_band(struct wpi_softc *s "adding chan %d (%dMHz) flags=0x%x maxpwr=%d passive=%d," " offset %d\n", chan, c->ic_freq, channels[i].flags, sc->maxpwr[chan], - (c->ic_flags & IEEE80211_CHAN_PASSIVE) != 0, - ic->ic_nchans); + IEEE80211_IS_CHAN_PASSIVE(c), ic->ic_nchans); } } @@ -1695,8 +1696,7 @@ wpi_rx_done(struct wpi_softc *sc, struct if (stat->len > WPI_STAT_MAXLEN) { device_printf(sc->sc_dev, "invalid RX statistic header\n"); - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - return; + goto fail1; } bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); @@ -1714,23 +1714,20 @@ wpi_rx_done(struct wpi_softc *sc, struct if ((flags & WPI_RX_NOERROR) != WPI_RX_NOERROR) { DPRINTF(sc, WPI_DEBUG_RECV, "%s: RX flags error %x\n", __func__, flags); - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - return; + goto fail1; } /* Discard frames that are too short. */ if (len < sizeof (*wh)) { DPRINTF(sc, WPI_DEBUG_RECV, "%s: frame too short: %d\n", __func__, len); - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - return; + goto fail1; } m1 = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); if (m1 == NULL) { DPRINTF(sc, WPI_DEBUG_ANY, "%s: no mbuf to restock ring\n", __func__); - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - return; + goto fail1; } bus_dmamap_unload(ring->data_dmat, data->map); @@ -1752,8 +1749,7 @@ wpi_rx_done(struct wpi_softc *sc, struct ring->desc[ring->cur] = htole32(paddr); bus_dmamap_sync(ring->data_dmat, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - return; + goto fail1; } m = data->m; @@ -1777,18 +1773,14 @@ wpi_rx_done(struct wpi_softc *sc, struct if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) && !IEEE80211_IS_MULTICAST(wh->i_addr1) && cip != NULL && cip->ic_cipher == IEEE80211_CIPHER_AES_CCM) { - if ((flags & WPI_RX_CIPHER_MASK) != WPI_RX_CIPHER_CCMP) { - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - m_freem(m); - return; - } + if ((flags & WPI_RX_CIPHER_MASK) != WPI_RX_CIPHER_CCMP) + goto fail2; + /* Check whether decryption was successful or not. */ if ((flags & WPI_RX_DECRYPT_MASK) != WPI_RX_DECRYPT_OK) { DPRINTF(sc, WPI_DEBUG_RECV, "CCMP decryption failed 0x%x\n", flags); - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - m_freem(m); - return; + goto fail2; } m->m_flags |= M_WEP; } @@ -1817,6 +1809,13 @@ wpi_rx_done(struct wpi_softc *sc, struct (void)ieee80211_input_all(ic, m, stat->rssi, -WPI_RSSI_OFFSET); WPI_LOCK(sc); + + return; + +fail2: ieee80211_free_node(ni); + m_freem(m); + +fail1: if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } static void @@ -1836,6 +1835,7 @@ wpi_tx_done(struct wpi_softc *sc, struct struct mbuf *m; struct ieee80211_node *ni; struct ieee80211vap *vap; + int ackfailcnt = stat->ackfailcnt; int status = le32toh(stat->status); KASSERT(data->ni != NULL, ("no node")); @@ -1844,7 +1844,7 @@ wpi_tx_done(struct wpi_softc *sc, struct DPRINTF(sc, WPI_DEBUG_XMIT, "%s: " "qid %d idx %d retries %d btkillcnt %d rate %x duration %d " - "status %x\n", __func__, desc->qid, desc->idx, stat->ackfailcnt, + "status %x\n", __func__, desc->qid, desc->idx, ackfailcnt, stat->btkillcnt, stat->rate, le32toh(stat->duration), status); /* Unmap and free mbuf. */ @@ -1861,11 +1861,11 @@ wpi_tx_done(struct wpi_softc *sc, struct if ((status & 0xff) != 1) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ieee80211_ratectl_tx_complete(vap, ni, - IEEE80211_RATECTL_TX_FAILURE, &stat->ackfailcnt, NULL); + IEEE80211_RATECTL_TX_FAILURE, &ackfailcnt, NULL); } else { if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ieee80211_ratectl_tx_complete(vap, ni, - IEEE80211_RATECTL_TX_SUCCESS, &stat->ackfailcnt, NULL); + IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL); } ieee80211_tx_complete(ni, m, (status & 0xff) != 1); @@ -1931,10 +1931,7 @@ wpi_notif_intr(struct wpi_softc *sc) hw = le32toh(sc->shared->next); hw = (hw == 0) ? WPI_RX_RING_COUNT - 1 : hw - 1; - if (sc->rxq.cur == hw) - return; - - do { + while (sc->rxq.cur != hw) { sc->rxq.cur = (sc->rxq.cur + 1) % WPI_RX_RING_COUNT; struct wpi_rx_data *data = &sc->rxq.data[sc->rxq.cur]; @@ -2020,10 +2017,10 @@ wpi_notif_intr(struct wpi_softc *sc) BUS_DMASYNC_POSTREAD); uint32_t *status = (uint32_t *)(desc + 1); -#ifdef WPI_DEBUG + DPRINTF(sc, WPI_DEBUG_STATE, "state changed to %x\n", le32toh(*status)); -#endif + if (le32toh(*status) & 1) { ieee80211_runtask(ic, &sc->sc_radiooff_task); return; @@ -2061,7 +2058,7 @@ wpi_notif_intr(struct wpi_softc *sc) break; } } - } while (sc->rxq.cur != hw); + } /* Tell the firmware what we have processed. */ wpi_update_rx_ring(sc); @@ -2081,15 +2078,15 @@ wpi_wakeup_intr(struct wpi_softc *sc) /* Wakeup RX and TX rings. */ if (sc->rxq.update) { - wpi_update_rx_ring(sc); sc->rxq.update = 0; + wpi_update_rx_ring(sc); } for (qid = 0; qid < WPI_NTXQUEUES; qid++) { struct wpi_tx_ring *ring = &sc->txq[qid]; if (ring->update) { - wpi_update_tx_ring(sc, ring); ring->update = 0; + wpi_update_tx_ring(sc, ring); } } @@ -2227,6 +2224,8 @@ done: static int wpi_cmd2(struct wpi_softc *sc, struct wpi_buf *buf) { + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_frame *wh; struct wpi_tx_cmd *cmd; struct wpi_tx_data *data; @@ -2234,23 +2233,16 @@ wpi_cmd2(struct wpi_softc *sc, struct wp struct wpi_tx_ring *ring; struct mbuf *m1; bus_dma_segment_t *seg, segs[WPI_MAX_SCATTER]; - u_int hdrlen; - int error, i, nsegs, pad, totlen; + int error, i, hdrspace, nsegs, totlen; WPI_LOCK_ASSERT(sc); DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); wh = mtod(buf->m, struct ieee80211_frame *); - hdrlen = ieee80211_anyhdrsize(wh); + hdrspace = ieee80211_anyhdrspace(ic, wh); totlen = buf->m->m_pkthdr.len; - if (hdrlen & 3) { - /* First segment length must be a multiple of 4. */ - pad = 4 - (hdrlen & 3); - } else - pad = 0; - ring = &sc->txq[buf->ac]; desc = &ring->desc[ring->cur]; data = &ring->data[ring->cur]; @@ -2265,8 +2257,8 @@ wpi_cmd2(struct wpi_softc *sc, struct wp memcpy(cmd->data, buf->data, buf->size); /* Save and trim IEEE802.11 header. */ - memcpy((uint8_t *)(cmd->data + buf->size), wh, hdrlen); - m_adj(buf->m, hdrlen); + memcpy((uint8_t *)(cmd->data + buf->size), wh, hdrspace); + m_adj(buf->m, hdrspace); error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, buf->m, segs, &nsegs, BUS_DMA_NOWAIT); @@ -2304,10 +2296,10 @@ wpi_cmd2(struct wpi_softc *sc, struct wp __func__, ring->qid, ring->cur, totlen, nsegs); /* Fill TX descriptor. */ - desc->nsegs = WPI_PAD32(totlen + pad) << 4 | (1 + nsegs); + desc->nsegs = WPI_PAD32(totlen) << 4 | (1 + nsegs); /* First DMA segment is used by the TX command. */ desc->segs[0].addr = htole32(data->cmd_paddr); - desc->segs[0].len = htole32(4 + buf->size + hdrlen + pad); + desc->segs[0].len = htole32(4 + buf->size + hdrspace); /* Other DMA segments are for data payload. */ seg = &segs[0]; for (i = 1; i <= nsegs; i++) { @@ -2353,9 +2345,10 @@ wpi_tx_data(struct wpi_softc *sc, struct uint32_t flags; uint16_t qos; uint8_t tid, type; - int ac, error, rate, ismcast, totlen; + int ac, error, rate, ismcast, hdrlen, totlen; wh = mtod(m, struct ieee80211_frame *); + hdrlen = ieee80211_anyhdrsize(wh); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); @@ -2399,12 +2392,12 @@ wpi_tx_data(struct wpi_softc *sc, struct /* 802.11 header may have moved. */ wh = mtod(m, struct ieee80211_frame *); } - totlen = m->m_pkthdr.len; + totlen = m->m_pkthdr.len - (hdrlen & 3); if (ieee80211_radiotap_active_vap(vap)) { struct wpi_tx_radiotap_header *tap = &sc->sc_txtap; - tap->wt_flags = 0; + tap->wt_flags = IEEE80211_RADIOTAP_F_DATAPAD; tap->wt_rate = rate; if (k != NULL) tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; @@ -2420,6 +2413,9 @@ wpi_tx_data(struct wpi_softc *sc, struct flags |= WPI_TX_NEED_ACK; } + if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) + flags |= WPI_TX_MORE_FRAG; /* Cannot happen yet. */ + /* Check if frame must be protected using RTS/CTS or CTS-to-self. */ if (!ismcast) { /* NB: Group frames are sent using CCK in 802.11b/g. */ @@ -2518,11 +2514,12 @@ wpi_tx_data_raw(struct wpi_softc *sc, st struct wpi_buf tx_data; uint32_t flags; uint8_t type; - int ac, rate, totlen; + int ac, rate, hdrlen, totlen; wh = mtod(m, struct ieee80211_frame *); + hdrlen = ieee80211_anyhdrsize(wh); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; - totlen = m->m_pkthdr.len; + totlen = m->m_pkthdr.len - (hdrlen & 3); ac = params->ibp_pri & 3; @@ -2544,6 +2541,8 @@ wpi_tx_data_raw(struct wpi_softc *sc, st tap->wt_flags = 0; tap->wt_rate = rate; + if (params->ibp_flags & IEEE80211_BPF_DATAPAD) + tap->wt_flags |= IEEE80211_RADIOTAP_F_DATAPAD; ieee80211_radiotap_tx(vap, m); } @@ -3434,31 +3433,28 @@ wpi_config(struct wpi_softc *sc) if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); + sc->rxon.filter = WPI_FILTER_MULTICAST; switch (ic->ic_opmode) { case IEEE80211_M_STA: sc->rxon.mode = WPI_MODE_STA; - sc->rxon.filter = htole32(WPI_FILTER_MULTICAST); break; case IEEE80211_M_IBSS: sc->rxon.mode = WPI_MODE_IBSS; - sc->rxon.filter = htole32(WPI_FILTER_BEACON | - WPI_FILTER_MULTICAST); + sc->rxon.filter |= WPI_FILTER_BEACON; break; /* XXX workaround for passive channels selection */ case IEEE80211_M_AHDEMO: - sc->rxon.filter = htole32(WPI_FILTER_MULTICAST); - /* FALLTHROUGH */ case IEEE80211_M_HOSTAP: sc->rxon.mode = WPI_MODE_HOSTAP; break; case IEEE80211_M_MONITOR: sc->rxon.mode = WPI_MODE_MONITOR; - sc->rxon.filter = htole32(WPI_FILTER_MULTICAST); break; default: device_printf(sc->sc_dev, "unknown opmode %d\n", ic->ic_opmode); return EINVAL; } + sc->rxon.filter = htole32(sc->rxon.filter); wpi_set_promisc(sc); sc->rxon.cck_mask = 0x0f; /* not yet negotiated */ sc->rxon.ofdm_mask = 0xff; /* not yet negotiated */ @@ -3677,7 +3673,7 @@ wpi_scan(struct wpi_softc *sc, struct ie } else hdr->crc_threshold = WPI_SCAN_CRC_TH_NEVER; - if (!(c->ic_flags & IEEE80211_CHAN_PASSIVE)) + if (!IEEE80211_IS_CHAN_PASSIVE(c)) chan->flags |= WPI_CHAN_ACTIVE; /* @@ -3702,7 +3698,7 @@ wpi_scan(struct wpi_softc *sc, struct ie chan->rf_gain = 0x28; DPRINTF(sc, WPI_DEBUG_SCAN, "Scanning %u Passive: %d\n", - chan->chan, (c->ic_flags & IEEE80211_CHAN_PASSIVE) ? 1 : 0); + chan->chan, IEEE80211_IS_CHAN_PASSIVE(c)); hdr->nchan++; chan++; @@ -3838,11 +3834,13 @@ wpi_update_beacon(struct ieee80211vap *v struct wpi_softc *sc = ifp->if_softc; int error; + WPI_LOCK(sc); if ((error = wpi_setup_beacon(sc, ni)) != 0) { device_printf(sc->sc_dev, "%s: could not update beacon frame, error %d", __func__, error); } + WPI_UNLOCK(sc); } static int @@ -3939,6 +3937,8 @@ wpi_run(struct wpi_softc *sc, struct iee /* Enable power-saving mode if requested by user. */ if (vap->iv_flags & IEEE80211_F_PMGTON) (void)wpi_set_pslevel(sc, 0, 3, 1); + else + (void)wpi_set_pslevel(sc, 0, 0, 1); DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); @@ -4384,6 +4384,8 @@ wpi_apm_init(struct wpi_softc *sc) DELAY(20); /* Disable L1-Active. */ wpi_prph_setbits(sc, WPI_APMG_PCI_STT, WPI_APMG_PCI_STT_L1A_DIS); + /* ??? */ + wpi_prph_clrbits(sc, WPI_APMG_PS, 0x00000E00); wpi_nic_unlock(sc); return 0; Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sat Feb 14 17:44:24 2015 (r278763) +++ head/sys/dev/wpi/if_wpireg.h Sat Feb 14 17:45:53 2015 (r278764) @@ -470,6 +470,7 @@ struct wpi_cmd_data { #define WPI_TX_FULL_TXOP (1 << 7) #define WPI_TX_BT_DISABLE (1 << 12) /* bluetooth coexistence */ #define WPI_TX_AUTO_SEQ (1 << 13) +#define WPI_TX_MORE_FRAG (1 << 14) #define WPI_TX_INSERT_TSTAMP (1 << 16) uint8_t plcp; @@ -964,11 +965,6 @@ static const char * const wpi_fw_errmsg[ "FATAL_ERROR" }; -/* XXX description for some error codes (error data). */ -/* 0x00000074 - wrong totlen field */ -/* 0x000003B3 - powersave error */ -/* 0x00000447 - wrong channel selected */ - #define WPI_READ(sc, reg) \ bus_space_read_4((sc)->sc_st, (sc)->sc_sh, (reg)) From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 18:14:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0668C05; Sat, 14 Feb 2015 18:14: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71E151F1; Sat, 14 Feb 2015 18:14:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EIEkeF094301; Sat, 14 Feb 2015 18:14:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EIEkIA094300; Sat, 14 Feb 2015 18:14:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502141814.t1EIEkIA094300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 Feb 2015 18:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278765 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 18:14:46 -0000 Author: adrian Date: Sat Feb 14 18:14:45 2015 New Revision: 278765 URL: https://svnweb.freebsd.org/changeset/base/278765 Log: Move the lock destruction/creation to earlier in the process - if interrupts are enabled and the NIC is awake (think: loading a module) then there's a not-quite-zero window where we'll get an interrupt for the device before the attach method is called to finish setting up the hardware. Since I grab locks in ath_intr() to check various things, the locks need to be ready much earlier. Modified: head/sys/dev/ath/if_ath_pci.c Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Sat Feb 14 17:45:53 2015 (r278764) +++ head/sys/dev/ath/if_ath_pci.c Sat Feb 14 18:14:45 2015 (r278765) @@ -279,6 +279,13 @@ ath_pci_attach(device_t dev) */ sc->sc_invalid = 1; + ATH_LOCK_INIT(sc); + ATH_PCU_LOCK_INIT(sc); + ATH_RX_LOCK_INIT(sc); + ATH_TX_LOCK_INIT(sc); + ATH_TX_IC_LOCK_INIT(sc); + ATH_TXSTATUS_LOCK_INIT(sc); + /* * Arrange interrupt line. */ @@ -329,7 +336,7 @@ ath_pci_attach(device_t dev) if (fw == NULL) { device_printf(dev, "%s: couldn't find firmware\n", __func__); - goto bad3; + goto bad4; } device_printf(dev, "%s: EEPROM firmware @ %p\n", @@ -339,30 +346,20 @@ ath_pci_attach(device_t dev) if (! sc->sc_eepromdata) { device_printf(dev, "%s: can't malloc eepromdata\n", __func__); - goto bad3; + goto bad4; } memcpy(sc->sc_eepromdata, fw->data, fw->datasize); firmware_put(fw, 0); } #endif /* ATH_EEPROM_FIRMWARE */ - ATH_LOCK_INIT(sc); - ATH_PCU_LOCK_INIT(sc); - ATH_RX_LOCK_INIT(sc); - ATH_TX_LOCK_INIT(sc); - ATH_TX_IC_LOCK_INIT(sc); - ATH_TXSTATUS_LOCK_INIT(sc); - error = ath_attach(pci_get_device(dev), sc); if (error == 0) /* success */ return 0; - ATH_TXSTATUS_LOCK_DESTROY(sc); - ATH_PCU_LOCK_DESTROY(sc); - ATH_RX_LOCK_DESTROY(sc); - ATH_TX_IC_LOCK_DESTROY(sc); - ATH_TX_LOCK_DESTROY(sc); - ATH_LOCK_DESTROY(sc); +#ifdef ATH_EEPROM_FIRMWARE +bad4: +#endif bus_dma_tag_destroy(sc->sc_dmat); bad3: bus_teardown_intr(dev, psc->sc_irq, psc->sc_ih); @@ -370,6 +367,14 @@ bad2: bus_release_resource(dev, SYS_RES_IRQ, 0, psc->sc_irq); bad1: bus_release_resource(dev, SYS_RES_MEMORY, BS_BAR, psc->sc_sr); + + ATH_TXSTATUS_LOCK_DESTROY(sc); + ATH_PCU_LOCK_DESTROY(sc); + ATH_RX_LOCK_DESTROY(sc); + ATH_TX_IC_LOCK_DESTROY(sc); + ATH_TX_LOCK_DESTROY(sc); + ATH_LOCK_DESTROY(sc); + bad: return (error); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 18:15:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57F13E78; Sat, 14 Feb 2015 18:15:18 +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)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 828821FD; Sat, 14 Feb 2015 18:15:16 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1EIF9Vl038685 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Feb 2015 21:15:09 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1EIF8sR038684; Sat, 14 Feb 2015 21:15:08 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Feb 2015 21:15:08 +0300 From: Gleb Smirnoff To: Bruce Evans Subject: Re: svn commit: r278737 - head/usr.sbin/flowctl Message-ID: <20150214181508.GL15484@FreeBSD.org> References: <201502132357.t1DNvKda075915@svn.freebsd.org> <20150214193210.N945@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150214193210.N945@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 18:15:18 -0000 Bruce, On Sat, Feb 14, 2015 at 08:46:58PM +1100, Bruce Evans wrote: B> Using VLAs and also the C99 feature of declarations anwhere, and extensions B> like __aligned(), we can almost implement a full alloca() using the fixed B> version of this change: B> B> /* B> * XXX need extended statement-expression so that __buf doesn't go out B> * of scope after the right brace. B> */ B> #define my_alloca(n) __extension__ ({ B> /* XXX need unique name. */ \ B> char __buf[__roundup2((n), MUMBLE)] __aligned(MUMBLE); \ B> \ B> (void *)__buf; \ B> }) I like this idea. But would this exact code work? The life of __buf is limited by the code block, and we exit the block immediately. Wouldn't the allocation be overwritten if we enter any function or block later? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 18:15:15 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98032D97; Sat, 14 Feb 2015 18:15: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83FDF1FB; Sat, 14 Feb 2015 18:15:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EIFFeF094458; Sat, 14 Feb 2015 18:15:15 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EIFFqk094457; Sat, 14 Feb 2015 18:15:15 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201502141815.t1EIFFqk094457@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 14 Feb 2015 18:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278766 - 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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 18:15:15 -0000 Author: hrs Date: Sat Feb 14 18:15:14 2015 New Revision: 278766 URL: https://svnweb.freebsd.org/changeset/base/278766 Log: Fix a panic when tearing down a vnet on a VIMAGE-enabled kernel. There was a race that bridge_ifdetach() could be called via ifnet_departure event handler after vnet_bridge_uninit(). PR: 195859 Reported by: Danilo Egea Gondolfo Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Sat Feb 14 18:14:45 2015 (r278765) +++ head/sys/net/if_bridge.c Sat Feb 14 18:15:14 2015 (r278766) @@ -228,7 +228,7 @@ struct bridge_softc { static VNET_DEFINE(struct mtx, bridge_list_mtx); #define V_bridge_list_mtx VNET(bridge_list_mtx) -eventhandler_tag bridge_detach_cookie = NULL; +static eventhandler_tag bridge_detach_cookie; int bridge_rtable_prune_period = BRIDGE_RTABLE_PRUNE_PERIOD; @@ -538,6 +538,7 @@ vnet_bridge_uninit(const void *unused __ { if_clone_detach(V_bridge_cloner); + V_bridge_cloner = NULL; BRIDGE_LIST_LOCK_DESTROY(); } VNET_SYSUNINIT(vnet_bridge_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, @@ -1797,7 +1798,13 @@ bridge_ifdetach(void *arg __unused, stru if (ifp->if_flags & IFF_RENAMING) return; - + if (V_bridge_cloner == NULL) { + /* + * This detach handler can be called after + * vnet_bridge_uninit(). Just return in that case. + */ + return; + } /* Check if the interface is a bridge member */ if (sc != NULL) { BRIDGE_LOCK(sc); From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 18:18:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 574211D3; Sat, 14 Feb 2015 18:18:06 +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)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D04BF234; Sat, 14 Feb 2015 18:18:05 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1EII3Ew038710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 14 Feb 2015 21:18:03 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1EII34o038709; Sat, 14 Feb 2015 21:18:03 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Feb 2015 21:18:03 +0300 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r278760 - head/sys/kern Message-ID: <20150214181803.GM15484@FreeBSD.org> References: <201502141702.t1EH2pVa059259@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502141702.t1EH2pVa059259@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 18:18:06 -0000 On Sat, Feb 14, 2015 at 05:02:51PM +0000, John Baldwin wrote: J> Author: jhb J> Date: Sat Feb 14 17:02:51 2015 J> New Revision: 278760 J> URL: https://svnweb.freebsd.org/changeset/base/278760 J> J> Log: J> Add two new counters for vnode life cycle events: J> - vfs.recycles counts the number of vnodes forcefully recycled to avoid J> exceeding kern.maxvnodes. J> - vfs.vnodes_created counts the number of vnodes created by successful J> calls to getnewvnode(). J> J> Differential Revision: https://reviews.freebsd.org/D1671 J> Reviewed by: kib J> MFC after: 1 week Why don't use counter(9) for that? Would avoid atomics. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 18:21:15 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4CF9433; Sat, 14 Feb 2015 18:21:15 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67AD525C; Sat, 14 Feb 2015 18:21:15 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id x12so12515853wgg.11; Sat, 14 Feb 2015 10:21:13 -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=5iV2LmV3M+FshKX3yaf633P+k0kW2S2x+gcjoamBjmI=; b=UFpQCcru7Kyh/VrM20xJzGUzJppW0T3MB2VqXQAnqPBGcW0ZdqwvxS+NvRGcF0nxBn aRReCIpl975jJkFvGapu5fCTEfTzUbBfgV96tcBh23ja34IE7Lr5JS1vXBgKN9+/xJcl yTGYpgYWKiLvYYmLpt976MyooNxALog2IUZcmOjNfszQ47wQbS1qBzUMjboj3SQQax0K fkoAhisu0sR+H3QdQbkqSI6X0KpFhTYSK7+hwldRilK0QjkBondQnXLL3q4IqCST+e1Q 92X1t0jyPpsks8Ydmv/wqOeeHB5oCVNNJdokWmhVFrxeFdg+yP19UbwPFXbaKM9t7lA1 AAtA== X-Received: by 10.194.110.69 with SMTP id hy5mr32705546wjb.121.1423938073785; Sat, 14 Feb 2015 10:21:13 -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 fa3sm7972159wib.17.2015.02.14.10.21.12 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 14 Feb 2015 10:21:12 -0800 (PST) Date: Sat, 14 Feb 2015 19:21:10 +0100 From: Mateusz Guzik To: John Baldwin Subject: Re: svn commit: r278760 - head/sys/kern Message-ID: <20150214182109.GC18597@dft-labs.eu> References: <201502141702.t1EH2pVa059259@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201502141702.t1EH2pVa059259@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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 18:21:15 -0000 On Sat, Feb 14, 2015 at 05:02:51PM +0000, John Baldwin wrote: > +SYSCTL_ULONG(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created, > + 0, "Number of vnodes created by getnewvnode"); > + [..] > +static u_long recycles_count; > +SYSCTL_ULONG(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, 0, > + "Number of vnodes recycled to avoid exceding kern.maxvnodes"); > + CTLFLAG_MPSAFE? -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 18:22:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED467573; Sat, 14 Feb 2015 18:22: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D92F731E; Sat, 14 Feb 2015 18:22:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EIMWk0099159; Sat, 14 Feb 2015 18:22:32 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EIMWMu099158; Sat, 14 Feb 2015 18:22:32 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201502141822.t1EIMWMu099158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 14 Feb 2015 18:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278767 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 18:22:33 -0000 Author: brd (doc committer) Date: Sat Feb 14 18:22:31 2015 New Revision: 278767 URL: https://svnweb.freebsd.org/changeset/base/278767 Log: Remove an extra curly bracket that was causing intermittent failures. PR: 197612 Submitted by: Robert O'Niel Approved by: will Modified: head/usr.sbin/pw/tests/pw_usernext.sh Modified: head/usr.sbin/pw/tests/pw_usernext.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_usernext.sh Sat Feb 14 18:15:14 2015 (r278766) +++ head/usr.sbin/pw/tests/pw_usernext.sh Sat Feb 14 18:22:31 2015 (r278767) @@ -32,7 +32,7 @@ usernext_assigned_group_body() { atf_check -s exit:0 ${PW} useradd -n test$var0 -g 0 var0=`expr $var0 + 1` done - atf_check -s exit:0 -o match:"100${LIMIT}:1001}" \ + atf_check -s exit:0 -o match:"100${LIMIT}:1001" \ ${PW} usernext } From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 18:33:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9038FADB; Sat, 14 Feb 2015 18:33:56 +0000 (UTC) Received: from pmta2.delivery5.ore.mailhop.org (pmta2.delivery5.ore.mailhop.org [54.186.218.12]) by mx1.freebsd.org (Postfix) with ESMTP id 6CF7E60E; Sat, 14 Feb 2015 18:33:56 +0000 (UTC) Received: from smtp7.ore.mailhop.org (172.31.36.112) by pmta2.delivery1.ore.mailhop.org id hruahq20u50c; Sat, 14 Feb 2015 18:33:59 +0000 (envelope-from ) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp7.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YMhXK-0001ut-SJ; Sat, 14 Feb 2015 18:33:50 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t1EIXm0H014934; Sat, 14 Feb 2015 11:33:48 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+xqzchXH8jXc+AH5A4KqYa Message-ID: <1423938828.80968.148.camel@freebsd.org> Subject: Re: svn commit: r278737 - head/usr.sbin/flowctl From: Ian Lepore To: Gleb Smirnoff Date: Sat, 14 Feb 2015 11:33:48 -0700 In-Reply-To: <20150214181508.GL15484@FreeBSD.org> References: <201502132357.t1DNvKda075915@svn.freebsd.org> <20150214193210.N945@besplex.bde.org> <20150214181508.GL15484@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 18:33:56 -0000 On Sat, 2015-02-14 at 21:15 +0300, Gleb Smirnoff wrote: > Bruce, > > On Sat, Feb 14, 2015 at 08:46:58PM +1100, Bruce Evans wrote: > B> Using VLAs and also the C99 feature of declarations anwhere, and extensions > B> like __aligned(), we can almost implement a full alloca() using the fixed > B> version of this change: > B> > B> /* > B> * XXX need extended statement-expression so that __buf doesn't go out > B> * of scope after the right brace. > B> */ > B> #define my_alloca(n) __extension__ ({ > B> /* XXX need unique name. */ \ > B> char __buf[__roundup2((n), MUMBLE)] __aligned(MUMBLE); \ > B> \ > B> (void *)__buf; \ > B> }) > > I like this idea. But would this exact code work? The life of > __buf is limited by the code block, and we exit the block > immediately. Wouldn't the allocation be overwritten if we > enter any function or block later? > Why put any effort into avoiding alloca() in the first place? Is it inefficient on some platforms? On arm it's like 5 instructions, it just adjusts the size to keep the stack dword-aligned and subtracts the result from sp, done. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 18:54:53 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A9D32A4; Sat, 14 Feb 2015 18:54: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 720C282F; Sat, 14 Feb 2015 18:54:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EIsr6i014454; Sat, 14 Feb 2015 18:54:53 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EIsr7B014453; Sat, 14 Feb 2015 18:54:53 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201502141854.t1EIsr7B014453@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Feb 2015 18:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278770 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 18:54:53 -0000 Author: ian Date: Sat Feb 14 18:54:52 2015 New Revision: 278770 URL: https://svnweb.freebsd.org/changeset/base/278770 Log: Add logic for handling new-style ARM cpu ID info. Submitted by: Michal Meloun Modified: head/sys/arm/arm/cpuinfo.c Modified: head/sys/arm/arm/cpuinfo.c ============================================================================== --- head/sys/arm/arm/cpuinfo.c Sat Feb 14 18:45:43 2015 (r278769) +++ head/sys/arm/arm/cpuinfo.c Sat Feb 14 18:54:52 2015 (r278770) @@ -58,9 +58,13 @@ cpuinfo_init(void) /* ARMv4T CPU */ cpuinfo.architecture = 1; cpuinfo.revision = (cpuinfo.midr >> 16) & 0x7F; - } + } else { + /* ARM new id scheme */ + cpuinfo.architecture = (cpuinfo.midr >> 16) & 0x0F; + cpuinfo.revision = (cpuinfo.midr >> 20) & 0x0F; + } } else { - /* must be new id scheme */ + /* non ARM -> must be new id scheme */ cpuinfo.architecture = (cpuinfo.midr >> 16) & 0x0F; cpuinfo.revision = (cpuinfo.midr >> 20) & 0x0F; } From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 18:59:32 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BD8E852; Sat, 14 Feb 2015 18:59: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77619873; Sat, 14 Feb 2015 18:59:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EIxWxV015567; Sat, 14 Feb 2015 18:59:32 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EIxWaf015566; Sat, 14 Feb 2015 18:59:32 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201502141859.t1EIxWaf015566@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sat, 14 Feb 2015 18:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278773 - 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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 18:59:32 -0000 Author: luigi Date: Sat Feb 14 18:59:31 2015 New Revision: 278773 URL: https://svnweb.freebsd.org/changeset/base/278773 Log: whitespace change: clarify the role of MAKEDEV_ETERNAL_KLD, and remove an old #ifdef __FreeBSD__ since the code is valid on all platforms. Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Sat Feb 14 18:57:02 2015 (r278772) +++ head/sys/dev/netmap/netmap.c Sat Feb 14 18:59:31 2015 (r278773) @@ -3071,16 +3071,14 @@ netmap_init(void) error = netmap_mem_init(); if (error != 0) goto fail; - /* XXX could use make_dev_credv() to get error number */ -#ifdef __FreeBSD__ - /* support for the 'eternal' flag */ + /* + * MAKEDEV_ETERNAL_KLD avoids an expensive check on syscalls + * when the module is compiled in. + * XXX could use make_dev_credv() to get error number + */ netmap_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &netmap_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0600, "netmap"); -#else - netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "netmap"); -#endif if (!netmap_dev) goto fail; From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 19:03:12 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3BFDA2F; Sat, 14 Feb 2015 19:03: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EE52922; Sat, 14 Feb 2015 19:03:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EJ3CQx019607; Sat, 14 Feb 2015 19:03:12 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EJ3CwD019606; Sat, 14 Feb 2015 19:03:12 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201502141903.t1EJ3CwD019606@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sat, 14 Feb 2015 19:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278774 - 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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 19:03:12 -0000 Author: luigi Date: Sat Feb 14 19:03:11 2015 New Revision: 278774 URL: https://svnweb.freebsd.org/changeset/base/278774 Log: two minor changes from the master netmap version: 1. handle errors from nm_config(), if any (none of the FreeBSD drivers currently returns an error on this function, so this change is a no-op at this time 2. use a full memory barrier on ioctls Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Sat Feb 14 18:59:31 2015 (r278773) +++ head/sys/dev/netmap/netmap.c Sat Feb 14 19:03:11 2015 (r278774) @@ -656,9 +656,8 @@ netmap_update_config(struct netmap_adapt u_int txr, txd, rxr, rxd; txr = txd = rxr = rxd = 0; - if (na->nm_config) { - na->nm_config(na, &txr, &txd, &rxr, &rxd); - } else { + if (na->nm_config == NULL || + na->nm_config(na, &txr, &txd, &rxr, &rxd)) { /* take whatever we had at init time */ txr = na->num_tx_rings; txd = na->num_tx_desc; @@ -2168,7 +2167,7 @@ netmap_ioctl(struct cdev *dev, u_long cm error = ENXIO; break; } - rmb(); /* make sure following reads are not from cache */ + mb(); /* make sure following reads are not from cache */ na = priv->np_na; /* we have a reference */ From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 19:21:05 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0225C3C9; Sat, 14 Feb 2015 19:21: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E14EFA51; Sat, 14 Feb 2015 19:21:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EJL4Ih027009; Sat, 14 Feb 2015 19:21:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EJL420027008; Sat, 14 Feb 2015 19:21:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502141921.t1EJL420027008@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 Feb 2015 19:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278776 - head/bin/pkill/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 19:21:05 -0000 Author: ngie Date: Sat Feb 14 19:21:04 2015 New Revision: 278776 URL: https://svnweb.freebsd.org/changeset/base/278776 Log: Refactor pkill-j_test to reflect the relevant changes done to pgrep-j_test r278742: Simplify jail_name_to_jid and try to be more fault tolerant when scanning for the jail ID (poll up to 10 times for the jail IDs to become available) If the scan fails, the code will fall through and fail as it does with Jenkins today r278636: Parameterize out the amount of sleep done in each test Set the value in each test to a different amount to avoid potential side-effects with other instances of the test (or lingering processes) still being present on the system r278633: Refactor the tests 1. `id -u` -> 0 is now only checked once; the entire test script is now skipped if this assertion is violated 2. De-dent whitespace, based on 1. 3. Only setup the symlink for $sleep once at the top of the script, and tear it down once at the bottom of the script Modified: head/bin/pkill/tests/pkill-j_test.sh Modified: head/bin/pkill/tests/pkill-j_test.sh ============================================================================== --- head/bin/pkill/tests/pkill-j_test.sh Sat Feb 14 19:18:56 2015 (r278775) +++ head/bin/pkill/tests/pkill-j_test.sh Sat Feb 14 19:21:04 2015 (r278776) @@ -4,99 +4,90 @@ jail_name_to_jid() { local check_name="$1" - ( - line="$(jls -n 2> /dev/null | grep name=$check_name )" - for nv in $line; do - local name="${nv%=*}" - if [ "${name}" = "jid" ]; then - eval $nv - echo $jid - break - fi - done - ) + jls -j "$check_name" -s 2>/dev/null | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g' } base=pkill_j_test +if [ `id -u` -ne 0 ]; then + echo "1..0 # skip Test needs uid 0." + exit 0 +fi + echo "1..3" +sleep=$(pwd)/sleep.txt +ln -sf /bin/sleep $sleep + name="pkill -j " -if [ `id -u` -eq 0 ]; then - sleep=$(pwd)/sleep.txt - ln -sf /bin/sleep $sleep - jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_1_1.pid $sleep 5 & +sleep_amount=5 +jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & + +jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount & - jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_1_2.pid $sleep 5 & +$sleep $sleep_amount & - $sleep 5 & - sleep 0.5 +for i in `seq 1 10`; do jid1=$(jail_name_to_jid ${base}_1_1) jid2=$(jail_name_to_jid ${base}_1_2) jid="${jid1},${jid2}" - if pkill -f -j "$jid" $sleep && sleep 0.5 && - ! -f ${PWD}/${base}_1_1.pid && - ! -f ${PWD}/${base}_1_2.pid ; then - echo "ok 1 - $name" - else - echo "not ok 1 - $name" - fi 2>/dev/null - rm -f $sleep - [ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) - [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) - wait + case "$jid" in + [0-9]+,[0-9]+) + break + ;; + esac + sleep 0.1 +done + +if pkill -f -j "$jid" $sleep && sleep 0.5 && + ! -f ${PWD}/${base}_1_1.pid && + ! -f ${PWD}/${base}_1_2.pid ; then + echo "ok 1 - $name" else - echo "ok 1 - $name # skip Test needs uid 0." -fi + echo "not ok 1 - $name" +fi 2>/dev/null +[ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) +[ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) +wait name="pkill -j any" -if [ `id -u` -eq 0 ]; then - sleep=$(pwd)/sleep.txt - ln -sf /bin/sleep $sleep - jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_2_1.pid $sleep 5 & - - jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_2_2.pid $sleep 5 & - - $sleep 5 & - sleep 0.5 - chpid3=$! - if pkill -f -j any $sleep && sleep 0.5 && - [ ! -f ${PWD}/${base}_2_1.pid -a - ! -f ${PWD}/${base}_2_2.pid ] && kill $chpid3; then - echo "ok 2 - $name" - else - echo "not ok 2 - $name" - fi 2>/dev/null - rm -f $sleep - [ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) - [ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) - wait +sleep_amount=6 +jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & + +jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_2_2.pid $sleep $sleep_amount & + +$sleep $sleep_amount & +chpid3=$! +sleep 0.5 +if pkill -f -j any $sleep && sleep 0.5 && + [ ! -f ${PWD}/${base}_2_1.pid -a + ! -f ${PWD}/${base}_2_2.pid ] && kill $chpid3; then + echo "ok 2 - $name" else - echo "ok 2 - $name # skip Test needs uid 0." -fi + echo "not ok 2 - $name" +fi 2>/dev/null +[ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) +[ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) +wait name="pkill -j none" -if [ `id -u` -eq 0 ]; then - sleep=$(pwd)/sleep.txt - ln -sf /bin/sleep $sleep - daemon -p ${PWD}/${base}_3_1.pid $sleep 5 - jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_3_2.pid $sleep 5 & - sleep 1 - if pkill -f -j none "$sleep 5" && sleep 1 && - [ ! -f ${PWD}/${base}_3_1.pid -a -f ${PWD}/${base}_3_2.pid ] ; then - echo "ok 3 - $name" - else - ls ${PWD}/*.pid - echo "not ok 3 - $name" - fi 2>/dev/null - rm -f $sleep - [ -f ${PWD}/${base}_3_1.pid ] && kill $(cat ${base}_3_1.pid) - [ -f ${PWD}/${base}_3_2.pid ] && kill $(cat ${base}_3_2.pid) +sleep_amount=7 +daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount +jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount & +sleep 1 +if pkill -f -j none "$sleep $sleep_amount" && sleep 1 && + [ ! -f ${PWD}/${base}_3_1.pid -a -f ${PWD}/${base}_3_2.pid ] ; then + echo "ok 3 - $name" else - echo "ok 3 - $name # skip Test needs uid 0." -fi + ls ${PWD}/*.pid + echo "not ok 3 - $name" +fi 2>/dev/null +[ -f ${PWD}/${base}_3_1.pid ] && kill $(cat ${base}_3_1.pid) +[ -f ${PWD}/${base}_3_2.pid ] && kill $(cat ${base}_3_2.pid) + +rm -f $sleep From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 19:59:48 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E2E049D for ; Sat, 14 Feb 2015 19:59:48 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEE6AE14 for ; Sat, 14 Feb 2015 19:59:47 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EJxlPg063128 for ; Sat, 14 Feb 2015 19:59:47 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t1EJxlV2063127 for svn-src-head@freebsd.org; Sat, 14 Feb 2015 19:59:47 GMT (envelope-from bdrewery) Received: (qmail 14765 invoked from network); 14 Feb 2015 13:59:43 -0600 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 14 Feb 2015 13:59:43 -0600 Message-ID: <54DFA938.6020207@FreeBSD.org> Date: Sat, 14 Feb 2015 13:59:52 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Steven Hartland , phabric-admin@FreeBSD.org Subject: Re: Phabricator + 'Reviewed by' [was Re: svn commit: r278472 - in head/sys: netinet netinet6] References: <201502091928.t19JSC5P066293@svn.freebsd.org> <38B8D2D0-862A-4DF5-9479-8EC234CF830B@FreeBSD.org> <54DE8F32.2090500@FreeBSD.org> <54DF6709.6030204@freebsd.org> In-Reply-To: <54DF6709.6030204@freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="71KaNec92cajp8T0dhVfr0IlJNwmc4jqa" Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 19:59:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --71KaNec92cajp8T0dhVfr0IlJNwmc4jqa Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/14/2015 9:17 AM, Steven Hartland wrote: >=20 > On 13/02/2015 23:56, Bryan Drewery wrote: >> On 2/9/2015 3:45 PM, Bjoern A. Zeeb wrote: >>>> Commented upon by hiren and sbruno >>>> See Phabricator D1777 for more details. >>>> >>>> Commented upon by hiren and sbruno >>>> Reviewed by: adrian, jhb and bz >>> I have not reviewed this; as a matter of fact you are aware that I >>> still wanted to do that. >>> >> Something about Phabricator is not jiving with our commit terminology.= >> This has happened before as well with other commits. I'm sure everyone= >> is good-intentioned as well. >> >> There's not 1 person on D1777 who has 'accepted' it. That is what >> warrants a 'Reviewed by' to me. >> >> It's clear to me, but seems unclear to others. I really think the >> reviewer list needs to be split up. Rather than using icons, use >> separate lists. Reviewers requested: accepted: commented: changes >> requested:. > I don't think it needs to be split up, that feels unnecessary, if > someone hasn't accepted it then they haven't review it period IMO. Yes I too think it's obvious, yet I've seen at least 2 commits where the reviewed by line was essentially a lie. It's in SVN forever now with those names stamped as reviewers. --=20 Regards, Bryan Drewery --71KaNec92cajp8T0dhVfr0IlJNwmc4jqa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJU36k4AAoJEDXXcbtuRpfPrisIALypNR5Xg4JeqeVwkRtogT/I p+gD7vk/HUNA5hg/wrin8nRB4pIKnikASihy5SnD99Wf5aS8a+Xl+rVbpyIrWtNY xrTswaA5i6TF6/Um0rJN0D5RNnL95W/33t5IcqsBBFb4peYRipqh+q9/YO7xV76N T9bAHHMsMWdoe818LKD8rdEjIbNh02m/xhrjp1BQ3dZ+bWYDKMG/PI9kRGKc1owH LMZQfsl8U0F5yQOfnVAn06kWELcqQqMhggzZGdh+4UwXLpXFndswrLgJHef8YO+d dbm8Ni++GQ/vg2GfiPjw/DmTRDmIl/i6MB8MiErbW824v93d2vBAjgT3qY6pCjo= =JhPT -----END PGP SIGNATURE----- --71KaNec92cajp8T0dhVfr0IlJNwmc4jqa-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 20:00:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1203150B for ; Sat, 14 Feb 2015 20:00:01 +0000 (UTC) Received: from nm42-vm5.bullet.mail.bf1.yahoo.com (nm42-vm5.bullet.mail.bf1.yahoo.com [216.109.114.204]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AABB0E1F for ; Sat, 14 Feb 2015 20:00:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1423943615; bh=P/VRe0WNcfdKswkuKcSBu3P2dJBNoC45UJvkuYvZlq8=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=kVcDHGoTf2y1HI8uO8EO5BZALVa6jkTTeFxs7J+HCfTR8YWpPsIbm9nYK0Xqh+GoVLBw55n7Tg3hzFHhdlQ83HP+JeSIT27ODuLgAcE8mJKnN7MLmuCzCHWCYZS0owKSjWXLr0m8KcVElpeTOU69XmpN8Dpyn3Sj6cFT6ZUR3wxf7zHGVe4luZPea4bmhciKttXTadHCP5V6SaM0Vs/HIYWHhMT6J3wQ+PQByicr6hhSXOst43rI3RpftDsvdKRRB+x9Rr4WGquyqi1BdUu6rEUtpsh7x1INz9xNgdvCK2Xo/wguL56i53vDygv9jz4Qz8Ue6ScyFFCE+63Msp4AUQ== Received: from [98.139.215.143] by nm42.bullet.mail.bf1.yahoo.com with NNFMP; 14 Feb 2015 19:53:35 -0000 Received: from [98.139.211.193] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 14 Feb 2015 19:53:35 -0000 Received: from [127.0.0.1] by smtp202.mail.bf1.yahoo.com with NNFMP; 14 Feb 2015 19:53:35 -0000 X-Yahoo-Newman-Id: 110902.27848.bm@smtp202.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Lr_6tcYVM1kaD7hfE0412MM1Vgpfv_Yn3W5X_eB3zFtGqhb 7z9vxqDnYAiqn6fuvNWRwjELmM56.8R8w4tB7mLTGpVc9onpqAHCrRsSWKWS pGAD.3ICP1mcXDNU5Oi.gUY4xFV7Ak7_0emNZkGlB3IwTphyamuba4lKqqML hbPD3uu7z0tqTxe1qnckm4wLePgJLXPfSY4fZJ.j22bFzqIEhsQ7DmjYVP_b LpKCTkGW3aQ0iEHTuNupdPt1vUEmAZmB_MJ3mH3Ee9pM9nVr0f1R16bFfqWE b5fk_z3f2jDWsNDr9s2eRTVqxqjRq.OoCVcxadGNJwa0PLqc_uqg5SdBVmnf eKpFaqwX..jBhCCdaTYtGVvV7St6j6.pT3LnN.Ubw3332mqLqiwRoAvrEPlH tulvTxqSLLD9H9vg6iHfA_h6BWdz5pRaReMtaOYggYGx_kUQcLoigo3tUt6j UqShRk.Wd.e.ByeRVc_zhI83Rxh.q2rB66VhKKFwkzs0Eux916hTgMy8GS5C EhK3ywGQ5BHbTUqj9QndfJmmoN6hNat9D X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54DFA7CC.20305@FreeBSD.org> Date: Sat, 14 Feb 2015 14:53:48 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ian Lepore , Gleb Smirnoff Subject: Re: svn commit: r278737 - head/usr.sbin/flowctl References: <201502132357.t1DNvKda075915@svn.freebsd.org> <20150214193210.N945@besplex.bde.org> <20150214181508.GL15484@FreeBSD.org> <1423938828.80968.148.camel@freebsd.org> In-Reply-To: <1423938828.80968.148.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 20:00:01 -0000 On 02/14/15 13:33, Ian Lepore wrote: > On Sat, 2015-02-14 at 21:15 +0300, Gleb Smirnoff wrote: >> Bruce, >> >> On Sat, Feb 14, 2015 at 08:46:58PM +1100, Bruce Evans wrote: >> B> Using VLAs and also the C99 feature of declarations anwhere, and extensions >> B> like __aligned(), we can almost implement a full alloca() using the fixed >> B> version of this change: >> B> >> B> /* >> B> * XXX need extended statement-expression so that __buf doesn't go out >> B> * of scope after the right brace. >> B> */ >> B> #define my_alloca(n) __extension__ ({ >> B> /* XXX need unique name. */ \ >> B> char __buf[__roundup2((n), MUMBLE)] __aligned(MUMBLE); \ >> B> \ >> B> (void *)__buf; \ >> B> }) >> >> I like this idea. But would this exact code work? The life of >> __buf is limited by the code block, and we exit the block >> immediately. Wouldn't the allocation be overwritten if we >> enter any function or block later? >> > Why put any effort into avoiding alloca() in the first place? Is it > inefficient on some platforms? On arm it's like 5 instructions, it just > adjusts the size to keep the stack dword-aligned and subtracts the > result from sp, done. Because it's non-standard and the alloca(3) man page discourages it: _____ ... BUGS The alloca() function is machine and compiler dependent; its use is dis- couraged. ____ It is not disappearing anytime soon though, some even say the man page is wrong. Pedro. From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 20:00:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22A4B89F; Sat, 14 Feb 2015 20:00: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E319E47; Sat, 14 Feb 2015 20:00:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EK0v3W047469; Sat, 14 Feb 2015 20:00:57 GMT (envelope-from davide@FreeBSD.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EK0v8B047468; Sat, 14 Feb 2015 20:00:57 GMT (envelope-from davide@FreeBSD.org) Message-Id: <201502142000.t1EK0v8B047468@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davide set sender to davide@FreeBSD.org using -f From: Davide Italiano Date: Sat, 14 Feb 2015 20:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278780 - 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.18-1 Precedence: list List-Id: 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, 14 Feb 2015 20:00:58 -0000 Author: davide Date: Sat Feb 14 20:00:57 2015 New Revision: 278780 URL: https://svnweb.freebsd.org/changeset/base/278780 Log: Don't access sockbuf fields directly, use accessor functions instead. It is safe to move the call to socantsendmore_locked() after sbdrop_locked() as long as we hold the sockbuf lock across the two calls. CR: D1805 Reviewed by: adrian, kmacy, julian, rwatson Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Feb 14 19:41:26 2015 (r278779) +++ head/sys/kern/uipc_socket.c Sat Feb 14 20:00:57 2015 (r278780) @@ -3439,11 +3439,9 @@ soisdisconnecting(struct socket *so) SOCKBUF_LOCK(&so->so_rcv); so->so_state &= ~SS_ISCONNECTING; so->so_state |= SS_ISDISCONNECTING; - so->so_rcv.sb_state |= SBS_CANTRCVMORE; - sorwakeup_locked(so); + socantrcvmore_locked(so); SOCKBUF_LOCK(&so->so_snd); - so->so_snd.sb_state |= SBS_CANTSENDMORE; - sowwakeup_locked(so); + socantsendmore_locked(so); wakeup(&so->so_timeo); } @@ -3458,12 +3456,10 @@ soisdisconnected(struct socket *so) SOCKBUF_LOCK(&so->so_rcv); so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); so->so_state |= SS_ISDISCONNECTED; - so->so_rcv.sb_state |= SBS_CANTRCVMORE; - sorwakeup_locked(so); + socantrcvmore_locked(so); SOCKBUF_LOCK(&so->so_snd); - so->so_snd.sb_state |= SBS_CANTSENDMORE; sbdrop_locked(&so->so_snd, sbused(&so->so_snd)); - sowwakeup_locked(so); + socantsendmore_locked(so); wakeup(&so->so_timeo); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 20:09:15 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8A32E2D; Sat, 14 Feb 2015 20:09:15 +0000 (UTC) Received: from pmta1.delivery8.ore.mailhop.org (pmta1.delivery8.ore.mailhop.org [54.191.158.99]) by mx1.freebsd.org (Postfix) with ESMTP id B170BF57; Sat, 14 Feb 2015 20:09:15 +0000 (UTC) Received: from smtp3.ore.mailhop.org (172.31.36.112) by pmta1.delivery1.ore.mailhop.org id hrulm220r840; Sat, 14 Feb 2015 20:08:57 +0000 (envelope-from ) Received: from [73.34.117.227] (helo=ilsoft.org) by smtp3.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YMj1X-0002pl-Jr; Sat, 14 Feb 2015 20:09:07 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t1EK9639015469; Sat, 14 Feb 2015 13:09:06 -0700 (MST) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX18qxpACM1e16AyJMbHyVzhm Message-ID: <1423944546.80968.151.camel@freebsd.org> Subject: Re: Phabricator + 'Reviewed by' [was Re: svn commit: r278472 - in head/sys: netinet netinet6] From: Ian Lepore To: Bryan Drewery Date: Sat, 14 Feb 2015 13:09:06 -0700 In-Reply-To: <54DFA938.6020207@FreeBSD.org> References: <201502091928.t19JSC5P066293@svn.freebsd.org> <38B8D2D0-862A-4DF5-9479-8EC234CF830B@FreeBSD.org> <54DE8F32.2090500@FreeBSD.org> <54DF6709.6030204@freebsd.org> <54DFA938.6020207@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.8 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Steven Hartland , svn-src-all@freebsd.org, phabric-admin@FreeBSD.org, Randall Stewart , "Bjoern A. Zeeb" , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 20:09:16 -0000 On Sat, 2015-02-14 at 13:59 -0600, Bryan Drewery wrote: > On 2/14/2015 9:17 AM, Steven Hartland wrote: > > > > On 13/02/2015 23:56, Bryan Drewery wrote: > >> On 2/9/2015 3:45 PM, Bjoern A. Zeeb wrote: > >>>> Commented upon by hiren and sbruno > >>>> See Phabricator D1777 for more details. > >>>> > >>>> Commented upon by hiren and sbruno > >>>> Reviewed by: adrian, jhb and bz > >>> I have not reviewed this; as a matter of fact you are aware that I > >>> still wanted to do that. > >>> > >> Something about Phabricator is not jiving with our commit terminology. > >> This has happened before as well with other commits. I'm sure everyone > >> is good-intentioned as well. > >> > >> There's not 1 person on D1777 who has 'accepted' it. That is what > >> warrants a 'Reviewed by' to me. > >> > >> It's clear to me, but seems unclear to others. I really think the > >> reviewer list needs to be split up. Rather than using icons, use > >> separate lists. Reviewers requested: accepted: commented: changes > >> requested:. > > I don't think it needs to be split up, that feels unnecessary, if > > someone hasn't accepted it then they haven't review it period IMO. > > Yes I too think it's obvious, yet I've seen at least 2 commits where the > reviewed by line was essentially a lie. It's in SVN forever now with > those names stamped as reviewers. > You make that sound like some sort of huge crisis, but we have glitches in commit messages (occasionally even a missing/empty message) from time to time, and life goes on. Phabricator is supposed to be a tool to make our lives better and easier, but it could all too easily turn into a stick to hit people with, and the first step on that path is making a bunch of rigid formal rules and procedures. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 22:12:19 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71A70475; Sat, 14 Feb 2015 22:12: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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BE15D71; Sat, 14 Feb 2015 22:12:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1EMCJlt013408; Sat, 14 Feb 2015 22:12:19 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1EMCI8w013399; Sat, 14 Feb 2015 22:12:18 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201502142212.t1EMCI8w013399@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Sat, 14 Feb 2015 22:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278787 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 14 Feb 2015 22:12:19 -0000 Author: grembo (ports committer) Date: Sat Feb 14 22:12:17 2015 New Revision: 278787 URL: https://svnweb.freebsd.org/changeset/base/278787 Log: Quirk based support of Chromebook keyboard found in Acer C720 This probably supports other devices based on SeaBIOS, which need to be added to the smbios based quirks table. The functionality has been ported from DragonFlyBSD and adapted to FreeBSD's more general purpose environment. Devices not covered by a quirk shouldn't be affected at all. Thanks to jhb and kostikbel for reviewing the code. Reviewed by: kostikbel, jhb Approved by: jhb, kostikbel Differential Revision: https://reviews.freebsd.org/D1802 Modified: head/sys/dev/atkbdc/atkbd.c head/sys/dev/atkbdc/atkbdc.c head/sys/dev/atkbdc/atkbdcreg.h head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Sat Feb 14 21:16:19 2015 (r278786) +++ head/sys/dev/atkbdc/atkbd.c Sat Feb 14 22:12:17 2015 (r278787) @@ -77,6 +77,10 @@ typedef struct atkbd_state { static void atkbd_timeout(void *arg); static void atkbd_shutdown_final(void *v); +static int atkbd_reset(KBDC kbdc, int flags, int c); + +#define HAS_QUIRK(p, q) (((atkbdc_softc_t *)(p))->quirks & q) +#define ALLOW_DISABLE_KBD(kbdc) !HAS_QUIRK(kbdc, KBDC_QUIRK_KEEP_ACTIVATED) int atkbd_probe_unit(device_t dev, int irq, int flags) @@ -1095,6 +1099,39 @@ atkbd_shutdown_final(void *v) #endif } +static int +atkbd_reset(KBDC kbdc, int flags, int c) +{ + /* reset keyboard hardware */ + if (!(flags & KB_CONF_NO_RESET) && !reset_kbd(kbdc)) { + /* + * KEYBOARD ERROR + * Keyboard reset may fail either because the keyboard + * doen't exist, or because the keyboard doesn't pass + * the self-test, or the keyboard controller on the + * motherboard and the keyboard somehow fail to shake hands. + * It is just possible, particularly in the last case, + * that the keyboard controller may be left in a hung state. + * test_controller() and test_kbd_port() appear to bring + * the keyboard controller back (I don't know why and how, + * though.) + */ + empty_both_buffers(kbdc, 10); + test_controller(kbdc); + test_kbd_port(kbdc); + /* + * We could disable the keyboard port and interrupt... but, + * the keyboard may still exist (see above). + */ + set_controller_command_byte(kbdc, + ALLOW_DISABLE_KBD(kbdc) ? 0xff : KBD_KBD_CONTROL_BITS, c); + if (bootverbose) + printf("atkbd: failed to reset the keyboard.\n"); + return (EIO); + } + return (0); +} + /* local functions */ static int @@ -1250,13 +1287,14 @@ probe_keyboard(KBDC kbdc, int flags) kbdc_set_device_mask(kbdc, m | KBD_KBD_CONTROL_BITS); } else { /* try to restore the command byte as before */ - set_controller_command_byte(kbdc, 0xff, c); + set_controller_command_byte(kbdc, + ALLOW_DISABLE_KBD(kbdc) ? 0xff : KBD_KBD_CONTROL_BITS, c); kbdc_set_device_mask(kbdc, m); } #endif kbdc_lock(kbdc, FALSE); - return err; + return (HAS_QUIRK(kbdc, KBDC_QUIRK_IGNORE_PROBE_RESULT) ? 0 : err); } static int @@ -1299,6 +1337,12 @@ init_keyboard(KBDC kbdc, int *type, int return EIO; } + if (HAS_QUIRK(kbdc, KBDC_QUIRK_RESET_AFTER_PROBE) && + atkbd_reset(kbdc, flags, c)) { + kbdc_lock(kbdc, FALSE); + return EIO; + } + /* * Check if we have an XT keyboard before we attempt to reset it. * The procedure assumes that the keyboard and the controller have @@ -1343,31 +1387,9 @@ init_keyboard(KBDC kbdc, int *type, int if (bootverbose) printf("atkbd: keyboard ID 0x%x (%d)\n", id, *type); - /* reset keyboard hardware */ - if (!(flags & KB_CONF_NO_RESET) && !reset_kbd(kbdc)) { - /* - * KEYBOARD ERROR - * Keyboard reset may fail either because the keyboard - * doen't exist, or because the keyboard doesn't pass - * the self-test, or the keyboard controller on the - * motherboard and the keyboard somehow fail to shake hands. - * It is just possible, particularly in the last case, - * that the keyboard controller may be left in a hung state. - * test_controller() and test_kbd_port() appear to bring - * the keyboard controller back (I don't know why and how, - * though.) - */ - empty_both_buffers(kbdc, 10); - test_controller(kbdc); - test_kbd_port(kbdc); - /* - * We could disable the keyboard port and interrupt... but, - * the keyboard may still exist (see above). - */ - set_controller_command_byte(kbdc, 0xff, c); + if (!HAS_QUIRK(kbdc, KBDC_QUIRK_RESET_AFTER_PROBE) && + atkbd_reset(kbdc, flags, c)) { kbdc_lock(kbdc, FALSE); - if (bootverbose) - printf("atkbd: failed to reset the keyboard.\n"); return EIO; } @@ -1387,7 +1409,8 @@ init_keyboard(KBDC kbdc, int *type, int * The XT kbd isn't usable unless the proper scan * code set is selected. */ - set_controller_command_byte(kbdc, 0xff, c); + set_controller_command_byte(kbdc, ALLOW_DISABLE_KBD(kbdc) + ? 0xff : KBD_KBD_CONTROL_BITS, c); kbdc_lock(kbdc, FALSE); printf("atkbd: unable to set the XT keyboard mode.\n"); return EIO; @@ -1402,6 +1425,17 @@ init_keyboard(KBDC kbdc, int *type, int c |= KBD_TRANSLATION; #endif + /* + * Some keyboards require a SETLEDS command to be sent after + * the reset command before they will send keystrokes to us + */ + if (HAS_QUIRK(kbdc, KBDC_QUIRK_SETLEDS_ON_INIT) && + send_kbd_command_and_data(kbdc, KBDC_SET_LEDS, 0) != KBD_ACK) { + printf("atkbd: setleds failed\n"); + } + if (!ALLOW_DISABLE_KBD(kbdc)) + send_kbd_command(kbdc, KBDC_ENABLE_KBD); + /* enable the keyboard port and intr. */ if (!set_controller_command_byte(kbdc, KBD_KBD_CONTROL_BITS | KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK, @@ -1412,7 +1446,9 @@ init_keyboard(KBDC kbdc, int *type, int * This is serious; we are left with the disabled * keyboard intr. */ - set_controller_command_byte(kbdc, 0xff, c); + set_controller_command_byte(kbdc, ALLOW_DISABLE_KBD(kbdc) + ? 0xff : (KBD_KBD_CONTROL_BITS | KBD_TRANSLATION | + KBD_OVERRIDE_KBD_LOCK), c); kbdc_lock(kbdc, FALSE); printf("atkbd: unable to enable the keyboard port and intr.\n"); return EIO; Modified: head/sys/dev/atkbdc/atkbdc.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc.c Sat Feb 14 21:16:19 2015 (r278786) +++ head/sys/dev/atkbdc/atkbdc.c Sat Feb 14 22:12:17 2015 (r278787) @@ -114,6 +114,41 @@ static int wait_for_kbd_ack(atkbdc_softc static int wait_for_aux_data(atkbdc_softc_t *kbdc); static int wait_for_aux_ack(atkbdc_softc_t *kbdc); +struct atkbdc_quirks { + const char* bios_vendor; + const char* maker; + const char* product; + int quirk; +}; + +static struct atkbdc_quirks quirks[] = { + {"coreboot", "Acer", "Peppy", + KBDC_QUIRK_KEEP_ACTIVATED | KBDC_QUIRK_IGNORE_PROBE_RESULT | + KBDC_QUIRK_RESET_AFTER_PROBE | KBDC_QUIRK_SETLEDS_ON_INIT}, + + {NULL, NULL, NULL, 0} +}; + +#define QUIRK_STR_MATCH(s1, s2) (s1 == NULL || \ + (s2 != NULL && !strcmp(s1, s2))) + +static int +atkbdc_getquirks(void) +{ + int i; + char* bios_vendor = kern_getenv("smbios.bios.vendor"); + char* maker = kern_getenv("smbios.system.maker"); + char* product = kern_getenv("smbios.system.product"); + + for (i=0; quirks[i].quirk != 0; ++i) + if (QUIRK_STR_MATCH(quirks[i].bios_vendor, bios_vendor) && + QUIRK_STR_MATCH(quirks[i].maker, maker) && + QUIRK_STR_MATCH(quirks[i].product, product)) + return (quirks[i].quirk); + + return (0); +} + atkbdc_softc_t *atkbdc_get_softc(int unit) { @@ -295,6 +330,7 @@ atkbdc_setup(atkbdc_softc_t *sc, bus_spa #else sc->retry = 5000; #endif + sc->quirks = atkbdc_getquirks(); return 0; } @@ -1124,7 +1160,8 @@ void kbdc_set_device_mask(KBDC p, int mask) { kbdcp(p)->command_mask = - mask & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS); + mask & (((kbdcp(p)->quirks & KBDC_QUIRK_KEEP_ACTIVATED) + ? 0 : KBD_KBD_CONTROL_BITS) | KBD_AUX_CONTROL_BITS); } int Modified: head/sys/dev/atkbdc/atkbdcreg.h ============================================================================== --- head/sys/dev/atkbdc/atkbdcreg.h Sat Feb 14 21:16:19 2015 (r278786) +++ head/sys/dev/atkbdc/atkbdcreg.h Sat Feb 14 22:12:17 2015 (r278787) @@ -202,6 +202,11 @@ typedef struct atkbdc_softc { kqueue kbd; /* keyboard data queue */ kqueue aux; /* auxiliary data queue */ int retry; + int quirks; /* controller doesn't like deactivate */ +#define KBDC_QUIRK_KEEP_ACTIVATED (1 << 0) +#define KBDC_QUIRK_IGNORE_PROBE_RESULT (1 << 1) +#define KBDC_QUIRK_RESET_AFTER_PROBE (1 << 2) +#define KBDC_QUIRK_SETLEDS_ON_INIT (1 << 3) } atkbdc_softc_t; enum kbdc_device_ivar { Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Feb 14 21:16:19 2015 (r278786) +++ head/sys/dev/atkbdc/psm.c Sat Feb 14 22:12:17 2015 (r278787) @@ -371,6 +371,10 @@ static devclass_t psm_devclass; /* other flags (flags) */ #define PSM_FLAGS_FINGERDOWN 0x0001 /* VersaPad finger down */ +#define kbdcp(p) ((atkbdc_softc_t *)(p)) +#define ALWAYS_RESTORE_CONTROLLER(kbdc) !(kbdcp(kbdc)->quirks \ + & KBDC_QUIRK_KEEP_ACTIVATED) + /* Tunables */ static int tap_enabled = -1; TUNABLE_INT("hw.psm.tap_enabled", &tap_enabled); @@ -1231,7 +1235,8 @@ psmprobe(device_t dev) * this is CONTROLLER ERROR; I don't know how to recover * from this error... */ - restore_controller(sc->kbdc, command_byte); + if (ALWAYS_RESTORE_CONTROLLER(sc->kbdc)) + restore_controller(sc->kbdc, command_byte); printf("psm%d: unable to set the command byte.\n", unit); endprobe(ENXIO); } @@ -1270,7 +1275,8 @@ psmprobe(device_t dev) recover_from_error(sc->kbdc); if (sc->config & PSM_CONFIG_IGNPORTERROR) break; - restore_controller(sc->kbdc, command_byte); + if (ALWAYS_RESTORE_CONTROLLER(sc->kbdc)) + restore_controller(sc->kbdc, command_byte); if (verbose) printf("psm%d: the aux port is not functioning (%d).\n", unit, i); @@ -1293,7 +1299,8 @@ psmprobe(device_t dev) */ if (!reset_aux_dev(sc->kbdc)) { recover_from_error(sc->kbdc); - restore_controller(sc->kbdc, command_byte); + if (ALWAYS_RESTORE_CONTROLLER(sc->kbdc)) + restore_controller(sc->kbdc, command_byte); if (verbose) printf("psm%d: failed to reset the aux " "device.\n", unit); @@ -1315,7 +1322,8 @@ psmprobe(device_t dev) if (!enable_aux_dev(sc->kbdc) || !disable_aux_dev(sc->kbdc)) { /* MOUSE ERROR */ recover_from_error(sc->kbdc); - restore_controller(sc->kbdc, command_byte); + if (ALWAYS_RESTORE_CONTROLLER(sc->kbdc)) + restore_controller(sc->kbdc, command_byte); if (verbose) printf("psm%d: failed to enable the aux device.\n", unit); @@ -1337,7 +1345,8 @@ psmprobe(device_t dev) /* verify the device is a mouse */ sc->hw.hwid = get_aux_id(sc->kbdc); if (!is_a_mouse(sc->hw.hwid)) { - restore_controller(sc->kbdc, command_byte); + if (ALWAYS_RESTORE_CONTROLLER(sc->kbdc)) + restore_controller(sc->kbdc, command_byte); if (verbose) printf("psm%d: unknown device type (%d).\n", unit, sc->hw.hwid); @@ -1443,7 +1452,8 @@ psmprobe(device_t dev) * this is CONTROLLER ERROR; I don't know the proper way to * recover from this error... */ - restore_controller(sc->kbdc, command_byte); + if (ALWAYS_RESTORE_CONTROLLER(sc->kbdc)) + restore_controller(sc->kbdc, command_byte); printf("psm%d: unable to set the command byte.\n", unit); endprobe(ENXIO); }