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: ,