From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 00:45:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BA3CDAD; Sun, 28 Apr 2013 00:45:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90F2C10E7; Sun, 28 Apr 2013 00:45:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S0jnZO041906; Sun, 28 Apr 2013 00:45:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S0jnAF041905; Sun, 28 Apr 2013 00:45:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304280045.r3S0jnAF041905@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Apr 2013 00:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r250002 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:45:49 -0000 Author: adrian Date: Sun Apr 28 00:45:48 2013 New Revision: 250002 URL: http://svnweb.freebsd.org/changeset/base/250002 Log: Temporarily bump this. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sat Apr 27 23:59:15 2013 (r250001) +++ svnadmin/conf/sizelimit.conf Sun Apr 28 00:45:48 2013 (r250002) @@ -35,3 +35,4 @@ rwatson sam stas thompsa +adrian From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 00:46:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0B1A61BA; Sun, 28 Apr 2013 00:46:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EEE0A10E8; Sun, 28 Apr 2013 00:45:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S0jxlq041974; Sun, 28 Apr 2013 00:45:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S0jxjO041967; Sun, 28 Apr 2013 00:45:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304280045.r3S0jxjO041967@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Apr 2013 00:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250003 - in vendor/qcamain_open_hal: . dist dist/hal dist/hal/ar9300 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:46:00 -0000 Author: adrian Date: Sun Apr 28 00:45:58 2013 New Revision: 250003 URL: http://svnweb.freebsd.org/changeset/base/250003 Log: Initial import of the QCA qcamain_open_hal repository. Source: https://github.com/qca/qcamain_open_hal_public Revision: 60390a9f9ac6a20db168fbbc01a4ad4e01c395ce Thankyou to QCA for this release. Added: vendor/qcamain_open_hal/ vendor/qcamain_open_hal/dist/ vendor/qcamain_open_hal/dist/LICENCE.TXT vendor/qcamain_open_hal/dist/NOTICE.TXT vendor/qcamain_open_hal/dist/README vendor/qcamain_open_hal/dist/hal/ vendor/qcamain_open_hal/dist/hal/ar9300/ vendor/qcamain_open_hal/dist/hal/ar9300/ar9300.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_aic.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_ani.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_aphrodite10.ini vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_attach.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_beacon.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_eeprom.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_gpio.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_interrupts.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_jupiter10.ini vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_jupiter20.ini vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_keycache.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_mci.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_misc.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_osprey22.ini vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_osprey22_scoemu.ini vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_paprd.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_phy.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_power.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_radar.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_radio.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_raw_adc_capture.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_recv.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_recv_ds.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_reset.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_rtt.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_sim.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_sim.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_spectral.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_timer.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_tx99_tgt.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_txbf.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_txbf.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_txbf_cal.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_xmit.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300_xmit_ds.c vendor/qcamain_open_hal/dist/hal/ar9300/ar9300desc.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300eep.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300paprd.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300phy.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300radar.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300reg.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_ap121.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_aphrodite.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_cus157.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_generic.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_hb112.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_hb116.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_osprey_k31.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_wasp_2.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_wasp_k31.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_xb112.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9300template_xb113.h vendor/qcamain_open_hal/dist/hal/ar9300/ar9330_11.ini vendor/qcamain_open_hal/dist/hal/ar9300/ar9330_12.ini (contents, props changed) vendor/qcamain_open_hal/dist/hal/ar9300/ar9340.ini vendor/qcamain_open_hal/dist/hal/ar9300/ar9485.ini vendor/qcamain_open_hal/dist/hal/ar9300/ar9485_1_1.ini vendor/qcamain_open_hal/dist/hal/ar9300/ar955x.ini vendor/qcamain_open_hal/dist/hal/ar9300/ar9580.ini vendor/qcamain_open_hal/dist/hal/ar9300/eeprom.diff vendor/qcamain_open_hal/dist/hal/ar9300/osprey_reg_map.h vendor/qcamain_open_hal/dist/hal/ar9300/osprey_reg_map_macro.h vendor/qcamain_open_hal/dist/hal/ar9300/poseidon_reg_map_macro.h vendor/qcamain_open_hal/dist/hal/ar9300/scorpion_reg_map.h vendor/qcamain_open_hal/dist/hal/ar9300/scorpion_reg_map_macro.h vendor/qcamain_open_hal/dist/hal/ar9300/sources vendor/qcamain_open_hal/dist/hal/ar9300/wasp_reg_map.h Added: vendor/qcamain_open_hal/dist/LICENCE.TXT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/qcamain_open_hal/dist/LICENCE.TXT Sun Apr 28 00:45:58 2013 (r250003) @@ -0,0 +1,13 @@ +Copyright (c) 2013 Qualcomm Atheros, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. Added: vendor/qcamain_open_hal/dist/NOTICE.TXT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/qcamain_open_hal/dist/NOTICE.TXT Sun Apr 28 00:45:58 2013 (r250003) @@ -0,0 +1,72 @@ +This NOTICE.TXT file contains certain notices of software components included +with the software that QUALCOMM ATHEROS Incorporated ('Qualcomm Atheros') is +required to provide you. Notwithstanding anything in the notices in this file, +your use of these software components together with the Qualcomm Atheros +software (Qualcomm Atheros software hereinafter referred to as 'Software') is +subject to the terms of your license from Qualcomm Atheros. Compliance with +all copyright laws and software license agreements included in the notice +section of this file are the responsibility of the user. Except as may be +granted by separate express written agreement, this file provides no license +to any Qualcomm Atheros patents, trademarks, copyrights, or other intellectual +property. + +Copyright (c) 2013 QUALCOMM ATHEROS Incorporated. All rights reserved. + +QUALCOMM ATHEROS® is a registered trademark and registered service mark of +QUALCOMM ATHEROS Incorporated. All other trademarks and service marks are +the property of their respective owners. + +NOTICES: + +/* + * Copyright (c) 2005-2012 Atheros Communications Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2005 Atheros Communications, Inc. + * Copyright (c) 2008-2010, Atheros Communications Inc. + * + * Redistribution and use in source and binary forms are permitted + * provided that the following conditions are met: + * 1. The materials contained herein are unmodified and are used + * unmodified. + * 2. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following NO + * ''WARRANTY'' disclaimer below (''Disclaimer''), without + * modification. + * 3. Redistributions in binary form must reproduce at minimum a + * disclaimer similar to the Disclaimer below and any redistribution + * must be conditioned upon including a substantially similar + * Disclaimer requirement for further binary redistribution. + * 4. Neither the names of the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote + * product derived from this software without specific prior written + * permission. + * + * NO WARRANTY + * 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 NONINFRINGEMENT, + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE + * FOR 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 DAMAGES. + */ Added: vendor/qcamain_open_hal/dist/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/qcamain_open_hal/dist/README Sun Apr 28 00:45:58 2013 (r250003) @@ -0,0 +1,23 @@ +This is a public version of the AR9300 HAL, suitable for open source +development. + + +What is this? +------------- + +This is a public version of the QCA mainline (10.x) development HAL. +It has a few notable changes: + +* The boolean types have been converted back to the HAL types + (HAL_BOOL, AH_TRUE / AH_FALSE) to aid integration into the existing + open source Atheros HAL drivers; + +* Some features have been removed from this HAL. + +However, this is essentially the same HAL which is used in QCA development +and forms the basis for public releases from the 10.x mainline. + +Subsequent HAL releases will be committed on top of this release in order +to provide developers with a simple change history they can use when +doing branch merging. + Added: vendor/qcamain_open_hal/dist/hal/ar9300/ar9300.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/qcamain_open_hal/dist/hal/ar9300/ar9300.h Sun Apr 28 00:45:58 2013 (r250003) @@ -0,0 +1,1641 @@ +/* + * Copyright (c) 2013 Qualcomm Atheros, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _ATH_AR9300_H_ +#define _ATH_AR9300_H_ + +#include "ah_internal.h" +#include "ah_eeprom.h" +#include "ah_devid.h" +#include "ar9300eep.h" /* For Eeprom definitions */ +#include "asf_amem.h" + + +#define AR9300_MAGIC 0x19741014 + + +/* MAC register values */ + +#define INIT_CONFIG_STATUS 0x00000000 +#define INIT_RSSI_THR 0x7 /* Missed beacon counter initialized to 0x7 (max is 0xff) */ +#define INIT_RSSI_BEACON_WEIGHT 8 /* ave beacon rssi weight (0-16) */ + +/* + * Various fifo fill before Tx start, in 64-byte units + * i.e. put the frame in the air while still DMAing + */ +#define MIN_TX_FIFO_THRESHOLD 0x1 +#define MAX_TX_FIFO_THRESHOLD (( 4096 / 64) - 1) +#define INIT_TX_FIFO_THRESHOLD MIN_TX_FIFO_THRESHOLD + + #define CHANSEL_DIV 15 + #define FCLK 40 + +#define COEFF ((FCLK * 5) / 2) +#define CHANSEL_2G(_freq) (((_freq) * 0x10000) / CHANSEL_DIV) +#define CHANSEL_5G(_freq) (((_freq) * 0x8000) / CHANSEL_DIV) +#define CHANSEL_5G_DOT5MHZ 2188 + +/* + * Receive Queue Fifo depth. + */ +enum RX_FIFO_DEPTH { + HAL_HP_RXFIFO_DEPTH = 16, + HAL_LP_RXFIFO_DEPTH = 128, +}; + +/* + * Gain support. + */ +#define NUM_CORNER_FIX_BITS_2133 7 +#define CCK_OFDM_GAIN_DELTA 15 + +enum GAIN_PARAMS { + GP_TXCLIP, + GP_PD90, + GP_PD84, + GP_GSEL +}; + +enum GAIN_PARAMS_2133 { + GP_MIXGAIN_OVR, + GP_PWD_138, + GP_PWD_137, + GP_PWD_136, + GP_PWD_132, + GP_PWD_131, + GP_PWD_130, +}; + +enum { + HAL_RESET_POWER_ON, + HAL_RESET_WARM, + HAL_RESET_COLD, +}; + +typedef struct _gain_opt_step { + int16_t paramVal[NUM_CORNER_FIX_BITS_2133]; + int32_t stepGain; + int8_t stepName[16]; +} GAIN_OPTIMIZATION_STEP; + +typedef struct { + u_int32_t numStepsInLadder; + u_int32_t defaultStepNum; + GAIN_OPTIMIZATION_STEP optStep[10]; +} GAIN_OPTIMIZATION_LADDER; + +typedef struct { + u_int32_t currStepNum; + u_int32_t currGain; + u_int32_t targetGain; + u_int32_t loTrig; + u_int32_t hiTrig; + u_int32_t gainFCorrection; + u_int32_t active; + GAIN_OPTIMIZATION_STEP *curr_step; +} GAIN_VALUES; + +typedef struct { + u_int16_t synth_center; + u_int16_t ctl_center; + u_int16_t ext_center; +} CHAN_CENTERS; + +/* RF HAL structures */ +typedef struct rf_hal_funcs { + HAL_BOOL (*set_channel)(struct ath_hal *, HAL_CHANNEL_INTERNAL *); + HAL_BOOL (*get_chip_power_lim)(struct ath_hal *ah, HAL_CHANNEL *chans, + u_int32_t nchancs); +} RF_HAL_FUNCS; + +struct ar9300_ani_default { + u_int16_t m1_thresh_low; + u_int16_t m2_thresh_low; + u_int16_t m1_thresh; + u_int16_t m2_thresh; + u_int16_t m2_count_thr; + u_int16_t m2_count_thr_low; + u_int16_t m1_thresh_low_ext; + u_int16_t m2_thresh_low_ext; + u_int16_t m1_thresh_ext; + u_int16_t m2_thresh_ext; + u_int16_t firstep; + u_int16_t firstep_low; + u_int16_t cycpwr_thr1; + u_int16_t cycpwr_thr1_ext; +}; + +/* + * Per-channel ANI state private to the driver. + */ +struct ar9300_ani_state { + HAL_CHANNEL c; + HAL_BOOL must_restore; + HAL_BOOL ofdms_turn; + u_int8_t ofdm_noise_immunity_level; + u_int8_t cck_noise_immunity_level; + u_int8_t spur_immunity_level; + u_int8_t firstep_level; + u_int8_t ofdm_weak_sig_detect_off; + u_int8_t mrc_cck_off; + + /* Thresholds */ + u_int32_t listen_time; + u_int32_t ofdm_trig_high; + u_int32_t ofdm_trig_low; + int32_t cck_trig_high; + int32_t cck_trig_low; + int32_t rssi_thr_low; + int32_t rssi_thr_high; + + int32_t rssi; /* The current RSSI */ + u_int32_t tx_frame_count; /* Last tx_frame_count */ + u_int32_t rx_frame_count; /* Last rx Frame count */ + u_int32_t cycle_count; /* Last cycle_count (can detect wrap-around) */ + u_int32_t ofdm_phy_err_count;/* OFDM err count since last reset */ + u_int32_t cck_phy_err_count; /* CCK err count since last reset */ + + struct ar9300_ani_default ini_def; /* INI default values for ANI registers */ + HAL_BOOL phy_noise_spur; /* based on OFDM/CCK Phy errors */ +}; + +#define AR9300_ANI_POLLINTERVAL 1000 /* 1000 milliseconds between ANI poll */ + +#define AR9300_CHANNEL_SWITCH_TIME_USEC 1000 /* 1 millisecond needed to change channels */ + +#define HAL_PROCESS_ANI 0x00000001 /* ANI state setup */ +#define HAL_RADAR_EN 0x80000000 /* Radar detect is capable */ +#define HAL_AR_EN 0x40000000 /* AR detect is capable */ + +#define DO_ANI(ah) \ + ((AH9300(ah)->ah_proc_phy_err & HAL_PROCESS_ANI)) + +struct ar9300_stats { + u_int32_t ast_ani_niup; /* ANI increased noise immunity */ + u_int32_t ast_ani_nidown; /* ANI decreased noise immunity */ + u_int32_t ast_ani_spurup; /* ANI increased spur immunity */ + u_int32_t ast_ani_spurdown;/* ANI descreased spur immunity */ + u_int32_t ast_ani_ofdmon; /* ANI OFDM weak signal detect on */ + u_int32_t ast_ani_ofdmoff;/* ANI OFDM weak signal detect off */ + u_int32_t ast_ani_cckhigh;/* ANI CCK weak signal threshold high */ + u_int32_t ast_ani_ccklow; /* ANI CCK weak signal threshold low */ + u_int32_t ast_ani_stepup; /* ANI increased first step level */ + u_int32_t ast_ani_stepdown;/* ANI decreased first step level */ + u_int32_t ast_ani_ofdmerrs;/* ANI cumulative ofdm phy err count */ + u_int32_t ast_ani_cckerrs;/* ANI cumulative cck phy err count */ + u_int32_t ast_ani_reset; /* ANI parameters zero'd for non-STA */ + u_int32_t ast_ani_lzero; /* ANI listen time forced to zero */ + u_int32_t ast_ani_lneg; /* ANI listen time calculated < 0 */ + HAL_MIB_STATS ast_mibstats; /* MIB counter stats */ + HAL_NODE_STATS ast_nodestats; /* Latest rssi stats from driver */ +}; + +struct ar9300_rad_reader { + u_int16_t rd_index; + u_int16_t rd_expSeq; + u_int32_t rd_resetVal; + u_int8_t rd_start; +}; + +struct ar9300_rad_writer { + u_int16_t wr_index; + u_int16_t wr_seq; +}; + +struct ar9300_radar_event { + u_int32_t re_ts; /* 32 bit time stamp */ + u_int8_t re_rssi; /* rssi of radar event */ + u_int8_t re_dur; /* duration of radar pulse */ + u_int8_t re_chanIndex; /* Channel of event */ +}; + +struct ar9300_radar_q_elem { + u_int32_t rq_seqNum; + u_int32_t rq_busy; /* 32 bit to insure atomic read/write */ + struct ar9300_radar_event rq_event; /* Radar event */ +}; + +struct ar9300_radar_q_info { + u_int16_t ri_qsize; /* q size */ + u_int16_t ri_seqSize; /* Size of sequence ring */ + struct ar9300_rad_reader ri_reader; /* State for the q reader */ + struct ar9300_rad_writer ri_writer; /* state for the q writer */ +}; + +#define HAL_MAX_ACK_RADAR_DUR 511 +#define HAL_MAX_NUM_PEAKS 3 +#define HAL_ARQ_SIZE 4096 /* 8K AR events for buffer size */ +#define HAL_ARQ_SEQSIZE 4097 /* Sequence counter wrap for AR */ +#define HAL_RADARQ_SIZE 1024 /* 1K radar events for buffer size */ +#define HAL_RADARQ_SEQSIZE 1025 /* Sequence counter wrap for radar */ +#define HAL_NUMRADAR_STATES 64 /* Number of radar channels we keep state for */ + +struct ar9300_ar_state { + u_int16_t ar_prev_time_stamp; + u_int32_t ar_prev_width; + u_int32_t ar_phy_err_count[HAL_MAX_ACK_RADAR_DUR]; + u_int32_t ar_ack_sum; + u_int16_t ar_peak_list[HAL_MAX_NUM_PEAKS]; + u_int32_t ar_packet_threshold; /* Thresh to determine traffic load */ + u_int32_t ar_par_threshold; /* Thresh to determine peak */ + u_int32_t ar_radar_rssi; /* Rssi threshold for AR event */ +}; + +struct ar9300_radar_state { + HAL_CHANNEL_INTERNAL *rs_chan; /* Channel info */ + u_int8_t rs_chan_index; /* Channel index in radar structure */ + u_int32_t rs_num_radar_events; /* Number of radar events */ + int32_t rs_firpwr; /* Thresh to check radar sig is gone */ + u_int32_t rs_radar_rssi; /* Thresh to start radar det (dB) */ + u_int32_t rs_height; /* Thresh for pulse height (dB)*/ + u_int32_t rs_pulse_rssi; /* Thresh to check if pulse is gone (dB) */ + u_int32_t rs_inband; /* Thresh to check if pusle is inband (0.5 dB) */ +}; +typedef struct { + u_int8_t uc_receiver_errors; + u_int8_t uc_bad_tlp_errors; + u_int8_t uc_bad_dllp_errors; + u_int8_t uc_replay_timeout_errors; + u_int8_t uc_replay_number_rollover_errors; +} ar_pcie_error_moniter_counters; + +#define AR9300_OPFLAGS_11A 0x01 /* if set, allow 11a */ +#define AR9300_OPFLAGS_11G 0x02 /* if set, allow 11g */ +#define AR9300_OPFLAGS_N_5G_HT40 0x04 /* if set, disable 5G HT40 */ +#define AR9300_OPFLAGS_N_2G_HT40 0x08 /* if set, disable 2G HT40 */ +#define AR9300_OPFLAGS_N_5G_HT20 0x10 /* if set, disable 5G HT20 */ +#define AR9300_OPFLAGS_N_2G_HT20 0x20 /* if set, disable 2G HT20 */ + +/* + * For Kite and later chipsets, the following bits are not being programmed in EEPROM + * and so need to be enabled always. + * Bit 0: en_fcc_mid, Bit 1: en_jap_mid, Bit 2: en_fcc_dfs_ht40 + * Bit 3: en_jap_ht40, Bit 4: en_jap_dfs_ht40 + */ +#define AR9300_RDEXT_DEFAULT 0x1F + +#define AR9300_MAX_CHAINS 3 +#define AR9300_NUM_CHAINS(chainmask) \ + (((chainmask >> 2) & 1) + ((chainmask >> 1) & 1) + (chainmask & 1)) +#define AR9300_CHAIN0_MASK 0x1 +#define AR9300_CHAIN1_MASK 0x2 +#define AR9300_CHAIN2_MASK 0x4 + +/* Support for multiple INIs */ +struct ar9300_ini_array { + u_int32_t *ia_array; + u_int32_t ia_rows; + u_int32_t ia_columns; +}; +#define INIT_INI_ARRAY(iniarray, array, rows, columns) do { \ + (iniarray)->ia_array = (u_int32_t *)(array); \ + (iniarray)->ia_rows = (rows); \ + (iniarray)->ia_columns = (columns); \ +} while (0) +#define INI_RA(iniarray, row, column) (((iniarray)->ia_array)[(row) * ((iniarray)->ia_columns) + (column)]) + +#define INIT_CAL(_perCal) \ + (_perCal)->cal_state = CAL_WAITING; \ + (_perCal)->cal_next = AH_NULL; + +#define INSERT_CAL(_ahp, _perCal) \ +do { \ + if ((_ahp)->ah_cal_list_last == AH_NULL) { \ + (_ahp)->ah_cal_list = (_ahp)->ah_cal_list_last = (_perCal); \ + ((_ahp)->ah_cal_list_last)->cal_next = (_perCal); \ + } else { \ + ((_ahp)->ah_cal_list_last)->cal_next = (_perCal); \ + (_ahp)->ah_cal_list_last = (_perCal); \ + (_perCal)->cal_next = (_ahp)->ah_cal_list; \ + } \ +} while (0) + +typedef enum cal_types { + IQ_MISMATCH_CAL = 0x1, + TEMP_COMP_CAL = 0x2, +} HAL_CAL_TYPES; + +typedef enum cal_state { + CAL_INACTIVE, + CAL_WAITING, + CAL_RUNNING, + CAL_DONE +} HAL_CAL_STATE; /* Calibrate state */ + +#define MIN_CAL_SAMPLES 1 +#define MAX_CAL_SAMPLES 64 +#define INIT_LOG_COUNT 5 +#define PER_MIN_LOG_COUNT 2 +#define PER_MAX_LOG_COUNT 10 + +#define AR9300_NUM_BT_WEIGHTS 4 +#define AR9300_NUM_WLAN_WEIGHTS 4 + +/* Per Calibration data structure */ +typedef struct per_cal_data { + HAL_CAL_TYPES cal_type; // Type of calibration + u_int32_t cal_num_samples; // Number of SW samples to collect + u_int32_t cal_count_max; // Number of HW samples to collect + void (*cal_collect)(struct ath_hal *, u_int8_t); // Accumulator func + void (*cal_post_proc)(struct ath_hal *, u_int8_t); // Post-processing func +} HAL_PERCAL_DATA; + +/* List structure for calibration data */ +typedef struct cal_list { + const HAL_PERCAL_DATA *cal_data; + HAL_CAL_STATE cal_state; + struct cal_list *cal_next; +} HAL_CAL_LIST; + +#define AR9300_NUM_CAL_TYPES 2 +#define AR9300_PAPRD_TABLE_SZ 24 +#define AR9300_PAPRD_GAIN_TABLE_SZ 32 +#define AR9382_MAX_GPIO_PIN_NUM (16) +#define AR9382_GPIO_PIN_8_RESERVED (8) +#define AR9382_GPIO_9_INPUT_ONLY (9) +#define AR9382_MAX_GPIO_INPUT_PIN_NUM (13) +#define AR9382_GPIO_PIN_11_RESERVED (11) +#define AR9382_MAX_JTAG_GPIO_PIN_NUM (3) + +/* Paprd tx power adjust data structure */ +struct ar9300_paprd_pwr_adjust { + u_int32_t target_rate; // rate index + u_int32_t reg_addr; // register offset + u_int32_t reg_mask; // mask of register + u_int32_t reg_mask_offset; // mask offset of register + u_int32_t sub_db; // offset value unit of dB +}; + +#define AR9300_MAX_RATES 36 /* legacy(4) + ofdm(8) + HTSS(8) + HTDS(8) + HTTS(8)*/ +struct ath_hal_9300 { + struct ath_hal_private_tables ah_priv; /* base class */ + + /* + * Information retrieved from EEPROM. + */ + ar9300_eeprom_t ah_eeprom; + + GAIN_VALUES ah_gain_values; + + u_int8_t ah_macaddr[IEEE80211_ADDR_LEN]; + u_int8_t ah_bssid[IEEE80211_ADDR_LEN]; + u_int8_t ah_bssid_mask[IEEE80211_ADDR_LEN]; + u_int16_t ah_assoc_id; + + /* + * Runtime state. + */ + u_int32_t ah_mask_reg; /* copy of AR_IMR */ + u_int32_t ah_mask2Reg; /* copy of AR_IMR_S2 */ + u_int32_t ah_msi_reg; /* copy of AR_PCIE_MSI */ + os_atomic_t ah_ier_ref_count; /* reference count for enabling interrupts */ + struct ar9300_stats ah_stats; /* various statistics */ + RF_HAL_FUNCS ah_rf_hal; + u_int32_t ah_tx_desc_mask; /* mask for TXDESC */ + u_int32_t ah_tx_ok_interrupt_mask; + u_int32_t ah_tx_err_interrupt_mask; + u_int32_t ah_tx_desc_interrupt_mask; + u_int32_t ah_tx_eol_interrupt_mask; + u_int32_t ah_tx_urn_interrupt_mask; + HAL_TX_QUEUE_INFO ah_txq[HAL_NUM_TX_QUEUES]; + HAL_SMPS_MODE ah_sm_power_mode; + HAL_BOOL ah_chip_full_sleep; + u_int32_t ah_atim_window; + HAL_ANT_SETTING ah_diversity_control; /* antenna setting */ + u_int16_t ah_antenna_switch_swap; /* Controls mapping of OID request */ + u_int8_t ah_tx_chainmask_cfg; /* chain mask config */ + u_int8_t ah_rx_chainmask_cfg; + u_int32_t ah_beacon_rssi_threshold; /* cache beacon rssi threshold */ + /* Calibration related fields */ + HAL_CAL_TYPES ah_supp_cals; + HAL_CAL_LIST ah_iq_cal_data; /* IQ Cal Data */ + HAL_CAL_LIST ah_temp_comp_cal_data; /* Temperature Compensation Cal Data */ + HAL_CAL_LIST *ah_cal_list; /* ptr to first cal in list */ + HAL_CAL_LIST *ah_cal_list_last; /* ptr to last cal in list */ + HAL_CAL_LIST *ah_cal_list_curr; /* ptr to current cal */ +// IQ Cal aliases +#define ah_total_power_meas_i ah_meas0.unsign +#define ah_total_power_meas_q ah_meas1.unsign +#define ah_total_iq_corr_meas ah_meas2.sign + union { + u_int32_t unsign[AR9300_MAX_CHAINS]; + int32_t sign[AR9300_MAX_CHAINS]; + } ah_meas0; + union { + u_int32_t unsign[AR9300_MAX_CHAINS]; + int32_t sign[AR9300_MAX_CHAINS]; + } ah_meas1; + union { + u_int32_t unsign[AR9300_MAX_CHAINS]; + int32_t sign[AR9300_MAX_CHAINS]; + } ah_meas2; + union { + u_int32_t unsign[AR9300_MAX_CHAINS]; + int32_t sign[AR9300_MAX_CHAINS]; + } ah_meas3; + u_int16_t ah_cal_samples; + /* end - Calibration related fields */ + u_int32_t ah_tx6_power_in_half_dbm; /* power output for 6Mb tx */ + u_int32_t ah_sta_id1_defaults; /* STA_ID1 default settings */ + u_int32_t ah_misc_mode; /* MISC_MODE settings */ + HAL_BOOL ah_get_plcp_hdr; /* setting about MISC_SEL_EVM */ + enum { + AUTO_32KHZ, /* use it if 32kHz crystal present */ + USE_32KHZ, /* do it regardless */ + DONT_USE_32KHZ, /* don't use it regardless */ + } ah_enable32k_hz_clock; /* whether to sleep at 32kHz */ + + u_int32_t ah_ofdm_tx_power; + int16_t ah_tx_power_index_offset; + + u_int ah_slot_time; /* user-specified slot time */ + u_int ah_ack_timeout; /* user-specified ack timeout */ + /* + * XXX + * 11g-specific stuff; belongs in the driver. + */ + u_int8_t ah_g_beacon_rate; /* fixed rate for G beacons */ + u_int32_t ah_gpio_mask; /* copy of enabled GPIO mask */ + u_int32_t ah_gpio_cause; /* copy of GPIO cause (sync and async) */ + /* + * RF Silent handling; setup according to the EEPROM. + */ + u_int32_t ah_gpio_select; /* GPIO pin to use */ + u_int32_t ah_polarity; /* polarity to disable RF */ + u_int32_t ah_gpio_bit; /* after init, prev value */ + HAL_BOOL ah_eep_enabled; /* EEPROM bit for capability */ + +#ifdef ATH_BT_COEX + /* + * Bluetooth coexistence static setup according to the registry + */ + HAL_BT_MODULE ah_bt_module; /* Bluetooth module identifier */ + u_int8_t ah_bt_coex_config_type; /* BT coex configuration */ + u_int8_t ah_bt_active_gpio_select; /* GPIO pin for BT_ACTIVE */ + u_int8_t ah_bt_priority_gpio_select; /* GPIO pin for BT_PRIORITY */ + u_int8_t ah_wlan_active_gpio_select; /* GPIO pin for WLAN_ACTIVE */ + u_int8_t ah_bt_active_polarity; /* Polarity of BT_ACTIVE */ + HAL_BOOL ah_bt_coex_single_ant; /* Single or dual antenna configuration */ + u_int8_t ah_bt_wlan_isolation; /* Isolation between BT and WLAN in dB */ + /* + * Bluetooth coexistence runtime settings + */ + HAL_BOOL ah_bt_coex_enabled; /* If Bluetooth coexistence is enabled */ + u_int32_t ah_bt_coex_mode; /* Register setting for AR_BT_COEX_MODE */ + u_int32_t ah_bt_coex_bt_weight[AR9300_NUM_BT_WEIGHTS]; /* Register setting for AR_BT_COEX_WEIGHT */ + u_int32_t ah_bt_coex_wlan_weight[AR9300_NUM_WLAN_WEIGHTS]; /* Register setting for AR_BT_COEX_WEIGHT */ + u_int32_t ah_bt_coex_mode2; /* Register setting for AR_BT_COEX_MODE2 */ + u_int32_t ah_bt_coex_flag; /* Special tuning flags for BT coex */ +#endif + + /* + * Generic timer support + */ + u_int32_t ah_avail_gen_timers; /* mask of available timers */ + u_int32_t ah_intr_gen_timer_trigger; /* generic timer trigger interrupt state */ + u_int32_t ah_intr_gen_timer_thresh; /* generic timer trigger interrupt state */ + HAL_BOOL ah_enable_tsf2; /* enable TSF2 for gen timer 8-15. */ + + /* + * ANI & Radar support. + */ + u_int32_t ah_proc_phy_err; /* Process Phy errs */ + u_int32_t ah_ani_period; /* ani update list period */ + struct ar9300_ani_state *ah_curani; /* cached last reference */ + struct ar9300_ani_state ah_ani[255]; /* per-channel state */ + struct ar9300_radar_state ah_radar[HAL_NUMRADAR_STATES]; /* Per-Channel Radar detector state */ + struct ar9300_radar_q_elem *ah_radarq; /* radar event queue */ + struct ar9300_radar_q_info ah_radarq_info; /* radar event q read/write state */ + struct ar9300_ar_state ah_ar; /* AR detector state */ + struct ar9300_radar_q_elem *ah_arq; /* AR event queue */ + struct ar9300_radar_q_info ah_arq_info; /* AR event q read/write state */ + + /* + * Transmit power state. Note these are maintained + * here so they can be retrieved by diagnostic tools. + */ + u_int16_t ah_rates_array[16]; + + /* + * Tx queue interrupt state. + */ + u_int32_t ah_intr_txqs; + + HAL_BOOL ah_intr_mitigation_rx; /* rx Interrupt Mitigation Settings */ + HAL_BOOL ah_intr_mitigation_tx; /* tx Interrupt Mitigation Settings */ + + /* + * Extension Channel Rx Clear State + */ + u_int32_t ah_cycle_count; + u_int32_t ah_ctl_busy; + u_int32_t ah_ext_busy; + + /* HT CWM state */ + HAL_HT_EXTPROTSPACING ah_ext_prot_spacing; + u_int8_t ah_tx_chainmask; /* tx chain mask */ + u_int8_t ah_rx_chainmask; /* rx chain mask */ + + u_int8_t ah_tx_cal_chainmask; /* tx cal chain mask */ + u_int8_t ah_rx_cal_chainmask; /* rx cal chain mask */ + + int ah_hwp; + void *ah_cal_mem; + HAL_BOOL ah_emu_eeprom; + + HAL_ANI_CMD ah_ani_function; + HAL_BOOL ah_rifs_enabled; + u_int32_t ah_rifs_reg[11]; + u_int32_t ah_rifs_sec_cnt; + + /* open-loop power control */ + u_int32_t original_gain[22]; + int32_t init_pdadc; + int32_t pdadc_delta; + + /* cycle counts for beacon stuck diagnostics */ + u_int32_t ah_cycles; + u_int32_t ah_rx_clear; + u_int32_t ah_rx_frame; + u_int32_t ah_tx_frame; + +#define BB_HANG_SIG1 0 +#define BB_HANG_SIG2 1 +#define BB_HANG_SIG3 2 +#define BB_HANG_SIG4 3 +#define MAC_HANG_SIG1 4 +#define MAC_HANG_SIG2 5 + /* bb hang detection */ + int ah_hang[6]; + hal_hw_hangs_t ah_hang_wars; + /* + * Support for ar9300 multiple INIs + */ + struct ar9300_ini_array ah_ini_pcie_serdes; + struct ar9300_ini_array ah_ini_pcie_serdes_low_power; + struct ar9300_ini_array ah_ini_modes_additional; + struct ar9300_ini_array ah_ini_modes_additional_40mhz; + struct ar9300_ini_array ah_ini_modes_rxgain; + struct ar9300_ini_array ah_ini_modes_rxgain_bounds; + struct ar9300_ini_array ah_ini_modes_txgain; + struct ar9300_ini_array ah_ini_japan2484; + struct ar9300_ini_array ah_ini_radio_post_sys2ant; + struct ar9300_ini_array ah_ini_BTCOEX_MAX_TXPWR; + /* + * New INI format starting with Osprey 2.0 INI. + * Pre, core, post arrays for each sub-system (mac, bb, radio, soc) + */ + #define ATH_INI_PRE 0 + #define ATH_INI_CORE 1 + #define ATH_INI_POST 2 + #define ATH_INI_NUM_SPLIT (ATH_INI_POST + 1) + struct ar9300_ini_array ah_ini_mac[ATH_INI_NUM_SPLIT]; /* New INI format */ + struct ar9300_ini_array ah_ini_bb[ATH_INI_NUM_SPLIT]; /* New INI format */ + struct ar9300_ini_array ah_ini_radio[ATH_INI_NUM_SPLIT]; /* New INI format */ + struct ar9300_ini_array ah_ini_soc[ATH_INI_NUM_SPLIT]; /* New INI format */ + + /* + * Added to support DFS postamble array in INI that we need to apply + * in DFS channels + */ + + struct ar9300_ini_array ah_ini_dfs; + +#if ATH_WOW + struct ar9300_ini_array ah_ini_pcie_serdes_wow; /* SerDes values during WOW sleep */ +#endif + + /* To indicate EEPROM mapping used */ + u_int32_t ah_immunity_vals[6]; + HAL_BOOL ah_immunity_on; + /* + * snap shot of counter register for debug purposes + */ +#ifdef AH_DEBUG + u_int32_t last_tf; + u_int32_t last_rf; + u_int32_t last_rc; + u_int32_t last_cc; +#endif + HAL_BOOL ah_dma_stuck; /* Set to AH_TRUE when RX/TX DMA failed to stop. */ + u_int32_t nf_tsf32; /* timestamp for NF calibration duration */ + + u_int32_t reg_dmn; /* Regulatory Domain */ + int16_t twice_antenna_gain; /* Antenna Gain */ + u_int16_t twice_antenna_reduction; /* Antenna Gain Allowed */ + + /* + * Upper limit after factoring in the regulatory max, antenna gain and + * multichain factor. No TxBF, CDD or STBC gain factored + */ + int16_t upper_limit[AR9300_MAX_CHAINS]; + + /* adjusted power for descriptor-based TPC for 1, 2, or 3 chains */ + int16_t txpower[AR9300_MAX_RATES][AR9300_MAX_CHAINS]; + + + /* adjusted power for descriptor-based TPC for 1, 2, or 3 chains with STBC*/ + int16_t txpower_stbc[AR9300_MAX_RATES][AR9300_MAX_CHAINS]; + + /* Transmit Status ring support */ + struct ar9300_txs *ts_ring; + u_int16_t ts_tail; + u_int16_t ts_size; + u_int32_t ts_paddr_start; + u_int32_t ts_paddr_end; + + /* Receive Buffer size */ +#define HAL_RXBUFSIZE_DEFAULT 0xfff + u_int16_t rx_buf_size; + + u_int32_t ah_wa_reg_val; // Store the permanent value of Reg 0x4004 so we dont have to R/M/W. (We should not be reading this register when in sleep states). + + /* Indicate the PLL source clock rate is 25Mhz or not. + * clk_25mhz = 0 by default. + */ + u_int8_t clk_25mhz; + /* For PAPRD uses */ + u_int16_t small_signal_gain[AH_MAX_CHAINS]; + u_int32_t pa_table[AH_MAX_CHAINS][AR9300_PAPRD_TABLE_SZ]; + u_int32_t paprd_gain_table_entries[AR9300_PAPRD_GAIN_TABLE_SZ]; + u_int32_t paprd_gain_table_index[AR9300_PAPRD_GAIN_TABLE_SZ]; + u_int32_t ah_2g_paprd_rate_mask_ht20; /* Copy of eep->modal_header_2g.paprd_rate_mask_ht20 */ + u_int32_t ah_2g_paprd_rate_mask_ht40; /* Copy of eep->modal_header_2g.paprd_rate_mask_ht40 */ + u_int32_t ah_5g_paprd_rate_mask_ht20; /* Copy of eep->modal_header_5g.paprd_rate_mask_ht20 */ + u_int32_t ah_5g_paprd_rate_mask_ht40; /* Copy of eep->modal_header_5g.paprd_rate_mask_ht40 */ + u_int32_t paprd_training_power; + /* For GreenTx use to store the default tx power */ + u_int8_t ah_default_tx_power[ar9300_rate_size]; + HAL_BOOL ah_paprd_broken; + + /* To store offsets of host interface registers */ + struct { + u_int32_t AR_RC; + u_int32_t AR_WA; + u_int32_t AR_PM_STATE; + u_int32_t AR_H_INFOL; + u_int32_t AR_H_INFOH; + u_int32_t AR_PCIE_PM_CTRL; + u_int32_t AR_HOST_TIMEOUT; + u_int32_t AR_EEPROM; + u_int32_t AR_SREV; + u_int32_t AR_INTR_SYNC_CAUSE; + u_int32_t AR_INTR_SYNC_CAUSE_CLR; + u_int32_t AR_INTR_SYNC_ENABLE; + u_int32_t AR_INTR_ASYNC_MASK; + u_int32_t AR_INTR_SYNC_MASK; + u_int32_t AR_INTR_ASYNC_CAUSE_CLR; + u_int32_t AR_INTR_ASYNC_CAUSE; + u_int32_t AR_INTR_ASYNC_ENABLE; + u_int32_t AR_PCIE_SERDES; + u_int32_t AR_PCIE_SERDES2; + u_int32_t AR_GPIO_OUT; + u_int32_t AR_GPIO_IN; + u_int32_t AR_GPIO_OE_OUT; + u_int32_t AR_GPIO_OE1_OUT; + u_int32_t AR_GPIO_INTR_POL; + u_int32_t AR_GPIO_INPUT_EN_VAL; + u_int32_t AR_GPIO_INPUT_MUX1; + u_int32_t AR_GPIO_INPUT_MUX2; + u_int32_t AR_GPIO_OUTPUT_MUX1; + u_int32_t AR_GPIO_OUTPUT_MUX2; + u_int32_t AR_GPIO_OUTPUT_MUX3; + u_int32_t AR_INPUT_STATE; + u_int32_t AR_SPARE; + u_int32_t AR_PCIE_CORE_RESET_EN; + u_int32_t AR_CLKRUN; + u_int32_t AR_EEPROM_STATUS_DATA; + u_int32_t AR_OBS; + u_int32_t AR_RFSILENT; + u_int32_t AR_GPIO_PDPU; + u_int32_t AR_GPIO_DS; + u_int32_t AR_MISC; + u_int32_t AR_PCIE_MSI; + u_int32_t AR_TSF_SNAPSHOT_BT_ACTIVE; + u_int32_t AR_TSF_SNAPSHOT_BT_PRIORITY; + u_int32_t AR_TSF_SNAPSHOT_BT_CNTL; + u_int32_t AR_PCIE_PHY_LATENCY_NFTS_ADJ; + u_int32_t AR_TDMA_CCA_CNTL; + u_int32_t AR_TXAPSYNC; + u_int32_t AR_TXSYNC_INIT_SYNC_TMR; + u_int32_t AR_INTR_PRIO_SYNC_CAUSE; + u_int32_t AR_INTR_PRIO_SYNC_ENABLE; + u_int32_t AR_INTR_PRIO_ASYNC_MASK; + u_int32_t AR_INTR_PRIO_SYNC_MASK; + u_int32_t AR_INTR_PRIO_ASYNC_CAUSE; + u_int32_t AR_INTR_PRIO_ASYNC_ENABLE; + } ah_hostifregs; + + u_int32_t ah_enterprise_mode; + u_int32_t ah_radar1; + u_int32_t ah_dc_offset; + HAL_BOOL ah_hw_green_tx_enable; /* 1:enalbe H/W Green Tx */ + HAL_BOOL ah_smartantenna_enable; /* 1:enalbe H/W */ + u_int32_t ah_disable_cck; + HAL_BOOL ah_lna_div_use_bt_ant_enable; /* 1:enable Rx(LNA) Diversity */ + + + /* + * Different types of memory where the calibration data might be stored. + * All types are searched in Ar9300EepromRestore() in the order flash, eeprom, otp. + * To disable searching a type, set its parameter to 0. + */ + int try_dram; + int try_flash; + int try_eeprom; + int try_otp; +#ifdef ATH_CAL_NAND_FLASH + int try_nand; +#endif + /* + * This is where we found the calibration data. + */ + int calibration_data_source; + int calibration_data_source_address; + /* + * This is where we look for the calibration data. must be set before ath_attach() is called + */ + int calibration_data_try; + int calibration_data_try_address; + u_int8_t + tx_iq_cal_enable : 1, + tx_iq_cal_during_agc_cal : 1, + tx_cl_cal_enable : 1; + +#if ATH_SUPPORT_MCI + /* For MCI */ + HAL_BOOL ah_mci_ready; + u_int32_t ah_mci_int_raw; + u_int32_t ah_mci_int_rx_msg; + u_int32_t ah_mci_rx_status; + u_int32_t ah_mci_cont_status; + u_int8_t ah_mci_bt_state; + u_int32_t ah_mci_gpm_addr; + u_int8_t *ah_mci_gpm_buf; + u_int32_t ah_mci_gpm_len; + u_int32_t ah_mci_gpm_idx; + u_int32_t ah_mci_sched_addr; + u_int8_t *ah_mci_sched_buf; + u_int8_t ah_mci_coex_major_version_wlan; + u_int8_t ah_mci_coex_minor_version_wlan; + u_int8_t ah_mci_coex_major_version_bt; + u_int8_t ah_mci_coex_minor_version_bt; + HAL_BOOL ah_mci_coex_bt_version_known; + HAL_BOOL ah_mci_coex_wlan_channels_update; + u_int32_t ah_mci_coex_wlan_channels[4]; + HAL_BOOL ah_mci_coex_2g5g_update; + HAL_BOOL ah_mci_coex_is_2g; + HAL_BOOL ah_mci_query_bt; + HAL_BOOL ah_mci_unhalt_bt_gpm; /* need send UNHALT */ + HAL_BOOL ah_mci_halted_bt_gpm; /* HALT sent */ + HAL_BOOL ah_mci_need_flush_btinfo; + HAL_BOOL ah_mci_concur_tx_en; + u_int8_t ah_mci_stomp_low_tx_pri; + u_int8_t ah_mci_stomp_all_tx_pri; + u_int8_t ah_mci_stomp_none_tx_pri; + u_int32_t ah_mci_wlan_cal_seq; + u_int32_t ah_mci_wlan_cal_done; +#if ATH_SUPPORT_AIC + HAL_BOOL ah_aic_enabled; + u_int32_t ah_aic_sram[ATH_AIC_MAX_BT_CHANNEL]; +#endif +#endif /* ATH_SUPPORT_MCI */ + u_int8_t ah_cac_quiet_enabled; +#if ATH_WOW_OFFLOAD + u_int32_t ah_mcast_filter_l32_set; + u_int32_t ah_mcast_filter_u32_set; +#endif + HAL_BOOL ah_reduced_self_gen_mask; +}; + +#define AH9300(_ah) ((struct ath_hal_9300 *)(_ah)) + +#define IS_9300_EMU(ah) \ + (AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_EMU_PCIE) + +#define ar9300_eep_data_in_flash(_ah) \ + (!(AH_PRIVATE(_ah)->ah_flags & AH_USE_EEPROM)) + +#define IS_5GHZ_FAST_CLOCK_EN(_ah, _c) \ + (IS_CHAN_5GHZ(_c) && \ + ((AH_PRIVATE(_ah))->ah_config.ath_hal_fastClockEnable)) + +#if notyet +// Need these additional conditions for IS_5GHZ_FAST_CLOCK_EN when we have valid eeprom contents. +&& \ + ((ar9300_eeprom_get(AH9300(_ah), EEP_MINOR_REV) <= AR9300_EEP_MINOR_VER_16) || \ + (ar9300_eeprom_get(AH9300(_ah), EEP_FSTCLK_5G)))) +#endif + +/* + * WAR for bug 6773. OS_DELAY() does a PIO READ on the PCI bus which allows + * other cards' DMA reads to complete in the middle of our reset. + */ +#define WAR_6773(x) do { \ + if ((++(x) % 64) == 0) \ + OS_DELAY(1); \ +} while (0) + +#define REG_WRITE_ARRAY(iniarray, column, regWr) do { \ + int r; \ + for (r = 0; r < ((iniarray)->ia_rows); r++) { \ + OS_REG_WRITE(ah, INI_RA((iniarray), (r), 0), INI_RA((iniarray), r, (column)));\ + WAR_6773(regWr); \ + } \ +} while (0) + +#define UPPER_5G_SUB_BANDSTART 5700 +#define MID_5G_SUB_BANDSTART 5400 +#define TRAINPOWER_DB_OFFSET 6 + +#define AH_PAPRD_GET_SCALE_FACTOR(_scale, _eep, _is2G, _channel) do{ if(_is2G) { _scale = (_eep->modal_header_2g.paprd_rate_mask_ht20>>25)&0x7; \ + } else { \ + if(_channel >= UPPER_5G_SUB_BANDSTART){ _scale = (_eep->modal_header_5g.paprd_rate_mask_ht20>>25)&0x7;} \ + else if((UPPER_5G_SUB_BANDSTART < _channel) && (_channel >= MID_5G_SUB_BANDSTART)) \ + { _scale = (_eep->modal_header_5g.paprd_rate_mask_ht40>>28)&0x7;} \ + else { _scale = (_eep->modal_header_5g.paprd_rate_mask_ht40>>25)&0x7;} } }while(0) + +#ifdef AH_ASSERT + #define ar9300FeatureNotSupported(feature, ah, func) \ + ath_hal_printf(ah, # feature \ + " not supported but called from %s\n", (func)), \ + hal_assert(0) +#else + #define ar9300FeatureNotSupported(feature, ah, func) \ + ath_hal_printf(ah, # feature \ + " not supported but called from %s\n", (func)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 00:46:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 594C0315; Sun, 28 Apr 2013 00:46:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 322E610EA; Sun, 28 Apr 2013 00:46:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S0kGth042070; Sun, 28 Apr 2013 00:46:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S0kGIj042069; Sun, 28 Apr 2013 00:46:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304280046.r3S0kGIj042069@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Apr 2013 00:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r250004 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:46:16 -0000 Author: adrian Date: Sun Apr 28 00:46:15 2013 New Revision: 250004 URL: http://svnweb.freebsd.org/changeset/base/250004 Log: Finished; take me out. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sun Apr 28 00:45:58 2013 (r250003) +++ svnadmin/conf/sizelimit.conf Sun Apr 28 00:46:15 2013 (r250004) @@ -18,6 +18,7 @@ #grog #kan #lulf +# adrian brooks des dim @@ -35,4 +36,3 @@ rwatson sam stas thompsa -adrian From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 00:48:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9F8C24D6; Sun, 28 Apr 2013 00:48:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 766B810FD; Sun, 28 Apr 2013 00:48:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S0m9Ft042437; Sun, 28 Apr 2013 00:48:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S0m9Li042436; Sun, 28 Apr 2013 00:48:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304280048.r3S0m9Li042436@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Apr 2013 00:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250005 - vendor/qcamain_open_hal/60390a9f9ac6a20db168fbbc01a4ad4e01c395ce X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:48:09 -0000 Author: adrian Date: Sun Apr 28 00:48:09 2013 New Revision: 250005 URL: http://svnweb.freebsd.org/changeset/base/250005 Log: Tag 60390a9f9ac6a20db168fbbc01a4ad4e01c395ce . Added: vendor/qcamain_open_hal/60390a9f9ac6a20db168fbbc01a4ad4e01c395ce/ - copied from r250004, vendor/qcamain_open_hal/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 00:52:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F2C264D; Sun, 28 Apr 2013 00:52:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37315110D; Sun, 28 Apr 2013 00:52:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S0qOKJ044043; Sun, 28 Apr 2013 00:52:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S0qOfL044037; Sun, 28 Apr 2013 00:52:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304280052.r3S0qOfL044037@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Apr 2013 00:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250006 - in head/sys/contrib/dev/ath: . ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:52:25 -0000 Author: adrian Date: Sun Apr 28 00:52:23 2013 New Revision: 250006 URL: http://svnweb.freebsd.org/changeset/base/250006 Log: Create a placeholder directory for the upcoming ar9300 HAL from qcamain_open_hal. Added: head/sys/contrib/dev/ath/ head/sys/contrib/dev/ath/ath_hal/ From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 00:53:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB7557C2; Sun, 28 Apr 2013 00:53:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 827B51114; Sun, 28 Apr 2013 00:53:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S0rVKt044282; Sun, 28 Apr 2013 00:53:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S0rVfd044281; Sun, 28 Apr 2013 00:53:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304280053.r3S0rVfd044281@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Apr 2013 00:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250007 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:53:31 -0000 Author: adrian Date: Sun Apr 28 00:53:31 2013 New Revision: 250007 URL: http://svnweb.freebsd.org/changeset/base/250007 Log: Copy the vendor branch ar9300 code from qcamain_open_hal into this directory. Only copy the ar9300 HAL, we don't want to grab everything. Added: head/sys/contrib/dev/ath/ath_hal/ar9300/ - copied from r250006, vendor/qcamain_open_hal/dist/hal/ar9300/ From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 00:56:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7FECB95C for ; Sun, 28 Apr 2013 00:56:54 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-ve0-x229.google.com (mail-ve0-x229.google.com [IPv6:2607:f8b0:400c:c01::229]) by mx1.freebsd.org (Postfix) with ESMTP id 400D1112A for ; Sun, 28 Apr 2013 00:56:54 +0000 (UTC) Received: by mail-ve0-f169.google.com with SMTP id pa12so947574veb.0 for ; Sat, 27 Apr 2013 17:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=KIkNG3DUWlF1GdSG332L3ITUH7jLZFTRyumInk9lhEY=; b=Y8XZP4Tm8PrlcIEpcjK8iLAs65ssKBAOklvTkaCzspGocYZsnY+g3TpFvaZ6xDoJHg A3uEHRjRsRENoDHhLk1FhTvk9p2X4oUrFMGnKpTF2o17fWl7S1XQfCdgE5vX9T40rqSP jQ9GZBtmsYTRGFRs4YQ9VGF2PXLEB0tq6xjTg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=KIkNG3DUWlF1GdSG332L3ITUH7jLZFTRyumInk9lhEY=; b=bEUcjsdDiFeMROKc3gkGR7FchpUMjFarzcfT8xnZAAZ01ElLSFEkwrR6XgW+A4ytyV 01pLj1WsElml3Uc3kM4tiYnijPQJc2UWfcPPMksAAovQWDPIIVgMwJutmJvTxlMO9HA3 D3cM96y9G8QfxdxajF1X13W+MlgMhkw+U9HRPfCsUqZoZykrTp05ip+zesRcJUMmn1q3 ppmouYnB+aEYUHvXPtNwj/qgQUFsmGJrkZmWLVoW02I15dukOBDveFLJmprNTa7AIa/n 01M6i5DgVz1EivzXXpmADuRH2JcOlTg1kE6nNKjSSS05MGkmu13FfpjbmtxGCSdXPzT5 JcQA== MIME-Version: 1.0 X-Received: by 10.58.173.36 with SMTP id bh4mr17292109vec.9.1367110613222; Sat, 27 Apr 2013 17:56:53 -0700 (PDT) Received: by 10.220.215.70 with HTTP; Sat, 27 Apr 2013 17:56:53 -0700 (PDT) In-Reply-To: <517AC0BB.4040207@FreeBSD.org> References: <201304180944.r3I9i05t093967@svn.freebsd.org> <517AC0BB.4040207@FreeBSD.org> Date: Sat, 27 Apr 2013 17:56:53 -0700 Message-ID: Subject: Re: svn commit: r249611 - in stable/9/sys/cam: ata scsi From: Peter Wemm To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlqVlONwct+jqRpOZ3E4Zf+cdchflmRkBA12Ra+WvfwAafRj6TERagIvUfQXvvT3RQoUAcT Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:56:54 -0000 On Fri, Apr 26, 2013 at 11:00 AM, Alexander Motin wrote: > On 26.04.2013 19:47, Peter Wemm wrote: >> >> On Thu, Apr 18, 2013 at 2:44 AM, Alexander Motin wrote: >>> >>> Author: mav >>> Date: Thu Apr 18 09:44:00 2013 >>> New Revision: 249611 >>> URL: http://svnweb.freebsd.org/changeset/base/249611 [..] >> This breaks a number of machines in the freebsd.org cluster. I have >> to back out both of these changes to get them to reboot. > > > I've made a search though the base system and found only two drivers > affected by this change: mpt and hptmv. I've patched both at head r249849 > and going to merge fix to stable/9 tomorrow unless objected. Have you tried > that patch instead of reverting? I'm testing this on ns1.freebsd.org and ns2.freebsd.org as we speak. If the cluster goes dark, that's why :) -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 00:57:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 61CC2AE2; Sun, 28 Apr 2013 00:57:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52F171133; Sun, 28 Apr 2013 00:57:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S0vmVS045089; Sun, 28 Apr 2013 00:57:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S0vlJp045085; Sun, 28 Apr 2013 00:57:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304280057.r3S0vlJp045085@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Apr 2013 00:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250008 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:57:51 -0000 Author: adrian Date: Sun Apr 28 00:57:47 2013 New Revision: 250008 URL: http://svnweb.freebsd.org/changeset/base/250008 Log: Bring over my FreeBSD modifications for the AR9300 HAL to make it work in FreeBSD. This is still heavily a work in progress but I'd rather it start shipping in -HEAD sooner rather than later. This doesn't (yet) link it into the build system either for a static kernel or as a module; that will come later (after many, many make universe tests.) Added: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_devid.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_keycache.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_paprd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_timer.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit_ds.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300desc.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300paprd.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sun Apr 28 00:53:31 2013 (r250007) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sun Apr 28 00:57:47 2013 (r250008) @@ -17,11 +17,31 @@ #ifndef _ATH_AR9300_H_ #define _ATH_AR9300_H_ +#include "ar9300_freebsd_inc.h" + +#define AH_BIG_ENDIAN 4321 +#define AH_LITTLE_ENDIAN 1234 + +#if _BYTE_ORDER == _BIG_ENDIAN +#define AH_BYTE_ORDER AH_BIG_ENDIAN +#else +#define AH_BYTE_ORDER AH_LITTLE_ENDIAN +#endif + +/* XXX doesn't belong here */ +#define AR_EEPROM_MODAL_SPURS 5 + +/* + * (a) this should be N(a), + * (b) FreeBSD does define nitems, + * (c) it doesn't have an AH_ prefix, sigh. + */ +#define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0])) + #include "ah_internal.h" #include "ah_eeprom.h" #include "ah_devid.h" #include "ar9300eep.h" /* For Eeprom definitions */ -#include "asf_amem.h" #define AR9300_MAGIC 0x19741014 @@ -117,9 +137,9 @@ typedef struct { /* RF HAL structures */ typedef struct rf_hal_funcs { - HAL_BOOL (*set_channel)(struct ath_hal *, HAL_CHANNEL_INTERNAL *); - HAL_BOOL (*get_chip_power_lim)(struct ath_hal *ah, HAL_CHANNEL *chans, - u_int32_t nchancs); + HAL_BOOL (*set_channel)(struct ath_hal *, struct ieee80211_channel *); + HAL_BOOL (*get_chip_power_lim)(struct ath_hal *ah, + struct ieee80211_channel *chan); } RF_HAL_FUNCS; struct ar9300_ani_default { @@ -143,7 +163,7 @@ struct ar9300_ani_default { * Per-channel ANI state private to the driver. */ struct ar9300_ani_state { - HAL_CHANNEL c; + struct ieee80211_channel c; /* XXX ew? */ HAL_BOOL must_restore; HAL_BOOL ofdms_turn; u_int8_t ofdm_noise_immunity_level; @@ -256,7 +276,7 @@ struct ar9300_ar_state { }; struct ar9300_radar_state { - HAL_CHANNEL_INTERNAL *rs_chan; /* Channel info */ + struct ieee80211_channel *rs_chan; /* Channel info */ u_int8_t rs_chan_index; /* Channel index in radar structure */ u_int32_t rs_num_radar_events; /* Number of radar events */ int32_t rs_firpwr; /* Thresh to check radar sig is gone */ @@ -380,9 +400,15 @@ struct ar9300_paprd_pwr_adjust { u_int32_t sub_db; // offset value unit of dB }; +struct ar9300NfLimits { + int16_t max; + int16_t min; + int16_t nominal; +}; + #define AR9300_MAX_RATES 36 /* legacy(4) + ofdm(8) + HTSS(8) + HTDS(8) + HTTS(8)*/ struct ath_hal_9300 { - struct ath_hal_private_tables ah_priv; /* base class */ + struct ath_hal_private ah_priv; /* base class */ /* * Information retrieved from EEPROM. @@ -582,6 +608,13 @@ struct ath_hal_9300 { /* bb hang detection */ int ah_hang[6]; hal_hw_hangs_t ah_hang_wars; + + /* + * Keytable type table + */ +#define AR_KEYTABLE_SIZE 128 /* XXX! */ + uint8_t ah_keytype[AR_KEYTABLE_SIZE]; +#undef AR_KEYTABLE_SIZE /* * Support for ar9300 multiple INIs */ @@ -647,7 +680,6 @@ struct ath_hal_9300 { /* adjusted power for descriptor-based TPC for 1, 2, or 3 chains */ int16_t txpower[AR9300_MAX_RATES][AR9300_MAX_CHAINS]; - /* adjusted power for descriptor-based TPC for 1, 2, or 3 chains with STBC*/ int16_t txpower_stbc[AR9300_MAX_RATES][AR9300_MAX_CHAINS]; @@ -819,7 +851,33 @@ struct ath_hal_9300 { u_int32_t ah_mcast_filter_l32_set; u_int32_t ah_mcast_filter_u32_set; #endif - HAL_BOOL ah_reduced_self_gen_mask; + HAL_BOOL ah_reduced_self_gen_mask; + + /* Local additions for FreeBSD */ + /* + * These fields are in the top level HAL in the atheros + * codebase; here we place them in the AR9300 HAL and + * access them via accessor methods if the driver requires them. + */ + u_int32_t ah_ob_db1[3]; + u_int32_t ah_db2[3]; + u_int32_t ah_bb_panic_timeout_ms; + u_int32_t ah_bb_panic_last_status; + u_int32_t ah_tx_trig_level; + u_int16_t ath_hal_spur_chans[AR_EEPROM_MODAL_SPURS][2]; + int16_t nf_cw_int_delta; /* diff btwn nominal NF and CW interf threshold */ + int ah_phyrestart_disabled; + HAL_RSSI_TX_POWER green_tx_status; + int green_ap_ps_on; + int ah_enable_keysearch_always; + int ah_fccaifs; + int ah_reset_reason; + int ah_dcs_enable; + + struct ar9300NfLimits nf_2GHz; + struct ar9300NfLimits nf_5GHz; + struct ar9300NfLimits *nfp; + }; #define AH9300(_ah) ((struct ath_hal_9300 *)(_ah)) @@ -830,11 +888,7 @@ struct ath_hal_9300 { #define ar9300_eep_data_in_flash(_ah) \ (!(AH_PRIVATE(_ah)->ah_flags & AH_USE_EEPROM)) -#define IS_5GHZ_FAST_CLOCK_EN(_ah, _c) \ - (IS_CHAN_5GHZ(_c) && \ - ((AH_PRIVATE(_ah))->ah_config.ath_hal_fastClockEnable)) - -#if notyet +#ifdef notyet // Need these additional conditions for IS_5GHZ_FAST_CLOCK_EN when we have valid eeprom contents. && \ ((ar9300_eeprom_get(AH9300(_ah), EEP_MINOR_REV) <= AR9300_EEP_MINOR_VER_16) || \ @@ -880,9 +934,6 @@ struct ath_hal_9300 { " not supported but called from %s\n", (func)) #endif /* AH_ASSERT */ -extern void ar9300_detach(struct ath_hal *ah); -extern void ar9300_get_desc_info(struct ath_hal *ah, HAL_DESC_INFO *desc_info); - /* * Green Tx, Based on different RSSI of Received Beacon thresholds, * using different tx power by modified register tx power related values. @@ -1129,15 +1180,10 @@ extern HAL_BOOL ar9300_rf_attach(struct struct ath_hal; extern struct ath_hal_9300 * ar9300_new_state(u_int16_t devid, - HAL_ADAPTER_HANDLE osdev, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_BUS_TYPE bustype, - asf_amem_instance_handle amem_handle, - struct hal_reg_parm *hal_conf_parm, HAL_STATUS *status); + HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_STATUS *status); extern struct ath_hal * ar9300_attach(u_int16_t devid, - HAL_ADAPTER_HANDLE osdev, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_BUS_TYPE bustype, - asf_amem_instance_handle amem_handle, - struct hal_reg_parm *hal_conf_parm, + HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *status); extern void ar9300_detach(struct ath_hal *ah); extern void ar9300_read_revisions(struct ath_hal *ah); @@ -1162,6 +1208,9 @@ extern u_int32_t ar9300_get_intr_mitiga extern u_int32_t ar9300_get_key_cache_size(struct ath_hal *); extern HAL_BOOL ar9300_is_key_cache_entry_valid(struct ath_hal *, u_int16_t entry); extern HAL_BOOL ar9300_reset_key_cache_entry(struct ath_hal *ah, u_int16_t entry); +extern HAL_CHANNEL_INTERNAL * ar9300_check_chan(struct ath_hal *ah, + const struct ieee80211_channel *chan); + extern HAL_BOOL ar9300_set_key_cache_entry_mac(struct ath_hal *, u_int16_t entry, const u_int8_t *mac); extern HAL_BOOL ar9300_set_key_cache_entry(struct ath_hal *ah, u_int16_t entry, @@ -1173,13 +1222,12 @@ extern HAL_BOOL ar9300_set_mac_address( extern void ar9300_get_bss_id_mask(struct ath_hal *ah, u_int8_t *mac); extern HAL_BOOL ar9300_set_bss_id_mask(struct ath_hal *, const u_int8_t *); extern HAL_STATUS ar9300_select_ant_config(struct ath_hal *ah, u_int32_t cfg); -extern u_int32_t ar9300_ant_ctrl_common_get(struct ath_hal *ah, HAL_BOOL is_2ghz); extern HAL_BOOL ar9300_set_regulatory_domain(struct ath_hal *ah, u_int16_t reg_domain, HAL_STATUS *stats); extern u_int ar9300_get_wireless_modes(struct ath_hal *ah); extern void ar9300_enable_rf_kill(struct ath_hal *); -extern HAL_BOOL ar9300_gpio_cfg_output(struct ath_hal *, u_int32_t gpio, HAL_GPIO_OUTPUT_MUX_TYPE signalType); -extern HAL_BOOL ar9300_gpio_cfg_output_led_off(struct ath_hal *, u_int32_t gpio, HAL_GPIO_OUTPUT_MUX_TYPE signalType); +extern HAL_BOOL ar9300_gpio_cfg_output(struct ath_hal *, u_int32_t gpio, HAL_GPIO_MUX_TYPE signalType); +extern HAL_BOOL ar9300_gpio_cfg_output_led_off(struct ath_hal *, u_int32_t gpio, HAL_GPIO_MUX_TYPE signalType); extern HAL_BOOL ar9300_gpio_cfg_input(struct ath_hal *, u_int32_t gpio); extern HAL_BOOL ar9300_gpio_set(struct ath_hal *, u_int32_t gpio, u_int32_t val); extern u_int32_t ar9300_gpio_get(struct ath_hal *ah, u_int32_t gpio); @@ -1200,7 +1248,6 @@ extern int ar9300_ppm_get_trigger(struc extern u_int32_t ar9300_ppm_force(struct ath_hal *); extern void ar9300_ppm_un_force(struct ath_hal *); extern u_int32_t ar9300_ppm_get_force_state(struct ath_hal *); -extern u_int32_t ar9300_ppm_get_force_state(struct ath_hal *); extern void ar9300_set_dcs_mode(struct ath_hal *ah, u_int32_t); extern u_int32_t ar9300_get_dcs_mode(struct ath_hal *ah); extern u_int32_t ar9300_get_tsf32(struct ath_hal *ah); @@ -1219,7 +1266,8 @@ extern u_int32_t ar9300_get_rssi_chain0 extern u_int ar9300_get_def_antenna(struct ath_hal *ah); extern void ar9300_set_def_antenna(struct ath_hal *ah, u_int antenna); extern HAL_BOOL ar9300_set_antenna_switch(struct ath_hal *ah, - HAL_ANT_SETTING settings, HAL_CHANNEL *chan, u_int8_t *, u_int8_t *, u_int8_t *); + HAL_ANT_SETTING settings, const struct ieee80211_channel *chan, + u_int8_t *, u_int8_t *, u_int8_t *); extern HAL_BOOL ar9300_is_sleep_after_beacon_broken(struct ath_hal *ah); extern HAL_BOOL ar9300_set_slot_time(struct ath_hal *, u_int); extern HAL_BOOL ar9300_set_ack_timeout(struct ath_hal *, u_int); @@ -1235,7 +1283,7 @@ extern HAL_BOOL ar9300_get_diag_state(s const void *args, u_int32_t argsize, void **result, u_int32_t *resultsize); extern void ar9300_get_desc_info(struct ath_hal *ah, HAL_DESC_INFO *desc_info); -extern int8_t ar9300_get_11n_ext_busy(struct ath_hal *ah); +extern uint32_t ar9300_get_11n_ext_busy(struct ath_hal *ah); extern void ar9300_set_11n_mac2040(struct ath_hal *ah, HAL_HT_MACMODE mode); extern HAL_HT_RXCLEAR ar9300_get_11n_rx_clear(struct ath_hal *ah); extern void ar9300_set_11n_rx_clear(struct ath_hal *ah, HAL_HT_RXCLEAR rxclear); @@ -1256,7 +1304,7 @@ extern void ar9300_wow_apply_pattern(st u_int8_t *p_ath_mask, int32_t pattern_count, u_int32_t ath_pattern_len); //extern u_int32_t ar9300_wow_wake_up(struct ath_hal *ah,u_int8_t *chipPatternBytes); extern u_int32_t ar9300_wow_wake_up(struct ath_hal *ah, HAL_BOOL offloadEnable); -extern HAL_BOOL ar9300_wow_enable(struct ath_hal *ah, u_int32_t pattern_enable, u_int32_t timeout_in_seconds, int clearbssid, +extern bool ar9300_wow_enable(struct ath_hal *ah, u_int32_t pattern_enable, u_int32_t timeout_in_seconds, int clearbssid, HAL_BOOL offloadEnable); #if ATH_WOW_OFFLOAD /* ARP offload */ @@ -1318,24 +1366,25 @@ extern void ar9300_wowoffload_download_ #endif /* ATH_WOW_OFFLOAD */ #endif -extern HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, - HAL_CHANNEL *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, +extern HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, + struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask, HAL_HT_EXTPROTSPACING extprotspacing, HAL_BOOL b_channel_change, HAL_STATUS *status, int is_scan); -extern HAL_BOOL ar9300_lean_channel_change(struct ath_hal *ah, HAL_OPMODE opmode, HAL_CHANNEL *chan, +extern HAL_BOOL ar9300_lean_channel_change(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask); extern HAL_BOOL ar9300_set_reset_reg(struct ath_hal *ah, u_int32_t type); -extern void ar9300_init_pll(struct ath_hal *ah, HAL_CHANNEL *chan); +extern void ar9300_init_pll(struct ath_hal *ah, struct ieee80211_channel *chan); extern void ar9300_green_ap_ps_on_off( struct ath_hal *ah, u_int16_t rxMask); extern u_int16_t ar9300_is_single_ant_power_save_possible(struct ath_hal *ah); extern void ar9300_set_operating_mode(struct ath_hal *ah, int opmode); extern HAL_BOOL ar9300_phy_disable(struct ath_hal *ah); extern HAL_BOOL ar9300_disable(struct ath_hal *ah); -extern HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, HAL_CHANNEL *); -extern HAL_BOOL ar9300_calibration(struct ath_hal *ah, HAL_CHANNEL *chan, +extern HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *); +extern HAL_BOOL ar9300_calibration(struct ath_hal *ah, struct ieee80211_channel *chan, u_int8_t rxchainmask, HAL_BOOL longcal, HAL_BOOL *isIQdone, int is_scan, u_int32_t *sched_cals); -extern void ar9300_reset_cal_valid(struct ath_hal *ah, HAL_CHANNEL *chan, - HAL_BOOL *isIQdone, u_int32_t cal_type); +extern void ar9300_reset_cal_valid(struct ath_hal *ah, + const struct ieee80211_channel *chan, + HAL_BOOL *isIQdone, u_int32_t cal_type); extern void ar9300_iq_cal_collect(struct ath_hal *ah, u_int8_t num_chains); extern void ar9300_iq_calibration(struct ath_hal *ah, u_int8_t num_chains); extern void ar9300_temp_comp_cal_collect(struct ath_hal *ah); @@ -1346,7 +1395,7 @@ extern void ar9300_upload_noise_floor(st extern HAL_BOOL ar9300_set_tx_power_limit(struct ath_hal *ah, u_int32_t limit, u_int16_t extra_txpow, u_int16_t tpc_in_db); extern void ar9300_chain_noise_floor(struct ath_hal *ah, int16_t *nf_buf, - HAL_CHANNEL *chan, int is_scan); + struct ieee80211_channel *chan, int is_scan); extern HAL_BOOL ar9300_load_nf(struct ath_hal *ah, int16_t nf[]); extern HAL_RFGAIN ar9300_get_rfgain(struct ath_hal *ah); @@ -1354,11 +1403,14 @@ extern const HAL_RATE_TABLE *ar9300_get_ extern int16_t ar9300_get_rate_txpower(struct ath_hal *ah, u_int mode, u_int8_t rate_index, u_int8_t chainmask, u_int8_t mimo_mode); extern void ar9300_init_rate_txpower(struct ath_hal *ah, u_int mode, - HAL_CHANNEL_INTERNAL *chan, + const struct ieee80211_channel *chan, u_int8_t powerPerRate[], u_int8_t chainmask); extern void ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, u_int8_t powerPerRate[]); +extern HAL_STATUS ath_hal_get_rate_power_limit_from_eeprom(struct ath_hal *ah, + u_int16_t freq, int8_t *max_rate_power, int8_t *min_rate_power); + extern void ar9300_reset_tx_status_ring(struct ath_hal *ah); extern void ar9300_enable_mib_counters(struct ath_hal *); extern void ar9300_disable_mib_counters(struct ath_hal *); @@ -1371,7 +1423,7 @@ struct ath_rx_status; extern void ar9300_process_mib_intr(struct ath_hal *, const HAL_NODE_STATS *); extern void ar9300_ani_ar_poll(struct ath_hal *, const HAL_NODE_STATS *, - HAL_CHANNEL *, HAL_ANISTATS *); + const struct ieee80211_channel *, HAL_ANISTATS *); extern void ar9300_ani_reset(struct ath_hal *, HAL_BOOL is_scanning); extern void ar9300_ani_init_defaults(struct ath_hal *ah, HAL_HT_MACMODE macmode); extern void ar9300_enable_tpc(struct ath_hal *); @@ -1381,9 +1433,8 @@ extern void ar9300_rx_gain_table_apply(s extern void ar9300_tx_gain_table_apply(struct ath_hal *ah); extern void ar9300_mat_enable(struct ath_hal *ah, int enable); extern void ar9300_dump_keycache(struct ath_hal *ah, int n, u_int32_t *entry); -extern HAL_BOOL ar9300_ant_ctrl_set_lna_div_use_bt_ant(struct ath_hal * ah, HAL_BOOL enable, HAL_CHANNEL * chan); +extern HAL_BOOL ar9300_ant_ctrl_set_lna_div_use_bt_ant(struct ath_hal * ah, HAL_BOOL enable, const struct ieee80211_channel * chan); -#ifdef AH_SUPPORT_AR9300 /* BB Panic Watchdog declarations */ #define HAL_BB_PANIC_WD_TMO 25 /* in ms, 0 to disable */ #define HAL_BB_PANIC_WD_TMO_HORNET 85 @@ -1391,17 +1442,15 @@ extern void ar9300_config_bb_panic_watch extern void ar9300_handle_bb_panic(struct ath_hal *); extern int ar9300_get_bb_panic_info(struct ath_hal *ah, struct hal_bb_panic_info *bb_panic); extern HAL_BOOL ar9300_handle_radar_bb_panic(struct ath_hal *ah); -#endif extern void ar9300_set_hal_reset_reason(struct ath_hal *ah, u_int8_t resetreason); /* DFS declarations */ -#ifdef ATH_SUPPORT_DFS -extern void ar9300_check_dfs(struct ath_hal *ah, HAL_CHANNEL *chan); -extern void ar9300_dfs_found(struct ath_hal *ah, HAL_CHANNEL *chan, +extern void ar9300_check_dfs(struct ath_hal *ah, struct ieee80211_channel *chan); +extern void ar9300_dfs_found(struct ath_hal *ah, struct ieee80211_channel *chan, u_int64_t nolTime); extern void ar9300_enable_dfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); extern void ar9300_get_dfs_thresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); -extern HAL_BOOL ar9300_radar_wait(struct ath_hal *ah, HAL_CHANNEL *chan); +extern HAL_BOOL ar9300_radar_wait(struct ath_hal *ah, struct ieee80211_channel *chan); extern struct dfs_pulse * ar9300_get_dfs_radars(struct ath_hal *ah, u_int32_t dfsdomain, int *numradars, struct dfs_bin5pulse **bin5pulses, int *numb5radars, HAL_PHYERR_PARAM *pe); @@ -1409,9 +1458,8 @@ extern void ar9300_adjust_difs(struct a extern u_int32_t ar9300_dfs_config_fft(struct ath_hal *ah, HAL_BOOL is_enable); extern void ar9300_cac_tx_quiet(struct ath_hal *ah, HAL_BOOL enable); extern void ar9300_dfs_cac_war(struct ath_hal *ah, u_int32_t start); -#endif -extern HAL_CHANNEL * ar9300_get_extension_channel(struct ath_hal *ah); +extern struct ieee80211_channel * ar9300_get_extension_channel(struct ath_hal *ah); extern HAL_BOOL ar9300_is_fast_clock_enabled(struct ath_hal *ah); @@ -1440,16 +1488,16 @@ extern HAL_STATUS ar9300_calc_adc_ref_po extern HAL_STATUS ar9300_get_min_agc_gain(struct ath_hal *ah, int freq_mhz, int32_t *chain_gain, int num_chain_gain); extern HAL_BOOL ar9300_reset_11n(struct ath_hal *ah, HAL_OPMODE opmode, - HAL_CHANNEL *chan, HAL_BOOL b_channel_change, HAL_STATUS *status); + struct ieee80211_channel *chan, HAL_BOOL b_channel_change, HAL_STATUS *status); extern void ar9300_set_coverage_class(struct ath_hal *ah, u_int8_t coverageclass, int now); extern void ar9300_get_channel_centers(struct ath_hal *ah, - HAL_CHANNEL_INTERNAL *chan, + const struct ieee80211_channel *chan, CHAN_CENTERS *centers); extern u_int16_t ar9300_get_ctl_center(struct ath_hal *ah, - HAL_CHANNEL_INTERNAL *chan); + const struct ieee80211_channel *chan); extern u_int16_t ar9300_get_ext_center(struct ath_hal *ah, - HAL_CHANNEL_INTERNAL *chan); + const struct ieee80211_channel *chan); extern u_int32_t ar9300_get_mib_cycle_counts_pct(struct ath_hal *, u_int32_t*, u_int32_t*, u_int32_t*); extern void ar9300_dma_reg_dump(struct ath_hal *); @@ -1485,20 +1533,20 @@ extern void ar9300_chk_rssi_update_tx_pw extern HAL_BOOL ar9300_is_skip_paprd_by_greentx(struct ath_hal *ah); extern void ar9300_control_signals_for_green_tx_mode(struct ath_hal *ah); extern void ar9300_hwgreentx_set_pal_spare(struct ath_hal *ah, int value); +extern HAL_BOOL ar9300_is_ani_noise_spur(struct ath_hal *ah); extern void ar9300_reset_hw_beacon_proc_crc(struct ath_hal *ah); extern int32_t ar9300_get_hw_beacon_rssi(struct ath_hal *ah); extern void ar9300_set_hw_beacon_rssi_threshold(struct ath_hal *ah, u_int32_t rssi_threshold); extern void ar9300_reset_hw_beacon_rssi(struct ath_hal *ah); extern void ar9300_set_hw_beacon_proc(struct ath_hal *ah, HAL_BOOL on); -extern HAL_BOOL ar9300_is_ani_noise_spur(struct ath_hal *ah); extern void ar9300_get_vow_stats(struct ath_hal *ah, HAL_VOWSTATS *p_stats, u_int8_t); extern int ar9300_get_spur_info(struct ath_hal * ah, int *enable, int len, u_int16_t *freq); extern int ar9300_set_spur_info(struct ath_hal * ah, int enable, int len, u_int16_t *freq); extern void ar9300_wow_set_gpio_reset_low(struct ath_hal * ah); -extern void ar9300_get_mib_cycle_counts(struct ath_hal *, HAL_COUNTERS*); +extern HAL_BOOL ar9300_get_mib_cycle_counts(struct ath_hal *, HAL_SURVEY_SAMPLE *); extern void ar9300_clear_mib_counters(struct ath_hal *ah); /* EEPROM interface functions */ @@ -1512,12 +1560,12 @@ extern u_int32_t ar9300_ini_fixup(struc u_int32_t val); extern HAL_STATUS ar9300_eeprom_set_transmit_power(struct ath_hal *ah, - ar9300_eeprom_t *p_eep_data, HAL_CHANNEL_INTERNAL *chan, + ar9300_eeprom_t *p_eep_data, const struct ieee80211_channel *chan, u_int16_t cfg_ctl, u_int16_t twice_antenna_reduction, u_int16_t twice_max_regulatory_power, u_int16_t power_limit); -extern void ar9300_eeprom_set_addac(struct ath_hal *, HAL_CHANNEL_INTERNAL *); +extern void ar9300_eeprom_set_addac(struct ath_hal *, struct ieee80211_channel *); extern HAL_BOOL ar9300_eeprom_set_param(struct ath_hal *ah, EEPROM_PARAM param, u_int32_t value); -extern HAL_BOOL ar9300_eeprom_set_board_values(struct ath_hal *, HAL_CHANNEL_INTERNAL *); +extern HAL_BOOL ar9300_eeprom_set_board_values(struct ath_hal *, const struct ieee80211_channel *); extern HAL_BOOL ar9300_eeprom_read_word(struct ath_hal *, u_int off, u_int16_t *data); extern HAL_BOOL ar9300_eeprom_read(struct ath_hal *ah, long address, u_int8_t *buffer, int many); extern HAL_BOOL ar9300_otp_read(struct ath_hal *ah, u_int off, u_int32_t *data, HAL_BOOL is_wifi); @@ -1526,7 +1574,7 @@ extern HAL_BOOL ar9300_flash_read(struc extern HAL_BOOL ar9300_flash_write(struct ath_hal *, u_int off, u_int16_t data); extern u_int ar9300_eeprom_dump_support(struct ath_hal *ah, void **pp_e); extern u_int8_t ar9300_eeprom_get_num_ant_config(struct ath_hal_9300 *ahp, HAL_FREQ_BAND freq_band); -extern HAL_STATUS ar9300_eeprom_get_ant_cfg(struct ath_hal_9300 *ahp, HAL_CHANNEL_INTERNAL *chan, +extern HAL_STATUS ar9300_eeprom_get_ant_cfg(struct ath_hal_9300 *ahp, const struct ieee80211_channel *chan, u_int8_t index, u_int16_t *config); extern u_int8_t* ar9300_eeprom_get_cust_data(struct ath_hal_9300 *ahp); extern u_int8_t *ar9300_eeprom_get_spur_chans_ptr(struct ath_hal *ah, HAL_BOOL is_2ghz); @@ -1625,7 +1673,7 @@ extern HAL_BOOL ar9300Get3StreamSignatur #ifdef ATH_TX99_DIAG #ifndef ATH_SUPPORT_HTC -extern void ar9300_tx99_channel_pwr_update(struct ath_hal *ah, HAL_CHANNEL *c, u_int32_t txpower); +extern void ar9300_tx99_channel_pwr_update(struct ath_hal *ah, struct ieee80211_channel *c, u_int32_t txpower); extern void ar9300_tx99_chainmsk_setup(struct ath_hal *ah, int tx_chainmask); extern void ar9300_tx99_set_single_carrier(struct ath_hal *ah, int tx_chain_mask, int chtype); extern void ar9300_tx99_start(struct ath_hal *ah, u_int8_t *data); Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Sun Apr 28 00:53:31 2013 (r250007) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Sun Apr 28 00:57:47 2013 (r250008) @@ -16,12 +16,10 @@ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR9300 - #include "ah.h" #include "ah_internal.h" #include "ah_desc.h" -#include "ah_pktlog.h" +//#include "ah_pktlog.h" #include "ar9300/ar9300.h" #include "ar9300/ar9300reg.h" @@ -30,7 +28,7 @@ extern void ar9300_set_rx_filter(struct ath_hal *ah, u_int32_t bits); extern u_int32_t ar9300_get_rx_filter(struct ath_hal *ah); -#define HAL_ANI_DEBUG 0 +#define HAL_ANI_DEBUG 1 /* * Anti noise immunity support. We track phy errors and react @@ -47,7 +45,7 @@ extern u_int32_t ar9300_get_rx_filter(s #define HAL_ANI_OFDM_TRIG_LOW 400 /* units are errors per second */ #define HAL_ANI_CCK_TRIG_HIGH 600 /* units are errors per second */ #define HAL_ANI_CCK_TRIG_LOW 300 /* units are errors per second */ -#define HAL_ANI_USE_OFDM_WEAK_SIG true +#define HAL_ANI_USE_OFDM_WEAK_SIG AH_TRUE #define HAL_ANI_ENABLE_MRC_CCK AH_TRUE /* default is enabled */ #define HAL_ANI_DEF_SPUR_IMMUNE_LVL 3 #define HAL_ANI_DEF_FIRSTEP_LVL 2 @@ -177,18 +175,20 @@ ar9300_disable_mib_counters(struct ath_h * ah_ani values and only the channel field needs to be set. */ static int -ar9300_get_ani_channel_index(struct ath_hal *ah, HAL_CHANNEL_INTERNAL *chan) +ar9300_get_ani_channel_index(struct ath_hal *ah, + const struct ieee80211_channel *chan) { struct ath_hal_9300 *ahp = AH9300(ah); int i; for (i = 0; i < ARRAY_LENGTH(ahp->ah_ani); i++) { - if (ahp->ah_ani[i].c.channel == chan->channel) { + /* XXX this doesn't distinguish between 20/40 channels */ + if (ahp->ah_ani[i].c.ic_freq == chan->ic_freq) { return i; } - if (ahp->ah_ani[i].c.channel == 0) { - ahp->ah_ani[i].c.channel = chan->channel; - ahp->ah_ani[i].c.channel_flags = chan->channel_flags; + if (ahp->ah_ani[i].c.ic_freq == 0) { + ahp->ah_ani[i].c.ic_freq = chan->ic_freq; + ahp->ah_ani[i].c.ic_flags = chan->ic_flags; return i; } } @@ -268,7 +268,7 @@ ar9300_ani_attach(struct ath_hal *ah) ar9300_enable_mib_counters(ah); ahp->ah_ani_period = HAL_ANI_PERIOD; - if (AH_PRIVATE(ah)->ah_config.ath_hal_enable_ani) { + if (ah->ah_config.ath_hal_enable_ani) { ahp->ah_proc_phy_err |= HAL_PROCESS_ANI; } } @@ -295,7 +295,7 @@ ar9300_ani_init_defaults(struct ath_hal { struct ath_hal_9300 *ahp = AH9300(ah); struct ar9300_ani_state *ani_state; - HAL_CHANNEL_INTERNAL *chan = AH_PRIVATE(ah)->ah_curchan; + const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan; int index; u_int32_t val; @@ -307,7 +307,7 @@ ar9300_ani_init_defaults(struct ath_hal HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ver %d.%d opmode %u chan %d Mhz/0x%x macmode %d\n", __func__, AH_PRIVATE(ah)->ah_macVersion, AH_PRIVATE(ah)->ah_macRev, - AH_PRIVATE(ah)->ah_opmode, chan->channel, chan->channel_flags, macmode); + AH_PRIVATE(ah)->ah_opmode, chan->ic_freq, chan->ic_flags, macmode); val = OS_REG_READ(ah, AR_PHY_SFCORR); ani_state->ini_def.m1_thresh = MS(val, AR_PHY_SFCORR_M1_THRESH); @@ -457,16 +457,16 @@ ar9300_ani_control(struct ath_hal *ah, H { struct ath_hal_9300 *ahp = AH9300(ah); struct ar9300_ani_state *ani_state = ahp->ah_curani; - HAL_CHANNEL_INTERNAL *chan = AH_PRIVATE(ah)->ah_curchan; + const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan; int32_t value, value2; u_int level = param; u_int is_on; - if (chan == NULL && cmd != HAL_ANI_MODE) { - HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, + if (chan == NULL && cmd != HAL_ANI_MODE) { + HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "%s: ignoring cmd 0x%02x - no channel\n", __func__, cmd); - return AH_FALSE; - } + return AH_FALSE; + } switch (cmd & ahp->ah_ani_function) { case HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION: @@ -538,7 +538,7 @@ ar9300_ani_control(struct ath_hal *ah, H if (!is_on != ani_state->ofdm_weak_sig_detect_off) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: ofdm weak signal: %s=>%s\n", - __func__, chan->channel, + __func__, chan->ic_freq, !ani_state->ofdm_weak_sig_detect_off ? "on" : "off", is_on ? "on" : "off"); if (is_on) { @@ -592,12 +592,12 @@ ar9300_ani_control(struct ath_hal *ah, H if (level != ani_state->firstep_level) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: level %d=>%d[def:%d] firstep[level]=%d ini=%d\n", - __func__, chan->channel, ani_state->firstep_level, level, + __func__, chan->ic_freq, ani_state->firstep_level, level, HAL_ANI_DEF_FIRSTEP_LVL, value, ani_state->ini_def.firstep); HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: level %d=>%d[def:%d] " "firstep_low[level]=%d ini=%d\n", - __func__, chan->channel, ani_state->firstep_level, level, + __func__, chan->ic_freq, ani_state->firstep_level, level, HAL_ANI_DEF_FIRSTEP_LVL, value2, ani_state->ini_def.firstep_low); if (level > ani_state->firstep_level) { @@ -651,13 +651,13 @@ ar9300_ani_control(struct ath_hal *ah, H HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: level %d=>%d[def:%d] " "cycpwr_thr1[level]=%d ini=%d\n", - __func__, chan->channel, ani_state->spur_immunity_level, level, + __func__, chan->ic_freq, ani_state->spur_immunity_level, level, HAL_ANI_DEF_SPUR_IMMUNE_LVL, value, ani_state->ini_def.cycpwr_thr1); HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: level %d=>%d[def:%d] " "cycpwr_thr1_ext[level]=%d ini=%d\n", - __func__, chan->channel, ani_state->spur_immunity_level, level, + __func__, chan->ic_freq, ani_state->spur_immunity_level, level, HAL_ANI_DEF_SPUR_IMMUNE_LVL, value2, ani_state->ini_def.cycpwr_thr1_ext); if (level > ani_state->spur_immunity_level) { @@ -682,7 +682,7 @@ ar9300_ani_control(struct ath_hal *ah, H } if (!is_on != ani_state->mrc_cck_off) { HALDEBUG(ah, HAL_DEBUG_ANI, - "%s: ** ch %d: MRC CCK: %s=>%s\n", __func__, chan->channel, + "%s: ** ch %d: MRC CCK: %s=>%s\n", __func__, chan->ic_freq, !ani_state->mrc_cck_off ? "on" : "off", is_on ? "on" : "off"); if (is_on) { ahp->ah_stats.ast_ani_ccklow++; @@ -857,7 +857,8 @@ ar9300_ani_reset(struct ath_hal *ah, HAL { struct ath_hal_9300 *ahp = AH9300(ah); struct ar9300_ani_state *ani_state; - HAL_CHANNEL_INTERNAL *chan = AH_PRIVATE(ah)->ah_curchan; + const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan; + HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan); int index; HALASSERT(chan != AH_NULL); @@ -881,7 +882,7 @@ ar9300_ani_reset(struct ath_hal *ah, HAL /* only allow a subset of functions in AP mode */ if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) { - if (IS_CHAN_2GHZ(chan)) { + if (IS_CHAN_2GHZ(ichan)) { ahp->ah_ani_function = (HAL_ANI_SPUR_IMMUNITY_LEVEL | HAL_ANI_FIRSTEP_LEVEL | HAL_ANI_MRC_CCK); @@ -908,8 +909,8 @@ ar9300_ani_reset(struct ath_hal *ah, HAL HALDEBUG(ah, HAL_DEBUG_ANI, "%s: Restore defaults: opmode %u chan %d Mhz/0x%x " "is_scanning=%d restore=%d ofdm:%d cck:%d\n", - __func__, AH_PRIVATE(ah)->ah_opmode, chan->channel, - chan->channel_flags, is_scanning, ani_state->must_restore, + __func__, AH_PRIVATE(ah)->ah_opmode, chan->ic_freq, + chan->ic_flags, is_scanning, ani_state->must_restore, ani_state->ofdm_noise_immunity_level, ani_state->cck_noise_immunity_level); /* @@ -941,8 +942,8 @@ ar9300_ani_reset(struct ath_hal *ah, HAL HALDEBUG(ah, HAL_DEBUG_ANI, "%s: Restore history: opmode %u chan %d Mhz/0x%x is_scanning=%d " "restore=%d ofdm:%d cck:%d\n", - __func__, AH_PRIVATE(ah)->ah_opmode, chan->channel, - chan->channel_flags, is_scanning, ani_state->must_restore, + __func__, AH_PRIVATE(ah)->ah_opmode, chan->ic_freq, + chan->ic_flags, is_scanning, ani_state->must_restore, ani_state->ofdm_noise_immunity_level, ani_state->cck_noise_immunity_level); ar9300_ani_set_odfm_noise_immunity_level( @@ -1041,7 +1042,8 @@ ar9300_ani_lower_immunity(struct ath_hal } /* convert HW counter values to ms using mode specifix clock rate */ -#define CLOCK_RATE(_ah) (ath_hal_chan_2_clock_rate_mhz(_ah) * 1000) +//#define CLOCK_RATE(_ah) (ath_hal_chan_2_clock_rate_mhz(_ah) * 1000) +#define CLOCK_RATE(_ah) (ath_hal_mac_clks(ah, 1000)) /* * Return an approximation of the time spent ``listening'' by @@ -1098,7 +1100,7 @@ ar9300_ani_get_listen_time(struct ath_ha */ void ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_STATS *stats, - HAL_CHANNEL *chan, HAL_ANISTATS *ani_stats) + const struct ieee80211_channel *chan, HAL_ANISTATS *ani_stats) { struct ath_hal_9300 *ahp = AH9300(ah); struct ar9300_ani_state *ani_state; @@ -1274,4 +1276,3 @@ ar9300_is_ani_noise_spur(struct ath_hal return ani_state->phy_noise_spur; } -#endif /* AH_SUPPORT_AR9300 */ Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Apr 28 00:53:31 2013 (r250007) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Apr 28 00:57:47 2013 (r250008) @@ -16,8 +16,6 @@ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR9300 - #include "ah.h" #include "ah_internal.h" #include "ah_devid.h" @@ -28,6 +26,9 @@ #include "ar9300/ar9300phy.h" #include "ar9300/ar9300paprd.h" +#include "ar9300/ar9300_stub.h" +#include "ar9300/ar9300_stub_funcs.h" + /* Add static register initialization vectors */ #include "ar9300/ar9300_osprey22.ini" @@ -43,16 +44,23 @@ #include "ar9300/ar9300_aphrodite10.ini" +/* Include various freebsd specific HAL methods */ +#include "ar9300/ar9300_freebsd.h" + +/* XXX duplicate in ar9300_radio.c ? */ static HAL_BOOL ar9300_get_chip_power_limits(struct ath_hal *ah, - HAL_CHANNEL *chans, u_int32_t nchans); + struct ieee80211_channel *chan); static inline HAL_STATUS ar9300_init_mac_addr(struct ath_hal *ah); static inline HAL_STATUS ar9300_hw_attach(struct ath_hal *ah); static inline void ar9300_hw_detach(struct ath_hal *ah); static int16_t ar9300_get_nf_adjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c); +#if 0 int ar9300_get_cal_intervals(struct ath_hal *ah, HAL_CALIBRATION_TIMER **timerp, HAL_CAL_QUERY query); +#endif + #if ATH_TRAFFIC_FAST_RECOVER unsigned long ar9300_get_pll3_sqsum_dvc(struct ath_hal *ah); #endif @@ -69,6 +77,7 @@ static const HAL_PERCAL_DATA iq_cal_sing ar9300_iq_cal_collect, ar9300_iq_calibration}; +#if 0 static HAL_CALIBRATION_TIMER ar9300_cals[] = { {IQ_MISMATCH_CAL, /* Cal type */ 1200000, /* Cal interval */ @@ -79,7 +88,8 @@ static HAL_CALIBRATION_TIMER ar9300_cals 0 }, }; - +#endif + #if ATH_PCIE_ERROR_MONITOR int ar9300_start_pcie_error_monitor(struct ath_hal *ah, int b_auto_stop) @@ -162,6 +172,7 @@ int ar9300_stop_pcie_error_monitor(struc #endif /* ATH_PCIE_ERROR_MONITOR */ +#if 0 /* WIN32 does not support C99 */ static const struct ath_hal_private ar9300hal = { { @@ -526,6 +537,7 @@ static const struct ath_hal_private ar93 ar9300_get_nf_adjust, /* ah_get_nf_adjust */ /* rest is zero'd by compiler */ }; +#endif /* * Read MAC version/revision information from Chip registers and initialize @@ -543,7 +555,7 @@ ar9300_read_revisions(struct ath_hal *ah if (AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_AR9340) { /* XXX: AR_SREV register in Wasp reads 0 */ AH_PRIVATE(ah)->ah_macVersion = AR_SREV_VERSION_WASP; - } else if(AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_AR955X) { + } else if(AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_QCA955X) { /* XXX: AR_SREV register in Scorpion reads 0 */ AH_PRIVATE(ah)->ah_macVersion = AR_SREV_VERSION_SCORPION; } else { @@ -592,10 +604,10 @@ ar9300_read_revisions(struct ath_hal *ah AH_PRIVATE(ah)->ah_macRev = MS(val, AR_SREV_REVISION2); if (AR_SREV_JUPITER(ah) || AR_SREV_APHRODITE(ah)) { - AH_PRIVATE(ah)->ah_is_pci_express = AH_TRUE; + AH_PRIVATE(ah)->ah_ispcie = AH_TRUE; } else { - AH_PRIVATE(ah)->ah_is_pci_express = + AH_PRIVATE(ah)->ah_ispcie = (val & AR_SREV_TYPE2_HOST_MODE) ? 0 : 1; } @@ -605,39 +617,47 @@ ar9300_read_revisions(struct ath_hal *ah * Attach for an AR9300 part. */ struct ath_hal * -ar9300_attach(u_int16_t devid, HAL_ADAPTER_HANDLE osdev, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_BUS_TYPE bustype, - asf_amem_instance_handle amem_handle, - struct hal_reg_parm *hal_conf_parm, HAL_STATUS *status) +ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, + HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *status) { struct ath_hal_9300 *ahp; struct ath_hal *ah; struct ath_hal_private *ahpriv; HAL_STATUS ecode; - HAL_NO_INTERSPERSED_READS; + HAL_NO_INTERSPERSED_READS; /* NB: memory is returned zero'd */ - ahp = ar9300_new_state( - devid, osdev, sc, st, sh, bustype, amem_handle, hal_conf_parm, status); + ahp = ar9300_new_state(devid, sc, st, sh, eepromdata, status); if (ahp == AH_NULL) { return AH_NULL; } - ah = &ahp->ah_priv.priv.h; + ah = &ahp->ah_priv.h; ar9300_init_offsets(ah, devid); ahpriv = AH_PRIVATE(ah); - AH_PRIVATE(ah)->ah_bustype = bustype; +// AH_PRIVATE(ah)->ah_bustype = bustype; + + /* FreeBSD: to make OTP work for now, provide this.. */ + AH9300(ah)->ah_cal_mem = ath_hal_malloc(HOST_CALDATA_SIZE); + + /* XXX FreeBSD: enable RX mitigation */ + ah->ah_config.ath_hal_intr_mitigation_rx = 1; + /* + * XXX what's this do? Check in the qcamain driver code + * as to what it does. + */ + ah->ah_config.ath_hal_ext_atten_margin_cfg = 0; /* interrupt mitigation */ #ifdef AR5416_INT_MITIGATION - if (ahpriv->ah_config.ath_hal_intr_mitigation_rx != 0) { + if (ah->ah_config.ath_hal_intr_mitigation_rx != 0) { ahp->ah_intr_mitigation_rx = AH_TRUE; } #else /* Enable Rx mitigation (default) */ ahp->ah_intr_mitigation_rx = AH_TRUE; - ahpriv->ah_config.ath_hal_intr_mitigation_rx = 1; + ah->ah_config.ath_hal_intr_mitigation_rx = 1; #endif #ifdef HOST_OFFLOAD @@ -645,12 +665,12 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT if (AR_SREV_HORNET(ah)) { ahp->ah_intr_mitigation_rx = AH_FALSE; #ifdef AR5416_INT_MITIGATION - ahpriv->ah_config.ath_hal_intr_mitigation_rx = 0; + ah->ah_config.ath_hal_intr_mitigation_rx = 0; #endif } #endif - if (ahpriv->ah_config.ath_hal_intr_mitigation_tx != 0) { + if (ah->ah_config.ath_hal_intr_mitigation_tx != 0) { ahp->ah_intr_mitigation_tx = AH_TRUE; } @@ -685,9 +705,11 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT #if ATH_SUPPORT_MCI if (AR_SREV_JUPITER(ah) || AR_SREV_APHRODITE(ah)) { +#if 0 ah->ah_bt_coex_set_weights = ar9300_mci_bt_coex_set_weights; ah->ah_bt_coex_disable = ar9300_mci_bt_coex_disable; ah->ah_bt_coex_enable = ar9300_mci_bt_coex_enable; +#endif ahp->ah_mci_ready = AH_FALSE; ahp->ah_mci_bt_state = MCI_BT_SLEEP; ahp->ah_mci_coex_major_version_wlan = MCI_GPM_COEX_MAJOR_VERSION_WLAN; @@ -772,9 +794,9 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT } /* No serialization of Register Accesses needed. */ - ahpriv->ah_config.ath_hal_serialize_reg_mode = SER_REG_MODE_OFF; - HALDEBUG(ah, HAL_DEBUG_RESET, "%s: ath_hal_serialize_reg_mode is %d\n", - __func__, ahpriv->ah_config.ath_hal_serialize_reg_mode); + ah->ah_config.ah_serialise_reg_war = SER_REG_MODE_OFF; + HALDEBUG(ah, HAL_DEBUG_RESET, "%s: ah_serialise_reg_war is %d\n", + __func__, ah->ah_config.ah_serialise_reg_war); /* * Add mac revision check when needed. @@ -798,7 +820,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT goto bad; } - ahpriv->ah_phy_rev = OS_REG_READ(ah, AR_PHY_CHIP_ID); + AH_PRIVATE(ah)->ah_phyRev = OS_REG_READ(ah, AR_PHY_CHIP_ID); /* Setup supported calibrations */ ahp->ah_iq_cal_data.cal_data = &iq_cal_single_sample; @@ -858,7 +880,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT ar9331_modes_lowest_ob_db_tx_gain_hornet1_2, ARRAY_LENGTH(ar9331_modes_lowest_ob_db_tx_gain_hornet1_2), 5); - ahpriv->ah_config.ath_hal_pcie_power_save_enable = 0; + ah->ah_config.ath_hal_pcie_power_save_enable = 0; /* Japan 2484Mhz CCK settings */ INIT_INI_ARRAY(&ahp->ah_ini_japan2484, @@ -926,7 +948,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT ar9331_modes_lowest_ob_db_tx_gain_hornet1_1, ARRAY_LENGTH(ar9331_modes_lowest_ob_db_tx_gain_hornet1_1), 5); - ahpriv->ah_config.ath_hal_pcie_power_save_enable = 0; + ah->ah_config.ath_hal_pcie_power_save_enable = 0; /* Japan 2484Mhz CCK settings */ INIT_INI_ARRAY(&ahp->ah_ini_japan2484, @@ -1003,13 +1025,13 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT ar9485_poseidon1_1_baseband_core_txfir_coeff_japan_2484), 2); /* Load PCIE SERDES settings from INI */ - if (ahpriv->ah_config.ath_hal_pcie_clock_req) { + if (ah->ah_config.ath_hal_pcie_clock_req) { /* Pci-e Clock Request = 1 */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_CONTROL) { /* Sleep Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D3) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes, @@ -1025,7 +1047,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT 2); } /* Awake Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D0) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes_low_power, @@ -1056,11 +1078,11 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT } } else { /* Pci-e Clock Request = 0 */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_CONTROL) { /* Sleep Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D3) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes, @@ -1076,7 +1098,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT 2); } /* Awake Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D0) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes_low_power, @@ -1107,7 +1129,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT } } /* pcie ps setting will honor registry setting, default is 0 */ - //ahpriv->ah_config.ath_hal_pciePowerSaveEnable = 0; + //ah->ah_config.ath_hal_pciePowerSaveEnable = 0; } else if (AR_SREV_POSEIDON(ah)) { /* mac */ INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_PRE], NULL, 0, 0); @@ -1160,13 +1182,13 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT ar9485_poseidon1_0_baseband_core_txfir_coeff_japan_2484), 2); /* Load PCIE SERDES settings from INI */ - if (ahpriv->ah_config.ath_hal_pcie_clock_req) { + if (ah->ah_config.ath_hal_pcie_clock_req) { /* Pci-e Clock Request = 1 */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_CONTROL) { /* Sleep Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D3) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes, @@ -1182,7 +1204,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT 2); } /* Awake Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D0) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes_low_power, @@ -1215,11 +1237,11 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT } } else { /* Pci-e Clock Request = 0 */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_CONTROL) { /* Sleep Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D3) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes, @@ -1235,7 +1257,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT 2); } /* Awake Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D0) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes_low_power, @@ -1268,7 +1290,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT } } /* pcie ps setting will honor registry setting, default is 0 */ - /*ahpriv->ah_config.ath_hal_pcie_power_save_enable = 0;*/ + /*ah->ah_config.ath_hal_pcie_power_save_enable = 0;*/ #if 0 /* ATH_WOW */ /* SerDes values during WOW sleep */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 01:03:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49A4BC98; Sun, 28 Apr 2013 01:03:03 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC7F1155; Sun, 28 Apr 2013 01:03:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S130LG047938; Sun, 28 Apr 2013 01:03:00 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S130A9047932; Sun, 28 Apr 2013 01:03:00 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304280103.r3S130A9047932@svn.freebsd.org> From: Neel Natu Date: Sun, 28 Apr 2013 01:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250009 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 01:03:03 -0000 Author: neel Date: Sun Apr 28 01:02:59 2013 New Revision: 250009 URL: http://svnweb.freebsd.org/changeset/base/250009 Log: Get rid of the 'vsc_rxpend' state - it doesn't serve any purpose because we drop any frames that arrive while the device is starved for receive buffers. This makes the receive path to only execute in context of the receive thread and allows for further simplification. Reviewed by: grehan Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Sun Apr 28 00:57:47 2013 (r250008) +++ head/usr.sbin/bhyve/pci_virtio_net.c Sun Apr 28 01:02:59 2013 (r250009) @@ -140,7 +140,6 @@ struct pci_vtnet_softc { int vsc_isr; int vsc_tapfd; int vsc_rx_ready; - int vsc_rxpend; int tx_in_progress; int resetting; @@ -323,14 +322,6 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc if (ndescs == 0) { /* - * Need to wait for host notification to read - */ - if (sc->vsc_rxpend == 0) { - WPRINTF(("vtnet: no rx descriptors !\n")); - sc->vsc_rxpend = 1; - } - - /* * Drop the packet and try later */ (void) read(sc->vsc_tapfd, dummybuf, sizeof(dummybuf)); @@ -417,17 +408,6 @@ pci_vtnet_ping_rxq(struct pci_vtnet_soft if (sc->vsc_rx_ready == 0) { sc->vsc_rx_ready = 1; } - - /* - * If the rx queue was empty, attempt to receive a - * packet that was previously blocked due to no rx bufs - * available - */ - if (sc->vsc_rxpend) { - WPRINTF(("vtnet: rx resumed\n\r")); - sc->vsc_rxpend = 0; - pci_vtnet_tap_rx(sc); - } } static void From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 02:23:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 75EB024C; Sun, 28 Apr 2013 02:23:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6844C1438; Sun, 28 Apr 2013 02:23:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S2Nees076383; Sun, 28 Apr 2013 02:23:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S2Ne5w076382; Sun, 28 Apr 2013 02:23:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304280223.r3S2Ne5w076382@svn.freebsd.org> From: Eitan Adler Date: Sun, 28 Apr 2013 02:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250012 - head/share/examples/BSD_daemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 02:23:40 -0000 Author: eadler Date: Sun Apr 28 02:23:39 2013 New Revision: 250012 URL: http://svnweb.freebsd.org/changeset/base/250012 Log: Add an alternate version of beastie to the examples directory. PR: docs/38556 Submitted by: Rahul Siddharthan Submitted on: 25 May 2002 22:49:56 -0000 MFC After: 2 weeks Added: head/share/examples/BSD_daemon/beastie2.eps (contents, props changed) Modified: head/share/examples/BSD_daemon/README Modified: head/share/examples/BSD_daemon/README ============================================================================== --- head/share/examples/BSD_daemon/README Sun Apr 28 02:04:33 2013 (r250011) +++ head/share/examples/BSD_daemon/README Sun Apr 28 02:23:39 2013 (r250012) @@ -35,6 +35,10 @@ beastie.eps Before committing this, clean out the comment brought over from the .fig file to avoid Dollar-FreeBSD-Dollar junk +beastie2.eps + Written by Rahul Siddharthan beaste2.eps is a + smaller, simpler version of the beastie eps graphic. + eps.patch Add some comments about tweakables in the .eps file and set the linecaps to round to improve visual appearance. Added: head/share/examples/BSD_daemon/beastie2.eps ============================================================================== Binary file. No diff available. From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 03:13:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7C519F56; Sun, 28 Apr 2013 03:13:46 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE05168F; Sun, 28 Apr 2013 03:13:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S3DkVO094923; Sun, 28 Apr 2013 03:13:46 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S3Dkwu094921; Sun, 28 Apr 2013 03:13:46 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201304280313.r3S3Dkwu094921@svn.freebsd.org> From: David Xu Date: Sun, 28 Apr 2013 03:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250013 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 03:13:46 -0000 Author: davidxu Date: Sun Apr 28 03:13:45 2013 New Revision: 250013 URL: http://svnweb.freebsd.org/changeset/base/250013 Log: Remove extra code for SA_RESETHAND, it is not needed because kernel has already done this. Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Sun Apr 28 02:23:39 2013 (r250012) +++ head/lib/libthr/thread/thr_sig.c Sun Apr 28 03:13:45 2013 (r250013) @@ -336,13 +336,6 @@ check_deferred_signal(struct pthread *cu memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t)); /* remove signal */ curthread->deferred_siginfo.si_signo = 0; - if (act.sa_flags & SA_RESETHAND) { - struct sigaction tact; - - tact = act; - tact.sa_handler = SIG_DFL; - _sigaction(info.si_signo, &tact, NULL); - } handle_signal(&act, info.si_signo, &info, uc); } } From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 05:09:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C8CDAFB for ; Sun, 28 Apr 2013 05:09:13 +0000 (UTC) (envelope-from ThomasSkibo@sbcglobal.net) Received: from nm26-vm0.access.bullet.mail.mud.yahoo.com (nm26-vm0.access.bullet.mail.mud.yahoo.com [66.94.236.225]) by mx1.freebsd.org (Postfix) with ESMTP id CECA718A9 for ; Sun, 28 Apr 2013 05:09:12 +0000 (UTC) Received: from [66.94.237.127] by nm26.access.bullet.mail.mud.yahoo.com with NNFMP; 28 Apr 2013 05:09:06 -0000 Received: from [98.139.221.157] by tm2.access.bullet.mail.mud.yahoo.com with NNFMP; 28 Apr 2013 05:09:06 -0000 Received: from [127.0.0.1] by smtp117.sbc.mail.bf1.yahoo.com with NNFMP; 28 Apr 2013 05:09:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sbcglobal.net; s=s1024; t=1367125746; bh=Iln5VCMCZI8e6D2qT3Ng2y5thU1DZwZbVLBHGMs8a1o=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=YVRLUKw8/JeM6B2GjNDrp2uaq38uC2a6zPFdwXkMJ5TQw8WonkJzS32qkDZnPGaawh7jRTlkm9jIy9K2eqkeOPH6bbKGk96CWIughjIaHRvz3Da/PphlOCisfUKIsINXecYUYVV5oO7gAxftUo9hkTZsXfxFKMbgL6vjWF1cXWU= X-Yahoo-Newman-Id: 179916.19110.bm@smtp117.sbc.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Q5jZ99QVM1lm8RN_JbxNn6s6jAn9vtSJ3E_u9ozynS2SIuY AvswMyD6mwSQR327hOlTh4HSSwzeUMUjgr45C4xro5RZaMzZMSZ6rFTfsxTJ MKiN8UcAmJxctYOnFuu7zVhqyOKRhEYuf1TtCojTMTk1GC7Gj1iDlQ_gWsS. PDyAiZ0hfsRMopeeqHqScrMf_LFdPBWCCgPozKDC4Yoz_CgJmWkAxebkJVhh Ti9ZOaTuh4rqvCOdPa.dbLNhaW7Ngwbv2y2Nf8R02Gq1vFxjKKVVfKNaDvEk wuppIk_GzWVeamJ7y0A1iWY28uoydMEYzpoqYLOtijdLd0LtQpF1h7uwRKQ7 g6Sov1ycyfe6u_R6Um6skAu1QzkYXYLX1_ryFFvJlDU1OfsdAYfhjGUZfpme 0istwj0HYsCVqtWt.BAW153tvP5akng.kNUdV3TGNLMulp1R4F2.7tctvX5v 4KYpsP5LsF3TQ10dJN5_qzfpqCpo1bHzs.ilJT7GPYWk4wR1jUxAe2we7ozD HKzX0Pz0mEJ9nDpZ.c.AVqnPi6KymfxeQvNB8BCCrK8RWbCsGS1Ze_Pn7ReC hzu4ioz0AbZy_JzWn9xuYEv5S6bU5G9DmpI23cmmqVO4eiGGLNWBJa8c- X-Yahoo-SMTP: tUxoRneswBA21azLM.3ybMESf0mC2bFhTbmt0VU5ervH0kqi5lo- X-Rocket-Received: from [192.168.1.9] (ThomasSkibo@71.139.162.8 with plain) by smtp117.sbc.mail.bf1.yahoo.com with SMTP; 28 Apr 2013 05:09:06 +0000 UTC Message-ID: <517CAEF2.3020401@sbcglobal.net> Date: Sat, 27 Apr 2013 22:09:06 -0700 From: Thomas Skibo User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: "Wojciech A. Koszek" Subject: Re: svn commit: r249997 - in head/sys: arm/conf arm/xilinx arm/xilinx/zedboard boot/fdt/dts dev/cadence dev/sdhci References: <201304272238.r3RMcTCm097428@svn.freebsd.org> <20130427233945.GD85673@FreeBSD.org> In-Reply-To: <20130427233945.GD85673@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 05:09:13 -0000 I'm okay with it. On 4/27/13 4:39 PM, Wojciech A. Koszek wrote: > On Sat, Apr 27, 2013 at 10:38:29PM +0000, Wojciech A. Koszek wrote: >> Author: wkoszek >> Date: Sat Apr 27 22:38:29 2013 >> New Revision: 249997 >> URL: http://svnweb.freebsd.org/changeset/base/249997 >> >> Log: >> Add Xilinx Zynq ARM/FPGA SoC support to FreeBSD/arm port. >> >> Submitted by: Thomas Skibo >> Reviewed by: wkoszek, freebsd-arm@ (no objections raised) >> > > Thomas, > > Was 3-clause BSD license in some of the files used purposefully, or it's a > copy&paste thing? If you'd be OK with that, I'd like to fix some stuff with > copyrights: > > http://people.freebsd.org/~wkoszek/patches/zynq_copyright.diff > > Are you OK with that? > -- -------- Thomas Skibo ThomasSkibo@sbcglobal.net From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 06:15:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1AA26174; Sun, 28 Apr 2013 06:15:57 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E75241AE2; Sun, 28 Apr 2013 06:15:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S6Fui0057399; Sun, 28 Apr 2013 06:15:56 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S6FuBT057398; Sun, 28 Apr 2013 06:15:56 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304280615.r3S6FuBT057398@svn.freebsd.org> From: Joel Dahl Date: Sun, 28 Apr 2013 06:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250014 - head/share/man/man4/man4.arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 06:15:57 -0000 Author: joel (doc committer) Date: Sun Apr 28 06:15:56 2013 New Revision: 250014 URL: http://svnweb.freebsd.org/changeset/base/250014 Log: mdoc improvements Modified: head/share/man/man4/man4.arm/devcfg.4 Modified: head/share/man/man4/man4.arm/devcfg.4 ============================================================================== --- head/share/man/man4/man4.arm/devcfg.4 Sun Apr 28 03:13:45 2013 (r250013) +++ head/share/man/man4/man4.arm/devcfg.4 Sun Apr 28 06:15:56 2013 (r250014) @@ -37,7 +37,9 @@ The special file .Pa /dev/devcfg can be used to configure the PL (FPGA) section of the Xilinx Zynq-7000. .Pp -On the first write to the character device at file offset 0, the devcfg driver +On the first write to the character device at file offset 0, the +.Nm +driver asserts the top-level PL reset signals, disables the PS-PL level shifters, and clears the PL configuration. Write data is sent to the PCAP (processor configuration access port). @@ -54,16 +56,18 @@ The file should not be confused with the design tools. It is the binary form of the configuration bitstream. The Xilinx -.Pa promgen +.Ic promgen tool can do the conversion: .Bd -literal -offset indent promgen -b -w -p bin -data_width 32 -u 0 design.bit -o design.bit.bin .Ed .Sh SYSCTL VARIABLES -The devcfg driver provides the following +The +.Nm +driver provides the following .Xr sysctl 8 variables: -.Bl -tag -width 12 +.Bl -tag -width 4n .It Va hw.fpga.pl_done .Pp This variable always reflects the status of the PL's DONE signal. @@ -73,15 +77,19 @@ A 1 means the PL section has been proper This variable controls if the PS-PL level shifters are enabled after the PL section has been reconfigured. This variable is 1 by default but setting it to 0 allows the PL section to be -programmed with configurations that don't interface to the PS section of the +programmed with configurations that do not interface to the PS section of the part. Changing this value has no effect on the level shifters until the next device reconfiguration. +.El .Sh FILES -/dev/devcfg Character device for +.Bl -tag -width 12n +.It Pa /dev/devcfg +Character device for the .Nm driver. -.Sh AUTHORS -Thomas Skibo +.El .Sh SEE ALSO Zynq-7000 SoC Technical Reference Manual (Xilinx doc UG585) +.Sh AUTHORS +Thomas Skibo From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 07:00:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BC6F066A; Sun, 28 Apr 2013 07:00:38 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9F9E61B9C; Sun, 28 Apr 2013 07:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S70ccP072039; Sun, 28 Apr 2013 07:00:38 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S70arA072022; Sun, 28 Apr 2013 07:00:36 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201304280700.r3S70arA072022@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sun, 28 Apr 2013 07:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250015 - in head/sys: arm/xilinx dev/cadence X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 07:00:38 -0000 Author: wkoszek Date: Sun Apr 28 07:00:36 2013 New Revision: 250015 URL: http://svnweb.freebsd.org/changeset/base/250015 Log: Bring copyright changes with the agreement of Thomas Skibo. Communication on src-commiters, Sat, 27 Apr 2013 22:09:06 -0700, Subject was: "Re: svn commit: r249997" As I'm here, fix the style main block comments in files' headers. Modified: head/sys/arm/xilinx/zy7_devcfg.c head/sys/arm/xilinx/zy7_ehci.c head/sys/arm/xilinx/zy7_gpio.c head/sys/arm/xilinx/zy7_l2cache.c head/sys/arm/xilinx/zy7_machdep.c head/sys/arm/xilinx/zy7_reg.h head/sys/arm/xilinx/zy7_slcr.c head/sys/arm/xilinx/zy7_slcr.h head/sys/dev/cadence/if_cgem.c head/sys/dev/cadence/if_cgem_hw.h Modified: head/sys/arm/xilinx/zy7_devcfg.c ============================================================================== --- head/sys/arm/xilinx/zy7_devcfg.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_devcfg.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,32 +1,33 @@ /*- - * Copyright (C) 2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of contributors may not 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 + * 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 AUTHORS 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 + * 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. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* Zynq-7000 Devcfg driver. This allows programming the PL (FPGA) section +/* + * Zynq-7000 Devcfg driver. This allows programming the PL (FPGA) section * of Zynq. * * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. Modified: head/sys/arm/xilinx/zy7_ehci.c ============================================================================== --- head/sys/arm/xilinx/zy7_ehci.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_ehci.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,31 +1,33 @@ /*- - * Copyright (C) 2012-2013, Thomas Skibo. + * Copyright (c) 2012-2013 Thomas Skibo * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of contributors may not 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 + * 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 AUTHORS 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. + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* A host-controller driver for Zynq-7000's USB OTG controller. +/* + * A host-controller driver for Zynq-7000's USB OTG controller. * * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. * (v1.4) November 16, 2012. Xilinx doc UG585. Ch. 15 covers the USB Modified: head/sys/arm/xilinx/zy7_gpio.c ============================================================================== --- head/sys/arm/xilinx/zy7_gpio.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_gpio.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,32 +1,33 @@ /*- - * Copyright (C) 2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of contributors may not 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 + * 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 AUTHORS 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 + * 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. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* A GPIO driver for Xilinx Zynq-7000. +/* + * A GPIO driver for Xilinx Zynq-7000. * * The GPIO peripheral on Zynq allows controlling 114 general purpose I/Os. * Modified: head/sys/arm/xilinx/zy7_l2cache.c ============================================================================== --- head/sys/arm/xilinx/zy7_l2cache.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_l2cache.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -11,20 +11,24 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ */ #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_machdep.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,32 +1,33 @@ /*- - * Copyright (C) 2012-2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of contributors may not 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 + * 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 AUTHORS 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 + * 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. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* Machine dependent code for Xilinx Zynq-7000 Soc. +/* + * Machine dependent code for Xilinx Zynq-7000 Soc. * * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. * (v1.4) November 16, 2012. Xilinx doc UG585. Modified: head/sys/arm/xilinx/zy7_reg.h ============================================================================== --- head/sys/arm/xilinx/zy7_reg.h Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_reg.h Sun Apr 28 07:00:36 2013 (r250015) @@ -1,33 +1,33 @@ /*- - * Copyright (C) 2012-2013, Thomas Skibo. + * Copyright (c) 2012-2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of contributors may not 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 + * 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 Thomas Skibo 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. + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* $FreeBSD$ */ - -/* Address regions of Zynq-7000. +/* + * Address regions of Zynq-7000. * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. * (v1.4) November 16, 2012. Xilinx doc UG585. */ Modified: head/sys/arm/xilinx/zy7_slcr.c ============================================================================== --- head/sys/arm/xilinx/zy7_slcr.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_slcr.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,32 +1,33 @@ /*- - * Copyright (C) 2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of contributors may not 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 + * 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 AUTHORS 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 + * 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. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* Zynq-700 SLCR driver. Provides hooks for cpu_reset and PL control stuff. +/* + * Zynq-700 SLCR driver. Provides hooks for cpu_reset and PL control stuff. * In the future, maybe MIO control, clock control, etc. could go here. * * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. Modified: head/sys/arm/xilinx/zy7_slcr.h ============================================================================== --- head/sys/arm/xilinx/zy7_slcr.h Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_slcr.h Sun Apr 28 07:00:36 2013 (r250015) @@ -1,34 +1,33 @@ /*- - * Copyright (C) 2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of contributors may not 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 + * 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 AUTHORS 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 + * 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. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* $FreeBSD$ */ - -/* Defines for Zynq-7000 SLCR registers. +/* + * Defines for Zynq-7000 SLCR registers. * * Most of these registers are initialized by the First Stage Boot * Loader and are not modified by the kernel. Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/dev/cadence/if_cgem.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2013 Thomas Skibo. + * Copyright (c) 2012-2013 Thomas Skibo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +24,8 @@ * SUCH DAMAGE. */ -/* A network interface driver for Cadence GEM Gigabit Ethernet +/* + * A network interface driver for Cadence GEM Gigabit Ethernet * interface such as the one used in Xilinx Zynq-7000 SoC. * * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. Modified: head/sys/dev/cadence/if_cgem_hw.h ============================================================================== --- head/sys/dev/cadence/if_cgem_hw.h Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/dev/cadence/if_cgem_hw.h Sun Apr 28 07:00:36 2013 (r250015) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2013 Thomas Skibo. + * Copyright (c) 2012-2013 Thomas Skibo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,10 +22,10 @@ * 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$ */ -/* $FreeBSD$ */ - /* * Hardware and register defines for Cadence GEM Gigabit Ethernet * controller such as the one used in Zynq-7000 SoC. From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 07:48:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3E2EB3A; Sun, 28 Apr 2013 07:48:53 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C520C1C4D; Sun, 28 Apr 2013 07:48:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S7mrEA088962; Sun, 28 Apr 2013 07:48:53 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S7mr3f088961; Sun, 28 Apr 2013 07:48:53 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304280748.r3S7mr3f088961@svn.freebsd.org> From: Martin Matuska Date: Sun, 28 Apr 2013 07:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250016 - stable/9/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 07:48:53 -0000 Author: mm Date: Sun Apr 28 07:48:53 2013 New Revision: 250016 URL: http://svnweb.freebsd.org/changeset/base/250016 Log: MFC r249883: Respect the enoent_ok flag if reporting error for holding an non-existing snapshot. Related illumos ZFS issue: 3699 zfs hold or release of a non-existent snapshot does not output error Reported by: Steven Hartland Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 28 07:00:36 2013 (r250015) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 28 07:48:53 2013 (r250016) @@ -4207,10 +4207,13 @@ zfs_hold(zfs_handle_t *zhp, const char * if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { fnvlist_free(ha.nvl); ret = ENOENT; - (void) snprintf(errbuf, sizeof (errbuf), - dgettext(TEXT_DOMAIN, "cannot hold snapshot '%s@%s'"), - zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); + if (!enoent_ok) { + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot hold snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(hdl, ret, errbuf); + } return (ret); } From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 07:52:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B0345CFD; Sun, 28 Apr 2013 07:52:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A08CD1C93; Sun, 28 Apr 2013 07:52:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S7qkTL091358; Sun, 28 Apr 2013 07:52:46 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S7qkFE091357; Sun, 28 Apr 2013 07:52:46 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304280752.r3S7qkFE091357@svn.freebsd.org> From: Martin Matuska Date: Sun, 28 Apr 2013 07:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250017 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 07:52:46 -0000 Author: mm Date: Sun Apr 28 07:52:46 2013 New Revision: 250017 URL: http://svnweb.freebsd.org/changeset/base/250017 Log: Update vendor-sys/illumos/dist to illumos-gate 14020:3843f7c5f635 Illumos ZFS issues: 3705 stack overflow due to zfs lz4 compression Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c Sun Apr 28 07:48:53 2013 (r250016) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c Sun Apr 28 07:52:46 2013 (r250017) @@ -197,20 +197,17 @@ lz4_decompress(void *s_start, void *d_st defined(__amd64) || defined(__ppc64__) || defined(_WIN64) || \ defined(__LP64__) || defined(_LP64)) #define LZ4_ARCH64 1 -/* - * Illumos: On amd64 we have 20k of stack and 24k on sun4u and sun4v, so we - * can spend 16k on the algorithm - */ -#define STACKLIMIT 12 #else #define LZ4_ARCH64 0 +#endif + /* - * Illumos: On i386 we only have 12k of stack, so in order to maintain the - * same COMPRESSIONLEVEL we have to use heap allocation. Performance will - * suck, but alas, it's ZFS on 32-bit we're talking about, so... + * Limits the amount of stack space that the algorithm may consume to hold + * the compression lookup table. The value `9' here means we'll never use + * more than 2k of stack (see above for a description of COMPRESSIONLEVEL). + * If more memory is needed, it is allocated from the heap. */ -#define STACKLIMIT 11 -#endif +#define STACKLIMIT 9 /* * Little Endian or Big Endian? @@ -240,11 +237,7 @@ lz4_decompress(void *s_start, void *d_st #define LZ4_FORCE_UNALIGNED_ACCESS 1 #endif -/* - * Illumos: we can't use GCC's __builtin_ctz family of builtins in the - * kernel - */ -#define LZ4_FORCE_SW_BITCOUNT +/* #define LZ4_FORCE_SW_BITCOUNT */ /* * Compiler Options From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 08:29:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67447319; Sun, 28 Apr 2013 08:29:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 595771D68; Sun, 28 Apr 2013 08:29:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S8T1YG003610; Sun, 28 Apr 2013 08:29:01 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S8T10k003608; Sun, 28 Apr 2013 08:29:01 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201304280829.r3S8T10k003608@svn.freebsd.org> From: Alan Cox Date: Sun, 28 Apr 2013 08:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250018 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 08:29:01 -0000 Author: alc Date: Sun Apr 28 08:29:00 2013 New Revision: 250018 URL: http://svnweb.freebsd.org/changeset/base/250018 Log: Eliminate an unneeded call to vm_radix_trimkey() from vm_radix_lookup_le(). This call is clearing bits from the key that will be set again by the next line. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Sun Apr 28 07:52:46 2013 (r250017) +++ head/sys/vm/vm_radix.c Sun Apr 28 08:29:00 2013 (r250018) @@ -666,7 +666,6 @@ restart: */ if (slot > 0) { inc = VM_RADIX_UNITLEVEL(rnode->rn_clev); - index = vm_radix_trimkey(index, rnode->rn_clev); index |= inc - 1; do { index -= inc; From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 09:29:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7A628E71; Sun, 28 Apr 2013 09:29:45 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6C43F1F17; Sun, 28 Apr 2013 09:29:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S9Tjfe024621; Sun, 28 Apr 2013 09:29:45 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S9TjEf024620; Sun, 28 Apr 2013 09:29:45 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304280929.r3S9TjEf024620@svn.freebsd.org> From: Joel Dahl Date: Sun, 28 Apr 2013 09:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250019 - head/usr.bin/biff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 09:29:45 -0000 Author: joel (doc committer) Date: Sun Apr 28 09:29:44 2013 New Revision: 250019 URL: http://svnweb.freebsd.org/changeset/base/250019 Log: Fix EXIT STATUS. biff reports its status when it was invoked. Submitted by: Ryan Kavanagh, Jason McIntyre Obtained from: OpenBSD Modified: head/usr.bin/biff/biff.1 Modified: head/usr.bin/biff/biff.1 ============================================================================== --- head/usr.bin/biff/biff.1 Sun Apr 28 08:29:00 2013 (r250018) +++ head/usr.bin/biff/biff.1 Sun Apr 28 09:29:44 2013 (r250019) @@ -28,7 +28,7 @@ .\" @(#)biff.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 20, 2010 +.Dd April 28, 2013 .Dt BIFF 1 .Os .Sh NAME @@ -97,9 +97,9 @@ The utility exits with one of the following values: .Bl -tag -width indent .It 0 -Notification is enabled. +Notification was enabled at the time of invocation. .It 1 -Notification is disabled. +Notification was disabled at the time of invocation. .It >1 An error occurred. .El From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 14:40:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 336A5147; Sun, 28 Apr 2013 14:40:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2643F17EA; Sun, 28 Apr 2013 14:40:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SEeUqK033361; Sun, 28 Apr 2013 14:40:30 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SEeUKT033360; Sun, 28 Apr 2013 14:40:30 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201304281440.r3SEeUKT033360@svn.freebsd.org> From: Robert Watson Date: Sun, 28 Apr 2013 14:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250020 - head/lib/libstand/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 14:40:30 -0000 Author: rwatson Date: Sun Apr 28 14:40:29 2013 New Revision: 250020 URL: http://svnweb.freebsd.org/changeset/base/250020 Log: Merge @228176 from Perforce to fix a bug introduced in r249553: Trim two now-unneeded (and likely harmful) lines from the libstand setjmp/longjmp for MIPS. Spotted by: jmallett MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/lib/libstand/mips/_setjmp.S Modified: head/lib/libstand/mips/_setjmp.S ============================================================================== --- head/lib/libstand/mips/_setjmp.S Sun Apr 28 09:29:44 2013 (r250019) +++ head/lib/libstand/mips/_setjmp.S Sun Apr 28 14:40:29 2013 (r250020) @@ -72,7 +72,6 @@ LEAF(_setjmp) REG_S s7, ((S7 + 3) * SZREG)(a0) REG_S sp, ((SP + 3) * SZREG)(a0) REG_S s8, ((S8 + 3) * SZREG)(a0) - REG_S v0, ((32 + 38) * SZREG)(a0) j ra move v0, zero END(_setjmp) @@ -96,7 +95,6 @@ LEAF(_longjmp) REG_L s5, ((S5 + 3) * SZREG)(a0) REG_L s6, ((S6 + 3) * SZREG)(a0) REG_L s7, ((S7 + 3) * SZREG)(a0) - REG_L v0, ((32 + 38) * SZREG)(a0) # get fpu status REG_L sp, ((SP + 3) * SZREG)(a0) REG_L s8, ((S8 + 3) * SZREG)(a0) From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 16:20:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AB5DC576; Sun, 28 Apr 2013 16:20:09 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E6931C55; Sun, 28 Apr 2013 16:20:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SGK9iI068619; Sun, 28 Apr 2013 16:20:09 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SGK9nK068618; Sun, 28 Apr 2013 16:20:09 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304281620.r3SGK9nK068618@svn.freebsd.org> From: Sean Bruno Date: Sun, 28 Apr 2013 16:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250021 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 16:20:09 -0000 Author: sbruno Date: Sun Apr 28 16:20:09 2013 New Revision: 250021 URL: http://svnweb.freebsd.org/changeset/base/250021 Log: Its time to retire COMPAQ. I don't think that its coming back. :-) Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Apr 28 14:40:29 2013 (r250020) +++ head/sys/dev/ciss/ciss.c Sun Apr 28 16:20:09 2013 (r250021) @@ -3375,7 +3375,7 @@ ciss_cam_complete_fixup(struct ciss_soft cl = &sc->ciss_logical[bus][target]; - padstr(inq->vendor, "COMPAQ", + padstr(inq->vendor, "HP", SID_VENDOR_SIZE); padstr(inq->product, ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 16:35:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 275878FD; Sun, 28 Apr 2013 16:35:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 19F231CF4; Sun, 28 Apr 2013 16:35:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SGZNrY074325; Sun, 28 Apr 2013 16:35:23 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SGZNDC074324; Sun, 28 Apr 2013 16:35:23 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304281635.r3SGZNDC074324@svn.freebsd.org> From: Sean Bruno Date: Sun, 28 Apr 2013 16:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250022 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 16:35:24 -0000 Author: sbruno Date: Sun Apr 28 16:35:23 2013 New Revision: 250022 URL: http://svnweb.freebsd.org/changeset/base/250022 Log: Let's align correctly by setting to 17. OpenCISS states that if the value is 0, then the driver should try a value of 31. That's just silly. Set to 17 so that the subtraction for maxio becomes 16 and aligns nicely. Reviewed by: scottl Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Apr 28 16:20:09 2013 (r250021) +++ head/sys/dev/ciss/ciss.c Sun Apr 28 16:35:23 2013 (r250022) @@ -3007,7 +3007,7 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; if (sc->ciss_cfg->max_sg_length == 0) { - sg_length = 16; + sg_length = 17; } else { /* XXX Fix for ZMR cards that advertise max_sg_length == 32 * Confusing bit here. max_sg_length is usually a power of 2. We always From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 16:35:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F22968FE; Sun, 28 Apr 2013 16:35:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E4BEE1CF5; Sun, 28 Apr 2013 16:35:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SGZOfn074364; Sun, 28 Apr 2013 16:35:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SGZOst074363; Sun, 28 Apr 2013 16:35:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201304281635.r3SGZOst074363@svn.freebsd.org> From: Robert Watson Date: Sun, 28 Apr 2013 16:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250023 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 16:35:25 -0000 Author: rwatson Date: Sun Apr 28 16:35:24 2013 New Revision: 250023 URL: http://svnweb.freebsd.org/changeset/base/250023 Log: Enable building string functions as part of libstand on mips; the Makefile is a bit obfuscated here, as ia64 adds string source files elsewhere, so simply exclude it here. Reviewed by: imp MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Sun Apr 28 16:35:23 2013 (r250022) +++ head/lib/libstand/Makefile Sun Apr 28 16:35:24 2013 (r250023) @@ -54,9 +54,7 @@ SRCS+= ntoh.c # string functions from libc .PATH: ${.CURDIR}/../libc/string -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ - ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} != "ia64" SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 17:58:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C51C9433; Sun, 28 Apr 2013 17:58:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B7C1A1FA5; Sun, 28 Apr 2013 17:58:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SHwBCm003182; Sun, 28 Apr 2013 17:58:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SHwBCC003180; Sun, 28 Apr 2013 17:58:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304281758.r3SHwBCC003180@svn.freebsd.org> From: Eitan Adler Date: Sun, 28 Apr 2013 17:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250024 - in head: tools/build/mk usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 17:58:11 -0000 Author: eadler Date: Sun Apr 28 17:58:11 2013 New Revision: 250024 URL: http://svnweb.freebsd.org/changeset/base/250024 Log: When the world is built WITHOUT_OPENSSH also don't install ssh-copy-id. PR: misc/177590 Submitted by: Oleg Ginzburg Reviewed by: imp Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/Makefile Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Apr 28 16:35:24 2013 (r250023) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Apr 28 17:58:11 2013 (r250024) @@ -3674,9 +3674,9 @@ OLD_FILES+=usr/share/man/man8/ntptime.8. # to be filled in #.endif -#.if ${MK_OPENSSH} == no -# to be filled in -#.endif +.if ${MK_OPENSSH} == no +OLD_FILES+=usr.bin/ssh-copy-id +.endif #.if ${MK_OPENSSL} == no # to be filled in Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sun Apr 28 16:35:24 2013 (r250023) +++ head/usr.bin/Makefile Sun Apr 28 17:58:11 2013 (r250024) @@ -148,7 +148,6 @@ SUBDIR= alias \ sockstat \ sort \ split \ - ssh-copy-id \ stat \ stdbuf \ su \ @@ -303,6 +302,10 @@ SUBDIR+= ypmatch SUBDIR+= ypwhich .endif +.if ${MK_OPENSSH} != "no" +SUBDIR+= ssh-copy-id +.endif + .if ${MK_OPENSSL} != "no" SUBDIR+= bc SUBDIR+= chkey From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 18:12:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7485ABE2; Sun, 28 Apr 2013 18:12:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 677E01058; Sun, 28 Apr 2013 18:12:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SICi8p009628; Sun, 28 Apr 2013 18:12:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SICigh009627; Sun, 28 Apr 2013 18:12:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304281812.r3SICigh009627@svn.freebsd.org> From: Alexander Motin Date: Sun, 28 Apr 2013 18:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250025 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 18:12:44 -0000 Author: mav Date: Sun Apr 28 18:12:43 2013 New Revision: 250025 URL: http://svnweb.freebsd.org/changeset/base/250025 Log: Add some cam_freeze_devq()'s missed at r249466. This makes number of freezes match the number of releases. Reported by: dim Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Sun Apr 28 17:58:11 2013 (r250024) +++ head/sys/cam/scsi/scsi_xpt.c Sun Apr 28 18:12:43 2013 (r250025) @@ -883,6 +883,7 @@ again: * routine finish up for us. */ start_ccb->csio.data_ptr = NULL; + cam_freeze_devq(periph->path); probedone(periph, start_ccb); return; } @@ -913,6 +914,7 @@ again: * routine finish up for us. */ start_ccb->csio.data_ptr = NULL; + cam_freeze_devq(periph->path); probedone(periph, start_ccb); return; } @@ -952,6 +954,7 @@ again: * routine finish up for us. */ start_ccb->csio.data_ptr = NULL; + cam_freeze_devq(periph->path); probedone(periph, start_ccb); return; } From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 18:40:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 96F25295; Sun, 28 Apr 2013 18:40:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 898EC10E8; Sun, 28 Apr 2013 18:40:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SIetZX019669; Sun, 28 Apr 2013 18:40:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SIetpT019668; Sun, 28 Apr 2013 18:40:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304281840.r3SIetpT019668@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Apr 2013 18:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250026 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 18:40:55 -0000 Author: kib Date: Sun Apr 28 18:40:55 2013 New Revision: 250026 URL: http://svnweb.freebsd.org/changeset/base/250026 Log: Convert panic() into KASSERT(). Reviewed by: alc MFC after: 1 week Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Apr 28 18:12:43 2013 (r250025) +++ head/sys/vm/vnode_pager.c Sun Apr 28 18:40:55 2013 (r250026) @@ -214,8 +214,7 @@ retry: VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vadead", 0); } - if (vp->v_usecount == 0) - panic("vnode_pager_alloc: no vnode reference"); + KASSERT(vp->v_usecount != 0, ("vnode_pager_alloc: no vnode reference")); if (object == NULL) { /* From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 19:12:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 492E8D8A; Sun, 28 Apr 2013 19:12:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AF1311C2; Sun, 28 Apr 2013 19:12:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SJC94I030637; Sun, 28 Apr 2013 19:12:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SJC9bL030636; Sun, 28 Apr 2013 19:12:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304281912.r3SJC9bL030636@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Apr 2013 19:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250027 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 19:12:10 -0000 Author: kib Date: Sun Apr 28 19:12:09 2013 New Revision: 250027 URL: http://svnweb.freebsd.org/changeset/base/250027 Log: Eliminate the layering violation in the kern_sendfile(). When quering the file size, use VOP_GETATTR() instead of accessing vnode vm_object un_pager.vnp.vnp_size. Take the shared vnode lock earlier to cover the added VOP_GETATTR() call and, as consequence, the whole internal sendfile loop. Reduce vm object lock scope to not protect the local calculations. Note that this is the last misuse of the vnp_size in the tree, the others were removed from the ELF image activator by r230246. Reviewed by: alc Tested by: pho, bf (previous version) MFC after: 1 week Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sun Apr 28 18:40:55 2013 (r250026) +++ head/sys/kern/uipc_syscalls.c Sun Apr 28 19:12:09 2013 (r250027) @@ -1902,8 +1902,10 @@ kern_sendfile(struct thread *td, struct struct mbuf *m = NULL; struct sf_buf *sf; struct vm_page *pg; + struct vattr va; off_t off, xfsize, fsbytes = 0, sbytes = 0, rem = 0; int error, hdrlen = 0, mnw = 0; + int bsize; struct sendfile_sync *sfs = NULL; /* @@ -2102,6 +2104,16 @@ retry_space: */ space -= hdrlen; + error = vn_lock(vp, LK_SHARED); + if (error != 0) + goto done; + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) { + VOP_UNLOCK(vp, 0); + goto done; + } + bsize = vp->v_mount->mnt_stat.f_iosize; + /* * Loop and construct maximum sized mbuf chain to be bulk * dumped into socket buffer. @@ -2111,7 +2123,6 @@ retry_space: vm_offset_t pgoff; struct mbuf *m0; - VM_OBJECT_WLOCK(obj); /* * Calculate the amount to transfer. * Not to exceed a page, the EOF, @@ -2121,12 +2132,11 @@ retry_space: if (uap->nbytes) rem = (uap->nbytes - fsbytes - loopbytes); else - rem = obj->un_pager.vnp.vnp_size - + rem = va.va_size - uap->offset - fsbytes - loopbytes; xfsize = omin(PAGE_SIZE - pgoff, rem); xfsize = omin(space - loopbytes, xfsize); if (xfsize <= 0) { - VM_OBJECT_WUNLOCK(obj); done = 1; /* all data sent */ break; } @@ -2136,7 +2146,6 @@ retry_space: * Let the outer loop figure out how to handle it. */ if (space <= loopbytes) { - VM_OBJECT_WUNLOCK(obj); done = 0; break; } @@ -2146,6 +2155,7 @@ retry_space: * if not found or wait and loop if busy. */ pindex = OFF_TO_IDX(off); + VM_OBJECT_WLOCK(obj); pg = vm_page_grab(obj, pindex, VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_RETRY); @@ -2163,7 +2173,6 @@ retry_space: else if (uap->flags & SF_NODISKIO) error = EBUSY; else { - int bsize; ssize_t resid; /* @@ -2175,13 +2184,6 @@ retry_space: /* * Get the page from backing store. - */ - error = vn_lock(vp, LK_SHARED); - if (error != 0) - goto after_read; - bsize = vp->v_mount->mnt_stat.f_iosize; - - /* * XXXMAC: Because we don't have fp->f_cred * here, we pass in NOCRED. This is probably * wrong, but is consistent with our original @@ -2191,8 +2193,6 @@ retry_space: trunc_page(off), UIO_NOCOPY, IO_NODELOCKED | IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT), td->td_ucred, NOCRED, &resid, td); - VOP_UNLOCK(vp, 0); - after_read: VM_OBJECT_WLOCK(obj); vm_page_io_finish(pg); if (!error) @@ -2281,6 +2281,8 @@ retry_space: } } + VOP_UNLOCK(vp, 0); + /* Add the buffer chain to the socket buffer. */ if (m != NULL) { int mlen, err; From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 19:19:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8D0F0392; Sun, 28 Apr 2013 19:19:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 802FC11F1; Sun, 28 Apr 2013 19:19:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SJJQux031999; Sun, 28 Apr 2013 19:19:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SJJQI9031998; Sun, 28 Apr 2013 19:19:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304281919.r3SJJQI9031998@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Apr 2013 19:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250028 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 19:19:26 -0000 Author: kib Date: Sun Apr 28 19:19:26 2013 New Revision: 250028 URL: http://svnweb.freebsd.org/changeset/base/250028 Log: Assert that the object type for the vnode' non-NULL v_object, passed to vnode_pager_setsize(), is either OBJT_VNODE, or, if vnode was already reclaimed, OBJT_DEAD. Note that the later is only possible due to some filesystems, in particular, nfsiods from nfs clients, call vnode_pager_setsize() with unlocked vnode. More, if the object is terminated, do not perform the resizing operation. Reviewed by: alc Tested by: pho, bf MFC after: 1 week Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Apr 28 19:12:09 2013 (r250027) +++ head/sys/vm/vnode_pager.c Sun Apr 28 19:19:26 2013 (r250028) @@ -380,6 +380,12 @@ vnode_pager_setsize(vp, nsize) return; /* ASSERT_VOP_ELOCKED(vp, "vnode_pager_setsize and not locked vnode"); */ VM_OBJECT_WLOCK(object); + if (object->type == OBJT_DEAD) { + VM_OBJECT_WUNLOCK(object); + return; + } + KASSERT(object->type == OBJT_VNODE, + ("not vnode-backed object %p", object)); if (nsize == object->un_pager.vnp.vnp_size) { /* * Hasn't changed size From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 19:25:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5FF535A8; Sun, 28 Apr 2013 19:25:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 392501223; Sun, 28 Apr 2013 19:25:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SJPAHX034667; Sun, 28 Apr 2013 19:25:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SJP9N7034664; Sun, 28 Apr 2013 19:25:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304281925.r3SJP9N7034664@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Apr 2013 19:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250029 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 19:25:10 -0000 Author: kib Date: Sun Apr 28 19:25:09 2013 New Revision: 250029 URL: http://svnweb.freebsd.org/changeset/base/250029 Log: Make vm_object_page_clean() and vm_mmap_vnode() tolerate the vnode' v_object of non OBJT_VNODE type. For vm_object_page_clean(), simply do not assert that object type must be OBJT_VNODE, and add a comment explaining how the check for OBJ_MIGHTBEDIRTY prevents the rest of function from operating on such objects. For vm_mmap_vnode(), if the object type is not OBJT_VNODE, require it to be for swap pager (or default), handle the bypass filesystems, and correctly acquire the object reference in this case. Reviewed by: alc Tested by: pho, bf MFC after: 1 week Modified: head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sun Apr 28 19:19:26 2013 (r250028) +++ head/sys/vm/vm_mmap.c Sun Apr 28 19:25:09 2013 (r250029) @@ -1284,7 +1284,7 @@ vm_mmap_vnode(struct thread *td, vm_size error = EINVAL; goto done; } - if (obj->handle != vp) { + if (obj->type == OBJT_VNODE && obj->handle != vp) { vput(vp); vp = (struct vnode *)obj->handle; /* @@ -1333,7 +1333,14 @@ vm_mmap_vnode(struct thread *td, vm_size objsize = round_page(va.va_size); if (va.va_nlink == 0) flags |= MAP_NOSYNC; - obj = vm_pager_allocate(OBJT_VNODE, vp, objsize, prot, foff, cred); + if (obj->type == OBJT_VNODE) + obj = vm_pager_allocate(OBJT_VNODE, vp, objsize, prot, foff, + cred); + else { + KASSERT(obj->type == OBJT_DEFAULT || obj->type == OBJT_SWAP, + ("wrong object type")); + vm_object_reference(obj); + } if (obj == NULL) { error = ENOMEM; goto done; Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Apr 28 19:19:26 2013 (r250028) +++ head/sys/vm/vm_object.c Sun Apr 28 19:25:09 2013 (r250029) @@ -820,7 +820,12 @@ vm_object_page_clean(vm_object_t object, boolean_t clearobjflags, eio, res; VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT(object->type == OBJT_VNODE, ("Not a vnode object")); + + /* + * The OBJ_MIGHTBEDIRTY flag is only set for OBJT_VNODE + * objects. The check below prevents the function from + * operating on non-vnode objects. + */ if ((object->flags & OBJ_MIGHTBEDIRTY) == 0 || object->resident_page_count == 0) return (TRUE); From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 19:39:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A24BA05; Sun, 28 Apr 2013 19:39:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C33D1297; Sun, 28 Apr 2013 19:39:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SJd0S3038704; Sun, 28 Apr 2013 19:39:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SJd0UA038698; Sun, 28 Apr 2013 19:39:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304281939.r3SJd0UA038698@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Apr 2013 19:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250030 - in head/sys: fs/tmpfs vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 19:39:01 -0000 Author: kib Date: Sun Apr 28 19:38:59 2013 New Revision: 250030 URL: http://svnweb.freebsd.org/changeset/base/250030 Log: Rework the handling of the tmpfs node backing swap object and tmpfs vnode v_object to avoid double-buffering. Use the same object both as the backing store for tmpfs node and as the v_object. Besides reducing memory use up to 2x times for situation of mapping files from tmpfs, it also makes tmpfs read and write operations copy twice bytes less. VM subsystem was already slightly adapted to tolerate OBJT_SWAP object as v_object. Now the vm_object_deallocate() is modified to not reinstantiate OBJ_ONEMAPPING flag and help the VFS to correctly handle VV_TEXT flag on the last dereference of the tmpfs backing object. Reviewed by: alc Tested by: pho, bf MFC after: 1 month Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Apr 28 19:25:09 2013 (r250029) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Apr 28 19:38:59 2013 (r250030) @@ -166,6 +166,7 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp char *target, dev_t rdev, struct tmpfs_node **node) { struct tmpfs_node *nnode; + vm_object_t obj; /* If the root directory of the 'tmp' file system is not yet * allocated, this must be the request to do it. */ @@ -227,9 +228,14 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp break; case VREG: - nnode->tn_reg.tn_aobj = + obj = nnode->tn_reg.tn_aobj = vm_pager_allocate(OBJT_SWAP, NULL, 0, VM_PROT_DEFAULT, 0, NULL /* XXXKIB - tmpfs needs swap reservation */); + VM_OBJECT_WLOCK(obj); + /* OBJ_TMPFS is set together with the setting of vp->v_object */ + vm_object_set_flag(obj, OBJ_NOSPLIT); + vm_object_clear_flag(obj, OBJ_ONEMAPPING); + VM_OBJECT_WUNLOCK(obj); break; default: @@ -434,9 +440,11 @@ int tmpfs_alloc_vp(struct mount *mp, struct tmpfs_node *node, int lkflag, struct vnode **vpp) { - int error = 0; struct vnode *vp; + vm_object_t object; + int error; + error = 0; loop: TMPFS_NODE_LOCK(node); if ((vp = node->tn_vnode) != NULL) { @@ -506,13 +514,22 @@ loop: /* FALLTHROUGH */ case VLNK: /* FALLTHROUGH */ - case VREG: - /* FALLTHROUGH */ case VSOCK: break; case VFIFO: vp->v_op = &tmpfs_fifoop_entries; break; + case VREG: + object = node->tn_reg.tn_aobj; + VM_OBJECT_WLOCK(object); + VI_LOCK(vp); + KASSERT(vp->v_object == NULL, ("Not NULL v_object in tmpfs")); + vp->v_object = object; + object->un_pager.swp.swp_tmpfs = vp; + vm_object_set_flag(object, OBJ_TMPFS); + VI_UNLOCK(vp); + VM_OBJECT_WUNLOCK(object); + break; case VDIR: MPASS(node->tn_dir.tn_parent != NULL); if (node->tn_dir.tn_parent == node) @@ -523,7 +540,6 @@ loop: panic("tmpfs_alloc_vp: type %p %d", node, (int)node->tn_type); } - vnode_pager_setsize(vp, node->tn_size); error = insmntque(vp, mp); if (error) vp = NULL; @@ -1343,7 +1359,6 @@ retry: TMPFS_UNLOCK(tmp); node->tn_size = newsize; - vnode_pager_setsize(vp, newsize); return (0); } Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Apr 28 19:25:09 2013 (r250029) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Apr 28 19:38:59 2013 (r250030) @@ -278,8 +278,6 @@ tmpfs_close(struct vop_close_args *v) { struct vnode *vp = v->a_vp; - MPASS(VOP_ISLOCKED(vp)); - /* Update node times. */ tmpfs_update(vp); @@ -439,7 +437,6 @@ tmpfs_setattr(struct vop_setattr_args *v return error; } -/* --------------------------------------------------------------------- */ static int tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx, vm_offset_t offset, size_t tlen, struct uio *uio) @@ -448,12 +445,35 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p int error, rv; VM_OBJECT_WLOCK(tobj); - m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | - VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + + /* + * The kern_sendfile() code calls vn_rdwr() with the page + * soft-busied. Ignore the soft-busy state here. Parallel + * reads of the page content from disk are prevented by + * VPO_BUSY. + * + * Although the tmpfs vnode lock is held here, it is + * nonetheless safe to sleep waiting for a free page. The + * pageout daemon does not need to acquire the tmpfs vnode + * lock to page out tobj's pages because tobj is a OBJT_SWAP + * type object. + */ + m = vm_page_grab(tobj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY | + VM_ALLOC_IGN_SBUSY); if (m->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(tobj, idx, NULL, NULL)) { rv = vm_pager_get_pages(tobj, &m, 1, 0); + m = vm_page_lookup(tobj, idx); + if (m == NULL) { + printf( + "tmpfs: vm_obj %p idx %jd null lookup rv %d\n", + tobj, idx, rv); + return (EIO); + } if (rv != VM_PAGER_OK) { + printf( + "tmpfs: vm_obj %p idx %jd valid %x pager error %d\n", + tobj, idx, m->valid, rv); vm_page_lock(m); vm_page_free(m); vm_page_unlock(m); @@ -463,127 +483,38 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p } else vm_page_zero_invalid(m, TRUE); } + vm_page_lock(m); + vm_page_hold(m); + vm_page_wakeup(m); + vm_page_unlock(m); VM_OBJECT_WUNLOCK(tobj); error = uiomove_fromphys(&m, offset, tlen, uio); VM_OBJECT_WLOCK(tobj); vm_page_lock(m); - vm_page_unwire(m, TRUE); + vm_page_unhold(m); + vm_page_deactivate(m); + /* Requeue to maintain LRU ordering. */ + vm_page_requeue(m); vm_page_unlock(m); - vm_page_wakeup(m); VM_OBJECT_WUNLOCK(tobj); return (error); } -static __inline int -tmpfs_nocacheread_buf(vm_object_t tobj, vm_pindex_t idx, - vm_offset_t offset, size_t tlen, void *buf) -{ - struct uio uio; - struct iovec iov; - - uio.uio_iovcnt = 1; - uio.uio_iov = &iov; - iov.iov_base = buf; - iov.iov_len = tlen; - - uio.uio_offset = 0; - uio.uio_resid = tlen; - uio.uio_rw = UIO_READ; - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_td = curthread; - - return (tmpfs_nocacheread(tobj, idx, offset, tlen, &uio)); -} - -static int -tmpfs_mappedread(vm_object_t vobj, vm_object_t tobj, size_t len, struct uio *uio) -{ - struct sf_buf *sf; - vm_pindex_t idx; - vm_page_t m; - vm_offset_t offset; - off_t addr; - size_t tlen; - char *ma; - int error; - - addr = uio->uio_offset; - idx = OFF_TO_IDX(addr); - offset = addr & PAGE_MASK; - tlen = MIN(PAGE_SIZE - offset, len); - - VM_OBJECT_WLOCK(vobj); -lookupvpg: - if (((m = vm_page_lookup(vobj, idx)) != NULL) && - vm_page_is_valid(m, offset, tlen)) { - if ((m->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking and sleeping so - * that the page daemon is less likely to reclaim it. - */ - vm_page_reference(m); - vm_page_sleep(m, "tmfsmr"); - goto lookupvpg; - } - vm_page_busy(m); - VM_OBJECT_WUNLOCK(vobj); - error = uiomove_fromphys(&m, offset, tlen, uio); - VM_OBJECT_WLOCK(vobj); - vm_page_wakeup(m); - VM_OBJECT_WUNLOCK(vobj); - return (error); - } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { - KASSERT(offset == 0, - ("unexpected offset in tmpfs_mappedread for sendfile")); - if ((m->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking and sleeping so - * that the page daemon is less likely to reclaim it. - */ - vm_page_reference(m); - vm_page_sleep(m, "tmfsmr"); - goto lookupvpg; - } - vm_page_busy(m); - VM_OBJECT_WUNLOCK(vobj); - sched_pin(); - sf = sf_buf_alloc(m, SFB_CPUPRIVATE); - ma = (char *)sf_buf_kva(sf); - error = tmpfs_nocacheread_buf(tobj, idx, 0, tlen, ma); - if (error == 0) { - if (tlen != PAGE_SIZE) - bzero(ma + tlen, PAGE_SIZE - tlen); - uio->uio_offset += tlen; - uio->uio_resid -= tlen; - } - sf_buf_free(sf); - sched_unpin(); - VM_OBJECT_WLOCK(vobj); - if (error == 0) - m->valid = VM_PAGE_BITS_ALL; - vm_page_wakeup(m); - VM_OBJECT_WUNLOCK(vobj); - return (error); - } - VM_OBJECT_WUNLOCK(vobj); - error = tmpfs_nocacheread(tobj, idx, offset, tlen, uio); - - return (error); -} - static int tmpfs_read(struct vop_read_args *v) { struct vnode *vp = v->a_vp; struct uio *uio = v->a_uio; - struct tmpfs_node *node; vm_object_t uobj; size_t len; int resid; - int error = 0; + vm_pindex_t idx; + vm_offset_t offset; + off_t addr; + size_t tlen; node = VP_TO_TMPFS_NODE(vp); @@ -607,7 +538,11 @@ tmpfs_read(struct vop_read_args *v) len = MIN(node->tn_size - uio->uio_offset, resid); if (len == 0) break; - error = tmpfs_mappedread(vp->v_object, uobj, len, uio); + addr = uio->uio_offset; + idx = OFF_TO_IDX(addr); + offset = addr & PAGE_MASK; + tlen = MIN(PAGE_SIZE - offset, len); + error = tmpfs_nocacheread(uobj, idx, offset, tlen, uio); if ((error != 0) || (resid == uio->uio_resid)) break; } @@ -620,10 +555,10 @@ out: /* --------------------------------------------------------------------- */ static int -tmpfs_mappedwrite(vm_object_t vobj, vm_object_t tobj, size_t len, struct uio *uio) +tmpfs_mappedwrite(vm_object_t tobj, size_t len, struct uio *uio) { vm_pindex_t idx; - vm_page_t vpg, tpg; + vm_page_t tpg; vm_offset_t offset; off_t addr; size_t tlen; @@ -636,69 +571,47 @@ tmpfs_mappedwrite(vm_object_t vobj, vm_o offset = addr & PAGE_MASK; tlen = MIN(PAGE_SIZE - offset, len); - VM_OBJECT_WLOCK(vobj); -lookupvpg: - if (((vpg = vm_page_lookup(vobj, idx)) != NULL) && - vm_page_is_valid(vpg, offset, tlen)) { - if ((vpg->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking and sleeping so - * that the page daemon is less likely to reclaim it. - */ - vm_page_reference(vpg); - vm_page_sleep(vpg, "tmfsmw"); - goto lookupvpg; - } - vm_page_busy(vpg); - vm_page_undirty(vpg); - VM_OBJECT_WUNLOCK(vobj); - error = uiomove_fromphys(&vpg, offset, tlen, uio); - } else { - if (vm_page_is_cached(vobj, idx)) - vm_page_cache_free(vobj, idx, idx + 1); - VM_OBJECT_WUNLOCK(vobj); - vpg = NULL; - } VM_OBJECT_WLOCK(tobj); - tpg = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | - VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + tpg = vm_page_grab(tobj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (tpg->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(tobj, idx, NULL, NULL)) { rv = vm_pager_get_pages(tobj, &tpg, 1, 0); + tpg = vm_page_lookup(tobj, idx); + if (tpg == NULL) { + printf( + "tmpfs: vm_obj %p idx %jd null lookup rv %d\n", + tobj, idx, rv); + return (EIO); + } if (rv != VM_PAGER_OK) { + printf( + "tmpfs: vm_obj %p idx %jd valid %x pager error %d\n", + tobj, idx, tpg->valid, rv); vm_page_lock(tpg); vm_page_free(tpg); vm_page_unlock(tpg); - error = EIO; - goto out; + VM_OBJECT_WUNLOCK(tobj); + return (EIO); } } else vm_page_zero_invalid(tpg, TRUE); } + vm_page_lock(tpg); + vm_page_hold(tpg); + vm_page_wakeup(tpg); + vm_page_unlock(tpg); VM_OBJECT_WUNLOCK(tobj); - if (vpg == NULL) - error = uiomove_fromphys(&tpg, offset, tlen, uio); - else { - KASSERT(vpg->valid == VM_PAGE_BITS_ALL, ("parts of vpg invalid")); - pmap_copy_page(vpg, tpg); - } + error = uiomove_fromphys(&tpg, offset, tlen, uio); VM_OBJECT_WLOCK(tobj); - if (error == 0) { - KASSERT(tpg->valid == VM_PAGE_BITS_ALL, - ("parts of tpg invalid")); + if (error == 0) vm_page_dirty(tpg); - } vm_page_lock(tpg); - vm_page_unwire(tpg, TRUE); + vm_page_unhold(tpg); + vm_page_deactivate(tpg); + /* Requeue to maintain LRU ordering. */ + vm_page_requeue(tpg); vm_page_unlock(tpg); - vm_page_wakeup(tpg); -out: VM_OBJECT_WUNLOCK(tobj); - if (vpg != NULL) { - VM_OBJECT_WLOCK(vobj); - vm_page_wakeup(vpg); - VM_OBJECT_WUNLOCK(vobj); - } return (error); } @@ -756,7 +669,7 @@ tmpfs_write(struct vop_write_args *v) len = MIN(node->tn_size - uio->uio_offset, resid); if (len == 0) break; - error = tmpfs_mappedwrite(vp->v_object, uobj, len, uio); + error = tmpfs_mappedwrite(uobj, len, uio); if ((error != 0) || (resid == uio->uio_resid)) break; } @@ -1536,8 +1449,6 @@ tmpfs_inactive(struct vop_inactive_args struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); - node = VP_TO_TMPFS_NODE(vp); if (node->tn_links == 0) @@ -1555,11 +1466,24 @@ tmpfs_reclaim(struct vop_reclaim_args *v struct tmpfs_mount *tmp; struct tmpfs_node *node; + vm_object_t obj; node = VP_TO_TMPFS_NODE(vp); tmp = VFS_TO_TMPFS(vp->v_mount); - vnode_destroy_vobject(vp); + if (node->tn_type == VREG) { + obj = node->tn_reg.tn_aobj; + if (obj != NULL) { + /* Instead of vnode_destroy_vobject() */ + VM_OBJECT_WLOCK(obj); + VI_LOCK(vp); + vm_object_clear_flag(obj, OBJ_TMPFS); + obj->un_pager.swp.swp_tmpfs = NULL; + VI_UNLOCK(vp); + VM_OBJECT_WUNLOCK(obj); + } + } + vp->v_object = NULL; cache_purge(vp); TMPFS_NODE_LOCK(node); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Apr 28 19:25:09 2013 (r250029) +++ head/sys/vm/vm_object.c Sun Apr 28 19:38:59 2013 (r250030) @@ -505,6 +505,7 @@ void vm_object_deallocate(vm_object_t object) { vm_object_t temp; + struct vnode *vp; while (object != NULL) { VM_OBJECT_WLOCK(object); @@ -527,15 +528,36 @@ vm_object_deallocate(vm_object_t object) VM_OBJECT_WUNLOCK(object); return; } else if (object->ref_count == 1) { + if (object->type == OBJT_SWAP && + (object->flags & OBJ_TMPFS) != 0) { + vp = object->un_pager.swp.swp_tmpfs; + vhold(vp); + VM_OBJECT_WUNLOCK(object); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vdrop(vp); + VM_OBJECT_WLOCK(object); + if (object->type == OBJT_DEAD) { + VM_OBJECT_WUNLOCK(object); + VOP_UNLOCK(vp, 0); + return; + } else if ((object->flags & OBJ_TMPFS) != 0) { + if (object->ref_count == 1) + VOP_UNSET_TEXT(vp); + VOP_UNLOCK(vp, 0); + } + } if (object->shadow_count == 0 && object->handle == NULL && (object->type == OBJT_DEFAULT || - object->type == OBJT_SWAP)) { + (object->type == OBJT_SWAP && + (object->flags & OBJ_TMPFS) == 0))) { vm_object_set_flag(object, OBJ_ONEMAPPING); } else if ((object->shadow_count == 1) && (object->handle == NULL) && (object->type == OBJT_DEFAULT || object->type == OBJT_SWAP)) { + KASSERT((object->flags & OBJ_TMPFS) == 0, + ("Shadowed tmpfs v_object")); vm_object_t robject; robject = LIST_FIRST(&object->shadow_head); Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sun Apr 28 19:25:09 2013 (r250029) +++ head/sys/vm/vm_object.h Sun Apr 28 19:38:59 2013 (r250030) @@ -154,11 +154,21 @@ struct vm_object { /* * Swap pager * + * swp_tmpfs - back-pointer to the tmpfs vnode, + * if any, which uses the vm object + * as backing store. The handle + * cannot be reused for linking, + * because the vnode can be + * reclaimed and recreated, making + * the handle changed and hash-chain + * invalid. + * * swp_bcount - number of swap 'swblock' metablocks, each * contains up to 16 swapblk assignments. * see vm/swap_pager.h */ struct { + void *swp_tmpfs; int swp_bcount; } swp; } un_pager; @@ -179,6 +189,7 @@ struct vm_object { #define OBJ_COLORED 0x1000 /* pg_color is defined */ #define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ #define OBJ_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */ +#define OBJ_TMPFS 0x8000 #define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT) #define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT)) From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 20:46:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57E0D402; Sun, 28 Apr 2013 20:46:33 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4ADEA1446; Sun, 28 Apr 2013 20:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SKkXqC062933; Sun, 28 Apr 2013 20:46:33 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SKkXwP062932; Sun, 28 Apr 2013 20:46:33 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304282046.r3SKkXwP062932@svn.freebsd.org> From: Sean Bruno Date: Sun, 28 Apr 2013 20:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250031 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 20:46:33 -0000 Author: sbruno Date: Sun Apr 28 20:46:32 2013 New Revision: 250031 URL: http://svnweb.freebsd.org/changeset/base/250031 Log: The controller does not zero this data structure, ever. Zero it out here so we do not misinterpret the data error. Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Apr 28 19:38:59 2013 (r250030) +++ head/sys/dev/ciss/ciss.c Sun Apr 28 20:46:32 2013 (r250031) @@ -2487,6 +2487,7 @@ ciss_preen_command(struct ciss_request * cc->header.sg_total = 0; cc->header.host_tag = cr->cr_tag << 2; cc->header.host_tag_zeroes = 0; + bzero(&(cc->sg[0]), CISS_COMMAND_ALLOC_SIZE - sizeof(struct ciss_command)); cmdphys = cr->cr_ccphys; cc->error_info.error_info_address = cmdphys + sizeof(struct ciss_command); cc->error_info.error_info_length = CISS_COMMAND_ALLOC_SIZE - sizeof(struct ciss_command); From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 20:55:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 63D7D924; Sun, 28 Apr 2013 20:55:46 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55B1114A0; Sun, 28 Apr 2013 20:55:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SKtkUO066285; Sun, 28 Apr 2013 20:55:46 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SKtkXk066284; Sun, 28 Apr 2013 20:55:46 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304282055.r3SKtkXk066284@svn.freebsd.org> From: Sean Bruno Date: Sun, 28 Apr 2013 20:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250032 - head/sys/dev/hptrr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 20:55:46 -0000 Author: sbruno Date: Sun Apr 28 20:55:45 2013 New Revision: 250032 URL: http://svnweb.freebsd.org/changeset/base/250032 Log: Silence warning from clang: /home/sbruno/bsd/head/sys/dev/hptrr/hptrr_osm_bsd.c:178:66: warning: for loop has empty body [-Wempty-body] for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) ; ^ /home/sbruno/bsd/head/sys/dev/hptrr/hptrr_osm_bsd.c:178:66: note: put the semicolon on a separate line to silence this warning Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Sun Apr 28 20:46:32 2013 (r250031) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Sun Apr 28 20:55:45 2013 (r250032) @@ -175,7 +175,8 @@ static int hpt_alloc_mem(PVBUS_EXT vbus_ HPT_ASSERT((f->size & (f->alignment-1))==0); - for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) ; + for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) + ; KdPrint(("%s: %d*%d=%d bytes, order %d", f->tag, f->count, f->size, f->count*f->size, order)); From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 21:14:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C966319C; Sun, 28 Apr 2013 21:14:23 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BAE39155E; Sun, 28 Apr 2013 21:14:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SLENgI074017; Sun, 28 Apr 2013 21:14:23 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SLEN1G074015; Sun, 28 Apr 2013 21:14:23 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304282114.r3SLEN1G074015@svn.freebsd.org> From: Steven Hartland Date: Sun, 28 Apr 2013 21:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250033 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 21:14:23 -0000 Author: smh Date: Sun Apr 28 21:14:23 2013 New Revision: 250033 URL: http://svnweb.freebsd.org/changeset/base/250033 Log: Correct comment typo's Add missing comment Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Apr 28 20:55:45 2013 (r250032) +++ head/sys/cam/ata/ata_da.c Sun Apr 28 21:14:23 2013 (r250033) @@ -1147,7 +1147,7 @@ adaregister(struct cam_periph *periph, v snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.write_cache", periph->unit_number); TUNABLE_INT_FETCH(announce_buf, &softc->write_cache); - /* Disable queue sorting for non-rotatational media by default */ + /* Disable queue sorting for non-rotational media by default. */ if (cgd->ident_data.media_rotation_rate == 1) softc->sort_io_queue = 0; else Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sun Apr 28 20:55:45 2013 (r250032) +++ head/sys/cam/scsi/scsi_da.c Sun Apr 28 21:14:23 2013 (r250033) @@ -3058,6 +3058,10 @@ dadone(struct cam_periph *periph, union bdc = (struct scsi_vpd_block_characteristics *)csio->data_ptr; if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + /* + * Disable queue sorting for non-rotational media + * by default. + */ if (scsi_2btoul(bdc->medium_rotation_rate) == SVPD_BDC_RATE_NONE_ROTATING) softc->sort_io_queue = 0; @@ -3106,8 +3110,8 @@ dadone(struct cam_periph *periph, union ATA_DSM_BLK_RANGES); } /* - * Disable queue sorting for non-rotatational media - * by default + * Disable queue sorting for non-rotational media + * by default. */ if (ata_params->media_rotation_rate == 1) softc->sort_io_queue = 0; From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 21:44:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 518F8BF2; Sun, 28 Apr 2013 21:44:45 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 42F3D163C; Sun, 28 Apr 2013 21:44:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SLijfj084465; Sun, 28 Apr 2013 21:44:45 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SLijb6084464; Sun, 28 Apr 2013 21:44:45 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201304282144.r3SLijb6084464@svn.freebsd.org> From: Nick Hibma Date: Sun, 28 Apr 2013 21:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250034 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 21:44:45 -0000 Author: n_hibma Date: Sun Apr 28 21:44:44 2013 New Revision: 250034 URL: http://svnweb.freebsd.org/changeset/base/250034 Log: Doing a cpio from /var/empty if dir was not specified or non-existent copies its mode to the destination. This is not desirable. Rephrase this code to be more sensible. PR: 173483 MFC after: 1 week Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 21:14:23 2013 (r250033) +++ head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 21:44:44 2013 (r250034) @@ -413,12 +413,13 @@ populate_slice ( ) ( dir=$2 mnt=$3 lbl=$4 - test -z $2 && dir=${NANO_WORLDDIR}/var/empty - test -d $dir || dir=${NANO_WORLDDIR}/var/empty - echo "Creating ${dev} with ${dir} (mounting on ${mnt})" - newfs_part $dev $mnt $lbl - cd ${dir} - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} + echo "Creating ${dev} (mounting on ${mnt})" + newfs_part ${dev} ${mnt} ${lbl} + if [ -n "${dir}" -a -d "${dir}" ]; then + echo "Populating ${lbl} from ${dir}" + cd ${dir} + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} + fi df -i ${mnt} umount ${mnt} ) From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 22:05:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7C75106; Sun, 28 Apr 2013 22:05:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AAC6916BF; Sun, 28 Apr 2013 22:05:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SM51dt091553; Sun, 28 Apr 2013 22:05:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SM51GT091551; Sun, 28 Apr 2013 22:05:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304282205.r3SM51GT091551@svn.freebsd.org> From: Eitan Adler Date: Sun, 28 Apr 2013 22:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250035 - head/bin/kill X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 22:05:01 -0000 Author: eadler Date: Sun Apr 28 22:05:01 2013 New Revision: 250035 URL: http://svnweb.freebsd.org/changeset/base/250035 Log: Remove cast that was only required for K&R C. Reviewed by: jilles Modified: head/bin/kill/kill.c Modified: head/bin/kill/kill.c ============================================================================== --- head/bin/kill/kill.c Sun Apr 28 21:44:44 2013 (r250034) +++ head/bin/kill/kill.c Sun Apr 28 22:05:01 2013 (r250035) @@ -156,7 +156,7 @@ signame_to_signum(const char *sig) { int n; - if (!strncasecmp(sig, "SIG", (size_t)3)) + if (strncasecmp(sig, "SIG", 3) == 0) sig += 3; for (n = 1; n < sys_nsig; n++) { if (!strcasecmp(sys_signame[n], sig)) From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 22:12:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6E3A06A3; Sun, 28 Apr 2013 22:12:41 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 46C5E16F2; Sun, 28 Apr 2013 22:12:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SMCfbl095280; Sun, 28 Apr 2013 22:12:41 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SMCfrS095279; Sun, 28 Apr 2013 22:12:41 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201304282212.r3SMCfrS095279@svn.freebsd.org> From: Nick Hibma Date: Sun, 28 Apr 2013 22:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250036 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 22:12:41 -0000 Author: n_hibma Date: Sun Apr 28 22:12:40 2013 New Revision: 250036 URL: http://svnweb.freebsd.org/changeset/base/250036 Log: Replace a silly command sequence with a proper if-then-else. Generate images sparsely. This saves space and time, especially when generating images inside a VM (PR 173482). Add a 'true' statement to last_orders to prevent some version of sh from tripping over an empty function. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 22:05:01 2013 (r250035) +++ head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 22:12:40 2013 (r250036) @@ -359,8 +359,7 @@ setup_nanobsd ( ) ( echo "mount -o ro /dev/${NANO_DRIVE}s3" > conf/default/etc/remount # Put /tmp on the /var ramdisk (could be symlink already) - rmdir tmp || true - rm tmp || true + test -d tmp && rmdir tmp || rm -f tmp ln -s var/tmp tmp ) > ${NANO_OBJ}/_.dl 2>&1 @@ -541,7 +540,7 @@ create_i386_diskimage ( ) ( if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) echo "Duplicating to second image..." - dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k + dd conv=sparse if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k mount /dev/${MD}s2a ${MNT} for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab do @@ -565,12 +564,12 @@ create_i386_diskimage ( ) ( if [ "${NANO_MD_BACKING}" = "swap" ] ; then echo "Writing out ${NANO_IMGNAME}..." - dd if=/dev/${MD} of=${IMG} bs=64k + dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k fi if ${do_copyout_partition} ; then echo "Writing out _.disk.image..." - dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + dd conv=sparse if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k fi mdconfig -d -u $MD @@ -589,6 +588,7 @@ last_orders () ( # after the build completed, for instance to copy the finished # image to a more convenient place: # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk + true ) ####################################################################### From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 22:52:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 645B294B; Sun, 28 Apr 2013 22:52:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B6F2186B; Sun, 28 Apr 2013 22:52:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SMqikU009206; Sun, 28 Apr 2013 22:52:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SMqiHH009205; Sun, 28 Apr 2013 22:52:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304282252.r3SMqiHH009205@svn.freebsd.org> From: Eitan Adler Date: Sun, 28 Apr 2013 22:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250037 - head/bin/hostname X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 22:52:44 -0000 Author: eadler Date: Sun Apr 28 22:52:43 2013 New Revision: 250037 URL: http://svnweb.freebsd.org/changeset/base/250037 Log: Mark usage() __dead2 Modified: head/bin/hostname/hostname.c Modified: head/bin/hostname/hostname.c ============================================================================== --- head/bin/hostname/hostname.c Sun Apr 28 22:12:40 2013 (r250036) +++ head/bin/hostname/hostname.c Sun Apr 28 22:52:43 2013 (r250037) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -static void usage(void); +static void usage(void) __dead2; int main(int argc, char *argv[]) From owner-svn-src-all@FreeBSD.ORG Sun Apr 28 23:43:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 79BD9DE9; Sun, 28 Apr 2013 23:43:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pb0-x229.google.com (mail-pb0-x229.google.com [IPv6:2607:f8b0:400e:c01::229]) by mx1.freebsd.org (Postfix) with ESMTP id 45D881BC6; Sun, 28 Apr 2013 23:43:21 +0000 (UTC) Received: by mail-pb0-f41.google.com with SMTP id md4so104272pbc.28 for ; Sun, 28 Apr 2013 16:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=RYPPlk7NZ1snAEfN89jvlHnrE6Wa7tN+8flTc7Afr5o=; b=ZjmCE1+gJdJv9YhxjV/9K59zl9WlkgfrWD873SrtRTM8rnImlW4R0MgK8EeIuC9Bz8 h17LcXcCXi0uxgGurmOMtrSj+u5WxtVnSr2qAht7E1l/dv/VKeQBhHmBVgycfDNpCvwA gD3oK1oky3SX9WcDYc3Qj7S+9axRuLk7wwL47D2eE5MyOupa05LlTICUND13ov7iby0d I9FG3pkQpJ8uCealtsY+phlcCXFcFODtdv8F+/Q9B35Fowd3KgT5VO4rTbMvVftTz6vi 9vPuZOPpqWVrTL3UCliZ5pAf6jNY/zb5fnW+jFjFV7grVkK9ThzfHhU1oshPpZyApLVx M43w== X-Received: by 10.66.148.132 with SMTP id ts4mr41010724pab.19.1367192601104; Sun, 28 Apr 2013 16:43:21 -0700 (PDT) Received: from [10.164.125.87] (mobile-166-147-082-058.mycingular.net. [166.147.82.58]) by mx.google.com with ESMTPSA id tx9sm21427411pbc.27.2013.04.28.16.43.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:43:20 -0700 (PDT) References: <201304282144.r3SLijb6084464@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201304282144.r3SLijb6084464@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <87DD1BC2-9658-4405-ABC5-BE05C3E6C6B4@gmail.com> X-Mailer: iPhone Mail (10B329) From: Garrett Cooper Subject: Re: svn commit: r250034 - head/tools/tools/nanobsd Date: Sun, 28 Apr 2013 16:43:11 -0700 To: Nick Hibma Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 23:43:21 -0000 On Apr 28, 2013, at 2:44 PM, Nick Hibma wrote: > Author: n_hibma > Date: Sun Apr 28 21:44:44 2013 > New Revision: 250034 > URL: http://svnweb.freebsd.org/changeset/base/250034 >=20 > Log: > Doing a cpio from /var/empty if dir was not specified or non-existent > copies its mode to the destination. This is not desirable. > Rephrase this code to be more sensible. >=20 > PR: 173483 > MFC after: 1 week >=20 > Modified: > head/tools/tools/nanobsd/nanobsd.sh >=20 > Modified: head/tools/tools/nanobsd/nanobsd.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 21:14:23 2013 (r2= 50033) > +++ head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 21:44:44 2013 (r2= 50034) > @@ -413,12 +413,13 @@ populate_slice ( ) ( > dir=3D$2 > mnt=3D$3 > lbl=3D$4 > - test -z $2 && dir=3D${NANO_WORLDDIR}/var/empty > - test -d $dir || dir=3D${NANO_WORLDDIR}/var/empty > - echo "Creating ${dev} with ${dir} (mounting on ${mnt})" > - newfs_part $dev $mnt $lbl > - cd ${dir} > - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} > + echo "Creating ${dev} (mounting on ${mnt})" > + newfs_part ${dev} ${mnt} ${lbl} > + if [ -n "${dir}" -a -d "${dir}" ]; then > + echo "Populating ${lbl} from ${dir}" > + cd ${dir} > + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} > + fi > df -i ${mnt} > umount ${mnt} > ) Awesome! Would you be interested in ushering in some of the nanobsd PRs in t= he queue, perhaps? Thanks! -Garrett= From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 00:06:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 493103DB; Mon, 29 Apr 2013 00:06:25 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id A5DB71C8E; Mon, 29 Apr 2013 00:06:23 +0000 (UTC) Received: by mail-ee0-f41.google.com with SMTP id c50so2120396eek.28 for ; Sun, 28 Apr 2013 17:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=R4LPU2EGJLxVVJMrMZqDsHwM1nuLt0omHiOPp2aaI5M=; b=XR8hxq28ibRObv4asIO7DFSjU9xqT07O1yWzoRYccF0k3C/rO1aQpsfdMIKePH4pK8 7/mv0iVdjepy5GkC8okmyLY2C0tP2EtS0b5K8qPUdRVLMaXFUIVCat9PE6Zm0/Acbx4z GqjCRyb9us/htRvEBHYGJliYcFdwXjgWw3Ei1Qd68A65LSEwwgyEtCLBR2DtXlmCD3hh LXtdz+pCzBoPDEWFmLbSPNYJ9xP6n5wtUYf6hJMRmbM4Q79UN700S4KK6SScHetwDCkl zvwULUfeMn78bose2+Hg0ll/i5HnQb704zg1dZuJuFNP/6AVRdPxHuS0mRiom7xeehBg 6O9w== MIME-Version: 1.0 X-Received: by 10.14.219.8 with SMTP id l8mr16887076eep.40.1367193976535; Sun, 28 Apr 2013 17:06:16 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.14.204.200 with HTTP; Sun, 28 Apr 2013 17:06:16 -0700 (PDT) In-Reply-To: References: <201304231302.r3ND2w5V024981@svn.freebsd.org> Date: Sun, 28 Apr 2013 17:06:16 -0700 X-Google-Sender-Auth: kTjpxDkdAATQZH29CKVT3z5SSqQ Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: hiren panchasara To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , Adrian Chadd , src-committers , Eitan Adler , svn-src-all X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 00:06:25 -0000 On Tue, Apr 23, 2013 at 9:46 AM, hiren panchasara wrote: > On Tue, Apr 23, 2013 at 9:34 AM, Eitan Adler wrote: >> On 23 April 2013 12:19, Adrian Chadd wrote: >>> ... you know, even though it doesn't have an active maintainer, do you >>> have test hardware, and why didn't you just bounce a patch to >>> -wireless for review? > > My bad. I proposed this change initially. >>> >>> We don't bite you know! >> >> that you need to emphasize this does not comfort me. ;) >> >> reverted in 249812. > > Will look at john's suggestions and fix it correctly. John, Does this look okay? % svn diff Index: if_bwn.c =================================================================== --- if_bwn.c (revision 250036) +++ if_bwn.c (working copy) @@ -9240,9 +9240,9 @@ BUS_DMASYNC_PREWRITE); /* - * Setup RX buf descriptor + * Restore RX buf descriptor */ - dr->setdesc(dr, desc, paddr, meta->mt_m->m_len - + dr->setdesc(dr, desc, meta->mt_paddr, meta->mt_m->m_len - sizeof(*hdr), 0, 0, 0); return (error); } Thanks, Hiren > > Hiren >> >> -- >> Eitan Adler >> Source, Ports, Doc committer >> Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 01:29:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 70570CD3 for ; Mon, 29 Apr 2013 01:29:22 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx1.freebsd.org (Postfix) with ESMTP id 2F46A1E3A for ; Mon, 29 Apr 2013 01:29:21 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id ha12so2479994vcb.2 for ; Sun, 28 Apr 2013 18:29:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=QhpKI9EI3Xtqy3fAEd4KiUyWcwflazCJ7kdAzDBDXLE=; b=MS8NqpayjPYH71Z9wwqCOZPJlLFxTCao2c5/50QibUy+Levr2tL3TVohfZrf4x9hUH ftE3jqrPFYznp72o5+8ySRSzTOFdOqAg333R1LLFDul0znI686VXaL0ulkwN7ysLFmXd kldkgCl5LOxuYYjGaac9Wz6SXdIyUhQ8bjjTM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=QhpKI9EI3Xtqy3fAEd4KiUyWcwflazCJ7kdAzDBDXLE=; b=Mubpqz3It//OYI2H9sjYF2fEhPmgk0TjWAX3T26at0qU1/lpLj+luN1YaGj+3VvNOg oVaJ+VzKD8DrUfkm/dmPI0A/hgD9pNZw6iK+1hSHOq2KdyImqhDkAyPedlIn4VRdIpdN rh7Y+GeoI8CNlRI6FQm6ecAVn1v/5M5OqW6QppdlnfuMBXbiW5KAz9M30CIToYW1sLeN yyoyZ/YFAscEApLV5BgE6xBVRWAnv9HwZmm9+IdjgFj5IM25RiNgH9gzmVUwgFBut+fq hf/H3t9CMK5+3w2pTdIn8iaz40b1J1WkK3FCvk06Qsnc7z3e9nX8Ef6wmy6qWY71+1el SRuA== MIME-Version: 1.0 X-Received: by 10.220.169.78 with SMTP id x14mr17435796vcy.41.1367198961184; Sun, 28 Apr 2013 18:29:21 -0700 (PDT) Received: by 10.220.215.70 with HTTP; Sun, 28 Apr 2013 18:29:21 -0700 (PDT) In-Reply-To: References: <201304180944.r3I9i05t093967@svn.freebsd.org> <517AC0BB.4040207@FreeBSD.org> Date: Sun, 28 Apr 2013 18:29:21 -0700 Message-ID: Subject: Re: svn commit: r249611 - in stable/9/sys/cam: ata scsi From: Peter Wemm To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmV+IY+r+RNDt8tJvIu62qOuHrLs6WyF5S2/PvHmcit4txt/Z9HfGl1P7BPuKkQrkK3Z3ui Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 01:29:22 -0000 On Sat, Apr 27, 2013 at 5:56 PM, Peter Wemm wrote: > On Fri, Apr 26, 2013 at 11:00 AM, Alexander Motin wrote: >> On 26.04.2013 19:47, Peter Wemm wrote: >>> >>> On Thu, Apr 18, 2013 at 2:44 AM, Alexander Motin wrote: >>>> >>>> Author: mav >>>> Date: Thu Apr 18 09:44:00 2013 >>>> New Revision: 249611 >>>> URL: http://svnweb.freebsd.org/changeset/base/249611 > [..] >>> This breaks a number of machines in the freebsd.org cluster. I have >>> to back out both of these changes to get them to reboot. >> >> >> I've made a search though the base system and found only two drivers >> affected by this change: mpt and hptmv. I've patched both at head r249849 >> and going to merge fix to stable/9 tomorrow unless objected. Have you tried >> that patch instead of reverting? > > I'm testing this on ns1.freebsd.org and ns2.freebsd.org as we speak. > If the cluster goes dark, that's why :) The machines have survived multiple reboots with > r249849. I do wonder if perhaps "post_sync" isn't the ideal name. Perhaps add a "quiesce_hardware" eventhandler chain and make it clear that this is the hook for what things like mpt were doing. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 04:38:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1EC6CEB8; Mon, 29 Apr 2013 04:38:44 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0DE051283; Mon, 29 Apr 2013 04:38:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3T4cilP029962; Mon, 29 Apr 2013 04:38:44 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3T4chWt029958; Mon, 29 Apr 2013 04:38:43 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304290438.r3T4chWt029958@svn.freebsd.org> From: Hiren Panchasara Date: Mon, 29 Apr 2013 04:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250038 - stable/9/sys/dev/hwpmc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 04:38:44 -0000 Author: hiren Date: Mon Apr 29 04:38:43 2013 New Revision: 250038 URL: http://svnweb.freebsd.org/changeset/base/250038 Log: MFC: r249069 Trailing whitespace cleanup along with 80 column enforcemnt. MFC: r249428 Cosmetic change: Fix a comment reference for Ivy Bridge *Xeon* MFC: r249460 Improve/correct a comment. We now support a lot more cpu types. Approved by: sbruno (mentor) Modified: stable/9/sys/dev/hwpmc/hwpmc_core.c stable/9/sys/dev/hwpmc/hwpmc_intel.c stable/9/sys/dev/hwpmc/hwpmc_uncore.c stable/9/sys/dev/hwpmc/pmc_events.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_core.c Sun Apr 28 22:52:43 2013 (r250037) +++ stable/9/sys/dev/hwpmc/hwpmc_core.c Mon Apr 29 04:38:43 2013 (r250038) @@ -25,7 +25,7 @@ */ /* - * Intel Core, Core 2 and Atom PMCs. + * Intel Core PMCs. */ #include @@ -560,7 +560,7 @@ struct iap_event_descr { #define IAP_F_SB (1 << 6) /* CPU: Sandy Bridge */ #define IAP_F_IB (1 << 7) /* CPU: Ivy Bridge */ #define IAP_F_SBX (1 << 8) /* CPU: Sandy Bridge Xeon */ -#define IAP_F_IBX (1 << 9) /* CPU: Ivy Bridge */ +#define IAP_F_IBX (1 << 9) /* CPU: Ivy Bridge Xeon */ #define IAP_F_HW (1 << 10) /* CPU: Haswell */ #define IAP_F_FM (1 << 11) /* Fixed mask */ @@ -604,7 +604,7 @@ static struct iap_event_descr iap_events IAPDESCR(03H_00H, 0x03, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(03H_01H, 0x03, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_SBX), - IAPDESCR(03H_02H, 0x03, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | + IAPDESCR(03H_02H, 0x03, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(03H_04H, 0x03, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), IAPDESCR(03H_08H, 0x03, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | @@ -622,8 +622,8 @@ static struct iap_event_descr iap_events IAPDESCR(05H_00H, 0x05, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(05H_01H, 0x05, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(05H_02H, 0x05, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAPDESCR(05H_02H, 0x05, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(05H_03H, 0x05, 0x03, IAP_F_FM | IAP_F_I7O), IAPDESCR(06H_00H, 0x06, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2 | @@ -635,7 +635,7 @@ static struct iap_event_descr iap_events IAPDESCR(06H_0FH, 0x06, 0x0F, IAP_F_FM | IAP_F_I7O), IAPDESCR(07H_00H, 0x07, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), - IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | + IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(07H_02H, 0x07, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2), @@ -683,8 +683,8 @@ static struct iap_event_descr iap_events IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW), IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(0EH_02H, 0x0E, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(0EH_10H, 0x0E, 0x10, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), IAPDESCR(0EH_20H, 0x0E, 0x20, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), @@ -698,7 +698,7 @@ static struct iap_event_descr iap_events IAPDESCR(0FH_80H, 0x0F, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(10H_00H, 0x10, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), - IAPDESCR(10H_01H, 0x10, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | + IAPDESCR(10H_01H, 0x10, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(10H_02H, 0x10, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(10H_04H, 0x10, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -737,7 +737,7 @@ static struct iap_event_descr iap_events IAPDESCR(13H_81H, 0x13, 0x81, IAP_F_FM | IAP_F_CA), IAPDESCR(14H_00H, 0x14, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), - IAPDESCR(14H_01H, 0x14, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | + IAPDESCR(14H_01H, 0x14, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(14H_02H, 0x14, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -764,37 +764,37 @@ static struct iap_event_descr iap_events IAPDESCR(23H, 0x23, IAP_M_CORE, IAP_F_ALLCPUSCORE2), IAPDESCR(24H, 0x24, IAP_M_CORE | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), - IAPDESCR(24H_01H, 0x24, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), + IAPDESCR(24H_01H, 0x24, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(24H_02H, 0x24, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(24H_03H, 0x24, 0x03, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_04H, 0x24, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_08H, 0x24, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_0CH, 0x24, 0x0C, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_10H, 0x24, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_20H, 0x24, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), + IAPDESCR(24H_03H, 0x24, 0x03, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(24H_04H, 0x24, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(24H_08H, 0x24, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(24H_0CH, 0x24, 0x0C, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(24H_10H, 0x24, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(24H_20H, 0x24, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(24H_21H, 0x24, 0x21, IAP_F_FM | IAP_F_HW), IAPDESCR(24H_22H, 0x24, 0x22, IAP_F_FM | IAP_F_HW), IAPDESCR(24H_24H, 0x24, 0x24, IAP_F_FM | IAP_F_HW), IAPDESCR(24H_27H, 0x24, 0x27, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_30H, 0x24, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(24H_40H, 0x24, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), + IAPDESCR(24H_30H, 0x24, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAPDESCR(24H_40H, 0x24, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(24H_41H, 0x24, 0x41, IAP_F_FM | IAP_F_HW), IAPDESCR(24H_42H, 0x24, 0x42, IAP_F_FM | IAP_F_HW), IAPDESCR(24H_44H, 0x24, 0x44, IAP_F_FM | IAP_F_HW), IAPDESCR(24H_50H, 0x24, 0x50, IAP_F_FM | IAP_F_HW), - IAPDESCR(24H_80H, 0x24, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_C0H, 0x24, 0xC0, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), + IAPDESCR(24H_80H, 0x24, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(24H_C0H, 0x24, 0xC0, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(24H_E1H, 0x24, 0xE1, IAP_F_FM | IAP_F_HW), IAPDESCR(24H_E2H, 0x24, 0xE2, IAP_F_FM | IAP_F_HW), IAPDESCR(24H_E4H, 0x24, 0xE4, IAP_F_FM | IAP_F_HW), @@ -820,16 +820,16 @@ static struct iap_event_descr iap_events IAPDESCR(26H_FFH, 0x26, 0xFF, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(27H, 0x27, IAP_M_CORE | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), - IAPDESCR(27H_01H, 0x27, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), + IAPDESCR(27H_01H, 0x27, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(27H_02H, 0x27, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(27H_04H, 0x27, 0x04, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_SBX), - IAPDESCR(27H_08H, 0x27, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), + IAPDESCR(27H_08H, 0x27, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(27H_0EH, 0x27, 0x0E, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(27H_0FH, 0x27, 0x0F, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), + IAPDESCR(27H_0FH, 0x27, 0x0F, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(27H_10H, 0x27, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(27H_20H, 0x27, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(27H_40H, 0x27, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -839,15 +839,15 @@ static struct iap_event_descr iap_events IAPDESCR(27H_F0H, 0x27, 0xF0, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(28H, 0x28, IAP_M_CORE | IAP_M_MESI, IAP_F_ALLCPUSCORE2), - IAPDESCR(28H_01H, 0x28, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX), - IAPDESCR(28H_02H, 0x28, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SBX), - IAPDESCR(28H_04H, 0x28, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAPDESCR(28H_01H, 0x28, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(28H_08H, 0x28, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAPDESCR(28H_02H, 0x28, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SBX), + IAPDESCR(28H_04H, 0x28, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(28H_08H, 0x28, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(28H_0FH, 0x28, 0x0F, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(28H_0FH, 0x28, 0x0F, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX), IAPDESCR(29H, 0x29, IAP_M_CORE | IAP_M_MESI, IAP_F_CC), IAPDESCR(29H, 0x29, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, @@ -875,9 +875,11 @@ static struct iap_event_descr iap_events IAPDESCR(3BH_C0H, 0x3B, 0xC0, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(3CH_00H, 0x3C, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | + IAP_F_HW), IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | + IAP_F_HW), IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(3DH_01H, 0x3D, 0x01, IAP_F_FM | IAP_F_I7O), @@ -924,14 +926,16 @@ static struct iap_event_descr iap_events IAPDESCR(49H_00H, 0x49, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(49H_01H, 0x49, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | + IAP_F_HW), IAPDESCR(49H_02H, 0x49, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | + IAP_F_HW), IAPDESCR(49H_04H, 0x49, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(49H_0EH, 0x49, 0x0E, IAP_F_FM | IAP_F_HW), IAPDESCR(49H_10H, 0x49, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(49H_20H, 0x49, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_HW), IAPDESCR(49H_40H, 0x49, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW), IAPDESCR(49H_60H, 0x49, 0x60, IAP_F_FM | IAP_F_HW), @@ -994,7 +998,7 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(5CH_02H, 0x5C, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - + IAPDESCR(5EH_01H, 0x5E, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), @@ -1079,7 +1083,7 @@ static struct iap_event_descr iap_events IAPDESCR(79H_18H, 0x79, 0x18, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), IAPDESCR(79H_24H, 0x79, 0x24, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), IAPDESCR(79H_3CH, 0x79, 0x3C, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW), - + IAPDESCR(7AH, 0x7A, IAP_M_AGENT, IAP_F_CA | IAP_F_CC2), IAPDESCR(7BH, 0x7B, IAP_M_AGENT, IAP_F_CA | IAP_F_CC2), @@ -1198,7 +1202,7 @@ static struct iap_event_descr iap_events IAPDESCR(94H_00H, 0x94, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(9CH_01H, 0x9C, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(97H_00H, 0x97, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(98H_00H, 0x98, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), @@ -1224,7 +1228,7 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(A1H_80H, 0xA1, 0x80, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - + IAPDESCR(A2H_00H, 0xA2, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(A2H_01H, 0xA2, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), @@ -1501,7 +1505,7 @@ static struct iap_event_descr iap_events IAPDESCR(CDH_01H, 0xCD, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(CDH_02H, 0xCD, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), + IAP_F_SBX | IAP_F_IBX), IAPDESCR(CEH_00H, 0xCE, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(CFH_00H, 0xCF, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), @@ -1519,7 +1523,7 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(D0H_80H, 0xD0, 0X80, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - + IAPDESCR(D1H_01H, 0xD1, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(D1H_02H, 0xD1, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | @@ -1809,7 +1813,7 @@ iap_event_westmere_ok_on_counter(enum pm case PMC_EV_IAP_EVENT_60H_01H: case PMC_EV_IAP_EVENT_60H_02H: case PMC_EV_IAP_EVENT_60H_04H: - case PMC_EV_IAP_EVENT_60H_08H: + case PMC_EV_IAP_EVENT_60H_08H: case PMC_EV_IAP_EVENT_B3H_01H: case PMC_EV_IAP_EVENT_B3H_02H: case PMC_EV_IAP_EVENT_B3H_04H: @@ -1937,12 +1941,12 @@ iap_allocate_pmc(int cpu, int ri, struct * A small number of events are not supported in all the * processors based on a given microarchitecture. */ - if (ev == PMC_EV_IAP_EVENT_0FH_01H || ev == PMC_EV_IAP_EVENT_0FH_80H) { + if (ev == PMC_EV_IAP_EVENT_0FH_01H || ev == PMC_EV_IAP_EVENT_0FH_80H) { model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); - if (core_cputype == PMC_CPU_INTEL_COREI7 && model != 0x2E) - return (EINVAL); + if (core_cputype == PMC_CPU_INTEL_COREI7 && model != 0x2E) + return (EINVAL); } - + switch (core_cputype) { case PMC_CPU_INTEL_COREI7: if (iap_event_corei7_ok_on_counter(ev, ri) == 0) @@ -1996,10 +2000,10 @@ iap_allocate_pmc(int cpu, int ri, struct case PMC_CPU_INTEL_IVYBRIDGE_XEON: cpuflag = IAP_F_IBX; break; - case PMC_CPU_INTEL_SANDYBRIDGE: + case PMC_CPU_INTEL_SANDYBRIDGE: cpuflag = IAP_F_SB; break; - case PMC_CPU_INTEL_SANDYBRIDGE_XEON: + case PMC_CPU_INTEL_SANDYBRIDGE_XEON: cpuflag = IAP_F_SBX; break; case PMC_CPU_INTEL_WESTMERE: @@ -2459,7 +2463,7 @@ core_intr(int cpu, struct trapframe *tf) if (error) continue; - wrmsr(IAP_EVSEL0 + ri, msr | (pm->pm_md.pm_iap.pm_iap_evsel | + wrmsr(IAP_EVSEL0 + ri, msr | (pm->pm_md.pm_iap.pm_iap_evsel | IAP_EN)); } @@ -2539,8 +2543,8 @@ core2_intr(int cpu, struct trapframe *tf /* Reload sampling count. */ wrmsr(IAF_CTR0 + n, v); - PMCDBG(MDP,INT, 1, "iaf-intr cpu=%d error=%d v=%jx(%jx)", cpu, error, - (uintmax_t) v, (uintmax_t) rdpmc(IAF_RI_TO_MSR(n))); + PMCDBG(MDP,INT, 1, "iaf-intr cpu=%d error=%d v=%jx(%jx)", cpu, + error, (uintmax_t) v, (uintmax_t) rdpmc(IAF_RI_TO_MSR(n))); } /* Modified: stable/9/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_intel.c Sun Apr 28 22:52:43 2013 (r250037) +++ stable/9/sys/dev/hwpmc/hwpmc_intel.c Mon Apr 29 04:38:43 2013 (r250038) @@ -68,7 +68,7 @@ intel_switch_out(struct pmc_cpu *pc, str (uintmax_t) rcr4()); /* always turn off the RDPMC instruction */ - load_cr4(rcr4() & ~CR4_PCE); + load_cr4(rcr4() & ~CR4_PCE); return 0; } @@ -131,8 +131,14 @@ pmc_intel_initialize(void) nclasses = 3; break; case 0x1A: - case 0x1E: /* Per Intel document 253669-032 9/2009, pages A-2 and A-57 */ - case 0x1F: /* Per Intel document 253669-032 9/2009, pages A-2 and A-57 */ + case 0x1E: /* + * Per Intel document 253669-032 9/2009, + * pages A-2 and A-57 + */ + case 0x1F: /* + * Per Intel document 253669-032 9/2009, + * pages A-2 and A-57 + */ case 0x2E: cputype = PMC_CPU_INTEL_COREI7; nclasses = 5; @@ -180,7 +186,7 @@ pmc_intel_initialize(void) /* Allocate base class and initialize machine dependent struct */ pmc_mdep = pmc_mdep_alloc(nclasses); - pmc_mdep->pmd_cputype = cputype; + pmc_mdep->pmd_cputype = cputype; pmc_mdep->pmd_switch_in = intel_switch_in; pmc_mdep->pmd_switch_out = intel_switch_out; Modified: stable/9/sys/dev/hwpmc/hwpmc_uncore.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_uncore.c Sun Apr 28 22:52:43 2013 (r250037) +++ stable/9/sys/dev/hwpmc/hwpmc_uncore.c Mon Apr 29 04:38:43 2013 (r250038) @@ -754,13 +754,13 @@ static struct ucp_event_descr ucp_events UCPDESCR(66H_04H, 0x66, 0x04, UCP_F_FM | UCP_F_I7 | UCP_F_WM), UCPDESCR(67H_01H, 0x67, 0x01, UCP_F_FM | UCP_F_WM), - + UCPDESCR(80H_01H, 0x80, 0x01, UCP_F_FM | UCP_F_WM | UCP_F_SB | UCP_F_HW), UCPDESCR(80H_02H, 0x80, 0x02, UCP_F_FM | UCP_F_WM), UCPDESCR(80H_04H, 0x80, 0x04, UCP_F_FM | UCP_F_WM), UCPDESCR(80H_08H, 0x80, 0x08, UCP_F_FM | UCP_F_WM), - + UCPDESCR(81H_01H, 0x81, 0x01, UCP_F_FM | UCP_F_WM | UCP_F_SB | UCP_F_HW), UCPDESCR(81H_02H, 0x81, 0x02, UCP_F_FM | UCP_F_WM), @@ -770,13 +770,13 @@ static struct ucp_event_descr ucp_events UCPDESCR(81H_80H, 0x81, 0x80, UCP_F_FM | UCP_F_SB | UCP_F_HW), UCPDESCR(82H_01H, 0x82, 0x01, UCP_F_FM | UCP_F_WM), - + UCPDESCR(83H_01H, 0x83, 0x01, UCP_F_FM | UCP_F_WM | UCP_F_SB | UCP_F_HW), UCPDESCR(83H_02H, 0x83, 0x02, UCP_F_FM | UCP_F_WM), UCPDESCR(83H_04H, 0x83, 0x04, UCP_F_FM | UCP_F_WM), UCPDESCR(83H_08H, 0x83, 0x08, UCP_F_FM | UCP_F_WM), - + UCPDESCR(84H_01H, 0x84, 0x01, UCP_F_FM | UCP_F_WM | UCP_F_SB | UCP_F_HW), UCPDESCR(84H_02H, 0x84, 0x02, UCP_F_FM | UCP_F_WM), @@ -808,20 +808,20 @@ static int ucp_event_sb_hw_ok_on_counter(enum pmc_event pe, int ri) { uint32_t mask; - + switch (pe) { - /* + /* * Events valid only on counter 0. */ case PMC_EV_UCP_EVENT_80H_01H: case PMC_EV_UCP_EVENT_83H_01H: mask = (1 << 0); break; - + default: mask = ~0; /* Any row index is ok. */ } - + return (mask & (1 << ri)); } @@ -855,7 +855,7 @@ ucp_allocate_pmc(int cpu, int ri, struct default: break; } - + /* * Look for an event descriptor with matching CPU and event id @@ -1045,9 +1045,9 @@ ucp_start_pmc(int cpu, int ri) evsel = pm->pm_md.pm_ucp.pm_ucp_evsel; - PMCDBG(MDP,STA,2, - "ucp-start/2 cpu=%d ri=%d evselmsr=0x%x evsel=0x%x", - cpu, ri, SELECTSEL(uncore_cputype) + ri, evsel); + PMCDBG(MDP,STA,2, + "ucp-start/2 cpu=%d ri=%d evselmsr=0x%x evsel=0x%x", + cpu, ri, SELECTSEL(uncore_cputype) + ri, evsel); /* Event specific configuration. */ switch (pm->pm_event) { @@ -1067,12 +1067,12 @@ ucp_start_pmc(int cpu, int ri) case PMC_EV_UCP_EVENT_0CH_08H_S: wrmsr(MSR_GQ_SNOOP_MESF,0x4); break; - default: + default: break; } wrmsr(SELECTSEL(uncore_cputype) + ri, evsel); - + do { cc->pc_resync = 0; cc->pc_globalctrl |= (1ULL << ri); Modified: stable/9/sys/dev/hwpmc/pmc_events.h ============================================================================== --- stable/9/sys/dev/hwpmc/pmc_events.h Sun Apr 28 22:52:43 2013 (r250037) +++ stable/9/sys/dev/hwpmc/pmc_events.h Mon Apr 29 04:38:43 2013 (r250038) @@ -29,7 +29,7 @@ #ifndef _DEV_HWPMC_PMC_EVENTS_H_ #define _DEV_HWPMC_PMC_EVENTS_H_ -/* +/* * Note: Documentation on adding events can be found both in * the source tree at src/share/doc/papers/hwpmc/hwpmc.ms * as well as on-line at: @@ -889,11 +889,11 @@ __PMC_EV(IAP, EVENT_A2H_10H) \ __PMC_EV(IAP, EVENT_A2H_20H) \ __PMC_EV(IAP, EVENT_A2H_40H) \ __PMC_EV(IAP, EVENT_A2H_80H) \ -__PMC_EV(IAP, EVENT_A3H_01H) \ -__PMC_EV(IAP, EVENT_A3H_02H) \ -__PMC_EV(IAP, EVENT_A3H_04H) \ -__PMC_EV(IAP, EVENT_A3H_05H) \ -__PMC_EV(IAP, EVENT_A3H_08H) \ +__PMC_EV(IAP, EVENT_A3H_01H) \ +__PMC_EV(IAP, EVENT_A3H_02H) \ +__PMC_EV(IAP, EVENT_A3H_04H) \ +__PMC_EV(IAP, EVENT_A3H_05H) \ +__PMC_EV(IAP, EVENT_A3H_08H) \ __PMC_EV(IAP, EVENT_A6H_01H) \ __PMC_EV(IAP, EVENT_A7H_01H) \ __PMC_EV(IAP, EVENT_A8H_01H) \ @@ -1195,7 +1195,7 @@ __PMC_EV_ALIAS("BR_INST_RETIRED.MISPRED" __PMC_EV_ALIAS("BR_INST_RETIRED.MISPRED_NOT_TAKEN", \ IAP_EVENT_C4H_02H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.MISPRED_TAKEN", IAP_EVENT_C4H_08H) \ -__PMC_EV_ALIAS("BR_INST_RETIRED.PRED_NOT_TAKEN",IAP_EVENT_C4H_01H) \ +__PMC_EV_ALIAS("BR_INST_RETIRED.PRED_NOT_TAKEN", IAP_EVENT_C4H_01H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.PRED_TAKEN", IAP_EVENT_C4H_04H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.TAKEN", IAP_EVENT_C4H_0CH) \ __PMC_EV_ALIAS("BR_MISSP_EXEC", IAP_EVENT_89H_00H) \ @@ -1416,139 +1416,139 @@ __PMC_EV_ALIAS("X87_OPS_RETIRED.FXCH", /* * Aliases for Core PMC events. */ -#define __PMC_EV_ALIAS_CORE() \ -__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ -__PMC_EV_ALIAS("BAClears", IAP_EVENT_E6H_00H) \ -__PMC_EV_ALIAS("BTB_Misses", IAP_EVENT_E2H_00H) \ -__PMC_EV_ALIAS("Br_BAC_Missp_Exec", IAP_EVENT_8AH_00H) \ -__PMC_EV_ALIAS("Br_Bogus", IAP_EVENT_E4H_00H) \ -__PMC_EV_ALIAS("Br_Call_Exec", IAP_EVENT_92H_00H) \ -__PMC_EV_ALIAS("Br_Call_Missp_Exec", IAP_EVENT_93H_00H) \ -__PMC_EV_ALIAS("Br_Cnd_Exec", IAP_EVENT_8BH_00H) \ -__PMC_EV_ALIAS("Br_Cnd_Missp_Exec", IAP_EVENT_8CH_00H) \ -__PMC_EV_ALIAS("Br_Ind_Call_Exec", IAP_EVENT_94H_00H) \ -__PMC_EV_ALIAS("Br_Ind_Exec", IAP_EVENT_8DH_00H) \ -__PMC_EV_ALIAS("Br_Ind_Missp_Exec", IAP_EVENT_8EH_00H) \ -__PMC_EV_ALIAS("Br_Inst_Exec", IAP_EVENT_88H_00H) \ -__PMC_EV_ALIAS("Br_Instr_Decoded", IAP_EVENT_E0H_00H) \ -__PMC_EV_ALIAS("Br_Instr_Ret", IAP_EVENT_C4H_00H) \ -__PMC_EV_ALIAS("Br_MisPred_Ret", IAP_EVENT_C5H_00H) \ -__PMC_EV_ALIAS("Br_MisPred_Taken_Ret", IAP_EVENT_CAH_00H) \ -__PMC_EV_ALIAS("Br_Missp_Exec", IAP_EVENT_89H_00H) \ -__PMC_EV_ALIAS("Br_Ret_BAC_Missp_Exec", IAP_EVENT_91H_00H) \ -__PMC_EV_ALIAS("Br_Ret_Exec", IAP_EVENT_8FH_00H) \ -__PMC_EV_ALIAS("Br_Ret_Missp_Exec", IAP_EVENT_90H_00H) \ -__PMC_EV_ALIAS("Br_Taken_Ret", IAP_EVENT_C9H_00H) \ -__PMC_EV_ALIAS("Bus_BNR_Clocks", IAP_EVENT_61H_00H) \ -__PMC_EV_ALIAS("Bus_DRDY_Clocks", IAP_EVENT_62H_00H) \ -__PMC_EV_ALIAS("Bus_Data_Rcv", IAP_EVENT_64H_40H) \ -__PMC_EV_ALIAS("Bus_Locks_Clocks", IAP_EVENT_63H) \ -__PMC_EV_ALIAS("Bus_Not_In_Use", IAP_EVENT_7DH) \ -__PMC_EV_ALIAS("Bus_Req_Outstanding", IAP_EVENT_60H) \ -__PMC_EV_ALIAS("Bus_Snoop_Stall", IAP_EVENT_7EH_00H) \ -__PMC_EV_ALIAS("Bus_Snoops", IAP_EVENT_77H) \ -__PMC_EV_ALIAS("Bus_Trans_Any", IAP_EVENT_70H) \ -__PMC_EV_ALIAS("Bus_Trans_Brd", IAP_EVENT_65H) \ -__PMC_EV_ALIAS("Bus_Trans_Burst", IAP_EVENT_6EH) \ -__PMC_EV_ALIAS("Bus_Trans_Def", IAP_EVENT_6DH) \ -__PMC_EV_ALIAS("Bus_Trans_IO", IAP_EVENT_6CH) \ -__PMC_EV_ALIAS("Bus_Trans_Ifetch", IAP_EVENT_68H) \ -__PMC_EV_ALIAS("Bus_Trans_Inval", IAP_EVENT_69H) \ -__PMC_EV_ALIAS("Bus_Trans_Mem", IAP_EVENT_6FH) \ -__PMC_EV_ALIAS("Bus_Trans_P", IAP_EVENT_6BH) \ -__PMC_EV_ALIAS("Bus_Trans_Pwr", IAP_EVENT_6AH) \ -__PMC_EV_ALIAS("Bus_Trans_RFO", IAP_EVENT_66H) \ -__PMC_EV_ALIAS("Bus_Trans_WB", IAP_EVENT_67H) \ -__PMC_EV_ALIAS("Cycles_Div_Busy", IAP_EVENT_14H_00H) \ -__PMC_EV_ALIAS("Cycles_Int_Masked", IAP_EVENT_C6H_00H) \ -__PMC_EV_ALIAS("Cycles_Int_Pending_Masked", IAP_EVENT_C7H_00H) \ -__PMC_EV_ALIAS("DCU_Snoop_To_Share", IAP_EVENT_78H) \ -__PMC_EV_ALIAS("DCache_Cache_LD", IAP_EVENT_40H) \ -__PMC_EV_ALIAS("DCache_Cache_Lock", IAP_EVENT_42H) \ -__PMC_EV_ALIAS("DCache_Cache_ST", IAP_EVENT_41H) \ -__PMC_EV_ALIAS("DCache_M_Evict", IAP_EVENT_47H_00H) \ -__PMC_EV_ALIAS("DCache_M_Repl", IAP_EVENT_46H_00H) \ -__PMC_EV_ALIAS("DCache_Pend_Miss", IAP_EVENT_48H_00H) \ -__PMC_EV_ALIAS("DCache_Repl", IAP_EVENT_45H_0FH) \ -__PMC_EV_ALIAS("Data_Mem_Cache_Ref", IAP_EVENT_44H_02H) \ -__PMC_EV_ALIAS("Data_Mem_Ref", IAP_EVENT_43H_01H) \ -__PMC_EV_ALIAS("Dbus_Busy", IAP_EVENT_22H) \ -__PMC_EV_ALIAS("Dbus_Busy_Rd", IAP_EVENT_23H) \ -__PMC_EV_ALIAS("Div", IAP_EVENT_13H_00H) \ -__PMC_EV_ALIAS("Dtlb_Miss", IAP_EVENT_49H_00H) \ -__PMC_EV_ALIAS("ESP_Uops", IAP_EVENT_D7H_00H) \ -__PMC_EV_ALIAS("EST_Trans", IAP_EVENT_3AH) \ -__PMC_EV_ALIAS("FP_Assist", IAP_EVENT_11H_00H) \ -__PMC_EV_ALIAS("FP_Comp_Instr_Ret", IAP_EVENT_C1H_00H) \ -__PMC_EV_ALIAS("FP_Comps_Op_Exe", IAP_EVENT_10H_00H) \ -__PMC_EV_ALIAS("FP_MMX_Trans", IAP_EVENT_CCH_01H) \ -__PMC_EV_ALIAS("Fused_Ld_Uops_Ret", IAP_EVENT_DAH_01H) \ -__PMC_EV_ALIAS("Fused_St_Uops_Ret", IAP_EVENT_DAH_02H) \ -__PMC_EV_ALIAS("Fused_Uops_Ret", IAP_EVENT_DAH_00H) \ -__PMC_EV_ALIAS("HW_Int_Rx", IAP_EVENT_C8H_00H) \ -__PMC_EV_ALIAS("ICache_Misses", IAP_EVENT_81H_00H) \ -__PMC_EV_ALIAS("ICache_Reads", IAP_EVENT_80H_00H) \ -__PMC_EV_ALIAS("IFU_Mem_Stall", IAP_EVENT_86H_00H) \ -__PMC_EV_ALIAS("ILD_Stall", IAP_EVENT_87H_00H) \ -__PMC_EV_ALIAS("ITLB_Misses", IAP_EVENT_85H_00H) \ -__PMC_EV_ALIAS("Instr_Decoded", IAP_EVENT_D0H_00H) \ -__PMC_EV_ALIAS("Instr_Ret", IAP_EVENT_C0H_00H) \ -__PMC_EV_ALIAS("L1_Pref_Req", IAP_EVENT_4FH_00H) \ -__PMC_EV_ALIAS("L2_ADS", IAP_EVENT_21H) \ -__PMC_EV_ALIAS("L2_IFetch", IAP_EVENT_28H) \ -__PMC_EV_ALIAS("L2_LD", IAP_EVENT_29H) \ -__PMC_EV_ALIAS("L2_Lines_In", IAP_EVENT_24H) \ -__PMC_EV_ALIAS("L2_Lines_Out", IAP_EVENT_26H) \ -__PMC_EV_ALIAS("L2_M_Lines_In", IAP_EVENT_25H) \ -__PMC_EV_ALIAS("L2_M_Lines_Out", IAP_EVENT_27H) \ -__PMC_EV_ALIAS("L2_No_Request_Cycles", IAP_EVENT_32H) \ -__PMC_EV_ALIAS("L2_Reject_Cycles", IAP_EVENT_30H) \ -__PMC_EV_ALIAS("L2_Rqsts", IAP_EVENT_2EH) \ -__PMC_EV_ALIAS("L2_ST", IAP_EVENT_2AH) \ -__PMC_EV_ALIAS("LD_Blocks", IAP_EVENT_03H_00H) \ -__PMC_EV_ALIAS("LLC_Misses", IAP_EVENT_2EH_41H) \ -__PMC_EV_ALIAS("LLC_Reference", IAP_EVENT_2EH_4FH) \ -__PMC_EV_ALIAS("MMX_Assist", IAP_EVENT_CDH_00H) \ -__PMC_EV_ALIAS("MMX_FP_Trans", IAP_EVENT_CCH_00H) \ -__PMC_EV_ALIAS("MMX_Instr_Exec", IAP_EVENT_B0H_00H) \ -__PMC_EV_ALIAS("MMX_Instr_Ret", IAP_EVENT_CEH_00H) \ -__PMC_EV_ALIAS("Misalign_Mem_Ref", IAP_EVENT_05H_00H) \ -__PMC_EV_ALIAS("Mul", IAP_EVENT_12H_00H) \ -__PMC_EV_ALIAS("NonHlt_Ref_Cycles", IAP_EVENT_3CH_01H) \ -__PMC_EV_ALIAS("Pref_Rqsts_Dn", IAP_EVENT_F8H_00H) \ -__PMC_EV_ALIAS("Pref_Rqsts_Up", IAP_EVENT_F0H_00H) \ -__PMC_EV_ALIAS("Resource_Stall", IAP_EVENT_A2H_00H) \ -__PMC_EV_ALIAS("SD_Drains", IAP_EVENT_04H_00H) \ -__PMC_EV_ALIAS("SIMD_FP_DP_P_Comp_Ret", IAP_EVENT_D9H_02H) \ -__PMC_EV_ALIAS("SIMD_FP_DP_P_Ret", IAP_EVENT_D8H_02H) \ -__PMC_EV_ALIAS("SIMD_FP_DP_S_Comp_Ret", IAP_EVENT_D9H_03H) \ -__PMC_EV_ALIAS("SIMD_FP_DP_S_Ret", IAP_EVENT_D8H_03H) \ -__PMC_EV_ALIAS("SIMD_FP_SP_P_Comp_Ret", IAP_EVENT_D9H_00H) \ -__PMC_EV_ALIAS("SIMD_FP_SP_Ret", IAP_EVENT_D8H_00H) \ -__PMC_EV_ALIAS("SIMD_FP_SP_S_Comp_Ret", IAP_EVENT_D9H_01H) \ -__PMC_EV_ALIAS("SIMD_FP_SP_S_Ret", IAP_EVENT_D8H_01H) \ -__PMC_EV_ALIAS("SIMD_Int_128_Ret", IAP_EVENT_D8H_04H) \ -__PMC_EV_ALIAS("SIMD_Int_Pari_Exec", IAP_EVENT_B3H_20H) \ -__PMC_EV_ALIAS("SIMD_Int_Pck_Exec", IAP_EVENT_B3H_04H) \ -__PMC_EV_ALIAS("SIMD_Int_Plog_Exec", IAP_EVENT_B3H_10H) \ -__PMC_EV_ALIAS("SIMD_Int_Pmul_Exec", IAP_EVENT_B3H_01H) \ -__PMC_EV_ALIAS("SIMD_Int_Psft_Exec", IAP_EVENT_B3H_02H) \ -__PMC_EV_ALIAS("SIMD_Int_Sat_Exec", IAP_EVENT_B1H_00H) \ -__PMC_EV_ALIAS("SIMD_Int_Upck_Exec", IAP_EVENT_B3H_08H) \ -__PMC_EV_ALIAS("SMC_Detected", IAP_EVENT_C3H_00H) \ -__PMC_EV_ALIAS("SSE_NTStores_Miss", IAP_EVENT_4BH_03H) \ -__PMC_EV_ALIAS("SSE_NTStores_Ret", IAP_EVENT_07H_03H) \ -__PMC_EV_ALIAS("SSE_PrefNta_Miss", IAP_EVENT_4BH_00H) \ -__PMC_EV_ALIAS("SSE_PrefNta_Ret", IAP_EVENT_07H_00H) \ -__PMC_EV_ALIAS("SSE_PrefT1_Miss", IAP_EVENT_4BH_01H) \ -__PMC_EV_ALIAS("SSE_PrefT1_Ret", IAP_EVENT_07H_01H) \ -__PMC_EV_ALIAS("SSE_PrefT2_Miss", IAP_EVENT_4BH_02H) \ -__PMC_EV_ALIAS("SSE_PrefT2_Ret", IAP_EVENT_07H_02H) \ -__PMC_EV_ALIAS("Seg_Reg_Loads", IAP_EVENT_06H_00H) \ -__PMC_EV_ALIAS("Serial_Execution_Cycles", IAP_EVENT_3CH_02H) \ -__PMC_EV_ALIAS("Thermal_Trip", IAP_EVENT_3BH_C0H) \ -__PMC_EV_ALIAS("Unfusion", IAP_EVENT_DBH_00H) \ -__PMC_EV_ALIAS("Unhalted_Core_Cycles", IAP_EVENT_3CH_00H) \ +#define __PMC_EV_ALIAS_CORE() \ +__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ +__PMC_EV_ALIAS("BAClears", IAP_EVENT_E6H_00H) \ +__PMC_EV_ALIAS("BTB_Misses", IAP_EVENT_E2H_00H) \ +__PMC_EV_ALIAS("Br_BAC_Missp_Exec", IAP_EVENT_8AH_00H) \ +__PMC_EV_ALIAS("Br_Bogus", IAP_EVENT_E4H_00H) \ +__PMC_EV_ALIAS("Br_Call_Exec", IAP_EVENT_92H_00H) \ +__PMC_EV_ALIAS("Br_Call_Missp_Exec", IAP_EVENT_93H_00H) \ +__PMC_EV_ALIAS("Br_Cnd_Exec", IAP_EVENT_8BH_00H) \ +__PMC_EV_ALIAS("Br_Cnd_Missp_Exec", IAP_EVENT_8CH_00H) \ +__PMC_EV_ALIAS("Br_Ind_Call_Exec", IAP_EVENT_94H_00H) \ +__PMC_EV_ALIAS("Br_Ind_Exec", IAP_EVENT_8DH_00H) \ +__PMC_EV_ALIAS("Br_Ind_Missp_Exec", IAP_EVENT_8EH_00H) \ +__PMC_EV_ALIAS("Br_Inst_Exec", IAP_EVENT_88H_00H) \ +__PMC_EV_ALIAS("Br_Instr_Decoded", IAP_EVENT_E0H_00H) \ +__PMC_EV_ALIAS("Br_Instr_Ret", IAP_EVENT_C4H_00H) \ +__PMC_EV_ALIAS("Br_MisPred_Ret", IAP_EVENT_C5H_00H) \ +__PMC_EV_ALIAS("Br_MisPred_Taken_Ret", IAP_EVENT_CAH_00H) \ +__PMC_EV_ALIAS("Br_Missp_Exec", IAP_EVENT_89H_00H) \ +__PMC_EV_ALIAS("Br_Ret_BAC_Missp_Exec", IAP_EVENT_91H_00H) \ +__PMC_EV_ALIAS("Br_Ret_Exec", IAP_EVENT_8FH_00H) \ +__PMC_EV_ALIAS("Br_Ret_Missp_Exec", IAP_EVENT_90H_00H) \ +__PMC_EV_ALIAS("Br_Taken_Ret", IAP_EVENT_C9H_00H) \ +__PMC_EV_ALIAS("Bus_BNR_Clocks", IAP_EVENT_61H_00H) \ +__PMC_EV_ALIAS("Bus_DRDY_Clocks", IAP_EVENT_62H_00H) \ +__PMC_EV_ALIAS("Bus_Data_Rcv", IAP_EVENT_64H_40H) \ +__PMC_EV_ALIAS("Bus_Locks_Clocks", IAP_EVENT_63H) \ +__PMC_EV_ALIAS("Bus_Not_In_Use", IAP_EVENT_7DH) \ +__PMC_EV_ALIAS("Bus_Req_Outstanding", IAP_EVENT_60H) \ +__PMC_EV_ALIAS("Bus_Snoop_Stall", IAP_EVENT_7EH_00H) \ +__PMC_EV_ALIAS("Bus_Snoops", IAP_EVENT_77H) \ +__PMC_EV_ALIAS("Bus_Trans_Any", IAP_EVENT_70H) \ +__PMC_EV_ALIAS("Bus_Trans_Brd", IAP_EVENT_65H) \ +__PMC_EV_ALIAS("Bus_Trans_Burst", IAP_EVENT_6EH) \ +__PMC_EV_ALIAS("Bus_Trans_Def", IAP_EVENT_6DH) \ +__PMC_EV_ALIAS("Bus_Trans_IO", IAP_EVENT_6CH) \ +__PMC_EV_ALIAS("Bus_Trans_Ifetch", IAP_EVENT_68H) \ +__PMC_EV_ALIAS("Bus_Trans_Inval", IAP_EVENT_69H) \ +__PMC_EV_ALIAS("Bus_Trans_Mem", IAP_EVENT_6FH) \ +__PMC_EV_ALIAS("Bus_Trans_P", IAP_EVENT_6BH) \ +__PMC_EV_ALIAS("Bus_Trans_Pwr", IAP_EVENT_6AH) \ +__PMC_EV_ALIAS("Bus_Trans_RFO", IAP_EVENT_66H) \ +__PMC_EV_ALIAS("Bus_Trans_WB", IAP_EVENT_67H) \ +__PMC_EV_ALIAS("Cycles_Div_Busy", IAP_EVENT_14H_00H) \ +__PMC_EV_ALIAS("Cycles_Int_Masked", IAP_EVENT_C6H_00H) \ +__PMC_EV_ALIAS("Cycles_Int_Pending_Masked", IAP_EVENT_C7H_00H) \ +__PMC_EV_ALIAS("DCU_Snoop_To_Share", IAP_EVENT_78H) \ +__PMC_EV_ALIAS("DCache_Cache_LD", IAP_EVENT_40H) \ +__PMC_EV_ALIAS("DCache_Cache_Lock", IAP_EVENT_42H) \ +__PMC_EV_ALIAS("DCache_Cache_ST", IAP_EVENT_41H) \ +__PMC_EV_ALIAS("DCache_M_Evict", IAP_EVENT_47H_00H) \ +__PMC_EV_ALIAS("DCache_M_Repl", IAP_EVENT_46H_00H) \ +__PMC_EV_ALIAS("DCache_Pend_Miss", IAP_EVENT_48H_00H) \ +__PMC_EV_ALIAS("DCache_Repl", IAP_EVENT_45H_0FH) \ +__PMC_EV_ALIAS("Data_Mem_Cache_Ref", IAP_EVENT_44H_02H) \ +__PMC_EV_ALIAS("Data_Mem_Ref", IAP_EVENT_43H_01H) \ +__PMC_EV_ALIAS("Dbus_Busy", IAP_EVENT_22H) \ +__PMC_EV_ALIAS("Dbus_Busy_Rd", IAP_EVENT_23H) \ +__PMC_EV_ALIAS("Div", IAP_EVENT_13H_00H) \ +__PMC_EV_ALIAS("Dtlb_Miss", IAP_EVENT_49H_00H) \ +__PMC_EV_ALIAS("ESP_Uops", IAP_EVENT_D7H_00H) \ +__PMC_EV_ALIAS("EST_Trans", IAP_EVENT_3AH) \ +__PMC_EV_ALIAS("FP_Assist", IAP_EVENT_11H_00H) \ +__PMC_EV_ALIAS("FP_Comp_Instr_Ret", IAP_EVENT_C1H_00H) \ +__PMC_EV_ALIAS("FP_Comps_Op_Exe", IAP_EVENT_10H_00H) \ +__PMC_EV_ALIAS("FP_MMX_Trans", IAP_EVENT_CCH_01H) \ +__PMC_EV_ALIAS("Fused_Ld_Uops_Ret", IAP_EVENT_DAH_01H) \ +__PMC_EV_ALIAS("Fused_St_Uops_Ret", IAP_EVENT_DAH_02H) \ +__PMC_EV_ALIAS("Fused_Uops_Ret", IAP_EVENT_DAH_00H) \ +__PMC_EV_ALIAS("HW_Int_Rx", IAP_EVENT_C8H_00H) \ +__PMC_EV_ALIAS("ICache_Misses", IAP_EVENT_81H_00H) \ +__PMC_EV_ALIAS("ICache_Reads", IAP_EVENT_80H_00H) \ +__PMC_EV_ALIAS("IFU_Mem_Stall", IAP_EVENT_86H_00H) \ +__PMC_EV_ALIAS("ILD_Stall", IAP_EVENT_87H_00H) \ +__PMC_EV_ALIAS("ITLB_Misses", IAP_EVENT_85H_00H) \ +__PMC_EV_ALIAS("Instr_Decoded", IAP_EVENT_D0H_00H) \ +__PMC_EV_ALIAS("Instr_Ret", IAP_EVENT_C0H_00H) \ +__PMC_EV_ALIAS("L1_Pref_Req", IAP_EVENT_4FH_00H) \ +__PMC_EV_ALIAS("L2_ADS", IAP_EVENT_21H) \ +__PMC_EV_ALIAS("L2_IFetch", IAP_EVENT_28H) \ +__PMC_EV_ALIAS("L2_LD", IAP_EVENT_29H) \ +__PMC_EV_ALIAS("L2_Lines_In", IAP_EVENT_24H) \ +__PMC_EV_ALIAS("L2_Lines_Out", IAP_EVENT_26H) \ +__PMC_EV_ALIAS("L2_M_Lines_In", IAP_EVENT_25H) \ +__PMC_EV_ALIAS("L2_M_Lines_Out", IAP_EVENT_27H) \ +__PMC_EV_ALIAS("L2_No_Request_Cycles", IAP_EVENT_32H) \ +__PMC_EV_ALIAS("L2_Reject_Cycles", IAP_EVENT_30H) \ +__PMC_EV_ALIAS("L2_Rqsts", IAP_EVENT_2EH) \ +__PMC_EV_ALIAS("L2_ST", IAP_EVENT_2AH) \ +__PMC_EV_ALIAS("LD_Blocks", IAP_EVENT_03H_00H) \ +__PMC_EV_ALIAS("LLC_Misses", IAP_EVENT_2EH_41H) \ +__PMC_EV_ALIAS("LLC_Reference", IAP_EVENT_2EH_4FH) \ +__PMC_EV_ALIAS("MMX_Assist", IAP_EVENT_CDH_00H) \ +__PMC_EV_ALIAS("MMX_FP_Trans", IAP_EVENT_CCH_00H) \ +__PMC_EV_ALIAS("MMX_Instr_Exec", IAP_EVENT_B0H_00H) \ +__PMC_EV_ALIAS("MMX_Instr_Ret", IAP_EVENT_CEH_00H) \ +__PMC_EV_ALIAS("Misalign_Mem_Ref", IAP_EVENT_05H_00H) \ +__PMC_EV_ALIAS("Mul", IAP_EVENT_12H_00H) \ +__PMC_EV_ALIAS("NonHlt_Ref_Cycles", IAP_EVENT_3CH_01H) \ +__PMC_EV_ALIAS("Pref_Rqsts_Dn", IAP_EVENT_F8H_00H) \ +__PMC_EV_ALIAS("Pref_Rqsts_Up", IAP_EVENT_F0H_00H) \ +__PMC_EV_ALIAS("Resource_Stall", IAP_EVENT_A2H_00H) \ +__PMC_EV_ALIAS("SD_Drains", IAP_EVENT_04H_00H) \ +__PMC_EV_ALIAS("SIMD_FP_DP_P_Comp_Ret", IAP_EVENT_D9H_02H) \ +__PMC_EV_ALIAS("SIMD_FP_DP_P_Ret", IAP_EVENT_D8H_02H) \ +__PMC_EV_ALIAS("SIMD_FP_DP_S_Comp_Ret", IAP_EVENT_D9H_03H) \ +__PMC_EV_ALIAS("SIMD_FP_DP_S_Ret", IAP_EVENT_D8H_03H) \ +__PMC_EV_ALIAS("SIMD_FP_SP_P_Comp_Ret", IAP_EVENT_D9H_00H) \ +__PMC_EV_ALIAS("SIMD_FP_SP_Ret", IAP_EVENT_D8H_00H) \ +__PMC_EV_ALIAS("SIMD_FP_SP_S_Comp_Ret", IAP_EVENT_D9H_01H) \ +__PMC_EV_ALIAS("SIMD_FP_SP_S_Ret", IAP_EVENT_D8H_01H) \ +__PMC_EV_ALIAS("SIMD_Int_128_Ret", IAP_EVENT_D8H_04H) \ +__PMC_EV_ALIAS("SIMD_Int_Pari_Exec", IAP_EVENT_B3H_20H) \ +__PMC_EV_ALIAS("SIMD_Int_Pck_Exec", IAP_EVENT_B3H_04H) \ +__PMC_EV_ALIAS("SIMD_Int_Plog_Exec", IAP_EVENT_B3H_10H) \ +__PMC_EV_ALIAS("SIMD_Int_Pmul_Exec", IAP_EVENT_B3H_01H) \ +__PMC_EV_ALIAS("SIMD_Int_Psft_Exec", IAP_EVENT_B3H_02H) \ +__PMC_EV_ALIAS("SIMD_Int_Sat_Exec", IAP_EVENT_B1H_00H) \ +__PMC_EV_ALIAS("SIMD_Int_Upck_Exec", IAP_EVENT_B3H_08H) \ +__PMC_EV_ALIAS("SMC_Detected", IAP_EVENT_C3H_00H) \ +__PMC_EV_ALIAS("SSE_NTStores_Miss", IAP_EVENT_4BH_03H) \ +__PMC_EV_ALIAS("SSE_NTStores_Ret", IAP_EVENT_07H_03H) \ +__PMC_EV_ALIAS("SSE_PrefNta_Miss", IAP_EVENT_4BH_00H) \ +__PMC_EV_ALIAS("SSE_PrefNta_Ret", IAP_EVENT_07H_00H) \ +__PMC_EV_ALIAS("SSE_PrefT1_Miss", IAP_EVENT_4BH_01H) \ +__PMC_EV_ALIAS("SSE_PrefT1_Ret", IAP_EVENT_07H_01H) \ +__PMC_EV_ALIAS("SSE_PrefT2_Miss", IAP_EVENT_4BH_02H) \ +__PMC_EV_ALIAS("SSE_PrefT2_Ret", IAP_EVENT_07H_02H) \ +__PMC_EV_ALIAS("Seg_Reg_Loads", IAP_EVENT_06H_00H) \ +__PMC_EV_ALIAS("Serial_Execution_Cycles", IAP_EVENT_3CH_02H) \ +__PMC_EV_ALIAS("Thermal_Trip", IAP_EVENT_3BH_C0H) \ +__PMC_EV_ALIAS("Unfusion", IAP_EVENT_DBH_00H) \ +__PMC_EV_ALIAS("Unhalted_Core_Cycles", IAP_EVENT_3CH_00H) \ __PMC_EV_ALIAS("Uops_Ret", IAP_EVENT_C2H_00H) /* @@ -1880,7 +1880,7 @@ __PMC_EV_ALIAS("SEGMENT_REG_LOADS", IAP_ */ #define __PMC_EV_ALIAS_COREI7() \ __PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ -__PMC_EV_ALIAS("SB_DRAIN.ANY", IAP_EVENT_04H_07H) \ +__PMC_EV_ALIAS("SB_DRAIN.ANY", IAP_EVENT_04H_07H) \ __PMC_EV_ALIAS("STORE_BLOCKS.AT_RET", IAP_EVENT_06H_04H) \ __PMC_EV_ALIAS("STORE_BLOCKS.L1D_BLOCK", IAP_EVENT_06H_08H) \ __PMC_EV_ALIAS("PARTIAL_ADDRESS_ALIAS", IAP_EVENT_07H_01H) \ @@ -1889,11 +1889,11 @@ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_CO __PMC_EV_ALIAS("DTLB_LOAD_MISSES.STLB_HIT", IAP_EVENT_08H_10H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.PDE_MISS", IAP_EVENT_08H_20H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.LARGE_WALK_COMPLETED", \ - IAP_EVENT_08H_80H) \ + IAP_EVENT_08H_80H) \ __PMC_EV_ALIAS("MEM_INST_RETIRED.LOADS", IAP_EVENT_0BH_01H) \ __PMC_EV_ALIAS("MEM_INST_RETIRED.STORES", IAP_EVENT_0BH_02H) \ __PMC_EV_ALIAS("MEM_INST_RETIRED.LATENCY_ABOVE_THRESHOLD", \ - IAP_EVENT_0BH_10H) \ + IAP_EVENT_0BH_10H) \ __PMC_EV_ALIAS("MEM_STORE_RETIRED.DTLB_MISS", IAP_EVENT_0CH_01H) \ __PMC_EV_ALIAS("UOPS_ISSUED.ANY", IAP_EVENT_0EH_01H) \ __PMC_EV_ALIAS("UOPS_ISSUED.STALLED_CYCLES", IAP_EVENT_0EH_01H) \ @@ -2192,7 +2192,7 @@ __PMC_EV_ALIAS("FP_COMP_OPS_EXE.SSE2_INT __PMC_EV_ALIAS("FP_COMP_OPS_EXE.SSE_FP_PACKED", IAP_EVENT_10H_10H) \ __PMC_EV_ALIAS("FP_COMP_OPS_EXE.SSE_FP_SCALAR", IAP_EVENT_10H_20H) \ __PMC_EV_ALIAS("FP_COMP_OPS_EXE.SSE_SINGLE_PRECISION", \ - IAP_EVENT_10H_40H) \ + IAP_EVENT_10H_40H) \ __PMC_EV_ALIAS("FP_COMP_OPS_EXE.SSE_DOUBLE_PRECISION", \ IAP_EVENT_10H_80H) \ __PMC_EV_ALIAS("SIMD_INT_128.PACKED_MPY", IAP_EVENT_12H_01H) \ @@ -2371,11 +2371,11 @@ __PMC_EV_ALIAS("UOPS_RETIRED.MACRO_FUSED __PMC_EV_ALIAS("MACHINE_CLEARS.CYCLES", IAP_EVENT_C3H_01H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.MEM_ORDER", IAP_EVENT_C3H_02H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.SMC", IAP_EVENT_C3H_04H) \ -__PMC_EV_ALIAS("BR_INST_RETIRED.ANY_P", IAP_EVENT_C4H_00H) \ +__PMC_EV_ALIAS("BR_INST_RETIRED.ANY_P", IAP_EVENT_C4H_00H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.CONDITIONAL", IAP_EVENT_C4H_01H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_CALL", IAP_EVENT_C4H_02H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_04H) \ -__PMC_EV_ALIAS("BR_MISP_RETIRED.ANY_P", IAP_EVENT_C5H_00H) \ +__PMC_EV_ALIAS("BR_MISP_RETIRED.ANY_P", IAP_EVENT_C5H_00H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.NEAR_CALL", IAP_EVENT_C5H_02H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \ @@ -2449,299 +2449,330 @@ __PMC_EV_ALIAS("SIMD_INT_64.SHUFFLE_MOVE /* * Aliases for Haswell core PMC events */ -#define __PMC_EV_ALIAS_HASWELL() \ -__PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \ -__PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \ -__PMC_EV_ALIAS("MISALIGN_MEM_REF.STORES", IAP_EVENT_05H_02H) \ +#define __PMC_EV_ALIAS_HASWELL() \ +__PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \ +__PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \ +__PMC_EV_ALIAS("MISALIGN_MEM_REF.STORES", IAP_EVENT_05H_02H) \ __PMC_EV_ALIAS("LD_BLOCKS_PARTIAL.ADDRESS_ALIAS", IAP_EVENT_07H_01H) \ -__PMC_EV_ALIAS("DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_08H_01H) \ +__PMC_EV_ALIAS("DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_08H_01H)\ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_4K", IAP_EVENT_08H_02H) \ -__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4K", IAP_EVENT_08H_02H) \ +__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4K", \ + IAP_EVENT_08H_02H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED", IAP_EVENT_08H_0EH) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_DURATION", IAP_EVENT_08H_10H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.STLB_HIT_4K", IAP_EVENT_08H_20H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.STLB_HIT_2M", IAP_EVENT_08H_40H) \ -__PMC_EV_ALIAS("DTLB_LOAD_MISSES.STLB_HIT", IAP_EVENT_08H_60H) \ +__PMC_EV_ALIAS("DTLB_LOAD_MISSES.STLB_HIT", IAP_EVENT_08H_60H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.PDE_CACHE_MISS", IAP_EVENT_08H_80H) \ -__PMC_EV_ALIAS("INT_MISC.RECOVERY_CYCLES", IAP_EVENT_0DH_03H) \ -__PMC_EV_ALIAS("UOPS_ISSUED.ANY", IAP_EVENT_0EH_01H) \ -__PMC_EV_ALIAS("UOPS_ISSUED.FLAGS_MERGE", IAP_EVENT_0EH_10H) \ -__PMC_EV_ALIAS("UOPS_ISSUED.SLOW_LEA", IAP_EVENT_0EH_20H) \ -__PMC_EV_ALIAS("UOPS_ISSUED.SiNGLE_MUL", IAP_EVENT_0EH_40H) \ +__PMC_EV_ALIAS("INT_MISC.RECOVERY_CYCLES", IAP_EVENT_0DH_03H) \ +__PMC_EV_ALIAS("UOPS_ISSUED.ANY", IAP_EVENT_0EH_01H) \ +__PMC_EV_ALIAS("UOPS_ISSUED.FLAGS_MERGE", IAP_EVENT_0EH_10H) \ +__PMC_EV_ALIAS("UOPS_ISSUED.SLOW_LEA", IAP_EVENT_0EH_20H) \ +__PMC_EV_ALIAS("UOPS_ISSUED.SiNGLE_MUL", IAP_EVENT_0EH_40H) \ __PMC_EV_ALIAS("L2_RQSTS.DEMAND_DATA_RD_MISS", IAP_EVENT_24H_21H) \ __PMC_EV_ALIAS("L2_RQSTS.DEMAND_DATA_RD_HIT", IAP_EVENT_24H_41H) \ __PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_DATA_RD", IAP_EVENT_24H_E1H) \ -__PMC_EV_ALIAS("L2_RQSTS.RFO_HIT", IAP_EVENT_24H_42H) \ -__PMC_EV_ALIAS("L2_RQSTS.RFO_MISS", IAP_EVENT_24H_22H) \ -__PMC_EV_ALIAS("L2_RQSTS.ALL_RFO", IAP_EVENT_24H_E2H) \ -__PMC_EV_ALIAS("L2_RQSTS.CODE_RD_HIT", IAP_EVENT_24H_44H) \ -__PMC_EV_ALIAS("L2_RQSTS.CODE_RD_MISS", IAP_EVENT_24H_24H) \ -__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_MISS", IAP_EVENT_24H_27H) \ +__PMC_EV_ALIAS("L2_RQSTS.RFO_HIT", IAP_EVENT_24H_42H) \ +__PMC_EV_ALIAS("L2_RQSTS.RFO_MISS", IAP_EVENT_24H_22H) \ +__PMC_EV_ALIAS("L2_RQSTS.ALL_RFO", IAP_EVENT_24H_E2H) \ +__PMC_EV_ALIAS("L2_RQSTS.CODE_RD_HIT", IAP_EVENT_24H_44H) \ +__PMC_EV_ALIAS("L2_RQSTS.CODE_RD_MISS", IAP_EVENT_24H_24H) \ +__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_MISS", IAP_EVENT_24H_27H) \ __PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_REFERENCES", IAP_EVENT_24H_E7H) \ -__PMC_EV_ALIAS("L2_RQSTS.ALL_CODE_RD", IAP_EVENT_24H_E4H) \ -__PMC_EV_ALIAS("L2_RQSTS.L2_PF_HIT", IAP_EVENT_24H_50H) \ -__PMC_EV_ALIAS("L2_RQSTS.L2_PF_MISS", IAP_EVENT_24H_30H) \ -__PMC_EV_ALIAS("L2_RQSTS.ALL_PF", IAP_EVENT_24H_F8H) \ -__PMC_EV_ALIAS("L2_RQSTS.MISS", IAP_EVENT_24H_3FH) \ -__PMC_EV_ALIAS("L2_RQSTS.REFERENCES", IAP_EVENT_24H_FFH) \ -__PMC_EV_ALIAS("L2_DEMAND_RQSTS.WB_HIT", IAP_EVENT_27H_50H) \ +__PMC_EV_ALIAS("L2_RQSTS.ALL_CODE_RD", IAP_EVENT_24H_E4H) \ +__PMC_EV_ALIAS("L2_RQSTS.L2_PF_HIT", IAP_EVENT_24H_50H) \ +__PMC_EV_ALIAS("L2_RQSTS.L2_PF_MISS", IAP_EVENT_24H_30H) \ +__PMC_EV_ALIAS("L2_RQSTS.ALL_PF", IAP_EVENT_24H_F8H) \ +__PMC_EV_ALIAS("L2_RQSTS.MISS", IAP_EVENT_24H_3FH) \ +__PMC_EV_ALIAS("L2_RQSTS.REFERENCES", IAP_EVENT_24H_FFH) \ +__PMC_EV_ALIAS("L2_DEMAND_RQSTS.WB_HIT", IAP_EVENT_27H_50H) \ __PMC_EV_ALIAS("LONGEST_LAT_CACHE.REFERENCE", IAP_EVENT_2EH_4FH) \ -__PMC_EV_ALIAS("LONGEST_LAT_CACHE.MISS", IAP_EVENT_2EH_41H) \ -__PMC_EV_ALIAS("CPU_CLK_UNHALTED.THREAD_P", IAP_EVENT_3CH_00H) \ +__PMC_EV_ALIAS("LONGEST_LAT_CACHE.MISS", IAP_EVENT_2EH_41H) \ +__PMC_EV_ALIAS("CPU_CLK_UNHALTED.THREAD_P", IAP_EVENT_3CH_00H) \ __PMC_EV_ALIAS("CPU_CLK_THREAD_UNHALTED.REF_XCLK", IAP_EVENT_3CH_01H) \ -__PMC_EV_ALIAS("L1D_PEND_MISS.PENDING", IAP_EVENT_48H_01H) \ -__PMC_EV_ALIAS("DTLB_STORE_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_49H_01H) \ -__PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_COMPLETED_4K", IAP_EVENT_49H_02H) \ -__PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M", IAP_EVENT_49H_04H) \ +__PMC_EV_ALIAS("L1D_PEND_MISS.PENDING", IAP_EVENT_48H_01H) \ +__PMC_EV_ALIAS("DTLB_STORE_MISSES.MISS_CAUSES_A_WALK", \ + IAP_EVENT_49H_01H) \ +__PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_COMPLETED_4K", \ + IAP_EVENT_49H_02H) \ +__PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M", \ + IAP_EVENT_49H_04H) \ __PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_COMPLETED", IAP_EVENT_49H_0EH) \ __PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_DURATION", IAP_EVENT_49H_10H) \ __PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT_4K", IAP_EVENT_49H_20H) \ __PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT_2M", IAP_EVENT_49H_40H) \ -__PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT", IAP_EVENT_49H_60H) \ +__PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT", IAP_EVENT_49H_60H) \ __PMC_EV_ALIAS("DTLB_STORE_MISSES.PDE_CACHE_MISS", IAP_EVENT_49H_80H) \ -__PMC_EV_ALIAS("LOAD_HIT_PRE.SW_PF", IAP_EVENT_4CH_01H) \ -__PMC_EV_ALIAS("LOAD_HIT_PRE.HW_PF", IAP_EVENT_4CH_02H) \ -__PMC_EV_ALIAS("L1D.REPLACEMENT", IAP_EVENT_51H_01H) \ -__PMC_EV_ALIAS("MOVE_ELIMINATION.INT_NOT_ELIMINATED", IAP_EVENT_58H_04H) \ -__PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_NOT_ELIMINATED", IAP_EVENT_58H_08H) \ +__PMC_EV_ALIAS("LOAD_HIT_PRE.SW_PF", IAP_EVENT_4CH_01H) \ +__PMC_EV_ALIAS("LOAD_HIT_PRE.HW_PF", IAP_EVENT_4CH_02H) \ +__PMC_EV_ALIAS("L1D.REPLACEMENT", IAP_EVENT_51H_01H) \ +__PMC_EV_ALIAS("MOVE_ELIMINATION.INT_NOT_ELIMINATED", \ + IAP_EVENT_58H_04H) \ +__PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_NOT_ELIMINATED", \ + IAP_EVENT_58H_08H) \ __PMC_EV_ALIAS("MOVE_ELIMINATION.INT_ELIMINATED", IAP_EVENT_58H_01H) \ __PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_ELIMINATED", IAP_EVENT_58H_02H) \ -__PMC_EV_ALIAS("CPL_CYCLES.RING0", IAP_EVENT_5CH_02H) \ -__PMC_EV_ALIAS("CPL_CYCLES.RING123", IAP_EVENT_5CH_01H) \ -__PMC_EV_ALIAS("RS_EVENTS.EMPTY_CYCLES", IAP_EVENT_5EH_01H) \ -__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD", IAP_EVENT_60H_01H) \ -__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CORE_RD", IAP_EVENT_60H_02H) \ -__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO", IAP_EVENT_60H_04H) \ -__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", IAP_EVENT_60H_08H) \ -__PMC_EV_ALIAS("LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION", IAP_EVENT_63H_01H) \ +__PMC_EV_ALIAS("CPL_CYCLES.RING0", IAP_EVENT_5CH_02H) \ +__PMC_EV_ALIAS("CPL_CYCLES.RING123", IAP_EVENT_5CH_01H) \ +__PMC_EV_ALIAS("RS_EVENTS.EMPTY_CYCLES", IAP_EVENT_5EH_01H) \ +__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD", \ + IAP_EVENT_60H_01H) \ +__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CORE_RD", \ + IAP_EVENT_60H_02H) \ +__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO", \ + IAP_EVENT_60H_04H) \ +__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", \ + IAP_EVENT_60H_08H) \ +__PMC_EV_ALIAS("LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION", \ + IAP_EVENT_63H_01H) \ __PMC_EV_ALIAS("LOCK_CYCLES.CACHE_LOCK_DURATION", IAP_EVENT_63H_02H) \ -__PMC_EV_ALIAS("IDQ.EMPTY", IAP_EVENT_79H_02H) \ -__PMC_EV_ALIAS("IDQ.MITE_UOPS", IAP_EVENT_79H_04H) \ -__PMC_EV_ALIAS("IDQ.DSB_UOPS", IAP_EVENT_79H_08H) \ -__PMC_EV_ALIAS("IDQ.MS_DSB_UOPS", IAP_EVENT_79H_10H) \ -__PMC_EV_ALIAS("IDQ.MS_MITE_UOPS", IAP_EVENT_79H_20H) \ -__PMC_EV_ALIAS("IDQ.MS_UOPS", IAP_EVENT_79H_30H) \ +__PMC_EV_ALIAS("IDQ.EMPTY", IAP_EVENT_79H_02H) \ +__PMC_EV_ALIAS("IDQ.MITE_UOPS", IAP_EVENT_79H_04H) \ +__PMC_EV_ALIAS("IDQ.DSB_UOPS", IAP_EVENT_79H_08H) \ +__PMC_EV_ALIAS("IDQ.MS_DSB_UOPS", IAP_EVENT_79H_10H) \ +__PMC_EV_ALIAS("IDQ.MS_MITE_UOPS", IAP_EVENT_79H_20H) \ +__PMC_EV_ALIAS("IDQ.MS_UOPS", IAP_EVENT_79H_30H) \ __PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_ANY_UOPS", IAP_EVENT_79H_18H) \ -__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_4_UOPS", IAP_EVENT_79H_18H) \ +__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_4_UOPS", IAP_EVENT_79H_18H) \ __PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_ANY_UOPS", IAP_EVENT_79H_24H) \ -__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_4_UOPS", IAP_EVENT_79H_24H) \ -__PMC_EV_ALIAS("IDQ.MITE_ALL_UOPS", IAP_EVENT_79H_3CH) \ -__PMC_EV_ALIAS("ICACHE.MISSES", IAP_EVENT_80H_02H) \ +__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_4_UOPS", IAP_EVENT_79H_24H) \ +__PMC_EV_ALIAS("IDQ.MITE_ALL_UOPS", IAP_EVENT_79H_3CH) \ +__PMC_EV_ALIAS("ICACHE.MISSES", IAP_EVENT_80H_02H) \ __PMC_EV_ALIAS("ITLB_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_85H_01H) \ __PMC_EV_ALIAS("ITLB_MISSES.WALK_COMPLETED_4K", IAP_EVENT_85H_02H) \ __PMC_EV_ALIAS("TLB_MISSES.WALK_COMPLETED_2M_4M", IAP_EVENT_85H_04H) \ -__PMC_EV_ALIAS("ITLB_MISSES.WALK_COMPLETED", IAP_EVENT_85H_0EH) \ -__PMC_EV_ALIAS("ITLB_MISSES.WALK_DURATION", IAP_EVENT_85H_10H) \ -__PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT_4K", IAP_EVENT_85H_20H) \ -__PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT_2M", IAP_EVENT_85H_40H) \ -__PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT", IAP_EVENT_85H_60H) \ -__PMC_EV_ALIAS("ILD_STALL.LCP", IAP_EVENT_87H_01H) \ -__PMC_EV_ALIAS("ILD_STALL.IQ_FULL", IAP_EVENT_87H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.COND", IAP_EVENT_88H_01H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_02H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET", IAP_EVENT_88H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_08H) \ +__PMC_EV_ALIAS("ITLB_MISSES.WALK_COMPLETED", IAP_EVENT_85H_0EH) \ +__PMC_EV_ALIAS("ITLB_MISSES.WALK_DURATION", IAP_EVENT_85H_10H) \ +__PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT_4K", IAP_EVENT_85H_20H) \ +__PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT_2M", IAP_EVENT_85H_40H) \ +__PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT", IAP_EVENT_85H_60H) \ +__PMC_EV_ALIAS("ILD_STALL.LCP", IAP_EVENT_87H_01H) \ +__PMC_EV_ALIAS("ILD_STALL.IQ_FULL", IAP_EVENT_87H_04H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.COND", IAP_EVENT_88H_01H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_02H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET", \ + IAP_EVENT_88H_04H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_08H) \ __PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_10H) \ __PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_20H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN", IAP_EVENT_88H_40H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN", IAP_EVENT_88H_80H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.ALL_BRANCHES", IAP_EVENT_88H_FFH) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.COND", IAP_EVENT_89H_01H) \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 05:38:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D254FAA; Mon, 29 Apr 2013 05:38:03 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4DE33171E; Mon, 29 Apr 2013 05:38:01 +0000 (UTC) Received: by mail-ee0-f54.google.com with SMTP id e49so1309356eek.27 for ; Sun, 28 Apr 2013 22:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=oJqvGfyAEwYas6OfWleVoN/fVXQ5kfiFeeF4nEadXO0=; b=KdyU/6aB9y+1anPLwmq1nPaaseF7eQZjk16UMel6c2+5rG34BHrZxLKWcVyivj5YF0 6uyc9xxqBC3fXvT8tv5wYHZJvMFqTQvij3cQdeUvsFAIQJQIyQpjNHh5r2s1TKiCnyu+ 2j+bLdVcqOZYNUMj+EOqOZgf8wwl8x0ULuPE/QHuDgIwrAtiTta/xDxeNNOF+bfRHyrD PrAoDGSCD5igGJGUeIf2+K3Crr3+6OVm9mAQSJPQzbpff5tshqrypXvuFQcQDePnSYXX yjX60i2sylq75ZfwokMsb2yye/AR0MGuMKikEDmtqbSlpPkk9/IrvuNg8NSCpdrOLHd0 q2jQ== X-Received: by 10.15.24.68 with SMTP id i44mr30721284eeu.19.1367213875572; Sun, 28 Apr 2013 22:37:55 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPSA id ch6sm30701753eeb.17.2013.04.28.22.37.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 22:37:54 -0700 (PDT) Sender: Alexander Motin Message-ID: <517E072F.2030006@FreeBSD.org> Date: Mon, 29 Apr 2013 08:37:51 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130413 Thunderbird/17.0.5 MIME-Version: 1.0 To: Peter Wemm Subject: Re: svn commit: r249611 - in stable/9/sys/cam: ata scsi References: <201304180944.r3I9i05t093967@svn.freebsd.org> <517AC0BB.4040207@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 05:38:03 -0000 On 29.04.2013 04:29, Peter Wemm wrote: > On Sat, Apr 27, 2013 at 5:56 PM, Peter Wemm wrote: >> On Fri, Apr 26, 2013 at 11:00 AM, Alexander Motin wrote: >>> On 26.04.2013 19:47, Peter Wemm wrote: >>>> >>>> On Thu, Apr 18, 2013 at 2:44 AM, Alexander Motin wrote: >>>>> >>>>> Author: mav >>>>> Date: Thu Apr 18 09:44:00 2013 >>>>> New Revision: 249611 >>>>> URL: http://svnweb.freebsd.org/changeset/base/249611 >> [..] >>>> This breaks a number of machines in the freebsd.org cluster. I have >>>> to back out both of these changes to get them to reboot. >>> >>> >>> I've made a search though the base system and found only two drivers >>> affected by this change: mpt and hptmv. I've patched both at head r249849 >>> and going to merge fix to stable/9 tomorrow unless objected. Have you tried >>> that patch instead of reverting? >> >> I'm testing this on ns1.freebsd.org and ns2.freebsd.org as we speak. >> If the cluster goes dark, that's why :) > > The machines have survived multiple reboots with > r249849. Thank you. > I do wonder if perhaps "post_sync" isn't the ideal name. Perhaps add > a "quiesce_hardware" eventhandler chain and make it clear that this is > the hook for what things like mpt were doing. It is only one specific case, but I am not sure that mpt is doing the right thing. According to the commit log, interrupts are disabled to prevent new incoming target commands. But may be it could/should be blocked in some other way. What worries me more is that I've just rediscovered that post_sync handlers are called even in case of panic, when no FS sync happens at all. Is it wise to touch random subsystems is state when nothing can be trusted? I've recalled that earlier I've even added checks to CAM ATA disk driver to not recurse lock in case of panic, but that IMO is a dirty hack. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 06:11:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A49FA4D4; Mon, 29 Apr 2013 06:11:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 979481814; Mon, 29 Apr 2013 06:11:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3T6BJkY063678; Mon, 29 Apr 2013 06:11:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3T6BJw0063677; Mon, 29 Apr 2013 06:11:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304290611.r3T6BJw0063677@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 29 Apr 2013 06:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250039 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 06:11:19 -0000 Author: glebius Date: Mon Apr 29 06:11:19 2013 New Revision: 250039 URL: http://svnweb.freebsd.org/changeset/base/250039 Log: Remove useless ifdef KLD_MODULE from dummynet module unload path. This fixes panic on unload. Reported by: pho Modified: head/sys/netpfil/ipfw/ip_dummynet.c Modified: head/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dummynet.c Mon Apr 29 04:38:43 2013 (r250038) +++ head/sys/netpfil/ipfw/ip_dummynet.c Mon Apr 29 06:11:19 2013 (r250039) @@ -2170,7 +2170,6 @@ ip_dn_init(void) getmicrouptime(&dn_cfg.prev_t); } -#ifdef KLD_MODULE static void ip_dn_destroy(int last) { @@ -2194,7 +2193,6 @@ ip_dn_destroy(int last) DN_LOCK_DESTROY(); } -#endif /* KLD_MODULE */ static int dummynet_modevent(module_t mod, int type, void *data) @@ -2210,13 +2208,8 @@ dummynet_modevent(module_t mod, int type ip_dn_io_ptr = dummynet_io; return 0; } else if (type == MOD_UNLOAD) { -#if !defined(KLD_MODULE) - printf("dummynet statically compiled, cannot unload\n"); - return EINVAL ; -#else ip_dn_destroy(1 /* last */); return 0; -#endif } else return EOPNOTSUPP; } From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 06:54:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F084ACAE; Mon, 29 Apr 2013 06:54:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D2EFC1A94; Mon, 29 Apr 2013 06:54:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3T6s1jP077596; Mon, 29 Apr 2013 06:54:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3T6s1gT077595; Mon, 29 Apr 2013 06:54:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304290654.r3T6s1gT077595@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 29 Apr 2013 06:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250040 - stable/9/libexec/rtld-elf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 06:54:02 -0000 Author: kib Date: Mon Apr 29 06:54:01 2013 New Revision: 250040 URL: http://svnweb.freebsd.org/changeset/base/250040 Log: MFC r249525: Rewrite origin_subst_one() to get rid of the wrong limit on the length of the resulting string. Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Mon Apr 29 06:11:19 2013 (r250039) +++ stable/9/libexec/rtld-elf/rtld.c Mon Apr 29 06:54:01 2013 (r250040) @@ -145,9 +145,8 @@ static void unlink_object(Obj_Entry *); static void unload_object(Obj_Entry *); static void unref_dag(Obj_Entry *); static void ref_dag(Obj_Entry *); -static int origin_subst_one(char **, const char *, const char *, - const char *, char *); -static char *origin_subst(const char *, const char *); +static char *origin_subst_one(char *, const char *, const char *, bool); +static char *origin_subst(char *, const char *); static void preinit_main(void); static int rtld_verify_versions(const Objlist *); static int rtld_verify_object_versions(Obj_Entry *); @@ -748,79 +747,80 @@ basename(const char *name) static struct utsname uts; -static int -origin_subst_one(char **res, const char *real, const char *kw, const char *subst, - char *may_free) +static char * +origin_subst_one(char *real, const char *kw, const char *subst, + bool may_free) { - const char *p, *p1; - char *res1; - int subst_len; - int kw_len; - - res1 = *res = NULL; - p = real; - subst_len = kw_len = 0; - for (;;) { - p1 = strstr(p, kw); - if (p1 != NULL) { - if (subst_len == 0) { - subst_len = strlen(subst); - kw_len = strlen(kw); - } - if (*res == NULL) { - *res = xmalloc(PATH_MAX); - res1 = *res; - } - if ((res1 - *res) + subst_len + (p1 - p) >= PATH_MAX) { - _rtld_error("Substitution of %s in %s cannot be performed", - kw, real); - if (may_free != NULL) - free(may_free); - free(res); - return (false); - } - memcpy(res1, p, p1 - p); - res1 += p1 - p; - memcpy(res1, subst, subst_len); - res1 += subst_len; - p = p1 + kw_len; - } else { - if (*res == NULL) { - if (may_free != NULL) - *res = may_free; - else - *res = xstrdup(real); - return (true); - } - *res1 = '\0'; - if (may_free != NULL) - free(may_free); - if (strlcat(res1, p, PATH_MAX - (res1 - *res)) >= PATH_MAX) { - free(res); - return (false); - } - return (true); - } - } + char *p, *p1, *res, *resp; + int subst_len, kw_len, subst_count, old_len, new_len; + + kw_len = strlen(kw); + + /* + * First, count the number of the keyword occurences, to + * preallocate the final string. + */ + for (p = real, subst_count = 0;; p = p1 + kw_len, subst_count++) { + p1 = strstr(p, kw); + if (p1 == NULL) + break; + } + + /* + * If the keyword is not found, just return. + */ + if (subst_count == 0) + return (may_free ? real : xstrdup(real)); + + /* + * There is indeed something to substitute. Calculate the + * length of the resulting string, and allocate it. + */ + subst_len = strlen(subst); + old_len = strlen(real); + new_len = old_len + (subst_len - kw_len) * subst_count; + res = xmalloc(new_len + 1); + + /* + * Now, execute the substitution loop. + */ + for (p = real, resp = res;;) { + p1 = strstr(p, kw); + if (p1 != NULL) { + /* Copy the prefix before keyword. */ + memcpy(resp, p, p1 - p); + resp += p1 - p; + /* Keyword replacement. */ + memcpy(resp, subst, subst_len); + resp += subst_len; + p = p1 + kw_len; + } else + break; + } + + /* Copy to the end of string and finish. */ + strcat(resp, p); + if (may_free) + free(real); + return (res); } static char * -origin_subst(const char *real, const char *origin_path) +origin_subst(char *real, const char *origin_path) { - char *res1, *res2, *res3, *res4; + char *res1, *res2, *res3, *res4; - if (uts.sysname[0] == '\0') { - if (uname(&uts) != 0) { - _rtld_error("utsname failed: %d", errno); - return (NULL); + if (uts.sysname[0] == '\0') { + if (uname(&uts) != 0) { + _rtld_error("utsname failed: %d", errno); + return (NULL); + } } - } - if (!origin_subst_one(&res1, real, "$ORIGIN", origin_path, NULL) || - !origin_subst_one(&res2, res1, "$OSNAME", uts.sysname, res1) || - !origin_subst_one(&res3, res2, "$OSREL", uts.release, res2) || - !origin_subst_one(&res4, res3, "$PLATFORM", uts.machine, res3)) - return (NULL); - return (res4); + res1 = origin_subst_one(real, "$ORIGIN", origin_path, false); + res2 = origin_subst_one(res1, "$OSNAME", uts.sysname, true); + res3 = origin_subst_one(res2, "$OSREL", uts.release, true); + res4 = origin_subst_one(res3, "$PLATFORM", uts.machine, true); + return (res4); } static void @@ -1438,10 +1438,12 @@ find_library(const char *xname, const Ob xname); return NULL; } - if (objgiven && refobj->z_origin) - return origin_subst(xname, refobj->origin_path); - else - return xstrdup(xname); + if (objgiven && refobj->z_origin) { + return (origin_subst(__DECONST(char *, xname), + refobj->origin_path)); + } else { + return (xstrdup(xname)); + } } if (libmap_disable || !objgiven || From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 07:28:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 484BC18D; Mon, 29 Apr 2013 07:28:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2041B79; Mon, 29 Apr 2013 07:28:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3T7SUES089165; Mon, 29 Apr 2013 07:28:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3T7SU0V089164; Mon, 29 Apr 2013 07:28:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304290728.r3T7SU0V089164@svn.freebsd.org> From: Adrian Chadd Date: Mon, 29 Apr 2013 07:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250041 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 07:28:30 -0000 Author: adrian Date: Mon Apr 29 07:28:29 2013 New Revision: 250041 URL: http://svnweb.freebsd.org/changeset/base/250041 Log: Debugging changes! * That lock isn't actually held during reset - just the whole TX/RX path is paused. So, remove the assertion. * Log the TX queue status - how many hardware frames are active in the MAC and whether the queue is active. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Apr 29 06:54:01 2013 (r250040) +++ head/sys/dev/ath/if_ath.c Mon Apr 29 07:28:29 2013 (r250041) @@ -4466,10 +4466,12 @@ ath_tx_stopdma(struct ath_softc *sc, str struct ath_hal *ah = sc->sc_ah; DPRINTF(sc, ATH_DEBUG_RESET, - "%s: tx queue [%u] %p, flags 0x%08x, link %p\n", + "%s: tx queue [%u] %p, active=%d, hwpending=%d, flags 0x%08x, link %p\n", __func__, txq->axq_qnum, (caddr_t)(uintptr_t) ath_hal_gettxbuf(ah, txq->axq_qnum), + (int) (!! ath_hal_txqenabled(ah, txq->axq_qnum)), + (int) ath_hal_numtxpending(ah, txq->axq_qnum), txq->axq_flags, txq->axq_link); (void) ath_hal_stoptxdma(ah, txq->axq_qnum); @@ -4511,8 +4513,6 @@ ath_tx_dump(struct ath_softc *sc, struct if (! (sc->sc_debug & ATH_DEBUG_RESET)) return; - ATH_TX_LOCK_ASSERT(sc); - device_printf(sc->sc_dev, "%s: Q%d: begin\n", __func__, txq->axq_qnum); TAILQ_FOREACH(bf, &txq->axq_q, bf_list) { From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 10:20:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 97039CF3; Mon, 29 Apr 2013 10:20:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 89F15167C; Mon, 29 Apr 2013 10:20:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TAKkuv053904; Mon, 29 Apr 2013 10:20:46 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TAKkLA053903; Mon, 29 Apr 2013 10:20:46 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304291020.r3TAKkLA053903@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 29 Apr 2013 10:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250043 - stable/9/sys/boot/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 10:20:46 -0000 Author: ae Date: Mon Apr 29 10:20:46 2013 New Revision: 250043 URL: http://svnweb.freebsd.org/changeset/base/250043 Log: MFC r249719: Since we didn't break the loop, we should set i to -1 to start from the beginning. Submitted by: Steven Hartland Modified: stable/9/sys/boot/common/module.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/common/module.c ============================================================================== --- stable/9/sys/boot/common/module.c Mon Apr 29 08:21:32 2013 (r250042) +++ stable/9/sys/boot/common/module.c Mon Apr 29 10:20:46 2013 (r250043) @@ -289,7 +289,8 @@ file_load(char *filename, vm_offset_t de break; } else if (last_file_format == i && i != 0) { /* Restart from the beginning */ - last_file_format = i = 0; + i = -1; + last_file_format = 0; fp = NULL; continue; } From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 10:52:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CCC14A2D; Mon, 29 Apr 2013 10:52:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BDD3C17E1; Mon, 29 Apr 2013 10:52:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TAqme5065071; Mon, 29 Apr 2013 10:52:48 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TAqjmL065045; Mon, 29 Apr 2013 10:52:45 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304291052.r3TAqjmL065045@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 29 Apr 2013 10:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250044 - in stable/9: sys/net sys/netinet sys/netinet6 sys/netipsec usr.bin/netstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 10:52:48 -0000 Author: ae Date: Mon Apr 29 10:52:45 2013 New Revision: 250044 URL: http://svnweb.freebsd.org/changeset/base/250044 Log: MFC r249294: Use IP6STAT_INC/IP6STAT_DEC macros to update ip6 stats. MFC r249528,249546: Add accounting to the source address selection algorithm for cases, when it fails to select an address, also add several another counters to the statistics. MFC r249543,249552: Replace hardcoded numbers. MFC r249544: Use IP6S_M2MMAX macro. MFC r249545: Replace hardcoded numbers. Also use interface-local scope name instead of node-local. Modified: stable/9/sys/net/if_bridge.c stable/9/sys/netinet/ip6.h stable/9/sys/netinet6/dest6.c stable/9/sys/netinet6/frag6.c stable/9/sys/netinet6/in6_gif.c stable/9/sys/netinet6/in6_src.c stable/9/sys/netinet6/ip6_forward.c stable/9/sys/netinet6/ip6_input.c stable/9/sys/netinet6/ip6_ipsec.c stable/9/sys/netinet6/ip6_mroute.c stable/9/sys/netinet6/ip6_output.c stable/9/sys/netinet6/ip6_var.h stable/9/sys/netinet6/raw_ip6.c stable/9/sys/netinet6/route6.c stable/9/sys/netipsec/ipsec_input.c stable/9/sys/netipsec/ipsec_output.c stable/9/usr.bin/netstat/inet6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) stable/9/usr.bin/netstat/ (props changed) Modified: stable/9/sys/net/if_bridge.c ============================================================================== --- stable/9/sys/net/if_bridge.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/net/if_bridge.c Mon Apr 29 10:52:45 2013 (r250044) @@ -3397,14 +3397,14 @@ bridge_ip6_checkbasic(struct mbuf **mp) if ((m = m_copyup(m, sizeof(struct ip6_hdr), (max_linkhdr + 3) & ~3)) == NULL) { /* XXXJRT new stat, please */ - V_ip6stat.ip6s_toosmall++; + IP6STAT_INC(ip6s_toosmall); in6_ifstat_inc(inifp, ifs6_in_hdrerr); goto bad; } } else if (__predict_false(m->m_len < sizeof(struct ip6_hdr))) { struct ifnet *inifp = m->m_pkthdr.rcvif; if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) { - V_ip6stat.ip6s_toosmall++; + IP6STAT_INC(ip6s_toosmall); in6_ifstat_inc(inifp, ifs6_in_hdrerr); goto bad; } @@ -3413,7 +3413,7 @@ bridge_ip6_checkbasic(struct mbuf **mp) ip6 = mtod(m, struct ip6_hdr *); if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { - V_ip6stat.ip6s_badvers++; + IP6STAT_INC(ip6s_badvers); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr); goto bad; } Modified: stable/9/sys/netinet/ip6.h ============================================================================== --- stable/9/sys/netinet/ip6.h Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet/ip6.h Mon Apr 29 10:52:45 2013 (r250044) @@ -275,24 +275,24 @@ do { \ if (((m)->m_flags & M_LOOP) && \ ((m)->m_len < (off) + (hlen)) && \ (((m) = m_pullup((m), (off) + (hlen))) == NULL)) { \ - V_ip6stat.ip6s_exthdrtoolong++; \ + IP6STAT_INC(ip6s_exthdrtoolong); \ return ret; \ } else if ((m)->m_flags & M_EXT) { \ if ((m)->m_len < (off) + (hlen)) { \ - V_ip6stat.ip6s_exthdrtoolong++; \ + IP6STAT_INC(ip6s_exthdrtoolong); \ m_freem(m); \ return ret; \ } \ } else { \ if ((m)->m_len < (off) + (hlen)) { \ - V_ip6stat.ip6s_exthdrtoolong++; \ + IP6STAT_INC(ip6s_exthdrtoolong); \ m_freem(m); \ return ret; \ } \ } \ } else { \ if ((m)->m_len < (off) + (hlen)) { \ - V_ip6stat.ip6s_tooshort++; \ + IP6STAT_INC(ip6s_tooshort); \ in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated); \ m_freem(m); \ return ret; \ Modified: stable/9/sys/netinet6/dest6.c ============================================================================== --- stable/9/sys/netinet6/dest6.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/dest6.c Mon Apr 29 10:52:45 2013 (r250044) @@ -93,7 +93,7 @@ dest6_input(struct mbuf **mp, int *offp, for (optlen = 0; dstoptlen > 0; dstoptlen -= optlen, opt += optlen) { if (*opt != IP6OPT_PAD1 && (dstoptlen < IP6OPT_MINLEN || *(opt + 1) + 2 > dstoptlen)) { - V_ip6stat.ip6s_toosmall++; + IP6STAT_INC(ip6s_toosmall); goto bad; } Modified: stable/9/sys/netinet6/frag6.c ============================================================================== --- stable/9/sys/netinet6/frag6.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/frag6.c Mon Apr 29 10:52:45 2013 (r250044) @@ -215,7 +215,7 @@ frag6_input(struct mbuf **mp, int *offp, return IPPROTO_DONE; } - V_ip6stat.ip6s_fragments++; + IP6STAT_INC(ip6s_fragments); in6_ifstat_inc(dstifp, ifs6_reass_reqd); /* offset now points to data portion */ @@ -228,7 +228,7 @@ frag6_input(struct mbuf **mp, int *offp, */ if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) { /* XXX-BZ we want dedicated counters for this. */ - V_ip6stat.ip6s_reassembled++; + IP6STAT_INC(ip6s_reassembled); in6_ifstat_inc(dstifp, ifs6_reass_ok); *offp = offset; return (ip6f->ip6f_nxt); @@ -603,7 +603,7 @@ insert: m->m_pkthdr.len = plen; } - V_ip6stat.ip6s_reassembled++; + IP6STAT_INC(ip6s_reassembled); in6_ifstat_inc(dstifp, ifs6_reass_ok); /* @@ -619,7 +619,7 @@ insert: dropfrag: IP6Q_UNLOCK(); in6_ifstat_inc(dstifp, ifs6_reass_fail); - V_ip6stat.ip6s_fragdropped++; + IP6STAT_INC(ip6s_fragdropped); m_freem(m); return IPPROTO_DONE; } @@ -743,7 +743,7 @@ frag6_slowtimo(void) --q6->ip6q_ttl; q6 = q6->ip6q_next; if (q6->ip6q_prev->ip6q_ttl == 0) { - V_ip6stat.ip6s_fragtimeout++; + IP6STAT_INC(ip6s_fragtimeout); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(q6->ip6q_prev); } @@ -755,7 +755,7 @@ frag6_slowtimo(void) */ while (V_frag6_nfragpackets > (u_int)V_ip6_maxfragpackets && V_ip6q.ip6q_prev) { - V_ip6stat.ip6s_fragoverflow++; + IP6STAT_INC(ip6s_fragoverflow); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(V_ip6q.ip6q_prev); } @@ -781,7 +781,7 @@ frag6_drain(void) VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); while (V_ip6q.ip6q_next != &V_ip6q) { - V_ip6stat.ip6s_fragdropped++; + IP6STAT_INC(ip6s_fragdropped); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(V_ip6q.ip6q_next); } Modified: stable/9/sys/netinet6/in6_gif.c ============================================================================== --- stable/9/sys/netinet6/in6_gif.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/in6_gif.c Mon Apr 29 10:52:45 2013 (r250044) @@ -301,14 +301,14 @@ in6_gif_input(struct mbuf **mp, int *off sc = (struct gif_softc *)encap_getarg(m); if (sc == NULL) { m_freem(m); - V_ip6stat.ip6s_nogif++; + IP6STAT_INC(ip6s_nogif); return IPPROTO_DONE; } gifp = GIF2IFP(sc); if (gifp == NULL || (gifp->if_flags & IFF_UP) == 0) { m_freem(m); - V_ip6stat.ip6s_nogif++; + IP6STAT_INC(ip6s_nogif); return IPPROTO_DONE; } @@ -363,7 +363,7 @@ in6_gif_input(struct mbuf **mp, int *off break; default: - V_ip6stat.ip6s_nogif++; + IP6STAT_INC(ip6s_nogif); m_freem(m); return IPPROTO_DONE; } Modified: stable/9/sys/netinet6/in6_src.c ============================================================================== --- stable/9/sys/netinet6/in6_src.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/in6_src.c Mon Apr 29 10:52:45 2013 (r250044) @@ -151,9 +151,8 @@ static struct in6_addrpolicy *match_addr * an entry to the caller for later use. */ #define REPLACE(r) do {\ - if ((r) < sizeof(V_ip6stat.ip6s_sources_rule) / \ - sizeof(V_ip6stat.ip6s_sources_rule[0])) /* check for safety */ \ - V_ip6stat.ip6s_sources_rule[(r)]++; \ + IP6STAT_INC(ip6s_sources_rule[(r)]); \ + rule = (r); \ /* { \ char ip6buf[INET6_ADDRSTRLEN], ip6b[INET6_ADDRSTRLEN]; \ printf("in6_selectsrc: replace %s with %s by %d\n", ia_best ? ip6_sprintf(ip6buf, &ia_best->ia_addr.sin6_addr) : "none", ip6_sprintf(ip6b, &ia->ia_addr.sin6_addr), (r)); \ @@ -161,9 +160,6 @@ static struct in6_addrpolicy *match_addr goto replace; \ } while(0) #define NEXT(r) do {\ - if ((r) < sizeof(V_ip6stat.ip6s_sources_rule) / \ - sizeof(V_ip6stat.ip6s_sources_rule[0])) /* check for safety */ \ - V_ip6stat.ip6s_sources_rule[(r)]++; \ /* { \ char ip6buf[INET6_ADDRSTRLEN], ip6b[INET6_ADDRSTRLEN]; \ printf("in6_selectsrc: keep %s against %s by %d\n", ia_best ? ip6_sprintf(ip6buf, &ia_best->ia_addr.sin6_addr) : "none", ip6_sprintf(ip6b, &ia->ia_addr.sin6_addr), (r)); \ @@ -171,9 +167,8 @@ static struct in6_addrpolicy *match_addr goto next; /* XXX: we can't use 'continue' here */ \ } while(0) #define BREAK(r) do { \ - if ((r) < sizeof(V_ip6stat.ip6s_sources_rule) / \ - sizeof(V_ip6stat.ip6s_sources_rule[0])) /* check for safety */ \ - V_ip6stat.ip6s_sources_rule[(r)]++; \ + IP6STAT_INC(ip6s_sources_rule[(r)]); \ + rule = (r); \ goto out; /* XXX: we can't use 'break' here */ \ } while(0) @@ -190,7 +185,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso struct in6_addrpolicy *dst_policy = NULL, *best_policy = NULL; u_int32_t odstzone; int prefer_tempaddr; - int error; + int error, rule; struct ip6_moptions *mopts; KASSERT(srcp != NULL, ("%s: srcp is NULL", __func__)); @@ -306,6 +301,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso if (error) return (error); + rule = 0; IN6_IFADDR_RLOCK(); TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { int new_scope = -1, new_matchlen = -1; @@ -487,6 +483,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso if ((ia = ia_best) == NULL) { IN6_IFADDR_RUNLOCK(); + IP6STAT_INC(ip6s_sources_none); return (EADDRNOTAVAIL); } @@ -503,6 +500,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso if (cred != NULL && prison_local_ip6(cred, &tmp, (inp != NULL && (inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)) != 0) { IN6_IFADDR_RUNLOCK(); + IP6STAT_INC(ip6s_sources_none); return (EADDRNOTAVAIL); } @@ -510,6 +508,16 @@ in6_selectsrc(struct sockaddr_in6 *dstso *ifpp = ifp; bcopy(&tmp, srcp, sizeof(*srcp)); + if (ia->ia_ifp == ifp) + IP6STAT_INC(ip6s_sources_sameif[best_scope]); + else + IP6STAT_INC(ip6s_sources_otherif[best_scope]); + if (dst_scope == best_scope) + IP6STAT_INC(ip6s_sources_samescope[best_scope]); + else + IP6STAT_INC(ip6s_sources_otherscope[best_scope]); + if (IFA6_IS_DEPRECATED(ia)) + IP6STAT_INC(ip6s_sources_deprecated[best_scope]); IN6_IFADDR_RUNLOCK(); return (0); } @@ -733,7 +741,7 @@ selectroute(struct sockaddr_in6 *dstsock error = EHOSTUNREACH; } if (error == EHOSTUNREACH) - V_ip6stat.ip6s_noroute++; + IP6STAT_INC(ip6s_noroute); if (retifp != NULL) { *retifp = ifp; Modified: stable/9/sys/netinet6/ip6_forward.c ============================================================================== --- stable/9/sys/netinet6/ip6_forward.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/ip6_forward.c Mon Apr 29 10:52:45 2013 (r250044) @@ -135,7 +135,7 @@ ip6_forward(struct mbuf *m, int srcrt) if ((m->m_flags & (M_BCAST|M_MCAST)) != 0 || IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { - V_ip6stat.ip6s_cantforward++; + IP6STAT_INC(ip6s_cantforward); /* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard) */ if (V_ip6_log_time + V_ip6_log_interval < time_second) { V_ip6_log_time = time_second; @@ -183,7 +183,7 @@ ip6_forward(struct mbuf *m, int srcrt) IP_FORWARDING, &error); if (sp == NULL) { V_ipsec6stat.out_inval++; - V_ip6stat.ip6s_cantforward++; + IP6STAT_INC(ip6s_cantforward); if (mcopy) { #if 0 /* XXX: what icmp ? */ @@ -204,7 +204,7 @@ ip6_forward(struct mbuf *m, int srcrt) * This packet is just discarded. */ V_ipsec6stat.out_polvio++; - V_ip6stat.ip6s_cantforward++; + IP6STAT_INC(ip6s_cantforward); KEY_FREESP(&sp); if (mcopy) { #if 0 @@ -226,7 +226,7 @@ ip6_forward(struct mbuf *m, int srcrt) if (sp->req == NULL) { /* XXX should be panic ? */ printf("ip6_forward: No IPsec request specified.\n"); - V_ip6stat.ip6s_cantforward++; + IP6STAT_INC(ip6s_cantforward); KEY_FREESP(&sp); if (mcopy) { #if 0 @@ -310,7 +310,7 @@ ip6_forward(struct mbuf *m, int srcrt) /* don't show these error codes to the user */ break; } - V_ip6stat.ip6s_cantforward++; + IP6STAT_INC(ip6s_cantforward); if (mcopy) { #if 0 /* XXX: what icmp ? */ @@ -362,7 +362,7 @@ again2: if (rin6.ro_rt != NULL) RT_UNLOCK(rin6.ro_rt); else { - V_ip6stat.ip6s_noroute++; + IP6STAT_INC(ip6s_noroute); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_noroute); if (mcopy) { icmp6_error(mcopy, ICMP6_DST_UNREACH, @@ -387,13 +387,13 @@ skip_routing: src_in6 = ip6->ip6_src; if (in6_setscope(&src_in6, rt->rt_ifp, &outzone)) { /* XXX: this should not happen */ - V_ip6stat.ip6s_cantforward++; - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_cantforward); + IP6STAT_INC(ip6s_badscope); goto bad; } if (in6_setscope(&src_in6, m->m_pkthdr.rcvif, &inzone)) { - V_ip6stat.ip6s_cantforward++; - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_cantforward); + IP6STAT_INC(ip6s_badscope); goto bad; } if (inzone != outzone @@ -401,8 +401,8 @@ skip_routing: && !ipsecrt #endif ) { - V_ip6stat.ip6s_cantforward++; - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_cantforward); + IP6STAT_INC(ip6s_badscope); in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard); if (V_ip6_log_time + V_ip6_log_interval < time_second) { @@ -432,8 +432,8 @@ skip_routing: if (in6_setscope(&dst_in6, m->m_pkthdr.rcvif, &inzone) != 0 || in6_setscope(&dst_in6, rt->rt_ifp, &outzone) != 0 || inzone != outzone) { - V_ip6stat.ip6s_cantforward++; - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_cantforward); + IP6STAT_INC(ip6s_badscope); goto bad; } @@ -623,12 +623,12 @@ pass: error = nd6_output(rt->rt_ifp, origifp, m, dst, rt); if (error) { in6_ifstat_inc(rt->rt_ifp, ifs6_out_discard); - V_ip6stat.ip6s_cantforward++; + IP6STAT_INC(ip6s_cantforward); } else { - V_ip6stat.ip6s_forward++; + IP6STAT_INC(ip6s_forward); in6_ifstat_inc(rt->rt_ifp, ifs6_out_forward); if (type) - V_ip6stat.ip6s_redirectsent++; + IP6STAT_INC(ip6s_redirectsent); else { if (mcopy) goto freecopy; Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/ip6_input.c Mon Apr 29 10:52:45 2013 (r250044) @@ -357,7 +357,7 @@ ip6_input_hbh(struct mbuf *m, uint32_t * * contained, ip6_hopopts_input() must set a valid * (non-zero) payload length to the variable plen. */ - V_ip6stat.ip6s_badoptions++; + IP6STAT_INC(ip6s_badoptions); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr); icmp6_error(m, ICMP6_PARAM_PROB, @@ -372,7 +372,7 @@ ip6_input_hbh(struct mbuf *m, uint32_t * IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), sizeof(struct ip6_hbh)); if (hbh == NULL) { - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); goto out; } #endif @@ -455,21 +455,20 @@ ip6_input(struct mbuf *m) */ if (m->m_flags & M_EXT) { if (m->m_next) - V_ip6stat.ip6s_mext2m++; + IP6STAT_INC(ip6s_mext2m); else - V_ip6stat.ip6s_mext1++; + IP6STAT_INC(ip6s_mext1); } else { -#define M2MMAX (sizeof(V_ip6stat.ip6s_m2m)/sizeof(V_ip6stat.ip6s_m2m[0])) if (m->m_next) { if (m->m_flags & M_LOOP) { - V_ip6stat.ip6s_m2m[V_loif->if_index]++; - } else if (m->m_pkthdr.rcvif->if_index < M2MMAX) - V_ip6stat.ip6s_m2m[m->m_pkthdr.rcvif->if_index]++; + IP6STAT_INC(ip6s_m2m[V_loif->if_index]); + } else if (m->m_pkthdr.rcvif->if_index < IP6S_M2MMAX) + IP6STAT_INC( + ip6s_m2m[m->m_pkthdr.rcvif->if_index]); else - V_ip6stat.ip6s_m2m[0]++; + IP6STAT_INC(ip6s_m2m[0]); } else - V_ip6stat.ip6s_m1++; -#undef M2MMAX + IP6STAT_INC(ip6s_m1); } /* drop the packet if IPv6 operation is disabled on the IF */ @@ -479,7 +478,7 @@ ip6_input(struct mbuf *m) } in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_receive); - V_ip6stat.ip6s_total++; + IP6STAT_INC(ip6s_total); #ifndef PULLDOWN_TEST /* @@ -517,7 +516,7 @@ ip6_input(struct mbuf *m) struct ifnet *inifp; inifp = m->m_pkthdr.rcvif; if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) { - V_ip6stat.ip6s_toosmall++; + IP6STAT_INC(ip6s_toosmall); in6_ifstat_inc(inifp, ifs6_in_hdrerr); return; } @@ -526,12 +525,12 @@ ip6_input(struct mbuf *m) ip6 = mtod(m, struct ip6_hdr *); if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { - V_ip6stat.ip6s_badvers++; + IP6STAT_INC(ip6s_badvers); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr); goto bad; } - V_ip6stat.ip6s_nxthist[ip6->ip6_nxt]++; + IP6STAT_INC(ip6s_nxthist[ip6->ip6_nxt]); /* * Check against address spoofing/corruption. @@ -541,7 +540,7 @@ ip6_input(struct mbuf *m) /* * XXX: "badscope" is not very suitable for a multicast source. */ - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } @@ -553,7 +552,7 @@ ip6_input(struct mbuf *m) * because ip6_mloopback() passes the "actual" interface * as the outgoing/incoming interface. */ - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } @@ -578,7 +577,7 @@ ip6_input(struct mbuf *m) */ if (IN6_IS_ADDR_V4MAPPED(&ip6->ip6_src) || IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst)) { - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } @@ -592,7 +591,7 @@ ip6_input(struct mbuf *m) */ if (IN6_IS_ADDR_V4COMPAT(&ip6->ip6_src) || IN6_IS_ADDR_V4COMPAT(&ip6->ip6_dst)) { - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } @@ -655,12 +654,12 @@ passin: * is not loopback. */ if (in6_clearscope(&ip6->ip6_src) || in6_clearscope(&ip6->ip6_dst)) { - V_ip6stat.ip6s_badscope++; /* XXX */ + IP6STAT_INC(ip6s_badscope); /* XXX */ goto bad; } if (in6_setscope(&ip6->ip6_src, m->m_pkthdr.rcvif, NULL) || in6_setscope(&ip6->ip6_dst, m->m_pkthdr.rcvif, NULL)) { - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); goto bad; } @@ -864,7 +863,7 @@ passin: * and we're not a router. */ if (!V_ip6_forwarding) { - V_ip6stat.ip6s_cantforward++; + IP6STAT_INC(ip6s_cantforward); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); goto bad; } @@ -918,7 +917,7 @@ passin: * Drop packet if shorter than we expect. */ if (m->m_pkthdr.len - sizeof(struct ip6_hdr) < plen) { - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated); goto bad; } @@ -970,7 +969,7 @@ passin: */ if (IN6_IS_ADDR_V4MAPPED(&ip6->ip6_src) || IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst)) { - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } @@ -978,13 +977,13 @@ passin: /* * Tell launch routine the next header */ - V_ip6stat.ip6s_delivered++; + IP6STAT_INC(ip6s_delivered); in6_ifstat_inc(deliverifp, ifs6_in_deliver); nest = 0; while (nxt != IPPROTO_DONE) { if (V_ip6_hdrnestlimit && (++nest > V_ip6_hdrnestlimit)) { - V_ip6stat.ip6s_toomanyhdr++; + IP6STAT_INC(ip6s_toomanyhdr); goto bad; } @@ -993,7 +992,7 @@ passin: * more sanity checks in header chain processing. */ if (m->m_pkthdr.len < off) { - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated); goto bad; } @@ -1087,14 +1086,14 @@ ip6_hopopts_input(u_int32_t *plenp, u_in IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), sizeof(struct ip6_hbh)); if (hbh == NULL) { - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); return -1; } hbhlen = (hbh->ip6h_len + 1) << 3; IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), hbhlen); if (hbh == NULL) { - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); return -1; } #endif @@ -1139,7 +1138,7 @@ ip6_process_hopopts(struct mbuf *m, u_in break; case IP6OPT_PADN: if (hbhlen < IP6OPT_MINLEN) { - V_ip6stat.ip6s_toosmall++; + IP6STAT_INC(ip6s_toosmall); goto bad; } optlen = *(opt + 1) + 2; @@ -1147,7 +1146,7 @@ ip6_process_hopopts(struct mbuf *m, u_in case IP6OPT_ROUTER_ALERT: /* XXX may need check for alignment */ if (hbhlen < IP6OPT_RTALERT_LEN) { - V_ip6stat.ip6s_toosmall++; + IP6STAT_INC(ip6s_toosmall); goto bad; } if (*(opt + 1) != IP6OPT_RTALERT_LEN - 2) { @@ -1164,7 +1163,7 @@ ip6_process_hopopts(struct mbuf *m, u_in case IP6OPT_JUMBO: /* XXX may need check for alignment */ if (hbhlen < IP6OPT_JUMBO_LEN) { - V_ip6stat.ip6s_toosmall++; + IP6STAT_INC(ip6s_toosmall); goto bad; } if (*(opt + 1) != IP6OPT_JUMBO_LEN - 2) { @@ -1182,7 +1181,7 @@ ip6_process_hopopts(struct mbuf *m, u_in */ ip6 = mtod(m, struct ip6_hdr *); if (ip6->ip6_plen) { - V_ip6stat.ip6s_badoptions++; + IP6STAT_INC(ip6s_badoptions); icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, erroff + opt - opthead); @@ -1206,7 +1205,7 @@ ip6_process_hopopts(struct mbuf *m, u_in * there's no explicit mention in specification. */ if (*plenp != 0) { - V_ip6stat.ip6s_badoptions++; + IP6STAT_INC(ip6s_badoptions); icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, erroff + opt + 2 - opthead); @@ -1218,7 +1217,7 @@ ip6_process_hopopts(struct mbuf *m, u_in * jumbo payload length must be larger than 65535. */ if (jumboplen <= IPV6_MAXPACKET) { - V_ip6stat.ip6s_badoptions++; + IP6STAT_INC(ip6s_badoptions); icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, erroff + opt + 2 - opthead); @@ -1229,7 +1228,7 @@ ip6_process_hopopts(struct mbuf *m, u_in break; default: /* unknown option */ if (hbhlen < IP6OPT_MINLEN) { - V_ip6stat.ip6s_toosmall++; + IP6STAT_INC(ip6s_toosmall); goto bad; } optlen = ip6_unknown_opt(opt, m, @@ -1266,11 +1265,11 @@ ip6_unknown_opt(u_int8_t *optp, struct m m_freem(m); return (-1); case IP6OPT_TYPE_FORCEICMP: /* send ICMP even if multicasted */ - V_ip6stat.ip6s_badoptions++; + IP6STAT_INC(ip6s_badoptions); icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_OPTION, off); return (-1); case IP6OPT_TYPE_ICMP: /* send ICMP if not multicasted */ - V_ip6stat.ip6s_badoptions++; + IP6STAT_INC(ip6s_badoptions); ip6 = mtod(m, struct ip6_hdr *); if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || (m->m_flags & (M_BCAST|M_MCAST))) @@ -1449,14 +1448,14 @@ ip6_savecontrol(struct inpcb *in6p, stru ext = ip6_pullexthdr(m, sizeof(struct ip6_hdr), ip6->ip6_nxt); if (ext == NULL) { - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); return; } hbh = mtod(ext, struct ip6_hbh *); hbhlen = (hbh->ip6h_len + 1) << 3; if (hbhlen != ext->m_len) { m_freem(ext); - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); return; } #endif @@ -1523,7 +1522,7 @@ ip6_savecontrol(struct inpcb *in6p, stru #else ext = ip6_pullexthdr(m, off, nxt); if (ext == NULL) { - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); return; } ip6e = mtod(ext, struct ip6_ext *); @@ -1533,7 +1532,7 @@ ip6_savecontrol(struct inpcb *in6p, stru elen = (ip6e->ip6e_len + 1) << 3; if (elen != ext->m_len) { m_freem(ext); - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); return; } #endif Modified: stable/9/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/9/sys/netinet6/ip6_ipsec.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/ip6_ipsec.c Mon Apr 29 10:52:45 2013 (r250044) @@ -152,7 +152,7 @@ ip6_ipsec_fwd(struct mbuf *m) KEY_FREESP(&sp); splx(s); if (error) { - V_ip6stat.ip6s_cantforward++; + IP6STAT_INC(ip6s_cantforward); return 1; } #endif /* IPSEC */ Modified: stable/9/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/9/sys/netinet6/ip6_mroute.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/ip6_mroute.c Mon Apr 29 10:52:45 2013 (r250044) @@ -1100,7 +1100,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru * (although such packets must normally set 1 to the hop limit field). */ if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { - V_ip6stat.ip6s_cantforward++; + IP6STAT_INC(ip6s_cantforward); if (V_ip6_log_time + V_ip6_log_interval < time_second) { V_ip6_log_time = time_second; log(LOG_DEBUG, @@ -1535,7 +1535,7 @@ ip6_mdq(struct mbuf *m, struct ifnet *if dst0 = ip6->ip6_dst; if ((error = in6_setscope(&src0, ifp, &iszone)) != 0 || (error = in6_setscope(&dst0, ifp, &idzone)) != 0) { - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); return (error); } for (mifp = mif6table, mifi = 0; mifi < nummifs; mifp++, mifi++) { @@ -1555,7 +1555,7 @@ ip6_mdq(struct mbuf *m, struct ifnet *if &odzone) || iszone != oszone || idzone != odzone) { - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); continue; } } Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/ip6_output.c Mon Apr 29 10:52:45 2013 (r250044) @@ -498,16 +498,16 @@ skip_ipsec2:; if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) && (flags & IPV6_UNSPECSRC) == 0) { error = EOPNOTSUPP; - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); goto bad; } if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_src)) { error = EOPNOTSUPP; - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); goto bad; } - V_ip6stat.ip6s_localout++; + IP6STAT_INC(ip6s_localout); /* * Route packet. @@ -713,7 +713,7 @@ again: goto routefound; badscope: - V_ip6stat.ip6s_badscope++; + IP6STAT_INC(ip6s_badscope); in6_ifstat_inc(origifp, ifs6_out_discard); if (error == 0) error = EHOSTUNREACH; /* XXX */ @@ -742,7 +742,7 @@ again: * Confirm that the outgoing interface supports multicast. */ if (!(ifp->if_flags & IFF_MULTICAST)) { - V_ip6stat.ip6s_noroute++; + IP6STAT_INC(ip6s_noroute); in6_ifstat_inc(ifp, ifs6_out_discard); error = ENETUNREACH; goto bad; @@ -1075,7 +1075,7 @@ passout: if (qslots <= 0 || ((u_int)qslots * (mtu - hlen) < tlen /* - hlen */)) { error = ENOBUFS; - V_ip6stat.ip6s_odropped++; + IP6STAT_INC(ip6s_odropped); goto bad; } @@ -1125,7 +1125,7 @@ passout: MGETHDR(m, M_DONTWAIT, MT_HEADER); if (!m) { error = ENOBUFS; - V_ip6stat.ip6s_odropped++; + IP6STAT_INC(ip6s_odropped); goto sendorfree; } m->m_pkthdr.rcvif = NULL; @@ -1138,7 +1138,7 @@ passout: m->m_len = sizeof(*mhip6); error = ip6_insertfraghdr(m0, m, hlen, &ip6f); if (error) { - V_ip6stat.ip6s_odropped++; + IP6STAT_INC(ip6s_odropped); goto sendorfree; } ip6f->ip6f_offlg = htons((u_short)((off - hlen) & ~7)); @@ -1150,7 +1150,7 @@ passout: sizeof(*ip6f) - sizeof(struct ip6_hdr))); if ((m_frgpart = m_copy(m0, off, len)) == 0) { error = ENOBUFS; - V_ip6stat.ip6s_odropped++; + IP6STAT_INC(ip6s_odropped); goto sendorfree; } m_cat(m, m_frgpart); @@ -1159,7 +1159,7 @@ passout: ip6f->ip6f_reserved = 0; ip6f->ip6f_ident = id; ip6f->ip6f_nxt = nextproto; - V_ip6stat.ip6s_ofragments++; + IP6STAT_INC(ip6s_ofragments); in6_ifstat_inc(ifp, ifs6_out_fragcreat); } @@ -1188,7 +1188,7 @@ sendorfree: } if (error == 0) - V_ip6stat.ip6s_fragmented++; + IP6STAT_INC(ip6s_fragmented); done: if (ro == &ip6route) Modified: stable/9/sys/netinet6/ip6_var.h ============================================================================== --- stable/9/sys/netinet6/ip6_var.h Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/ip6_var.h Mon Apr 29 10:52:45 2013 (r250044) @@ -204,9 +204,11 @@ struct ip6stat { u_quad_t ip6s_rawout; /* total raw ip packets generated */ u_quad_t ip6s_badscope; /* scope error */ u_quad_t ip6s_notmember; /* don't join this multicast group */ - u_quad_t ip6s_nxthist[256]; /* next header history */ +#define IP6S_HDRCNT 256 /* headers count */ + u_quad_t ip6s_nxthist[IP6S_HDRCNT]; /* next header history */ u_quad_t ip6s_m1; /* one mbuf */ - u_quad_t ip6s_m2m[32]; /* two or more mbuf */ +#define IP6S_M2MMAX 32 + u_quad_t ip6s_m2m[IP6S_M2MMAX]; /* two or more mbuf */ u_quad_t ip6s_mext1; /* one ext mbuf */ u_quad_t ip6s_mext2m; /* two or more ext mbuf */ u_quad_t ip6s_exthdrtoolong; /* ext hdr are not contiguous */ @@ -218,27 +220,29 @@ struct ip6stat { * algorithm: * XXX: hardcoded 16 = # of ip6 multicast scope types + 1 */ +#define IP6S_RULESMAX 16 +#define IP6S_SCOPECNT 16 /* number of times that address selection fails */ u_quad_t ip6s_sources_none; /* number of times that an address on the outgoing I/F is chosen */ - u_quad_t ip6s_sources_sameif[16]; + u_quad_t ip6s_sources_sameif[IP6S_SCOPECNT]; /* number of times that an address on a non-outgoing I/F is chosen */ - u_quad_t ip6s_sources_otherif[16]; + u_quad_t ip6s_sources_otherif[IP6S_SCOPECNT]; /* * number of times that an address that has the same scope * from the destination is chosen. */ - u_quad_t ip6s_sources_samescope[16]; + u_quad_t ip6s_sources_samescope[IP6S_SCOPECNT]; /* * number of times that an address that has a different scope * from the destination is chosen. */ - u_quad_t ip6s_sources_otherscope[16]; + u_quad_t ip6s_sources_otherscope[IP6S_SCOPECNT]; /* number of times that a deprecated address is chosen */ - u_quad_t ip6s_sources_deprecated[16]; + u_quad_t ip6s_sources_deprecated[IP6S_SCOPECNT]; /* number of times that each rule of source selection is applied. */ - u_quad_t ip6s_sources_rule[16]; + u_quad_t ip6s_sources_rule[IP6S_RULESMAX]; }; #ifdef _KERNEL Modified: stable/9/sys/netinet6/raw_ip6.c ============================================================================== --- stable/9/sys/netinet6/raw_ip6.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/raw_ip6.c Mon Apr 29 10:52:45 2013 (r250044) @@ -296,7 +296,7 @@ rip6_input(struct mbuf **mp, int *offp, if ((last != NULL) && ipsec6_in_reject(m, last)) { m_freem(m); V_ipsec6stat.in_polvio++; - V_ip6stat.ip6s_delivered--; + IP6STAT_DEC(ip6s_delivered); /* Do not inject data into pcb. */ INP_RUNLOCK(last); } else @@ -328,7 +328,7 @@ rip6_input(struct mbuf **mp, int *offp, ICMP6_PARAMPROB_NEXTHEADER, prvnxtp - mtod(m, char *)); } - V_ip6stat.ip6s_delivered--; + IP6STAT_DEC(ip6s_delivered); } return (IPPROTO_DONE); } Modified: stable/9/sys/netinet6/route6.c ============================================================================== --- stable/9/sys/netinet6/route6.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netinet6/route6.c Mon Apr 29 10:52:45 2013 (r250044) @@ -69,7 +69,7 @@ route6_input(struct mbuf **mp, int *offp if (ip6a) { /* XXX reject home-address option before rthdr */ if (ip6a->ip6a_flags & IP6A_SWAP) { - V_ip6stat.ip6s_badoptions++; + IP6STAT_INC(ip6s_badoptions); m_freem(m); return IPPROTO_DONE; } @@ -84,7 +84,7 @@ route6_input(struct mbuf **mp, int *offp ip6 = mtod(m, struct ip6_hdr *); IP6_EXTHDR_GET(rh, struct ip6_rthdr *, m, off, sizeof(*rh)); if (rh == NULL) { - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); return IPPROTO_DONE; } #endif @@ -100,7 +100,7 @@ route6_input(struct mbuf **mp, int *offp rhlen = (rh->ip6r_len + 1) << 3; break; /* Final dst. Just ignore the header. */ } - V_ip6stat.ip6s_badoptions++; + IP6STAT_INC(ip6s_badoptions); icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, (caddr_t)&rh->ip6r_type - (caddr_t)ip6); return (IPPROTO_DONE); Modified: stable/9/sys/netipsec/ipsec_input.c ============================================================================== --- stable/9/sys/netipsec/ipsec_input.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netipsec/ipsec_input.c Mon Apr 29 10:52:45 2013 (r250044) @@ -768,7 +768,7 @@ ipsec6_common_input_cb(struct mbuf *m, s nxt = nxt8; while (nxt != IPPROTO_DONE) { if (V_ip6_hdrnestlimit && (++nest > V_ip6_hdrnestlimit)) { - V_ip6stat.ip6s_toomanyhdr++; + IP6STAT_INC(ip6s_toomanyhdr); error = EINVAL; goto bad; } @@ -778,7 +778,7 @@ ipsec6_common_input_cb(struct mbuf *m, s * more sanity checks in header chain processing. */ if (m->m_pkthdr.len < skip) { - V_ip6stat.ip6s_tooshort++; + IP6STAT_INC(ip6s_tooshort); in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated); error = EINVAL; goto bad; Modified: stable/9/sys/netipsec/ipsec_output.c ============================================================================== --- stable/9/sys/netipsec/ipsec_output.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/sys/netipsec/ipsec_output.c Mon Apr 29 10:52:45 2013 (r250044) @@ -869,7 +869,7 @@ ipsec6_output_tunnel(struct ipsec_output rtalloc_ign_fib(state->ro, 0UL, M_GETFIB(m)); } if (state->ro->ro_rt == NULL) { - V_ip6stat.ip6s_noroute++; + IP6STAT_INC(ip6s_noroute); V_ipsec6stat.ips_out_noroute++; error = EHOSTUNREACH; goto bad; Modified: stable/9/usr.bin/netstat/inet6.c ============================================================================== --- stable/9/usr.bin/netstat/inet6.c Mon Apr 29 10:20:46 2013 (r250043) +++ stable/9/usr.bin/netstat/inet6.c Mon Apr 29 10:52:45 2013 (r250044) @@ -408,7 +408,7 @@ ip6_stats(u_long off, const char *name, p(ip6s_cantfrag, "\t%ju datagram%s that can't be fragmented\n"); p(ip6s_badscope, "\t%ju packet%s that violated scope rules\n"); p(ip6s_notmember, "\t%ju multicast packet%s which we don't join\n"); - for (first = 1, i = 0; i < 256; i++) + for (first = 1, i = 0; i < IP6S_HDRCNT; i++) if (ip6stat.ip6s_nxthist[i] != 0) { if (first) { printf("\tInput histogram:\n"); @@ -419,7 +419,7 @@ ip6_stats(u_long off, const char *name, } printf("\tMbuf statistics:\n"); printf("\t\t%ju one mbuf\n", (uintmax_t)ip6stat.ip6s_m1); - for (first = 1, i = 0; i < 32; i++) { + for (first = 1, i = 0; i < IP6S_M2MMAX; i++) { char ifbuf[IFNAMSIZ]; if (ip6stat.ip6s_m2m[i] != 0) { if (first) { @@ -445,7 +445,7 @@ ip6_stats(u_long off, const char *name, #define PRINT_SCOPESTAT(s,i) do {\ switch(i) { /* XXX hardcoding in each case */\ case 1:\ - p(s, "\t\t%ju node-local%s\n");\ + p(s, "\t\t%ju interface-local%s\n");\ break;\ case 2:\ p(s,"\t\t%ju link-local%s\n");\ @@ -464,7 +464,7 @@ ip6_stats(u_long off, const char *name, p(ip6s_sources_none, "\t%ju failure%s of source address selection\n"); - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_sameif[i]) { if (first) { printf("\tsource addresses on an outgoing I/F\n"); @@ -473,7 +473,7 @@ ip6_stats(u_long off, const char *name, PRINT_SCOPESTAT(ip6s_sources_sameif[i], i); } } - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_otherif[i]) { if (first) { printf("\tsource addresses on a non-outgoing I/F\n"); @@ -482,7 +482,7 @@ ip6_stats(u_long off, const char *name, PRINT_SCOPESTAT(ip6s_sources_otherif[i], i); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 11:35:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4369A745; Mon, 29 Apr 2013 11:35:53 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3453A1DD1; Mon, 29 Apr 2013 11:35:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TBZrcd080275; Mon, 29 Apr 2013 11:35:53 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TBZr5A080274; Mon, 29 Apr 2013 11:35:53 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304291135.r3TBZr5A080274@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 29 Apr 2013 11:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250045 - stable/9/tools/tools/umastat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 11:35:53 -0000 Author: pluknet Date: Mon Apr 29 11:35:52 2013 New Revision: 250045 URL: http://svnweb.freebsd.org/changeset/base/250045 Log: Fix build. - pass a format string to printf - catch up with constifying uz_name Modified: stable/9/tools/tools/umastat/umastat.c Directory Properties: stable/9/tools/tools/umastat/ (props changed) Modified: stable/9/tools/tools/umastat/umastat.c ============================================================================== --- stable/9/tools/tools/umastat/umastat.c Mon Apr 29 10:52:45 2013 (r250044) +++ stable/9/tools/tools/umastat/umastat.c Mon Apr 29 11:35:52 2013 (r250045) @@ -79,7 +79,7 @@ kread(kvm_t *kvm, void *kvm_pointer, voi } static int -kread_string(kvm_t *kvm, void *kvm_pointer, char *buffer, int buflen) +kread_string(kvm_t *kvm, const void *kvm_pointer, char *buffer, int buflen) { ssize_t ret; int i; @@ -151,7 +151,7 @@ uma_print_keg_flags(struct uma_keg *ukp, if (ukp->uk_flags & flaginfo[i].fi_flag) { if (count++ > 0) printf(" | "); - printf(flaginfo[i].fi_name); + printf("%s", flaginfo[i].fi_name); } } From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 11:36:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4A5498B7; Mon, 29 Apr 2013 11:36:23 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B7C01DD9; Mon, 29 Apr 2013 11:36:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TBaNqH080420; Mon, 29 Apr 2013 11:36:23 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TBaNKC080419; Mon, 29 Apr 2013 11:36:23 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304291136.r3TBaNKC080419@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 29 Apr 2013 11:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250046 - stable/8/tools/tools/umastat X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 11:36:23 -0000 Author: pluknet Date: Mon Apr 29 11:36:22 2013 New Revision: 250046 URL: http://svnweb.freebsd.org/changeset/base/250046 Log: Fix build. - pass a format string to printf - catch up with constifying uz_name Modified: stable/8/tools/tools/umastat/umastat.c Directory Properties: stable/8/tools/tools/umastat/ (props changed) Modified: stable/8/tools/tools/umastat/umastat.c ============================================================================== --- stable/8/tools/tools/umastat/umastat.c Mon Apr 29 11:35:52 2013 (r250045) +++ stable/8/tools/tools/umastat/umastat.c Mon Apr 29 11:36:22 2013 (r250046) @@ -79,7 +79,7 @@ kread(kvm_t *kvm, void *kvm_pointer, voi } static int -kread_string(kvm_t *kvm, void *kvm_pointer, char *buffer, int buflen) +kread_string(kvm_t *kvm, const void *kvm_pointer, char *buffer, int buflen) { ssize_t ret; int i; @@ -151,7 +151,7 @@ uma_print_keg_flags(struct uma_keg *ukp, if (ukp->uk_flags & flaginfo[i].fi_flag) { if (count++ > 0) printf(" | "); - printf(flaginfo[i].fi_name); + printf("%s", flaginfo[i].fi_name); } } From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 11:36:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 998E2ADB; Mon, 29 Apr 2013 11:36:59 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BD131DF4; Mon, 29 Apr 2013 11:36:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TBaxoJ080562; Mon, 29 Apr 2013 11:36:59 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TBaxg6080561; Mon, 29 Apr 2013 11:36:59 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304291136.r3TBaxg6080561@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 29 Apr 2013 11:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r250047 - stable/7/tools/tools/umastat X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 11:36:59 -0000 Author: pluknet Date: Mon Apr 29 11:36:59 2013 New Revision: 250047 URL: http://svnweb.freebsd.org/changeset/base/250047 Log: Fix build. - pass a format string to printf - catch up with constifying uz_name Modified: stable/7/tools/tools/umastat/umastat.c Directory Properties: stable/7/tools/tools/umastat/ (props changed) Modified: stable/7/tools/tools/umastat/umastat.c ============================================================================== --- stable/7/tools/tools/umastat/umastat.c Mon Apr 29 11:36:22 2013 (r250046) +++ stable/7/tools/tools/umastat/umastat.c Mon Apr 29 11:36:59 2013 (r250047) @@ -79,7 +79,7 @@ kread(kvm_t *kvm, void *kvm_pointer, voi } static int -kread_string(kvm_t *kvm, void *kvm_pointer, char *buffer, int buflen) +kread_string(kvm_t *kvm, const void *kvm_pointer, char *buffer, int buflen) { ssize_t ret; int i; @@ -151,7 +151,7 @@ uma_print_keg_flags(struct uma_keg *ukp, if (ukp->uk_flags & flaginfo[i].fi_flag) { if (count++ > 0) printf(" | "); - printf(flaginfo[i].fi_name); + printf("%s", flaginfo[i].fi_name); } } From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 13:10:43 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C911DF8C; Mon, 29 Apr 2013 13:10:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5201397; Mon, 29 Apr 2013 13:10:43 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id A2FC2121426; Mon, 29 Apr 2013 22:43:32 +1000 (EST) Date: Mon, 29 Apr 2013 22:43:28 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r250037 - head/bin/hostname In-Reply-To: <201304282252.r3SMqiHH009205@svn.freebsd.org> Message-ID: <20130429212227.R1043@besplex.bde.org> References: <201304282252.r3SMqiHH009205@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.0 cv=Tre+H0rh c=1 sm=1 a=HGXDrXWPGKwA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=S8Dq8nDLOMQA:10 a=L-e4rMQgvTWKUpiW9zgA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 13:10:43 -0000 On Sun, 28 Apr 2013, Eitan Adler wrote: > Log: > Mark usage() __dead2 This just adds a style bug. > Modified: head/bin/hostname/hostname.c > ============================================================================== > --- head/bin/hostname/hostname.c Sun Apr 28 22:12:40 2013 (r250036) > +++ head/bin/hostname/hostname.c Sun Apr 28 22:52:43 2013 (r250037) > @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -static void usage(void); > +static void usage(void) __dead2; Static functions should never be marked __dead2. The purpose of the markup is to inform the compiler that the function doesn't return. But for static functions, the compiler can see this for itself, at least with -funit-at-a-time in CFLAGS. (-funit-at-a-time is not required (doesn't exist) in C standards, but is now the default. Compilers even use it to look to closely at static functions and automatically inline them even when they are declared after they are used, as is common for usage(), provided they are only used once and -fno-inline-functions-called-once is not used. This mainly breaks debugging and profiling of non-inline functions. The breakage is largest for clang, collaterally with the bug that clang doesn't support either of these flags, so it seems to have no way to turn off this excessive inlining.) The style bug is missing in the example of using usage() in style(9). This style bug is missing in about 259 out of 284 declarations of static void usage(void) in /usr/src/*bin (.c files). Except: - bin/pkill/pkill.c has it in a worse form, with __dead2 hard-coded using __attribute(()) - usr.bin/rlogin/rlogin.c has it in a gratuitously different form, as 'static _Noreturn void usage(void);'. This is bogus since _Noreturn is a wrapper for a new C++ feature, but rlogin is an old C application; for C, it is defined as __dead2, but it isn't clear that it does the same as a normal use of __dead2 since it is used in a syntactically different way. __dead2 only exist because this syntax, which was used for the old __dead (== volatile return type instead of __attribute((__noreturn__))) didn't work. Apparently the syntax of __attribute__() has become less strict, so the more natural (old) syntax works again, and the use of the old syntax here is just a style bug and not a syntax error. I counted these style bugs by grepping for "static.*usage" (318 lines) and then filtering out most that didn't match the normal usage of usage(). There are too many gratuitous differences like taking a 'char *' arg or returning an int. Another popular style bug is a gnu-style declaration with a space after the function name. One declaration is even missing the arg type, so it isn't a prototype. Not all instances of the __dead[2] style bug are new. In 4.4BSD-Lite2, there were 17 instances of __dead in /usr/src/*bin. Only 4 of these were on static functions. Only 2 of them were on usage(), and usage() wasn't declared static in these 2. These 2 were rlogin and mount_nfs. The bug in rlogin persists in a worse form, and the bug in mount_nfs was cloned to many other mount utilities. In FreeBSD-~5.2, there were 43 instances of __dead2 in /usr/src/*bin. 30 of these were on static functions. 22 of these were on usage(). Almost half of these 22 were in mount utilities. Further statistics for -current in /usr/src/*bin: - 60 instances of __dead2 - 57 of these on static functions - at least 26 of these on static.*usage.* - some false/misleading hits for the sloppy patterns: - 1 nonsense declaration in echo/echo.c. __dead2 is placed on the function definition of errexit(), where it ican have no effect except possibly to cause a warning when the function does return. The function actually ends with exit(), so the compiler can see that it doesn't return. There is no forward prototype for this function, but it is placed before it is used, so the compiler can see that it doesn't return even without -funit-at-a-time. - same nonsense declaration in sh/arith_yacc.c:yyerror(). It returns with error() instad of exit(), so its non-returningness is given by __dead2 on error(). - same nonsense declaration in killall/killall.c:usage(). usage() is unsorted at the beginning of the file, so it doesn't need the usual forward prototype, but it has the __dead2 declaration which is not even needed for the prototype. - i2c/i2c.c:usage(). Like killall, except the unsorting is not so close to the beginning of the file. - gbde/gbde.c:usage(). Like i2c. - hastd/primary.c. Like sh (3 functions). - hastctl/hastctl.c. Like i2c. These false hits were only harder to understand because the function definitions are formatted normally, so the function name isn't on the same line as __dead2 so grepping with simple patterns doesn't show what it is. The syntax for all the nonsense declarations is 'static __dead2 \n'. This would have been a syntax error for the original implementation of __dead2. __dead2 is named as it is (with '2' meaning gcc version2 instead of 1) because simply changing the definition of __dead wouldn't have worked due to syntactical problems. The above statistics are all for .c files. __dead2 is used a further 28 times in .h files in /usr/src/*bin in -current. Now all the uses are hopefully useful. But there aren't enough of them to make much difference. System headers are hopefully more careful about this. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 14:50:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B4188135; Mon, 29 Apr 2013 14:50:07 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-ve0-x22a.google.com (mail-ve0-x22a.google.com [IPv6:2607:f8b0:400c:c01::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 4278A1910; Mon, 29 Apr 2013 14:50:07 +0000 (UTC) Received: by mail-ve0-f170.google.com with SMTP id 15so3117206vea.15 for ; Mon, 29 Apr 2013 07:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=OfPyEZK7mm6QI9BBIy4/Y2X3LpPG8C6C9yOP1sLlrEM=; b=V0b6ZB3Ec+qXShPFsOkd2AE2NjqMSuMwwPgx0m41/BExKobS+qNoLaD3h6klqqOGEj Qq2Cslz9+BFN5Dj0HszPpHK+MJpuNosbNxQRYHVtoL4KccIB47uqI2hGr2a9prJWg8v9 bPZNzSPnjZnzNKi/6eVyCitu/l1aDGk9TL11DslTxomgvOE0J13t+cyBrs/nZUGtTqKk kud1HscJ0FK5OMQutFVNXsz6vxZyCTooU0BJhzt7QwC32ncYXYUxBHeuZgNKVZiZpblF ZA+C79NRb6IWhcenAB80cC4iSAy3ZkOSYWlFCoIVbqe0kWndUDIVs4M0nuiNnhP4YEdQ QRaA== MIME-Version: 1.0 X-Received: by 10.52.25.40 with SMTP id z8mr2505636vdf.7.1367247006856; Mon, 29 Apr 2013 07:50:06 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.221.10.69 with HTTP; Mon, 29 Apr 2013 07:50:06 -0700 (PDT) In-Reply-To: <20130429212227.R1043@besplex.bde.org> References: <201304282252.r3SMqiHH009205@svn.freebsd.org> <20130429212227.R1043@besplex.bde.org> Date: Mon, 29 Apr 2013 16:50:06 +0200 X-Google-Sender-Auth: 3OF8JXFfBI8914SpnbFljOfw52E Message-ID: Subject: Re: svn commit: r250037 - head/bin/hostname From: Ed Schouten To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 14:50:07 -0000 Hi Bruce, 2013/4/29 Bruce Evans : > - usr.bin/rlogin/rlogin.c has it in a gratuitously different form, as > 'static _Noreturn void usage(void);'. This is bogus since > _Noreturn is a wrapper for a new C++ feature I hate to correct you here, but _Noreturn is not a wrapper for a new C++ feature, it's a keyword that's part of C11. See: http://en.wikipedia.org/wiki/C11_(C_standard_revision)#Changes_from_C99 All C11 keywords can be implemented on top of GCC-specific constructs, with the exception of _Generic. I would strongly prefer it if we used these keywords over our FreeBSD-specific solutions. If the only objection is the spelling of these keywords (underscores, uppercase, etc), be sure to: #include /* For alignas/alignof. */ #include /* For noreturn. */ #include /* For thread_local. */ -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 15:58:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC24C5C9; Mon, 29 Apr 2013 15:58:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DEF0B1DAD; Mon, 29 Apr 2013 15:58:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TFw4nT072926; Mon, 29 Apr 2013 15:58:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TFw4ge072925; Mon, 29 Apr 2013 15:58:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304291558.r3TFw4ge072925@svn.freebsd.org> From: Eitan Adler Date: Mon, 29 Apr 2013 15:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250048 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 15:58:05 -0000 Author: eadler Date: Mon Apr 29 15:58:04 2013 New Revision: 250048 URL: http://svnweb.freebsd.org/changeset/base/250048 Log: A transition period of more than two years is more than enough: Remove the compatibility code added in 2011-02-10. This change is not intended for MFC Reviewed by: imp Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Apr 29 11:36:59 2013 (r250047) +++ head/Makefile.inc1 Mon Apr 29 15:58:04 2013 (r250048) @@ -41,13 +41,6 @@ # /usr/share/mk. These include: # obj depend all install clean cleandepend cleanobj -# You are supposed to define both of these when calling Makefile.inc1 -# directly. However, some old scripts don't. Cope for the moment, but -# issue a new warning for a transition period. -.if defined(TARGET) && !defined(TARGET_ARCH) -.warning "You must pass both TARGET and TARGET_ARCH to Makefile.inc1. Setting TARGET_ARCH=${TARGET}." -TARGET_ARCH=${TARGET} -.endif .if !defined(TARGET) || !defined(TARGET_ARCH) .error "Both TARGET and TARGET_ARCH must be defined." .endif From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 16:13:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 107E9B44; Mon, 29 Apr 2013 16:13:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id DE2D01E45; Mon, 29 Apr 2013 16:13:39 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D0312B917; Mon, 29 Apr 2013 12:13:32 -0400 (EDT) From: John Baldwin To: hiren panchasara Subject: Re: svn commit: r249800 - head/sys/dev/bwn Date: Mon, 29 Apr 2013 11:23:41 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201304231302.r3ND2w5V024981@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201304291123.41402.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 29 Apr 2013 12:13:32 -0400 (EDT) Cc: svn-src-head , Adrian Chadd , src-committers , Eitan Adler , svn-src-all X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:13:40 -0000 On Sunday, April 28, 2013 8:06:16 pm hiren panchasara wrote: > On Tue, Apr 23, 2013 at 9:46 AM, hiren panchasara wrote: > > On Tue, Apr 23, 2013 at 9:34 AM, Eitan Adler wrote: > >> On 23 April 2013 12:19, Adrian Chadd wrote: > >>> ... you know, even though it doesn't have an active maintainer, do you > >>> have test hardware, and why didn't you just bounce a patch to > >>> -wireless for review? > > > > My bad. I proposed this change initially. > >>> > >>> We don't bite you know! > >> > >> that you need to emphasize this does not comfort me. ;) > >> > >> reverted in 249812. > > > > Will look at john's suggestions and fix it correctly. > > John, > > Does this look okay? > > % svn diff > Index: if_bwn.c > =================================================================== > --- if_bwn.c (revision 250036) > +++ if_bwn.c (working copy) > @@ -9240,9 +9240,9 @@ > BUS_DMASYNC_PREWRITE); > > /* > - * Setup RX buf descriptor > + * Restore RX buf descriptor > */ > - dr->setdesc(dr, desc, paddr, meta->mt_m->m_len - > + dr->setdesc(dr, desc, meta->mt_paddr, meta->mt_m->m_len - > sizeof(*hdr), 0, 0, 0); > return (error); > } I would leave the comment alone. In the common case you do allocate a new mbuf so you aren't restoring the descriptor but setting it up with a new address. The code change looks correct. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 16:19:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E4E26D66; Mon, 29 Apr 2013 16:19:12 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) by mx1.freebsd.org (Postfix) with ESMTP id AFA6B1E7B; Mon, 29 Apr 2013 16:19:11 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id hm14so2956995wib.5 for ; Mon, 29 Apr 2013 09:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=I8Ds3v/llIXlNhzM6734dyXukMNv3G4VlLPiagD+Sqs=; b=tkijf8cN+jnW+O9cK54VwNdLMANkQNpsCZ70e8mI72bQ2bObSWhJU+U9XB7GdMbNP9 Wd57d6VFcllFW9iFdoOst0/smQV0ed9s/Ui4IC7bz0VPeaHSBcO2n8BHDuRQ9FBQC7HT OJTQ4kxxPTG8x6044XMWDBRc7xhB36a2cVB7wueV9hu1OCdtCK9SZXuf5kBNjWhEbDxo bdXNZuTE6H51sG9Qs/3QTN0dNXesGcC0fQ/PcrwwNDZRnRMtvMRtHIb20X29yxb+q+lr sm3LgSdrCw6dK432xvUQfZ0zRRDGH4jGoDvkaMVn6xsfoTCKuGpKKKaZE5z34A05m5+K 1ddw== MIME-Version: 1.0 X-Received: by 10.180.89.140 with SMTP id bo12mr1699154wib.22.1367252350884; Mon, 29 Apr 2013 09:19:10 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Mon, 29 Apr 2013 09:19:10 -0700 (PDT) In-Reply-To: <201304291123.41402.jhb@freebsd.org> References: <201304231302.r3ND2w5V024981@svn.freebsd.org> <201304291123.41402.jhb@freebsd.org> Date: Mon, 29 Apr 2013 09:19:10 -0700 X-Google-Sender-Auth: UyFBBmv_Ooyqj-ru8AVAj2pZiZk Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head , Eitan Adler , svn-src-all , src-committers , hiren panchasara X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:19:13 -0000 On 29 April 2013 08:23, John Baldwin wrote: >> - dr->setdesc(dr, desc, paddr, meta->mt_m->m_len - >> + dr->setdesc(dr, desc, meta->mt_paddr, meta->mt_m->m_len - >> sizeof(*hdr), 0, 0, 0); >> return (error); >> } > > I would leave the comment alone. In the common case you do allocate a new > mbuf so you aren't restoring the descriptor but setting it up with a new > address. The code change looks correct. Does anyone here have bwn hardware that works? Adrian From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 16:44:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C9F6E3E8; Mon, 29 Apr 2013 16:44:06 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ee0-f47.google.com (mail-ee0-f47.google.com [74.125.83.47]) by mx1.freebsd.org (Postfix) with ESMTP id 612D91F6B; Mon, 29 Apr 2013 16:44:05 +0000 (UTC) Received: by mail-ee0-f47.google.com with SMTP id b57so2706590eek.20 for ; Mon, 29 Apr 2013 09:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=S8XiHZM4iCAAep0KgWL2zW8SaKjgmQUEGZf31E8oCPo=; b=J5GXfNYlA7eR/AzmQJuO74WnYoosgNZUhPjkcIbSv7+bXkX4LY4dBHxKK1eRPtAmHA D5QRP9D2YfacBVzXVSY8P+uKNELoVNb1YQuT6R57VtbmbWS+4jXOFvQNjg7E0VT4nvRQ /Wczo89BgcV+f+iam2fkskJvbPMzTe2ELuoZROS0fZLWuSrgB2RfhsyxMkjJW1DCrg7x KRAokhRhgEINPLzL5Mq1EvSUmmGk3ggd16RhB8be/bfSQLyOa1UXyA7W/OsHQNkeiZxB Mdg6KNQNV7FKNJ9VZwBtJurXp4bMzHRftVRLD2T5yoUlmzv/+MaBDg4gq3fG731FNINo uQcg== MIME-Version: 1.0 X-Received: by 10.15.27.195 with SMTP id p43mr124194688eeu.8.1367253844359; Mon, 29 Apr 2013 09:44:04 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.14.204.200 with HTTP; Mon, 29 Apr 2013 09:44:04 -0700 (PDT) In-Reply-To: References: <201304231302.r3ND2w5V024981@svn.freebsd.org> <201304291123.41402.jhb@freebsd.org> Date: Mon, 29 Apr 2013 09:44:04 -0700 X-Google-Sender-Auth: adph2r6gHC0ONIGeDCu_lP9EvJQ Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: hiren panchasara To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , src-committers , Eitan Adler , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:44:06 -0000 On Mon, Apr 29, 2013 at 9:19 AM, Adrian Chadd wrote: > On 29 April 2013 08:23, John Baldwin wrote: >>> - dr->setdesc(dr, desc, paddr, meta->mt_m->m_len - >>> + dr->setdesc(dr, desc, meta->mt_paddr, meta->mt_m->m_len - >>> sizeof(*hdr), 0, 0, 0); >>> return (error); >>> } >> >> I would leave the comment alone. In the common case you do allocate a new >> mbuf so you aren't restoring the descriptor but setting it up with a new >> address. The code change looks correct. Alright. Thanks John. > > Does anyone here have bwn hardware that works? I do not. Hiren > > > > Adrian From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 16:46:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C5B2D595; Mon, 29 Apr 2013 16:46:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 09D6A1F80; Mon, 29 Apr 2013 16:46:14 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 8DEEB421360; Tue, 30 Apr 2013 02:22:02 +1000 (EST) Date: Tue, 30 Apr 2013 02:22:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten Subject: Re: svn commit: r250037 - head/bin/hostname In-Reply-To: Message-ID: <20130430013949.O1819@besplex.bde.org> References: <201304282252.r3SMqiHH009205@svn.freebsd.org> <20130429212227.R1043@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Gu4aYTJC c=1 sm=1 a=HGXDrXWPGKwA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=S8Dq8nDLOMQA:10 a=ElF3g5Y_1pXU53sFaFAA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:46:14 -0000 On Mon, 29 Apr 2013, Ed Schouten wrote: > 2013/4/29 Bruce Evans : >> - usr.bin/rlogin/rlogin.c has it in a gratuitously different form, as >> 'static _Noreturn void usage(void);'. This is bogus since >> _Noreturn is a wrapper for a new C++ feature > > I hate to correct you here, but _Noreturn is not a wrapper for a new > C++ feature, it's a keyword that's part of C11. See: Yes, I misread the ifdef in sys/cdefs.h. So it is a new C feature as well as a new C++ feature. > All C11 keywords can be implemented on top of GCC-specific constructs, > with the exception of _Generic. I would strongly prefer it if we used > these keywords over our FreeBSD-specific solutions. That would mainly churn the source code, and still depend for portability on FreeBSD #defining them in sys/cdefs.h. Just with different spelling. > If the only objection is the spelling of these keywords (underscores, > uppercase, etc), be sure to: > > #include /* For alignas/alignof. */ > #include /* For noreturn. */ > #include /* For thread_local. */ Ideally, new code would just use the new features. Then it would need includes to get the nicer spelling and not depend on FreeBSD features. But it is easier to use the FreeBSD features. I once hoped that the portability hacks in sys/cdefs.h (that is, the whole file) would go away when C became standard. Instead, it grew many more. It is now 7 times larger and many more than 7 times more convoluted than in FreeBSD-1. In FreeBSD-1, it only defined the following macros: __BEGIN_DECLS, __CONCAT(), __END_DECLS, __P(), __STRING(), __dead, __pure, const, inline, signed, volatile where only the last 4 are for corrupting Standard C keywords. `noreturn' (case-insensitive) is now used 9 times in /usr/src/*bin (.c files): - 4 times for hard-coded __attribute__(()) - 3 times in rlogin.c for _Noreturn. I already pointed out some of the syntax problems with these. They are unportable since they give syntax errors with some versions of gcc, while either __dead or __dead2 would not have these syntax errors when correctly placed. I don't know if the C11 keyword can be placed almost anywhere like the attribute can be now. If not, then it would be impossible to replace all the __dead2's by it without changing the syntax, and then it would give syntax errors for the old compilers. - 2 times for NORETURN comments after usage() in fstat. These are just garbage. They are because lint is too stupid to understand __dead2 or _Noreturn, so it needs a comment to tell it that usage() doesn't return. But the comment for this is NOTREACHED, not NORETURN. NORETURN also misdescribes the situtation for human readers, since it is usage() that doesn't return and the code after it that is not reached. I dislike even correct lint comments. Telling the compiler than functions don't return has worked better than telling lint this for more than 20 years. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 16:58:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D12A0839; Mon, 29 Apr 2013 16:58:22 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3EDA1FFD; Mon, 29 Apr 2013 16:58:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TGwMZm094558; Mon, 29 Apr 2013 16:58:22 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TGwMPe094557; Mon, 29 Apr 2013 16:58:22 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304291658.r3TGwMPe094557@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 29 Apr 2013 16:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250049 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:58:22 -0000 Author: luigi Date: Mon Apr 29 16:58:21 2013 New Revision: 250049 URL: http://svnweb.freebsd.org/changeset/base/250049 Log: explicitly mark some variables as const Modified: head/sys/dev/netmap/ixgbe_netmap.h Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Mon Apr 29 15:58:04 2013 (r250048) +++ head/sys/dev/netmap/ixgbe_netmap.h Mon Apr 29 16:58:21 2013 (r250049) @@ -226,7 +226,8 @@ ixgbe_netmap_txsync(struct ifnet *ifp, u struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, k = ring->cur, l, n = 0, lim = kring->nkr_num_slots - 1; + u_int j, l, n = 0; + u_int const k = ring->cur, lim = kring->nkr_num_slots - 1; /* * ixgbe can generate an interrupt on every tx packet, but it @@ -393,11 +394,10 @@ ring_reset: if (ix_use_dd) { struct ixgbe_legacy_tx_desc *txd = (struct ixgbe_legacy_tx_desc *)txr->tx_base; - + u_int k1 = netmap_idx_k2n(kring, kring->nr_hwcur); l = txr->next_to_clean; - k = netmap_idx_k2n(kring, kring->nr_hwcur); delta = 0; - while (l != k && + while (l != k1 && txd[l].upper.fields.status & IXGBE_TXD_STAT_DD) { delta++; l = (l == lim) ? 0 : l + 1; From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 16:59:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 73C0C9E8; Mon, 29 Apr 2013 16:59:31 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id CF638100D; Mon, 29 Apr 2013 16:59:30 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 936DC1203CB; Mon, 29 Apr 2013 18:59:14 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 6E23028493; Mon, 29 Apr 2013 18:59:14 +0200 (CEST) Date: Mon, 29 Apr 2013 18:59:14 +0200 From: Jilles Tjoelker To: Bruce Evans Subject: Re: svn commit: r249859 - head/lib/libc/sys Message-ID: <20130429165914.GA78757@stack.nl> References: <201304242124.r3OLOZW5034818@svn.freebsd.org> <20130425204458.F1034@besplex.bde.org> <20130426155933.GA24412@stack.nl> <20130427030857.L2680@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130427030857.L2680@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:59:31 -0000 On Sat, Apr 27, 2013 at 04:36:56AM +1000, Bruce Evans wrote: > On Fri, 26 Apr 2013, Jilles Tjoelker wrote: > > On Thu, Apr 25, 2013 at 09:56:01PM +1000, Bruce Evans wrote: > >> On Wed, 24 Apr 2013, Jilles Tjoelker wrote: > >>> Log: > >>> getdtablesize(2): Describe what this function actually does. > >>> ... > >>> .Sh NAME > >>> .Nm getdtablesize > >>> -.Nd get descriptor table size > >>> +.Nd get file descriptor limit > >> Now its name doesn't match its description, and the reason for this is > >> not documented. > > This seems to be the case on most systems that have this function. > No reason not to document it. I can do it if you provide text. > >> This function is almost obsolete. In POSIX, it is spelled {OPEN_MAX} > >> or sysconf(__SC_OPEN_MAX). It is sometimes misspelled OPEN_MAX. > > There is a difference between sysconf(_SC_OPEN_MAX) and getdtablesize(): > > the latter also takes maxfilesperproc and rctl(8) rules into account. > Yes, only sysconf(_SC_OPEN_MAX) (and getrlimit(..., RLIMIT_NOFILE)) are > broken. > I'm not familiar with rctl. It seems to break this some more: in > kern_descrip.c, all the places that use the rlimit clamp it to > maxfileperproc, so the effective rlimit is always the clamped value > and this is what sysconf() and getrlimit() should return too. Now > for rctl, only 1 of these places (namely getdtablesize()) clamps it > further to the RACCT_NOFILE limit. Other places include do_dup(). > do_dup() checks the RACCT_NOFILE much later. I think this gives the > same limit, but at least the errno when the limit RACCT_NOFILE limit > is exceeded but the others aren't is wrong in all cases. (The early > errno for (new >= maxfd) is (flags & DUP_FCNTL ? EINVAL : EBADF). > The later errno for racct_set(... RACCT_NOFILE, new + 1) is always > EMFILE. EMFILE is not even a possible errno for dup2(). Hmm, if we return [EBADF] there, we should also change sysconf(_SC_OPEN_MAX) to return getdtablesize() instead of the soft rlimit. > >> I prepared to remove the broken definition of OPEN_MAX, but never committed > >> the final step. /usr/src has very few misuses of OPEN_MAX now, so removing > >> the definition wouldn't be too hard. Most uses are in compatibility > >> cruft. E.g., the following from > >> crypto/openssh/openbsd-compat/bsd-closefrom.c > >> which is confused about related things: > >> [snip] > > If that code is compiled at all, it is a bug. We have closefrom() and > > OpenSSH should use it. > It almost certainly uses it. However, a quick grep for getdtablesize() > shows many applications using it, and most of them use it to give the > top of a close() loop. These should be converted to use something > like closefrom(). getdtablesize() is used much more than sysconf() > or getrlimit() for this. This is done mostly in old BSD applications. > However, the worst uses that I noticed are in the relatively new ppp > application. There are about 40 calls to getdtablesize() in /usr/src. > 7 of these are in ppp. 1 of the 7 is for the close() loop. 4 of the > 7 are for fcntl(... F_SETFD ...) loops. The other 2 are for a home > made FD_SETSIZE and a home made FD_ZERO(). These essentially initialize > FD_SETSIZE to the variable getdtablesize(). A table of bits of that > size is allocated. A table of bits of that size is cleared. Since > getdtablesize() is variable, buffer overruns and underruns occur if > someone changes getdtablesize() while the process is running (it can > be changed by the maxfileperproc sysctl and now by rctl). But the > huge table is not always passed to select() (its size doesn't seem to > be recorded anywhere, so it can also be overrun or underrun by > FD_SET() on it, where the fd for FD_SET is acquired before or after > getdtablesize() changes). Much of this is in uncommonly used code that is hard to test :( A getdtablesize()/close() loop is not so bad because it is exactly equivalent to closefrom() (modulo bugs in the former) but the fcntl(F_SETFD, 1) loops are harder. There are also various copies of popen in the tree (often slightly modified) that create an array of getdtablesize() elements to track popened file descriptors. This is safe as long as getdtablesize() does not increase while the process is running, but also wasteful. > >> ... in 4.4BSD and FreeBSD, both sysconf(_SC_OPEN_MAX) are just wrappers for > >> the resource limit (sysconf() is a libc wrapper and getdtablesize() is > >> a syscall wrapper). Actually, in FreeBSD, getdtablesize() is not even the > >> rlmint -- it is the min() of the rlimit and the global sysctl integer > >> maxfilesperproc. Here the bug is in the rlimit. For the rlimit, > >> maxfilesperproc is only used when the rlimit is set and when it is used > >> in the kernel. But when the rlimit is returned to userland, via > >> getrlimit(), maxfilesperproc is not used, so the rlimit may be wrong if > >> maxfileperproc was lowered after setting the rlimit. > > I don't like the idea of rlimits changing of "their own will". Changing > > maxfileperproc at run time is going to be a bit nasty in any case but > > seems not as bad as changing rlimits of running processes. > I don't like this either. maxfileperproc wouldn't exist if my axe was > sharper in 1995 when it was committed. rctl is less hackish, but causes > similar problems. > Anyway, since the effective limit does change, getrlimit() should keep up > with the change like getdtablesize() does. Otherwise processes can't tell > what the rlimit actually is, or needs to know that getdtablesize() must > be used instead of getrlimit() to determine the actual limit. I don't think getrlimit() is intended to allow programs to determine an actual limit. There may be other limits than the setrlimit(). > maxfileperproc and the rctl limit are only needed to prevent growth > of the table. Once a large table has been allocated, it is not useful > to prevent dup2() from using a large fd for which space has already > been allocated. But the clamps to maxfileperproc prevent this. Maybe > the clamps to the rctl limit don't prevent this, since they are applied > later and only cause failure if the allocation fails. But then since > they are applied at the same time in getdtablesize(), they prevent > applications from knowing the actual limit in another way. I think this > is now further complicated by sparse tables. Only preventing growth of the table would still allow a process to consume more of kern.maxfiles than is supposed to be possible. > >> Actually, {OPEN_MAX} is guaranteed by POSIX to be at least > >> {_POSIX_OPEN_MAX}, and {_POSIX_OPEN_MAX} is precisely 20. But these > >> guarantees and similar ones for stdio's FOPEN_MAX have always been > >> broken in FreeBSD, since anyone can reduce the rlimit below 20. > >> ... > > Recent versions of POSIX allow {OPEN_MAX} to be based on the rlimit. In > > that case, it may change when the rlimit is changed. > I think this is more or less required (and implicit before). But how > can anything work if it there is no API like closefrom() and there is > no way to determine the maximum open fd. getdtablesize() would be > more useful if it actually returned the table size. Then its old use > of closing all files up to the table size (less 1) would keep working > OK iff the table size is small. Of course, the table must remain large > enough to keep holding the maximum open fd. If getdtablesize() did that, > then it would match its name again. But it hasn't matched since 386BSD > or earlier -- in FreeBSD-1, it returned essentially the same as now: > (just the rlimit, so it doesn't cover the maximum open fd if anyone > reduces the rlimit). Various uses of getdtablesize() are indeed for the limit, and trying to imitate closefrom() is an incorrect and slow use of getdtablesize(). A closefrom() API was explicitly rejected for POSIX in http://www.austingroupbugs.net/view.php?id=149 because closing arbitrary file descriptors could render the application non-conforming (for example, tracing might be implemented using a file descriptor, or if fexecve() is used on an interpreted (#!) file). Instead, it was suggested to allow making all new file descriptors close-on-exec and to require standard functions to make all internal file descriptors close-on-exec. Some of this is already implemented, see https://wiki.freebsd.org/AtomicCloseOnExec . > >>> The > >>> .Fn getdtablesize > >>> -system call returns the size of this table. > >>> +system call returns the maximum number of file descriptors > >>> +that the current process may open. > >> Actually, the process may open more than this number, after raising its > >> (soft) rlimit, if this is possible. > > True, but this requires different function calls than just ones > > allocating file descriptors. > Not too bad if the rlimit can only be changed by the process itself, but > I'd still like this to be documented explicitly. > POSIX doesn't have the complications of maxfileperproc or rctl. These > are harder to document. About all you can say is that the results returned > by getdtablesize(), getrlimit() and sysconf() are volatile so that they > become unusable before they can be used :-(. > >>> +.Xr closefrom 2 , > >>> .Xr dup 2 , > >>> -.Xr open 2 , > >>> -.Xr select 2 > >>> +.Xr getrlimit 2 , > >>> +.Xr sysconf 2 > >>> .Sh HISTORY > >>> The > >>> .Fn getdtablesize > > I suppose rctl(8) can be added here. > dup(2) needs similar changes (I didn't notice if you changed it > recently). It says that `oldd' must be < getdtablesize(), but actually, > `oldd' must just be open. It doesn't say that `newd' must be < > getdtablesize() (modulo complications for the rctl case), except > indirectly in the ERRORS section, it says that EBADF occurs when `newd' > exceeds the maximum allowable descriptor number. Here "allowable" has > a wrong tense ("allowed" would make more sense), and what this maximum > is is not described. POSIX uses better wording for this of course > ("... when `fildes' is greater than or equal to {OPEN_MAX}"). This > would be better still with "greater than or equal" spelled ">=". Probably. To be looked at later. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 17:00:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8C371BE6; Mon, 29 Apr 2013 17:00:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA301023; Mon, 29 Apr 2013 17:00:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TH0QD8095274; Mon, 29 Apr 2013 17:00:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TH0Q7X095272; Mon, 29 Apr 2013 17:00:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304291700.r3TH0Q7X095272@svn.freebsd.org> From: Xin LI Date: Mon, 29 Apr 2013 17:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250050 - head/sys/dev/hptiop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 17:00:26 -0000 Author: delphij Date: Mon Apr 29 17:00:26 2013 New Revision: 250050 URL: http://svnweb.freebsd.org/changeset/base/250050 Log: Add missing braces. Submitted by: Sascha Wildner Obtained from: DragonFly MFC after: 1 week Modified: head/sys/dev/hptiop/hptiop.c Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Mon Apr 29 16:58:21 2013 (r250049) +++ head/sys/dev/hptiop/hptiop.c Mon Apr 29 17:00:26 2013 (r250050) @@ -1704,10 +1704,11 @@ static int hptiop_internal_memalloc_mvfr hba->u.mvfrey.internal_mem_size, hptiop_mvfrey_map_ctlcfg, hba, 0)) { device_printf(hba->pcidev, "bus_dmamap_load failed!\n"); - if (hba->ctlcfg_dmat) + if (hba->ctlcfg_dmat) { bus_dmamem_free(hba->ctlcfg_dmat, hba->ctlcfg_ptr, hba->ctlcfg_dmamap); bus_dma_tag_destroy(hba->ctlcfg_dmat); + } return -1; } From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 17:29:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18613A18; Mon, 29 Apr 2013 17:29:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ECF061322; Mon, 29 Apr 2013 17:29:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3THTmk8005652; Mon, 29 Apr 2013 17:29:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3THTmgP005651; Mon, 29 Apr 2013 17:29:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304291729.r3THTmgP005651@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 29 Apr 2013 17:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250051 - stable/8/libexec/rtld-elf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 17:29:49 -0000 Author: kib Date: Mon Apr 29 17:29:48 2013 New Revision: 250051 URL: http://svnweb.freebsd.org/changeset/base/250051 Log: MFC r249525: Rewrite origin_subst_one() to get rid of the wrong limit on the length of the resulting string. Modified: stable/8/libexec/rtld-elf/rtld.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Mon Apr 29 17:00:26 2013 (r250050) +++ stable/8/libexec/rtld-elf/rtld.c Mon Apr 29 17:29:48 2013 (r250051) @@ -135,9 +135,8 @@ static void unlink_object(Obj_Entry *); static void unload_object(Obj_Entry *); static void unref_dag(Obj_Entry *); static void ref_dag(Obj_Entry *); -static int origin_subst_one(char **, const char *, const char *, - const char *, char *); -static char *origin_subst(const char *, const char *); +static char *origin_subst_one(char *, const char *, const char *, bool); +static char *origin_subst(char *, const char *); static int rtld_verify_versions(const Objlist *); static int rtld_verify_object_versions(Obj_Entry *); static void object_add_name(Obj_Entry *, const char *); @@ -661,79 +660,80 @@ basename(const char *name) static struct utsname uts; -static int -origin_subst_one(char **res, const char *real, const char *kw, const char *subst, - char *may_free) +static char * +origin_subst_one(char *real, const char *kw, const char *subst, + bool may_free) { - const char *p, *p1; - char *res1; - int subst_len; - int kw_len; - - res1 = *res = NULL; - p = real; - subst_len = kw_len = 0; - for (;;) { - p1 = strstr(p, kw); - if (p1 != NULL) { - if (subst_len == 0) { - subst_len = strlen(subst); - kw_len = strlen(kw); - } - if (*res == NULL) { - *res = xmalloc(PATH_MAX); - res1 = *res; - } - if ((res1 - *res) + subst_len + (p1 - p) >= PATH_MAX) { - _rtld_error("Substitution of %s in %s cannot be performed", - kw, real); - if (may_free != NULL) - free(may_free); - free(res); - return (false); - } - memcpy(res1, p, p1 - p); - res1 += p1 - p; - memcpy(res1, subst, subst_len); - res1 += subst_len; - p = p1 + kw_len; - } else { - if (*res == NULL) { - if (may_free != NULL) - *res = may_free; - else - *res = xstrdup(real); - return (true); - } - *res1 = '\0'; - if (may_free != NULL) - free(may_free); - if (strlcat(res1, p, PATH_MAX - (res1 - *res)) >= PATH_MAX) { - free(res); - return (false); - } - return (true); - } - } + char *p, *p1, *res, *resp; + int subst_len, kw_len, subst_count, old_len, new_len; + + kw_len = strlen(kw); + + /* + * First, count the number of the keyword occurences, to + * preallocate the final string. + */ + for (p = real, subst_count = 0;; p = p1 + kw_len, subst_count++) { + p1 = strstr(p, kw); + if (p1 == NULL) + break; + } + + /* + * If the keyword is not found, just return. + */ + if (subst_count == 0) + return (may_free ? real : xstrdup(real)); + + /* + * There is indeed something to substitute. Calculate the + * length of the resulting string, and allocate it. + */ + subst_len = strlen(subst); + old_len = strlen(real); + new_len = old_len + (subst_len - kw_len) * subst_count; + res = xmalloc(new_len + 1); + + /* + * Now, execute the substitution loop. + */ + for (p = real, resp = res;;) { + p1 = strstr(p, kw); + if (p1 != NULL) { + /* Copy the prefix before keyword. */ + memcpy(resp, p, p1 - p); + resp += p1 - p; + /* Keyword replacement. */ + memcpy(resp, subst, subst_len); + resp += subst_len; + p = p1 + kw_len; + } else + break; + } + + /* Copy to the end of string and finish. */ + strcat(resp, p); + if (may_free) + free(real); + return (res); } static char * -origin_subst(const char *real, const char *origin_path) +origin_subst(char *real, const char *origin_path) { - char *res1, *res2, *res3, *res4; + char *res1, *res2, *res3, *res4; - if (uts.sysname[0] == '\0') { - if (uname(&uts) != 0) { - _rtld_error("utsname failed: %d", errno); - return (NULL); - } - } - if (!origin_subst_one(&res1, real, "$ORIGIN", origin_path, NULL) || - !origin_subst_one(&res2, res1, "$OSNAME", uts.sysname, res1) || - !origin_subst_one(&res3, res2, "$OSREL", uts.release, res2) || - !origin_subst_one(&res4, res3, "$PLATFORM", uts.machine, res3)) - return (NULL); - return (res4); + if (uts.sysname[0] == '\0') { + if (uname(&uts) != 0) { + _rtld_error("utsname failed: %d", errno); + return (NULL); + } + } + res1 = origin_subst_one(real, "$ORIGIN", origin_path, false); + res2 = origin_subst_one(res1, "$OSNAME", uts.sysname, true); + res3 = origin_subst_one(res2, "$OSREL", uts.release, true); + res4 = origin_subst_one(res3, "$PLATFORM", uts.machine, true); + return (res4); } static void @@ -1144,10 +1144,12 @@ find_library(const char *xname, const Ob xname); return NULL; } - if (refobj != NULL && refobj->z_origin) - return origin_subst(xname, refobj->origin_path); - else - return xstrdup(xname); + if (refobj != NULL && refobj->z_origin) { + return (origin_subst(__DECONST(char *, xname), + refobj->origin_path)); + } else { + return (xstrdup(xname)); + } } if (libmap_disable || (refobj == NULL) || From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 17:42:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 02607E6D; Mon, 29 Apr 2013 17:42:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) by mx1.freebsd.org (Postfix) with ESMTP id BE2E01390; Mon, 29 Apr 2013 17:42:08 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id k13so3814960wgh.31 for ; Mon, 29 Apr 2013 10:42:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=BmlY8EANHd8sOflkQGQPZ1Wc/hpzGxt49Fz4ja5InlU=; b=EylkfSWMxCH+LZ/XiIdO1RZZvt6I0w5fHf3S/RLdRogRNhc1bwjYTQeTjlsQgm5V7R g8CH7iHSTleMmzA0bTClRnQhIBL4Fg8jVnkPv0g0AMalMETOKekJ/oTRxUV0bwh19pks fk3mJyBN9pwn7Q8+8Fa9C1mA67oVO0cg67exAmGidhEYjH6BTCK0/J+ERgUsqEXIyNtm M/sHt4TxIkKFMdtR4NSdQTUtFdUE2RS0pvQ7sguexT3TTzDyf/xZVVD1bN32Wk8XGPJy HE8G/6Ub758ejtidE1IPfNgYKuSn7ttH3eDTzjX9+iEBfGcZyNXyMRmII60RlQgPgqjP YKcA== MIME-Version: 1.0 X-Received: by 10.180.107.6 with SMTP id gy6mr19602359wib.22.1367257327990; Mon, 29 Apr 2013 10:42:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Mon, 29 Apr 2013 10:42:07 -0700 (PDT) In-Reply-To: References: <201304231302.r3ND2w5V024981@svn.freebsd.org> <201304291123.41402.jhb@freebsd.org> Date: Mon, 29 Apr 2013 10:42:07 -0700 X-Google-Sender-Auth: Su8uX3B0baV5n2z9VENY6VzoJxQ Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: Adrian Chadd To: hiren panchasara Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head , svn-src-all , src-committers , Eitan Adler , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 17:42:10 -0000 On 29 April 2013 09:44, hiren panchasara wrote: >> Does anyone here have bwn hardware that works? > > I do not. Have an expresscard slot? Want some? adrian From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 18:00:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 780383E8; Mon, 29 Apr 2013 18:00:16 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ea0-x236.google.com (mail-ea0-x236.google.com [IPv6:2a00:1450:4013:c01::236]) by mx1.freebsd.org (Postfix) with ESMTP id 397A91487; Mon, 29 Apr 2013 18:00:15 +0000 (UTC) Received: by mail-ea0-f182.google.com with SMTP id r16so2672185ead.27 for ; Mon, 29 Apr 2013 11:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=bIr87GAoiFZ5i7Ej/WeH+BhhoYR6VIbxffND0uMbWsY=; b=RgG3MhWlseu5kBjFMFZap0HCtqmNqz9QP+LOmJZp4Cuc0WI+HupadNyJJGavE7YHiZ ul0TXViX50Z/BrFDxOyz+Pw+seM6Nt3+sHHLPfc/3s8YTYm82B0xKEnjB6kreSLRzAV3 b0MaFJXZZWEW8Tqt81il3t/sinA1+aWL3taHMpiZtTVrMaqr0j2TfO7iniFHuj1fIYep /+fuDvB1jOIOutZjennRKAqTB2Gq9J/4kapAoB3K0lAB21wpi7N9w6vFZ43e7Z17zE6H FwH8dlh6xPEnSi5KWXXxSvyo5ZhL1c2FjkIOR153868/k77pbAbdQOFY0rsTQlPdotdJ x6UQ== MIME-Version: 1.0 X-Received: by 10.14.22.7 with SMTP id s7mr23785643ees.32.1367258413653; Mon, 29 Apr 2013 11:00:13 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.14.204.200 with HTTP; Mon, 29 Apr 2013 11:00:13 -0700 (PDT) In-Reply-To: References: <201304231302.r3ND2w5V024981@svn.freebsd.org> <201304291123.41402.jhb@freebsd.org> Date: Mon, 29 Apr 2013 11:00:13 -0700 X-Google-Sender-Auth: LxZ_4g7s21U3p85TPzRiqan1ggY Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: hiren panchasara To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , src-committers , Eitan Adler , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 18:00:16 -0000 On Mon, Apr 29, 2013 at 10:42 AM, Adrian Chadd wrote: > On 29 April 2013 09:44, hiren panchasara wrote: > >>> Does anyone here have bwn hardware that works? >> >> I do not. > > Have an expresscard slot? Want some? Yes and yes :-) cheers, Hiren > > > > adrian From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 18:00:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9F41056E; Mon, 29 Apr 2013 18:00:55 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80E9714A1; Mon, 29 Apr 2013 18:00:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TI0slL017987; Mon, 29 Apr 2013 18:00:54 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TI0rim017973; Mon, 29 Apr 2013 18:00:53 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304291800.r3TI0rim017973@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 29 Apr 2013 18:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250052 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 18:00:55 -0000 Author: luigi Date: Mon Apr 29 18:00:53 2013 New Revision: 250052 URL: http://svnweb.freebsd.org/changeset/base/250052 Log: whitespace changes: remove $Id$ lines, and add blank lines around some #if / #elif /#endif Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/if_em_netmap.h Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: if_em_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * netmap support for em. * Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/if_igb_netmap.h Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: if_igb_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * Netmap support for igb, partly contributed by Ahmed Kooli * For details on netmap support please see ixgbe_netmap.h Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/if_lem_netmap.h Mon Apr 29 18:00:53 2013 (r250052) @@ -26,7 +26,6 @@ /* * $FreeBSD$ - * $Id: if_lem_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * netmap support for "lem" * Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/if_re_netmap.h Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: if_re_netmap.h 10609 2012-02-22 19:44:58Z luigi $ * * netmap support for "re" * For details on netmap support please see ixgbe_netmap.h Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/ixgbe_netmap.h Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: ixgbe_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * netmap modifications for ixgbe * Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/netmap.c Mon Apr 29 18:00:53 2013 (r250052) @@ -99,6 +99,7 @@ MALLOC_DEFINE(M_NETMAP, "netmap", "Netwo #include #include +/* XXX the following variables must be deprecated and included in nm_mem */ u_int netmap_total_buffers; u_int netmap_buf_size; char *netmap_buffer_base; /* address of an invalid buffer */ @@ -148,6 +149,8 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, copy, #define NM_BDG_HASH 1024 /* forwarding table entries */ #define NM_BDG_BATCH 1024 /* entries in the forwarding buffer */ #define NM_BRIDGES 4 /* number of bridges */ + + int netmap_bridge = NM_BDG_BATCH; /* bridge batch size */ SYSCTL_INT(_dev_netmap, OID_AUTO, bridge, CTLFLAG_RW, &netmap_bridge, 0 , ""); Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/netmap_kern.h Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: netmap_kern.h 11829 2012-09-26 04:06:34Z luigi $ * * The header contains the definitions of constants and function * prototypes used only in kernelspace. @@ -35,6 +34,7 @@ #define _NET_NETMAP_KERN_H_ #if defined(__FreeBSD__) + #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) @@ -42,8 +42,10 @@ #define NM_SELINFO_T struct selinfo #define MBUF_LEN(m) ((m)->m_pkthdr.len) #define NM_SEND_UP(ifp, m) ((ifp)->if_input)(ifp, m) + #elif defined (linux) -#define NM_LOCK_T safe_spinlock_t // see bsd_glue.h + +#define NM_LOCK_T safe_spinlock_t // see bsd_glue.h #define NM_SELINFO_T wait_queue_head_t #define MBUF_LEN(m) ((m)->len) #define NM_SEND_UP(ifp, m) netif_rx(m) @@ -65,6 +67,7 @@ #endif #elif defined (__APPLE__) + #warning apple support is incomplete. #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) @@ -74,8 +77,10 @@ #define NM_SEND_UP(ifp, m) ((ifp)->if_input)(ifp, m) #else + #error unsupported platform -#endif + +#endif /* end - platform-specific code */ #define ND(format, ...) #define D(format, ...) \ Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/netmap_mem2.c Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: netmap_mem2.c 11881 2012-10-18 23:24:15Z luigi $ * * (New) memory allocator for netmap */ From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 18:54:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B12AA51; Mon, 29 Apr 2013 18:54:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CF0A181F; Mon, 29 Apr 2013 18:54:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TIsWpY036204; Mon, 29 Apr 2013 18:54:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TIsWHi036203; Mon, 29 Apr 2013 18:54:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201304291854.r3TIsWHi036203@svn.freebsd.org> From: John Baldwin Date: Mon, 29 Apr 2013 18:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250053 - head/sys/dev/acpi_support X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 18:54:32 -0000 Author: jhb Date: Mon Apr 29 18:54:31 2013 New Revision: 250053 URL: http://svnweb.freebsd.org/changeset/base/250053 Log: Only cleanup CMI-related state on detach if the system supports CMI. PR: kern/163268 MFC after: 1 week Modified: head/sys/dev/acpi_support/acpi_hp.c Modified: head/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- head/sys/dev/acpi_support/acpi_hp.c Mon Apr 29 18:00:53 2013 (r250052) +++ head/sys/dev/acpi_support/acpi_hp.c Mon Apr 29 18:54:31 2013 (r250053) @@ -574,28 +574,26 @@ acpi_hp_attach(device_t dev) static int acpi_hp_detach(device_t dev) { - int ret; + struct acpi_hp_softc *sc; ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); - struct acpi_hp_softc *sc = device_get_softc(dev); - if (sc->has_cmi && sc->hpcmi_open_pid != 0) { - ret = EBUSY; - } - else { - if (sc->has_notify) { - ACPI_WMI_REMOVE_EVENT_HANDLER(dev, - ACPI_HP_WMI_EVENT_GUID); - } + sc = device_get_softc(dev); + if (sc->has_cmi && sc->hpcmi_open_pid != 0) + return (EBUSY); + + if (sc->has_notify) + ACPI_WMI_REMOVE_EVENT_HANDLER(dev, ACPI_HP_WMI_EVENT_GUID); + + if (sc->has_cmi) { if (sc->hpcmi_bufptr != -1) { sbuf_delete(&sc->hpcmi_sbuf); sc->hpcmi_bufptr = -1; } sc->hpcmi_open_pid = 0; destroy_dev(sc->hpcmi_dev_t); - ret = 0; } - return (ret); + return (0); } static int From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 19:30:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4908A636; Mon, 29 Apr 2013 19:30:36 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8B31B15; Mon, 29 Apr 2013 19:30:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TJUaTn049721; Mon, 29 Apr 2013 19:30:36 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TJUa6L049720; Mon, 29 Apr 2013 19:30:36 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304291930.r3TJUa6L049720@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 29 Apr 2013 19:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250054 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 19:30:36 -0000 Author: luigi Date: Mon Apr 29 19:30:35 2013 New Revision: 250054 URL: http://svnweb.freebsd.org/changeset/base/250054 Log: whitespace - document alternative locking under linux Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Mon Apr 29 18:54:31 2013 (r250053) +++ head/sys/dev/netmap/netmap_mem2.c Mon Apr 29 19:30:35 2013 (r250054) @@ -97,6 +97,8 @@ #define NETMAP_BUF_MAX_NUM 20*4096*2 /* large machine */ #ifdef linux +// XXX a mtx would suffice here 20130415 lr +// #define NMA_LOCK_T safe_spinlock_t #define NMA_LOCK_T struct semaphore #define NMA_LOCK_INIT() sema_init(&nm_mem.nm_mtx, 1) #define NMA_LOCK_DESTROY() From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:09:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B6EC537; Mon, 29 Apr 2013 20:09:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8DE0C1D04; Mon, 29 Apr 2013 20:09:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TK9j9T062350; Mon, 29 Apr 2013 20:09:45 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TK9jlZ062348; Mon, 29 Apr 2013 20:09:45 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292009.r3TK9jlZ062348@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250055 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:09:45 -0000 Author: des Date: Mon Apr 29 20:09:44 2013 New Revision: 250055 URL: http://svnweb.freebsd.org/changeset/base/250055 Log: Fix a bug that allows NFS clients to issue READDIR on files. PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 19:30:35 2013 (r250054) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:09:44 2013 (r250055) @@ -1574,6 +1574,8 @@ nfsrvd_readdir(struct nfsrv_descript *nd nd->nd_repstat = NFSERR_BAD_COOKIE; #endif } + if (!nd->nd_repstat && vp->v_type != VDIR) + nd->nd_repstat = NFSERR_NOTDIR; if (nd->nd_repstat == 0 && cnt == 0) { if (nd->nd_flag & ND_NFSV2) /* NFSv2 does not have NFSERR_TOOSMALL */ From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:13:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67C7281D; Mon, 29 Apr 2013 20:13:11 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48D331D31; Mon, 29 Apr 2013 20:13:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKDBsR065137; Mon, 29 Apr 2013 20:13:11 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKDAxT065129; Mon, 29 Apr 2013 20:13:10 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292013.r3TKDAxT065129@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250056 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:13:11 -0000 Author: des Date: Mon Apr 29 20:13:09 2013 New Revision: 250056 URL: http://svnweb.freebsd.org/changeset/base/250056 Log: Add a -Z option which zeroes unused blocks. It can be combined with -E, in which case unused blocks are first zeroed and then erased. Reviewed by: mckusick MFC after: 3 weeks Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/pass5.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Mon Apr 29 20:09:44 2013 (r250055) +++ head/sbin/fsck_ffs/fsck.h Mon Apr 29 20:13:09 2013 (r250056) @@ -74,6 +74,7 @@ #define MINBUFS 10 /* minimum number of buffers required */ #define MAXBUFS 40 /* maximum space to allocate to buffers */ #define INOBUFSIZE 64*1024 /* size of buffer to read inodes in pass1 */ +#define ZEROBUFSIZE (dev_bsize * 128) /* size of zero buffer used by -Z */ union dinode { struct ufs1_dinode dp1; @@ -306,7 +307,8 @@ char yflag; /* assume a yes response * int bkgrdflag; /* use a snapshot to run on an active system */ int bflag; /* location of alternate super block */ int debug; /* output debugging info */ -int Eflag; /* zero out empty data blocks */ +int Eflag; /* delete empty data blocks */ +int Zflag; /* zero empty data blocks */ int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ @@ -402,6 +404,7 @@ int blread(int fd, char *buf, ufs2_dadd void bufinit(void); void blwrite(int fd, char *buf, ufs2_daddr_t blk, ssize_t size); void blerase(int fd, ufs2_daddr_t blk, long size); +void blzero(int fd, ufs2_daddr_t blk, long size); void cacheino(union dinode *dp, ino_t inumber); void catch(int); void catchquit(int); Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Mon Apr 29 20:09:44 2013 (r250055) +++ head/sbin/fsck_ffs/fsck_ffs.8 Mon Apr 29 20:13:09 2013 (r250056) @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BEFfnpry +.Op Fl BEFfnpryZ .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -280,6 +280,15 @@ Assume a yes response to all questions a .Nm ; this should be used with great caution as this is a free license to continue after essentially unlimited trouble has been encountered. +.It Fl Z +Similar to +.Fl E , +but overwrites unused blocks with zeroes. +If both +.Fl E +and +.Fl Z +are specified, blocks are first zeroed and then erased. .El .Pp Inconsistencies checked are as follows: Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Mon Apr 29 20:09:44 2013 (r250055) +++ head/sbin/fsck_ffs/fsutil.c Mon Apr 29 20:13:09 2013 (r250056) @@ -618,6 +618,35 @@ blerase(int fd, ufs2_daddr_t blk, long s return; } +void +blzero(int fd, ufs2_daddr_t blk, long size) +{ + static char *zero; + off_t offset, len; + + if (fd < 0) + return; + len = ZEROBUFSIZE; + if (zero == NULL) { + zero = calloc(len, 1); + if (zero == NULL) + errx(EEXIT, "cannot allocate buffer pool"); + } + offset = blk * dev_bsize; + if (lseek(fd, offset, 0) < 0) + rwerror("SEEK BLK", blk); + while (size > 0) { + if (size > len) + size = len; + else + len = size; + if (write(fd, zero, len) != len) + rwerror("WRITE BLK", blk); + blk += len / dev_bsize; + size -= len; + } +} + /* * Verify cylinder group's magic number and other parameters. If the * test fails, offer an option to rebuild the whole cylinder group. Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Mon Apr 29 20:09:44 2013 (r250055) +++ head/sbin/fsck_ffs/main.c Mon Apr 29 20:13:09 2013 (r250056) @@ -82,7 +82,7 @@ main(int argc, char *argv[]) sync(); skipclean = 1; inoopt = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npry")) != -1) { + while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npryZ")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -147,6 +147,10 @@ main(int argc, char *argv[]) nflag = 0; break; + case 'Z': + Zflag++; + break; + default: usage(); } Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Mon Apr 29 20:09:44 2013 (r250055) +++ head/sbin/fsck_ffs/pass5.c Mon Apr 29 20:13:09 2013 (r250056) @@ -252,7 +252,7 @@ pass5(void) frags = 0; for (j = 0; j < fs->fs_frag; j++) { if (testbmap(d + j)) { - if (Eflag && start != -1) { + if ((Eflag || Zflag) && start != -1) { clear_blocks(start, d + j - 1); start = -1; } @@ -274,7 +274,7 @@ pass5(void) ffs_fragacct(fs, blk, newcg->cg_frsum, 1); } } - if (Eflag && start != -1) + if ((Eflag || Zflag) && start != -1) clear_blocks(start, d - 1); if (fs->fs_contigsumsize > 0) { int32_t *sump = cg_clustersum(newcg); @@ -586,6 +586,10 @@ static void clear_blocks(ufs2_daddr_t st if (debug) printf("Zero frags %jd to %jd\n", start, end); - blerase(fswritefd, fsbtodb(&sblock, start), - lfragtosize(&sblock, end - start + 1)); + if (Zflag) + blzero(fswritefd, fsbtodb(&sblock, start), + lfragtosize(&sblock, end - start + 1)); + if (Eflag) + blerase(fswritefd, fsbtodb(&sblock, start), + lfragtosize(&sblock, end - start + 1)); } From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:14:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3900799D; Mon, 29 Apr 2013 20:14:12 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 11EAF1D3B; Mon, 29 Apr 2013 20:14:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKEBT5065384; Mon, 29 Apr 2013 20:14:11 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKEB6L065383; Mon, 29 Apr 2013 20:14:11 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292014.r3TKEB6L065383@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250057 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:14:12 -0000 Author: des Date: Mon Apr 29 20:14:11 2013 New Revision: 250057 URL: http://svnweb.freebsd.org/changeset/base/250057 Log: Style nit. Modified: head/sbin/fsck_ffs/pass5.c Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Mon Apr 29 20:13:09 2013 (r250056) +++ head/sbin/fsck_ffs/pass5.c Mon Apr 29 20:14:11 2013 (r250057) @@ -581,7 +581,8 @@ check_maps( } } -static void clear_blocks(ufs2_daddr_t start, ufs2_daddr_t end) +static void +clear_blocks(ufs2_daddr_t start, ufs2_daddr_t end) { if (debug) From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:15:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57857B45; Mon, 29 Apr 2013 20:15:44 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 477121D4A; Mon, 29 Apr 2013 20:15:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKFiZR065712; Mon, 29 Apr 2013 20:15:44 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKFiLt065711; Mon, 29 Apr 2013 20:15:44 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292015.r3TKFiLt065711@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250058 - stable/8/sys/fs/nfsserver X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:15:44 -0000 Author: des Date: Mon Apr 29 20:15:43 2013 New Revision: 250058 URL: http://svnweb.freebsd.org/changeset/base/250058 Log: Fix a bug that allows NFS clients to issue READDIR on files. PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Approved by: so Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:14:11 2013 (r250057) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:15:43 2013 (r250058) @@ -1569,6 +1569,8 @@ nfsrvd_readdir(struct nfsrv_descript *nd nd->nd_repstat = NFSERR_BAD_COOKIE; #endif } + if (!nd->nd_repstat && vp->v_type != VDIR) + nd->nd_repstat = NFSERR_NOTDIR; if (nd->nd_repstat == 0 && cnt == 0) { if (nd->nd_flag & ND_NFSV2) /* NFSv2 does not have NFSERR_TOOSMALL */ From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:15:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7DADDB46; Mon, 29 Apr 2013 20:15:48 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7009B1D4B; Mon, 29 Apr 2013 20:15:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKFmWw065758; Mon, 29 Apr 2013 20:15:48 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKFmfR065757; Mon, 29 Apr 2013 20:15:48 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292015.r3TKFmfR065757@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r250059 - releng/8.3/sys/fs/nfsserver X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:15:48 -0000 Author: des Date: Mon Apr 29 20:15:47 2013 New Revision: 250059 URL: http://svnweb.freebsd.org/changeset/base/250059 Log: Fix a bug that allows NFS clients to issue READDIR on files. PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Approved by: so Modified: releng/8.3/sys/fs/nfsserver/nfs_nfsdport.c Modified: releng/8.3/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- releng/8.3/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:15:43 2013 (r250058) +++ releng/8.3/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:15:47 2013 (r250059) @@ -1568,6 +1568,8 @@ nfsrvd_readdir(struct nfsrv_descript *nd nd->nd_repstat = NFSERR_BAD_COOKIE; #endif } + if (!nd->nd_repstat && vp->v_type != VDIR) + nd->nd_repstat = NFSERR_NOTDIR; if (nd->nd_repstat == 0 && cnt == 0) { if (nd->nd_flag & ND_NFSV2) /* NFSv2 does not have NFSERR_TOOSMALL */ From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:15:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F572D58; Mon, 29 Apr 2013 20:15:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DBD581D4C; Mon, 29 Apr 2013 20:15:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKFtHK065828; Mon, 29 Apr 2013 20:15:55 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKFtgK065827; Mon, 29 Apr 2013 20:15:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292015.r3TKFtgK065827@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250060 - stable/9/sys/fs/nfsserver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:15:58 -0000 Author: des Date: Mon Apr 29 20:15:55 2013 New Revision: 250060 URL: http://svnweb.freebsd.org/changeset/base/250060 Log: Fix a bug that allows NFS clients to issue READDIR on files. PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Approved by: so Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:15:47 2013 (r250059) +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:15:55 2013 (r250060) @@ -1575,6 +1575,8 @@ nfsrvd_readdir(struct nfsrv_descript *nd nd->nd_repstat = NFSERR_BAD_COOKIE; #endif } + if (!nd->nd_repstat && vp->v_type != VDIR) + nd->nd_repstat = NFSERR_NOTDIR; if (nd->nd_repstat == 0 && cnt == 0) { if (nd->nd_flag & ND_NFSV2) /* NFSv2 does not have NFSERR_TOOSMALL */ From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:16:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95108D6E; Mon, 29 Apr 2013 20:16:00 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 880931D4D; Mon, 29 Apr 2013 20:16:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKG0Ou065884; Mon, 29 Apr 2013 20:16:00 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKG0GC065883; Mon, 29 Apr 2013 20:16:00 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292016.r3TKG0GC065883@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r250061 - releng/9.1/sys/fs/nfsserver X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:16:00 -0000 Author: des Date: Mon Apr 29 20:16:00 2013 New Revision: 250061 URL: http://svnweb.freebsd.org/changeset/base/250061 Log: Fix a bug that allows NFS clients to issue READDIR on files. PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Approved by: so Modified: releng/9.1/sys/fs/nfsserver/nfs_nfsdport.c Modified: releng/9.1/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- releng/9.1/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:15:55 2013 (r250060) +++ releng/9.1/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:16:00 2013 (r250061) @@ -1574,6 +1574,8 @@ nfsrvd_readdir(struct nfsrv_descript *nd nd->nd_repstat = NFSERR_BAD_COOKIE; #endif } + if (!nd->nd_repstat && vp->v_type != VDIR) + nd->nd_repstat = NFSERR_NOTDIR; if (nd->nd_repstat == 0 && cnt == 0) { if (nd->nd_flag & ND_NFSV2) /* NFSv2 does not have NFSERR_TOOSMALL */ From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:16:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E605BFD; Mon, 29 Apr 2013 20:16:25 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D8ECC1D5D; Mon, 29 Apr 2013 20:16:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKGPt2066040; Mon, 29 Apr 2013 20:16:25 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKGP5q066039; Mon, 29 Apr 2013 20:16:25 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292016.r3TKGP5q066039@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r250062 - releng/8.4/sys/fs/nfsserver X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:16:26 -0000 Author: des Date: Mon Apr 29 20:16:25 2013 New Revision: 250062 URL: http://svnweb.freebsd.org/changeset/base/250062 Log: Fix a bug that allows NFS clients to issue READDIR on files. PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Approved by: re Modified: releng/8.4/sys/fs/nfsserver/nfs_nfsdport.c Modified: releng/8.4/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- releng/8.4/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:16:00 2013 (r250061) +++ releng/8.4/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:16:25 2013 (r250062) @@ -1569,6 +1569,8 @@ nfsrvd_readdir(struct nfsrv_descript *nd nd->nd_repstat = NFSERR_BAD_COOKIE; #endif } + if (!nd->nd_repstat && vp->v_type != VDIR) + nd->nd_repstat = NFSERR_NOTDIR; if (nd->nd_repstat == 0 && cnt == 0) { if (nd->nd_flag & ND_NFSV2) /* NFSv2 does not have NFSERR_TOOSMALL */ From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:30:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E8B69468; Mon, 29 Apr 2013 20:30:30 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DAE8C1DD7; Mon, 29 Apr 2013 20:30:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKUUU6070321; Mon, 29 Apr 2013 20:30:30 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKUUbh070319; Mon, 29 Apr 2013 20:30:30 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304292030.r3TKUUbh070319@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 29 Apr 2013 20:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250063 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:30:31 -0000 Author: pluknet Date: Mon Apr 29 20:30:29 2013 New Revision: 250063 URL: http://svnweb.freebsd.org/changeset/base/250063 Log: MFC r248253: Add missed `_load' to the `if_foo_load="YES"' line. PR: docs/176915 Submitted by: Dmitry Afanasiev Modified: stable/9/share/man/man4/cas.4 stable/9/share/man/man4/sge.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/cas.4 ============================================================================== --- stable/9/share/man/man4/cas.4 Mon Apr 29 20:16:25 2013 (r250062) +++ stable/9/share/man/man4/cas.4 Mon Apr 29 20:30:29 2013 (r250063) @@ -44,7 +44,7 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -if_cas="YES" +if_cas_load="YES" .Ed .Sh DESCRIPTION The Modified: stable/9/share/man/man4/sge.4 ============================================================================== --- stable/9/share/man/man4/sge.4 Mon Apr 29 20:16:25 2013 (r250062) +++ stable/9/share/man/man4/sge.4 Mon Apr 29 20:30:29 2013 (r250063) @@ -43,7 +43,7 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -if_sge="YES" +if_sge_load="YES" .Ed .Sh DESCRIPTION The From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:31:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 81EFD5F9; Mon, 29 Apr 2013 20:31:26 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73BB01DE9; Mon, 29 Apr 2013 20:31:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKVQcQ071949; Mon, 29 Apr 2013 20:31:26 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKVQYr071947; Mon, 29 Apr 2013 20:31:26 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304292031.r3TKVQYr071947@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 29 Apr 2013 20:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250064 - stable/8/share/man/man4 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:31:26 -0000 Author: pluknet Date: Mon Apr 29 20:31:25 2013 New Revision: 250064 URL: http://svnweb.freebsd.org/changeset/base/250064 Log: MFC r248253: Add missed `_load' to the `if_foo_load="YES"' line. PR: docs/176915 Submitted by: Dmitry Afanasiev Modified: stable/8/share/man/man4/cas.4 stable/8/share/man/man4/sge.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/cas.4 ============================================================================== --- stable/8/share/man/man4/cas.4 Mon Apr 29 20:30:29 2013 (r250063) +++ stable/8/share/man/man4/cas.4 Mon Apr 29 20:31:25 2013 (r250064) @@ -44,7 +44,7 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -if_cas="YES" +if_cas_load="YES" .Ed .Sh DESCRIPTION The Modified: stable/8/share/man/man4/sge.4 ============================================================================== --- stable/8/share/man/man4/sge.4 Mon Apr 29 20:30:29 2013 (r250063) +++ stable/8/share/man/man4/sge.4 Mon Apr 29 20:31:25 2013 (r250064) @@ -43,7 +43,7 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -if_sge="YES" +if_sge_load="YES" .Ed .Sh DESCRIPTION The From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 20:32:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D6E32777; Mon, 29 Apr 2013 20:32:09 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C8C441DF7; Mon, 29 Apr 2013 20:32:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKW9rH072117; Mon, 29 Apr 2013 20:32:09 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKW9ug072115; Mon, 29 Apr 2013 20:32:09 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304292032.r3TKW9ug072115@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 29 Apr 2013 20:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r250065 - stable/7/share/man/man4 X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:32:09 -0000 Author: pluknet Date: Mon Apr 29 20:32:09 2013 New Revision: 250065 URL: http://svnweb.freebsd.org/changeset/base/250065 Log: MFC r248253: Add missed `_load' to the `if_foo_load="YES"' line. PR: docs/176915 Submitted by: Dmitry Afanasiev Modified: stable/7/share/man/man4/cas.4 stable/7/share/man/man4/sge.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/cas.4 ============================================================================== --- stable/7/share/man/man4/cas.4 Mon Apr 29 20:31:25 2013 (r250064) +++ stable/7/share/man/man4/cas.4 Mon Apr 29 20:32:09 2013 (r250065) @@ -44,7 +44,7 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -if_cas="YES" +if_cas_load="YES" .Ed .Sh DESCRIPTION The Modified: stable/7/share/man/man4/sge.4 ============================================================================== --- stable/7/share/man/man4/sge.4 Mon Apr 29 20:31:25 2013 (r250064) +++ stable/7/share/man/man4/sge.4 Mon Apr 29 20:32:09 2013 (r250065) @@ -43,7 +43,7 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -if_sge="YES" +if_sge_load="YES" .Ed .Sh DESCRIPTION The From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:04:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BE418E68; Mon, 29 Apr 2013 21:04:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AFDAA11CC; Mon, 29 Apr 2013 21:04:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TL4boY085352; Mon, 29 Apr 2013 21:04:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TL4bu6085351; Mon, 29 Apr 2013 21:04:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304292104.r3TL4bu6085351@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 29 Apr 2013 21:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250066 - stable/9/usr.sbin/config X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:04:37 -0000 Author: jkim Date: Mon Apr 29 21:04:37 2013 New Revision: 250066 URL: http://svnweb.freebsd.org/changeset/base/250066 Log: MFC: r248777 Loosen restrictions for quoted strings. Now we can use more complex strings and "escaped" quote characters. Modified: stable/9/usr.sbin/config/main.c Directory Properties: stable/9/usr.sbin/config/ (props changed) Modified: stable/9/usr.sbin/config/main.c ============================================================================== --- stable/9/usr.sbin/config/main.c Mon Apr 29 20:32:09 2013 (r250065) +++ stable/9/usr.sbin/config/main.c Mon Apr 29 21:04:37 2013 (r250066) @@ -350,16 +350,24 @@ begin: if (ch == '"' || ch == '\'') { int quote = ch; + escaped_nl = 0; while ((ch = getc(fp)) != EOF) { - if (ch == quote) + if (ch == quote && !escaped_nl) break; - if (ch == '\n') { + if (ch == '\n' && !escaped_nl) { *cp = 0; printf("config: missing quote reading `%s'\n", line); exit(2); } + if (ch == '\\' && !escaped_nl) { + escaped_nl = 1; + continue; + } + if (ch != quote && escaped_nl) + *cp++ = '\\'; *cp++ = ch; + escaped_nl = 0; } } else { *cp++ = ch; From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:05:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4EF54FF5; Mon, 29 Apr 2013 21:05:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 419A711EF; Mon, 29 Apr 2013 21:05:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TL5D6W085555; Mon, 29 Apr 2013 21:05:13 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TL5DYp085554; Mon, 29 Apr 2013 21:05:13 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304292105.r3TL5DYp085554@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 29 Apr 2013 21:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250067 - stable/8/usr.sbin/config X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:05:13 -0000 Author: jkim Date: Mon Apr 29 21:05:12 2013 New Revision: 250067 URL: http://svnweb.freebsd.org/changeset/base/250067 Log: MFC: r248777 Loosen restrictions for quoted strings. Now we can use more complex strings and "escaped" quote characters. Modified: stable/8/usr.sbin/config/main.c Directory Properties: stable/8/usr.sbin/config/ (props changed) Modified: stable/8/usr.sbin/config/main.c ============================================================================== --- stable/8/usr.sbin/config/main.c Mon Apr 29 21:04:37 2013 (r250066) +++ stable/8/usr.sbin/config/main.c Mon Apr 29 21:05:12 2013 (r250067) @@ -377,16 +377,24 @@ begin: if (ch == '"' || ch == '\'') { int quote = ch; + escaped_nl = 0; while ((ch = getc(fp)) != EOF) { - if (ch == quote) + if (ch == quote && !escaped_nl) break; - if (ch == '\n') { + if (ch == '\n' && !escaped_nl) { *cp = 0; printf("config: missing quote reading `%s'\n", line); exit(2); } + if (ch == '\\' && !escaped_nl) { + escaped_nl = 1; + continue; + } + if (ch != quote && escaped_nl) + *cp++ = '\\'; *cp++ = ch; + escaped_nl = 0; } } else { *cp++ = ch; From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:10:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3E1693A2; Mon, 29 Apr 2013 21:10:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 30C5A1297; Mon, 29 Apr 2013 21:10:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLAoWH090433; Mon, 29 Apr 2013 21:10:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLAo23090432; Mon, 29 Apr 2013 21:10:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292110.r3TLAo23090432@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 21:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250068 - stable/8 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:10:50 -0000 Author: des Date: Mon Apr 29 21:10:49 2013 New Revision: 250068 URL: http://svnweb.freebsd.org/changeset/base/250068 Log: Fix a bug that allows NFS clients to issue READDIR on files. (files missing from previous commit) PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Approved by: so Modified: stable/8/UPDATING Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Mon Apr 29 21:05:12 2013 (r250067) +++ stable/8/UPDATING Mon Apr 29 21:10:49 2013 (r250068) @@ -15,6 +15,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130429: + Fix a bug that allows NFS clients to issue READDIR on files. + 20130225: A new compression method (lz4) has been merged. Please refer to zpool-features(7) for more information. From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:10:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A8D6E3A3; Mon, 29 Apr 2013 21:10:54 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9B7EC1299; Mon, 29 Apr 2013 21:10:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLAsWv090489; Mon, 29 Apr 2013 21:10:54 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLAsWH090487; Mon, 29 Apr 2013 21:10:54 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292110.r3TLAsWH090487@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 21:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r250069 - in releng/8.3: . sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:10:54 -0000 Author: des Date: Mon Apr 29 21:10:53 2013 New Revision: 250069 URL: http://svnweb.freebsd.org/changeset/base/250069 Log: Fix a bug that allows NFS clients to issue READDIR on files. (files missing from previous commit) PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Approved by: so Modified: releng/8.3/UPDATING releng/8.3/sys/conf/newvers.sh Modified: releng/8.3/UPDATING ============================================================================== --- releng/8.3/UPDATING Mon Apr 29 21:10:49 2013 (r250068) +++ releng/8.3/UPDATING Mon Apr 29 21:10:53 2013 (r250069) @@ -15,6 +15,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130429: p8 FreeBSD-SA-13:05.nfsserver + Fix a bug that allows NFS clients to issue READDIR on files. + 20130402: p7 FreeBSD-SA-13:03.openssl Fix multiple vulnerabilities in OpenSSL. Modified: releng/8.3/sys/conf/newvers.sh ============================================================================== --- releng/8.3/sys/conf/newvers.sh Mon Apr 29 21:10:49 2013 (r250068) +++ releng/8.3/sys/conf/newvers.sh Mon Apr 29 21:10:53 2013 (r250069) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.3" -BRANCH="RELEASE-p7" +BRANCH="RELEASE-p8" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:11:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0250560A; Mon, 29 Apr 2013 21:11:02 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 066F8129B; Mon, 29 Apr 2013 21:11:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLB1n6090638; Mon, 29 Apr 2013 21:11:01 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLB1Gt090637; Mon, 29 Apr 2013 21:11:01 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292111.r3TLB1Gt090637@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 21:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250070 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:11:03 -0000 Author: des Date: Mon Apr 29 21:11:01 2013 New Revision: 250070 URL: http://svnweb.freebsd.org/changeset/base/250070 Log: Fix a bug that allows NFS clients to issue READDIR on files. (files missing from previous commit) PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Approved by: so Modified: stable/9/UPDATING Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Mon Apr 29 21:10:53 2013 (r250069) +++ stable/9/UPDATING Mon Apr 29 21:11:01 2013 (r250070) @@ -11,6 +11,9 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130429: + Fix a bug that allows NFS clients to issue READDIR on files. + 20130315: The install(1) option -M has changed meaning and now takes an argument that is a file or path to append logs to. In the From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:11:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8289061C; Mon, 29 Apr 2013 21:11:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 691EF129F; Mon, 29 Apr 2013 21:11:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLB6aP090692; Mon, 29 Apr 2013 21:11:06 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLB6pO090690; Mon, 29 Apr 2013 21:11:06 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292111.r3TLB6pO090690@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 21:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r250071 - in releng/9.1: . sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:11:06 -0000 Author: des Date: Mon Apr 29 21:11:05 2013 New Revision: 250071 URL: http://svnweb.freebsd.org/changeset/base/250071 Log: Fix a bug that allows NFS clients to issue READDIR on files. (files missing from previous commit) PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Approved by: so Modified: releng/9.1/UPDATING releng/9.1/sys/conf/newvers.sh Modified: releng/9.1/UPDATING ============================================================================== --- releng/9.1/UPDATING Mon Apr 29 21:11:01 2013 (r250070) +++ releng/9.1/UPDATING Mon Apr 29 21:11:05 2013 (r250071) @@ -9,6 +9,9 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130429: p3 FreeBSD-SA-13:05.nfsserver + Fix a bug that allows NFS clients to issue READDIR on files. + 20130402: p2 FreeBSD-SA-13:03.openssl FreeBSD-SA-13:04.bind Fix multiple vulnerabilities in OpenSSL. Modified: releng/9.1/sys/conf/newvers.sh ============================================================================== --- releng/9.1/sys/conf/newvers.sh Mon Apr 29 21:11:01 2013 (r250070) +++ releng/9.1/sys/conf/newvers.sh Mon Apr 29 21:11:05 2013 (r250071) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.1" -BRANCH="RELEASE-p2" +BRANCH="RELEASE-p3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:11:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4ECFD898; Mon, 29 Apr 2013 21:11:22 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 41AE912AD; Mon, 29 Apr 2013 21:11:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLBMOV090782; Mon, 29 Apr 2013 21:11:22 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLBMh7090781; Mon, 29 Apr 2013 21:11:22 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304292111.r3TLBMh7090781@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 29 Apr 2013 21:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250072 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:11:22 -0000 Author: pluknet Date: Mon Apr 29 21:11:21 2013 New Revision: 250072 URL: http://svnweb.freebsd.org/changeset/base/250072 Log: MFC r246826: Add support of passing SCM_BINTIME ancillary data object for PF_LOCAL sockets. PR: kern/175883 Submitted by: Andrey Simonenko Modified: stable/9/sys/kern/uipc_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_usrreq.c ============================================================================== --- stable/9/sys/kern/uipc_usrreq.c Mon Apr 29 21:11:05 2013 (r250071) +++ stable/9/sys/kern/uipc_usrreq.c Mon Apr 29 21:11:21 2013 (r250072) @@ -1815,6 +1815,7 @@ unp_internalize(struct mbuf **controlp, struct mbuf *control = *controlp; struct proc *p = td->td_proc; struct filedesc *fdescp = p->p_fd; + struct bintime *bt; struct cmsghdr *cm = mtod(control, struct cmsghdr *); struct cmsgcred *cmcred; struct file **rp; @@ -1923,6 +1924,18 @@ unp_internalize(struct mbuf **controlp, microtime(tv); break; + case SCM_BINTIME: + *controlp = sbcreatecontrol(NULL, sizeof(*bt), + SCM_BINTIME, SOL_SOCKET); + if (*controlp == NULL) { + error = ENOBUFS; + goto out; + } + bt = (struct bintime *) + CMSG_DATA(mtod(*controlp, struct cmsghdr *)); + bintime(bt); + break; + default: error = EINVAL; goto out; From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:11:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 29CA49C5; Mon, 29 Apr 2013 21:11:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D9A612B1; Mon, 29 Apr 2013 21:11:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLBVIL090854; Mon, 29 Apr 2013 21:11:31 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLBVhI090853; Mon, 29 Apr 2013 21:11:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292111.r3TLBVhI090853@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 21:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r250073 - releng/8.4 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:11:32 -0000 Author: des Date: Mon Apr 29 21:11:31 2013 New Revision: 250073 URL: http://svnweb.freebsd.org/changeset/base/250073 Log: Fix a bug that allows NFS clients to issue READDIR on files. (files missing from previous commit) PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Approved by: re Modified: releng/8.4/UPDATING Modified: releng/8.4/UPDATING ============================================================================== --- releng/8.4/UPDATING Mon Apr 29 21:11:21 2013 (r250072) +++ releng/8.4/UPDATING Mon Apr 29 21:11:31 2013 (r250073) @@ -15,6 +15,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130429: + Fix a bug that allows NFS clients to issue READDIR on files. + 20130225: A new compression method (lz4) has been merged. Please refer to zpool-features(7) for more information. From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:12:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3E230C50; Mon, 29 Apr 2013 21:12:19 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C33C12CD; Mon, 29 Apr 2013 21:12:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLCJq6091105; Mon, 29 Apr 2013 21:12:19 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLCJiT091104; Mon, 29 Apr 2013 21:12:19 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304292112.r3TLCJiT091104@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 29 Apr 2013 21:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250074 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:12:19 -0000 Author: pluknet Date: Mon Apr 29 21:12:18 2013 New Revision: 250074 URL: http://svnweb.freebsd.org/changeset/base/250074 Log: MFC r246826: Add support of passing SCM_BINTIME ancillary data object for PF_LOCAL sockets. PR: kern/175883 Submitted by: Andrey Simonenko Modified: stable/8/sys/kern/uipc_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/uipc_usrreq.c ============================================================================== --- stable/8/sys/kern/uipc_usrreq.c Mon Apr 29 21:11:31 2013 (r250073) +++ stable/8/sys/kern/uipc_usrreq.c Mon Apr 29 21:12:18 2013 (r250074) @@ -1706,6 +1706,7 @@ unp_internalize(struct mbuf **controlp, struct mbuf *control = *controlp; struct proc *p = td->td_proc; struct filedesc *fdescp = p->p_fd; + struct bintime *bt; struct cmsghdr *cm = mtod(control, struct cmsghdr *); struct cmsgcred *cmcred; struct file **rp; @@ -1814,6 +1815,18 @@ unp_internalize(struct mbuf **controlp, microtime(tv); break; + case SCM_BINTIME: + *controlp = sbcreatecontrol(NULL, sizeof(*bt), + SCM_BINTIME, SOL_SOCKET); + if (*controlp == NULL) { + error = ENOBUFS; + goto out; + } + bt = (struct bintime *) + CMSG_DATA(mtod(*controlp, struct cmsghdr *)); + bintime(bt); + break; + default: error = EINVAL; goto out; From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:12:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2D088DA3; Mon, 29 Apr 2013 21:12:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7157112D0; Mon, 29 Apr 2013 21:12:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLCQ85091168; Mon, 29 Apr 2013 21:12:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLCQQh091167; Mon, 29 Apr 2013 21:12:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304292112.r3TLCQQh091167@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 29 Apr 2013 21:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250075 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:12:27 -0000 Author: kib Date: Mon Apr 29 21:12:25 2013 New Revision: 250075 URL: http://svnweb.freebsd.org/changeset/base/250075 Log: Properly terminate the result string for intermediate results, to allow the final strcpy() to start at the intended place. Reported and tested by: pgj Pointy hat to: kib MFC after: 3 days Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Apr 29 21:12:18 2013 (r250074) +++ head/libexec/rtld-elf/rtld.c Mon Apr 29 21:12:25 2013 (r250075) @@ -784,7 +784,7 @@ origin_subst_one(char *real, const char /* * Now, execute the substitution loop. */ - for (p = real, resp = res;;) { + for (p = real, resp = res, *resp = '\0';;) { p1 = strstr(p, kw); if (p1 != NULL) { /* Copy the prefix before keyword. */ @@ -793,6 +793,7 @@ origin_subst_one(char *real, const char /* Keyword replacement. */ memcpy(resp, subst, subst_len); resp += subst_len; + *resp = '\0'; p = p1 + kw_len; } else break; From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:30:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8F96758E; Mon, 29 Apr 2013 21:30:05 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80DA8144E; Mon, 29 Apr 2013 21:30:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLU5Ar096297; Mon, 29 Apr 2013 21:30:05 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLU5GL096293; Mon, 29 Apr 2013 21:30:05 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304292130.r3TLU5GL096293@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 29 Apr 2013 21:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250076 - stable/9/tools/regression/sockets/unix_cmsg X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:30:05 -0000 Author: pluknet Date: Mon Apr 29 21:30:04 2013 New Revision: 250076 URL: http://svnweb.freebsd.org/changeset/base/250076 Log: MFC r243314: Zero the whole struct not just the size of a pointer. MFC r246670: Major update for unix_cmsg. PR: bin/131567 Submitted by: Andrey Simonenko Modified: stable/9/tools/regression/sockets/unix_cmsg/README stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.t Directory Properties: stable/9/tools/regression/sockets/ (props changed) Modified: stable/9/tools/regression/sockets/unix_cmsg/README ============================================================================== --- stable/9/tools/regression/sockets/unix_cmsg/README Mon Apr 29 21:12:25 2013 (r250075) +++ stable/9/tools/regression/sockets/unix_cmsg/README Mon Apr 29 21:30:04 2013 (r250076) @@ -1,127 +1,160 @@ $FreeBSD$ About unix_cmsg -================ +=============== -This program is a collection of regression tests for ancillary (control) -data for PF_LOCAL sockets (local domain or Unix domain sockets). There -are tests for stream and datagram sockets. - -Usually each test does following steps: create Server, fork Client, -Client sends something to Server, Server verifies if everything -is correct in received message. Sometimes Client sends several -messages to Server. +This program is a collection of regression tests for ancillary data +(control information) for PF_LOCAL sockets (local domain or Unix domain +sockets). There are tests for stream and datagram sockets. + +Usually each test does following steps: creates Server, forks Client, +Client sends something to Server, Server verifies whether everything is +correct in received message(s). It is better to change the owner of unix_cmsg to some safe user -(eg. nobody:nogroup) and set SUID and SGID bits, else some tests -can give correct results for wrong implementation. +(eg. nobody:nogroup) and set SUID and SGID bits, else some tests that +check credentials can give correct results for wrong implementation. + +It is better to run this program by a user that belongs to more +than 16 groups. Available options ================= --d Output debugging information, values of different fields of - received messages, etc. Will produce many lines of information. - --h Output help message and exit. - --t - Run tests only for the given socket type: "stream" or "dgram". - With this option it is possible to run only particular test, - not all of them. - --z Do not send real control data if possible. Struct cmsghdr{} - should be followed by real control data. It is not clear if - a sender should give control data in all cases (this is not - documented and an arbitrary application can choose anything). - - At least for PF_LOCAL sockets' control messages with types - SCM_CREDS and SCM_TIMESTAMP the kernel does not need any - control data. This option allow to not send real control data - for SCM_CREDS and SCM_TIMESTAMP control messages. +usage: unix_cmsg [-dh] [-n num] [-s size] [-t type] [-z value] [testno] -Description of tests -==================== + Options are: + -d Output debugging information + -h Output the help message and exit + -n num Number of messages to send + -s size Specify size of data for IPC + -t type Specify socket type (stream, dgram) for tests + -z value Do not send data in a message (bit 0x1), do not send + data array associated with a cmsghdr structure (bit 0x2) + testno Run one test by its number (require the -t option) + +Description +=========== + +If Client sends something to Server, then it sends 5 messages by default. +Number of messages can be changed in the -n command line option. Number +of messages will be given as N in the following descriptions. + +If Client sends something to Server, then it sends some data (few bytes) +in each message by default. The size of this data can be changed by the -s +command line option. The "-s 0" command line option means, that Client will +send zero bytes represented by { NULL, 0 } value of struct iovec{}, referenced +by the msg_iov field from struct msghdr{}. The "-z 1" or "-z 3" command line +option means, that Client will send zero bytes represented by the NULL value +in the msg_iov field from struct msghdr{}. + +If Client sends some ancillary data object, then this ancillary data object +always has associated data array by default. The "-z 2" or "-z 3" option +means, that Client will not send associated data array if possible. For SOCK_STREAM sockets: ----------------------- 1: Sending, receiving cmsgcred - Client connects to Server and sends two messages with data and - control message with SCM_CREDS type to Server. Server should - receive two messages, in both messages there should be data and - control message with SCM_CREDS type followed by struct cmsgcred{} - and this structure should contain correct information. - - 2: Receiving sockcred (listening socket has LOCAL_CREDS) - - Server creates listen socket and set socket option LOCAL_CREDS - for it. Client connects to Server and sends two messages with data - to Server. Server should receive two messages, in first message - there should be data and control message with SCM_CREDS type followed - by struct sockcred{} and this structure should contain correct - information, in second message there should be data and no control - message. - - 3: Receiving sockcred (accepted socket has LOCAL_CREDS) - - Client connects to Server and sends two messages with data. Server - accepts connection and set socket option LOCAL_CREDS for just accepted - socket (here synchronization is used, to allow Client to see just set - flag on Server's socket before sending messages to Server). Server - should receive two messages, in first message there should be data and - control message with SOCK_CRED type followed by struct sockcred{} and - this structure should contain correct information, in second message - there should be data and no control message. + Client connects to Server and sends N messages with SCM_CREDS ancillary + data object. Server should receive N messages, each message should + have SCM_CREDS ancillary data object followed by struct cmsgcred{}. + + 2: Receiving sockcred (listening socket) + + Server creates a listening stream socket and sets the LOCAL_CREDS + socket option for it. Client connects to Server two times, each time + it sends N messages. Server accepts two connections and receives N + messages from each connection. The first message from each connection + should have SCM_CREDS ancillary data object followed by struct sockcred{}, + next messages from the same connection should not have ancillary data. + + 3: Receiving sockcred (accepted socket) + + Client connects to Server. Server accepts connection and sets the + LOCAL_CREDS socket option for just accepted socket. Client sends N + messages to Server. Server should receive N messages, the first + message should have SCM_CREDS ancillary data object followed by + struct sockcred{}, next messages should not have ancillary data. 4: Sending cmsgcred, receiving sockcred - Server creates listen socket and set socket option LOCAL_CREDS - for it. Client connects to Server and sends one message with data - and control message with SCM_CREDS type to Server. Server should - receive one message with data and control message with SCM_CREDS type - followed by struct sockcred{} and this structure should contain - correct information. - - 5: Sending, receiving timestamp - - Client connects to Server and sends message with data and control - message with SCM_TIMESTAMP type to Server. Server should receive - message with data and control message with SCM_TIMESTAMP type - followed by struct timeval{}. + Server creates a listening stream socket and sets the LOCAL_CREDS + socket option for it. Client connects to Server and sends N messages + with SCM_CREDS ancillary data object. Server should receive N messages, + the first message should have SCM_CREDS ancillary data object followed + by struct sockcred{}, each of next messages should have SCM_CREDS + ancillary data object followed by struct cmsgcred{}. + + 5: Sending, receiving timeval + + Client connects to Server and sends message with SCM_TIMESTAMP ancillary + data object. Server should receive one message with SCM_TIMESTAMP + ancillary data object followed by struct timeval{}. + + 6: Sending, receiving bintime + + Client connects to Server and sends message with SCM_BINTIME ancillary + data object. Server should receive one message with SCM_BINTIME + ancillary data object followed by struct bintime{}. + + 7: Checking cmsghdr.cmsg_len + + Client connects to Server and tries to send several messages with + SCM_CREDS ancillary data object that has wrong cmsg_len field in its + struct cmsghdr{}. All these attempts should fail, since cmsg_len + in all requests is less than CMSG_LEN(0). + + 8: Check LOCAL_PEERCRED socket option + + This test does not use ancillary data, but can be implemented here. + Client connects to Server. Both Client and Server verify that + credentials of the peer are correct using LOCAL_PEERCRED socket option. For SOCK_DGRAM sockets: ---------------------- 1: Sending, receiving cmsgcred - Client sends to Server two messages with data and control message - with SCM_CREDS type to Server. Server should receive two messages, - in both messages there should be data and control message with - SCM_CREDS type followed by struct cmsgcred{} and this structure - should contain correct information. + Client connects to Server and sends N messages with SCM_CREDS ancillary + data object. Server should receive N messages, each message should + have SCM_CREDS ancillary data object followed by struct cmsgcred{}. 2: Receiving sockcred - Server creates datagram socket and set socket option LOCAL_CREDS - for it. Client sends two messages with data to Server. Server should - receive two messages, in both messages there should be data and control - message with SCM_CREDS type followed by struct sockcred{} and this - structure should contain correct information. + Server creates datagram socket and sets the LOCAL_CREDS socket option + for it. Client sends N messages to Server. Server should receive N + messages, each message should have SCM_CREDS ancillary data object + followed by struct sockcred{}. 3: Sending cmsgcred, receiving sockcred - - Server creates datagram socket and set socket option LOCAL_CREDS - for it. Client sends one message with data and control message with - SOCK_CREDS type to Server. Server should receive one message with - data and control message with SCM_CREDS type followed by struct - sockcred{} and this structure should contain correct information. - - 4: Sending, receiving timestamp - - Client sends message with data and control message with SCM_TIMESTAMP - type to Server. Server should receive message with data and control - message with SCM_TIMESTAMP type followed by struct timeval{}. + + Server creates datagram socket and sets the LOCAL_CREDS socket option + for it. Client sends N messages with SCM_CREDS ancillary data object + to Server. Server should receive N messages, the first message should + have SCM_CREDS ancillary data object followed by struct sockcred{}, + each of next messages should have SCM_CREDS ancillary data object + followed by struct cmsgcred{}. + + 4: Sending, receiving timeval + + Client sends one message with SCM_TIMESTAMP ancillary data object + to Server. Server should receive one message with SCM_TIMESTAMP + ancillary data object followed by struct timeval{}. + + 5: Sending, receiving bintime + + Client sends one message with SCM_BINTIME ancillary data object + to Server. Server should receive one message with SCM_BINTIME + ancillary data object followed by struct bintime{}. + + 6: Checking cmsghdr.cmsg_len + + Client tries to send Server several messages with SCM_CREDS ancillary + data object that has wrong cmsg_len field in its struct cmsghdr{}. + All these attempts should fail, since cmsg_len in all requests is less + than CMSG_LEN(0). - Andrey Simonenko -simon@comsys.ntu-kpi.kiev.ua +andreysimonenko@users.sourceforge.net Modified: stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c ============================================================================== --- stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c Mon Apr 29 21:12:25 2013 (r250075) +++ stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c Mon Apr 29 21:30:04 2013 (r250076) @@ -27,48 +27,46 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include +#include #include +#include #include #include -#include #include #include #include +#include #include #include -#include +#include #include #include +#include #include #include #include #include -#include #include /* * There are tables with tests descriptions and pointers to test * functions. Each t_*() function returns 0 if its test passed, - * -1 if its test failed (something wrong was found in local domain - * control messages), -2 if some system error occurred. If test - * function returns -2, then a program exits. + * -1 if its test failed, -2 if some system error occurred. + * If a test function returns -2, then a program exits. * - * Each test function completely control what to do (eg. fork or - * do not fork a client process). If a test function forks a client - * process, then it waits for its termination. If a return code of a - * client process is not equal to zero, or if a client process was - * terminated by a signal, then test function returns -2. + * If a test function forks a client process, then it waits for its + * termination. If a return code of a client process is not equal + * to zero, or if a client process was terminated by a signal, then + * a test function returns -1 or -2 depending on exit status of + * a client process. * - * Each test function and complete program are not optimized - * a lot to allow easy to modify tests. - * - * Each function which can block, is run under TIMEOUT, if timeout - * occurs, then test function returns -2 or a client process exits - * with nonzero return code. + * Each function which can block, is run under TIMEOUT. If timeout + * occurs, then a test function returns -2 or a client process exits + * with a non-zero return code. */ #ifndef LISTENQ @@ -76,207 +74,290 @@ __FBSDID("$FreeBSD$"); #endif #ifndef TIMEOUT -# define TIMEOUT 60 +# define TIMEOUT 2 #endif -#define EXTRA_CMSG_SPACE 512 /* Memory for not expected control data. */ - -static int t_cmsgcred(void), t_sockcred_stream1(void); -static int t_sockcred_stream2(void), t_cmsgcred_sockcred(void); -static int t_sockcred_dgram(void), t_timestamp(void); +static int t_cmsgcred(void); +static int t_sockcred_1(void); +static int t_sockcred_2(void); +static int t_cmsgcred_sockcred(void); +static int t_timeval(void); +static int t_bintime(void); +static int t_cmsg_len(void); +static int t_peercred(void); struct test_func { - int (*func)(void); /* Pointer to function. */ - const char *desc; /* Test description. */ -}; - -static struct test_func test_stream_tbl[] = { - { NULL, " 0: All tests" }, - { t_cmsgcred, " 1: Sending, receiving cmsgcred" }, - { t_sockcred_stream1, " 2: Receiving sockcred (listening socket has LOCAL_CREDS)" }, - { t_sockcred_stream2, " 3: Receiving sockcred (accepted socket has LOCAL_CREDS)" }, - { t_cmsgcred_sockcred, " 4: Sending cmsgcred, receiving sockcred" }, - { t_timestamp, " 5: Sending, receiving timestamp" }, - { NULL, NULL } + int (*func)(void); + const char *desc; }; -static struct test_func test_dgram_tbl[] = { - { NULL, " 0: All tests" }, - { t_cmsgcred, " 1: Sending, receiving cmsgcred" }, - { t_sockcred_dgram, " 2: Receiving sockcred" }, - { t_cmsgcred_sockcred, " 3: Sending cmsgcred, receiving sockcred" }, - { t_timestamp, " 4: Sending, receiving timestamp" }, - { NULL, NULL } +static const struct test_func test_stream_tbl[] = { + { + .func = NULL, + .desc = "All tests" + }, + { + .func = t_cmsgcred, + .desc = "Sending, receiving cmsgcred" + }, + { + .func = t_sockcred_1, + .desc = "Receiving sockcred (listening socket)" + }, + { + .func = t_sockcred_2, + .desc = "Receiving sockcred (accepted socket)" + }, + { + .func = t_cmsgcred_sockcred, + .desc = "Sending cmsgcred, receiving sockcred" + }, + { + .func = t_timeval, + .desc = "Sending, receiving timeval" + }, + { + .func = t_bintime, + .desc = "Sending, receiving bintime" + }, + { + .func = t_cmsg_len, + .desc = "Check cmsghdr.cmsg_len" + }, + { + .func = t_peercred, + .desc = "Check LOCAL_PEERCRED socket option" + } }; -#define TEST_STREAM_NO_MAX (sizeof(test_stream_tbl) / sizeof(struct test_func) - 2) -#define TEST_DGRAM_NO_MAX (sizeof(test_dgram_tbl) / sizeof(struct test_func) - 2) - -static const char *myname = "SERVER"; /* "SERVER" or "CLIENT" */ - -static int debug = 0; /* 1, if -d. */ -static int no_control_data = 0; /* 1, if -z. */ - -static u_int nfailed = 0; /* Number of failed tests. */ +#define TEST_STREAM_TBL_SIZE \ + (sizeof(test_stream_tbl) / sizeof(test_stream_tbl[0])) -static int sock_type; /* SOCK_STREAM or SOCK_DGRAM */ -static const char *sock_type_str; /* "SOCK_STREAM" or "SOCK_DGRAN" */ - -static char tempdir[] = "/tmp/unix_cmsg.XXXXXXX"; -static char serv_sock_path[PATH_MAX]; - -static char ipc_message[] = "hello"; - -#define IPC_MESSAGE_SIZE (sizeof(ipc_message)) - -static struct sockaddr_un servaddr; /* Server address. */ - -static sigjmp_buf env_alrm; +static const struct test_func test_dgram_tbl[] = { + { + .func = NULL, + .desc = "All tests" + }, + { + .func = t_cmsgcred, + .desc = "Sending, receiving cmsgcred" + }, + { + .func = t_sockcred_2, + .desc = "Receiving sockcred" + }, + { + .func = t_cmsgcred_sockcred, + .desc = "Sending cmsgcred, receiving sockcred" + }, + { + .func = t_timeval, + .desc = "Sending, receiving timeval" + }, + { + .func = t_bintime, + .desc = "Sending, receiving bintime" + }, + { + .func = t_cmsg_len, + .desc = "Check cmsghdr.cmsg_len" + } +}; -static uid_t my_uid; -static uid_t my_euid; -static gid_t my_gid; -static gid_t my_egid; +#define TEST_DGRAM_TBL_SIZE \ + (sizeof(test_dgram_tbl) / sizeof(test_dgram_tbl[0])) -/* - * my_gids[0] is EGID, next items are supplementary GIDs, - * my_ngids determines valid items in my_gids array. - */ -static gid_t my_gids[NGROUPS_MAX]; -static int my_ngids; +static bool debug = false; +static bool server_flag = true; +static bool send_data_flag = true; +static bool send_array_flag = true; +static bool failed_flag = false; + +static int sock_type; +static const char *sock_type_str; + +static const char *proc_name; + +static char work_dir[] = _PATH_TMP "unix_cmsg.XXXXXXX"; +static int serv_sock_fd; +static struct sockaddr_un serv_addr_sun; + +static struct { + char *buf_send; + char *buf_recv; + size_t buf_size; + u_int msg_num; +} ipc_msg; + +#define IPC_MSG_NUM_DEF 5 +#define IPC_MSG_NUM_MAX 10 +#define IPC_MSG_SIZE_DEF 7 +#define IPC_MSG_SIZE_MAX 128 + +static struct { + uid_t uid; + uid_t euid; + gid_t gid; + gid_t egid; + gid_t *gid_arr; + int gid_num; +} proc_cred; + +static pid_t client_pid; + +#define SYNC_SERVER 0 +#define SYNC_CLIENT 1 +#define SYNC_RECV 0 +#define SYNC_SEND 1 -static pid_t client_pid; /* PID of forked client. */ +static int sync_fd[2][2]; -#define dbgmsg(x) do { \ - if (debug) \ - logmsgx x ; \ -} while (/* CONSTCOND */0) +#define LOGMSG_SIZE 128 static void logmsg(const char *, ...) __printflike(1, 2); static void logmsgx(const char *, ...) __printflike(1, 2); +static void dbgmsg(const char *, ...) __printflike(1, 2); static void output(const char *, ...) __printflike(1, 2); -extern char *__progname; /* The name of program. */ - -/* - * Output the help message (-h switch). - */ static void -usage(int quick) +usage(bool verbose) { - const struct test_func *test_func; + u_int i; - fprintf(stderr, "Usage: %s [-dhz] [-t ] [testno]\n", - __progname); - if (quick) + printf("usage: %s [-dh] [-n num] [-s size] [-t type] " + "[-z value] [testno]\n", getprogname()); + if (!verbose) return; - fprintf(stderr, "\n Options are:\n\ - -d\t\t\tOutput debugging information\n\ - -h\t\t\tOutput this help message and exit\n\ - -t \t\tRun test only for the given socket type:\n\ -\t\t\tstream or dgram\n\ - -z\t\t\tDo not send real control data if possible\n\n"); - fprintf(stderr, " Available tests for stream sockets:\n"); - for (test_func = test_stream_tbl; test_func->desc != NULL; ++test_func) - fprintf(stderr, " %s\n", test_func->desc); - fprintf(stderr, "\n Available tests for datagram sockets:\n"); - for (test_func = test_dgram_tbl; test_func->desc != NULL; ++test_func) - fprintf(stderr, " %s\n", test_func->desc); + printf("\n Options are:\n\ + -d Output debugging information\n\ + -h Output the help message and exit\n\ + -n num Number of messages to send\n\ + -s size Specify size of data for IPC\n\ + -t type Specify socket type (stream, dgram) for tests\n\ + -z value Do not send data in a message (bit 0x1), do not send\n\ + data array associated with a cmsghdr structure (bit 0x2)\n\ + testno Run one test by its number (require the -t option)\n\n"); + printf(" Available tests for stream sockets:\n"); + for (i = 0; i < TEST_STREAM_TBL_SIZE; ++i) + printf(" %u: %s\n", i, test_stream_tbl[i].desc); + printf("\n Available tests for datagram sockets:\n"); + for (i = 0; i < TEST_DGRAM_TBL_SIZE; ++i) + printf(" %u: %s\n", i, test_dgram_tbl[i].desc); } -/* - * printf-like function for outputting to STDOUT_FILENO. - */ static void output(const char *format, ...) { - char buf[128]; + char buf[LOGMSG_SIZE]; va_list ap; va_start(ap, format); if (vsnprintf(buf, sizeof(buf), format, ap) < 0) - err(EX_SOFTWARE, "output: vsnprintf failed"); + err(EXIT_FAILURE, "output: vsnprintf failed"); write(STDOUT_FILENO, buf, strlen(buf)); va_end(ap); } -/* - * printf-like function for logging, also outputs message for errno. - */ static void logmsg(const char *format, ...) { - char buf[128]; + char buf[LOGMSG_SIZE]; va_list ap; int errno_save; - errno_save = errno; /* Save errno. */ - + errno_save = errno; va_start(ap, format); if (vsnprintf(buf, sizeof(buf), format, ap) < 0) - err(EX_SOFTWARE, "logmsg: vsnprintf failed"); + err(EXIT_FAILURE, "logmsg: vsnprintf failed"); if (errno_save == 0) - output("%s: %s\n", myname, buf); + output("%s: %s\n", proc_name, buf); else - output("%s: %s: %s\n", myname, buf, strerror(errno_save)); + output("%s: %s: %s\n", proc_name, buf, strerror(errno_save)); va_end(ap); + errno = errno_save; +} + +static void +vlogmsgx(const char *format, va_list ap) +{ + char buf[LOGMSG_SIZE]; + + if (vsnprintf(buf, sizeof(buf), format, ap) < 0) + err(EXIT_FAILURE, "logmsgx: vsnprintf failed"); + output("%s: %s\n", proc_name, buf); - errno = errno_save; /* Restore errno. */ } -/* - * printf-like function for logging, do not output message for errno. - */ static void logmsgx(const char *format, ...) { - char buf[128]; va_list ap; va_start(ap, format); - if (vsnprintf(buf, sizeof(buf), format, ap) < 0) - err(EX_SOFTWARE, "logmsgx: vsnprintf failed"); - output("%s: %s\n", myname, buf); + vlogmsgx(format, ap); va_end(ap); } -/* - * Run tests from testno1 to testno2. - */ +static void +dbgmsg(const char *format, ...) +{ + va_list ap; + + if (debug) { + va_start(ap, format); + vlogmsgx(format, ap); + va_end(ap); + } +} + static int -run_tests(u_int testno1, u_int testno2) +run_tests(int type, u_int testno1) { - const struct test_func *test_func; - u_int i, nfailed1; + const struct test_func *tf; + u_int i, testno2, failed_num; - output("Running tests for %s sockets:\n", sock_type_str); - test_func = (sock_type == SOCK_STREAM ? - test_stream_tbl : test_dgram_tbl) + testno1; + sock_type = type; + if (type == SOCK_STREAM) { + sock_type_str = "SOCK_STREAM"; + tf = test_stream_tbl; + i = TEST_STREAM_TBL_SIZE - 1; + } else { + sock_type_str = "SOCK_DGRAM"; + tf = test_dgram_tbl; + i = TEST_DGRAM_TBL_SIZE - 1; + } + if (testno1 == 0) { + testno1 = 1; + testno2 = i; + } else + testno2 = testno1; - nfailed1 = 0; - for (i = testno1; i <= testno2; ++test_func, ++i) { - output(" %s\n", test_func->desc); - switch (test_func->func()) { + output("Running tests for %s sockets:\n", sock_type_str); + failed_num = 0; + for (i = testno1, tf += testno1; i <= testno2; ++tf, ++i) { + output(" %u: %s\n", i, tf->desc); + switch (tf->func()) { case -1: - ++nfailed1; + ++failed_num; break; case -2: - logmsgx("some system error occurred, exiting"); + logmsgx("some system error or timeout occurred"); return (-1); } } - nfailed += nfailed1; + if (failed_num != 0) + failed_flag = true; if (testno1 != testno2) { - if (nfailed1 == 0) - output("-- all tests were passed!\n"); + if (failed_num == 0) + output("-- all tests passed!\n"); else - output("-- %u test%s failed!\n", nfailed1, - nfailed1 == 1 ? "" : "s"); + output("-- %u test%s failed!\n", + failed_num, failed_num == 1 ? "" : "s"); } else { - if (nfailed == 0) - output("-- test was passed!\n"); + if (failed_num == 0) + output("-- test passed!\n"); else output("-- test failed!\n"); } @@ -284,183 +365,322 @@ run_tests(u_int testno1, u_int testno2) return (0); } -/* ARGSUSED */ -static void -sig_alrm(int signo __unused) +static int +init(void) +{ + struct sigaction sigact; + size_t idx; + int rv; + + proc_name = "SERVER"; + + sigact.sa_handler = SIG_IGN; + sigact.sa_flags = 0; + sigemptyset(&sigact.sa_mask); + if (sigaction(SIGPIPE, &sigact, (struct sigaction *)NULL) < 0) { + logmsg("init: sigaction"); + return (-1); + } + + if (ipc_msg.buf_size == 0) + ipc_msg.buf_send = ipc_msg.buf_recv = NULL; + else { + ipc_msg.buf_send = malloc(ipc_msg.buf_size); + ipc_msg.buf_recv = malloc(ipc_msg.buf_size); + if (ipc_msg.buf_send == NULL || ipc_msg.buf_recv == NULL) { + logmsg("init: malloc"); + return (-1); + } + for (idx = 0; idx < ipc_msg.buf_size; ++idx) + ipc_msg.buf_send[idx] = (char)idx; + } + + proc_cred.uid = getuid(); + proc_cred.euid = geteuid(); + proc_cred.gid = getgid(); + proc_cred.egid = getegid(); + proc_cred.gid_num = getgroups(0, (gid_t *)NULL); + if (proc_cred.gid_num < 0) { + logmsg("init: getgroups"); + return (-1); + } + proc_cred.gid_arr = malloc(proc_cred.gid_num * + sizeof(*proc_cred.gid_arr)); + if (proc_cred.gid_arr == NULL) { + logmsg("init: malloc"); + return (-1); + } + if (getgroups(proc_cred.gid_num, proc_cred.gid_arr) < 0) { + logmsg("init: getgroups"); + return (-1); + } + + memset(&serv_addr_sun, 0, sizeof(serv_addr_sun)); + rv = snprintf(serv_addr_sun.sun_path, sizeof(serv_addr_sun.sun_path), + "%s/%s", work_dir, proc_name); + if (rv < 0) { + logmsg("init: snprintf"); + return (-1); + } + if ((size_t)rv >= sizeof(serv_addr_sun.sun_path)) { + logmsgx("init: not enough space for socket pathname"); + return (-1); + } + serv_addr_sun.sun_family = PF_LOCAL; + serv_addr_sun.sun_len = SUN_LEN(&serv_addr_sun); + + return (0); +} + +static int +client_fork(void) { - siglongjmp(env_alrm, 1); + int fd1, fd2; + + if (pipe(sync_fd[SYNC_SERVER]) < 0 || + pipe(sync_fd[SYNC_CLIENT]) < 0) { + logmsg("client_fork: pipe"); + return (-1); + } + client_pid = fork(); + if (client_pid == (pid_t)-1) { + logmsg("client_fork: fork"); + return (-1); + } + if (client_pid == 0) { + proc_name = "CLIENT"; + server_flag = false; + fd1 = sync_fd[SYNC_SERVER][SYNC_RECV]; + fd2 = sync_fd[SYNC_CLIENT][SYNC_SEND]; + } else { + fd1 = sync_fd[SYNC_SERVER][SYNC_SEND]; + fd2 = sync_fd[SYNC_CLIENT][SYNC_RECV]; + } + if (close(fd1) < 0 || close(fd2) < 0) { + logmsg("client_fork: close"); + return (-1); + } + return (client_pid != 0); } -/* - * Initialize signals handlers. - */ static void -sig_init(void) +client_exit(int rv) +{ + if (close(sync_fd[SYNC_SERVER][SYNC_SEND]) < 0 || + close(sync_fd[SYNC_CLIENT][SYNC_RECV]) < 0) { + logmsg("client_exit: close"); + rv = -1; + } + rv = rv == 0 ? EXIT_SUCCESS : -rv; + dbgmsg("exit: code %d", rv); + _exit(rv); +} + +static int +client_wait(void) { - struct sigaction sa; + int status; + pid_t pid; - sa.sa_handler = SIG_IGN; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - if (sigaction(SIGPIPE, &sa, (struct sigaction *)NULL) < 0) - err(EX_OSERR, "sigaction(SIGPIPE)"); - - sa.sa_handler = sig_alrm; - if (sigaction(SIGALRM, &sa, (struct sigaction *)NULL) < 0) - err(EX_OSERR, "sigaction(SIGALRM)"); + dbgmsg("waiting for client"); + + if (close(sync_fd[SYNC_SERVER][SYNC_RECV]) < 0 || + close(sync_fd[SYNC_CLIENT][SYNC_SEND]) < 0) { + logmsg("client_wait: close"); + return (-1); + } + + pid = waitpid(client_pid, &status, 0); + if (pid == (pid_t)-1) { + logmsg("client_wait: waitpid"); + return (-1); + } + + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) != EXIT_SUCCESS) { + logmsgx("client exit status is %d", + WEXITSTATUS(status)); + return (-WEXITSTATUS(status)); + } + } else { + if (WIFSIGNALED(status)) + logmsgx("abnormal termination of client, signal %d%s", + WTERMSIG(status), WCOREDUMP(status) ? + " (core file generated)" : ""); + else + logmsgx("termination of client, unknown status"); + return (-1); + } + + return (0); } int main(int argc, char *argv[]) { const char *errstr; - int opt, dgramflag, streamflag; - u_int testno1, testno2; - - dgramflag = streamflag = 0; - while ((opt = getopt(argc, argv, "dht:z")) != -1) + u_int testno, zvalue; + int opt, rv; + bool dgram_flag, stream_flag; + + ipc_msg.buf_size = IPC_MSG_SIZE_DEF; + ipc_msg.msg_num = IPC_MSG_NUM_DEF; + dgram_flag = stream_flag = false; + while ((opt = getopt(argc, argv, "dhn:s:t:z:")) != -1) switch (opt) { case 'd': - debug = 1; + debug = true; break; case 'h': - usage(0); - return (EX_OK); + usage(true); + return (EXIT_SUCCESS); + case 'n': + ipc_msg.msg_num = strtonum(optarg, 1, + IPC_MSG_NUM_MAX, &errstr); + if (errstr != NULL) + errx(EXIT_FAILURE, "option -n: number is %s", + errstr); + break; + case 's': + ipc_msg.buf_size = strtonum(optarg, 0, + IPC_MSG_SIZE_MAX, &errstr); + if (errstr != NULL) + errx(EXIT_FAILURE, "option -s: number is %s", + errstr); + break; case 't': if (strcmp(optarg, "stream") == 0) - streamflag = 1; + stream_flag = true; else if (strcmp(optarg, "dgram") == 0) - dgramflag = 1; + dgram_flag = true; else - errx(EX_USAGE, "wrong socket type in -t option"); + errx(EXIT_FAILURE, "option -t: " + "wrong socket type"); break; case 'z': - no_control_data = 1; + zvalue = strtonum(optarg, 0, 3, &errstr); + if (errstr != NULL) + errx(EXIT_FAILURE, "option -z: number is %s", + errstr); + if (zvalue & 0x1) + send_data_flag = false; + if (zvalue & 0x2) + send_array_flag = false; break; - case '?': default: - usage(1); - return (EX_USAGE); + usage(false); + return (EXIT_FAILURE); } if (optind < argc) { if (optind + 1 != argc) - errx(EX_USAGE, "too many arguments"); - testno1 = strtonum(argv[optind], 0, UINT_MAX, &errstr); + errx(EXIT_FAILURE, "too many arguments"); + testno = strtonum(argv[optind], 0, UINT_MAX, &errstr); if (errstr != NULL) - errx(EX_USAGE, "wrong test number: %s", errstr); + errx(EXIT_FAILURE, "test number is %s", errstr); + if (stream_flag && testno >= TEST_STREAM_TBL_SIZE) + errx(EXIT_FAILURE, "given test %u for stream " + "sockets does not exist", testno); + if (dgram_flag && testno >= TEST_DGRAM_TBL_SIZE) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:33:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ECC93894; Mon, 29 Apr 2013 21:33:37 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DDCE2148D; Mon, 29 Apr 2013 21:33:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLXbxj098666; Mon, 29 Apr 2013 21:33:37 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLXbq1098663; Mon, 29 Apr 2013 21:33:37 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304292133.r3TLXbq1098663@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 29 Apr 2013 21:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250077 - stable/8/tools/regression/sockets/unix_cmsg X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:33:38 -0000 Author: pluknet Date: Mon Apr 29 21:33:36 2013 New Revision: 250077 URL: http://svnweb.freebsd.org/changeset/base/250077 Log: MFC r243314: Zero the whole struct not just the size of a pointer. MFC r246670: Major update for unix_cmsg. PR: bin/131567 Submitted by: Andrey Simonenko Modified: stable/8/tools/regression/sockets/unix_cmsg/README stable/8/tools/regression/sockets/unix_cmsg/unix_cmsg.c stable/8/tools/regression/sockets/unix_cmsg/unix_cmsg.t Directory Properties: stable/8/tools/regression/sockets/ (props changed) Modified: stable/8/tools/regression/sockets/unix_cmsg/README ============================================================================== --- stable/8/tools/regression/sockets/unix_cmsg/README Mon Apr 29 21:30:04 2013 (r250076) +++ stable/8/tools/regression/sockets/unix_cmsg/README Mon Apr 29 21:33:36 2013 (r250077) @@ -1,127 +1,160 @@ $FreeBSD$ About unix_cmsg -================ +=============== -This program is a collection of regression tests for ancillary (control) -data for PF_LOCAL sockets (local domain or Unix domain sockets). There -are tests for stream and datagram sockets. - -Usually each test does following steps: create Server, fork Client, -Client sends something to Server, Server verifies if everything -is correct in received message. Sometimes Client sends several -messages to Server. +This program is a collection of regression tests for ancillary data +(control information) for PF_LOCAL sockets (local domain or Unix domain +sockets). There are tests for stream and datagram sockets. + +Usually each test does following steps: creates Server, forks Client, +Client sends something to Server, Server verifies whether everything is +correct in received message(s). It is better to change the owner of unix_cmsg to some safe user -(eg. nobody:nogroup) and set SUID and SGID bits, else some tests -can give correct results for wrong implementation. +(eg. nobody:nogroup) and set SUID and SGID bits, else some tests that +check credentials can give correct results for wrong implementation. + +It is better to run this program by a user that belongs to more +than 16 groups. Available options ================= --d Output debugging information, values of different fields of - received messages, etc. Will produce many lines of information. - --h Output help message and exit. - --t - Run tests only for the given socket type: "stream" or "dgram". - With this option it is possible to run only particular test, - not all of them. - --z Do not send real control data if possible. Struct cmsghdr{} - should be followed by real control data. It is not clear if - a sender should give control data in all cases (this is not - documented and an arbitrary application can choose anything). - - At least for PF_LOCAL sockets' control messages with types - SCM_CREDS and SCM_TIMESTAMP the kernel does not need any - control data. This option allow to not send real control data - for SCM_CREDS and SCM_TIMESTAMP control messages. +usage: unix_cmsg [-dh] [-n num] [-s size] [-t type] [-z value] [testno] -Description of tests -==================== + Options are: + -d Output debugging information + -h Output the help message and exit + -n num Number of messages to send + -s size Specify size of data for IPC + -t type Specify socket type (stream, dgram) for tests + -z value Do not send data in a message (bit 0x1), do not send + data array associated with a cmsghdr structure (bit 0x2) + testno Run one test by its number (require the -t option) + +Description +=========== + +If Client sends something to Server, then it sends 5 messages by default. +Number of messages can be changed in the -n command line option. Number +of messages will be given as N in the following descriptions. + +If Client sends something to Server, then it sends some data (few bytes) +in each message by default. The size of this data can be changed by the -s +command line option. The "-s 0" command line option means, that Client will +send zero bytes represented by { NULL, 0 } value of struct iovec{}, referenced +by the msg_iov field from struct msghdr{}. The "-z 1" or "-z 3" command line +option means, that Client will send zero bytes represented by the NULL value +in the msg_iov field from struct msghdr{}. + +If Client sends some ancillary data object, then this ancillary data object +always has associated data array by default. The "-z 2" or "-z 3" option +means, that Client will not send associated data array if possible. For SOCK_STREAM sockets: ----------------------- 1: Sending, receiving cmsgcred - Client connects to Server and sends two messages with data and - control message with SCM_CREDS type to Server. Server should - receive two messages, in both messages there should be data and - control message with SCM_CREDS type followed by struct cmsgcred{} - and this structure should contain correct information. - - 2: Receiving sockcred (listening socket has LOCAL_CREDS) - - Server creates listen socket and set socket option LOCAL_CREDS - for it. Client connects to Server and sends two messages with data - to Server. Server should receive two messages, in first message - there should be data and control message with SCM_CREDS type followed - by struct sockcred{} and this structure should contain correct - information, in second message there should be data and no control - message. - - 3: Receiving sockcred (accepted socket has LOCAL_CREDS) - - Client connects to Server and sends two messages with data. Server - accepts connection and set socket option LOCAL_CREDS for just accepted - socket (here synchronization is used, to allow Client to see just set - flag on Server's socket before sending messages to Server). Server - should receive two messages, in first message there should be data and - control message with SOCK_CRED type followed by struct sockcred{} and - this structure should contain correct information, in second message - there should be data and no control message. + Client connects to Server and sends N messages with SCM_CREDS ancillary + data object. Server should receive N messages, each message should + have SCM_CREDS ancillary data object followed by struct cmsgcred{}. + + 2: Receiving sockcred (listening socket) + + Server creates a listening stream socket and sets the LOCAL_CREDS + socket option for it. Client connects to Server two times, each time + it sends N messages. Server accepts two connections and receives N + messages from each connection. The first message from each connection + should have SCM_CREDS ancillary data object followed by struct sockcred{}, + next messages from the same connection should not have ancillary data. + + 3: Receiving sockcred (accepted socket) + + Client connects to Server. Server accepts connection and sets the + LOCAL_CREDS socket option for just accepted socket. Client sends N + messages to Server. Server should receive N messages, the first + message should have SCM_CREDS ancillary data object followed by + struct sockcred{}, next messages should not have ancillary data. 4: Sending cmsgcred, receiving sockcred - Server creates listen socket and set socket option LOCAL_CREDS - for it. Client connects to Server and sends one message with data - and control message with SCM_CREDS type to Server. Server should - receive one message with data and control message with SCM_CREDS type - followed by struct sockcred{} and this structure should contain - correct information. - - 5: Sending, receiving timestamp - - Client connects to Server and sends message with data and control - message with SCM_TIMESTAMP type to Server. Server should receive - message with data and control message with SCM_TIMESTAMP type - followed by struct timeval{}. + Server creates a listening stream socket and sets the LOCAL_CREDS + socket option for it. Client connects to Server and sends N messages + with SCM_CREDS ancillary data object. Server should receive N messages, + the first message should have SCM_CREDS ancillary data object followed + by struct sockcred{}, each of next messages should have SCM_CREDS + ancillary data object followed by struct cmsgcred{}. + + 5: Sending, receiving timeval + + Client connects to Server and sends message with SCM_TIMESTAMP ancillary + data object. Server should receive one message with SCM_TIMESTAMP + ancillary data object followed by struct timeval{}. + + 6: Sending, receiving bintime + + Client connects to Server and sends message with SCM_BINTIME ancillary + data object. Server should receive one message with SCM_BINTIME + ancillary data object followed by struct bintime{}. + + 7: Checking cmsghdr.cmsg_len + + Client connects to Server and tries to send several messages with + SCM_CREDS ancillary data object that has wrong cmsg_len field in its + struct cmsghdr{}. All these attempts should fail, since cmsg_len + in all requests is less than CMSG_LEN(0). + + 8: Check LOCAL_PEERCRED socket option + + This test does not use ancillary data, but can be implemented here. + Client connects to Server. Both Client and Server verify that + credentials of the peer are correct using LOCAL_PEERCRED socket option. For SOCK_DGRAM sockets: ---------------------- 1: Sending, receiving cmsgcred - Client sends to Server two messages with data and control message - with SCM_CREDS type to Server. Server should receive two messages, - in both messages there should be data and control message with - SCM_CREDS type followed by struct cmsgcred{} and this structure - should contain correct information. + Client connects to Server and sends N messages with SCM_CREDS ancillary + data object. Server should receive N messages, each message should + have SCM_CREDS ancillary data object followed by struct cmsgcred{}. 2: Receiving sockcred - Server creates datagram socket and set socket option LOCAL_CREDS - for it. Client sends two messages with data to Server. Server should - receive two messages, in both messages there should be data and control - message with SCM_CREDS type followed by struct sockcred{} and this - structure should contain correct information. + Server creates datagram socket and sets the LOCAL_CREDS socket option + for it. Client sends N messages to Server. Server should receive N + messages, each message should have SCM_CREDS ancillary data object + followed by struct sockcred{}. 3: Sending cmsgcred, receiving sockcred - - Server creates datagram socket and set socket option LOCAL_CREDS - for it. Client sends one message with data and control message with - SOCK_CREDS type to Server. Server should receive one message with - data and control message with SCM_CREDS type followed by struct - sockcred{} and this structure should contain correct information. - - 4: Sending, receiving timestamp - - Client sends message with data and control message with SCM_TIMESTAMP - type to Server. Server should receive message with data and control - message with SCM_TIMESTAMP type followed by struct timeval{}. + + Server creates datagram socket and sets the LOCAL_CREDS socket option + for it. Client sends N messages with SCM_CREDS ancillary data object + to Server. Server should receive N messages, the first message should + have SCM_CREDS ancillary data object followed by struct sockcred{}, + each of next messages should have SCM_CREDS ancillary data object + followed by struct cmsgcred{}. + + 4: Sending, receiving timeval + + Client sends one message with SCM_TIMESTAMP ancillary data object + to Server. Server should receive one message with SCM_TIMESTAMP + ancillary data object followed by struct timeval{}. + + 5: Sending, receiving bintime + + Client sends one message with SCM_BINTIME ancillary data object + to Server. Server should receive one message with SCM_BINTIME + ancillary data object followed by struct bintime{}. + + 6: Checking cmsghdr.cmsg_len + + Client tries to send Server several messages with SCM_CREDS ancillary + data object that has wrong cmsg_len field in its struct cmsghdr{}. + All these attempts should fail, since cmsg_len in all requests is less + than CMSG_LEN(0). - Andrey Simonenko -simon@comsys.ntu-kpi.kiev.ua +andreysimonenko@users.sourceforge.net Modified: stable/8/tools/regression/sockets/unix_cmsg/unix_cmsg.c ============================================================================== --- stable/8/tools/regression/sockets/unix_cmsg/unix_cmsg.c Mon Apr 29 21:30:04 2013 (r250076) +++ stable/8/tools/regression/sockets/unix_cmsg/unix_cmsg.c Mon Apr 29 21:33:36 2013 (r250077) @@ -27,48 +27,46 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include +#include #include +#include #include #include -#include #include #include #include +#include #include #include -#include +#include #include #include +#include #include #include #include #include -#include #include /* * There are tables with tests descriptions and pointers to test * functions. Each t_*() function returns 0 if its test passed, - * -1 if its test failed (something wrong was found in local domain - * control messages), -2 if some system error occurred. If test - * function returns -2, then a program exits. + * -1 if its test failed, -2 if some system error occurred. + * If a test function returns -2, then a program exits. * - * Each test function completely control what to do (eg. fork or - * do not fork a client process). If a test function forks a client - * process, then it waits for its termination. If a return code of a - * client process is not equal to zero, or if a client process was - * terminated by a signal, then test function returns -2. + * If a test function forks a client process, then it waits for its + * termination. If a return code of a client process is not equal + * to zero, or if a client process was terminated by a signal, then + * a test function returns -1 or -2 depending on exit status of + * a client process. * - * Each test function and complete program are not optimized - * a lot to allow easy to modify tests. - * - * Each function which can block, is run under TIMEOUT, if timeout - * occurs, then test function returns -2 or a client process exits - * with nonzero return code. + * Each function which can block, is run under TIMEOUT. If timeout + * occurs, then a test function returns -2 or a client process exits + * with a non-zero return code. */ #ifndef LISTENQ @@ -76,207 +74,290 @@ __FBSDID("$FreeBSD$"); #endif #ifndef TIMEOUT -# define TIMEOUT 60 +# define TIMEOUT 2 #endif -#define EXTRA_CMSG_SPACE 512 /* Memory for not expected control data. */ - -static int t_cmsgcred(void), t_sockcred_stream1(void); -static int t_sockcred_stream2(void), t_cmsgcred_sockcred(void); -static int t_sockcred_dgram(void), t_timestamp(void); +static int t_cmsgcred(void); +static int t_sockcred_1(void); +static int t_sockcred_2(void); +static int t_cmsgcred_sockcred(void); +static int t_timeval(void); +static int t_bintime(void); +static int t_cmsg_len(void); +static int t_peercred(void); struct test_func { - int (*func)(void); /* Pointer to function. */ - const char *desc; /* Test description. */ -}; - -static struct test_func test_stream_tbl[] = { - { NULL, " 0: All tests" }, - { t_cmsgcred, " 1: Sending, receiving cmsgcred" }, - { t_sockcred_stream1, " 2: Receiving sockcred (listening socket has LOCAL_CREDS)" }, - { t_sockcred_stream2, " 3: Receiving sockcred (accepted socket has LOCAL_CREDS)" }, - { t_cmsgcred_sockcred, " 4: Sending cmsgcred, receiving sockcred" }, - { t_timestamp, " 5: Sending, receiving timestamp" }, - { NULL, NULL } + int (*func)(void); + const char *desc; }; -static struct test_func test_dgram_tbl[] = { - { NULL, " 0: All tests" }, - { t_cmsgcred, " 1: Sending, receiving cmsgcred" }, - { t_sockcred_dgram, " 2: Receiving sockcred" }, - { t_cmsgcred_sockcred, " 3: Sending cmsgcred, receiving sockcred" }, - { t_timestamp, " 4: Sending, receiving timestamp" }, - { NULL, NULL } +static const struct test_func test_stream_tbl[] = { + { + .func = NULL, + .desc = "All tests" + }, + { + .func = t_cmsgcred, + .desc = "Sending, receiving cmsgcred" + }, + { + .func = t_sockcred_1, + .desc = "Receiving sockcred (listening socket)" + }, + { + .func = t_sockcred_2, + .desc = "Receiving sockcred (accepted socket)" + }, + { + .func = t_cmsgcred_sockcred, + .desc = "Sending cmsgcred, receiving sockcred" + }, + { + .func = t_timeval, + .desc = "Sending, receiving timeval" + }, + { + .func = t_bintime, + .desc = "Sending, receiving bintime" + }, + { + .func = t_cmsg_len, + .desc = "Check cmsghdr.cmsg_len" + }, + { + .func = t_peercred, + .desc = "Check LOCAL_PEERCRED socket option" + } }; -#define TEST_STREAM_NO_MAX (sizeof(test_stream_tbl) / sizeof(struct test_func) - 2) -#define TEST_DGRAM_NO_MAX (sizeof(test_dgram_tbl) / sizeof(struct test_func) - 2) - -static const char *myname = "SERVER"; /* "SERVER" or "CLIENT" */ - -static int debug = 0; /* 1, if -d. */ -static int no_control_data = 0; /* 1, if -z. */ - -static u_int nfailed = 0; /* Number of failed tests. */ +#define TEST_STREAM_TBL_SIZE \ + (sizeof(test_stream_tbl) / sizeof(test_stream_tbl[0])) -static int sock_type; /* SOCK_STREAM or SOCK_DGRAM */ -static const char *sock_type_str; /* "SOCK_STREAM" or "SOCK_DGRAN" */ - -static char tempdir[] = "/tmp/unix_cmsg.XXXXXXX"; -static char serv_sock_path[PATH_MAX]; - -static char ipc_message[] = "hello"; - -#define IPC_MESSAGE_SIZE (sizeof(ipc_message)) - -static struct sockaddr_un servaddr; /* Server address. */ - -static sigjmp_buf env_alrm; +static const struct test_func test_dgram_tbl[] = { + { + .func = NULL, + .desc = "All tests" + }, + { + .func = t_cmsgcred, + .desc = "Sending, receiving cmsgcred" + }, + { + .func = t_sockcred_2, + .desc = "Receiving sockcred" + }, + { + .func = t_cmsgcred_sockcred, + .desc = "Sending cmsgcred, receiving sockcred" + }, + { + .func = t_timeval, + .desc = "Sending, receiving timeval" + }, + { + .func = t_bintime, + .desc = "Sending, receiving bintime" + }, + { + .func = t_cmsg_len, + .desc = "Check cmsghdr.cmsg_len" + } +}; -static uid_t my_uid; -static uid_t my_euid; -static gid_t my_gid; -static gid_t my_egid; +#define TEST_DGRAM_TBL_SIZE \ + (sizeof(test_dgram_tbl) / sizeof(test_dgram_tbl[0])) -/* - * my_gids[0] is EGID, next items are supplementary GIDs, - * my_ngids determines valid items in my_gids array. - */ -static gid_t my_gids[NGROUPS_MAX]; -static int my_ngids; +static bool debug = false; +static bool server_flag = true; +static bool send_data_flag = true; +static bool send_array_flag = true; +static bool failed_flag = false; + +static int sock_type; +static const char *sock_type_str; + +static const char *proc_name; + +static char work_dir[] = _PATH_TMP "unix_cmsg.XXXXXXX"; +static int serv_sock_fd; +static struct sockaddr_un serv_addr_sun; + +static struct { + char *buf_send; + char *buf_recv; + size_t buf_size; + u_int msg_num; +} ipc_msg; + +#define IPC_MSG_NUM_DEF 5 +#define IPC_MSG_NUM_MAX 10 +#define IPC_MSG_SIZE_DEF 7 +#define IPC_MSG_SIZE_MAX 128 + +static struct { + uid_t uid; + uid_t euid; + gid_t gid; + gid_t egid; + gid_t *gid_arr; + int gid_num; +} proc_cred; + +static pid_t client_pid; + +#define SYNC_SERVER 0 +#define SYNC_CLIENT 1 +#define SYNC_RECV 0 +#define SYNC_SEND 1 -static pid_t client_pid; /* PID of forked client. */ +static int sync_fd[2][2]; -#define dbgmsg(x) do { \ - if (debug) \ - logmsgx x ; \ -} while (/* CONSTCOND */0) +#define LOGMSG_SIZE 128 static void logmsg(const char *, ...) __printflike(1, 2); static void logmsgx(const char *, ...) __printflike(1, 2); +static void dbgmsg(const char *, ...) __printflike(1, 2); static void output(const char *, ...) __printflike(1, 2); -extern char *__progname; /* The name of program. */ - -/* - * Output the help message (-h switch). - */ static void -usage(int quick) +usage(bool verbose) { - const struct test_func *test_func; + u_int i; - fprintf(stderr, "Usage: %s [-dhz] [-t ] [testno]\n", - __progname); - if (quick) + printf("usage: %s [-dh] [-n num] [-s size] [-t type] " + "[-z value] [testno]\n", getprogname()); + if (!verbose) return; - fprintf(stderr, "\n Options are:\n\ - -d\t\t\tOutput debugging information\n\ - -h\t\t\tOutput this help message and exit\n\ - -t \t\tRun test only for the given socket type:\n\ -\t\t\tstream or dgram\n\ - -z\t\t\tDo not send real control data if possible\n\n"); - fprintf(stderr, " Available tests for stream sockets:\n"); - for (test_func = test_stream_tbl; test_func->desc != NULL; ++test_func) - fprintf(stderr, " %s\n", test_func->desc); - fprintf(stderr, "\n Available tests for datagram sockets:\n"); - for (test_func = test_dgram_tbl; test_func->desc != NULL; ++test_func) - fprintf(stderr, " %s\n", test_func->desc); + printf("\n Options are:\n\ + -d Output debugging information\n\ + -h Output the help message and exit\n\ + -n num Number of messages to send\n\ + -s size Specify size of data for IPC\n\ + -t type Specify socket type (stream, dgram) for tests\n\ + -z value Do not send data in a message (bit 0x1), do not send\n\ + data array associated with a cmsghdr structure (bit 0x2)\n\ + testno Run one test by its number (require the -t option)\n\n"); + printf(" Available tests for stream sockets:\n"); + for (i = 0; i < TEST_STREAM_TBL_SIZE; ++i) + printf(" %u: %s\n", i, test_stream_tbl[i].desc); + printf("\n Available tests for datagram sockets:\n"); + for (i = 0; i < TEST_DGRAM_TBL_SIZE; ++i) + printf(" %u: %s\n", i, test_dgram_tbl[i].desc); } -/* - * printf-like function for outputting to STDOUT_FILENO. - */ static void output(const char *format, ...) { - char buf[128]; + char buf[LOGMSG_SIZE]; va_list ap; va_start(ap, format); if (vsnprintf(buf, sizeof(buf), format, ap) < 0) - err(EX_SOFTWARE, "output: vsnprintf failed"); + err(EXIT_FAILURE, "output: vsnprintf failed"); write(STDOUT_FILENO, buf, strlen(buf)); va_end(ap); } -/* - * printf-like function for logging, also outputs message for errno. - */ static void logmsg(const char *format, ...) { - char buf[128]; + char buf[LOGMSG_SIZE]; va_list ap; int errno_save; - errno_save = errno; /* Save errno. */ - + errno_save = errno; va_start(ap, format); if (vsnprintf(buf, sizeof(buf), format, ap) < 0) - err(EX_SOFTWARE, "logmsg: vsnprintf failed"); + err(EXIT_FAILURE, "logmsg: vsnprintf failed"); if (errno_save == 0) - output("%s: %s\n", myname, buf); + output("%s: %s\n", proc_name, buf); else - output("%s: %s: %s\n", myname, buf, strerror(errno_save)); + output("%s: %s: %s\n", proc_name, buf, strerror(errno_save)); va_end(ap); + errno = errno_save; +} + +static void +vlogmsgx(const char *format, va_list ap) +{ + char buf[LOGMSG_SIZE]; + + if (vsnprintf(buf, sizeof(buf), format, ap) < 0) + err(EXIT_FAILURE, "logmsgx: vsnprintf failed"); + output("%s: %s\n", proc_name, buf); - errno = errno_save; /* Restore errno. */ } -/* - * printf-like function for logging, do not output message for errno. - */ static void logmsgx(const char *format, ...) { - char buf[128]; va_list ap; va_start(ap, format); - if (vsnprintf(buf, sizeof(buf), format, ap) < 0) - err(EX_SOFTWARE, "logmsgx: vsnprintf failed"); - output("%s: %s\n", myname, buf); + vlogmsgx(format, ap); va_end(ap); } -/* - * Run tests from testno1 to testno2. - */ +static void +dbgmsg(const char *format, ...) +{ + va_list ap; + + if (debug) { + va_start(ap, format); + vlogmsgx(format, ap); + va_end(ap); + } +} + static int -run_tests(u_int testno1, u_int testno2) +run_tests(int type, u_int testno1) { - const struct test_func *test_func; - u_int i, nfailed1; + const struct test_func *tf; + u_int i, testno2, failed_num; - output("Running tests for %s sockets:\n", sock_type_str); - test_func = (sock_type == SOCK_STREAM ? - test_stream_tbl : test_dgram_tbl) + testno1; + sock_type = type; + if (type == SOCK_STREAM) { + sock_type_str = "SOCK_STREAM"; + tf = test_stream_tbl; + i = TEST_STREAM_TBL_SIZE - 1; + } else { + sock_type_str = "SOCK_DGRAM"; + tf = test_dgram_tbl; + i = TEST_DGRAM_TBL_SIZE - 1; + } + if (testno1 == 0) { + testno1 = 1; + testno2 = i; + } else + testno2 = testno1; - nfailed1 = 0; - for (i = testno1; i <= testno2; ++test_func, ++i) { - output(" %s\n", test_func->desc); - switch (test_func->func()) { + output("Running tests for %s sockets:\n", sock_type_str); + failed_num = 0; + for (i = testno1, tf += testno1; i <= testno2; ++tf, ++i) { + output(" %u: %s\n", i, tf->desc); + switch (tf->func()) { case -1: - ++nfailed1; + ++failed_num; break; case -2: - logmsgx("some system error occurred, exiting"); + logmsgx("some system error or timeout occurred"); return (-1); } } - nfailed += nfailed1; + if (failed_num != 0) + failed_flag = true; if (testno1 != testno2) { - if (nfailed1 == 0) - output("-- all tests were passed!\n"); + if (failed_num == 0) + output("-- all tests passed!\n"); else - output("-- %u test%s failed!\n", nfailed1, - nfailed1 == 1 ? "" : "s"); + output("-- %u test%s failed!\n", + failed_num, failed_num == 1 ? "" : "s"); } else { - if (nfailed == 0) - output("-- test was passed!\n"); + if (failed_num == 0) + output("-- test passed!\n"); else output("-- test failed!\n"); } @@ -284,183 +365,322 @@ run_tests(u_int testno1, u_int testno2) return (0); } -/* ARGSUSED */ -static void -sig_alrm(int signo __unused) +static int +init(void) +{ + struct sigaction sigact; + size_t idx; + int rv; + + proc_name = "SERVER"; + + sigact.sa_handler = SIG_IGN; + sigact.sa_flags = 0; + sigemptyset(&sigact.sa_mask); + if (sigaction(SIGPIPE, &sigact, (struct sigaction *)NULL) < 0) { + logmsg("init: sigaction"); + return (-1); + } + + if (ipc_msg.buf_size == 0) + ipc_msg.buf_send = ipc_msg.buf_recv = NULL; + else { + ipc_msg.buf_send = malloc(ipc_msg.buf_size); + ipc_msg.buf_recv = malloc(ipc_msg.buf_size); + if (ipc_msg.buf_send == NULL || ipc_msg.buf_recv == NULL) { + logmsg("init: malloc"); + return (-1); + } + for (idx = 0; idx < ipc_msg.buf_size; ++idx) + ipc_msg.buf_send[idx] = (char)idx; + } + + proc_cred.uid = getuid(); + proc_cred.euid = geteuid(); + proc_cred.gid = getgid(); + proc_cred.egid = getegid(); + proc_cred.gid_num = getgroups(0, (gid_t *)NULL); + if (proc_cred.gid_num < 0) { + logmsg("init: getgroups"); + return (-1); + } + proc_cred.gid_arr = malloc(proc_cred.gid_num * + sizeof(*proc_cred.gid_arr)); + if (proc_cred.gid_arr == NULL) { + logmsg("init: malloc"); + return (-1); + } + if (getgroups(proc_cred.gid_num, proc_cred.gid_arr) < 0) { + logmsg("init: getgroups"); + return (-1); + } + + memset(&serv_addr_sun, 0, sizeof(serv_addr_sun)); + rv = snprintf(serv_addr_sun.sun_path, sizeof(serv_addr_sun.sun_path), + "%s/%s", work_dir, proc_name); + if (rv < 0) { + logmsg("init: snprintf"); + return (-1); + } + if ((size_t)rv >= sizeof(serv_addr_sun.sun_path)) { + logmsgx("init: not enough space for socket pathname"); + return (-1); + } + serv_addr_sun.sun_family = PF_LOCAL; + serv_addr_sun.sun_len = SUN_LEN(&serv_addr_sun); + + return (0); +} + +static int +client_fork(void) { - siglongjmp(env_alrm, 1); + int fd1, fd2; + + if (pipe(sync_fd[SYNC_SERVER]) < 0 || + pipe(sync_fd[SYNC_CLIENT]) < 0) { + logmsg("client_fork: pipe"); + return (-1); + } + client_pid = fork(); + if (client_pid == (pid_t)-1) { + logmsg("client_fork: fork"); + return (-1); + } + if (client_pid == 0) { + proc_name = "CLIENT"; + server_flag = false; + fd1 = sync_fd[SYNC_SERVER][SYNC_RECV]; + fd2 = sync_fd[SYNC_CLIENT][SYNC_SEND]; + } else { + fd1 = sync_fd[SYNC_SERVER][SYNC_SEND]; + fd2 = sync_fd[SYNC_CLIENT][SYNC_RECV]; + } + if (close(fd1) < 0 || close(fd2) < 0) { + logmsg("client_fork: close"); + return (-1); + } + return (client_pid != 0); } -/* - * Initialize signals handlers. - */ static void -sig_init(void) +client_exit(int rv) +{ + if (close(sync_fd[SYNC_SERVER][SYNC_SEND]) < 0 || + close(sync_fd[SYNC_CLIENT][SYNC_RECV]) < 0) { + logmsg("client_exit: close"); + rv = -1; + } + rv = rv == 0 ? EXIT_SUCCESS : -rv; + dbgmsg("exit: code %d", rv); + _exit(rv); +} + +static int +client_wait(void) { - struct sigaction sa; + int status; + pid_t pid; - sa.sa_handler = SIG_IGN; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - if (sigaction(SIGPIPE, &sa, (struct sigaction *)NULL) < 0) - err(EX_OSERR, "sigaction(SIGPIPE)"); - - sa.sa_handler = sig_alrm; - if (sigaction(SIGALRM, &sa, (struct sigaction *)NULL) < 0) - err(EX_OSERR, "sigaction(SIGALRM)"); + dbgmsg("waiting for client"); + + if (close(sync_fd[SYNC_SERVER][SYNC_RECV]) < 0 || + close(sync_fd[SYNC_CLIENT][SYNC_SEND]) < 0) { + logmsg("client_wait: close"); + return (-1); + } + + pid = waitpid(client_pid, &status, 0); + if (pid == (pid_t)-1) { + logmsg("client_wait: waitpid"); + return (-1); + } + + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) != EXIT_SUCCESS) { + logmsgx("client exit status is %d", + WEXITSTATUS(status)); + return (-WEXITSTATUS(status)); + } + } else { + if (WIFSIGNALED(status)) + logmsgx("abnormal termination of client, signal %d%s", + WTERMSIG(status), WCOREDUMP(status) ? + " (core file generated)" : ""); + else + logmsgx("termination of client, unknown status"); + return (-1); + } + + return (0); } int main(int argc, char *argv[]) { const char *errstr; - int opt, dgramflag, streamflag; - u_int testno1, testno2; - - dgramflag = streamflag = 0; - while ((opt = getopt(argc, argv, "dht:z")) != -1) + u_int testno, zvalue; + int opt, rv; + bool dgram_flag, stream_flag; + + ipc_msg.buf_size = IPC_MSG_SIZE_DEF; + ipc_msg.msg_num = IPC_MSG_NUM_DEF; + dgram_flag = stream_flag = false; + while ((opt = getopt(argc, argv, "dhn:s:t:z:")) != -1) switch (opt) { case 'd': - debug = 1; + debug = true; break; case 'h': - usage(0); - return (EX_OK); + usage(true); + return (EXIT_SUCCESS); + case 'n': + ipc_msg.msg_num = strtonum(optarg, 1, + IPC_MSG_NUM_MAX, &errstr); + if (errstr != NULL) + errx(EXIT_FAILURE, "option -n: number is %s", + errstr); + break; + case 's': + ipc_msg.buf_size = strtonum(optarg, 0, + IPC_MSG_SIZE_MAX, &errstr); + if (errstr != NULL) + errx(EXIT_FAILURE, "option -s: number is %s", + errstr); + break; case 't': if (strcmp(optarg, "stream") == 0) - streamflag = 1; + stream_flag = true; else if (strcmp(optarg, "dgram") == 0) - dgramflag = 1; + dgram_flag = true; else - errx(EX_USAGE, "wrong socket type in -t option"); + errx(EXIT_FAILURE, "option -t: " + "wrong socket type"); break; case 'z': - no_control_data = 1; + zvalue = strtonum(optarg, 0, 3, &errstr); + if (errstr != NULL) + errx(EXIT_FAILURE, "option -z: number is %s", + errstr); + if (zvalue & 0x1) + send_data_flag = false; + if (zvalue & 0x2) + send_array_flag = false; break; - case '?': default: - usage(1); - return (EX_USAGE); + usage(false); + return (EXIT_FAILURE); } if (optind < argc) { if (optind + 1 != argc) - errx(EX_USAGE, "too many arguments"); - testno1 = strtonum(argv[optind], 0, UINT_MAX, &errstr); + errx(EXIT_FAILURE, "too many arguments"); + testno = strtonum(argv[optind], 0, UINT_MAX, &errstr); if (errstr != NULL) - errx(EX_USAGE, "wrong test number: %s", errstr); + errx(EXIT_FAILURE, "test number is %s", errstr); + if (stream_flag && testno >= TEST_STREAM_TBL_SIZE) + errx(EXIT_FAILURE, "given test %u for stream " + "sockets does not exist", testno); + if (dgram_flag && testno >= TEST_DGRAM_TBL_SIZE) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 21:49:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 030D6C9D; Mon, 29 Apr 2013 21:49:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E7065154A; Mon, 29 Apr 2013 21:49:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLnNhS004361; Mon, 29 Apr 2013 21:49:23 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLnNLJ004355; Mon, 29 Apr 2013 21:49:23 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304292149.r3TLnNLJ004355@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 29 Apr 2013 21:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250078 - in stable/9: share/man/man4 sys/dev/atkbdc sys/sys usr.sbin/moused X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:49:24 -0000 Author: jkim Date: Mon Apr 29 21:49:22 2013 New Revision: 250078 URL: http://svnweb.freebsd.org/changeset/base/250078 Log: MFC: r248478 Add preliminary support for IBM/Lenovo TrackPoint. Modified: stable/9/share/man/man4/psm.4 stable/9/sys/dev/atkbdc/psm.c stable/9/sys/sys/mouse.h stable/9/usr.sbin/moused/moused.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.sbin/moused/ (props changed) Modified: stable/9/share/man/man4/psm.4 ============================================================================== --- stable/9/share/man/man4/psm.4 Mon Apr 29 21:33:36 2013 (r250077) +++ stable/9/share/man/man4/psm.4 Mon Apr 29 21:49:22 2013 (r250078) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2012 +.Dd March 18, 2013 .Dt PSM 4 .Os .Sh NAME @@ -339,6 +339,12 @@ at boot-time. This will enable .Nm to handle packets from guest devices (sticks) and extra buttons. +Similarly, extended support for IBM/Lenovo TrackPoint can be enabled +by setting +.Va hw.psm.trackpoint_support +to +.Em 1 +at boot-time. .Pp Tap and drag gestures can be disabled by setting .Va hw.psm.tap_enabled @@ -832,8 +838,8 @@ In contrast, some pad products, e.g.\& s and Interlink VersaPad, treat the tapping action as fourth button events. .Pp -It is reported that ALPS GlidePoint, Synaptics Touchpad, and -Interlink VersaPad require +It is reported that ALPS GlidePoint, Synaptics Touchpad, IBM/Lenovo +TrackPoint, and Interlink VersaPad require .Em INITAFTERSUSPEND flag in order to recover from suspended state. This flag is automatically set when one of these devices is detected by the Modified: stable/9/sys/dev/atkbdc/psm.c ============================================================================== --- stable/9/sys/dev/atkbdc/psm.c Mon Apr 29 21:33:36 2013 (r250077) +++ stable/9/sys/dev/atkbdc/psm.c Mon Apr 29 21:49:22 2013 (r250078) @@ -260,6 +260,38 @@ typedef struct synapticsaction { int in_vscroll; } synapticsaction_t; +enum { + TRACKPOINT_SYSCTL_SENSITIVITY, + TRACKPOINT_SYSCTL_NEGATIVE_INERTIA, + TRACKPOINT_SYSCTL_UPPER_PLATEAU, + TRACKPOINT_SYSCTL_BACKUP_RANGE, + TRACKPOINT_SYSCTL_DRAG_HYSTERESIS, + TRACKPOINT_SYSCTL_MINIMUM_DRAG, + TRACKPOINT_SYSCTL_UP_THRESHOLD, + TRACKPOINT_SYSCTL_THRESHOLD, + TRACKPOINT_SYSCTL_JENKS_CURVATURE, + TRACKPOINT_SYSCTL_Z_TIME, + TRACKPOINT_SYSCTL_PRESS_TO_SELECT, + TRACKPOINT_SYSCTL_SKIP_BACKUPS +}; + +typedef struct trackpointinfo { + struct sysctl_ctx_list sysctl_ctx; + struct sysctl_oid *sysctl_tree; + int sensitivity; + int inertia; + int uplateau; + int reach; + int draghys; + int mindrag; + int upthresh; + int threshold; + int jenks; + int ztime; + int pts; + int skipback; +} trackpointinfo_t; + /* driver control block */ struct psm_softc { /* Driver status information */ int unit; @@ -274,6 +306,8 @@ struct psm_softc { /* Driver status inf synapticshw_t synhw; /* Synaptics hardware information */ synapticsinfo_t syninfo; /* Synaptics configuration */ synapticsaction_t synaction; /* Synaptics action context */ + int tphw; /* TrackPoint hardware information */ + trackpointinfo_t tpinfo; /* TrackPoint configuration */ mousemode_t mode; /* operation mode */ mousemode_t dflt_mode; /* default operation mode */ mousestatus_t status; /* accumulated mouse movement */ @@ -344,6 +378,9 @@ TUNABLE_INT("hw.psm.tap_enabled", &tap_e static int synaptics_support = 0; TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support); +static int trackpoint_support = 0; +TUNABLE_INT("hw.psm.trackpoint_support", &trackpoint_support); + static int verbose = PSM_DEBUG; TUNABLE_INT("debug.psm.loglevel", &verbose); @@ -432,6 +469,7 @@ static probefunc_t enable_4dmouse; static probefunc_t enable_4dplus; static probefunc_t enable_mmanplus; static probefunc_t enable_synaptics; +static probefunc_t enable_trackpoint; static probefunc_t enable_versapad; static struct { @@ -466,6 +504,8 @@ static struct { 0x80, MOUSE_PS2_PACKETSIZE, enable_kmouse }, { MOUSE_MODEL_VERSAPAD, /* Interlink electronics VersaPad */ 0xe8, MOUSE_PS2VERSA_PACKETSIZE, enable_versapad }, + { MOUSE_MODEL_TRACKPOINT, /* IBM/Lenovo TrackPoint */ + 0xc0, MOUSE_PS2_PACKETSIZE, enable_trackpoint }, { MOUSE_MODEL_GENERIC, 0xc0, MOUSE_PS2_PACKETSIZE, NULL }, }; @@ -708,6 +748,7 @@ model_name(int model) { MOUSE_MODEL_4DPLUS, "4D+ Mouse" }, { MOUSE_MODEL_SYNAPTICS, "Synaptics Touchpad" }, { MOUSE_MODEL_GENERIC, "Generic PS/2 mouse" }, + { MOUSE_MODEL_TRACKPOINT, "IBM/Lenovo TrackPoint" }, { MOUSE_MODEL_UNKNOWN, "Unknown" }, }; int i; @@ -1452,7 +1493,7 @@ psmattach(device_t dev) sc->config |= PSM_CONFIG_INITAFTERSUSPEND; break; default: - if (sc->synhw.infoMajor >= 4) + if (sc->synhw.infoMajor >= 4 || sc->tphw > 0) sc->config |= PSM_CONFIG_INITAFTERSUSPEND; break; } @@ -3440,6 +3481,7 @@ psmsoftintr(void *arg) goto next; break; + case MOUSE_MODEL_TRACKPOINT: case MOUSE_MODEL_GENERIC: default: break; @@ -4472,6 +4514,233 @@ enable_synaptics(KBDC kbdc, struct psm_s return (TRUE); } +/* IBM/Lenovo TrackPoint */ +static int +trackpoint_command(KBDC kbdc, int cmd, int loc, int val) +{ + const int seq[] = { 0xe2, cmd, loc, val }; + int i; + + for (i = 0; i < nitems(seq); i++) + if (send_aux_command(kbdc, seq[i]) != PSM_ACK) + return (EIO); + return (0); +} + +#define PSM_TPINFO(x) offsetof(struct psm_softc, tpinfo.x) +#define TPMASK 0 +#define TPLOC 1 +#define TPINFO 2 + +static int +trackpoint_sysctl(SYSCTL_HANDLER_ARGS) +{ + static const int data[][3] = { + { 0x00, 0x4a, PSM_TPINFO(sensitivity) }, + { 0x00, 0x4d, PSM_TPINFO(inertia) }, + { 0x00, 0x60, PSM_TPINFO(uplateau) }, + { 0x00, 0x57, PSM_TPINFO(reach) }, + { 0x00, 0x58, PSM_TPINFO(draghys) }, + { 0x00, 0x59, PSM_TPINFO(mindrag) }, + { 0x00, 0x5a, PSM_TPINFO(upthresh) }, + { 0x00, 0x5c, PSM_TPINFO(threshold) }, + { 0x00, 0x5d, PSM_TPINFO(jenks) }, + { 0x00, 0x5e, PSM_TPINFO(ztime) }, + { 0x01, 0x2c, PSM_TPINFO(pts) }, + { 0x08, 0x2d, PSM_TPINFO(skipback) } + }; + struct psm_softc *sc; + int error, newval, *oldvalp; + const int *tp; + + if (arg1 == NULL || arg2 < 0 || arg2 >= nitems(data)) + return (EINVAL); + sc = arg1; + tp = data[arg2]; + oldvalp = (int *)((intptr_t)sc + tp[TPINFO]); + newval = *oldvalp; + error = sysctl_handle_int(oidp, &newval, 0, req); + if (error != 0) + return (error); + if (newval == *oldvalp) + return (0); + if (newval < 0 || newval > (tp[TPMASK] == 0 ? 255 : 1)) + return (EINVAL); + error = trackpoint_command(sc->kbdc, tp[TPMASK] == 0 ? 0x81 : 0x47, + tp[TPLOC], tp[TPMASK] == 0 ? newval : tp[TPMASK]); + if (error != 0) + return (error); + *oldvalp = newval; + + return (0); +} + +static void +trackpoint_sysctl_create_tree(struct psm_softc *sc) +{ + + if (sc->tpinfo.sysctl_tree != NULL) + return; + + /* Attach extra trackpoint sysctl nodes under hw.psm.trackpoint */ + sysctl_ctx_init(&sc->tpinfo.sysctl_ctx); + sc->tpinfo.sysctl_tree = SYSCTL_ADD_NODE(&sc->tpinfo.sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_hw_psm), OID_AUTO, "trackpoint", CTLFLAG_RD, + 0, "IBM/Lenovo TrackPoint"); + + /* hw.psm.trackpoint.sensitivity */ + sc->tpinfo.sensitivity = 0x64; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "sensitivity", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_SENSITIVITY, + trackpoint_sysctl, "I", + "Sensitivity"); + + /* hw.psm.trackpoint.negative_inertia */ + sc->tpinfo.inertia = 0x06; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "negative_inertia", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_NEGATIVE_INERTIA, + trackpoint_sysctl, "I", + "Negative inertia factor"); + + /* hw.psm.trackpoint.upper_plateau */ + sc->tpinfo.uplateau = 0x61; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "upper_plateau", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_UPPER_PLATEAU, + trackpoint_sysctl, "I", + "Transfer function upper plateau speed"); + + /* hw.psm.trackpoint.backup_range */ + sc->tpinfo.reach = 0x0a; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "backup_range", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_BACKUP_RANGE, + trackpoint_sysctl, "I", + "Backup range"); + + /* hw.psm.trackpoint.drag_hysteresis */ + sc->tpinfo.draghys = 0xff; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "drag_hysteresis", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_DRAG_HYSTERESIS, + trackpoint_sysctl, "I", + "Drag hysteresis"); + + /* hw.psm.trackpoint.minimum_drag */ + sc->tpinfo.mindrag = 0x14; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "minimum_drag", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_MINIMUM_DRAG, + trackpoint_sysctl, "I", + "Minimum drag"); + + /* hw.psm.trackpoint.up_threshold */ + sc->tpinfo.upthresh = 0xff; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "up_threshold", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_UP_THRESHOLD, + trackpoint_sysctl, "I", + "Up threshold for release"); + + /* hw.psm.trackpoint.threshold */ + sc->tpinfo.threshold = 0x08; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "threshold", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_THRESHOLD, + trackpoint_sysctl, "I", + "Threshold"); + + /* hw.psm.trackpoint.jenks_curvature */ + sc->tpinfo.jenks = 0x87; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "jenks_curvature", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_JENKS_CURVATURE, + trackpoint_sysctl, "I", + "Jenks curvature"); + + /* hw.psm.trackpoint.z_time */ + sc->tpinfo.ztime = 0x26; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "z_time", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_Z_TIME, + trackpoint_sysctl, "I", + "Z time constant"); + + /* hw.psm.trackpoint.press_to_select */ + sc->tpinfo.pts = 0x00; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "press_to_select", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_PRESS_TO_SELECT, + trackpoint_sysctl, "I", + "Press to Select"); + + /* hw.psm.trackpoint.skip_backups */ + sc->tpinfo.skipback = 0x00; + SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, + "skip_backups", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, TRACKPOINT_SYSCTL_SKIP_BACKUPS, + trackpoint_sysctl, "I", + "Skip backups from drags"); +} + +static int +enable_trackpoint(KBDC kbdc, struct psm_softc *sc) +{ + int id; + + kbdc = sc->kbdc; + + if (send_aux_command(kbdc, 0xe1) != PSM_ACK || + read_aux_data(kbdc) != 0x01) + return (FALSE); + id = read_aux_data(kbdc); + if (id < 0x01) + return (FALSE); + if (sc != NULL) + sc->tphw = id; + if (!trackpoint_support) + return (FALSE); + + if (sc != NULL) { + /* Create sysctl tree. */ + trackpoint_sysctl_create_tree(sc); + + trackpoint_command(kbdc, 0x81, 0x4a, sc->tpinfo.sensitivity); + trackpoint_command(kbdc, 0x81, 0x4d, sc->tpinfo.inertia); + trackpoint_command(kbdc, 0x81, 0x60, sc->tpinfo.uplateau); + trackpoint_command(kbdc, 0x81, 0x57, sc->tpinfo.reach); + trackpoint_command(kbdc, 0x81, 0x58, sc->tpinfo.draghys); + trackpoint_command(kbdc, 0x81, 0x59, sc->tpinfo.mindrag); + trackpoint_command(kbdc, 0x81, 0x5a, sc->tpinfo.upthresh); + trackpoint_command(kbdc, 0x81, 0x5c, sc->tpinfo.threshold); + trackpoint_command(kbdc, 0x81, 0x5d, sc->tpinfo.jenks); + trackpoint_command(kbdc, 0x81, 0x5e, sc->tpinfo.ztime); + if (sc->tpinfo.pts == 0x01) + trackpoint_command(kbdc, 0x47, 0x2c, 0x01); + if (sc->tpinfo.skipback == 0x01) + trackpoint_command(kbdc, 0x47, 0x2d, 0x08); + + sc->hw.hwid = id; + sc->hw.buttons = 3; + } + + return (TRUE); +} + /* Interlink electronics VersaPad */ static int enable_versapad(KBDC kbdc, struct psm_softc *sc) Modified: stable/9/sys/sys/mouse.h ============================================================================== --- stable/9/sys/sys/mouse.h Mon Apr 29 21:33:36 2013 (r250077) +++ stable/9/sys/sys/mouse.h Mon Apr 29 21:49:22 2013 (r250078) @@ -141,6 +141,7 @@ typedef struct synapticshw { #define MOUSE_MODEL_4D 11 #define MOUSE_MODEL_4DPLUS 12 #define MOUSE_MODEL_SYNAPTICS 13 +#define MOUSE_MODEL_TRACKPOINT 14 typedef struct mousemode { int protocol; /* MOUSE_PROTO_XXX */ Modified: stable/9/usr.sbin/moused/moused.c ============================================================================== --- stable/9/usr.sbin/moused/moused.c Mon Apr 29 21:33:36 2013 (r250077) +++ stable/9/usr.sbin/moused/moused.c Mon Apr 29 21:49:22 2013 (r250078) @@ -245,6 +245,7 @@ static symtab_t rmodels[] = { { "4D Mouse", MOUSE_MODEL_4D, 0 }, { "4D+ Mouse", MOUSE_MODEL_4DPLUS, 0 }, { "Synaptics Touchpad", MOUSE_MODEL_SYNAPTICS, 0 }, + { "TrackPoint", MOUSE_MODEL_TRACKPOINT, 0 }, { "generic", MOUSE_MODEL_GENERIC, 0 }, { NULL, MOUSE_MODEL_UNKNOWN, 0 }, }; From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 22:48:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 65E398F3; Mon, 29 Apr 2013 22:48:54 +0000 (UTC) (envelope-from carl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47BBE1CE4; Mon, 29 Apr 2013 22:48:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TMmsqW027093; Mon, 29 Apr 2013 22:48:54 GMT (envelope-from carl@svn.freebsd.org) Received: (from carl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TMmrqT027087; Mon, 29 Apr 2013 22:48:53 GMT (envelope-from carl@svn.freebsd.org) Message-Id: <201304292248.r3TMmrqT027087@svn.freebsd.org> From: Carl Delsey Date: Mon, 29 Apr 2013 22:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250079 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ntb sys/dev/ntb/if_ntb sys/dev/ntb/ntb_hw sys/modules sys/modules/ntb sys/modules/ntb/if_ntb sys/modules/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 22:48:54 -0000 Author: carl Date: Mon Apr 29 22:48:53 2013 New Revision: 250079 URL: http://svnweb.freebsd.org/changeset/base/250079 Log: Add a new driver to support the Intel Non-Transparent Bridge(NTB). The NTB allows you to connect two systems with this device using a PCI-e link. The driver is made of two modules: - ntb_hw which is a basic hardware abstraction layer for the device. - if_ntb which implements the ntb network device and the communication protocol. The driver is limited at the moment to CPU memcpy instead of using DMA, and only Back-to-Back mode is supported. Also the network device isn't full featured yet. These changes will be coming soon. The DMA change will also bring in the ioat driver from the project branch it is on now. This is an initial port of the GPL/BSD Linux driver contributed by Jon Mason from Intel. Any bugs are my contributions. Sponsored by: Intel Reviewed by: jimharris, joel (man page only) Approved by: jimharris (mentor) Added: head/share/man/man4/ntb.4 (contents, props changed) head/sys/dev/ntb/ head/sys/dev/ntb/if_ntb/ head/sys/dev/ntb/if_ntb/if_ntb.c (contents, props changed) head/sys/dev/ntb/ntb_hw/ head/sys/dev/ntb/ntb_hw/ntb_hw.c (contents, props changed) head/sys/dev/ntb/ntb_hw/ntb_hw.h (contents, props changed) head/sys/dev/ntb/ntb_hw/ntb_regs.h (contents, props changed) head/sys/modules/ntb/ head/sys/modules/ntb/Makefile (contents, props changed) head/sys/modules/ntb/if_ntb/ head/sys/modules/ntb/if_ntb/Makefile (contents, props changed) head/sys/modules/ntb/ntb_hw/ head/sys/modules/ntb/ntb_hw/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Apr 29 21:49:22 2013 (r250078) +++ head/share/man/man4/Makefile Mon Apr 29 22:48:53 2013 (r250079) @@ -333,6 +333,7 @@ MAN= aac.4 \ ng_vlan.4 \ nmdm.4 \ nsp.4 \ + ${_ntb.4} \ null.4 \ ${_nvd.4} \ ${_nve.4} \ @@ -647,6 +648,7 @@ MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=${_nfe.4} ${_if_nfe.4} MLINKS+=nge.4 if_nge.4 +MLINKS+=${_ntb.4} ${_if_ntb.4} ${_ntb_hw.4} MLINKS+=${_nve.4} ${_if_nve.4} MLINKS+=${_nxge.4} ${_if_nxge.4} MLINKS+=patm.4 if_patm.4 @@ -784,6 +786,9 @@ MLINKS+=lindev.4 full.4 .if ${MACHINE_CPUARCH} == "amd64" _bhyve.4= bhyve.4 +_if_ntb.4= if_ntb.4 +_ntb.4= ntb.4 +_ntb_hw.4= ntb_hw.4 _qlxgb.4= qlxgb.4 _sfxge.4= sfxge.4 Added: head/share/man/man4/ntb.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ntb.4 Mon Apr 29 22:48:53 2013 (r250079) @@ -0,0 +1,114 @@ +.\" +.\" Copyright (c) 2013 Intel Corporation +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" substantially similar to the "NO WARRANTY" disclaimer below +.\" ("Disclaimer") and any redistribution must be conditioned upon +.\" including a substantially similar Disclaimer requirement for further +.\" binary redistribution. +.\" +.\" NO WARRANTY +.\" 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 MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +.\" +.\" ntb driver man page. +.\" +.\" Author: Carl Delsey +.\" +.\" $FreeBSD$ +.\" +.Dd Apr 11, 2013 +.Dt NTB 4 +.Os +.Sh NAME +.Nm ntb , +.Nm ntb_hw , +.Nm if_ntb +.Nd Intel(R) Non-Transparent Bridge driver +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ntb_hw" +.Cd "device if_ntb" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ntb_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Non-Transparent Bridge (NTB) in the Intel S1200, +Xeon E3 and Xeon E5 processor families. +.Pp +The NTB allows you to connect two computer systems using a PCI-e link if they +have the correct equipment and connectors. +.Sh CONFIGURATION +The NTB memory windows need to be configured by the BIOS. +If your BIOS allows you to set their size, you should set the size of both +memory windows to 1 MiB. +This needs to be done on both systems. +.Pp +Each system needs to have a different IP address assigned. +The MAC address is randomly generated. +Also for maximum performance, the MTU should be set to 16 kiB. +This can be down by adding the line below to +.Xr rc.conf 5 : +.Bd -literal -offset indent +ifconfig_ntb0="inet 192.168.1.10 netmask 255.255.255.0 mtu 16384" +.Ed +.Pp +And on the second system : +.Bd -literal -offset indent +ifconfig_ntb0="inet 192.168.1.11 netmask 255.255.255.0 mtu 16384" +.Ed +.Pp +If you are using the UDP protocol, you may want to increase the +.Va net.inet.udp.maxdgram +.Xr sysctl 8 +variable. +.Sh SEE ALSO +.Xr rc.conf 5 , +.Xr sysctl 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by Intel and originally written by +.An Carl Delsey Aq carl@FreeBSD.org. +.Sh BUGS +If the driver is unloaded, it cannot be reloaded without a system reboot. +.Pp +The network support is limited. +It isn't fully configurable yet. +It also isn't integrated into +.Xr netgraph 4 +or +.Xr bpf 4 . +.Pp +NTB to Root Port mode is not yet supported. +.Pp +There is no way to protect your system from malicious behavior on the other +system once the link is brought up. +Anyone with root or kernel access on the other system can read or write to +any location on your system. +In other words, only connect two systems that completely trust each other. Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Apr 29 21:49:22 2013 (r250078) +++ head/sys/amd64/conf/NOTES Mon Apr 29 22:48:53 2013 (r250079) @@ -366,6 +366,10 @@ device iwn6000fw device iwn6050fw device wpifw +# Intel Non-Transparent Bridge (NTB) hardware +device ntb_hw # Hardware Abstraction Layer for the NTB +device if_ntb # Simulated ethernet device using the NTB + # #XXX this stores pointers in a 32bit field that is defined by the hardware #device pst Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Apr 29 21:49:22 2013 (r250078) +++ head/sys/conf/files.amd64 Mon Apr 29 22:48:53 2013 (r250079) @@ -211,6 +211,8 @@ dev/kbd/kbd.c optional atkbd | sc | uk dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev dev/nfe/if_nfe.c optional nfe pci +dev/ntb/if_ntb/if_ntb.c optional if_ntb +dev/ntb/ntb_hw/ntb_hw.c optional if_ntb ntb_hw dev/nvd/nvd.c optional nvd nvme dev/nve/if_nve.c optional nve pci dev/nvme/nvme.c optional nvme Added: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Mon Apr 29 22:48:53 2013 (r250079) @@ -0,0 +1,1366 @@ +/*- + * Copyright (C) 2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../ntb_hw/ntb_hw.h" + +/* + * The Non-Transparent Bridge (NTB) is a device on some Intel processors that + * allows you to connect two systems using a PCI-e link. + * + * This module contains a protocol for sending and receiving messages, and + * exposes that protocol through a simulated ethernet device called ntb. + * + * NOTE: Much of the code in this module is shared with Linux. Any patches may + * be picked up and redistributed in Linux with a dual GPL/BSD license. + */ + +/* TODO: These functions should really be part of the kernel */ +#define test_bit(pos, bitmap_addr) (*(bitmap_addr) & 1UL << (pos)) +#define set_bit(pos, bitmap_addr) *(bitmap_addr) |= 1UL << (pos) +#define clear_bit(pos, bitmap_addr) *(bitmap_addr) &= ~(1UL << (pos)) + +#define KTR_NTB KTR_SPARE3 + +#define NTB_TRANSPORT_VERSION 3 +#define NTB_RX_MAX_PKTS 64 +#define NTB_RXQ_SIZE 300 + +static unsigned int transport_mtu = 0x4000 + ETHER_HDR_LEN + ETHER_CRC_LEN; +static unsigned int max_num_clients = 1; + +STAILQ_HEAD(ntb_queue_list, ntb_queue_entry); + +struct ntb_queue_entry { + /* ntb_queue list reference */ + STAILQ_ENTRY(ntb_queue_entry) entry; + + /* info on data to be transfered */ + void *cb_data; + void *buf; + uint64_t len; + uint64_t flags; +}; + +struct ntb_rx_info { + unsigned int entry; +}; + +struct ntb_transport_qp { + struct ntb_netdev *transport; + struct ntb_softc *ntb; + + void *cb_data; + + bool client_ready; + bool qp_link; + uint8_t qp_num; /* Only 64 QP's are allowed. 0-63 */ + + struct ntb_rx_info *rx_info; + struct ntb_rx_info *remote_rx_info; + + void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); + struct ntb_queue_list tx_free_q; + struct mtx ntb_tx_free_q_lock; + void *tx_mw; + uint64_t tx_index; + uint64_t tx_max_entry; + uint64_t tx_max_frame; + + void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); + struct ntb_queue_list rx_pend_q; + struct ntb_queue_list rx_free_q; + struct mtx ntb_rx_pend_q_lock; + struct mtx ntb_rx_free_q_lock; + struct task rx_completion_task; + void *rx_buff; + uint64_t rx_index; + uint64_t rx_max_entry; + uint64_t rx_max_frame; + + void (*event_handler) (void *data, int status); + struct callout link_work; + struct callout queue_full; + struct callout rx_full; + + uint64_t last_rx_no_buf; + + /* Stats */ + uint64_t rx_bytes; + uint64_t rx_pkts; + uint64_t rx_ring_empty; + uint64_t rx_err_no_buf; + uint64_t rx_err_oflow; + uint64_t rx_err_ver; + uint64_t tx_bytes; + uint64_t tx_pkts; + uint64_t tx_ring_full; +}; + +struct ntb_queue_handlers { + void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); + void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); + void (*event_handler) (void *data, int status); +}; + + +struct ntb_transport_mw { + size_t size; + void *virt_addr; + vm_paddr_t dma_addr; +}; + +struct ntb_netdev { + struct ntb_softc *ntb; + struct ifnet *ifp; + struct ntb_transport_mw mw[NTB_NUM_MW]; + struct ntb_transport_qp *qps; + uint64_t max_qps; + uint64_t qp_bitmap; + bool transport_link; + struct callout link_work; + struct ntb_transport_qp *qp; + uint64_t bufsize; + u_char eaddr[ETHER_ADDR_LEN]; + struct mtx tx_lock; + struct mtx rx_lock; +}; + +static struct ntb_netdev net_softc; + +enum { + IF_NTB_DESC_DONE_FLAG = 1 << 0, + IF_NTB_LINK_DOWN_FLAG = 1 << 1, +}; + +struct ntb_payload_header { + uint64_t ver; + uint64_t len; + uint64_t flags; +}; + +enum { + IF_NTB_VERSION = 0, + IF_NTB_MW0_SZ, + IF_NTB_MW1_SZ, + IF_NTB_NUM_QPS, + IF_NTB_QP_LINKS, + IF_NTB_MAX_SPAD, +}; + +#define QP_TO_MW(qp) ((qp) % NTB_NUM_MW) +#define NTB_QP_DEF_NUM_ENTRIES 100 +#define NTB_LINK_DOWN_TIMEOUT 10 + +static int ntb_handle_module_events(struct module *m, int what, void *arg); +static int ntb_setup_interface(void); +static int ntb_teardown_interface(void); +static void ntb_net_init(void *arg); +static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data); +static void ntb_start(struct ifnet *ifp); +static void ntb_net_tx_handler(struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); +static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); +static void ntb_net_event_handler(void *data, int status); +static int ntb_transport_init(struct ntb_softc *ntb); +static void ntb_transport_free(void *transport); +static void ntb_transport_init_queue(struct ntb_netdev *nt, + unsigned int qp_num); +static void ntb_transport_free_queue(struct ntb_transport_qp *qp); +static struct ntb_transport_qp * ntb_transport_create_queue(void *data, + struct ntb_softc *pdev, const struct ntb_queue_handlers *handlers); +static void ntb_transport_link_up(struct ntb_transport_qp *qp); +static int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, + void *data, unsigned int len); +static int ntb_process_tx(struct ntb_transport_qp *qp, + struct ntb_queue_entry *entry); +static void ntb_tx_copy_task(struct ntb_transport_qp *qp, + struct ntb_queue_entry *entry, void *offset); +static void ntb_qp_full(void *arg); +static void ntb_transport_rxc_db(void *data, int db_num); +static void ntb_rx_pendq_full(void *arg); +static void ntb_transport_rx(struct ntb_transport_qp *qp); +static int ntb_process_rxc(struct ntb_transport_qp *qp); +static void ntb_rx_copy_task(struct ntb_transport_qp *qp, + struct ntb_queue_entry *entry, void *offset); +static void ntb_rx_completion_task(void *arg, int pending); +static void ntb_transport_event_callback(void *data, enum ntb_hw_event event); +static void ntb_transport_link_work(void *arg); +static int ntb_set_mw(struct ntb_netdev *nt, int num_mw, unsigned int size); +static void ntb_transport_setup_qp_mw(struct ntb_netdev *nt, + unsigned int qp_num); +static void ntb_qp_link_work(void *arg); +static void ntb_transport_link_cleanup(struct ntb_netdev *nt); +static void ntb_qp_link_down(struct ntb_transport_qp *qp); +static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp); +static void ntb_transport_link_down(struct ntb_transport_qp *qp); +static void ntb_send_link_down(struct ntb_transport_qp *qp); +static void ntb_list_add(struct mtx *lock, struct ntb_queue_entry *entry, + struct ntb_queue_list *list); +static struct ntb_queue_entry *ntb_list_rm(struct mtx *lock, + struct ntb_queue_list *list); +static void create_random_local_eui48(u_char *eaddr); +static unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); + +MALLOC_DEFINE(M_NTB_IF, "if_ntb", "ntb network driver"); + +/* Module setup and teardown */ +static int +ntb_handle_module_events(struct module *m, int what, void *arg) +{ + int err = 0; + + switch (what) { + case MOD_LOAD: + err = ntb_setup_interface(); + break; + case MOD_UNLOAD: + err = ntb_teardown_interface(); + break; + default: + err = EOPNOTSUPP; + break; + } + return (err); +} + +static moduledata_t ntb_transport_mod = { + "ntb_transport", + ntb_handle_module_events, + NULL +}; + +DECLARE_MODULE(ntb_transport, ntb_transport_mod, SI_SUB_KLD, SI_ORDER_ANY); +MODULE_DEPEND(ntb_transport, ntb_hw, 1, 1, 1); + +static int +ntb_setup_interface() +{ + struct ifnet *ifp; + struct ntb_queue_handlers handlers = { ntb_net_rx_handler, + ntb_net_tx_handler, ntb_net_event_handler }; + + net_softc.ntb = devclass_get_softc(devclass_find("ntb_hw"), 0); + if (net_softc.ntb == NULL) { + printf("ntb: Can't find devclass\n"); + return (ENXIO); + } + + ntb_transport_init(net_softc.ntb); + + ifp = net_softc.ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + printf("ntb: cannot allocate ifnet structure\n"); + return (ENOMEM); + } + + net_softc.qp = ntb_transport_create_queue(ifp, net_softc.ntb, + &handlers); + if_initname(ifp, "ntb", 0); + ifp->if_init = ntb_net_init; + ifp->if_softc = &net_softc; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; + ifp->if_ioctl = ntb_ioctl; + ifp->if_start = ntb_start; + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_READY(&ifp->if_snd); + create_random_local_eui48(net_softc.eaddr); + ether_ifattach(ifp, net_softc.eaddr); + ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; + ifp->if_capenable = ifp->if_capabilities; + + ntb_transport_link_up(net_softc.qp); + net_softc.bufsize = ntb_transport_max_size(net_softc.qp) + + sizeof(struct ether_header); + return (0); +} + +static int +ntb_teardown_interface() +{ + struct ifnet *ifp = net_softc.ifp; + + ntb_transport_link_down(net_softc.qp); + + ether_ifdetach(ifp); + if_free(ifp); + ntb_transport_free_queue(net_softc.qp); + ntb_transport_free(&net_softc); + + return (0); +} + +/* Network device interface */ + +static void +ntb_net_init(void *arg) +{ + struct ntb_netdev *ntb_softc = arg; + struct ifnet *ifp = ntb_softc->ifp; + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_flags |= IFF_UP; + if_link_state_change(ifp, LINK_STATE_UP); +} + +static int +ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +{ + struct ntb_netdev *nt = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *)data; + int error = 0; + + switch (command) { + case SIOCSIFMTU: + { + if (ifr->ifr_mtu > ntb_transport_max_size(nt->qp) - + ETHER_HDR_LEN - ETHER_CRC_LEN) { + error = EINVAL; + break; + } + + ifp->if_mtu = ifr->ifr_mtu; + break; + } + default: + error = ether_ioctl(ifp, command, data); + break; + } + + return (error); +} + + +static void +ntb_start(struct ifnet *ifp) +{ + struct mbuf *m_head; + struct ntb_netdev *nt = ifp->if_softc; + int rc; + + mtx_lock(&nt->tx_lock); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + CTR0(KTR_NTB, "TX: ntb_start"); + while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); + CTR1(KTR_NTB, "TX: start mbuf %p", m_head); + rc = ntb_transport_tx_enqueue(nt->qp, m_head, m_head, + m_length(m_head, NULL)); + if (rc != 0) { + CTR1(KTR_NTB, + "TX: couldn't tx mbuf %p. Returning to snd q", + m_head); + if (rc == EAGAIN) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + callout_reset(&nt->qp->queue_full, hz / 1000, + ntb_qp_full, ifp); + } + break; + } + + } + mtx_unlock(&nt->tx_lock); +} + +/* Network Device Callbacks */ +static void +ntb_net_tx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, + int len) +{ + + m_freem(data); + CTR1(KTR_NTB, "TX: tx_handler freeing mbuf %p", data); +} + +static void +ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, + int len) +{ + struct mbuf *m = data; + struct ifnet *ifp = qp_data; + + CTR0(KTR_NTB, "RX: rx handler"); + (*ifp->if_input)(ifp, m); +} + +static void +ntb_net_event_handler(void *data, int status) +{ + +} + +/* Transport Init and teardown */ + +static int +ntb_transport_init(struct ntb_softc *ntb) +{ + struct ntb_netdev *nt = &net_softc; + int rc, i; + + nt->max_qps = max_num_clients; + ntb_register_transport(ntb, nt); + mtx_init(&nt->tx_lock, "ntb transport tx", NULL, MTX_DEF); + mtx_init(&nt->rx_lock, "ntb transport rx", NULL, MTX_DEF); + + nt->qps = malloc(nt->max_qps * sizeof(struct ntb_transport_qp), + M_NTB_IF, M_WAITOK|M_ZERO); + + nt->qp_bitmap = ((uint64_t) 1 << nt->max_qps) - 1; + + for (i = 0; i < nt->max_qps; i++) + ntb_transport_init_queue(nt, i); + + callout_init(&nt->link_work, 0); + + rc = ntb_register_event_callback(ntb, + ntb_transport_event_callback); + if (rc != 0) + goto err; + + if (ntb_query_link_status(ntb)) + callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); + + return (0); + +err: + free(nt->qps, M_NTB_IF); + ntb_unregister_transport(ntb); + return (rc); +} + +static void +ntb_transport_free(void *transport) +{ + struct ntb_netdev *nt = transport; + struct ntb_softc *ntb = nt->ntb; + int i; + + nt->transport_link = NTB_LINK_DOWN; + + callout_drain(&nt->link_work); + + /* verify that all the qp's are freed */ + for (i = 0; i < nt->max_qps; i++) + if (!test_bit(i, &nt->qp_bitmap)) + ntb_transport_free_queue(&nt->qps[i]); + + + ntb_unregister_event_callback(ntb); + + for (i = 0; i < NTB_NUM_MW; i++) + if (nt->mw[i].virt_addr != NULL) + contigfree(nt->mw[i].virt_addr, nt->mw[i].size, + M_NTB_IF); + + free(nt->qps, M_NTB_IF); + ntb_unregister_transport(ntb); +} + +static void +ntb_transport_init_queue(struct ntb_netdev *nt, unsigned int qp_num) +{ + struct ntb_transport_qp *qp; + unsigned int num_qps_mw, tx_size; + uint8_t mw_num = QP_TO_MW(qp_num); + + qp = &nt->qps[qp_num]; + qp->qp_num = qp_num; + qp->transport = nt; + qp->ntb = nt->ntb; + qp->qp_link = NTB_LINK_DOWN; + qp->client_ready = NTB_LINK_DOWN; + qp->event_handler = NULL; + + if (nt->max_qps % NTB_NUM_MW && mw_num < nt->max_qps % NTB_NUM_MW) + num_qps_mw = nt->max_qps / NTB_NUM_MW + 1; + else + num_qps_mw = nt->max_qps / NTB_NUM_MW; + + tx_size = (unsigned int) ntb_get_mw_size(qp->ntb, mw_num) / num_qps_mw; + qp->rx_info = (struct ntb_rx_info *) + ((char *)ntb_get_mw_vbase(qp->ntb, mw_num) + + (qp_num / NTB_NUM_MW * tx_size)); + tx_size -= sizeof(struct ntb_rx_info); + + qp->tx_mw = qp->rx_info + sizeof(struct ntb_rx_info); + qp->tx_max_frame = min(transport_mtu + sizeof(struct ntb_payload_header), + tx_size); + qp->tx_max_entry = tx_size / qp->tx_max_frame; + qp->tx_index = 0; + + callout_init(&qp->link_work, 0); + callout_init(&qp->queue_full, CALLOUT_MPSAFE); + callout_init(&qp->rx_full, CALLOUT_MPSAFE); + + mtx_init(&qp->ntb_rx_pend_q_lock, "ntb rx pend q", NULL, MTX_SPIN); + mtx_init(&qp->ntb_rx_free_q_lock, "ntb rx free q", NULL, MTX_SPIN); + mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); + TASK_INIT(&qp->rx_completion_task, 0, ntb_rx_completion_task, qp); + + STAILQ_INIT(&qp->rx_pend_q); + STAILQ_INIT(&qp->rx_free_q); + STAILQ_INIT(&qp->tx_free_q); +} + +static void +ntb_transport_free_queue(struct ntb_transport_qp *qp) +{ + struct ntb_queue_entry *entry; + + if (qp == NULL) + return; + + callout_drain(&qp->link_work); + + ntb_unregister_db_callback(qp->ntb, qp->qp_num); + + while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q))) + free(entry, M_NTB_IF); + + while ((entry = ntb_list_rm(&qp->ntb_rx_pend_q_lock, &qp->rx_pend_q))) + free(entry, M_NTB_IF); + + while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) + free(entry, M_NTB_IF); + + set_bit(qp->qp_num, &qp->transport->qp_bitmap); +} + +/** + * ntb_transport_create_queue - Create a new NTB transport layer queue + * @rx_handler: receive callback function + * @tx_handler: transmit callback function + * @event_handler: event callback function + * + * Create a new NTB transport layer queue and provide the queue with a callback + * routine for both transmit and receive. The receive callback routine will be + * used to pass up data when the transport has received it on the queue. The + * transmit callback routine will be called when the transport has completed the + * transmission of the data on the queue and the data is ready to be freed. + * + * RETURNS: pointer to newly created ntb_queue, NULL on error. + */ +static struct ntb_transport_qp * +ntb_transport_create_queue(void *data, struct ntb_softc *pdev, + const struct ntb_queue_handlers *handlers) +{ + struct ntb_queue_entry *entry; + struct ntb_transport_qp *qp; + struct ntb_netdev *nt; + unsigned int free_queue; + int rc, i; + + nt = ntb_find_transport(pdev); + if (nt == NULL) + goto err; + + free_queue = ffs(nt->qp_bitmap); + if (free_queue == 0) + goto err; + + /* decrement free_queue to make it zero based */ + free_queue--; + + clear_bit(free_queue, &nt->qp_bitmap); + + qp = &nt->qps[free_queue]; + qp->cb_data = data; + qp->rx_handler = handlers->rx_handler; + qp->tx_handler = handlers->tx_handler; + qp->event_handler = handlers->event_handler; + + for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { + entry = malloc(sizeof(struct ntb_queue_entry), M_NTB_IF, + M_WAITOK|M_ZERO); + entry->cb_data = nt->ifp; + entry->buf = NULL; + entry->len = transport_mtu; + ntb_list_add(&qp->ntb_rx_pend_q_lock, entry, &qp->rx_pend_q); + } + + for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { + entry = malloc(sizeof(struct ntb_queue_entry), M_NTB_IF, + M_WAITOK|M_ZERO); + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); + } + + rc = ntb_register_db_callback(qp->ntb, free_queue, qp, + ntb_transport_rxc_db); + if (rc != 0) + goto err1; + + return (qp); + +err1: + while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) + free(entry, M_NTB_IF); + while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q))) + free(entry, M_NTB_IF); + set_bit(free_queue, &nt->qp_bitmap); +err: + return (NULL); +} + +/** + * ntb_transport_link_up - Notify NTB transport of client readiness to use queue + * @qp: NTB transport layer queue to be enabled + * + * Notify NTB transport layer of client readiness to use queue + */ +static void +ntb_transport_link_up(struct ntb_transport_qp *qp) +{ + + if (qp == NULL) + return; + + qp->client_ready = NTB_LINK_UP; + + if (qp->transport->transport_link == NTB_LINK_UP) + callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); +} + + + +/* Transport Tx */ + +/** + * ntb_transport_tx_enqueue - Enqueue a new NTB queue entry + * @qp: NTB transport layer queue the entry is to be enqueued on + * @cb: per buffer pointer for callback function to use + * @data: pointer to data buffer that will be sent + * @len: length of the data buffer + * + * Enqueue a new transmit buffer onto the transport queue from which a NTB + * payload will be transmitted. This assumes that a lock is behing held to + * serialize access to the qp. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +static int +ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, + unsigned int len) +{ + struct ntb_queue_entry *entry; + int rc; + + if (qp == NULL || qp->qp_link != NTB_LINK_UP || len == 0) { + CTR0(KTR_NTB, "TX: link not up"); + return (EINVAL); + } + + entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q); + if (entry == NULL) { + CTR0(KTR_NTB, "TX: couldn't get entry from tx_free_q"); + return (ENOMEM); + } + CTR1(KTR_NTB, "TX: got entry %p from tx_free_q", entry); + + entry->cb_data = cb; + entry->buf = data; + entry->len = len; + entry->flags = 0; + + rc = ntb_process_tx(qp, entry); + if (rc != 0) { + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); + CTR1(KTR_NTB, + "TX: process_tx failed. Returning entry %p to tx_free_q", + entry); + } + return (rc); +} + +static int +ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) +{ + void *offset; + + offset = (char *)qp->tx_mw + qp->tx_max_frame * qp->tx_index; + CTR3(KTR_NTB, + "TX: process_tx: tx_pkts=%u, tx_index=%u, remote entry=%u", + qp->tx_pkts, qp->tx_index, qp->remote_rx_info->entry); + if (qp->tx_index == qp->remote_rx_info->entry) { + CTR0(KTR_NTB, "TX: ring full"); + qp->tx_ring_full++; + return (EAGAIN); + } + + if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) { + if (qp->tx_handler != NULL) + qp->tx_handler(qp, qp->cb_data, entry->buf, + EIO); + + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); + CTR1(KTR_NTB, + "TX: frame too big. returning entry %p to tx_free_q", + entry); + return (0); + } + CTR2(KTR_NTB, "TX: copying entry %p to offset %p", entry, offset); + ntb_tx_copy_task(qp, entry, offset); + + qp->tx_index++; + qp->tx_index %= qp->tx_max_entry; + + qp->tx_pkts++; + + return (0); +} + +static void +ntb_tx_copy_task(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, + void *offset) +{ + struct ntb_payload_header *hdr; + + CTR2(KTR_NTB, "TX: copying %d bytes to offset %p", entry->len, offset); + if (entry->buf != NULL) + m_copydata((struct mbuf *)entry->buf, 0, entry->len, offset); + + hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - + sizeof(struct ntb_payload_header)); + hdr->len = entry->len; /* TODO: replace with bus_space_write */ + hdr->ver = qp->tx_pkts; /* TODO: replace with bus_space_write */ + wmb(); + /* TODO: replace with bus_space_write */ + hdr->flags = entry->flags | IF_NTB_DESC_DONE_FLAG; + + ntb_ring_sdb(qp->ntb, qp->qp_num); + + /* + * The entry length can only be zero if the packet is intended to be a + * "link down" or similar. Since no payload is being sent in these + * cases, there is nothing to add to the completion queue. + */ + if (entry->len > 0) { + qp->tx_bytes += entry->len; + + if (qp->tx_handler) + qp->tx_handler(qp, qp->cb_data, entry->cb_data, + entry->len); + } + + CTR2(KTR_NTB, + "TX: entry %p sent. hdr->ver = %d, Returning to tx_free_q", entry, + hdr->ver); + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); +} + +static void +ntb_qp_full(void *arg) +{ + + CTR0(KTR_NTB, "TX: qp_full callout"); + ntb_start(arg); +} + +/* Transport Rx */ +static void +ntb_transport_rxc_db(void *data, int db_num) +{ + struct ntb_transport_qp *qp = data; + + ntb_transport_rx(qp); +} + +static void +ntb_rx_pendq_full(void *arg) +{ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 22:56:42 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8C44D2F; Mon, 29 Apr 2013 22:56:42 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 78B551D47; Mon, 29 Apr 2013 22:56:42 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r3TMufS1001935; Mon, 29 Apr 2013 16:56:41 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r3TMufnd001934; Mon, 29 Apr 2013 16:56:41 -0600 (MDT) (envelope-from ken) Date: Mon, 29 Apr 2013 16:56:41 -0600 From: "Kenneth D. Merry" To: Steven Hartland Subject: Re: svn commit: r249939 - head/sys/cam/scsi Message-ID: <20130429225641.GA1375@nargothrond.kdm.org> References: <201304261617.r3QGH58Q048395@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304261617.r3QGH58Q048395@svn.freebsd.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 22:56:42 -0000 On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: > Author: smh > Date: Fri Apr 26 16:17:04 2013 > New Revision: 249939 > URL: http://svnweb.freebsd.org/changeset/base/249939 > > Log: > Added available delete methods discovery during device probe, including the > maximum sizes for said methods, which are used when processing BIO_DELETE > requests. This includes updating UNMAP support discovery to be based on > SBC-3 T10/1799-D Revision 31 specification. > > Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) > > sys/cam/scsi/scsi_da.c: > - Added ATA Data Set Management TRIM support via ATA Pass-Through(16) > as a delete_method > This adds a lot of unnecessary verbosity for devices that don't support ATA passthrough. For example: (da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 (da7:iscsi4:0:0:0): CAM status: SCSI Status Error (da7:iscsi4:0:0:0): SCSI status: Check Condition (da7:iscsi4:0:0:0): Retrying command (per sense data) (2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 (2:2:0:0): Tag: 0x00f6, Type: 1 (2:2:0:0): CTL Status: SCSI Error (2:2:0:0): SCSI Status: Check Condition (2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command operation code) (2:2:0:0): Command byte 0 is invalid (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 (da8:iscsi4:0:0:1): CAM status: SCSI Status Error (da8:iscsi4:0:0:1): SCSI status: Check Condition (da8:iscsi4:0:0:1): Retrying command (per sense data) (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 (da8:iscsi4:0:0:1): CAM status: SCSI Status Error (da8:iscsi4:0:0:1): SCSI status: Check Condition (da8:iscsi4:0:0:1): Error 5, Retries exhausted That is with CTL and and trasz's new iSCSI initiator, but you should see it with any CTL configuration. (And probably with any controller or device that doesn't support ATA passthrough.) So, please: - Check for the presence of VPD page 0x89 before sending an ATA passthrough command. The spec (sat3r03 in this case) says that it "shall" be implemented, so I think we can count on that. - If the target returns an illegal request sense key, don't retry again. The target will keep returning illegal request Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 23:08:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 17369F86; Mon, 29 Apr 2013 23:08:14 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 096E41D9F; Mon, 29 Apr 2013 23:08:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TN8DvV034101; Mon, 29 Apr 2013 23:08:13 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TN8Dlj034100; Mon, 29 Apr 2013 23:08:13 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201304292308.r3TN8Dlj034100@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 29 Apr 2013 23:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250081 - head/sys/xen/xenstore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 23:08:14 -0000 Author: gibbs Date: Mon Apr 29 23:08:13 2013 New Revision: 250081 URL: http://svnweb.freebsd.org/changeset/base/250081 Log: xenstore/xenstore.c: Prevent access to invalid memory region when listing an empty directory in the XenStore. Reported by: Bei Guan MFC after: 1 week Modified: head/sys/xen/xenstore/xenstore.c Modified: head/sys/xen/xenstore/xenstore.c ============================================================================== --- head/sys/xen/xenstore/xenstore.c Mon Apr 29 22:54:26 2013 (r250080) +++ head/sys/xen/xenstore/xenstore.c Mon Apr 29 23:08:13 2013 (r250081) @@ -307,7 +307,8 @@ split(char *strings, u_int len, u_int *n const char **ret; /* Protect against unterminated buffers. */ - strings[len - 1] = '\0'; + if (len > 0) + strings[len - 1] = '\0'; /* Count the strings. */ *num = extract_strings(strings, /*dest*/NULL, len); From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 23:20:05 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8710F3FA; Mon, 29 Apr 2013 23:20:05 +0000 (UTC) (envelope-from smh@freebsd.org) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 219971E0A; Mon, 29 Apr 2013 23:20:04 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 0E72C20E7088B; Mon, 29 Apr 2013 23:19:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.7 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (46-65-172-4.zone16.bethere.co.uk [46.65.172.4]) by smtp1.multiplay.co.uk (Postfix) with ESMTP id C8DC120E70886; Mon, 29 Apr 2013 23:19:31 +0000 (UTC) Message-ID: From: "Steven Hartland" To: "Kenneth D. Merry" References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> Subject: Re: svn commit: r249939 - head/sys/cam/scsi Date: Tue, 30 Apr 2013 00:20:07 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 23:20:05 -0000 ----- Original Message ----- From: "Kenneth D. Merry" To: "Steven Hartland" Cc: ; ; Sent: Monday, April 29, 2013 11:56 PM Subject: Re: svn commit: r249939 - head/sys/cam/scsi > On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: >> Author: smh >> Date: Fri Apr 26 16:17:04 2013 >> New Revision: 249939 >> URL: http://svnweb.freebsd.org/changeset/base/249939 >> >> Log: >> Added available delete methods discovery during device probe, including the >> maximum sizes for said methods, which are used when processing BIO_DELETE >> requests. This includes updating UNMAP support discovery to be based on >> SBC-3 T10/1799-D Revision 31 specification. >> >> Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) >> >> sys/cam/scsi/scsi_da.c: >> - Added ATA Data Set Management TRIM support via ATA Pass-Through(16) >> as a delete_method >> > > This adds a lot of unnecessary verbosity for devices that don't support ATA > passthrough. For example: > > (da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 > (da7:iscsi4:0:0:0): CAM status: SCSI Status Error > (da7:iscsi4:0:0:0): SCSI status: Check Condition > (da7:iscsi4:0:0:0): Retrying command (per sense data) > (2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 > (2:2:0:0): Tag: 0x00f6, Type: 1 > (2:2:0:0): CTL Status: SCSI Error > (2:2:0:0): SCSI Status: Check Condition > (2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command operation code) > (2:2:0:0): Command byte 0 is invalid > > (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 > (da8:iscsi4:0:0:1): CAM status: SCSI Status Error > (da8:iscsi4:0:0:1): SCSI status: Check Condition > (da8:iscsi4:0:0:1): Retrying command (per sense data) > (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 > (da8:iscsi4:0:0:1): CAM status: SCSI Status Error > (da8:iscsi4:0:0:1): SCSI status: Check Condition > (da8:iscsi4:0:0:1): Error 5, Retries exhausted > > That is with CTL and and trasz's new iSCSI initiator, but you should see it > with any CTL configuration. (And probably with any controller or device > that doesn't support ATA passthrough.) > > So, please: > - Check for the presence of VPD page 0x89 before sending an ATA > passthrough command. The spec (sat3r03 in this case) says that > it "shall" be implemented, so I think we can count on that. > - If the target returns an illegal request sense key, don't retry > again. The target will keep returning illegal request Thanks for the report Ken I'll check this on a card I know doesn't support pass-through. Regards Steve From owner-svn-src-all@FreeBSD.ORG Mon Apr 29 23:57:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C856A99C; Mon, 29 Apr 2013 23:57:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9D561F1F; Mon, 29 Apr 2013 23:57:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TNvf0m051145; Mon, 29 Apr 2013 23:57:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TNvfQi051144; Mon, 29 Apr 2013 23:57:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304292357.r3TNvfQi051144@svn.freebsd.org> From: Adrian Chadd Date: Mon, 29 Apr 2013 23:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250082 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 23:57:41 -0000 Author: adrian Date: Mon Apr 29 23:57:41 2013 New Revision: 250082 URL: http://svnweb.freebsd.org/changeset/base/250082 Log: Sync from git - ah_config is in 'ath_hal', not 'ath_hal_private' on FreeBSD. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Mon Apr 29 23:08:13 2013 (r250081) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Mon Apr 29 23:57:41 2013 (r250082) @@ -704,7 +704,7 @@ ar9300_ani_control(struct ath_hal *ah, H return AH_TRUE; } /* if we're turning off ANI, reset regs back to INI settings */ - if (AH_PRIVATE(ah)->ah_config.ath_hal_enable_ani) { + if (ah->ah_config.ath_hal_enable_ani) { HAL_ANI_CMD savefunc = ahp->ah_ani_function; /* temporarly allow all functions so we can reset */ ahp->ah_ani_function = HAL_ANI_ALL; From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 00:36:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2851F85; Tue, 30 Apr 2013 00:36:16 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4F301027; Tue, 30 Apr 2013 00:36:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U0aGQ5065205; Tue, 30 Apr 2013 00:36:16 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U0aG02065204; Tue, 30 Apr 2013 00:36:16 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304300036.r3U0aG02065204@svn.freebsd.org> From: Neel Natu Date: Tue, 30 Apr 2013 00:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250083 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 00:36:16 -0000 Author: neel Date: Tue Apr 30 00:36:16 2013 New Revision: 250083 URL: http://svnweb.freebsd.org/changeset/base/250083 Log: Use a separate mutex for the receive path instead of overloading the softc mutex for this purpose. Reviewed by: grehan Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Mon Apr 29 23:57:41 2013 (r250082) +++ head/usr.sbin/bhyve/pci_virtio_net.c Tue Apr 30 00:36:16 2013 (r250083) @@ -140,7 +140,6 @@ struct pci_vtnet_softc { int vsc_isr; int vsc_tapfd; int vsc_rx_ready; - int tx_in_progress; int resetting; uint32_t vsc_features; @@ -149,9 +148,14 @@ struct pci_vtnet_softc { uint64_t vsc_pfn[VTNET_MAXQ]; struct vring_hqueue vsc_hq[VTNET_MAXQ]; uint16_t vsc_msix_table_idx[VTNET_MAXQ]; + + pthread_mutex_t rx_mtx; + int rx_in_progress; + pthread_t tx_tid; pthread_mutex_t tx_mtx; pthread_cond_t tx_cond; + int tx_in_progress; }; #define vtnet_ctx(sc) ((sc)->vsc_pi->pi_vmctx) @@ -220,6 +224,38 @@ pci_vtnet_ring_reset(struct pci_vtnet_so hq->hq_cur_aidx = 0; } +/* + * If the transmit thread is active then stall until it is done. + */ +static void +pci_vtnet_txwait(struct pci_vtnet_softc *sc) +{ + + pthread_mutex_lock(&sc->tx_mtx); + while (sc->tx_in_progress) { + pthread_mutex_unlock(&sc->tx_mtx); + usleep(10000); + pthread_mutex_lock(&sc->tx_mtx); + } + pthread_mutex_unlock(&sc->tx_mtx); +} + +/* + * If the receive thread is active then stall until it is done. + */ +static void +pci_vtnet_rxwait(struct pci_vtnet_softc *sc) +{ + + pthread_mutex_lock(&sc->rx_mtx); + while (sc->rx_in_progress) { + pthread_mutex_unlock(&sc->rx_mtx); + usleep(10000); + pthread_mutex_lock(&sc->rx_mtx); + } + pthread_mutex_unlock(&sc->rx_mtx); +} + static void pci_vtnet_update_status(struct pci_vtnet_softc *sc, uint32_t value) { @@ -227,21 +263,19 @@ pci_vtnet_update_status(struct pci_vtnet if (value == 0) { DPRINTF(("vtnet: device reset requested !\n")); - /* Wait for TX thread to complete pending desc processing */ sc->resetting = 1; - pthread_mutex_lock(&sc->tx_mtx); - while (sc->tx_in_progress) { - pthread_mutex_unlock(&sc->tx_mtx); - usleep(10000); - pthread_mutex_lock(&sc->tx_mtx); - } - - pthread_mutex_unlock(&sc->tx_mtx); - + /* + * Wait for the transmit and receive threads to finish their + * processing. + */ + pci_vtnet_txwait(sc); + pci_vtnet_rxwait(sc); + + sc->vsc_rx_ready = 0; pci_vtnet_ring_reset(sc, VTNET_RXQ); pci_vtnet_ring_reset(sc, VTNET_TXQ); - sc->vsc_rx_ready = 0; + sc->resetting = 0; } @@ -303,9 +337,9 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc /* * But, will be called when the rx ring hasn't yet - * been set up. + * been set up or the guest is resetting the device. */ - if (sc->vsc_rx_ready == 0) { + if (!sc->vsc_rx_ready || sc->resetting) { /* * Drop the packet and try later. */ @@ -393,9 +427,11 @@ pci_vtnet_tap_callback(int fd, enum ev_t { struct pci_vtnet_softc *sc = param; - pthread_mutex_lock(&sc->vsc_mtx); + pthread_mutex_lock(&sc->rx_mtx); + sc->rx_in_progress = 1; pci_vtnet_tap_rx(sc); - pthread_mutex_unlock(&sc->vsc_mtx); + sc->rx_in_progress = 0; + pthread_mutex_unlock(&sc->rx_mtx); } @@ -462,7 +498,6 @@ pci_vtnet_proctx(struct pci_vtnet_softc vu->vu_tlen = tlen; hq->hq_cur_aidx = aidx + 1; *hq->hq_used_idx = uidx + 1; - } static void @@ -706,21 +741,24 @@ pci_vtnet_init(struct vmctx *ctx, struct } pci_emul_alloc_bar(pi, 0, PCIBAR_IO, VTNET_REGSZ); - + + sc->resetting = 0; + + sc->rx_in_progress = 0; + pthread_mutex_init(&sc->rx_mtx, NULL); + /* * Initialize tx semaphore & spawn TX processing thread * As of now, only one thread for TX desc processing is * spawned. */ sc->tx_in_progress = 0; - sc->resetting = 0; pthread_mutex_init(&sc->tx_mtx, NULL); pthread_cond_init(&sc->tx_cond, NULL); pthread_create(&sc->tx_tid, NULL, pci_vtnet_tx_thread, (void *)sc); snprintf(tname, sizeof(tname), "%s vtnet%d tx", vmname, pi->pi_slot); pthread_set_name_np(sc->tx_tid, tname); - return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 00:49:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AA43096D; Tue, 30 Apr 2013 00:49:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D1091092; Tue, 30 Apr 2013 00:49:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U0nPPu069742; Tue, 30 Apr 2013 00:49:25 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U0nPvL069741; Tue, 30 Apr 2013 00:49:25 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304300049.r3U0nPvL069741@svn.freebsd.org> From: Eitan Adler Date: Tue, 30 Apr 2013 00:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250084 - stable/9/bin/mkdir X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 00:49:25 -0000 Author: eadler Date: Tue Apr 30 00:49:25 2013 New Revision: 250084 URL: http://svnweb.freebsd.org/changeset/base/250084 Log: MFC r249996: Add missing static qualifiers Modified: stable/9/bin/mkdir/mkdir.c Directory Properties: stable/9/bin/mkdir/ (props changed) Modified: stable/9/bin/mkdir/mkdir.c ============================================================================== --- stable/9/bin/mkdir/mkdir.c Tue Apr 30 00:36:16 2013 (r250083) +++ stable/9/bin/mkdir/mkdir.c Tue Apr 30 00:49:25 2013 (r250084) @@ -135,7 +135,7 @@ main(int argc, char *argv[]) * Returns 1 if a directory has been created, * 2 if it already existed, and 0 on failure. */ -int +static int build(char *path, mode_t omode) { struct stat sb; @@ -208,7 +208,7 @@ build(char *path, mode_t omode) return (retval); } -void +static void usage(void) { From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 00:49:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D52CD96E; Tue, 30 Apr 2013 00:49:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C7E7F1093; Tue, 30 Apr 2013 00:49:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U0nU6k069790; Tue, 30 Apr 2013 00:49:30 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U0nUYn069789; Tue, 30 Apr 2013 00:49:30 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304300049.r3U0nUYn069789@svn.freebsd.org> From: Eitan Adler Date: Tue, 30 Apr 2013 00:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250085 - stable/8/bin/mkdir X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 00:49:30 -0000 Author: eadler Date: Tue Apr 30 00:49:30 2013 New Revision: 250085 URL: http://svnweb.freebsd.org/changeset/base/250085 Log: MFC r249996: Add missing static qualifiers Modified: stable/8/bin/mkdir/mkdir.c Directory Properties: stable/8/bin/mkdir/ (props changed) Modified: stable/8/bin/mkdir/mkdir.c ============================================================================== --- stable/8/bin/mkdir/mkdir.c Tue Apr 30 00:49:25 2013 (r250084) +++ stable/8/bin/mkdir/mkdir.c Tue Apr 30 00:49:30 2013 (r250085) @@ -135,7 +135,7 @@ main(int argc, char *argv[]) * Returns 1 if a directory has been created, * 2 if it already existed, and 0 on failure. */ -int +static int build(char *path, mode_t omode) { struct stat sb; @@ -208,7 +208,7 @@ build(char *path, mode_t omode) return (retval); } -void +static void usage(void) { From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 01:14:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F2F719B; Tue, 30 Apr 2013 01:14:55 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1208B11CE; Tue, 30 Apr 2013 01:14:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U1EshK079994; Tue, 30 Apr 2013 01:14:54 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U1EsFw079993; Tue, 30 Apr 2013 01:14:54 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304300114.r3U1EsFw079993@svn.freebsd.org> From: Neel Natu Date: Tue, 30 Apr 2013 01:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250086 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 01:14:55 -0000 Author: neel Date: Tue Apr 30 01:14:54 2013 New Revision: 250086 URL: http://svnweb.freebsd.org/changeset/base/250086 Log: Reset some more softc state when the guest resets the virtio network device. Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Tue Apr 30 00:49:30 2013 (r250085) +++ head/usr.sbin/bhyve/pci_virtio_net.c Tue Apr 30 01:14:54 2013 (r250086) @@ -259,6 +259,7 @@ pci_vtnet_rxwait(struct pci_vtnet_softc static void pci_vtnet_update_status(struct pci_vtnet_softc *sc, uint32_t value) { + int i; if (value == 0) { DPRINTF(("vtnet: device reset requested !\n")); @@ -276,6 +277,12 @@ pci_vtnet_update_status(struct pci_vtnet pci_vtnet_ring_reset(sc, VTNET_RXQ); pci_vtnet_ring_reset(sc, VTNET_TXQ); + for (i = 0; i < VTNET_MAXQ; i++) + sc->vsc_msix_table_idx[i] = VIRTIO_MSI_NO_VECTOR; + + sc->vsc_isr = 0; + sc->vsc_features = 0; + sc->resetting = 0; } From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 01:15:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E663B30C; Tue, 30 Apr 2013 01:15:10 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA14411D3; Tue, 30 Apr 2013 01:15:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U1FAHd080148; Tue, 30 Apr 2013 01:15:10 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U1FAVu080147; Tue, 30 Apr 2013 01:15:10 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201304300115.r3U1FAVu080147@svn.freebsd.org> From: Peter Wemm Date: Tue, 30 Apr 2013 01:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250087 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 01:15:11 -0000 Author: peter Date: Tue Apr 30 01:15:10 2013 New Revision: 250087 URL: http://svnweb.freebsd.org/changeset/base/250087 Log: Oh wow.. disassociate/disown any connection with cvs. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Apr 30 01:14:54 2013 (r250086) +++ head/MAINTAINERS Tue Apr 30 01:15:10 2013 (r250087) @@ -64,7 +64,6 @@ linprocfs des Pre-commit review requeste lpr gad Pre-commit review requested, particularly for lpd/recvjob.c and lpd/printjob.c. newsyslog(8) gad Heads-up appreciated. I'm going thru the PR's for it. -cvs peter Heads-up appreciated, try not to break it. nvi peter Try not to break it. libz peter Try not to break it. groff ru Recommends pre-commit review. From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 03:16:21 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD56891E; Tue, 30 Apr 2013 03:16:21 +0000 (UTC) (envelope-from prvs=18322e35f1=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id B19BA167E; Tue, 30 Apr 2013 03:16:20 +0000 (UTC) Received: from r2d2 ([46.65.172.4]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50003549993.msg; Tue, 30 Apr 2013 04:16:17 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Tue, 30 Apr 2013 04:16:17 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 46.65.172.4 X-Return-Path: prvs=18322e35f1=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> From: "Steven Hartland" To: "Steven Hartland" , "Kenneth D. Merry" References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> Subject: Re: svn commit: r249939 - head/sys/cam/scsi Date: Tue, 30 Apr 2013 04:16:49 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0415_01CE4559.890A90E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 03:16:21 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0415_01CE4559.890A90E0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit ----- Original Message ----- From: "Steven Hartland" >> On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: >>> Author: smh >>> Date: Fri Apr 26 16:17:04 2013 >>> New Revision: 249939 >>> URL: http://svnweb.freebsd.org/changeset/base/249939 >>> >>> Log: >>> Added available delete methods discovery during device probe, including the >>> maximum sizes for said methods, which are used when processing BIO_DELETE >>> requests. This includes updating UNMAP support discovery to be based on >>> SBC-3 T10/1799-D Revision 31 specification. >>> Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) >>> sys/cam/scsi/scsi_da.c: >>> - Added ATA Data Set Management TRIM support via ATA Pass-Through(16) >>> as a delete_method >>> >> >> This adds a lot of unnecessary verbosity for devices that don't support ATA >> passthrough. For example: >> >> (da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 >> (da7:iscsi4:0:0:0): CAM status: SCSI Status Error >> (da7:iscsi4:0:0:0): SCSI status: Check Condition >> (da7:iscsi4:0:0:0): Retrying command (per sense data) >> (2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 >> (2:2:0:0): Tag: 0x00f6, Type: 1 >> (2:2:0:0): CTL Status: SCSI Error >> (2:2:0:0): SCSI Status: Check Condition >> (2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command operation code) >> (2:2:0:0): Command byte 0 is invalid >> >> (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 >> (da8:iscsi4:0:0:1): CAM status: SCSI Status Error >> (da8:iscsi4:0:0:1): SCSI status: Check Condition >> (da8:iscsi4:0:0:1): Retrying command (per sense data) >> (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 >> (da8:iscsi4:0:0:1): CAM status: SCSI Status Error >> (da8:iscsi4:0:0:1): SCSI status: Check Condition >> (da8:iscsi4:0:0:1): Error 5, Retries exhausted >> >> That is with CTL and and trasz's new iSCSI initiator, but you should see it >> with any CTL configuration. (And probably with any controller or device >> that doesn't support ATA passthrough.) >> >> So, please: >> - Check for the presence of VPD page 0x89 before sending an ATA >> passthrough command. The spec (sat3r03 in this case) says that >> it "shall" be implemented, so I think we can count on that. >> - If the target returns an illegal request sense key, don't retry >> again. The target will keep returning illegal request > > Thanks for the report Ken I'll check this on a card I know doesn't support > pass-through. I checked with an areca controller, which I know doesn't support pass16, and all is quiet during boot / probe. I can provoke output at the app layer with camcontrol identify da0, which is to be expected, but nothing in /var/log/messages. daerror handler in scsi_da.c definitely has SF_QUIET_IR so Illegal Request should never be output. I can't provoke this using standard CAM devices even when they don't support ATA Pass-Through (16) so I think this is actually an issue with CTL: 1. Being verbose when it shouldn't (ctl_process_done - line 12571?) 2. Retrying Illegal Request commands when it shouldn't (I didn't experince this on r250032) The attached patch implements a check for ATA Information VPD before using ATA Pass-Through (16). It's had limited testing but I have confirmed it eliminates the use of pass16 under CTL and still enables ATA TRIM under on mpt for SATA disks, so looks promising. If you could test and let me know if it works for you Ken that would be appreciated. The test case I used for CTL was:- kldload ctl ctladm create -b ramdisk -s 10485760 ctladm port -o on As a side note while test "kldload ctl" caused kernel panic the once. If anyone's interested the trace was:- #0 doadump (textdump=0) at pcpu.h:231 #1 0xffffffff802f6d6e in db_dump (dummy=, dummy2=0, dummy3=0, dummy4=0x0) at /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:543 #2 0xffffffff802f683d in db_command (cmd_table=) at /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:449 #3 0xffffffff802f65b4 in db_command_loop () at /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:502 #4 0xffffffff802f8f50 in db_trap (type=, code=0) at /usr/home/smh/freebsd/base/head/sys/ddb/db_main.c:231 #5 0xffffffff805c0df3 in kdb_trap (type=9, code=0, tf=) at /usr/home/smh/freebsd/base/head/sys/kern/subr_kdb.c:654 #6 0xffffffff8075580a in trap_fatal (frame=0xffffff823b8dc790, eva=) at /usr/home/smh/freebsd/base/head/sys/amd64/amd64/trap.c:867 #7 0xffffffff807554b7 in trap (frame=) at /usr/home/smh/freebsd/base/head/sys/amd64/amd64/trap.c:224 #8 0xffffffff8073e1f2 in calltrap () at /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:228 #9 0xffffffff8029c860 in cam_periph_alloc (periph_ctor=0xffffffff802af410 , periph_oninvalidate=0xfffffe0019cfa200, periph_dtor=, periph_start=0xfffffe0015980a90, name=, type=2159638184, path=0xfffffe0015ad79a0, ac_callback=, code=) at /usr/home/smh/freebsd/base/head/sys/cam/cam_periph.c:227 #10 0xffffffff802aed6b in scsi_scan_lun (request_ccb=) at /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:2266 #11 0xffffffff802b2859 in scsi_scan_bus (periph=0x0, request_ccb=0xfffffe00234df000) at /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:1969 #12 0xffffffff802a66c5 in xpt_scanner_thread (dummy=) at /usr/home/smh/freebsd/base/head/sys/cam/cam_xpt.c:2411 #13 0xffffffff8055cde4 in fork_exit (callout=0xffffffff802a6650 , arg=0x0, frame=0xffffff823b8dcc00) at /usr/home/smh/freebsd/base/head/sys/kern/kern_fork.c:991 #14 0xffffffff8073e72e in fork_trampoline () at /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:602 #15 0x0000000000000000 in ?? () Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. ------=_NextPart_000_0415_01CE4559.890A90E0 Content-Type: application/octet-stream; name="cam-scsi-delete-ata-info.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="cam-scsi-delete-ata-info.patch" Use the existence of ATA Information VPD to determine if we should = attempt=0A= to query ATA functionality via ATA Pass-Through (16) as this page is = defined=0A= as "must" for SATL devices, hence indicating that the device is at least=0A= likely to support Pass-Through (16).=0A= =0A= This eliminates errors produced by CTL when ATA Pass-Through (16) fails.=0A= =0A= Output details about supported and choosen delete method when verbose = booted.=0A= Index: sys/cam/scsi/scsi_all.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- sys/cam/scsi/scsi_all.h (revision 250032)=0A= +++ sys/cam/scsi/scsi_all.h (working copy)=0A= @@ -1430,6 +1430,12 @@=0A= };=0A= =0A= /*=0A= + * ATA Information VPD Page based on=0A= + * T10/2126-D Revision 04=0A= + */=0A= +#define SVPD_ATA_INFORMATION 0x89=0A= +=0A= +/*=0A= * Block Device Characteristics VPD Page based on=0A= * T10/1799-D Revision 31=0A= */=0A= Index: sys/cam/scsi/scsi_da.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- sys/cam/scsi/scsi_da.c (revision 250033)=0A= +++ sys/cam/scsi/scsi_da.c (working copy)=0A= @@ -918,6 +918,7 @@=0A= da_delete_methods delete_method);=0A= static void dadeletemethodchoose(struct da_softc *softc,=0A= da_delete_methods default_method);=0A= +static void dadeletemethodauto(struct cam_periph *periph);=0A= =0A= static periph_ctor_t daregister;=0A= static periph_dtor_t dacleanup;=0A= @@ -1680,6 +1681,47 @@=0A= }=0A= =0A= static void=0A= +dadeletemethodauto(struct cam_periph *periph)=0A= +{=0A= + struct da_softc *softc;=0A= +=0A= + softc =3D (struct da_softc *)periph->softc;=0A= +=0A= + dadeletemethodchoose(softc, DA_DELETE_NONE);=0A= +=0A= + if (bootverbose && (softc->flags & DA_FLAG_PROBED) =3D=3D 0) {=0A= + char buf[80];=0A= + int i, sep;=0A= +=0A= + snprintf(buf, sizeof(buf), "Delete methods: <");=0A= + sep =3D 0;=0A= + for (i =3D DA_DELETE_MIN; i <=3D DA_DELETE_MAX; i++) {=0A= + if (softc->delete_available & (1 << i)) {=0A= + if (sep) {=0A= + strlcat(buf, ",", sizeof(buf));=0A= + } else {=0A= + sep =3D 1;=0A= + }=0A= + strlcat(buf, da_delete_method_names[i],=0A= + sizeof(buf));=0A= + if (i =3D=3D softc->delete_method) {=0A= + strlcat(buf, "(*)", sizeof(buf));=0A= + }=0A= + }=0A= + }=0A= + if (sep =3D=3D 0) {=0A= + if (softc->delete_method =3D=3D DA_DELETE_NONE) =0A= + strlcat(buf, "NONE(*)", sizeof(buf));=0A= + else=0A= + strlcat(buf, "DISABLED(*)", sizeof(buf));=0A= + }=0A= + strlcat(buf, ">", sizeof(buf));=0A= + printf("%s%d: %s\n", periph->periph_name,=0A= + periph->unit_number, buf);=0A= + }=0A= +}=0A= +=0A= +static void=0A= dadeletemethodchoose(struct da_softc *softc, da_delete_methods = default_method)=0A= {=0A= int i, delete_method;=0A= @@ -2457,6 +2499,21 @@=0A= {=0A= struct ata_params *ata_params;=0A= =0A= + if (!scsi_vpd_supported_page(periph, SVPD_ATA_INFORMATION)) {=0A= + dadeletemethodauto(periph);=0A= +=0A= + xpt_release_ccb(start_ccb);=0A= + softc->state =3D DA_STATE_NORMAL;=0A= + daschedule(periph);=0A= + wakeup(&softc->disk->d_mediasize);=0A= + if ((softc->flags & DA_FLAG_PROBED) =3D=3D 0) {=0A= + softc->flags |=3D DA_FLAG_PROBED;=0A= + cam_periph_unhold(periph);=0A= + } else=0A= + cam_periph_release_locked(periph);=0A= + break;=0A= + }=0A= +=0A= ata_params =3D (struct ata_params*)=0A= malloc(sizeof(*ata_params), M_SCSIDA, M_NOWAIT|M_ZERO);=0A= =0A= @@ -3134,7 +3191,7 @@=0A= }=0A= =0A= free(ata_params, M_SCSIDA);=0A= - dadeletemethodchoose(softc, DA_DELETE_NONE);=0A= + dadeletemethodauto(periph);=0A= /*=0A= * Since our peripheral may be invalidated by an error=0A= * above or an external event, we must release our CCB=0A= ------=_NextPart_000_0415_01CE4559.890A90E0-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 04:31:58 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 45129AA3; Tue, 30 Apr 2013 04:31:58 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 250E819F5; Tue, 30 Apr 2013 04:31:57 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r3U4Vo2F078570; Tue, 30 Apr 2013 04:31:50 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id yeciirvewq6xcmjzhd8xfxh3ri; Tue, 30 Apr 2013 04:31:50 +0000 (UTC) (envelope-from tim@kientzle.com) Subject: Re: svn commit: r249774 - head/sys/boot/fdt/dts Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <201304221853.r3MIram6060889@svn.freebsd.org> Date: Mon, 29 Apr 2013 21:31:50 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <8DA5B1ED-C616-4D2F-9235-E37A89F7EABE@kientzle.com> References: <201304221853.r3MIram6060889@svn.freebsd.org> To: Oleksandr Tymoshenko X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 04:31:58 -0000 On Apr 22, 2013, at 11:53 AM, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Mon Apr 22 18:53:36 2013 > New Revision: 249774 > URL: http://svnweb.freebsd.org/changeset/base/249774 >=20 > Log: > Split BeagleBone DTS to generic AM335x part and Beagle-bone specific >=20 > Added: > head/sys/boot/fdt/dts/am335x.dtsi (contents, props changed) > Modified: > head/sys/boot/fdt/dts/beaglebone.dts >=20 > Added: head/sys/boot/fdt/dts/am335x.dtsi > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > + > +/ { > + compatible =3D "ti,am335x"; >=20 > Modified: head/sys/boot/fdt/dts/beaglebone.dts > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >=20 > +/include/ "am335x.dtsi" > + > / { > model =3D "beaglebone"; > - compatible =3D "beaglebone", "ti,am335x"; This used to have two "compatible" names; now it only has one. Is there a way to have both again? (Mostly I'm just curious; I'm still learning FDT conventions.) Tim From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 05:08:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6DC746A; Tue, 30 Apr 2013 05:08:18 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 45FC21B30; Tue, 30 Apr 2013 05:08:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U58IRq062511; Tue, 30 Apr 2013 05:08:18 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U58If4062510; Tue, 30 Apr 2013 05:08:18 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304300508.r3U58If4062510@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 30 Apr 2013 05:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250088 - head/sys/dev/bktr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 05:08:18 -0000 Author: pluknet Date: Tue Apr 30 05:08:17 2013 New Revision: 250088 URL: http://svnweb.freebsd.org/changeset/base/250088 Log: Pass a format string to kproc_create() [1] and thus fix the build with -DBKTR_NEW_MSP34XX_DRIVER and -Wformat-security. This also allows to eliminates a superfluous malloc/snprintf/free on intermediate buffer. PR: kern/175546 MFC after: 1 week Modified: head/sys/dev/bktr/msp34xx.c Modified: head/sys/dev/bktr/msp34xx.c ============================================================================== --- head/sys/dev/bktr/msp34xx.c Tue Apr 30 01:15:10 2013 (r250087) +++ head/sys/dev/bktr/msp34xx.c Tue Apr 30 05:08:17 2013 (r250088) @@ -134,7 +134,6 @@ struct msp3400c { /* thread */ struct proc *kthread; - char *threaddesc; int active,restart,rmmod; @@ -1147,12 +1146,6 @@ int msp_attach(bktr_ptr_t bktr) msp->bass = 32768; msp->treble = 32768; msp->input = -1; - msp->threaddesc = malloc(15 * sizeof(char), M_DEVBUF, M_NOWAIT); - if (msp->threaddesc == NULL) { - free(msp, M_DEVBUF); - return ENOMEM; - } - snprintf(msp->threaddesc, 14, "%s_msp34xx_thread", bktr->bktr_xname); for (i = 0; i < DFP_COUNT; i++) msp->dfp_regs[i] = -1; @@ -1163,7 +1156,6 @@ int msp_attach(bktr_ptr_t bktr) if (-1 != rev1) rev2 = msp3400c_read(bktr, I2C_MSP3400C_DFP, 0x1f); if ((-1 == rev1) || (0 == rev1 && 0 == rev2)) { - free(msp->threaddesc, M_DEVBUF); free(msp, M_DEVBUF); bktr->msp3400c_info = NULL; printf("%s: msp3400: error while reading chip version\n", bktr_name(bktr)); @@ -1199,10 +1191,9 @@ int msp_attach(bktr_ptr_t bktr) /* startup control thread */ err = kproc_create(msp->simple ? msp3410d_thread : msp3400c_thread, bktr, &msp->kthread, (RFFDG | RFPROC), 0, - msp->threaddesc); + "%s_msp34xx_thread", bktr->bktr_xname); if (err) { printf("%s: Error returned by kproc_create: %d", bktr_name(bktr), err); - free(msp->threaddesc, M_DEVBUF); free(msp, M_DEVBUF); bktr->msp3400c_info = NULL; return ENXIO; From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 05:32:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7F43A9E9; Tue, 30 Apr 2013 05:32:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 627F91C0F; Tue, 30 Apr 2013 05:32:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U5W8nE072115; Tue, 30 Apr 2013 05:32:08 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U5W7DT072106; Tue, 30 Apr 2013 05:32:07 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304300532.r3U5W7DT072106@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Apr 2013 05:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250090 - in head/sys/dev/cxgbe: . common firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 05:32:08 -0000 Author: np Date: Tue Apr 30 05:32:07 2013 New Revision: 250090 URL: http://svnweb.freebsd.org/changeset/base/250090 Log: cxgbe(4): Some updates to shared code. Obtained from: Chelsio MFC after: 1 week Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/osdep.h Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Tue Apr 30 05:30:09 2013 (r250089) +++ head/sys/dev/cxgbe/common/common.h Tue Apr 30 05:32:07 2013 (r250090) @@ -424,7 +424,7 @@ int t4_read_flash(struct adapter *adapte int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); int t4_load_boot(struct adapter *adap, u8 *boot_data, unsigned int boot_addr, unsigned int size); -unsigned int t4_flash_cfg_addr(struct adapter *adapter); +int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 05:30:09 2013 (r250089) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 05:32:07 2013 (r250090) @@ -176,9 +176,7 @@ static void t4_report_fw_error(struct ad u32 pcie_fw; pcie_fw = t4_read_reg(adap, A_PCIE_FW); - if (!(pcie_fw & F_PCIE_FW_ERR)) - CH_ERR(adap, "Firmware error report called with no error\n"); - else + if (pcie_fw & F_PCIE_FW_ERR) CH_ERR(adap, "Firmware reports adapter error: %s\n", reason[G_PCIE_FW_EVAL(pcie_fw)]); } @@ -512,6 +510,7 @@ struct t4_vpd_hdr { #define VPD_BASE_OLD 0 #define VPD_LEN 1024 #define VPD_INFO_FLD_HDR_SIZE 3 +#define CHELSIO_VPD_UNIQUE_ID 0x82 /** * t4_seeprom_read - read a serial EEPROM location @@ -676,7 +675,7 @@ static int get_vpd_params(struct adapter * it at 0. */ ret = t4_seeprom_read(adapter, VPD_BASE, (u32 *)(vpd)); - addr = *vpd == 0x82 ? VPD_BASE : VPD_BASE_OLD; + addr = *vpd == CHELSIO_VPD_UNIQUE_ID ? VPD_BASE : VPD_BASE_OLD; for (i = 0; i < sizeof(vpd); i += 4) { ret = t4_seeprom_read(adapter, addr + i, (u32 *)(vpd + i)); @@ -714,8 +713,10 @@ static int get_vpd_params(struct adapter i = vpd[sn - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->sn, vpd + sn, min(i, SERNUM_LEN)); strstrip(p->sn); + i = vpd[pn - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->pn, vpd + pn, min(i, PN_LEN)); strstrip((char *)p->pn); + i = vpd[na - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->na, vpd + na, min(i, MACADDR_LEN)); strstrip((char *)p->na); @@ -1034,14 +1035,19 @@ static int t4_flash_erase_sectors(struct * @adapter: the adapter * * Return the address within the flash where the Firmware Configuration - * File is stored. + * File is stored, or an error if the device FLASH is too small to contain + * a Firmware Configuration File. */ -unsigned int t4_flash_cfg_addr(struct adapter *adapter) +int t4_flash_cfg_addr(struct adapter *adapter) { - if (adapter->params.sf_size == 0x100000) - return FLASH_FPGA_CFG_START; - else - return FLASH_CFG_START; + /* + * If the device FLASH isn't large enough to hold a Firmware + * Configuration File, return an error. + */ + if (adapter->params.sf_size < FLASH_CFG_START + FLASH_CFG_MAX_SIZE) + return -ENOSPC; + + return FLASH_CFG_START; } /** @@ -1054,12 +1060,16 @@ unsigned int t4_flash_cfg_addr(struct ad */ int t4_load_cfg(struct adapter *adap, const u8 *cfg_data, unsigned int size) { - int ret, i, n; + int ret, i, n, cfg_addr; unsigned int addr; unsigned int flash_cfg_start_sec; unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; - addr = t4_flash_cfg_addr(adap); + cfg_addr = t4_flash_cfg_addr(adap); + if (cfg_addr < 0) + return cfg_addr; + + addr = cfg_addr; flash_cfg_start_sec = addr / SF_SEC_SIZE; if (size > FLASH_CFG_MAX_SIZE) { @@ -1839,7 +1849,8 @@ void t4_ulprx_read_la(struct adapter *ad } #define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\ - FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_ANEG) + FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \ + FW_PORT_CAP_SPEED_100G | FW_PORT_CAP_ANEG) /** * t4_link_start - apply link configuration to MAC/PHY @@ -2406,8 +2417,13 @@ static void mem_intr_handler(struct adap addr = EDC_REG(A_EDC_INT_CAUSE, idx); cnt_addr = EDC_REG(A_EDC_ECC_STATUS, idx); } else { - addr = A_MC_INT_CAUSE; - cnt_addr = A_MC_ECC_STATUS; + if (is_t4(adapter)) { + addr = A_MC_INT_CAUSE; + cnt_addr = A_MC_ECC_STATUS; + } else { + addr = A_MC_P_INT_CAUSE; + cnt_addr = A_MC_P_ECC_STATUS; + } } v = t4_read_reg(adapter, addr) & MEM_INT_MASK; @@ -2514,12 +2530,19 @@ static void xgmac_intr_handler(struct ad static void pl_intr_handler(struct adapter *adap) { static struct intr_info pl_intr_info[] = { - { F_FATALPERR, "T4 fatal parity error", -1, 1 }, + { F_FATALPERR, "Fatal parity error", -1, 1 }, { F_PERRVFID, "PL VFID_MAP parity error", -1, 1 }, { 0 } }; - if (t4_handle_intr_status(adap, A_PL_PL_INT_CAUSE, pl_intr_info)) + static struct intr_info t5_pl_intr_info[] = { + { F_PL_BUSPERR, "PL bus parity error", -1, 1 }, + { F_FATALPERR, "Fatal parity error", -1, 1 }, + { 0 } + }; + + if (t4_handle_intr_status(adap, A_PL_PL_INT_CAUSE, + is_t4(adap) ? pl_intr_info : t5_pl_intr_info)) t4_fatal_err(adap); } @@ -2652,7 +2675,6 @@ void t4_intr_clear(struct adapter *adapt A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, A_PCIE_NONFAT_ERR, A_PCIE_INT_CAUSE, - A_MC_INT_CAUSE, A_MA_INT_WRAP_STATUS, A_MA_PARITY_ERROR_STATUS, A_MA_INT_CAUSE, A_EDC_INT_CAUSE, EDC_REG(A_EDC_INT_CAUSE, 1), A_CIM_HOST_INT_CAUSE, A_CIM_HOST_UPACC_INT_CAUSE, @@ -2672,6 +2694,9 @@ void t4_intr_clear(struct adapter *adapt for (i = 0; i < ARRAY_SIZE(cause_reg); ++i) t4_write_reg(adapter, cause_reg[i], 0xffffffff); + t4_write_reg(adapter, is_t4(adapter) ? A_MC_INT_CAUSE : + A_MC_P_INT_CAUSE, 0xffffffff); + t4_write_reg(adapter, A_PL_INT_CAUSE, GLBL_INTR_MASK); (void) t4_read_reg(adapter, A_PL_INT_CAUSE); /* flush */ } @@ -4666,8 +4691,8 @@ int t4_query_params(struct adapter *adap V_FW_PARAMS_CMD_VFN(vf)); c.retval_len16 = htonl(FW_LEN16(c)); - for (i = 0; i < nparams; i++, p += 2) - *p = htonl(*params++); + for (i = 0; i < nparams; i++, p += 2, params++) + *p = htonl(*params); ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); if (ret == 0) @@ -4706,8 +4731,10 @@ int t4_set_params(struct adapter *adap, c.retval_len16 = htonl(FW_LEN16(c)); while (nparams--) { - *p++ = htonl(*params++); - *p++ = htonl(*val++); + *p++ = htonl(*params); + params++; + *p++ = htonl(*val); + val++; } return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); @@ -5299,6 +5326,8 @@ int t4_handle_fw_rpl(struct adapter *ada speed = SPEED_1000; else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_10G)) speed = SPEED_10000; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_40G)) + speed = SPEED_40000; for_each_port(adap, i) { pi = adap2pinfo(adap, i); @@ -5312,6 +5341,7 @@ int t4_handle_fw_rpl(struct adapter *ada lc->link_ok = link_ok; lc->speed = speed; lc->fc = fc; + lc->supported = ntohs(p->u.info.pcap); t4_os_link_changed(adap, i, link_ok); } if (mod != pi->mod_type) { Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Apr 30 05:30:09 2013 (r250089) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Apr 30 05:32:07 2013 (r250090) @@ -80,6 +80,7 @@ enum fw_retval { ********************************/ enum fw_wr_opcodes { + FW_FRAG_WR = 0x1d, FW_FILTER_WR = 0x02, FW_ULPTX_WR = 0x04, FW_TP_WR = 0x05, @@ -203,6 +204,24 @@ struct fw_wr_hdr { #define V_FW_WR_LEN16(x) ((x) << S_FW_WR_LEN16) #define G_FW_WR_LEN16(x) (((x) >> S_FW_WR_LEN16) & M_FW_WR_LEN16) +struct fw_frag_wr { + __be32 op_to_fragoff16; + __be32 flowid_len16; + __be64 r4; +}; + +#define S_FW_FRAG_WR_EOF 15 +#define M_FW_FRAG_WR_EOF 0x1 +#define V_FW_FRAG_WR_EOF(x) ((x) << S_FW_FRAG_WR_EOF) +#define G_FW_FRAG_WR_EOF(x) (((x) >> S_FW_FRAG_WR_EOF) & M_FW_FRAG_WR_EOF) +#define F_FW_FRAG_WR_EOF V_FW_FRAG_WR_EOF(1U) + +#define S_FW_FRAG_WR_FRAGOFF16 8 +#define M_FW_FRAG_WR_FRAGOFF16 0x7f +#define V_FW_FRAG_WR_FRAGOFF16(x) ((x) << S_FW_FRAG_WR_FRAGOFF16) +#define G_FW_FRAG_WR_FRAGOFF16(x) \ + (((x) >> S_FW_FRAG_WR_FRAGOFF16) & M_FW_FRAG_WR_FRAGOFF16) + /* valid filter configurations for compressed tuple * Encodings: TPL - Compressed TUPLE for filter in addition to 4-tuple * FR - FRAGMENT, FC - FCoE, MT - MPS MATCH TYPE, M - MPS MATCH, @@ -2996,6 +3015,9 @@ enum fw_ldst_addrspc { FW_LDST_ADDRSPC_FUNC_I2C = 0x002A, /* legacy */ FW_LDST_ADDRSPC_LE = 0x0030, FW_LDST_ADDRSPC_I2C = 0x0038, + FW_LDST_ADDRSPC_PCIE_CFGS = 0x0040, + FW_LDST_ADDRSPC_PCIE_DBG = 0x0041, + FW_LDST_ADDRSPC_PCIE_PHY = 0x0042, }; /* @@ -3482,13 +3504,20 @@ enum fw_params_param_dev { FW_PARAMS_PARAM_DEV_INTFVER_ISCSIPDU = 0x08, FW_PARAMS_PARAM_DEV_INTFVER_ISCSI = 0x09, FW_PARAMS_PARAM_DEV_INTFVER_FCOE = 0x0A, - FW_PARAMS_PARAM_DEV_FWREV = 0x0B, - FW_PARAMS_PARAM_DEV_TPREV = 0x0C, - FW_PARAMS_PARAM_DEV_CF = 0x0D, - FW_PARAMS_PARAM_DEV_BYPASS = 0x0E, - FW_PARAMS_PARAM_DEV_PHYFW = 0x0F, - FW_PARAMS_PARAM_DEV_LOAD = 0x10, - FW_PARAMS_PARAM_DEV_DIAG = 0x11, + FW_PARAMS_PARAM_DEV_FWREV = 0x0B, + FW_PARAMS_PARAM_DEV_TPREV = 0x0C, + FW_PARAMS_PARAM_DEV_CF = 0x0D, + FW_PARAMS_PARAM_DEV_BYPASS = 0x0E, + FW_PARAMS_PARAM_DEV_PHYFW = 0x0F, + FW_PARAMS_PARAM_DEV_LOAD = 0x10, + FW_PARAMS_PARAM_DEV_DIAG = 0x11, + FW_PARAMS_PARAM_DEV_UCLK = 0x12, /* uP clock in khz */ + FW_PARAMS_PARAM_DEV_MAXORDIRD_QP = 0x13, /* max supported QP IRD/ORD + */ + FW_PARAMS_PARAM_DEV_MAXIRD_ADAPTER= 0x14,/* max supported ADAPTER IRD + */ + FW_PARAMS_PARAM_DEV_INTFVER_FCOEPDU = 0x15, + FW_PARAMS_PARAM_DEV_MCINIT = 0x16, }; /* @@ -5860,6 +5889,9 @@ enum fw_port_type { FW_PORT_TYPE_SFP = 9, /* No, 1, Yes, No, No, No, 10G */ FW_PORT_TYPE_BP_AP = 10, /* No, 1, No, No, Yes, Yes, 10G, BP ANGE */ FW_PORT_TYPE_BP4_AP = 11, /* No, 4, No, No, Yes, Yes, 10G, BP ANGE */ + FW_PORT_TYPE_QSFP_10G = 12, /* No, 1, Yes, No, No, No, 10G */ + FW_PORT_TYPE_QSFP = 14, /* No, 4, Yes, No, No, No, 40G */ + FW_PORT_TYPE_BP40_BA = 15, /* No, 4, No, No, Yes, Yes, 40G/10G/1G, BP ANGE */ FW_PORT_TYPE_NONE = M_FW_PORT_CMD_PTYPE }; @@ -6783,6 +6815,7 @@ enum fw_devlog_level { */ enum fw_devlog_facility { FW_DEVLOG_FACILITY_CORE = 0x00, + FW_DEVLOG_FACILITY_CF = 0x01, FW_DEVLOG_FACILITY_SCHED = 0x02, FW_DEVLOG_FACILITY_TIMER = 0x04, FW_DEVLOG_FACILITY_RES = 0x06, Modified: head/sys/dev/cxgbe/osdep.h ============================================================================== --- head/sys/dev/cxgbe/osdep.h Tue Apr 30 05:30:09 2013 (r250089) +++ head/sys/dev/cxgbe/osdep.h Tue Apr 30 05:32:07 2013 (r250090) @@ -109,6 +109,7 @@ typedef boolean_t bool; #define SPEED_100 100 #define SPEED_1000 1000 #define SPEED_10000 10000 +#define SPEED_40000 40000 #define DUPLEX_HALF 0 #define DUPLEX_FULL 1 #define AUTONEG_DISABLE 0 From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 05:51:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 75427E7D; Tue, 30 Apr 2013 05:51:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 689891CAB; Tue, 30 Apr 2013 05:51:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U5pq73078878; Tue, 30 Apr 2013 05:51:52 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U5pqpn078875; Tue, 30 Apr 2013 05:51:52 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304300551.r3U5pqpn078875@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Apr 2013 05:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250092 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 05:51:53 -0000 Author: np Date: Tue Apr 30 05:51:52 2013 New Revision: 250092 URL: http://svnweb.freebsd.org/changeset/base/250092 Log: - Provide accurate ifmedia information so that 40G ports/transceivers are displayed properly in ifconfig, etc. - Use the same number of tx and rx queues for a 40G port as for a 10G port. 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 Tue Apr 30 05:39:42 2013 (r250091) +++ head/sys/dev/cxgbe/adapter.h Tue Apr 30 05:51:52 2013 (r250092) @@ -757,6 +757,13 @@ is_10G_port(const struct port_info *pi) return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); } +static inline bool +is_40G_port(const struct port_info *pi) +{ + + return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) != 0); +} + static inline int tx_resume_threshold(struct sge_eq *eq) { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Apr 30 05:39:42 2013 (r250091) +++ head/sys/dev/cxgbe/t4_main.c Tue Apr 30 05:51:52 2013 (r250092) @@ -666,7 +666,7 @@ t4_attach(device_t dev) device_get_nameunit(dev), i); mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); - if (is_10G_port(pi)) { + if (is_10G_port(pi) || is_40G_port(pi)) { n10g++; pi->tmr_idx = t4_tmr_idx_10g; pi->pktc_idx = t4_pktc_idx_10g; @@ -756,7 +756,7 @@ t4_attach(device_t dev) pi->first_rxq = rqidx; pi->first_txq = tqidx; - if (is_10G_port(pi)) { + if (is_10G_port(pi) || is_40G_port(pi)) { pi->nrxq = iaq.nrxq10g; pi->ntxq = iaq.ntxq10g; } else { @@ -771,7 +771,7 @@ t4_attach(device_t dev) if (is_offload(sc)) { pi->first_ofld_rxq = ofld_rqidx; pi->first_ofld_txq = ofld_tqidx; - if (is_10G_port(pi)) { + if (is_10G_port(pi) || is_40G_port(pi)) { pi->nofldrxq = iaq.nofldrxq10g; pi->nofldtxq = iaq.nofldtxq10g; } else { @@ -2595,16 +2595,47 @@ build_medialist(struct port_info *pi) case FW_PORT_MOD_TYPE_NA: case FW_PORT_MOD_TYPE_ER: default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", + pi->port_type, pi->mod_type); + ifmedia_add(media, m | IFM_UNKNOWN, data, NULL); + ifmedia_set(media, m | IFM_UNKNOWN); + break; + } + break; + + case FW_PORT_TYPE_QSFP: + switch (pi->mod_type) { + + case FW_PORT_MOD_TYPE_LR: + ifmedia_add(media, m | IFM_40G_LR4, data, NULL); + ifmedia_set(media, m | IFM_40G_LR4); + break; + + case FW_PORT_MOD_TYPE_SR: + ifmedia_add(media, m | IFM_40G_SR4, data, NULL); + ifmedia_set(media, m | IFM_40G_SR4); + break; + case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: + case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: + ifmedia_add(media, m | IFM_40G_CR4, data, NULL); + ifmedia_set(media, m | IFM_40G_CR4); + break; + + default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", + pi->port_type, pi->mod_type); ifmedia_add(media, m | IFM_UNKNOWN, data, NULL); ifmedia_set(media, m | IFM_UNKNOWN); break; } break; - case FW_PORT_TYPE_KX4: - case FW_PORT_TYPE_KX: - case FW_PORT_TYPE_KR: default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", pi->port_type, + pi->mod_type); ifmedia_add(media, m | IFM_UNKNOWN, data, NULL); ifmedia_set(media, m | IFM_UNKNOWN); break; From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 06:30:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2D810789; Tue, 30 Apr 2013 06:30:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1FBE31DF9; Tue, 30 Apr 2013 06:30:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U6UMTO092865; Tue, 30 Apr 2013 06:30:22 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U6ULDH092864; Tue, 30 Apr 2013 06:30:21 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304300630.r3U6ULDH092864@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Apr 2013 06:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250093 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 06:30:22 -0000 Author: np Date: Tue Apr 30 06:30:21 2013 New Revision: 250093 URL: http://svnweb.freebsd.org/changeset/base/250093 Log: Attach to the T580 (2 x 40G) card. 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 Tue Apr 30 05:51:52 2013 (r250092) +++ head/sys/dev/cxgbe/t4_main.c Tue Apr 30 06:30:21 2013 (r250093) @@ -444,6 +444,7 @@ struct { {0x5401, "Chelsio T520-CR"}, {0x5407, "Chelsio T520-SO"}, {0x5408, "Chelsio T520-CX"}, + {0x5410, "Chelsio T580-LP-CR"}, /* 2 x 40G */ {0x5411, "Chelsio T520-LL-CR"}, #ifdef notyet {0x5402, "Chelsio T522-CR"}, @@ -458,7 +459,6 @@ struct { {0x540d, "Chelsio T580-CR"}, {0x540e, "Chelsio T540-LP-CR"}, {0x540f, "Chelsio Amsterdam"}, - {0x5410, "Chelsio T580-LP-CR"}, {0x5412, "Chelsio T560-CR"}, {0x5413, "Chelsio T580-CR"}, #endif From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 06:41:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 99788A11; Tue, 30 Apr 2013 06:41:42 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B0A81E74; Tue, 30 Apr 2013 06:41:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U6fgvP096648; Tue, 30 Apr 2013 06:41:42 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U6fgH5096647; Tue, 30 Apr 2013 06:41:42 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201304300641.r3U6fgH5096647@svn.freebsd.org> From: Kirk McKusick Date: Tue, 30 Apr 2013 06:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250094 - stable/9/sbin/tunefs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 06:41:42 -0000 Author: mckusick Date: Tue Apr 30 06:41:42 2013 New Revision: 250094 URL: http://svnweb.freebsd.org/changeset/base/250094 Log: MFC of 249789: Fix error check. Submitted by: Andrey Chernov (ache@) Modified: stable/9/sbin/tunefs/tunefs.c Directory Properties: stable/9/sbin/tunefs/ (props changed) Modified: stable/9/sbin/tunefs/tunefs.c ============================================================================== --- stable/9/sbin/tunefs/tunefs.c Tue Apr 30 06:30:21 2013 (r250093) +++ stable/9/sbin/tunefs/tunefs.c Tue Apr 30 06:41:42 2013 (r250094) @@ -172,7 +172,7 @@ main(int argc, char *argv[]) found_arg = 1; name = "space to hold for metadata blocks"; kvalue = atoi(optarg); - if (mvalue < 0) + if (kvalue < 0) errx(10, "bad %s (%s)", name, optarg); kflag = 1; break; From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 07:22:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 786E638B; Tue, 30 Apr 2013 07:22:04 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DE741FFC; Tue, 30 Apr 2013 07:22:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U7M4I3011366; Tue, 30 Apr 2013 07:22:04 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U7M4Ks011365; Tue, 30 Apr 2013 07:22:04 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304300722.r3U7M4Ks011365@svn.freebsd.org> From: Joel Dahl Date: Tue, 30 Apr 2013 07:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250095 - head/sbin/dumpon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 07:22:06 -0000 Author: joel (doc committer) Date: Tue Apr 30 07:22:03 2013 New Revision: 250095 URL: http://svnweb.freebsd.org/changeset/base/250095 Log: Adapt to the fact that minidumps are now on by default. PR: 177188 Modified: head/sbin/dumpon/dumpon.8 Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Tue Apr 30 06:41:42 2013 (r250094) +++ head/sbin/dumpon/dumpon.8 Tue Apr 30 07:22:03 2013 (r250095) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 12, 1995 +.Dd April 29, 2013 .Dt DUMPON 8 .Os .Sh NAME @@ -59,14 +59,21 @@ controlled by the variable in the boot time configuration file .Pa /etc/rc.conf . .Pp -For most systems the size of the specified dump device must be at +The default type of kernel crash dump is the mini crash dump. +Mini crash dumps hold only memory pages in use by the kernel. +Alternatively, full memory dumps can be enabled by setting the +.Va debug.minidump +.Xr sysctl 8 +variable to 0. +.Pp +For systems using full memory dumps, the size of the specified dump +device must be at least the size of physical memory. Even though an additional 64 kB header is added to the dump, the BIOS for a platform typically holds back some memory, so it is not usually necessary to size the dump device larger than the actual amount of RAM available in the machine. -.Pp -The +Also, when using full memory dumps, the .Nm utility will refuse to enable a dump device which is smaller than the total amount of physical memory as reported by the From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 08:18:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C3D3610C; Tue, 30 Apr 2013 08:18:09 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6A7E1227; Tue, 30 Apr 2013 08:18:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U8I9Qd030510; Tue, 30 Apr 2013 08:18:09 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U8I9wN030508; Tue, 30 Apr 2013 08:18:09 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201304300818.r3U8I9wN030508@svn.freebsd.org> From: Davide Italiano Date: Tue, 30 Apr 2013 08:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250096 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 08:18:09 -0000 Author: davide Date: Tue Apr 30 08:18:08 2013 New Revision: 250096 URL: http://svnweb.freebsd.org/changeset/base/250096 Log: Fixup Westmere hwpmc(4) support: add missing CPU flag so that intrucion-retired, llc-misses and llc-reference events can now be allocated. Reviewed by: jimharris, gnn Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Tue Apr 30 07:22:03 2013 (r250095) +++ head/sys/dev/hwpmc/hwpmc_core.c Tue Apr 30 08:18:08 2013 (r250096) @@ -860,9 +860,9 @@ static struct iap_event_descr iap_events IAPDESCR(2EH_01H, 0x2E, 0x01, IAP_F_FM | IAP_F_WM), IAPDESCR(2EH_02H, 0x2E, 0x02, IAP_F_FM | IAP_F_WM), IAPDESCR(2EH_41H, 0x2E, 0x41, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(2EH_4FH, 0x2E, 0x4F, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(30H, 0x30, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), @@ -1359,7 +1359,7 @@ static struct iap_event_descr iap_events IAPDESCR(BFH_05H, 0xBF, 0x05, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(C0H_00H, 0xC0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(C0H_01H, 0xC0, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 08:33:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7D4A54A; Tue, 30 Apr 2013 08:33:38 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA0DB12DF; Tue, 30 Apr 2013 08:33:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U8XchP036502; Tue, 30 Apr 2013 08:33:38 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U8XcHB036501; Tue, 30 Apr 2013 08:33:38 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201304300833.r3U8XcHB036501@svn.freebsd.org> From: Davide Italiano Date: Tue, 30 Apr 2013 08:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250097 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 08:33:38 -0000 Author: davide Date: Tue Apr 30 08:33:38 2013 New Revision: 250097 URL: http://svnweb.freebsd.org/changeset/base/250097 Log: When hwpmc(4) module is unloaded it reports a double leakage. This happens at least if FreeBSD is ran under VirtualBox. In order to avoid the leakage, properly deallocate structures in case CPU claims that hw performance monitoring counters are not supported. Reported by: hiren Modified: head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Tue Apr 30 08:18:08 2013 (r250096) +++ head/sys/dev/hwpmc/hwpmc_intel.c Tue Apr 30 08:33:38 2013 (r250097) @@ -87,7 +87,7 @@ pmc_intel_initialize(void) cputype = -1; nclasses = 2; - + error = 0; model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); switch (cpu_id & 0xF00) { @@ -192,10 +192,6 @@ pmc_intel_initialize(void) ncpus = pmc_cpu_max(); - error = pmc_tsc_initialize(pmc_mdep, ncpus); - if (error) - goto error; - switch (cputype) { #if defined(__i386__) || defined(__amd64__) /* @@ -271,10 +267,10 @@ pmc_intel_initialize(void) break; } #endif - + error = pmc_tsc_initialize(pmc_mdep, ncpus); error: if (error) { - free(pmc_mdep, M_PMC); + pmc_mdep_free(pmc_mdep); pmc_mdep = NULL; } From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 09:44:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 648B5C3C for ; Tue, 30 Apr 2013 09:44:12 +0000 (UTC) (envelope-from westernunion18920@yahoo.in) Received: from n7-vm2.bullet.mail.ne1.yahoo.com (n7-vm2.bullet.mail.ne1.yahoo.com [98.138.229.126]) by mx1.freebsd.org (Postfix) with ESMTP id 1F3D415F7 for ; Tue, 30 Apr 2013 09:44:11 +0000 (UTC) Received: from [98.138.101.135] by n7.bullet.mail.ne1.yahoo.com with NNFMP; 30 Apr 2013 09:44:05 -0000 Received: from [98.136.168.83] by t7.bullet.mail.ne1.yahoo.com with NNFMP; 30 Apr 2013 09:44:05 -0000 Received: from [127.0.0.1] by store173.c108.cal.gq1.yahoo.com with NNFMP; 30 Apr 2013 09:44:05 -0000 X-yahoo-newman-expires: 1367318645 Date: Tue, 30 Apr 2013 02:44:05 -0700 (PDT) From: "western. Union" Sender: "western. Union" To: svn-src-all@freebsd.org Message-ID: <1508228921.687322.1367315045034.JavaMail.zimbra@store173.c108.cal.gq1.yahoo.com> Subject: Invitation: From Western union MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_687319_800948687.1367315045032" X-Yahoo-Newman-Property: calendar-invite X-Yahoo-Newman-Id: westernunion18920:8639c546-5703-4e82-ab89-36fc6db10830:1367315045135:svn-src-all@freebsd.org X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "western. Union" List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 09:44:12 -0000 ------=_Part_687319_800948687.1367315045032 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit YAHOO! CALENDAR - YOU'RE INVITED! westernunion18920@yahoo.in has sent an invitation: >From Western union When: Tuesday, 30 April, 2013 11:00 a - 12:00 p (GMT+00:00) Your first payment of $4000 was sent to you today the MTCN NO is 6941311961,sender's name is Mr Edwin Manafa,So kindly reconfirm your Receiver Name,Your Address, and your telephone number,kindly Contact Western union Agent so he can activate the MTCN No to enable you pick up your $4000 from any western union in your country:And you will pay sum of $85 only for the activating fees. E-mail ( westernu.nionbj@live.com ) Contact Person; James Harrison Tel: +229 94351174 Make sure you send your full information so that you can pick up the $4000 from the western union in your country today. Best Regards Mr.William Okwadike *~*~*~*~*~*~*~*~*~* RSVP Now! http://calendar.yahoo.com/westernunion18920/rsvp?e=svn-src-all@freebsd.org&uid=8639c546-5703-4e82-ab89-36fc6db10830&tk=fi7SYTPt179cheLvWrG4x_SQEs4-&hh=Out1h0YISnawSPNfX7quslNw5nE- ------=_Part_687319_800948687.1367315045032-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 09:44:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AB23BCA3 for ; Tue, 30 Apr 2013 09:44:28 +0000 (UTC) (envelope-from westernunion18920@yahoo.in) Received: from n4-vm2.bullet.mail.ne1.yahoo.com (n4-vm2.bullet.mail.ne1.yahoo.com [98.138.229.242]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3E515FF for ; Tue, 30 Apr 2013 09:44:27 +0000 (UTC) Received: from [98.138.101.136] by n4.bullet.mail.ne1.yahoo.com with NNFMP; 30 Apr 2013 09:44:21 -0000 Received: from [98.136.168.83] by t8.bullet.mail.ne1.yahoo.com with NNFMP; 30 Apr 2013 09:44:20 -0000 Received: from [127.0.0.1] by store173.c108.cal.gq1.yahoo.com with NNFMP; 30 Apr 2013 09:44:20 -0000 X-yahoo-newman-expires: 1367318660 Date: Tue, 30 Apr 2013 02:44:20 -0700 (PDT) From: "western. Union" Sender: "western. Union" To: svn-src-all@freebsd.org Message-ID: <1981421454.688122.1367315060653.JavaMail.zimbra@store173.c108.cal.gq1.yahoo.com> Subject: Cancelled: From Western union MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_688119_572011708.1367315060652" X-Yahoo-Newman-Property: calendar-invite X-Yahoo-Newman-Id: westernunion18920:8639c546-5703-4e82-ab89-36fc6db10830:1367315060747:svn-src-all@freebsd.org X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "western. Union" List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 09:44:28 -0000 ------=_Part_688119_572011708.1367315060652 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit YAHOO! CALENDAR - CANCELLED EVENT westernunion18920@yahoo.in has cancelled the invitation: >From Western union When: Tuesday, 30 April, 2013 11:00 a - 12:00 p (GMT+00:00) Your first payment of $4000 was sent to you today the MTCN NO is 6941311961,sender's name is Mr Edwin Manafa,So kindly reconfirm your Receiver Name,Your Address, and your telephone number,kindly Contact Western union Agent so he can activate the MTCN No to enable you pick up your $4000 from any western union in your country:And you will pay sum of $85 only for the activating fees. E-mail ( westernu.nionbj@live.com ) Contact Person; James Harrison Tel: +229 94351174 Make sure you send your full information so that you can pick up the $4000 from the western union in your country today. Best Regards Mr.William Okwadike *~*~*~*~*~*~*~*~*~* Delete invite ? http://calendar.yahoo.com/westernunion18920/deleteInvite?e=svn-src-all@freebsd.org&uid=8639c546-5703-4e82-ab89-36fc6db10830&tk=PaI2xb7DiwfSI_vhzoNuphC9AzE-&hh=Out1h0YISnawSPNfX7quslNw5nE- ------=_Part_688119_572011708.1367315060652-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 09:57:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4ED6198; Tue, 30 Apr 2013 09:57:06 +0000 (UTC) (envelope-from flo@zoidberg.smeets.im) Received: from mail.solomo.de (mail.solomo.de [IPv6:2a01:4f8:162:1142::2]) by mx1.freebsd.org (Postfix) with ESMTP id 94E1D16E0; Tue, 30 Apr 2013 09:57:06 +0000 (UTC) Received: from cpos1.nexxtmobile.de (localhost [127.0.0.1]) by mail.solomo.de (Postfix) with ESMTP id 6A5E01254A; Tue, 30 Apr 2013 11:57:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at nexxtmobile.de Received: from mail.solomo.de ([127.0.0.1]) by cpos1.nexxtmobile.de (cpos1.nexxtmobile.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id G4lPmBQqtZF7; Tue, 30 Apr 2013 11:57:03 +0200 (CEST) Received: from zoidberg.smeets.im (zoidberg.smeets.im [85.214.194.88]) by mail.solomo.de (Postfix) with ESMTP id 8E6FB12542; Tue, 30 Apr 2013 11:57:03 +0200 (CEST) Received: by zoidberg.smeets.im (Postfix, from userid 1001) id 64B0D69F2A; Tue, 30 Apr 2013 11:57:03 +0200 (CEST) Date: Tue, 30 Apr 2013 11:57:03 +0200 From: Florian Smeets To: Carl Delsey Subject: Re: svn commit: r250079 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ntb sys/dev/ntb/if_ntb sys/dev/ntb/ntb_hw sys/modules sys/modules/ntb sys/modules/ntb/if_ntb sys/modules/ntb/ntb_hw Message-ID: <20130430095703.GC14196@zoidberg.smeets.im> References: <201304292248.r3TMmrqT027087@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rQ2U398070+RC21q" Content-Disposition: inline In-Reply-To: <201304292248.r3TMmrqT027087@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 09:57:06 -0000 --rQ2U398070+RC21q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 29, 2013 at 10:48:53PM +0000, Carl Delsey wrote: > Author: carl > Date: Mon Apr 29 22:48:53 2013 > New Revision: 250079 > URL: http://svnweb.freebsd.org/changeset/base/250079 >=20 > Log: > Add a new driver to support the Intel Non-Transparent Bridge(NTB). > =20 Hi Carl, This change breaks installworld. /usr/share/man/man4/nve.4.gz -> /usr/share/man/man4/ntb_hw.4.gz install: link /usr/share/man/man4/ntb_hw.4.gz -> /usr/share/man/man4/nve.4.= gz: No such file or directory *** [_maninstall] Error code 71 I think the following patch does what you intended? Index: share/man/man4/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- share/man/man4/Makefile (revision 250097) +++ share/man/man4/Makefile (working copy) @@ -648,7 +648,8 @@ netintro.4 networking.4 MLINKS+=3D${_nfe.4} ${_if_nfe.4} MLINKS+=3Dnge.4 if_nge.4 -MLINKS+=3D${_ntb.4} ${_if_ntb.4} ${_ntb_hw.4} +MLINKS+=3D${_ntb.4} ${_if_ntb.4} \ + ${_ntb.4} ${_ntb_hw.4} MLINKS+=3D${_nve.4} ${_if_nve.4} MLINKS+=3D${_nxge.4} ${_if_nxge.4} MLINKS+=3Dpatm.4 if_patm.4 With this installworld finished as expected. Florian --rQ2U398070+RC21q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlF/lW0ACgkQapo8P8lCvwnJpACgxtFsaxuLIgoYT5zCmZMFYd06 GIcAnjoaI5IillYfHj1SkbGH6li2odFL =Azqz -----END PGP SIGNATURE----- --rQ2U398070+RC21q-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 10:05:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E56B50C; Tue, 30 Apr 2013 10:05:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 000481745; Tue, 30 Apr 2013 10:05:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UA5ml4069229; Tue, 30 Apr 2013 10:05:48 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UA5mbA069223; Tue, 30 Apr 2013 10:05:48 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304301005.r3UA5mbA069223@svn.freebsd.org> From: Martin Matuska Date: Tue, 30 Apr 2013 10:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250098 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 10:05:49 -0000 Author: mm Date: Tue Apr 30 10:05:47 2013 New Revision: 250098 URL: http://svnweb.freebsd.org/changeset/base/250098 Log: MFC r249858: Merge vendor bugfix for a possible deadlock related to async destroy and improve write performance by introducing a new lock protecting tx_open_txg. Illumos ZFS issues: 3642 dsl_scan_active() should not issue I/O to determine if async destroying is active 3643 txg_delay should not hold the tc_lock Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Apr 30 08:33:38 2013 (r250097) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Apr 30 10:05:47 2013 (r250098) @@ -753,12 +753,16 @@ dsl_destroy_head_sync_impl(dsl_dataset_t zil_destroy_sync(dmu_objset_zil(os), tx); if (!spa_feature_is_active(dp->dp_spa, async_destroy)) { + dsl_scan_t *scn = dp->dp_scan; + spa_feature_incr(dp->dp_spa, async_destroy, tx); dp->dp_bptree_obj = bptree_alloc(mos, tx); VERIFY0(zap_add(mos, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1, &dp->dp_bptree_obj, tx)); + ASSERT(!scn->scn_async_destroying); + scn->scn_async_destroying = B_TRUE; } used = ds->ds_dir->dd_phys->dd_used_bytes; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Tue Apr 30 08:33:38 2013 (r250097) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Tue Apr 30 10:05:47 2013 (r250098) @@ -125,6 +125,15 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t t scn = dp->dp_scan = kmem_zalloc(sizeof (dsl_scan_t), KM_SLEEP); scn->scn_dp = dp; + /* + * It's possible that we're resuming a scan after a reboot so + * make sure that the scan_async_destroying flag is initialized + * appropriately. + */ + ASSERT(!scn->scn_async_destroying); + scn->scn_async_destroying = spa_feature_is_active(dp->dp_spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]); + err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, "scrub_func", sizeof (uint64_t), 1, &f); if (err == 0) { @@ -1374,13 +1383,10 @@ dsl_scan_active(dsl_scan_t *scn) if (spa_shutting_down(spa)) return (B_FALSE); - if (scn->scn_phys.scn_state == DSS_SCANNING) + if (scn->scn_phys.scn_state == DSS_SCANNING || + scn->scn_async_destroying) return (B_TRUE); - if (spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { - return (B_TRUE); - } if (spa_version(scn->scn_dp->dp_spa) >= SPA_VERSION_DEADLISTS) { (void) bpobj_space(&scn->scn_dp->dp_free_bpobj, &used, &comp, &uncomp); @@ -1436,6 +1442,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * if (err == 0 && spa_feature_is_active(spa, &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + ASSERT(scn->scn_async_destroying); scn->scn_is_bptree = B_TRUE; scn->scn_zio_root = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED); @@ -1456,6 +1463,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * VERIFY0(bptree_free(dp->dp_meta_objset, dp->dp_bptree_obj, tx)); dp->dp_bptree_obj = 0; + scn->scn_async_destroying = B_FALSE; } } if (scn->scn_visited_this_txg) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Tue Apr 30 08:33:38 2013 (r250097) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Tue Apr 30 10:05:47 2013 (r250098) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_DSL_SCAN_H @@ -82,6 +82,7 @@ typedef struct dsl_scan { /* for freeing blocks */ boolean_t scn_is_bptree; + boolean_t scn_async_destroying; /* for debugging / information */ uint64_t scn_visited_this_txg; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h Tue Apr 30 08:33:38 2013 (r250097) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h Tue Apr 30 10:05:47 2013 (r250098) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + #ifndef _SYS_TXG_IMPL_H #define _SYS_TXG_IMPL_H @@ -33,14 +37,55 @@ extern "C" { #endif +/* + * The tx_cpu structure is a per-cpu structure that is used to track + * the number of active transaction holds (tc_count). As transactions + * are assigned into a transaction group the appropriate tc_count is + * incremented to indicate that there are pending changes that have yet + * to quiesce. Consumers evenutally call txg_rele_to_sync() to decrement + * the tc_count. A transaction group is not considered quiesced until all + * tx_cpu structures have reached a tc_count of zero. + * + * This structure is a per-cpu structure by design. Updates to this structure + * are frequent and concurrent. Having a single structure would result in + * heavy lock contention so a per-cpu design was implemented. With the fanned + * out mutex design, consumers only need to lock the mutex associated with + * thread's cpu. + * + * The tx_cpu contains two locks, the tc_lock and tc_open_lock. + * The tc_lock is used to protect all members of the tx_cpu structure with + * the exception of the tc_open_lock. This lock should only be held for a + * short period of time, typically when updating the value of tc_count. + * + * The tc_open_lock protects the tx_open_txg member of the tx_state structure. + * This lock is used to ensure that transactions are only assigned into + * the current open transaction group. In order to move the current open + * transaction group to the quiesce phase, the txg_quiesce thread must + * grab all tc_open_locks, increment the tx_open_txg, and drop the locks. + * The tc_open_lock is held until the transaction is assigned into the + * transaction group. Typically, this is a short operation but if throttling + * is occuring it may be held for longer periods of time. + */ struct tx_cpu { - kmutex_t tc_lock; + kmutex_t tc_open_lock; /* protects tx_open_txg */ + kmutex_t tc_lock; /* protects the rest of this struct */ kcondvar_t tc_cv[TXG_SIZE]; uint64_t tc_count[TXG_SIZE]; list_t tc_callbacks[TXG_SIZE]; /* commit cb list */ - char tc_pad[16]; + char tc_pad[8]; /* pad to fill 3 cache lines */ }; +/* + * The tx_state structure maintains the state information about the different + * stages of the pool's transcation groups. A per pool tx_state structure + * is used to track this information. The tx_state structure also points to + * an array of tx_cpu structures (described above). Although the tx_sync_lock + * is used to protect the members of this structure, it is not used to + * protect the tx_open_txg. Instead a special lock in the tx_cpu structure + * is used. Readers of tx_open_txg must grab the per-cpu tc_open_lock. + * Any thread wishing to update tx_open_txg must grab the tc_open_lock on + * every cpu (see txg_quiesce()). + */ typedef struct tx_state { tx_cpu_t *tx_cpu; /* protects right to enter txg */ kmutex_t tx_sync_lock; /* protects tx_state_t */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Tue Apr 30 08:33:38 2013 (r250097) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Tue Apr 30 10:05:47 2013 (r250098) @@ -132,6 +132,8 @@ txg_init(dsl_pool_t *dp, uint64_t txg) int i; mutex_init(&tx->tx_cpu[c].tc_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&tx->tx_cpu[c].tc_open_lock, NULL, MUTEX_DEFAULT, + NULL); for (i = 0; i < TXG_SIZE; i++) { cv_init(&tx->tx_cpu[c].tc_cv[i], NULL, CV_DEFAULT, NULL); @@ -174,6 +176,7 @@ txg_fini(dsl_pool_t *dp) for (c = 0; c < max_ncpus; c++) { int i; + mutex_destroy(&tx->tx_cpu[c].tc_open_lock); mutex_destroy(&tx->tx_cpu[c].tc_lock); for (i = 0; i < TXG_SIZE; i++) { cv_destroy(&tx->tx_cpu[c].tc_cv[i]); @@ -297,10 +300,12 @@ txg_hold_open(dsl_pool_t *dp, txg_handle tx_cpu_t *tc = &tx->tx_cpu[CPU_SEQID]; uint64_t txg; - mutex_enter(&tc->tc_lock); - + mutex_enter(&tc->tc_open_lock); txg = tx->tx_open_txg; + + mutex_enter(&tc->tc_lock); tc->tc_count[txg & TXG_MASK]++; + mutex_exit(&tc->tc_lock); th->th_cpu = tc; th->th_txg = txg; @@ -313,7 +318,8 @@ txg_rele_to_quiesce(txg_handle_t *th) { tx_cpu_t *tc = th->th_cpu; - mutex_exit(&tc->tc_lock); + ASSERT(!MUTEX_HELD(&tc->tc_lock)); + mutex_exit(&tc->tc_open_lock); } void @@ -350,10 +356,10 @@ txg_quiesce(dsl_pool_t *dp, uint64_t txg int c; /* - * Grab all tx_cpu locks so nobody else can get into this txg. + * Grab all tc_open_locks so nobody else can get into this txg. */ for (c = 0; c < max_ncpus; c++) - mutex_enter(&tx->tx_cpu[c].tc_lock); + mutex_enter(&tx->tx_cpu[c].tc_open_lock); ASSERT(txg == tx->tx_open_txg); tx->tx_open_txg++; @@ -363,7 +369,7 @@ txg_quiesce(dsl_pool_t *dp, uint64_t txg * enter the next transaction group. */ for (c = 0; c < max_ncpus; c++) - mutex_exit(&tx->tx_cpu[c].tc_lock); + mutex_exit(&tx->tx_cpu[c].tc_open_lock); /* * Quiesce the transaction group by waiting for everyone to txg_exit(). From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 13:13:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6C95AC48; Tue, 30 Apr 2013 13:13:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5F6081245; Tue, 30 Apr 2013 13:13:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UDDXst036848; Tue, 30 Apr 2013 13:13:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UDDXGN036847; Tue, 30 Apr 2013 13:13:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301313.r3UDDXGN036847@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 13:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250099 - head/tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 13:13:33 -0000 Author: luigi Date: Tue Apr 30 13:13:32 2013 New Revision: 250099 URL: http://svnweb.freebsd.org/changeset/base/250099 Log: sync with my local copy (this file may go away, eventually) Modified: head/tools/tools/netmap/README Modified: head/tools/tools/netmap/README ============================================================================== --- head/tools/tools/netmap/README Tue Apr 30 10:05:47 2013 (r250098) +++ head/tools/tools/netmap/README Tue Apr 30 13:13:32 2013 (r250099) @@ -21,3 +21,4 @@ BSD netmap 0.77 3.82 ports/trafshow (version 5) 0.94 7.7 net-mgmt/ipcad (ip accounting daemon) 0.9 5.0 net-mgmt/darkstat (ip accounting + graphing) + 0.83 2.45 net-mgmt/iftop (curses traffic display) From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 13:20:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 58C7CF8A; Tue, 30 Apr 2013 13:20:12 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 308791299; Tue, 30 Apr 2013 13:20:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UDKCwG038199; Tue, 30 Apr 2013 13:20:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UDKBoM038197; Tue, 30 Apr 2013 13:20:11 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301320.r3UDKBoM038197@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 13:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250100 - in head/release/picobsd/floppy.tree/etc: . ssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 13:20:12 -0000 Author: luigi Date: Tue Apr 30 13:20:11 2013 New Revision: 250100 URL: http://svnweb.freebsd.org/changeset/base/250100 Log: support for sshd (newer config file location) Added: head/release/picobsd/floppy.tree/etc/ssh/ head/release/picobsd/floppy.tree/etc/ssh/sshd_config - copied unchanged from r243964, head/release/picobsd/floppy.tree/etc/sshd_config Deleted: head/release/picobsd/floppy.tree/etc/sshd_config Modified: head/release/picobsd/floppy.tree/etc/master.passwd Modified: head/release/picobsd/floppy.tree/etc/master.passwd ============================================================================== --- head/release/picobsd/floppy.tree/etc/master.passwd Tue Apr 30 13:13:32 2013 (r250099) +++ head/release/picobsd/floppy.tree/etc/master.passwd Tue Apr 30 13:20:11 2013 (r250100) @@ -5,6 +5,7 @@ daemon:*:1:1::0:0:Owner of many system p operator:*:2:20::0:0:System &:/usr/guest/operator:/bin/csh bin:*:3:7::0:0:Binaries Commands and Source,,,:/:/nonexistent tty:*:4:65533::0:0:Tty Sandbox:/:/nonexistent +sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/nonexistent _dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin user:*:1002:1002:Sample User:0:0:user:/home/user:/bin/sh Copied: head/release/picobsd/floppy.tree/etc/ssh/sshd_config (from r243964, head/release/picobsd/floppy.tree/etc/sshd_config) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/picobsd/floppy.tree/etc/ssh/sshd_config Tue Apr 30 13:20:11 2013 (r250100, copy of r243964, head/release/picobsd/floppy.tree/etc/sshd_config) @@ -0,0 +1,29 @@ +Port 22 +ListenAddress 0.0.0.0 +HostKey /etc/ssh_host_key +RandomSeed /etc/ssh_random_seed +ServerKeyBits 768 +LoginGraceTime 600 +KeyRegenerationInterval 3600 +PermitRootLogin yes +IgnoreRhosts no +StrictModes yes +QuietMode no +X11Forwarding no +X11DisplayOffset 10 +FascistLogging no +PrintMotd yes +KeepAlive yes +SyslogFacility AUTH +RhostsAuthentication no +RhostsRSAAuthentication yes +RSAAuthentication yes +PasswordAuthentication no +PermitEmptyPasswords no +UseLogin no +# CheckMail no +# PidFile /u/zappa/.ssh/pid +# AllowHosts *.our.com friend.other.com +# DenyHosts lowsecurity.theirs.com *.evil.org evil.org +# Umask 022 +# SilentDeny yes From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 14:56:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F2413B47; Tue, 30 Apr 2013 14:56:41 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3DF8177C; Tue, 30 Apr 2013 14:56:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UEufDo072226; Tue, 30 Apr 2013 14:56:41 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UEufcC072225; Tue, 30 Apr 2013 14:56:41 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201304301456.r3UEufcC072225@svn.freebsd.org> From: Davide Italiano Date: Tue, 30 Apr 2013 14:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250101 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 14:56:42 -0000 Author: davide Date: Tue Apr 30 14:56:41 2013 New Revision: 250101 URL: http://svnweb.freebsd.org/changeset/base/250101 Log: Complete r250097: Do not change the initialization order in pmc_intel_initialize(). Modified: head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Tue Apr 30 13:20:11 2013 (r250100) +++ head/sys/dev/hwpmc/hwpmc_intel.c Tue Apr 30 14:56:41 2013 (r250101) @@ -191,7 +191,9 @@ pmc_intel_initialize(void) pmc_mdep->pmd_switch_out = intel_switch_out; ncpus = pmc_cpu_max(); - + error = pmc_tsc_initialize(pmc_mdep, ncpus); + if (error) + goto error; switch (cputype) { #if defined(__i386__) || defined(__amd64__) /* @@ -246,8 +248,10 @@ pmc_intel_initialize(void) KASSERT(0, ("[intel,%d] Unknown CPU type", __LINE__)); } - if (error) + if (error) { + pmc_tsc_finalize(pmc_mdep); goto error; + } /* * Init the uncore class. @@ -267,7 +271,6 @@ pmc_intel_initialize(void) break; } #endif - error = pmc_tsc_initialize(pmc_mdep, ncpus); error: if (error) { pmc_mdep_free(pmc_mdep); From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 15:06:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 12746E6B; Tue, 30 Apr 2013 15:06:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04C4417DE; Tue, 30 Apr 2013 15:06:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UF6USn075892; Tue, 30 Apr 2013 15:06:30 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UF6UDa075891; Tue, 30 Apr 2013 15:06:30 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304301506.r3UF6UDa075891@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 30 Apr 2013 15:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250102 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 15:06:31 -0000 Author: jilles Date: Tue Apr 30 15:06:30 2013 New Revision: 250102 URL: http://svnweb.freebsd.org/changeset/base/250102 Log: socket: Make shutdown() wake up a blocked accept(). A blocking accept (and some other operations) waits on &so->so_timeo. Once it wakes up, it will detect the SBS_CANTRCVMORE bit. The error from accept() is [ECONNABORTED] which is not the nicest one -- the thread calling accept() needs to know out-of-band what is happening. A spurious wakeup on so->so_timeo appears harmless (sleep retried) except when lingering on close (SO_LINGER, and in that case there is no descriptor to call shutdown() on) so this should be fairly safe. A shutdown() already woke up a blocked accept() for TCP sockets, but not for Unix domain sockets. This fix is generic for all domains. This patch was sent to -hackers@ and -net@ on April 5. MFC after: 2 weeks Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Apr 30 14:56:41 2013 (r250101) +++ head/sys/kern/uipc_socket.c Tue Apr 30 15:06:30 2013 (r250102) @@ -2429,9 +2429,11 @@ soshutdown(struct socket *so, int how) sorflush(so); if (how != SHUT_RD) { error = (*pr->pr_usrreqs->pru_shutdown)(so); + wakeup(&so->so_timeo); CURVNET_RESTORE(); return (error); } + wakeup(&so->so_timeo); CURVNET_RESTORE(); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 15:31:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF58E782; Tue, 30 Apr 2013 15:31:46 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A1D831A4C; Tue, 30 Apr 2013 15:31:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UFVkcb085542; Tue, 30 Apr 2013 15:31:46 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UFVkC2085540; Tue, 30 Apr 2013 15:31:46 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201304301531.r3UFVkC2085540@svn.freebsd.org> From: Davide Italiano Date: Tue, 30 Apr 2013 15:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250103 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 15:31:46 -0000 Author: davide Date: Tue Apr 30 15:31:45 2013 New Revision: 250103 URL: http://svnweb.freebsd.org/changeset/base/250103 Log: The Intel PMC architectural events have encodings which are identical to those of some non-architectural core events. This is not a problem in the general case as long as there's an 1:1 mapping between the two, but there are few exceptions. For example, 3CH_01H on Nehalem/Westmere represents both unhalted-reference-cycles and CPU_CLK_UNHALTED.REF_P. CPU_CLK_UNHALTED.REF_P on the aforementioned architectures does not measure reference (i.e. bus) but TSC, so there's the need to disambiguate. In order to avoid the namespace collision rename all the architectural events in a way they cannot be ambigous and refactor the architectural events handling function to reflect this change. While here, per Jim Harris request, rename iap_architectural_event_is_unsupported() to iap_event_is_architectural(). Discussed with: jimharris Reviewed by: jimharris, gnn Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Tue Apr 30 15:06:30 2013 (r250102) +++ head/sys/dev/hwpmc/hwpmc_core.c Tue Apr 30 15:31:45 2013 (r250103) @@ -60,6 +60,10 @@ __FBSDID("$FreeBSD$"); PMC_CAP_EDGE | PMC_CAP_THRESHOLD | PMC_CAP_READ | PMC_CAP_WRITE | \ PMC_CAP_INVERT | PMC_CAP_QUALIFIER | PMC_CAP_PRECISE) +#define EV_IS_NOTARCH 0 +#define EV_IS_ARCH_SUPP 1 +#define EV_IS_ARCH_NOTSUPP -1 + /* * "Architectural" events defined by Intel. The values of these * symbols correspond to positions in the bitmask returned by @@ -1723,43 +1727,53 @@ iap_pmc_has_overflowed(int ri) /* * Check an event against the set of supported architectural events. * - * Returns 1 if the event is architectural and unsupported on this - * CPU. Returns 0 otherwise. + * If the event is not architectural EV_IS_NOTARCH is returned. + * If the event is architectural and supported on this CPU, the correct + * event+umask mapping is returned in map, and EV_IS_ARCH_SUPP is returned. + * Otherwise, the function returns EV_IS_ARCH_NOTSUPP. */ static int -iap_architectural_event_is_unsupported(enum pmc_event pe) +iap_is_event_architectural(enum pmc_event pe, enum pmc_event *map) { enum core_arch_events ae; switch (pe) { - case PMC_EV_IAP_EVENT_3CH_00H: + case PMC_EV_IAP_ARCH_UNH_COR_CYC: ae = CORE_AE_UNHALTED_CORE_CYCLES; + *map = PMC_EV_IAP_EVENT_C4H_00H; break; - case PMC_EV_IAP_EVENT_C0H_00H: + case PMC_EV_IAP_ARCH_INS_RET: ae = CORE_AE_INSTRUCTION_RETIRED; + *map = PMC_EV_IAP_EVENT_C0H_00H; break; - case PMC_EV_IAP_EVENT_3CH_01H: + case PMC_EV_IAP_ARCH_UNH_REF_CYC: ae = CORE_AE_UNHALTED_REFERENCE_CYCLES; + *map = PMC_EV_IAP_EVENT_3CH_01H; break; - case PMC_EV_IAP_EVENT_2EH_4FH: + case PMC_EV_IAP_ARCH_LLC_REF: ae = CORE_AE_LLC_REFERENCE; + *map = PMC_EV_IAP_EVENT_2EH_4FH; break; - case PMC_EV_IAP_EVENT_2EH_41H: + case PMC_EV_IAP_ARCH_LLC_MIS: ae = CORE_AE_LLC_MISSES; + *map = PMC_EV_IAP_EVENT_2EH_41H; break; - case PMC_EV_IAP_EVENT_C4H_00H: + case PMC_EV_IAP_ARCH_BR_INS_RET: ae = CORE_AE_BRANCH_INSTRUCTION_RETIRED; + *map = PMC_EV_IAP_EVENT_C4H_00H; break; - case PMC_EV_IAP_EVENT_C5H_00H: + case PMC_EV_IAP_ARCH_BR_MIS_RET: ae = CORE_AE_BRANCH_MISSES_RETIRED; + *map = PMC_EV_IAP_EVENT_C5H_00H; break; default: /* Non architectural event. */ - return (0); + return (EV_IS_NOTARCH); } - return ((core_architectural_events & (1 << ae)) == 0); + return (((core_architectural_events & (1 << ae)) == 0) ? + EV_IS_ARCH_NOTSUPP : EV_IS_ARCH_SUPP); } static int @@ -1917,8 +1931,8 @@ static int iap_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) { - int n, model; - enum pmc_event ev; + int arch, n, model; + enum pmc_event ev, map; struct iap_event_descr *ie; uint32_t c, caps, config, cpuflag, evsel, mask; @@ -1932,10 +1946,13 @@ iap_allocate_pmc(int cpu, int ri, struct if ((IAP_PMC_CAPS & caps) != caps) return (EPERM); - ev = pm->pm_event; - - if (iap_architectural_event_is_unsupported(ev)) + arch = iap_is_event_architectural(pm->pm_event, &map); + if (arch == EV_IS_ARCH_NOTSUPP) return (EOPNOTSUPP); + else if (arch == EV_IS_ARCH_SUPP) + ev = map; + else + ev = pm->pm_event; /* * A small number of events are not supported in all the Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Tue Apr 30 15:06:30 2013 (r250102) +++ head/sys/dev/hwpmc/pmc_events.h Tue Apr 30 15:31:45 2013 (r250103) @@ -468,6 +468,13 @@ __PMC_EV_ALIAS("unhalted-reference-cycle * the CPU model happens inside hwpmc(4). */ #define __PMC_EV_IAP() \ +__PMC_EV(IAP, ARCH_BR_INS_RET) \ +__PMC_EV(IAP, ARCH_BR_MIS_RET) \ +__PMC_EV(IAP, ARCH_INS_RET) \ +__PMC_EV(IAP, ARCH_LLC_MIS) \ +__PMC_EV(IAP, ARCH_LLC_REF) \ +__PMC_EV(IAP, ARCH_UNH_REF_CYC) \ +__PMC_EV(IAP, ARCH_UNH_COR_CYC) \ __PMC_EV(IAP, EVENT_02H_01H) \ __PMC_EV(IAP, EVENT_02H_81H) \ __PMC_EV(IAP, EVENT_03H_00H) \ @@ -1157,20 +1164,20 @@ __PMC_EV(IAP, EVENT_FDH_10H) \ __PMC_EV(IAP, EVENT_FDH_20H) \ __PMC_EV(IAP, EVENT_FDH_40H) -#define PMC_EV_IAP_FIRST PMC_EV_IAP_EVENT_02H_01H +#define PMC_EV_IAP_FIRST PMC_EV_IAP_ARCH_BR_INS_RET #define PMC_EV_IAP_LAST PMC_EV_IAP_EVENT_FDH_40H /* * Map "architectural" event names to event ids. */ #define __PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ -__PMC_EV_ALIAS("branch-instruction-retired", IAP_EVENT_C4H_00H) \ -__PMC_EV_ALIAS("branch-misses-retired", IAP_EVENT_C5H_00H) \ -__PMC_EV_ALIAS("instruction-retired", IAP_EVENT_C0H_00H) \ -__PMC_EV_ALIAS("llc-misses", IAP_EVENT_2EH_41H) \ -__PMC_EV_ALIAS("llc-reference", IAP_EVENT_2EH_4FH) \ -__PMC_EV_ALIAS("unhalted-reference-cycles", IAP_EVENT_3CH_01H) \ -__PMC_EV_ALIAS("unhalted-core-cycles", IAP_EVENT_3CH_00H) +__PMC_EV_ALIAS("branch-instruction-retired", IAP_ARCH_BR_INS_RET) \ +__PMC_EV_ALIAS("branch-misses-retired", IAP_ARCH_BR_MIS_RET) \ +__PMC_EV_ALIAS("instruction-retired", IAP_ARCH_INS_RET) \ +__PMC_EV_ALIAS("llc-misses", IAP_ARCH_LLC_MIS) \ +__PMC_EV_ALIAS("llc-reference", IAP_ARCH_LLC_REF) \ +__PMC_EV_ALIAS("unhalted-reference-cycles", IAP_ARCH_UNH_REF_CYC) \ +__PMC_EV_ALIAS("unhalted-core-cycles", IAP_ARCH_UNH_COR_CYC) /* * Aliases for Atom PMCs. From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 15:38:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 72D91A03; Tue, 30 Apr 2013 15:38:32 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 625C81A9C; Tue, 30 Apr 2013 15:38:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UFcWNt086773; Tue, 30 Apr 2013 15:38:32 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UFcW1D086772; Tue, 30 Apr 2013 15:38:32 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304301538.r3UFcW1D086772@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 30 Apr 2013 15:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250104 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 15:38:32 -0000 Author: des Date: Tue Apr 30 15:38:31 2013 New Revision: 250104 URL: http://svnweb.freebsd.org/changeset/base/250104 Log: Forgot to update UPDATING in head last night. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Apr 30 15:31:45 2013 (r250103) +++ head/UPDATING Tue Apr 30 15:38:31 2013 (r250104) @@ -31,6 +31,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130429: + Fix a bug that allows NFS clients to issue READDIR on files. + 20130426: The WITHOUT_IDEA option has been removed because the IDEA patent expired. From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 15:59:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2DA65478; Tue, 30 Apr 2013 15:59:23 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06BCE1BCB; Tue, 30 Apr 2013 15:59:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UFxM8F094040; Tue, 30 Apr 2013 15:59:22 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UFxM88094038; Tue, 30 Apr 2013 15:59:22 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201304301559.r3UFxM88094038@svn.freebsd.org> From: Davide Italiano Date: Tue, 30 Apr 2013 15:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250105 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 15:59:23 -0000 Author: davide Date: Tue Apr 30 15:59:22 2013 New Revision: 250105 URL: http://svnweb.freebsd.org/changeset/base/250105 Log: malloc(9) cannot return NULL if M_WAITOK flag is specified. Modified: head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/hwpmc/hwpmc_soft.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:38:31 2013 (r250104) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:59:22 2013 (r250105) @@ -2210,11 +2210,8 @@ pmc_allocate_pmc_descriptor(void) struct pmc *pmc; pmc = malloc(sizeof(struct pmc), M_PMC, M_WAITOK|M_ZERO); - - if (pmc != NULL) { - pmc->pm_owner = NULL; - LIST_INIT(&pmc->pm_targets); - } + pmc->pm_owner = NULL; + LIST_INIT(&pmc->pm_targets); PMCDBG(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc); @@ -4671,13 +4668,10 @@ pmc_mdep_alloc(int nclasses) n = 1 + nclasses; md = malloc(sizeof(struct pmc_mdep) + n * sizeof(struct pmc_classdep), M_PMC, M_WAITOK|M_ZERO); - if (md != NULL) { - md->pmd_nclass = n; - - /* Add base class. */ - pmc_soft_initialize(md); - } + md->pmd_nclass = n; + /* Add base class. */ + pmc_soft_initialize(md); return md; } @@ -4889,9 +4883,6 @@ pmc_initialize(void) pmc_pmcdisp = malloc(sizeof(enum pmc_mode) * md->pmd_npmc, M_PMC, M_WAITOK|M_ZERO); - KASSERT(pmc_pmcdisp != NULL, - ("[pmc,%d] pmcdisp allocation returned NULL", __LINE__)); - /* mark all PMCs as available */ for (n = 0; n < (int) md->pmd_npmc; n++) PMC_MARK_ROW_FREE(n); Modified: head/sys/dev/hwpmc/hwpmc_soft.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_soft.c Tue Apr 30 15:38:31 2013 (r250104) +++ head/sys/dev/hwpmc/hwpmc_soft.c Tue Apr 30 15:59:22 2013 (r250105) @@ -241,9 +241,6 @@ soft_pcpu_init(struct pmc_mdep *md, int __LINE__)); soft_pc = malloc(sizeof(struct soft_cpu), M_PMC, M_WAITOK|M_ZERO); - if (soft_pc == NULL) - return (ENOMEM); - pc = pmc_pcpu[cpu]; KASSERT(pc != NULL, ("[soft,%d] cpu %d null per-cpu", __LINE__, cpu)); From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 16:00:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3DCF9608; Tue, 30 Apr 2013 16:00:22 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 30EE61BDE; Tue, 30 Apr 2013 16:00:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UG0MTv094419; Tue, 30 Apr 2013 16:00:22 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UG0LOt094416; Tue, 30 Apr 2013 16:00:21 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301600.r3UG0LOt094416@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 16:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250106 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:00:22 -0000 Author: luigi Date: Tue Apr 30 16:00:21 2013 New Revision: 250106 URL: http://svnweb.freebsd.org/changeset/base/250106 Log: remove $Id$ (whitespace change) Modified: head/sys/net/netmap.h head/sys/net/netmap_user.h Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Tue Apr 30 15:59:22 2013 (r250105) +++ head/sys/net/netmap.h Tue Apr 30 16:00:21 2013 (r250106) @@ -32,7 +32,6 @@ /* * $FreeBSD$ - * $Id: netmap.h 11997 2013-01-17 21:59:12Z luigi $ * * Definitions of constants and the structures used by the netmap * framework, for the part visible to both kernel and userspace. Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Tue Apr 30 15:59:22 2013 (r250105) +++ head/sys/net/netmap_user.h Tue Apr 30 16:00:21 2013 (r250106) @@ -32,7 +32,6 @@ /* * $FreeBSD$ - * $Id: netmap_user.h 10597 2012-02-21 05:08:32Z luigi $ * * This header contains the macros used to manipulate netmap structures * and packets in userspace. See netmap(4) for more information. From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 16:08:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A03BCB69; Tue, 30 Apr 2013 16:08:35 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 840E21C41; Tue, 30 Apr 2013 16:08:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UG8Zi9097993; Tue, 30 Apr 2013 16:08:35 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UG8YhV097989; Tue, 30 Apr 2013 16:08:34 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301608.r3UG8YhV097989@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 16:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250107 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:08:35 -0000 Author: luigi Date: Tue Apr 30 16:08:34 2013 New Revision: 250107 URL: http://svnweb.freebsd.org/changeset/base/250107 Log: Partial cleanup in preparation for upcoming changes: - netmap_rx_irq()/netmap_tx_irq() can now be called by FreeBSD drivers hiding the logic for handling NIC interrupts in netmap mode. This also simplifies the case of NICs attached to VALE switches. Individual drivers will be updated with separate commits. - use the same refcount() API for FreeBSD and linux - plus some comments, typos and formatting fixes Portions contributed by Michio Honda Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Tue Apr 30 16:00:21 2013 (r250106) +++ head/sys/dev/netmap/netmap.c Tue Apr 30 16:08:34 2013 (r250107) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2011-2013 Matteo Landi, Luigi Rizzo. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -123,12 +123,10 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, no_pen int netmap_drop = 0; /* debugging */ int netmap_flags = 0; /* debug flags */ int netmap_fwd = 0; /* force transparent mode */ -int netmap_copy = 0; /* debugging, copy content */ SYSCTL_INT(_dev_netmap, OID_AUTO, drop, CTLFLAG_RW, &netmap_drop, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, copy, CTLFLAG_RW, &netmap_copy, 0 , ""); #ifdef NM_BRIDGE /* support for netmap bridge */ @@ -155,18 +153,27 @@ int netmap_bridge = NM_BDG_BATCH; /* bri SYSCTL_INT(_dev_netmap, OID_AUTO, bridge, CTLFLAG_RW, &netmap_bridge, 0 , ""); #ifdef linux -#define ADD_BDG_REF(ifp) (NA(ifp)->if_refcount++) -#define DROP_BDG_REF(ifp) (NA(ifp)->if_refcount-- <= 1) + +#define refcount_acquire(_a) atomic_add(1, (atomic_t *)_a) +#define refcount_release(_a) atomic_dec_and_test((atomic_t *)_a) + #else /* !linux */ -#define ADD_BDG_REF(ifp) (ifp)->if_refcount++ -#define DROP_BDG_REF(ifp) refcount_release(&(ifp)->if_refcount) + #ifdef __FreeBSD__ #include #include #endif /* __FreeBSD__ */ + #define prefetch(x) __builtin_prefetch(x) + #endif /* !linux */ +/* + * These are used to handle reference counters for bridge ports. + */ +#define ADD_BDG_REF(ifp) refcount_acquire(&NA(ifp)->na_bdg_refcount) +#define DROP_BDG_REF(ifp) refcount_release(&NA(ifp)->na_bdg_refcount) + static void bdg_netmap_attach(struct ifnet *ifp); static int bdg_netmap_reg(struct ifnet *ifp, int onoff); /* per-tx-queue entry */ @@ -183,9 +190,14 @@ struct nm_hash_ent { }; /* - * Interfaces for a bridge are all in ports[]. + * Interfaces for a bridge are all in bdg_ports[]. * The array has fixed size, an empty entry does not terminate - * the search. + * the search. But lookups only occur on attach/detach so we + * don't mind if they are slow. + * + * The bridge is non blocking on the transmit ports. + * + * bdg_lock protects accesses to the bdg_ports array. */ struct nm_bridge { struct ifnet *bdg_ports[NM_BDG_MAXPORTS]; @@ -1668,19 +1680,25 @@ netmap_attach(struct netmap_adapter *arg ND("using default locks for %s", ifp->if_xname); na->nm_lock = netmap_lock_wrapper; } + #ifdef linux - if (ifp->netdev_ops) { - ND("netdev_ops %p", ifp->netdev_ops); - /* prepare a clone of the netdev ops */ - na->nm_ndo = *ifp->netdev_ops; + if (!ifp->netdev_ops) { + D("ouch, we cannot override netdev_ops"); + goto fail; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) + /* if needed, prepare a clone of the entire netdev ops */ + na->nm_ndo = *ifp->netdev_ops; +#endif /* 2.6.28 and above */ na->nm_ndo.ndo_start_xmit = linux_netmap_start; -#endif +#endif /* linux */ + D("success for %s", ifp->if_xname); return 0; fail: D("fail, arg %p ifp %p na %p", arg, ifp, na); + netmap_detach(ifp); return (na ? EINVAL : ENOMEM); } @@ -1726,17 +1744,18 @@ netmap_start(struct ifnet *ifp, struct m if (netmap_verbose & NM_VERB_HOST) D("%s packet %d len %d from the stack", ifp->if_xname, kring->nr_hwcur + kring->nr_hwavail, len); + if (len > NETMAP_BUF_SIZE) { /* too long for us */ + D("%s from_host, drop packet size %d > %d", ifp->if_xname, + len, NETMAP_BUF_SIZE); + m_freem(m); + return EINVAL; + } na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); if (kring->nr_hwavail >= lim) { if (netmap_verbose) D("stack ring %s full\n", ifp->if_xname); goto done; /* no space */ } - if (len > NETMAP_BUF_SIZE) { - D("%s from_host, drop packet size %d > %d", ifp->if_xname, - len, NETMAP_BUF_SIZE); - goto done; /* too long for us */ - } /* compute the insert position */ i = kring->nr_hwcur + kring->nr_hwavail; @@ -1837,6 +1856,10 @@ netmap_reset(struct netmap_adapter *na, * N rings, separate locks: * lock(i); wake(i); unlock(i); lock(core) wake(N+1) unlock(core) * work_done is non-null on the RX path. + * + * The 'q' argument also includes flag to tell whether the queue is + * already locked on enter, and whether it should remain locked on exit. + * This helps adapting to different defaults in drivers and OSes. */ int netmap_rx_irq(struct ifnet *ifp, int q, int *work_done) @@ -1844,9 +1867,14 @@ netmap_rx_irq(struct ifnet *ifp, int q, struct netmap_adapter *na; struct netmap_kring *r; NM_SELINFO_T *main_wq; + int locktype, unlocktype, lock; if (!(ifp->if_capenable & IFCAP_NETMAP)) return 0; + + lock = q & (NETMAP_LOCKED_ENTER | NETMAP_LOCKED_EXIT); + q = q & NETMAP_RING_MASK; + ND(5, "received %s queue %d", work_done ? "RX" : "TX" , q); na = NA(ifp); if (na->na_flags & NAF_SKIP_INTR) { @@ -1856,32 +1884,42 @@ netmap_rx_irq(struct ifnet *ifp, int q, if (work_done) { /* RX path */ if (q >= na->num_rx_rings) - return 0; // regular queue + return 0; // not a physical queue r = na->rx_rings + q; r->nr_kflags |= NKR_PENDINTR; main_wq = (na->num_rx_rings > 1) ? &na->rx_si : NULL; - } else { /* tx path */ + locktype = NETMAP_RX_LOCK; + unlocktype = NETMAP_RX_UNLOCK; + } else { /* TX path */ if (q >= na->num_tx_rings) - return 0; // regular queue + return 0; // not a physical queue r = na->tx_rings + q; main_wq = (na->num_tx_rings > 1) ? &na->tx_si : NULL; work_done = &q; /* dummy */ + locktype = NETMAP_TX_LOCK; + unlocktype = NETMAP_TX_UNLOCK; } if (na->separate_locks) { - mtx_lock(&r->q_lock); + if (!(lock & NETMAP_LOCKED_ENTER)) + na->nm_lock(ifp, locktype, q); selwakeuppri(&r->si, PI_NET); - mtx_unlock(&r->q_lock); + na->nm_lock(ifp, unlocktype, q); if (main_wq) { - mtx_lock(&na->core_lock); + na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); selwakeuppri(main_wq, PI_NET); - mtx_unlock(&na->core_lock); + na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); } + /* lock the queue again if requested */ + if (lock & NETMAP_LOCKED_EXIT) + na->nm_lock(ifp, locktype, q); } else { - mtx_lock(&na->core_lock); + if (!(lock & NETMAP_LOCKED_ENTER)) + na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); selwakeuppri(&r->si, PI_NET); if (main_wq) selwakeuppri(main_wq, PI_NET); - mtx_unlock(&na->core_lock); + if (!(lock & NETMAP_LOCKED_EXIT)) + na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); } *work_done = 1; /* do not fire napi again */ return 1; @@ -1902,7 +1940,9 @@ netmap_rx_irq(struct ifnet *ifp, int q, static u_int linux_netmap_poll(struct file * file, struct poll_table_struct *pwait) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) + int events = POLLIN | POLLOUT; /* XXX maybe... */ +#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) int events = pwait ? pwait->key : POLLIN | POLLOUT; #else /* in 3.4.0 field 'key' was renamed to '_key' */ int events = pwait ? pwait->_key : POLLIN | POLLOUT; @@ -1942,7 +1982,7 @@ linux_netmap_mmap(struct file *f, struct * vtophys mapping in lut[k] so we use that, scanning * the lut[] array in steps of clustentries, * and we map each cluster (not individual pages, - * it would be overkill). + * it would be overkill -- XXX slow ? 20130415). */ /* Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Tue Apr 30 16:00:21 2013 (r250106) +++ head/sys/dev/netmap/netmap_kern.h Tue Apr 30 16:08:34 2013 (r250107) @@ -210,10 +210,20 @@ struct netmap_adapter { int (*nm_config)(struct ifnet *, u_int *txr, u_int *txd, u_int *rxr, u_int *rxd); + /* + * Bridge support: + * + * bdg_port is the port number used in the bridge; + * na_bdg_refcount is a refcount used for bridge ports, + * when it goes to 0 we can detach+free this port + * (a bridge port is always attached if it exists; + * it is not always registered) + */ int bdg_port; + int na_bdg_refcount; + #ifdef linux struct net_device_ops nm_ndo; - int if_refcount; // XXX additions for bridge #endif /* linux */ }; @@ -248,6 +258,10 @@ enum { #endif }; +/* How to handle locking support in netmap_rx_irq/netmap_tx_irq */ +#define NETMAP_LOCKED_ENTER 0x10000000 /* already locked on enter */ +#define NETMAP_LOCKED_EXIT 0x20000000 /* keep locked on exit */ + /* * The following are support routines used by individual drivers to * support netmap operation. @@ -275,7 +289,7 @@ struct netmap_slot *netmap_reset(struct int netmap_ring_reinit(struct netmap_kring *); extern u_int netmap_buf_size; -#define NETMAP_BUF_SIZE netmap_buf_size +#define NETMAP_BUF_SIZE netmap_buf_size // XXX remove extern int netmap_mitigate; extern int netmap_no_pendintr; extern u_int netmap_total_buffers; @@ -437,7 +451,7 @@ netmap_idx_k2n(struct netmap_kring *kr, /* Entries of the look-up table. */ struct lut_entry { void *vaddr; /* virtual address. */ - vm_paddr_t paddr; /* phisical address. */ + vm_paddr_t paddr; /* physical address. */ }; struct netmap_obj_pool; @@ -470,6 +484,4 @@ PNMB(struct netmap_slot *slot, uint64_t int netmap_rx_irq(struct ifnet *, int, int *); #define netmap_tx_irq(_n, _q) netmap_rx_irq(_n, _q, NULL) - -extern int netmap_copy; #endif /* _NET_NETMAP_KERN_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 16:10:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A00EFCFE; Tue, 30 Apr 2013 16:10:19 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id C8D021C54; Tue, 30 Apr 2013 16:10:18 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id o7so565286wea.32 for ; Tue, 30 Apr 2013 09:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=nowYmetMoTsV+e6sfNaDoaKe30OMj36abn0VrMNb9sY=; b=mtPAP7jBDAP3chqjgl88qeczClgPxCl/TfjAzNaMZwjTycdsCaanuYkkfYdwB3PTYa BuO4seL20XJrgS7SRjU3/yUsxwys6qVY3OKOx/HucWOPCDqBWHKyfKM+YZrs1G8pi0b2 xC4COLqa6JewQ9wyPt9TDX36JtD/Mv8bsJHBUwcYCWsdwIj9dsil1Y1PyhBnvgWhKNjI cncZ000cWkJMPlfUoDioC/1i/ml7CFxI85m0KB0pu6bH4ExluTuF318pMQTzgpJD6nuF 1PvMhcQk745Zm8SkMNmhvdSRSqDA64ilB3j3sCCgY0+Yg6QFy5kwyJwFNRzdZ0uDy87E oLUQ== MIME-Version: 1.0 X-Received: by 10.180.183.50 with SMTP id ej18mr25639597wic.4.1367338217875; Tue, 30 Apr 2013 09:10:17 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.194.29.199 with HTTP; Tue, 30 Apr 2013 09:10:17 -0700 (PDT) In-Reply-To: <201304301559.r3UFxM88094038@svn.freebsd.org> References: <201304301559.r3UFxM88094038@svn.freebsd.org> Date: Tue, 30 Apr 2013 20:10:17 +0400 X-Google-Sender-Auth: ME8zOrcBWu6-cf8vyU2t1AVD1gk Message-ID: Subject: Re: svn commit: r250105 - head/sys/dev/hwpmc From: Sergey Kandaurov To: Davide Italiano Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:10:19 -0000 Hi. On 30 April 2013 19:59, Davide Italiano wrote: > Author: davide > Date: Tue Apr 30 15:59:22 2013 > New Revision: 250105 > URL: http://svnweb.freebsd.org/changeset/base/250105 > > Log: > malloc(9) cannot return NULL if M_WAITOK flag is specified. > > Modified: > head/sys/dev/hwpmc/hwpmc_mod.c > head/sys/dev/hwpmc/hwpmc_soft.c > > Modified: head/sys/dev/hwpmc/hwpmc_mod.c > ============================================================================== > --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:38:31 2013 (r250104) > +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:59:22 2013 (r250105) > @@ -2210,11 +2210,8 @@ pmc_allocate_pmc_descriptor(void) > struct pmc *pmc; > > pmc = malloc(sizeof(struct pmc), M_PMC, M_WAITOK|M_ZERO); > - > - if (pmc != NULL) { > - pmc->pm_owner = NULL; > - LIST_INIT(&pmc->pm_targets); > - } > + pmc->pm_owner = NULL; > + LIST_INIT(&pmc->pm_targets); > > PMCDBG(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc); > It looks like zeroing pm_owner can also be omitted with M_ZERO. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 16:18:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02817F7D; Tue, 30 Apr 2013 16:18:30 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D774F1CFB; Tue, 30 Apr 2013 16:18:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UGIU48001764; Tue, 30 Apr 2013 16:18:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UGIUdK001760; Tue, 30 Apr 2013 16:18:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301618.r3UGIUdK001760@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 16:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250108 - in head/sys/dev: e1000 ixgbe re X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:18:31 -0000 Author: luigi Date: Tue Apr 30 16:18:29 2013 New Revision: 250108 URL: http://svnweb.freebsd.org/changeset/base/250108 Log: use netmap_rx_irq() / netmap_tx_irq() to handle interrupts in netmap mode, removing the logic from individual drivers. (note: if_lem.c not updated yet due to some other pending modifications) Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/re/if_re.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Apr 30 16:08:34 2013 (r250107) +++ head/sys/dev/e1000/if_em.c Tue Apr 30 16:18:29 2013 (r250108) @@ -3828,17 +3828,9 @@ em_txeof(struct tx_ring *txr) EM_TX_LOCK_ASSERT(txr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); - EM_TX_UNLOCK(txr); - EM_CORE_LOCK(adapter); - selwakeuppri(&na->tx_si, PI_NET); - EM_CORE_UNLOCK(adapter); - EM_TX_LOCK(txr); + if (netmap_tx_irq(ifp, txr->me | + (NETMAP_LOCKED_ENTER | NETMAP_LOCKED_EXIT))) return; - } #endif /* DEV_NETMAP */ /* No work, make sure watchdog is off */ @@ -4440,17 +4432,8 @@ em_rxeof(struct rx_ring *rxr, int count, EM_RX_LOCK(rxr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); - EM_RX_UNLOCK(rxr); - EM_CORE_LOCK(adapter); - selwakeuppri(&na->rx_si, PI_NET); - EM_CORE_UNLOCK(adapter); - return (0); - } + if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) + return (FALSE); #endif /* DEV_NETMAP */ for (i = rxr->next_to_check, processed = 0; count != 0;) { Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Apr 30 16:08:34 2013 (r250107) +++ head/sys/dev/e1000/if_igb.c Tue Apr 30 16:18:29 2013 (r250108) @@ -3897,17 +3897,9 @@ igb_txeof(struct tx_ring *txr) IGB_TX_LOCK_ASSERT(txr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); - IGB_TX_UNLOCK(txr); - IGB_CORE_LOCK(adapter); - selwakeuppri(&na->tx_si, PI_NET); - IGB_CORE_UNLOCK(adapter); - IGB_TX_LOCK(txr); - return FALSE; - } + if (netmap_tx_irq(ifp, txr->me | + (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT))) + return (FALSE); #endif /* DEV_NETMAP */ if (txr->tx_avail == adapter->num_tx_desc) { txr->queue_status = IGB_QUEUE_IDLE; @@ -4761,17 +4753,8 @@ igb_rxeof(struct igb_queue *que, int cou BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); - IGB_RX_UNLOCK(rxr); - IGB_CORE_LOCK(adapter); - selwakeuppri(&na->rx_si, PI_NET); - IGB_CORE_UNLOCK(adapter); - return (0); - } + if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) + return (FALSE); #endif /* DEV_NETMAP */ /* Main clean loop */ Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Tue Apr 30 16:08:34 2013 (r250107) +++ head/sys/dev/ixgbe/ixgbe.c Tue Apr 30 16:18:29 2013 (r250108) @@ -3597,13 +3597,8 @@ ixgbe_txeof(struct tx_ring *txr) if (!netmap_mitigate || (kring->nr_kflags < kring->nkr_num_slots && txd[kring->nr_kflags].wb.status & IXGBE_TXD_STAT_DD)) { - kring->nr_kflags = kring->nkr_num_slots; - selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); - IXGBE_TX_UNLOCK(txr); - IXGBE_CORE_LOCK(adapter); - selwakeuppri(&na->tx_si, PI_NET); - IXGBE_CORE_UNLOCK(adapter); - IXGBE_TX_LOCK(txr); + netmap_tx_irq(ifp, txr->me | + (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT)); } return FALSE; } @@ -4388,23 +4383,9 @@ ixgbe_rxeof(struct ix_queue *que) IXGBE_RX_LOCK(rxr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - /* - * Same as the txeof routine: only wakeup clients on intr. - * NKR_PENDINTR in nr_kflags is used to implement interrupt - * mitigation (ixgbe_rxsync() will not look for new packets - * unless NKR_PENDINTR is set). - */ - struct netmap_adapter *na = NA(ifp); - - na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); - IXGBE_RX_UNLOCK(rxr); - IXGBE_CORE_LOCK(adapter); - selwakeuppri(&na->rx_si, PI_NET); - IXGBE_CORE_UNLOCK(adapter); + /* Same as the txeof routine: wakeup clients on intr. */ + if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) return (FALSE); - } #endif /* DEV_NETMAP */ for (i = rxr->next_to_check; count != 0;) { struct mbuf *sendmp, *mp; Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Apr 30 16:08:34 2013 (r250107) +++ head/sys/dev/re/if_re.c Tue Apr 30 16:18:29 2013 (r250108) @@ -2112,11 +2112,9 @@ re_rxeof(struct rl_softc *sc, int *rx_np ifp = sc->rl_ifp; #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - NA(ifp)->rx_rings[0].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&NA(ifp)->rx_rings[0].si, PI_NET); + if (netmap_rx_irq(ifp, 0 | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT), + &rx_npkts)) return 0; - } #endif /* DEV_NETMAP */ if (ifp->if_mtu > RL_MTU && (sc->rl_flags & RL_FLAG_JUMBOV2) != 0) jumbo = 1; @@ -2360,10 +2358,8 @@ re_txeof(struct rl_softc *sc) ifp = sc->rl_ifp; #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - selwakeuppri(&NA(ifp)->tx_rings[0].si, PI_NET); + if (netmap_tx_irq(ifp, 0 | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT))) return; - } #endif /* DEV_NETMAP */ /* Invalidate the TX descriptor list */ bus_dmamap_sync(sc->rl_ldata.rl_tx_list_tag, From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 16:51:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 00F21A43; Tue, 30 Apr 2013 16:51:58 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E64781E51; Tue, 30 Apr 2013 16:51:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UGpwK9014523; Tue, 30 Apr 2013 16:51:58 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UGpwJ2014522; Tue, 30 Apr 2013 16:51:58 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301651.r3UGpwJ2014522@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 16:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250109 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:51:59 -0000 Author: luigi Date: Tue Apr 30 16:51:58 2013 New Revision: 250109 URL: http://svnweb.freebsd.org/changeset/base/250109 Log: use netmap_rx_irq() and netmap_tx_irq() instead of replicating the logic in the individual driver. Modified: head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Tue Apr 30 16:18:29 2013 (r250108) +++ head/sys/dev/e1000/if_lem.c Tue Apr 30 16:51:58 2013 (r250109) @@ -2980,10 +2980,8 @@ lem_txeof(struct adapter *adapter) EM_TX_LOCK_ASSERT(adapter); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - selwakeuppri(&NA(ifp)->tx_rings[0].si, PI_NET); + if (netmap_tx_irq(ifp, 0 | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT))) return; - } #endif /* DEV_NETMAP */ if (adapter->num_tx_desc_avail == adapter->num_tx_desc) return; @@ -3459,13 +3457,8 @@ lem_rxeof(struct adapter *adapter, int c BUS_DMASYNC_POSTREAD); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - na->rx_rings[0].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[0].si, PI_NET); - EM_RX_UNLOCK(adapter); - return (0); - } + if (netmap_rx_irq(ifp, 0 | NETMAP_LOCKED_ENTER, &rx_sent)) + return (FALSE); #endif /* DEV_NETMAP */ if (!((current_desc->status) & E1000_RXD_STAT_DD)) { From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 16:59:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B3C8C9F; Tue, 30 Apr 2013 16:59:26 +0000 (UTC) (envelope-from carl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE711E9F; Tue, 30 Apr 2013 16:59:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UGxQr1015908; Tue, 30 Apr 2013 16:59:26 GMT (envelope-from carl@svn.freebsd.org) Received: (from carl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UGxQ1b015907; Tue, 30 Apr 2013 16:59:26 GMT (envelope-from carl@svn.freebsd.org) Message-Id: <201304301659.r3UGxQ1b015907@svn.freebsd.org> From: Carl Delsey Date: Tue, 30 Apr 2013 16:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250110 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:59:26 -0000 Author: carl Date: Tue Apr 30 16:59:25 2013 New Revision: 250110 URL: http://svnweb.freebsd.org/changeset/base/250110 Log: Fix the man page installation broken in r250079. Pointy hat to me. Thanks to Florian Smeets for pointing this out and providing a patch. Submitted by: Florian Smeets Approved by: jimharris (mentor) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Apr 30 16:51:58 2013 (r250109) +++ head/share/man/man4/Makefile Tue Apr 30 16:59:25 2013 (r250110) @@ -648,7 +648,8 @@ MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=${_nfe.4} ${_if_nfe.4} MLINKS+=nge.4 if_nge.4 -MLINKS+=${_ntb.4} ${_if_ntb.4} ${_ntb_hw.4} +MLINKS+=${_ntb.4} ${_if_ntb.4} \ + ${_ntb.4} ${_ntb_hw.4} MLINKS+=${_nve.4} ${_if_nve.4} MLINKS+=${_nxge.4} ${_if_nxge.4} MLINKS+=patm.4 if_patm.4 From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 17:02:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67648E5E; Tue, 30 Apr 2013 17:02:45 +0000 (UTC) (envelope-from carl@freebsd.org) Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by mx1.freebsd.org (Postfix) with ESMTP id 69ADB1EC5; Tue, 30 Apr 2013 17:02:44 +0000 (UTC) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 30 Apr 2013 10:02:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,582,1363158000"; d="asc'?scan'208";a="295529971" Received: from crdelsey-fbsd.ch.intel.com (HELO [10.2.105.127]) ([10.2.105.127]) by azsmga001.ch.intel.com with ESMTP; 30 Apr 2013 10:02:34 -0700 Message-ID: <517FF910.2060600@FreeBSD.org> Date: Tue, 30 Apr 2013 10:02:08 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130115 Thunderbird/17.0.2 MIME-Version: 1.0 To: Florian Smeets Subject: Re: svn commit: r250079 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ntb sys/dev/ntb/if_ntb sys/dev/ntb/ntb_hw sys/modules sys/modules/ntb sys/modules/ntb/if_ntb sys/modules/ntb/ntb_hw References: <201304292248.r3TMmrqT027087@svn.freebsd.org> <20130430095703.GC14196@zoidberg.smeets.im> In-Reply-To: <20130430095703.GC14196@zoidberg.smeets.im> X-Enigmail-Version: 1.4.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA694BFE399D54C07260A4341" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 17:02:45 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA694BFE399D54C07260A4341 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks Florian. Fixed in r250110. On 04/30/13 02:57, Florian Smeets wrote: > On Mon, Apr 29, 2013 at 10:48:53PM +0000, Carl Delsey wrote: >> Author: carl >> Date: Mon Apr 29 22:48:53 2013 >> New Revision: 250079 >> URL: http://svnweb.freebsd.org/changeset/base/250079 >> >> Log: >> Add a new driver to support the Intel Non-Transparent Bridge(NTB). >> =20 > Hi Carl, > > This change breaks installworld. > > /usr/share/man/man4/nve.4.gz -> /usr/share/man/man4/ntb_hw.4.gz > install: link /usr/share/man/man4/ntb_hw.4.gz -> /usr/share/man/man4/nv= e.4.gz: No such file or directory > *** [_maninstall] Error code 71 > > I think the following patch does what you intended? > > Index: share/man/man4/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- share/man/man4/Makefile (revision 250097) > +++ share/man/man4/Makefile (working copy) > @@ -648,7 +648,8 @@ > netintro.4 networking.4 > MLINKS+=3D${_nfe.4} ${_if_nfe.4} > MLINKS+=3Dnge.4 if_nge.4 > -MLINKS+=3D${_ntb.4} ${_if_ntb.4} ${_ntb_hw.4} > +MLINKS+=3D${_ntb.4} ${_if_ntb.4} \ > + ${_ntb.4} ${_ntb_hw.4} > MLINKS+=3D${_nve.4} ${_if_nve.4} > MLINKS+=3D${_nxge.4} ${_if_nxge.4} > MLINKS+=3Dpatm.4 if_patm.4 > > With this installworld finished as expected. > > Florian --------------enigA694BFE399D54C07260A4341 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQIcBAEBAgAGBQJRf/kpAAoJEGAx6WP7O104wjMQAK6PfPy+OpS0sGeCUF85+UAK /bB2K+gk/G+RgZzTyzMdtK9TQDH1ThIkNvGnPK7fdK8vyfoSnsy8WdH3s3ObDbWB 9hnmnla6xySPgpmaK+9A6RY2EcIwn1TsqwsskpQIf3FS7TK1awMtPGegSK+/euqY /o4VkAbDVWOBFHJyPqqgTsPe4co6RFrznTpulbYbjhDjFGkN4SkBC/YxcmALuldE b9118+1Q58pu8yJCWD3X7e0O3BeM44v215EuqYp2ieeNiT/Qbiu5Rw9+3F7+gmRD cAprfWHF/oaIAPCz9YEmp0Kgos4BdOxY6r7vbEutpwphhXeRVCBFGsIYSLIJMr/Q Ta4J0/oi4Dy8j3JSuzR5u53HnrVklmoYy4AzPx9E3UZ/a0iKBil+IjybwhUJI4ai 0HCX/buc69/VALj9N43EPa9H/oaEilwDVyya/JPfWP+vwNXeceZWKfDfZtW+1gAt ASwMpFrs4mjI24L0fcqTkWcNp/j343skF5fCKsbiejqehkrDPpvZg5hbL9Yw6GDc vFMPAyIzGstO2YJAQcVcAGyv++n/FgH7YdloYnXdeA/icayhaaqNFu7nr5d4iTTG 5vbmRltW1cRCPx54QKBpCH0aTVV3f0G4s3ygMy3chytd7krZyHU3W9Hz3FRqPR1h 5G5+LPgBn8INZdG9imz5 =5Wi2 -----END PGP SIGNATURE----- --------------enigA694BFE399D54C07260A4341-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 18:06:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2E56EF9; Tue, 30 Apr 2013 18:06:44 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03E161173; Tue, 30 Apr 2013 18:06:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UI6hPL040799; Tue, 30 Apr 2013 18:06:43 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UI6hNY040798; Tue, 30 Apr 2013 18:06:43 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201304301806.r3UI6hNY040798@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 30 Apr 2013 18:06:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250111 - stable/9/sys/rpc/rpcsec_gss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 18:06:44 -0000 Author: gnn Date: Tue Apr 30 18:06:43 2013 New Revision: 250111 URL: http://svnweb.freebsd.org/changeset/base/250111 Log: Improve error handling when unwrapping received data. Submitted by: Rick Macklem Modified: stable/9/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c ============================================================================== --- stable/9/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c Tue Apr 30 16:59:25 2013 (r250110) +++ stable/9/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c Tue Apr 30 18:06:43 2013 (r250111) @@ -208,6 +208,8 @@ m_trim(struct mbuf *m, int len) struct mbuf *n; int off; + if (m == NULL) + return; n = m_getptr(m, len, &off); if (n) { n->m_len = off; @@ -251,10 +253,19 @@ xdr_rpc_gss_unwrap_data(struct mbuf **re * Extract the MIC and make it contiguous. */ cklen = get_uint32(&results); + if (!results) { + m_freem(message); + return (FALSE); + } KASSERT(cklen <= MHLEN, ("unexpected large GSS-API checksum")); mic = results; - if (cklen > mic->m_len) + if (cklen > mic->m_len) { mic = m_pullup(mic, cklen); + if (!mic) { + m_freem(message); + return (FALSE); + } + } if (cklen != RNDUP(cklen)) m_trim(mic, cklen); @@ -272,6 +283,8 @@ xdr_rpc_gss_unwrap_data(struct mbuf **re } else if (svc == rpc_gss_svc_privacy) { /* Decode databody_priv. */ len = get_uint32(&results); + if (!results) + return (FALSE); /* Decrypt databody. */ message = results; @@ -294,6 +307,8 @@ xdr_rpc_gss_unwrap_data(struct mbuf **re /* Decode rpc_gss_data_t (sequence number + arguments). */ seq_num = get_uint32(&message); + if (!message) + return (FALSE); /* Verify sequence number. */ if (seq_num != seq) { From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 18:14:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8AFA84BC; Tue, 30 Apr 2013 18:14:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7E01411E0; Tue, 30 Apr 2013 18:14:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UIEN5O044106; Tue, 30 Apr 2013 18:14:23 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UIENr0044105; Tue, 30 Apr 2013 18:14:23 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304301814.r3UIENr0044105@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 18:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250112 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 18:14:23 -0000 Author: brooks Date: Tue Apr 30 18:14:22 2013 New Revision: 250112 URL: http://svnweb.freebsd.org/changeset/base/250112 Log: Wrap the creation of the ../include link in /usr/lib in !defined(LIBRARIES_ONLY) so it is only created once on architectures with 32-bit compat support. Replace ln -fhs with ${INSTALL_SYMLINK} to the link is logged in the METALOG. Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Apr 30 18:06:43 2013 (r250111) +++ head/lib/Makefile Tue Apr 30 18:14:22 2013 (r250112) @@ -252,7 +252,9 @@ _libusbhid= libusbhid _libusb= libusb .endif +.if !defined(LIBRARIES_ONLY) afterinstall: - ln -hfs ../include ${DESTDIR}/usr/lib/include + ${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include +.endif .include From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 18:29:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 92120AA2; Tue, 30 Apr 2013 18:29:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8397B1285; Tue, 30 Apr 2013 18:29:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UIT5jm048264; Tue, 30 Apr 2013 18:29:05 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UIT5dr048263; Tue, 30 Apr 2013 18:29:05 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304301829.r3UIT5dr048263@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 18:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250113 - head/sys/dev/altera/jtag_uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 18:29:05 -0000 Author: brooks Date: Tue Apr 30 18:29:05 2013 New Revision: 250113 URL: http://svnweb.freebsd.org/changeset/base/250113 Log: Partial MFC of change 228122: Due to the requirement that tty prefixes be unique per driver, rename the Altera JTAG UART devices to ttyj#. Sponsored by: DARPA, AFRL Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart.h Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart.h ============================================================================== --- head/sys/dev/altera/jtag_uart/altera_jtag_uart.h Tue Apr 30 18:14:22 2013 (r250112) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart.h Tue Apr 30 18:29:05 2013 (r250113) @@ -75,7 +75,7 @@ struct altera_jtag_uart_softc { u_int *ajus_jtag_missedp; }; -#define AJU_TTYNAME "ttyu" +#define AJU_TTYNAME "ttyj" /* * Flag values for ajus_flags. From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 18:33:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 56926D2C; Tue, 30 Apr 2013 18:33:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2F53E12AB; Tue, 30 Apr 2013 18:33:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UIXUjv050723; Tue, 30 Apr 2013 18:33:30 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UIXTJp050720; Tue, 30 Apr 2013 18:33:29 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304301833.r3UIXTJp050720@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 18:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250114 - in head/sys: conf dev/cfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 18:33:30 -0000 Author: brooks Date: Tue Apr 30 18:33:29 2013 New Revision: 250114 URL: http://svnweb.freebsd.org/changeset/base/250114 Log: MFP4 changes 222065 and 222068: Add a simplebus attachment for cfi(4)'s FDT support and move cfi_bus_fdt.c to sys/conf/files so non-ppc architectures are supported. Sponsored by: DARPA, AFRL Modified: head/sys/conf/files head/sys/conf/files.powerpc head/sys/dev/cfi/cfi_bus_fdt.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Apr 30 18:29:05 2013 (r250113) +++ head/sys/conf/files Tue Apr 30 18:33:29 2013 (r250114) @@ -1046,6 +1046,7 @@ dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus dev/cas/if_cas.c optional cas +dev/cfi/cfi_bus_fdt.c optional cfi fdt dev/cfi/cfi_bus_nexus.c optional cfi dev/cfi/cfi_core.c optional cfi dev/cfi/cfi_dev.c optional cfi Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Apr 30 18:29:05 2013 (r250113) +++ head/sys/conf/files.powerpc Tue Apr 30 18:33:29 2013 (r250114) @@ -27,7 +27,6 @@ dev/adb/adb_hb_if.m optional adb dev/adb/adb_if.m optional adb dev/adb/adb_buttons.c optional adb dev/agp/agp_apple.c optional agp powermac -dev/cfi/cfi_bus_fdt.c optional cfi fdt dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt dev/hwpmc/hwpmc_powerpc.c optional hwpmc Modified: head/sys/dev/cfi/cfi_bus_fdt.c ============================================================================== --- head/sys/dev/cfi/cfi_bus_fdt.c Tue Apr 30 18:29:05 2013 (r250113) +++ head/sys/dev/cfi/cfi_bus_fdt.c Tue Apr 30 18:33:29 2013 (r250114) @@ -61,6 +61,7 @@ static driver_t cfi_fdt_driver = { }; DRIVER_MODULE (cfi, lbc, cfi_fdt_driver, cfi_devclass, 0, 0); +DRIVER_MODULE (cfi, simplebus, cfi_fdt_driver, cfi_devclass, 0, 0); static int cfi_fdt_probe(device_t dev) From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 18:48:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD669FE7; Tue, 30 Apr 2013 18:48:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B06881317; Tue, 30 Apr 2013 18:48:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UImBi2054881; Tue, 30 Apr 2013 18:48:11 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UImBpW054880; Tue, 30 Apr 2013 18:48:11 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304301848.r3UImBpW054880@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 18:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250115 - head/sys/dev/cfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 18:48:11 -0000 Author: brooks Date: Tue Apr 30 18:48:11 2013 New Revision: 250115 URL: http://svnweb.freebsd.org/changeset/base/250115 Log: MFP4 change 222060: On Intel devices, put the Factory PPR in kenv. On some FPGA boards it may be the only software accessable unique ID. Sponsored by: DARPA, AFRL Modified: head/sys/dev/cfi/cfi_core.c Modified: head/sys/dev/cfi/cfi_core.c ============================================================================== --- head/sys/dev/cfi/cfi_core.c Tue Apr 30 18:33:29 2013 (r250114) +++ head/sys/dev/cfi/cfi_core.c Tue Apr 30 18:48:11 2013 (r250115) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -261,6 +262,10 @@ cfi_attach(device_t dev) struct cfi_softc *sc; u_int blksz, blocks; u_int r, u; +#ifdef CFI_SUPPORT_STRATAFLASH + uint64_t ppr; + char name[KENV_MNAMELEN], value[32]; +#endif sc = device_get_softc(dev); sc->sc_dev = dev; @@ -312,6 +317,20 @@ cfi_attach(device_t dev) "%s%u", cfi_driver_name, u); sc->sc_nod->si_drv1 = sc; +#ifdef CFI_SUPPORT_STRATAFLASH + /* + * Store the Intel factory PPR in the environment. In some + * cases it is the most unique ID on a board. + */ + if (cfi_intel_get_factory_pr(sc, &ppr) == 0) { + if (snprintf(name, sizeof(name), "%s.factory_ppr", + device_get_nameunit(dev)) < (sizeof(name) - 1) && + snprintf(value, sizeof(value), "0x%016jx", ppr) < + (sizeof(value) - 1)) + (void) setenv(name, value); + } +#endif + device_add_child(dev, "cfid", -1); bus_generic_attach(dev); From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 19:26:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A4A4B6E0; Tue, 30 Apr 2013 19:26:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95F9814BF; Tue, 30 Apr 2013 19:26:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UJQj9h068692; Tue, 30 Apr 2013 19:26:45 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UJQjqx068691; Tue, 30 Apr 2013 19:26:45 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304301926.r3UJQjqx068691@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 19:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250116 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 19:26:45 -0000 Author: brooks Date: Tue Apr 30 19:26:44 2013 New Revision: 250116 URL: http://svnweb.freebsd.org/changeset/base/250116 Log: Make an attempt to detect missing MTREE files in distrib-dirs. Not perfect, but this is just a developer seatbelt. PR: conf/176897 Submitted by: Garrett Cooper MFC after: 1 week Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Tue Apr 30 18:48:11 2013 (r250115) +++ head/etc/Makefile Tue Apr 30 19:26:44 2013 (r250116) @@ -328,7 +328,7 @@ MTREES+= mtree/BSD.sendmail.dist / MTREES+= ../${mtree} / .endfor -distrib-dirs: +distrib-dirs: ${MTREES:N/*} @set ${MTREES}; \ while test $$# -ge 2; do \ m=${.CURDIR}/$$1; \ From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 19:57:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 803F0BF9; Tue, 30 Apr 2013 19:57:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 720B015AE; Tue, 30 Apr 2013 19:57:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UJvMF9078948; Tue, 30 Apr 2013 19:57:22 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UJvMsG078947; Tue, 30 Apr 2013 19:57:22 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304301957.r3UJvMsG078947@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Apr 2013 19:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250117 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 19:57:22 -0000 Author: np Date: Tue Apr 30 19:57:21 2013 New Revision: 250117 URL: http://svnweb.freebsd.org/changeset/base/250117 Log: Fix DDP breakage introduced in r248925. Bitwise OR has higher precedence than ternary conditional. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_ddp.c Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Apr 30 19:26:44 2013 (r250116) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Apr 30 19:57:21 2013 (r250117) @@ -747,7 +747,13 @@ write_page_pods(struct adapter *sc, stru struct ulptx_idata *ulpsc; struct pagepod *ppod; int i, j, k, n, chunk, len, ddp_pgsz, idx, ppod_addr; + uint32_t cmd; + cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE)); + if (is_t4(sc)) + cmd |= htobe32(F_ULP_MEMIO_ORDER); + else + cmd |= htobe32(F_T5_ULP_MEMIO_IMM); ddp_pgsz = t4_ddp_pgsz[G_PPOD_PGSZ(db->tag)]; ppod_addr = sc->vres.ddp.start + G_PPOD_TAG(db->tag) * PPOD_SIZE; for (i = 0; i < db->nppods; ppod_addr += chunk) { @@ -763,8 +769,7 @@ write_page_pods(struct adapter *sc, stru ulpmc = wrtod(wr); INIT_ULPTX_WR(ulpmc, len, 0, 0); - ulpmc->cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | - is_t4(sc) ? F_ULP_MEMIO_ORDER : F_T5_ULP_MEMIO_IMM); + ulpmc->cmd = cmd; ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk / 32)); ulpmc->len16 = htobe32(howmany(len - sizeof(ulpmc->wr), 16)); ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(ppod_addr >> 5)); From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 20:15:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2C06A16F; Tue, 30 Apr 2013 20:15:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0CA6C1625; Tue, 30 Apr 2013 20:15:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UKFrNP086554; Tue, 30 Apr 2013 20:15:53 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UKFrqa086551; Tue, 30 Apr 2013 20:15:53 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304302015.r3UKFrqa086551@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 20:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250118 - in stable/9: . usr.sbin/mergemaster X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 20:15:54 -0000 Author: brooks Date: Tue Apr 30 20:15:53 2013 New Revision: 250118 URL: http://svnweb.freebsd.org/changeset/base/250118 Log: MFC r249906: Use the system MAKEOBJDIRPREFIX when running make targets in mergemaster. This allows bootstrap verions of tools to be used. Add a note to UPDATING about this change. This commit is a partial backout of r248531 in that it removes an accidentally committed change to mergemaster. Discussed with: jhb Sponsored by: DARPA, AFRL Modified: stable/9/UPDATING (contents, props changed) stable/9/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/9/usr.sbin/mergemaster/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Tue Apr 30 19:57:21 2013 (r250117) +++ stable/9/UPDATING Tue Apr 30 20:15:53 2013 (r250118) @@ -11,6 +11,16 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130430: + The mergemaster command now uses the default MAKEOBJDIRPREFIX + rather than creating it's own in the temporary directory in + order allow access to bootstrapped versions of tools such as + install and mtree. When upgrading from version of FreeBSD where + the install command does not support -l, you will need to + install a new mergemaster command if mergemaster -p is required. + This can be accomplished with the command (cd src/usr.sbin/mergemaster + && make install). + 20130429: Fix a bug that allows NFS clients to issue READDIR on files. @@ -1535,7 +1545,7 @@ COMMON ITEMS: step. It never hurts to do it all the time. You may need to install a new mergemaster (cd src/usr.sbin/mergemaster && make install) after the buildworld before this step if you last updated - from current before 20020224 or from -stable before 20020408. + from [78]-stable or 9-stable before 20130430. [6] This only deletes old files and directories. Old libraries can be deleted by "make delete-old-libs", but you have to make Modified: stable/9/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/9/usr.sbin/mergemaster/mergemaster.sh Tue Apr 30 19:57:21 2013 (r250117) +++ stable/9/usr.sbin/mergemaster/mergemaster.sh Tue Apr 30 20:15:53 2013 (r250118) @@ -629,16 +629,10 @@ case "${RERUN}" in ${MM_MAKE} DESTDIR=${DESTDIR} distrib-dirs >/dev/null ;; esac - if [ -d `${MM_MAKE} -V .OBJDIR` ]; then - od=`${MM_MAKE} -V MAKEOBJDIRPREFIX` - else - od=${TEMPROOT}/usr/obj - fi - echo $od 1>&2 ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs >/dev/null && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc >/dev/null && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} everything SUBDIR_OVERRIDE=etc >/dev/null && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} DESTDIR=${TEMPROOT} distribution >/dev/null;} || + ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc >/dev/null && + ${MM_MAKE} everything SUBDIR_OVERRIDE=etc >/dev/null && + ${MM_MAKE} DESTDIR=${TEMPROOT} distribution >/dev/null;} || { echo ''; echo " *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to"; echo " the temproot environment"; From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 20:53:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 470D7A2D; Tue, 30 Apr 2013 20:53:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39B6717CE; Tue, 30 Apr 2013 20:53:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UKrTxo099973; Tue, 30 Apr 2013 20:53:29 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UKrTl9099972; Tue, 30 Apr 2013 20:53:29 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304302053.r3UKrTl9099972@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 20:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250119 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 20:53:29 -0000 Author: brooks Date: Tue Apr 30 20:53:28 2013 New Revision: 250119 URL: http://svnweb.freebsd.org/changeset/base/250119 Log: Add some advice to get past the hurdle of install -l for the common, but non-default (and unsupportable) case of setting INSTALL="install -C" in /etc/make.conf or /etc/src.conf. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Apr 30 20:15:53 2013 (r250118) +++ head/UPDATING Tue Apr 30 20:53:28 2013 (r250119) @@ -104,6 +104,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 while having the GNU version installed as gnupatch, rebuild and install world with the WITH_BSD_PATCH knob set. +20130121: + Due to the use of the new -l option to install(1) during build + and install, you must take care not to directly set the INSTALL + make variable in your /etc/make.conf, /etc/src.conf, or on the + command line. If you with to use the -C flag for all installs + you may be able to add INSTALL+=-C to /etc/make.conf or + /etc/src.conf. + 20130118: The install(1) option -M has changed meaning and now takes an argument that is a file or path to append logs to. In the From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 22:13:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AD5D5DCF; Tue, 30 Apr 2013 22:13:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DA791C1A; Tue, 30 Apr 2013 22:13:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UMDvtM028936; Tue, 30 Apr 2013 22:13:57 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UMDuoZ028919; Tue, 30 Apr 2013 22:13:56 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304302213.r3UMDuoZ028919@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 22:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250121 - in stable/9: . etc share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 22:13:57 -0000 Author: brooks Date: Tue Apr 30 22:13:55 2013 New Revision: 250121 URL: http://svnweb.freebsd.org/changeset/base/250121 Log: MFC r245752,246913,247162,250119 Replace all known uses of ln in the build process with appropriate install -l invocations via new INSTALL_LINK and INSTALL_SYMLINK variables. Sponsored by: DARPA, AFRL Modified: stable/9/UPDATING (contents, props changed) stable/9/etc/Makefile stable/9/share/mk/bsd.incs.mk stable/9/share/mk/bsd.info.mk stable/9/share/mk/bsd.lib.mk stable/9/share/mk/bsd.links.mk stable/9/share/mk/bsd.man.mk stable/9/share/mk/bsd.own.mk Directory Properties: stable/9/etc/ (props changed) stable/9/share/mk/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Tue Apr 30 21:36:52 2013 (r250120) +++ stable/9/UPDATING Tue Apr 30 22:13:55 2013 (r250121) @@ -21,6 +21,13 @@ Items affecting the ports and packages s This can be accomplished with the command (cd src/usr.sbin/mergemaster && make install). + Due to the use of the new -l option to install(1) during build + and install, you must take care not to directly set the INSTALL + make variable in your /etc/make.conf, /etc/src.conf, or on the + command line. If you with to use the -C flag for all installs + you may be able to add INSTALL+=-C to /etc/make.conf or + /etc/src.conf. + 20130429: Fix a bug that allows NFS clients to issue READDIR on files. Modified: stable/9/etc/Makefile ============================================================================== --- stable/9/etc/Makefile Tue Apr 30 21:36:52 2013 (r250120) +++ stable/9/etc/Makefile Tue Apr 30 22:13:55 2013 (r250121) @@ -321,26 +321,29 @@ distrib-dirs: -f $$m -p $$d; \ ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ done; true - ln -sfh usr/src/sys ${DESTDIR}/sys + ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys cd ${DESTDIR}/usr/share/man; \ for mandir in man*; do \ - ln -sfh ../$$mandir ${DESTDIR}/usr/share/man/en.ISO8859-1/; \ - ln -sfh ../$$mandir ${DESTDIR}/usr/share/man/en.UTF-8/; \ + ${INSTALL_SYMLINK} ../$$mandir \ + ${DESTDIR}/usr/share/man/en.ISO8859-1/; \ + ${INSTALL_SYMLINK} ../$$mandir \ + ${DESTDIR}/usr/share/man/en.UTF-8/; \ done cd ${DESTDIR}/usr/share/openssl/man; \ for mandir in man*; do \ - ln -sfh ../$$mandir \ + ${INSTALL_SYMLINK} ../$$mandir \ ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \ done set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \ while [ $$# -gt 0 ] ; do \ - ln -sfh "$$2" "${DESTDIR}/usr/share/man/$$1"; \ - ln -sfh "$$2" "${DESTDIR}/usr/share/openssl/man/$$1"; \ + ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \ + ${INSTALL_SYMLINK} "$$2" \ + "${DESTDIR}/usr/share/openssl/man/$$1"; \ shift; shift; \ done set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \ while [ $$# -gt 0 ] ; do \ - ln -sfh "$$2" "${DESTDIR}/usr/share/nls/$$1"; \ + ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \ shift; shift; \ done Modified: stable/9/share/mk/bsd.incs.mk ============================================================================== --- stable/9/share/mk/bsd.incs.mk Tue Apr 30 21:36:52 2013 (r250120) +++ stable/9/share/mk/bsd.incs.mk Tue Apr 30 22:13:55 2013 (r250121) @@ -73,7 +73,7 @@ installincludes: t=${DESTDIR}$$1; \ shift; \ ${ECHO} $$t -\> $$l; \ - ln -fs $$l $$t; \ + ${INSTALL_SYMLINK} $$l $$t; \ done; true .endif .endif # !target(installincludes) Modified: stable/9/share/mk/bsd.info.mk ============================================================================== --- stable/9/share/mk/bsd.info.mk Tue Apr 30 21:36:52 2013 (r250120) +++ stable/9/share/mk/bsd.info.mk Tue Apr 30 22:13:55 2013 (r250121) @@ -113,7 +113,7 @@ DVIPS2ASCII?= dvips2ascii .info.html: ${INFO2HTML} ${.IMPSRC} - ln -f ${.TARGET:R}.info.Top.html ${.TARGET} + ${INSTALL_LINK} ${.TARGET:R}.info.Top.html ${.TARGET} .PATH: ${.CURDIR} ${SRCDIR} Modified: stable/9/share/mk/bsd.lib.mk ============================================================================== --- stable/9/share/mk/bsd.lib.mk Tue Apr 30 21:36:52 2013 (r250120) +++ stable/9/share/mk/bsd.lib.mk Tue Apr 30 22:13:55 2013 (r250121) @@ -180,7 +180,7 @@ ${SHLIB_NAME}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${.TARGET} ${SHLIB_LINK} .if defined(SHLIB_LINK) - @ln -fs ${.TARGET} ${SHLIB_LINK} + @${INSTALL_SYMLINK} ${SHLIB_NAME} ${SHLIB_LINK} .endif .if !defined(NM) @${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ @@ -291,9 +291,9 @@ _libinstall: ${_INSTALLFLAGS} lib${LIB}.ld ${DESTDIR}${LIBDIR}/${SHLIB_LINK} .else .if ${SHLIBDIR} == ${LIBDIR} - ln -fs ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK} + ${INSTALL_SYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK} .else - ln -fs ${_SHLIBDIRPREFIX}${SHLIBDIR}/${SHLIB_NAME} \ + ${INSTALL_SYMLINK} ${_SHLIBDIRPREFIX}${SHLIBDIR}/${SHLIB_NAME} \ ${DESTDIR}${LIBDIR}/${SHLIB_LINK} .if exists(${DESTDIR}${LIBDIR}/${SHLIB_NAME}) -chflags noschg ${DESTDIR}${LIBDIR}/${SHLIB_NAME} Modified: stable/9/share/mk/bsd.links.mk ============================================================================== --- stable/9/share/mk/bsd.links.mk Tue Apr 30 21:36:52 2013 (r250120) +++ stable/9/share/mk/bsd.links.mk Tue Apr 30 22:13:55 2013 (r250121) @@ -15,7 +15,7 @@ _installlinks: t=${DESTDIR}$$1; \ shift; \ ${ECHO} $$t -\> $$l; \ - ln -f $$l $$t; \ + ${INSTALL_LINK} $$l $$t; \ done; true .endif .if defined(SYMLINKS) && !empty(SYMLINKS) @@ -26,6 +26,6 @@ _installlinks: t=${DESTDIR}$$1; \ shift; \ ${ECHO} $$t -\> $$l; \ - ln -fs $$l $$t; \ + ${INSTALL_SYMLINK} $$l $$t; \ done; true .endif Modified: stable/9/share/mk/bsd.man.mk ============================================================================== --- stable/9/share/mk/bsd.man.mk Tue Apr 30 21:36:52 2013 (r250120) +++ stable/9/share/mk/bsd.man.mk Tue Apr 30 22:13:55 2013 (r250121) @@ -216,7 +216,7 @@ _maninstall: ${MAN} t=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \ ${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \ rm -f $${t} $${t}${MCOMPRESS_EXT}; \ - ln $${l}${ZEXT} $${t}${ZEXT}; \ + ${INSTALL_LINK} $${l}${ZEXT} $${t}${ZEXT}; \ done .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) @set ${MLINKS:C/\.([^.]*)$/.\1 \1/}; \ @@ -231,7 +231,7 @@ _maninstall: ${MAN} t=${DESTDIR}${CATDIR}$${sect}${MANSUBDIR}/$$name; \ ${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \ rm -f $${t} $${t}${MCOMPRESS_EXT}; \ - ln $${l}${ZEXT} $${t}${ZEXT}; \ + ${INSTALL_LINK} $${l}${ZEXT} $${t}${ZEXT}; \ done .endif .endif Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Tue Apr 30 21:36:52 2013 (r250120) +++ stable/9/share/mk/bsd.own.mk Tue Apr 30 22:13:55 2013 (r250121) @@ -181,6 +181,15 @@ NLSMODE?= ${NOBINMODE} INCLUDEDIR?= /usr/include +# +# install(1) parameters. +# +HRDLINK?= -l h +SYMLINK?= -l s + +INSTALL_LINK?= ${INSTALL} ${HRDLINK} +INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} + # Common variables .if !defined(DEBUG_FLAGS) STRIP?= -s From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 23:36:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 808B6A2B; Tue, 30 Apr 2013 23:36:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 731E41EE2; Tue, 30 Apr 2013 23:36:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UNakbG056930; Tue, 30 Apr 2013 23:36:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UNakAB056929; Tue, 30 Apr 2013 23:36:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304302336.r3UNakAB056929@svn.freebsd.org> From: Eitan Adler Date: Tue, 30 Apr 2013 23:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250123 - head/sys/dev/hptiop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 23:36:46 -0000 Author: eadler Date: Tue Apr 30 23:36:45 2013 New Revision: 250123 URL: http://svnweb.freebsd.org/changeset/base/250123 Log: Add missing braces Reviewed by: swildner@dragonflybsd.org Reviewed by: delphij Modified: head/sys/dev/hptiop/hptiop.c Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Tue Apr 30 22:59:09 2013 (r250122) +++ head/sys/dev/hptiop/hptiop.c Tue Apr 30 23:36:45 2013 (r250123) @@ -1642,10 +1642,11 @@ static int hptiop_internal_memalloc_mv(s MVIOP_IOCTLCFG_SIZE, hptiop_mv_map_ctlcfg, hba, 0)) { device_printf(hba->pcidev, "bus_dmamap_load failed!\n"); - if (hba->ctlcfg_dmat) + if (hba->ctlcfg_dmat) { bus_dmamem_free(hba->ctlcfg_dmat, hba->ctlcfg_ptr, hba->ctlcfg_dmamap); bus_dma_tag_destroy(hba->ctlcfg_dmat); + } return -1; } From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 23:36:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 29000A2C; Tue, 30 Apr 2013 23:36:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1B2FC1EE3; Tue, 30 Apr 2013 23:36:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UNamlf056970; Tue, 30 Apr 2013 23:36:48 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UNamXq056968; Tue, 30 Apr 2013 23:36:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304302336.r3UNamXq056968@svn.freebsd.org> From: Eitan Adler Date: Tue, 30 Apr 2013 23:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250124 - head/sys/dev/hptiop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 23:36:49 -0000 Author: eadler Date: Tue Apr 30 23:36:48 2013 New Revision: 250124 URL: http://svnweb.freebsd.org/changeset/base/250124 Log: Remove ancient compatibility cruft. Reviewed by: delphij Modified: head/sys/dev/hptiop/hptiop.c head/sys/dev/hptiop/hptiop.h Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Tue Apr 30 23:36:45 2013 (r250123) +++ head/sys/dev/hptiop/hptiop.c Tue Apr 30 23:36:48 2013 (r250124) @@ -30,12 +30,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include -#endif #include #include @@ -43,11 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include -#if (__FreeBSD_version >= 500000) #include #include #include -#endif #include #include @@ -62,17 +56,9 @@ __FBSDID("$FreeBSD$"); #include #include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include -#include -#endif - -#if (__FreeBSD_version <= 500043) -#include -#endif + #include #include @@ -83,9 +69,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if (__FreeBSD_version < 500043) -#include -#endif #include @@ -177,27 +160,11 @@ static struct cdevsw hptiop_cdevsw = { .d_close = hptiop_close, .d_ioctl = hptiop_ioctl, .d_name = driver_name, -#if __FreeBSD_version>=503000 .d_version = D_VERSION, -#endif -#if (__FreeBSD_version>=503000 && __FreeBSD_version<600034) - .d_flags = D_NEEDGIANT, -#endif -#if __FreeBSD_version<600034 -#if __FreeBSD_version>=501000 - .d_maj = MAJOR_AUTO, -#else - .d_maj = HPT_DEV_MAJOR, -#endif -#endif }; -#if __FreeBSD_version < 503000 -#define hba_from_dev(dev) ((struct hpt_iop_hba *)(dev)->si_drv1) -#else #define hba_from_dev(dev) \ ((struct hpt_iop_hba *)devclass_get_softc(hptiop_devclass, dev2unit(dev))) -#endif #define BUS_SPACE_WRT4_ITL(offset, value) bus_space_write_4(hba->bar0t,\ hba->bar0h, offsetof(struct hpt_iopmu_itl, offset), (value)) @@ -245,9 +212,7 @@ static int hptiop_ioctl(ioctl_dev_t dev, int ret = EFAULT; struct hpt_iop_hba *hba = hba_from_dev(dev); -#if (__FreeBSD_version >= 500000) mtx_lock(&Giant); -#endif switch (cmd) { case HPT_DO_IOCONTROL: @@ -259,9 +224,7 @@ static int hptiop_ioctl(ioctl_dev_t dev, break; } -#if (__FreeBSD_version >= 500000) mtx_unlock(&Giant); -#endif return ret; } @@ -1615,21 +1578,15 @@ static int hptiop_internal_memalloc_mv(s 1, BUS_SPACE_MAXSIZE_32BIT, BUS_DMA_ALLOCNOW, -#if __FreeBSD_version > 502000 NULL, NULL, -#endif &hba->ctlcfg_dmat)) { device_printf(hba->pcidev, "alloc ctlcfg_dmat failed\n"); return -1; } if (bus_dmamem_alloc(hba->ctlcfg_dmat, (void **)&hba->ctlcfg_ptr, -#if __FreeBSD_version>501000 BUS_DMA_WAITOK | BUS_DMA_COHERENT, -#else - BUS_DMA_WAITOK, -#endif &hba->ctlcfg_dmamap) != 0) { device_printf(hba->pcidev, "bus_dmamem_alloc failed!\n"); @@ -1678,21 +1635,15 @@ static int hptiop_internal_memalloc_mvfr 1, BUS_SPACE_MAXSIZE_32BIT, BUS_DMA_ALLOCNOW, -#if __FreeBSD_version > 502000 NULL, NULL, -#endif &hba->ctlcfg_dmat)) { device_printf(hba->pcidev, "alloc ctlcfg_dmat failed\n"); return -1; } if (bus_dmamem_alloc(hba->ctlcfg_dmat, (void **)&hba->ctlcfg_ptr, -#if __FreeBSD_version>501000 BUS_DMA_WAITOK | BUS_DMA_COHERENT, -#else - BUS_DMA_WAITOK, -#endif &hba->ctlcfg_dmamap) != 0) { device_printf(hba->pcidev, "bus_dmamem_alloc failed!\n"); @@ -1937,9 +1888,7 @@ static int hptiop_attach(device_t dev) pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), hba->ops)); -#if __FreeBSD_version >=440000 pci_enable_busmaster(dev); -#endif hba->pcidev = dev; hba->pciunit = unit; @@ -1951,9 +1900,7 @@ static int hptiop_attach(device_t dev) goto release_pci_res; } -#if (__FreeBSD_version >= 500000) mtx_init(&hba->lock, "hptioplock", NULL, MTX_DEF); -#endif if (bus_dma_tag_create(bus_get_dma_tag(dev),/* PCI parent */ 1, /* alignment */ @@ -1965,10 +1912,8 @@ static int hptiop_attach(device_t dev) BUS_SPACE_UNRESTRICTED, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ -#if __FreeBSD_version>502000 NULL, /* lockfunc */ NULL, /* lockfuncarg */ -#endif &hba->parent_dmat /* tag */)) { device_printf(dev, "alloc parent_dmat failed\n"); @@ -2015,10 +1960,8 @@ static int hptiop_attach(device_t dev) hba->max_sg_count, /* nsegments */ 0x20000, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ -#if __FreeBSD_version>502000 busdma_lock_mutex, /* lockfunc */ &hba->lock, /* lockfuncarg */ -#endif &hba->io_dmat /* tag */)) { device_printf(dev, "alloc io_dmat failed\n"); @@ -2035,10 +1978,8 @@ static int hptiop_attach(device_t dev) 1, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ -#if __FreeBSD_version>502000 NULL, /* lockfunc */ NULL, /* lockfuncarg */ -#endif &hba->srb_dmat /* tag */)) { device_printf(dev, "alloc srb_dmat failed\n"); @@ -2046,11 +1987,7 @@ static int hptiop_attach(device_t dev) } if (bus_dmamem_alloc(hba->srb_dmat, (void **)&hba->uncached_ptr, -#if __FreeBSD_version>501000 BUS_DMA_WAITOK | BUS_DMA_COHERENT, -#else - BUS_DMA_WAITOK, -#endif &hba->srb_dmamap) != 0) { device_printf(dev, "srb bus_dmamem_alloc failed!\n"); @@ -2071,23 +2008,14 @@ static int hptiop_attach(device_t dev) goto srb_dmamap_unload; } -#if __FreeBSD_version <700000 - hba->sim = cam_sim_alloc(hptiop_action, hptiop_poll, driver_name, - hba, unit, hba->max_requests - 1, 1, devq); -#else hba->sim = cam_sim_alloc(hptiop_action, hptiop_poll, driver_name, hba, unit, &Giant, hba->max_requests - 1, 1, devq); -#endif if (!hba->sim) { device_printf(dev, "cam_sim_alloc failed\n"); cam_simq_free(devq); goto srb_dmamap_unload; } -#if __FreeBSD_version <700000 - if (xpt_bus_register(hba->sim, 0) != CAM_SUCCESS) -#else if (xpt_bus_register(hba->sim, dev, 0) != CAM_SUCCESS) -#endif { device_printf(dev, "xpt_bus_register failed\n"); goto free_cam_sim; @@ -2124,13 +2052,8 @@ static int hptiop_attach(device_t dev) goto free_hba_path; } -#if __FreeBSD_version <700000 - if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM, - hptiop_pci_intr, hba, &hba->irq_handle)) -#else if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM, NULL, hptiop_pci_intr, hba, &hba->irq_handle)) -#endif { device_printf(dev, "allocate intr function failed!\n"); goto free_irq_resource; @@ -2149,9 +2072,6 @@ static int hptiop_attach(device_t dev) UID_ROOT, GID_WHEEL /*GID_OPERATOR*/, S_IRUSR | S_IWUSR, "%s%d", driver_name, unit); -#if __FreeBSD_version < 503000 - hba->ioctl_dev->si_drv1 = hba; -#endif return 0; @@ -2419,15 +2339,7 @@ scsi_done: break; case XPT_CALC_GEOMETRY: -#if __FreeBSD_version >= 500000 cam_calc_geometry(&ccb->ccg, 1); -#else - ccb->ccg.heads = 255; - ccb->ccg.secs_per_track = 63; - ccb->ccg.cylinders = ccb->ccg.volume_size / - (ccb->ccg.heads * ccb->ccg.secs_per_track); - ccb->ccb_h.status = CAM_REQ_CMP; -#endif break; case XPT_PATH_INQ: Modified: head/sys/dev/hptiop/hptiop.h ============================================================================== --- head/sys/dev/hptiop/hptiop.h Tue Apr 30 23:36:45 2013 (r250123) +++ head/sys/dev/hptiop/hptiop.h Tue Apr 30 23:36:48 2013 (r250124) @@ -333,17 +333,9 @@ struct hpt_iop_ioctl_param { #define HPT_IOCTL_FLAG_OPEN 1 #define HPT_CTL_CODE_BSD_TO_IOP(x) ((x)-0xff00) -#if __FreeBSD_version>503000 typedef struct cdev * ioctl_dev_t; -#else -typedef dev_t ioctl_dev_t; -#endif -#if __FreeBSD_version >= 500000 typedef struct thread * ioctl_thread_t; -#else -typedef struct proc * ioctl_thread_t; -#endif struct hpt_iop_hba { struct hptiop_adapter_ops *ops; @@ -425,11 +417,7 @@ struct hpt_iop_hba { struct cam_sim *sim; struct cam_path *path; void *req; -#if (__FreeBSD_version >= 500000) struct mtx lock; -#else - int hpt_splx; -#endif #define HPT_IOCTL_FLAG_OPEN 1 u_int32_t flag; struct hpt_iop_srb* srb[HPT_SRB_MAX_QUEUE_SIZE]; @@ -474,19 +462,8 @@ struct hpt_iop_srb { int index; }; -#if __FreeBSD_version >= 500000 #define hptiop_lock_adapter(hba) mtx_lock(&(hba)->lock) #define hptiop_unlock_adapter(hba) mtx_unlock(&(hba)->lock) -#else -static __inline void hptiop_lock_adapter(struct hpt_iop_hba *hba) -{ - hba->hpt_splx = splcam(); -} -static __inline void hptiop_unlock_adapter(struct hpt_iop_hba *hba) -{ - splx(hba->hpt_splx); -} -#endif #define HPT_OSM_TIMEOUT (20*hz) /* timeout value for OS commands */ @@ -499,24 +476,12 @@ static __inline int hptiop_sleep(struct int retval; -#if __FreeBSD_version >= 500000 retval = msleep(ident, &hba->lock, priority, wmesg, timo); -#else - asleep(ident, priority, wmesg, timo); - hptiop_unlock_adapter(hba); - retval = await(priority, timo); - hptiop_lock_adapter(hba); -#endif return retval; } -#if __FreeBSD_version < 501000 -#define READ_16 0x88 -#define WRITE_16 0x8a -#define SERVICE_ACTION_IN 0x9e -#endif #define HPT_DEV_MAJOR 200 From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 23:49:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 507DB1A3; Tue, 30 Apr 2013 23:49:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3FD101F4C; Tue, 30 Apr 2013 23:49:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UNnOJG061099; Tue, 30 Apr 2013 23:49:24 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UNnOcK061097; Tue, 30 Apr 2013 23:49:24 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304302349.r3UNnOcK061097@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 30 Apr 2013 23:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250125 - in vendor/flex/dist: . doc m4 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 23:49:24 -0000 Author: jkim Date: Tue Apr 30 23:49:23 2013 New Revision: 250125 URL: http://svnweb.freebsd.org/changeset/base/250125 Log: Import flex 2.5.37. Added: vendor/flex/dist/ylwrap (contents, props changed) Deleted: vendor/flex/dist/doc/ vendor/flex/dist/m4/ Modified: vendor/flex/dist/ChangeLog vendor/flex/dist/INSTALL vendor/flex/dist/Makefile.am vendor/flex/dist/Makefile.in vendor/flex/dist/NEWS vendor/flex/dist/README.cvs vendor/flex/dist/buf.c vendor/flex/dist/compile vendor/flex/dist/conf.in vendor/flex/dist/config.guess vendor/flex/dist/config.sub vendor/flex/dist/configure vendor/flex/dist/configure.in vendor/flex/dist/depcomp vendor/flex/dist/dfa.c vendor/flex/dist/filter.c vendor/flex/dist/flex.skl vendor/flex/dist/flexdef.h vendor/flex/dist/flexint.h vendor/flex/dist/gen.c vendor/flex/dist/install-sh vendor/flex/dist/main.c vendor/flex/dist/misc.c vendor/flex/dist/missing vendor/flex/dist/parse.c vendor/flex/dist/parse.h vendor/flex/dist/parse.y vendor/flex/dist/regex.c vendor/flex/dist/scan.c vendor/flex/dist/scan.l vendor/flex/dist/scanflags.c vendor/flex/dist/scanopt.c vendor/flex/dist/skel.c vendor/flex/dist/tables.c Modified: vendor/flex/dist/ChangeLog ============================================================================== --- vendor/flex/dist/ChangeLog Tue Apr 30 23:36:48 2013 (r250124) +++ vendor/flex/dist/ChangeLog Tue Apr 30 23:49:23 2013 (r250125) @@ -1,996 +1,1408 @@ -2008-02-26 15:36 Will Estes +2012-08-03 Will Estes + + * NEWS: update NEWS to reflect changes in 2.5.37 + +2012-08-03 Will Estes + + * configure.in: update flex version to 2.5.37 + +2012-08-03 Will Estes + + * po/de.po: new de translation from the translation project + +2012-08-02 Will Estes + + * po/vi.po: new vi translation from the translation project + +2012-08-02 Will Estes + + * po/pl.po: new pl translation from the translation project + +2012-08-02 Will Estes + + * po/fi.po: new fi translation from the translation project + +2012-08-02 Will Estes + + * Makefile.am: Add -f option to LN_S to create flex++ The autoconf macro LN_S needs -f to successfully install flex++ if + flex++ already exists. Fortunately, ln, ln -s and cp -p, which are + the various forms that LN_S can take all will do the right thing + with a -f argument passed. + +2012-08-02 Will Estes + + * Makefile.am, tools/Makefile.am, tools/cvs2cl.pl, + tools/cvsauthors, tools/git2cl: replace cvs2cl with git2cl Add the git2cl script in tools/ and remove the (now unnecessary) + cvs2cl script. Remove tools/cvsauthors since git2cl does not need + that file. Account for all the above in Makefile.am and + tools/Makefile.am + +2012-07-29 Will Estes + + * tests/.cvsignore, tests/.gitignore, tests/TEMPLATE/.cvsignore, + tests/TEMPLATE/.gitignore, tests/test-alloc-extra/.cvsignore, + tests/test-alloc-extra/.gitignore, tests/test-array-nr/.cvsignore, + tests/test-array-nr/.gitignore, tests/test-array-r/.cvsignore, + tests/test-array-r/.gitignore, tests/test-basic-nr/.cvsignore, + tests/test-basic-nr/.gitignore, tests/test-basic-r/.cvsignore, + tests/test-basic-r/.gitignore, tests/test-bison-nr/.cvsignore, + tests/test-bison-nr/.gitignore, tests/test-bison-yylloc/.cvsignore, + tests/test-bison-yylloc/.gitignore, + tests/test-bison-yylval/.cvsignore, + tests/test-bison-yylval/.gitignore, + tests/test-c++-basic/.cvsignore, tests/test-c++-basic/.gitignore, + tests/test-c++-multiple-scanners/.cvsignore, + tests/test-c++-multiple-scanners/.gitignore, + tests/test-c++-yywrap/.cvsignore, tests/test-c++-yywrap/.gitignore, + tests/test-c-cpp-nr/.cvsignore, tests/test-c-cpp-nr/.gitignore, + tests/test-c-cpp-r/.cvsignore, tests/test-c-cpp-r/.gitignore, + tests/test-ccl/.cvsignore, tests/test-ccl/.gitignore, + tests/test-concatenated-options/.cvsignore, + tests/test-concatenated-options/.gitignore, + tests/test-debug-nr/.cvsignore, tests/test-debug-nr/.gitignore, + tests/test-debug-r/.cvsignore, tests/test-debug-r/.gitignore, + tests/test-extended/.cvsignore, tests/test-extended/.gitignore, + tests/test-header-nr/.cvsignore, tests/test-header-nr/.gitignore, + tests/test-header-r/.cvsignore, tests/test-header-r/.gitignore, + tests/test-include-by-buffer/.cvsignore, + tests/test-include-by-buffer/.gitignore, + tests/test-include-by-push/.cvsignore, + tests/test-include-by-push/.gitignore, + tests/test-include-by-reentrant/.cvsignore, + tests/test-include-by-reentrant/.gitignore, + tests/test-linedir-r/.cvsignore, tests/test-linedir-r/.gitignore, + tests/test-lineno-nr/.cvsignore, tests/test-lineno-nr/.gitignore, + tests/test-lineno-r/.cvsignore, tests/test-lineno-r/.gitignore, + tests/test-mem-nr/.cvsignore, tests/test-mem-nr/.gitignore, + tests/test-mem-r/.cvsignore, tests/test-mem-r/.gitignore, + tests/test-multiple-scanners-nr/.cvsignore, + tests/test-multiple-scanners-nr/.gitignore, + tests/test-multiple-scanners-r/.cvsignore, + tests/test-multiple-scanners-r/.gitignore, + tests/test-noansi-nr/.cvsignore, tests/test-noansi-nr/.gitignore, + tests/test-noansi-r/.cvsignore, tests/test-noansi-r/.gitignore, + tests/test-posix/.cvsignore, tests/test-posix/.gitignore, + tests/test-posixly-correct/.cvsignore, + tests/test-posixly-correct/.gitignore, + tests/test-prefix-nr/.cvsignore, tests/test-prefix-nr/.gitignore, + tests/test-prefix-r/.cvsignore, tests/test-prefix-r/.gitignore, + tests/test-pthread/.cvsignore, tests/test-pthread/.gitignore, + tests/test-quotes/.cvsignore, tests/test-quotes/.gitignore, + tests/test-reject/.cvsignore, tests/test-reject/.gitignore, + tests/test-rescan-nr/.cvsignore, tests/test-rescan-nr/.gitignore, + tests/test-rescan-r/.cvsignore, tests/test-rescan-r/.gitignore, + tests/test-string-nr/.cvsignore, tests/test-string-nr/.gitignore, + tests/test-string-r/.cvsignore, tests/test-string-r/.gitignore, + tests/test-table-opts/.cvsignore, tests/test-table-opts/.gitignore, + tests/test-top/.cvsignore, tests/test-top/.gitignore, + tests/test-yyextra/.cvsignore, tests/test-yyextra/.gitignore: rename + .cvsignore files in tests/ subdirectories to gitignore + +2012-07-23 Will Estes + + * examples/.cvsignore, examples/fastwc/.cvsignore, + examples/manual/.cvsignore, lib/.cvsignore, tools/.cvsignore: remove + unneeded .cvsignore files + +2012-07-22 Will Estes + + * .gitignore: add *.o and *.a to top level .gitignore The cvs tree did not need these additions because cvs assumed a lot + of C-style defaults for .cvsignore files. flex builds *.o object + files in the course of compilation and *.a files are built as a part + of the libraries that flex compiles in the build process. + +2012-07-22 Will Estes + + * .cvsignore, .gitignore, doc/.cvsignore, doc/.gitignore, + m4/.cvsignore, m4/.gitignore, po/.cvsignore, po/.gitignore: rename + .cvsignore files to .gitignore The .cvsignore files from the legacy cvs repository tracked what + files got autogenerated during various stages of the flex build. + Renaming the .cvsignore files to .gitignore lets git do the same + thing. git is better about letting higher level .gitignore files + not-track files in lower level directories. As I work my way through + the test directories, we may add additional .gitignore files from + the old .cvsignore files. The po/ directory has a lot of special files used by gettext, so the + patterns in po/.gitignore look very different. The doc/.gitignore file accounts for what texinfo/makeinfo do, and + so it also has special patterns. The m4 directory is mainly present for autoconf's benefit, but we + have to account for it so make can do the right thing. Hence, + m4/.gitignore says to ignore *.m4, as counterintuitive as that may + seem. + +2012-07-22 Will Estes + + * NEWS: update NEWS file to note release date of 2.5.36 + +2012-06-23 Will Estes + + * doc/flex.texi: fix call to version in manual + +2012-06-22 Will Estes + + * doc/flex.texi: add missing argument to call to yylex in manual + +2012-04-27 Will Estes + + * flex.skl: lintish cleanup in flex.skl; resolves #2040664 + +2012-04-27 Will Estes + + * doc/flex.texi: add a 7 to the c99 octal pattern; resolves #3518269 + +2012-03-31 Will Estes + + * doc/flex.texi: copyedit; resolves #3513670 + +2012-03-23 Will Estes + + * buf.c: escape backslashes in #line filenames in %top section; + resolves #3212400; patch submitted by scfc_de + +2012-03-21 Will Estes + + * Makefile.am, configure.in, lib/Makefile.am, lib/lib.c, + lib/malloc.c, lib/realloc.c: provide malloc() and realloc() for + systems that do not have satisfactory versions; resolves #1899047 + +2012-03-21 Will Estes + + * Makefile.am: install flex++ as a link; resolves bug #2939681 + +2012-03-21 Will Estes + + * tests/test-bison-nr/Makefile.am, + tests/test-bison-yylloc/Makefile.am, + tests/test-bison-yylval/Makefile.am: fix dependencies for make -j in + test suite + +2012-03-19 Will Estes + + * flex.skl: add missing prototypes for yyset_column() and + yyget_column(); resolves #3029024; patch submitted by scfc_de + +2012-03-02 Will Estes + + * flex.skl, tests/test-reject/scanner.l, + tests/test-table-opts/scanner.l: wrap yy_fatal_error calls + appropriately + +2012-03-02 Will Estes + + * regex.c: fix overlapping data buffer issue; patch from Tim + Landsheet scfc_de + +2012-03-02 Will Estes + + * scan.l: better bracket handling in the scanner + +2012-03-02 Will Estes + + * flexdef.h, main.c, misc.c: Remove unneeded tracking of line/column + output; patch from Tim Landsheet scfc_de + +2012-03-02 Will Estes + + * configure.in: fix test for m4 to accept an m4 with -P and not jus + tGNU m4; patch from Tim Landsheet scfc_de on sourceforge + +2012-03-02 Will Estes + + * doc/flex.texi: fix order of td_lolen and td_hilen in + documentation; resolves #2913693; patch submitted by Andreas + Gruenbacher + +2012-03-02 Will Estes + + * doc/flex.texi: correct document of YY_FLUSH_BUFFER; resolves + #1723028 + +2012-02-17 Will Estes + + * dfa.c, flexdef.h, misc.c, parse.y: speed up things for complex + inputs; resolves #2891390 + +2012-02-17 Will Estes + + * doc/flex.texi: fix ipv6 pattern in manual; update manual copyright + to 2012 + +2012-02-17 Will Estes + + * flex.skl: fremove isatty() declaration; resolves #1984987 + +2012-02-17 Will Estes + + * doc/flex.texi: Add link for RFC 2396 + +2012-02-17 Will Estes + + * flex.skl: resolve #1990170 + +2012-02-17 Will Estes + + * flex.skl: fix documentation to reflect arguments actually used; + bug #2783023 + +2012-02-05 Will Estes + + * main.c: fix yywrap behavior for reentrant scanners + +2012-02-04 Will Estes + + * NEWS: Mmention tr translation + +2012-02-04 Will Estes + + * tables.c: prevent unused stuff from being compiled so as to reduce + warnings + +2012-02-03 Will Estes + + * buf.c, filter.c, main.c, misc.c, regex.c, scanflags.c: more better + error messages; more better memory handling + +2012-02-03 Will Estes + + * misc.c: more careful/paranoia + +2012-02-03 Will Estes + + * scanopt.c: more careful memory allocation in option processing + +2012-02-03 Will Estes + + * Makefile.am, configure.in: remove m4/ directory and generally + clean up automake/autoconf inputs + +2012-02-03 Will Estes + + * lib/.cvsignore: cvsignore files that need that + +2012-02-03 Will Estes + + * NEWS, po/da.po, po/es.po, po/ko.po, po/pt_BR.po, po/ro.po, + po/ru.po, po/sv.po, po/tr.po, po/zh_CN.po: check in translations + +2012-02-03 Will Estes + + * main.c: correct macro definition of yywrap + +2012-02-03 Will Estes + + * scan.l: Greater specificity in error messages + +2012-02-03 Will Estes + + * parse.y: improve rule handling at EOF + +2012-02-03 Will Estes + + * flex.skl: include cstdio for definition of EOF in all cases + +2012-02-03 Will Estes + + * flex.skl: suppress warning on unused yyguts_t + +2010-08-13 Will Estes + + * NEWS, po/LINGUAS, po/fi.po: new fi translation from the + translation project + +2009-03-31 Will Estes + + * doc/flex.texi: Include version.texi after @setfilename, so that @set values are correctly evaluated. (Start Conditions, Performance, Lex and Posix): Fix some markup errors. (Cxx): Likewise. Also, fix C++ example to actually be compilable. Patch from Ralf Wildenhues + +2008-12-28 Will Estes + + * configure.in: remove line break that broke configure + +2008-12-28 Will Estes + + * doc/flex.texi: specify the title on the title page since @settitle + doesn't do that for us; resolves bug #2043491 + +2008-12-28 Will Estes + + * configure.in, flexdef.h: check for regex.h; resolves bug #2337486 + +2008-07-23 Will Estes + + * NEWS, po/ga.po: new ga translation from the translation project + +2008-06-10 Will Estes + + * NEWS, po/ca.po: new ca translation + +2008-05-31 Will Estes + + * Makefile.am: move ABOUT-NLS back to EXTRA_DIST + +2008-05-31 Will Estes + + * Makefile.am: create new dist_doc_DATA; move some EXTRA_DIST files + to new dist_doc_DATA target + +2008-05-31 Will Estes + + * .cvsignore: ignore more automake generated config.status* files + +2008-05-31 Will Estes + + * NEWS: flex distribution now built with automake and autoconf + versions ... + +2008-05-31 Will Estes + + * README.cvs: document GNU auto* version changes for building flex + from cvs + +2008-05-31 Will Estes + + * .cvsignore, doc/Makefile.am: ignore automake-supplied ylwrap + +2008-05-15 Will Estes + + * NEWS, flex.skl: clean up types; resolves 1961902 + +2008-05-15 Will Estes + + * NEWS: update NEWS re manual + +2008-05-15 Will Estes + + * doc/flex.texi: correct eroneous references to 'nowrap' to refer to + 'noyywrap'; resolves bug #1739912 + +2008-05-14 Will Estes + + * filter.c: call clearerr on stdin before dup2'ing it; resolves bug + #1902612 + +2008-05-14 Will Estes + + * NEWS: generic updates to NEWS + +2008-05-14 Will Estes + + * tests/test-pthread/Makefile.am: move library flags in linker + command; resolves patch #1943403; patch submitted by + nullnix@users.sourceforge.net + +2008-05-14 Will Estes + + * doc/flex.texi: use ansi syntax in simple examples; resolves patch + #1909844; patch submitted by Tom Browder, + tbrowder2@users.sourceforge.net + +2008-04-10 Will Estes + + * doc/flex.texi: fix typo in example (from Paolo J. Matos + +2008-04-10 Will Estes + + * flexint.h: move endif to better account for what C99 defines for + integer types (fix from debian project) + +2008-04-10 Will Estes + + * gen.c: fix another int type to be size_t + +2008-03-30 Will Estes + + * NEWS, po/fr.po: new fr translation + +2008-03-30 Will Estes + + * NEWS, configure.in: start version 2.5.36 + +2008-02-26 Will Estes * NEWS: add date of release -2008-02-15 07:37 Will Estes +2008-02-15 Will Estes * NEWS, parse.y: fix bug that prevented comments from working properly -2008-02-12 07:57 Will Estes +2008-02-12 Will Estes * po/de.po: new de translation -2008-02-10 06:08 Will Estes +2008-02-10 Will Estes * NEWS, po/vi.po: new vi translation -2008-02-09 19:22 Will Estes +2008-02-10 Will Estes * NEWS, po/nl.po: new nl translation -2008-02-09 14:59 Will Estes +2008-02-09 Will Estes * NEWS, po/pl.po: new pl translation -2008-02-09 14:19 Will Estes +2008-02-09 Will Estes * NEWS, po/de.po, po/pt_BR.po: new de, pt_br translations -2008-02-09 13:54 Will Estes +2008-02-09 Will Estes * NEWS, flex.skl: generate headers for all functions (resolves bug #1628314) -2008-02-09 10:49 Will Estes +2008-02-09 Will Estes * NEWS, flex.skl: change yy_size_t to be size_t (resolves bug #1849812) -2008-02-09 10:46 Will Estes +2008-02-09 Will Estes * configure.in: start work on version 2.5.35 -2007-12-12 16:00 Will Estes +2007-12-12 Will Estes - * NEWS, configure.in: revert NEWS and configure.in to version - 2.5.34 + * NEWS, configure.in: revert NEWS and configure.in to version 2.5.34 -2007-09-12 11:28 Will Estes +2007-09-12 Will Estes * NEWS, configure.in: update version number to 2.5.35 -2007-09-10 02:17 Aaron Stone +2007-09-10 Aaron Stone * tests/test-alloc-extra/scanner.l: Use %option extra-type. -2007-09-10 02:16 Aaron Stone +2007-09-10 Aaron Stone - * NEWS, flex.skl, flexdef.h, main.c, parse.y, scan.l, - doc/flex.texi: Introduce %option extra-type="your_type *" (resolves - bug #1744505). + * NEWS, doc/flex.texi, flex.skl, flexdef.h, main.c, parse.y, scan.l: + Introduce %option extra-type="your_type *" (resolves bug #1744505). -2007-08-15 08:28 Will Estes +2007-08-15 Will Estes * po/nl.po: new nl translations from the translation project -2007-06-28 16:28 Will Estes +2007-06-28 Will Estes * NEWS: change release date -2007-06-27 21:59 Will Estes +2007-06-28 Will Estes * flex.skl: adjustment for prefix classes; patch submitted by Petr Machata -2007-06-27 21:53 Will Estes +2007-06-28 Will Estes * NEWS: NEWS item for yy_init_extra -2007-06-12 12:33 Aaron Stone +2007-06-12 Aaron Stone * doc/flex.texi: Docs and example for yylex_init_extra. -2007-05-31 20:22 Will Estes +2007-06-01 Will Estes * tests/test-alloc-extra/.cvsignore: ignore OUTPUT file in test-alloc-extra -2007-05-31 20:21 Will Estes +2007-06-01 Will Estes * tests/descriptions: add description of concatenated options test -2007-05-31 16:20 Will Estes +2007-05-31 Will Estes * tests/test-alloc-extra/.cvsignore: add missing .cvsignore to test-alloc-extra -2007-05-31 02:21 Aaron Stone +2007-05-31 Aaron Stone * configure.in, flex.skl, gen.c, main.c: Changes to resolve SF bugs 1568325 and 1563589. -2007-05-31 02:09 Aaron Stone +2007-05-31 Aaron Stone - * tests/: Makefile.am, descriptions, test-alloc-extra/Makefile.am, - test-alloc-extra/scanner.l, test-alloc-extra/test.input: Adding - test cases for yylex_init_extra. + * tests/Makefile.am, tests/descriptions, + tests/test-alloc-extra/Makefile.am, + tests/test-alloc-extra/scanner.l, tests/test-alloc-extra/test.input: + Adding test cases for yylex_init_extra. -2007-05-12 11:27 Will Estes +2007-05-12 Will Estes * configure.in, tests/test-pthread/scanner.l: fixes to test-pthread -2007-05-12 09:13 Will Estes +2007-05-12 Will Estes * NEWS: NEWS item for concatenated options -2007-05-12 09:13 Will Estes +2007-05-12 Will Estes * configure.in, tests/Makefile.am, tests/test-concatenated-options/.cvsignore, tests/test-concatenated-options/Makefile.am: unit test to verify concatenated options parsing -2007-05-12 09:11 Will Estes +2007-05-12 Will Estes * scanopt.c: parse multiple short concatenated options; patch submitted by Petr Machata +2007-05-11 Will Estes * autogen.sh: remove --force option from autogen.sh; much faster without it -2007-05-11 14:35 Will Estes +2007-05-11 Will Estes * NEWS, configure.in: version 2.5.34 -2007-05-08 00:23 Aaron Stone +2007-05-08 Aaron Stone * NEWS, flex.skl: Better checking after yyalloc/yyrealloc (resolves bug #1595967) -2007-05-01 08:10 Will Estes +2007-05-01 Will Estes * doc/flex.texi: change title of manual to 'Lexical Analysis with Flex' -2007-04-25 14:16 Will Estes +2007-04-25 Will Estes * flex.skl: c++ memory leak plug -2007-04-23 09:29 Will Estes +2007-04-23 Will Estes * flex.skl: roll back c++ memory patch as it causes the test suite no end of grief -2007-04-23 08:42 Will Estes +2007-04-23 Will Estes - * flex.skl: fix function definitions for non-ANSI environments - (from Manoj Srivastava from Debian patchset) + * flex.skl: fix function definitions for non-ANSI environments (from + Manoj Srivastava from Debian patchset) -2007-04-23 08:37 Will Estes +2007-04-23 Will Estes * flex.skl: fix c++ memory leak (from Manoj Srivastava from Debian patchset) -2007-04-23 06:59 Will Estes +2007-04-23 Will Estes * flex.skl: fix parameter name in comment (patch from Manoj Srivastava from the debian patchset -2007-04-23 06:57 Will Estes +2007-04-23 Will Estes * flex.skl: add a size_t cast (patch from Manoj Srivastava from the debian patchset -2007-04-16 17:06 Will Estes +2007-04-16 Will Estes - * tests/: test-extended/Makefile.am, test-quotes/Makefile.am: + * tests/test-extended/Makefile.am, tests/test-quotes/Makefile.am: cleanups to handle VPATH builds better; passifies make distcheck -2007-04-16 16:42 Will Estes +2007-04-16 Will Estes * doc/flex.texi: drop using the \ in \ escaping as it throws pdf generation for a loop -2007-04-14 08:33 Will Estes +2007-04-14 Will Estes * .cvsignore: add compile and *.tar.bz2 to .cvsignore -2007-04-14 08:27 Will Estes +2007-04-14 Will Estes * main.c: add call to setlocale for ctype as per debian patchset -2007-04-14 08:25 Will Estes +2007-04-14 Will Estes - * Makefile.am, NEWS: provide for a PIC version of libfl.a for - shared libraries using flex scanners + * Makefile.am, NEWS: provide for a PIC version of libfl.a for shared + libraries using flex scanners -2007-04-13 13:24 Will Estes +2007-04-13 Will Estes * FlexLexer.h: annotate endifs since they're a bit far from their opening #if statements -2007-04-13 12:55 Will Estes +2007-04-13 Will Estes * flexdef.h, parse.y: refactor and slightly redo alloca testing, resolves bug #1675899 -2007-04-13 12:50 Will Estes - - * configure.in: overhaul configure.in: use octathorps for comments - so they're passed through m4 processing; better bracketing of m4 - arguments; retool checks as per suggestions from autoscan(1) - -2007-04-13 12:43 Will Estes +2007-04-13 Will Estes - * flex.skl: better handling of class that use the prefix - functionality; from submitted patch + * : overhaul configure.in: use octathorps for comments so they're + passed through m4 processing; better bracketing of m4 arguments; + retool checks as per suggestions from autoscan(1) -2007-04-13 12:32 Will Estes +2007-04-13 Will Estes * flex.skl: fix skeleton for reentrant scanners -2007-04-12 21:50 Will Estes +2007-04-13 Will Estes * Makefile.am: remove homegrown tags target; automake does that for us -2007-04-12 15:12 Will Estes - - * FlexLexer.h: declare some const where missing in c++ header file - -2007-04-12 15:12 Will Estes +2007-04-12 Will Estes * flex.skl: fix skeleton for reentrant scanners, resolves bug #1694318 -2007-04-10 15:20 Will Estes +2007-04-12 Will Estes + + * FlexLexer.h: declare some const where missing in c++ header file + +2007-04-10 Will Estes * doc/flex.texi: corrections to the manual as per suggestions from flex-help@ -2007-04-03 15:16 Will Estes +2007-04-03 Will Estes * doc/flex.texi: include author names in online versions of the manual -2007-04-03 15:07 Will Estes +2007-04-03 Will Estes * COPYING: update copyright notice -2007-04-03 14:54 Will Estes +2007-04-03 Will Estes * AUTHORS: rearrange and update AUTHORS -2007-03-29 11:45 Will Estes +2007-03-29 Will Estes * NEWS: note sf feature request 1658379 in NEWS -2007-03-29 11:36 Will Estes +2007-03-29 Will Estes * tools/cvsauthors: add sodabrew to cvsauthors file -2007-03-29 11:25 Aaron Stone +2007-03-29 Aaron Stone - * flex.skl: - SourceForge feature request #1658379: Expose YY_BUF_SIZE in the - header file. + * flex.skl: SourceForge feature request #1658379: Expose YY_BUF_SIZE + in the header file. -2007-03-07 16:50 Will Estes +2007-03-07 Will Estes * NEWS, filter.c, flex.skl: apply patches submitted by sodabrew -2007-03-07 16:20 Will Estes +2007-03-07 Will Estes * README.cvs: more changes describing building flex from cvs -2007-03-07 16:16 Will Estes +2007-03-07 Will Estes * Makefile.am, README.cvs, README.cvs-snapshot: rename README.cvs-snapshot to README.cvs -2007-03-07 16:14 Will Estes +2007-03-07 Will Estes * README.cvs-snapshot: update to explain where flex cvs lives -2007-03-07 15:45 Will Estes +2007-03-07 Will Estes * README, doc/flex.texi: correct how to submit bugs -2007-02-16 10:38 Will Estes +2007-02-16 Will Estes * NEWS: clarify NEWS item re man page and pdf manual -2007-02-14 12:03 Will Estes +2007-02-14 Will Estes * po/Makevars: update bug address to point to flex-devel instead of lex-help -2007-02-13 12:54 Will Estes +2007-02-13 Will Estes * configure.in, doc/Makefile.am: make better use of AC_INIT; clean up, simplify and make more robust the generation of the man page -2007-02-13 12:08 Will Estes +2007-02-13 Will Estes * configure.in: remove option check-news from call to AM_INIT_AUTOMAKE as gnits implies check-news -2007-02-13 10:07 Will Estes +2007-02-13 Will Estes * Makefile.am, configure.in: move automake options from Makefile.am to configure.in -2007-02-13 10:04 Will Estes +2007-02-13 Will Estes * autogen.sh: restore --install option to autogen.sh since --force does not imply --install -2007-02-13 10:04 Will Estes +2007-02-13 Will Estes * tools/cvsauthors: add john43 to cvsauthors file -2007-02-13 09:50 Will Estes +2007-02-13 Will Estes * autogen.sh: call autoreconf with --force instead of --install -2007-02-13 09:48 Will Estes +2007-02-13 Will Estes * doc/.cvsignore: remove texinfo.tex from cvs tree -2007-02-12 20:15 Will Estes +2007-02-13 Will Estes * NEWS: updates to NEWS file to reflect recent changes -2007-02-12 20:14 Will Estes +2007-02-13 Will Estes * doc/Makefile.am: add flex.pdf to EXTRA_DIST -2007-02-12 19:45 Will Estes +2007-02-13 Will Estes * configure.in: remove flex.spec -2007-02-12 19:44 Will Estes +2007-02-13 Will Estes * Makefile.am: remove maintainercleanfiles -2007-02-01 15:56 Will Estes +2007-02-01 Will Estes * doc/Makefile.am: more changes to build system to distribute man page -2007-02-01 12:10 Will Estes +2007-02-01 Will Estes * doc/Makefile.am: add flex man page to distribution -2007-02-01 12:09 Will Estes +2007-02-01 Will Estes * .cvsignore, flex.spec.in: remove flex spec file -2006-11-17 10:14 Will Estes +2006-11-17 Will Estes - * tests/test-table-opts/Makefile.am: make test target depend on - test groupings, which in turn depend on building executables; - cygwin portability fix + * tests/test-table-opts/Makefile.am: make test target depend on test + groupings, which in turn depend on building executables; cygwin + portability fix -2006-11-10 16:00 Will Estes +2006-11-10 Will Estes * tests/create-test: change create-test script to edit files in place -2006-11-09 15:14 Will Estes +2006-11-09 Will Estes - * tests/: test-array-nr/Makefile.am, test-array-r/Makefile.am, - test-basic-nr/Makefile.am, test-basic-r/Makefile.am, - test-bison-nr/Makefile.am, test-bison-yylloc/Makefile.am, - test-bison-yylval/Makefile.am, test-c++-basic/Makefile.am, - test-c++-multiple-scanners/Makefile.am, - test-c++-yywrap/Makefile.am, test-c-cpp-nr/Makefile.am, - test-c-cpp-r/Makefile.am, test-ccl/Makefile.am, - test-debug-nr/Makefile.am, test-debug-r/Makefile.am, - test-extended/Makefile.am, test-header-nr/Makefile.am, - test-header-r/Makefile.am, test-include-by-buffer/Makefile.am, - test-include-by-push/Makefile.am, - test-include-by-reentrant/Makefile.am, test-linedir-r/Makefile.am, - test-lineno-nr/Makefile.am, test-lineno-r/Makefile.am, - test-mem-nr/Makefile.am, test-mem-r/Makefile.am, - test-multiple-scanners-nr/Makefile.am, - test-multiple-scanners-r/Makefile.am, test-noansi-nr/Makefile.am, - test-noansi-r/Makefile.am, test-posix/Makefile.am, - test-posixly-correct/Makefile.am, test-prefix-nr/Makefile.am, - test-prefix-r/Makefile.am, test-pthread/Makefile.am, - test-quotes/Makefile.am, test-reject/Makefile.am, - test-rescan-nr/Makefile.am, test-rescan-r/Makefile.am, - test-string-nr/Makefile.am, test-string-r/Makefile.am, - test-top/Makefile.am, test-yyextra/Makefile.am: change CLEANFILES - to include instead of just the testname for the executable + * tests/test-array-nr/Makefile.am, tests/test-array-r/Makefile.am, + tests/test-basic-nr/Makefile.am, tests/test-basic-r/Makefile.am, + tests/test-bison-nr/Makefile.am, + tests/test-bison-yylloc/Makefile.am, + tests/test-bison-yylval/Makefile.am, + tests/test-c++-basic/Makefile.am, + tests/test-c++-multiple-scanners/Makefile.am, + tests/test-c++-yywrap/Makefile.am, tests/test-c-cpp-nr/Makefile.am, + tests/test-c-cpp-r/Makefile.am, tests/test-ccl/Makefile.am, + tests/test-debug-nr/Makefile.am, tests/test-debug-r/Makefile.am, + tests/test-extended/Makefile.am, tests/test-header-nr/Makefile.am, + tests/test-header-r/Makefile.am, + tests/test-include-by-buffer/Makefile.am, + tests/test-include-by-push/Makefile.am, + tests/test-include-by-reentrant/Makefile.am, + tests/test-linedir-r/Makefile.am, tests/test-lineno-nr/Makefile.am, + tests/test-lineno-r/Makefile.am, tests/test-mem-nr/Makefile.am, + tests/test-mem-r/Makefile.am, + tests/test-multiple-scanners-nr/Makefile.am, + tests/test-multiple-scanners-r/Makefile.am, + tests/test-noansi-nr/Makefile.am, tests/test-noansi-r/Makefile.am, + tests/test-posix/Makefile.am, + tests/test-posixly-correct/Makefile.am, + tests/test-prefix-nr/Makefile.am, tests/test-prefix-r/Makefile.am, + tests/test-pthread/Makefile.am, tests/test-quotes/Makefile.am, + tests/test-reject/Makefile.am, tests/test-rescan-nr/Makefile.am, + tests/test-rescan-r/Makefile.am, tests/test-string-nr/Makefile.am, + tests/test-string-r/Makefile.am, tests/test-top/Makefile.am, + tests/test-yyextra/Makefile.am: change CLEANFILES to include + instead of just the testname for the executable -2006-11-09 09:44 Will Estes +2006-11-09 Will Estes * doc/flex.texi: fix typos in manual; resolves bug #1592857 -2006-11-09 09:39 Will Estes +2006-11-09 Will Estes * tests/TEMPLATE/Makefile.am: change test template to remove test executable when that executable has an extension, e.g. under Cygwin -2006-11-08 10:28 Will Estes +2006-11-08 Will Estes * tests/Makefile.am: test names weren't displaying in test success/failure messages (from #1591672 -2006-10-30 15:28 Will Estes +2006-10-30 Will Estes * doc/.cvsignore: add flex.html to .cvsignore in doc directory -2006-10-22 18:42 Will Estes +2006-10-22 Will Estes * NEWS: update NEWS file for the work that millaway did -2006-10-22 18:17 Will Estes +2006-10-22 Will Estes * FlexLexer.h, NEWS, main.c, tests/test-c++-multiple-scanners/scanner-2.l: make yywrap work with c++ scanners as per sf bug report -2006-10-20 15:16 Will Estes +2006-10-20 Will Estes - * flex.skl, tests/test-c++-multiple-scanners/main.cpp, - tests/test-c-cpp-nr/scanner.l, NEWS: memory leak issues in c++ - scanner + * NEWS, flex.skl, tests/test-c++-multiple-scanners/main.cpp, + tests/test-c-cpp-nr/scanner.l: memory leak issues in c++ scanner -2006-10-20 13:10 Will Estes +2006-10-20 Will Estes - * configure.in, tests/Makefile.am, tests/descriptions, + * NEWS, configure.in, tests/Makefile.am, tests/descriptions, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 23:50:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EB8063E4; Tue, 30 Apr 2013 23:50:07 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C49E81F57; Tue, 30 Apr 2013 23:50:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UNo7wb061376; Tue, 30 Apr 2013 23:50:07 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UNo7Ki061375; Tue, 30 Apr 2013 23:50:07 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304302350.r3UNo7Ki061375@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 30 Apr 2013 23:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250126 - vendor/flex/2.5.37 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 23:50:08 -0000 Author: jkim Date: Tue Apr 30 23:50:07 2013 New Revision: 250126 URL: http://svnweb.freebsd.org/changeset/base/250126 Log: Tag flex 2.5.37. Added: vendor/flex/2.5.37/ - copied from r250125, vendor/flex/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Apr 30 23:51:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7519B547; Tue, 30 Apr 2013 23:51:12 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CCD41F5E; Tue, 30 Apr 2013 23:51:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UNpCnA063170; Tue, 30 Apr 2013 23:51:12 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UNpC2O063168; Tue, 30 Apr 2013 23:51:12 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304302351.r3UNpC2O063168@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 30 Apr 2013 23:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250127 - vendor/flex X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 23:51:12 -0000 Author: jkim Date: Tue Apr 30 23:51:11 2013 New Revision: 250127 URL: http://svnweb.freebsd.org/changeset/base/250127 Log: Update for 2.5.37. Modified: vendor/flex/FREEBSD-Xlist Modified: vendor/flex/FREEBSD-Xlist ============================================================================== --- vendor/flex/FREEBSD-Xlist Tue Apr 30 23:50:07 2013 (r250126) +++ vendor/flex/FREEBSD-Xlist Tue Apr 30 23:51:11 2013 (r250127) @@ -1,9 +1,9 @@ +*/doc */examples +*/lib +*/m4 +*/po */tests -*/*.tex -*/*.texi */tools */*.pro -*/po */*.m4 -*/*.pdf From owner-svn-src-all@FreeBSD.ORG Wed May 1 00:04:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 46DB6CE4; Wed, 1 May 2013 00:04:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 391A91FF1; Wed, 1 May 2013 00:04:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4104U8O067687; Wed, 1 May 2013 00:04:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4104TmY067682; Wed, 1 May 2013 00:04:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305010004.r4104TmY067682@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 1 May 2013 00:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250128 - vendor/flex/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 00:04:30 -0000 Author: jkim Date: Wed May 1 00:04:29 2013 New Revision: 250128 URL: http://svnweb.freebsd.org/changeset/base/250128 Log: Merge some important post-2.5.37 changes from upstream. http://flex.git.sourceforge.net/git/gitweb.cgi?p=flex/flex;a=commit;h=c53fd2db8c78fef5afd284c3e64da51bc71cf6c3 http://flex.git.sourceforge.net/git/gitweb.cgi?p=flex/flex;a=commit;h=899b2163bbde1a70b3be8b91cbbabd8007341205 http://flex.git.sourceforge.net/git/gitweb.cgi?p=flex/flex;a=commit;h=7642bd98aebb62260df923f57b794138dab6f1e7 http://flex.git.sourceforge.net/git/gitweb.cgi?p=flex/flex;a=commit;h=11b7c6cea340c2fca9b49ec635a45bd34361afe9 http://flex.git.sourceforge.net/git/gitweb.cgi?p=flex/flex;a=commit;h=ec2fdb85e0bac6e8aeca405094506e4cf8bfc0b6 Modified: vendor/flex/dist/flex.skl vendor/flex/dist/flexdef.h vendor/flex/dist/gen.c vendor/flex/dist/main.c Modified: vendor/flex/dist/flex.skl ============================================================================== --- vendor/flex/dist/flex.skl Tue Apr 30 23:51:11 2013 (r250127) +++ vendor/flex/dist/flex.skl Wed May 1 00:04:29 2013 (r250128) @@ -727,6 +727,11 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here +m4_ifdef( [[M4_YY_NOT_IN_HEADER]], +[[ +%% [1.5] DFA +]]) + %if-c-only Standard (non-C++) definition m4_ifdef( [[M4_YY_NOT_IN_HEADER]], @@ -1272,8 +1277,6 @@ m4_ifdef( [[M4_YY_NOT_REENTRANT]], ]]) ]]) -%% [7.0] user's declarations go here - m4_ifdef( [[M4_YY_BISON_LVAL]], [[ yylval = yylval_param; @@ -1329,6 +1332,9 @@ m4_ifdef( [[M4_YY_USES_REJECT]], yy_load_buffer_state( M4_YY_CALL_ONLY_ARG ); } + { +%% [7.0] user's declarations go here + while ( 1 ) /* loops until end-of-file is reached */ { %% [8.0] yymore()-related code goes here @@ -1486,6 +1492,7 @@ do_action: /* This label is used only to "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ %ok-for-header @@ -2360,7 +2367,7 @@ YY_BUFFER_STATE yy_scan_bytes YYFARGS2( YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; m4_dnl M4_YY_DECL_GUTS_VAR(); /* Get memory for full buffer, including space for trailing EOB's. */ Modified: vendor/flex/dist/flexdef.h ============================================================================== --- vendor/flex/dist/flexdef.h Tue Apr 30 23:51:11 2013 (r250127) +++ vendor/flex/dist/flexdef.h Wed May 1 00:04:29 2013 (r250128) @@ -908,6 +908,9 @@ extern void lerrif PROTO ((const char *, /* Report an error message formatted with one string argument. */ extern void lerrsf PROTO ((const char *, const char *)); +/* Like lerrsf, but also exit after displaying message. */ +extern void lerrsf_fatal PROTO ((const char *, const char *)); + /* Spit out a "#line" statement. */ extern void line_directive_out PROTO ((FILE *, int)); Modified: vendor/flex/dist/gen.c ============================================================================== --- vendor/flex/dist/gen.c Tue Apr 30 23:51:11 2013 (r250127) +++ vendor/flex/dist/gen.c Wed May 1 00:04:29 2013 (r250128) @@ -874,7 +874,7 @@ void gen_next_state (worry_about_NULs) else strcpy (char_map, useecs ? - "yy_ec[YY_SC_TO_UI(*yy_cp)]" : + "yy_ec[YY_SC_TO_UI(*yy_cp)] " : "YY_SC_TO_UI(*yy_cp)"); if (worry_about_NULs && nultrans) { @@ -1972,7 +1972,7 @@ void make_tables () ("if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )"); indent_up (); indent_puts ("{"); - indent_puts ("int yyl;"); + indent_puts ("yy_size_t yyl;"); do_indent (); out_str ("for ( yyl = %s; yyl < yyleng; ++yyl )\n", yymore_used ? (yytext_is_array ? "YY_G(yy_prev_more_offset)" : Modified: vendor/flex/dist/main.c ============================================================================== --- vendor/flex/dist/main.c Tue Apr 30 23:51:11 2013 (r250127) +++ vendor/flex/dist/main.c Wed May 1 00:04:29 2013 (r250128) @@ -182,6 +182,8 @@ int flex_main (argc, argv) readin (); + skelout (); + /* %% [1.5] DFA */ ntod (); for (i = 1; i <= num_rules; ++i) @@ -240,11 +242,6 @@ void check_options () flexerror (_ ("Can't use --reentrant or --bison-bridge with -l option")); - /* Don't rely on detecting use of yymore() and REJECT, - * just assume they'll be used. - */ - yymore_really_used = reject_really_used = true; - yytext_is_array = true; do_yylineno = true; use_read = false; From owner-svn-src-all@FreeBSD.ORG Wed May 1 01:49:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5648C3DB; Wed, 1 May 2013 01:49:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4753211E0; Wed, 1 May 2013 01:49:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r411n0Da003658; Wed, 1 May 2013 01:49:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r411n0Eb003657; Wed, 1 May 2013 01:49:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305010149.r411n0Eb003657@svn.freebsd.org> From: Adrian Chadd Date: Wed, 1 May 2013 01:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250129 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 01:49:01 -0000 Author: adrian Date: Wed May 1 01:49:00 2013 New Revision: 250129 URL: http://svnweb.freebsd.org/changeset/base/250129 Log: There's no HAL_EEPROM in FreeBSD - use ar9300_eeprom_t instead. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed May 1 00:04:29 2013 (r250128) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed May 1 01:49:00 2013 (r250129) @@ -1138,7 +1138,7 @@ ar9300_get_diag_state(struct ath_hal *ah #ifdef AH_PRIVATE_DIAG case HAL_DIAG_EEPROM: *result = &ahp->ah_eeprom; - *resultsize = sizeof(HAL_EEPROM); + *resultsize = sizeof(ar9300_eeprom_t); return AH_TRUE; #if 0 /* XXX - TODO */ From owner-svn-src-all@FreeBSD.ORG Wed May 1 01:50:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7BDE65A; Wed, 1 May 2013 01:50:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA8EA1210; Wed, 1 May 2013 01:50:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r411oXKh005443; Wed, 1 May 2013 01:50:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r411oX8I005442; Wed, 1 May 2013 01:50:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305010150.r411oX8I005442@svn.freebsd.org> From: Adrian Chadd Date: Wed, 1 May 2013 01:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250130 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 01:50:33 -0000 Author: adrian Date: Wed May 1 01:50:33 2013 New Revision: 250130 URL: http://svnweb.freebsd.org/changeset/base/250130 Log: Disable TXCONT, it's not here in FreeBSD. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed May 1 01:49:00 2013 (r250129) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed May 1 01:50:33 2013 (r250130) @@ -1185,9 +1185,11 @@ ar9300_get_diag_state(struct ath_hal *ah ar9300_ani_control( ah, ((const u_int32_t *)args)[0], ((const u_int32_t *)args)[1]); return AH_TRUE; +#if 0 case HAL_DIAG_TXCONT: /*AR9300_CONTTXMODE(ah, (struct ath_desc *)args, argsize );*/ return AH_TRUE; +#endif /* 0 */ #endif /* AH_PRIVATE_DIAG */ case HAL_DIAG_CHANNELS: #if 0 From owner-svn-src-all@FreeBSD.ORG Wed May 1 03:58:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03EDAD86; Wed, 1 May 2013 03:58:34 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id B76DA174A; Wed, 1 May 2013 03:58:33 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r413wW1m088660; Tue, 30 Apr 2013 21:58:32 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r413wWGM088659; Tue, 30 Apr 2013 21:58:32 -0600 (MDT) (envelope-from ken) Date: Tue, 30 Apr 2013 21:58:32 -0600 From: "Kenneth D. Merry" To: Steven Hartland Subject: Re: svn commit: r249939 - head/sys/cam/scsi Message-ID: <20130501035832.GB79864@nargothrond.kdm.org> References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> User-Agent: Mutt/1.4.2i Cc: svn-src-head@freebsd.org, Steven Hartland , src-committers@freebsd.org, trasz@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 03:58:34 -0000 On Tue, Apr 30, 2013 at 04:16:49 +0100, Steven Hartland wrote: > ----- Original Message ----- > From: "Steven Hartland" > >>On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: > >>>Author: smh > >>>Date: Fri Apr 26 16:17:04 2013 > >>>New Revision: 249939 > >>>URL: http://svnweb.freebsd.org/changeset/base/249939 > >>> > >>>Log: > >>> Added available delete methods discovery during device probe, > >>> including the > >>> maximum sizes for said methods, which are used when processing > >>> BIO_DELETE > >>> requests. This includes updating UNMAP support discovery to be based on > >>> SBC-3 T10/1799-D Revision 31 specification. > >>> Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) > >>> sys/cam/scsi/scsi_da.c: > >>> - Added ATA Data Set Management TRIM support via ATA > >>> Pass-Through(16) > >>> as a delete_method > >>> > >> > >>This adds a lot of unnecessary verbosity for devices that don't support > >>ATA > >>passthrough. For example: > >> > >>(da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 > >>00 00 00 00 00 00 00 40 ec 00 > >>(da7:iscsi4:0:0:0): CAM status: SCSI Status Error > >>(da7:iscsi4:0:0:0): SCSI status: Check Condition > >>(da7:iscsi4:0:0:0): Retrying command (per sense data) > >>(2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 > >>00 00 00 00 40 ec 00 > >>(2:2:0:0): Tag: 0x00f6, Type: 1 > >>(2:2:0:0): CTL Status: SCSI Error > >>(2:2:0:0): SCSI Status: Check Condition > >>(2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command > >>operation code) > >>(2:2:0:0): Command byte 0 is invalid > >> > >>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 > >>00 00 00 00 00 00 00 40 ec 00 > >>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error > >>(da8:iscsi4:0:0:1): SCSI status: Check Condition > >>(da8:iscsi4:0:0:1): Retrying command (per sense data) > >>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 > >>00 00 00 00 00 00 00 40 ec 00 > >>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error > >>(da8:iscsi4:0:0:1): SCSI status: Check Condition > >>(da8:iscsi4:0:0:1): Error 5, Retries exhausted > >> > >>That is with CTL and and trasz's new iSCSI initiator, but you should see > >>it > >>with any CTL configuration. (And probably with any controller or device > >>that doesn't support ATA passthrough.) > >> > >>So, please: > >>- Check for the presence of VPD page 0x89 before sending an ATA > >> passthrough command. The spec (sat3r03 in this case) says that > >> it "shall" be implemented, so I think we can count on that. > >>- If the target returns an illegal request sense key, don't retry > >> again. The target will keep returning illegal request > > > >Thanks for the report Ken I'll check this on a card I know doesn't support > >pass-through. > > I checked with an areca controller, which I know doesn't support pass16, and > all is quiet during boot / probe. > > I can provoke output at the app layer with camcontrol identify da0, which is > to be expected, but nothing in /var/log/messages. > > daerror handler in scsi_da.c definitely has SF_QUIET_IR so Illegal Request > should never be output. You're correct, it should not print out any messages. > I can't provoke this using standard CAM devices even when they don't support > ATA Pass-Through (16) so I think this is actually an issue with CTL: > 1. Being verbose when it shouldn't (ctl_process_done - line 12571?) That part at least is by design -- it prints out rate-limited messages so you know when the initiator is sending commands CTL doesn't support. It comes in handy for figuring out initiator problems sometimes. > 2. Retrying Illegal Request commands when it shouldn't (I didn't experince > this on r250032) CTL doesn't do any retries, it leaves that up to the initiator. I finally tracked down the problem. The issue is that the iSCSI initiator wasn't setting the CAM_AUTOSNS_VALID flag in the CCB status field. As a result, only the CAM status and SCSI status fields were being printed. SF_QUIET_IR > The attached patch implements a check for ATA Information VPD before > using ATA Pass-Through (16). It's had limited testing but I have > confirmed it eliminates the use of pass16 under CTL and still enables > ATA TRIM under on mpt for SATA disks, so looks promising. > > If you could test and let me know if it works for you Ken that would > be appreciated. Yes, it does work and eliminates the error message, thanks! I think it is also a better way to go, just in case we run into a target that has an issue with the ATA passthrough CDB. > The test case I used for CTL was:- > kldload ctl > ctladm create -b ramdisk -s 10485760 > ctladm port -o on > > As a side note while test "kldload ctl" caused kernel panic the once. What was the panic message? This doesn't look like a CTL-specific problem (not on the surface), but rather a more general CAM problem: > #8 0xffffffff8073e1f2 in calltrap () at > /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:228 > #9 0xffffffff8029c860 in cam_periph_alloc (periph_ctor=0xffffffff802af410 > , periph_oninvalidate=0xfffffe0019cfa200, periph_dtor= optimized out>, periph_start=0xfffffe0015980a90, name= out>, type=2159638184, > path=0xfffffe0015ad79a0, ac_callback=, code= optimized out>) at /usr/home/smh/freebsd/base/head/sys/cam/cam_periph.c:227 > #10 0xffffffff802aed6b in scsi_scan_lun (request_ccb=) > at /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:2266 > #11 0xffffffff802b2859 in scsi_scan_bus (periph=0x0, > request_ccb=0xfffffe00234df000) at > /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:1969 > #12 0xffffffff802a66c5 in xpt_scanner_thread (dummy=) > at /usr/home/smh/freebsd/base/head/sys/cam/cam_xpt.c:2411 > #13 0xffffffff8055cde4 in fork_exit (callout=0xffffffff802a6650 > , arg=0x0, frame=0xffffff823b8dcc00) at > /usr/home/smh/freebsd/base/head/sys/kern/kern_fork.c:991 > #14 0xffffffff8073e72e in fork_trampoline () at > /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:602 > #15 0x0000000000000000 in ?? () If this is on a stock FreeBSD/head, it looks like it failed on this line in cam_periph_alloc(): cur_periph = TAILQ_FIRST(&(*p_drv)->units); Perhaps there's an issue with the ctl peripheral driver getting added to the list of peripheral drivers (via periphdriver_register()). The topology lock isn't held in periphdriver_register(), so it's possible that the thread was in between the peripheral driver list traversal and the line above when the peripheral was added. It's more likely that the scan request was generated as a result of the CTL ports going online. And that means that the peripheral driver registration should have long since been done. If you can reproduce the problem, you can probably figure out where the issue is. Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Wed May 1 04:37:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4E0E42F8; Wed, 1 May 2013 04:37:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 25213182A; Wed, 1 May 2013 04:37:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r414bZ8l064427; Wed, 1 May 2013 04:37:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r414bZiJ064423; Wed, 1 May 2013 04:37:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305010437.r414bZiJ064423@svn.freebsd.org> From: Eitan Adler Date: Wed, 1 May 2013 04:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250131 - in head/sys: arm/broadcom/bcm2835 cam/ctl net netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 04:37:36 -0000 Author: eadler Date: Wed May 1 04:37:34 2013 New Revision: 250131 URL: http://svnweb.freebsd.org/changeset/base/250131 Log: Correct a few sizeof()s Submitted by: swildner@DragonFlyBSD.org Reviewed by: alfred Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c head/sys/cam/ctl/ctl_frontend_internal.c head/sys/net/if_spppsubr.c head/sys/netpfil/ipfw/ip_dummynet.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Wed May 1 01:50:33 2013 (r250130) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Wed May 1 04:37:34 2013 (r250131) @@ -198,7 +198,7 @@ bcm_dma_reset(device_t dev, int ch) /* Reset control block */ cb = sc->sc_dma_ch[ch].cb; - bzero(cb, sizeof(cb)); + bzero(cb, sizeof(*cb)); cb->info = INFO_WAIT_RESP; } Modified: head/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_internal.c Wed May 1 01:50:33 2013 (r250130) +++ head/sys/cam/ctl/ctl_frontend_internal.c Wed May 1 04:37:34 2013 (r250131) @@ -248,7 +248,7 @@ cfi_init(void) sizeof(struct cfi_lun_io), CTL_PORT_PRIV_SIZE); } - memset(softc, 0, sizeof(softc)); + memset(softc, 0, sizeof(*softc)); mtx_init(&softc->lock, "CTL frontend mutex", NULL, MTX_DEF); softc->flags |= CTL_FLAG_MASTER_SHELF; Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Wed May 1 01:50:33 2013 (r250130) +++ head/sys/net/if_spppsubr.c Wed May 1 04:37:34 2013 (r250131) @@ -3596,7 +3596,7 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct continue; } - bzero(&suggestaddr, sizeof(&suggestaddr)); + bzero(&suggestaddr, sizeof(suggestaddr)); if (collision && nohisaddr) { /* collision, hisaddr unknown - Conf-Rej */ type = CONF_REJ; Modified: head/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dummynet.c Wed May 1 01:50:33 2013 (r250130) +++ head/sys/netpfil/ipfw/ip_dummynet.c Wed May 1 04:37:34 2013 (r250131) @@ -618,7 +618,7 @@ fsk_detach(struct dn_fsk *fs, int flags) fs->sched->fp->free_fsk(fs); fs->sched = NULL; if (flags & DN_DELETE_FS) { - bzero(fs, sizeof(fs)); /* safety */ + bzero(fs, sizeof(*fs)); /* safety */ free(fs, M_DUMMYNET); dn_cfg.fsk_count--; } else { From owner-svn-src-all@FreeBSD.ORG Wed May 1 04:37:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C4DB2445; Wed, 1 May 2013 04:37:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B857A182B; Wed, 1 May 2013 04:37:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r414bj72064486; Wed, 1 May 2013 04:37:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r414bjUx064485; Wed, 1 May 2013 04:37:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305010437.r414bjUx064485@svn.freebsd.org> From: Eitan Adler Date: Wed, 1 May 2013 04:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250132 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 04:37:45 -0000 Author: eadler Date: Wed May 1 04:37:45 2013 New Revision: 250132 URL: http://svnweb.freebsd.org/changeset/base/250132 Log: Fix incorrect sizeof() in bzero() Submitted by: swildner@DragonFlyBSD.org Reviewed by: alfred, jmallett Modified: head/sys/contrib/octeon-sdk/cvmx-usbd.c Modified: head/sys/contrib/octeon-sdk/cvmx-usbd.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-usbd.c Wed May 1 04:37:34 2013 (r250131) +++ head/sys/contrib/octeon-sdk/cvmx-usbd.c Wed May 1 04:37:45 2013 (r250132) @@ -245,7 +245,7 @@ int cvmx_usbd_initialize(cvmx_usbd_state if (cvmx_unlikely(flags & CVMX_USBD_INITIALIZE_FLAGS_DEBUG)) cvmx_dprintf("%s: Called\n", __FUNCTION__); - memset(usb, 0, sizeof(usb)); + memset(usb, 0, sizeof(*usb)); usb->init_flags = flags; usb->index = usb_port_number; From owner-svn-src-all@FreeBSD.ORG Wed May 1 05:15:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 634C0A1D; Wed, 1 May 2013 05:15:00 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53BA4192C; Wed, 1 May 2013 05:15:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r415F0gp078235; Wed, 1 May 2013 05:15:00 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r415F0iZ078233; Wed, 1 May 2013 05:15:00 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201305010515.r415F0iZ078233@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Wed, 1 May 2013 05:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250133 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 05:15:00 -0000 Author: wkoszek Date: Wed May 1 05:14:59 2013 New Revision: 250133 URL: http://svnweb.freebsd.org/changeset/base/250133 Log: Make the internal assertion correct--only fail when '\0' is found in places other than the end of the test section. Otherwise, with kernel compiled with Clang which happens to be setting ELF section alignment differently config(8) was throwing assert() failure unnecessarily Reported by: Kimmo Paasiala Tested by: Kimmo Paasiala MFC after: 10 days Modified: head/usr.sbin/config/main.c Modified: head/usr.sbin/config/main.c ============================================================================== --- head/usr.sbin/config/main.c Wed May 1 04:37:45 2013 (r250132) +++ head/usr.sbin/config/main.c Wed May 1 05:14:59 2013 (r250133) @@ -706,17 +706,11 @@ kernconfdump(const char *file) r = fgetc(fp); if (r == EOF) break; - /* - * If '\0' is present in the middle of the configuration - * string, this means something very weird is happening. - * Make such case very visible. However, some architectures - * pad the length of the section with NULs to a multiple of - * sh_addralign, allow a NUL in that part of the section. - */ - if (r == '\0' && (size - i) < align) + if (r == '\0') { + assert(i == size - 1 && + ("\\0 found in the middle of a file")); break; - assert(r != '\0' && ("Char present in the configuration " - "string mustn't be equal to 0")); + } fputc(r, stdout); } fclose(fp); From owner-svn-src-all@FreeBSD.ORG Wed May 1 05:46:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7E6EF45; Wed, 1 May 2013 05:46:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AB12C1BCB; Wed, 1 May 2013 05:46:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r415ktsg088823; Wed, 1 May 2013 05:46:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r415ktrA088822; Wed, 1 May 2013 05:46:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010546.r415ktrA088822@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 05:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250134 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 05:46:55 -0000 Author: imp Date: Wed May 1 05:46:54 2013 New Revision: 250134 URL: http://svnweb.freebsd.org/changeset/base/250134 Log: Import virgin regdef.h from 4.4 Lite 2's sys/pmax/include/regdef.h, expand the %sccs.include.redist.c% directive with the standard 3-clause license, and add $FreeBSD$ to keep the commit script happy. # This may break some mips stuff, which will be fixed in the next commit. Modified: head/sys/mips/include/regdef.h Modified: head/sys/mips/include/regdef.h ============================================================================== --- head/sys/mips/include/regdef.h Wed May 1 05:14:59 2013 (r250133) +++ head/sys/mips/include/regdef.h Wed May 1 05:46:54 2013 (r250134) @@ -1,86 +1,67 @@ -/*- - * Copyright (c) 2001, Juniper Networks, Inc. - * All rights reserved. - * Truman Joe, February 2001. +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. * - * regdef.h -- MIPS register definitions. + * This code is derived from software contributed to Berkeley by + * Ralph Campbell. This file is derived from the MIPS RISC + * Architecture book by Gerry Kane. * - * JNPR: regdef.h,v 1.3 2006/08/07 05:38:57 katta - * $FreeBSD$ - */ - -#ifndef _MACHINE_REGDEF_H_ -#define _MACHINE_REGDEF_H_ - -#include /* For API selection */ - -#if defined(__ASSEMBLER__) -/* General purpose CPU register names */ -#define zero $0 /* wired zero */ -#define AT $at /* assembler temp */ -#define v0 $2 /* return value */ -#define v1 $3 -#define a0 $4 /* argument registers */ -#define a1 $5 -#define a2 $6 -#define a3 $7 -#if defined(__mips_n32) || defined(__mips_n64) -#define a4 $8 -#define a5 $9 -#define a6 $10 -#define a7 $11 -#define t0 $12 /* Temp regs, not saved accross subroutine calls */ -#define t1 $13 -#define t2 $14 -#define t3 $15 -#else -#define t0 $8 /* caller saved */ -#define t1 $9 -#define t2 $10 -#define t3 $11 -#define t4 $12 /* caller saved - 32 bit env arg reg 64 bit */ -#define t5 $13 -#define t6 $14 -#define t7 $15 -#endif -#define s0 $16 /* callee saved */ -#define s1 $17 -#define s2 $18 -#define s3 $19 -#define s4 $20 -#define s5 $21 -#define s6 $22 -#define s7 $23 -#define t8 $24 /* code generator */ -#define t9 $25 -#define k0 $26 /* kernel temporary */ -#define k1 $27 -#define gp $28 /* global pointer */ -#define sp $29 /* stack pointer */ -#define fp $30 /* frame pointer */ -#define s8 $30 /* callee saved */ -#define ra $31 /* return address */ - -/* - * These are temp registers whose names can be used in either the old - * or new ABI, although they map to different physical registers. In - * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 - * should be used only when we need more than t0-t3. + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * @(#)regdef.h 8.1 (Berkeley) 06/10/93 + * $FreeBSD$ */ -#if defined(__mips_n32) || defined(__mips_n64) -#define ta0 $8 -#define ta1 $9 -#define ta2 $10 -#define ta3 $11 -#else -#define ta0 $12 -#define ta1 $13 -#define ta2 $14 -#define ta3 $15 -#endif /* __mips_n32 || __mips_n64 */ - -#endif /* __ASSEMBLER__ */ -#endif /* !_MACHINE_REGDEF_H_ */ +#define zero $0 /* always zero */ +#define AT $at /* assembler temp */ +#define v0 $2 /* return value */ +#define v1 $3 +#define a0 $4 /* argument registers */ +#define a1 $5 +#define a2 $6 +#define a3 $7 +#define t0 $8 /* temp registers (not saved across subroutine calls) */ +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#define s0 $16 /* saved across subroutine calls (callee saved) */ +#define s1 $17 +#define s2 $18 +#define s3 $19 +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +#define t8 $24 /* two more temp registers */ +#define t9 $25 +#define k0 $26 /* kernel temporary */ +#define k1 $27 +#define gp $28 /* global pointer */ +#define sp $29 /* stack pointer */ +#define s8 $30 /* one more callee saved */ +#define ra $31 /* return address */ From owner-svn-src-all@FreeBSD.ORG Wed May 1 05:48:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0E1FE15A; Wed, 1 May 2013 05:48:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01A841BE4; Wed, 1 May 2013 05:48:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r415mWUA089152; Wed, 1 May 2013 05:48:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r415mWCw089151; Wed, 1 May 2013 05:48:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010548.r415mWCw089151@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 05:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250135 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 05:48:33 -0000 Author: imp Date: Wed May 1 05:48:32 2013 New Revision: 250135 URL: http://svnweb.freebsd.org/changeset/base/250135 Log: Add the standard #ifdef header protection. Modified: head/sys/mips/include/regdef.h Modified: head/sys/mips/include/regdef.h ============================================================================== --- head/sys/mips/include/regdef.h Wed May 1 05:46:54 2013 (r250134) +++ head/sys/mips/include/regdef.h Wed May 1 05:48:32 2013 (r250135) @@ -33,6 +33,9 @@ * $FreeBSD$ */ +#ifndef _MIPS_INCLUDE_REGDEF_H_ +#define _MIPS_INCLUDE_REGDEF_H_ + #define zero $0 /* always zero */ #define AT $at /* assembler temp */ #define v0 $2 /* return value */ @@ -65,3 +68,5 @@ #define sp $29 /* stack pointer */ #define s8 $30 /* one more callee saved */ #define ra $31 /* return address */ + +#endif /* _MIPS_INCLUDE_REGDEF_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed May 1 05:55:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D403B32B for ; Wed, 1 May 2013 05:55:58 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) by mx1.freebsd.org (Postfix) with ESMTP id 5F3101C1A for ; Wed, 1 May 2013 05:55:58 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id fd20so1098418lab.11 for ; Tue, 30 Apr 2013 22:55:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=Gi8ii8ajnVx5+xKoVp+Ajyp/IeihWEn8g7jyvct7OmY=; b=bIes8XeZGp0R4WDQBxKfil3Q8rc0XoFmINkrjOrEQF/t5NOzSpEc3Vyo99DCukEweL R4a+PPGGQIROOpB2Zlet1OnvIQvcaQLPwZIVd60nKWmWO7d2mvZlmsligu4LKUg4rNjT QtIFGdptSOkPVflTwbNJ7nEBb+aU/eARMC2b22BCeM8dNUcHP2m0lD4hXEMmUKhFfQR7 ksBIfOp9613Gutnb/RXggKxakrR8qe1tVCEQMh8GZVI7S4IZSHiOfeFNtQ3RbkyC0nz3 8DSvPF+8J7WQw3/ONq9k21bm0A7tnh2T/B2cT48dR2TW4Vl0kixSIG0umbBkI4cfwsMg oYMg== X-Received: by 10.152.3.167 with SMTP id d7mr448341lad.53.1367387756660; Tue, 30 Apr 2013 22:55:56 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.28.196 with HTTP; Tue, 30 Apr 2013 22:55:36 -0700 (PDT) In-Reply-To: <201305010546.r415ktrA088822@svn.freebsd.org> References: <201305010546.r415ktrA088822@svn.freebsd.org> From: Juli Mallett Date: Tue, 30 Apr 2013 22:55:36 -0700 X-Google-Sender-Auth: uviF0PlGzwpSMj9EepZqazPPGvQ Message-ID: Subject: Re: svn commit: r250134 - head/sys/mips/include To: Warner Losh Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnzlrshN+TkD8XAXJ1eglYqXMmtos7cYX7WiN+ASxvYSbkYaBWj1wyviNoAqkYFN77wcm97 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 05:55:58 -0000 Warner, May I ask why you're bringing in the 4.4BSD version and not the NetBSD version, which already contained the appropriate ABI gunk? Do we really need to duplicate their work improving the file since 4.4BSD? Thanks, Juli. On Tue, Apr 30, 2013 at 10:46 PM, Warner Losh wrote: > Author: imp > Date: Wed May 1 05:46:54 2013 > New Revision: 250134 > URL: http://svnweb.freebsd.org/changeset/base/250134 > > Log: > Import virgin regdef.h from 4.4 Lite 2's sys/pmax/include/regdef.h, > expand the %sccs.include.redist.c% directive with the standard > 3-clause license, and add $FreeBSD$ to keep the commit script happy. > > # This may break some mips stuff, which will be fixed in the next commit. > > Modified: > head/sys/mips/include/regdef.h > > Modified: head/sys/mips/include/regdef.h > ============================================================================== > --- head/sys/mips/include/regdef.h Wed May 1 05:14:59 2013 (r250133) > +++ head/sys/mips/include/regdef.h Wed May 1 05:46:54 2013 (r250134) > @@ -1,86 +1,67 @@ > -/*- > - * Copyright (c) 2001, Juniper Networks, Inc. > - * All rights reserved. > - * Truman Joe, February 2001. > +/* > + * Copyright (c) 1992, 1993 > + * The Regents of the University of California. All rights reserved. > * > - * regdef.h -- MIPS register definitions. > + * This code is derived from software contributed to Berkeley by > + * Ralph Campbell. This file is derived from the MIPS RISC > + * Architecture book by Gerry Kane. > * > - * JNPR: regdef.h,v 1.3 2006/08/07 05:38:57 katta > - * $FreeBSD$ > - */ > - > -#ifndef _MACHINE_REGDEF_H_ > -#define _MACHINE_REGDEF_H_ > - > -#include /* For API selection */ > - > -#if defined(__ASSEMBLER__) > -/* General purpose CPU register names */ > -#define zero $0 /* wired zero */ > -#define AT $at /* assembler temp */ > -#define v0 $2 /* return value */ > -#define v1 $3 > -#define a0 $4 /* argument registers */ > -#define a1 $5 > -#define a2 $6 > -#define a3 $7 > -#if defined(__mips_n32) || defined(__mips_n64) > -#define a4 $8 > -#define a5 $9 > -#define a6 $10 > -#define a7 $11 > -#define t0 $12 /* Temp regs, not saved accross subroutine calls */ > -#define t1 $13 > -#define t2 $14 > -#define t3 $15 > -#else > -#define t0 $8 /* caller saved */ > -#define t1 $9 > -#define t2 $10 > -#define t3 $11 > -#define t4 $12 /* caller saved - 32 bit env arg reg 64 bit */ > -#define t5 $13 > -#define t6 $14 > -#define t7 $15 > -#endif > -#define s0 $16 /* callee saved */ > -#define s1 $17 > -#define s2 $18 > -#define s3 $19 > -#define s4 $20 > -#define s5 $21 > -#define s6 $22 > -#define s7 $23 > -#define t8 $24 /* code generator */ > -#define t9 $25 > -#define k0 $26 /* kernel temporary */ > -#define k1 $27 > -#define gp $28 /* global pointer */ > -#define sp $29 /* stack pointer */ > -#define fp $30 /* frame pointer */ > -#define s8 $30 /* callee saved */ > -#define ra $31 /* return address */ > - > -/* > - * These are temp registers whose names can be used in either the old > - * or new ABI, although they map to different physical registers. In > - * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. > + * 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. > + * 4. Neither the name of the University nor the names of its contributors > + * may be used to endorse or promote products derived from this software > + * without specific prior written permission. > * > - * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 > - * should be used only when we need more than t0-t3. > + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. > + * @(#)regdef.h 8.1 (Berkeley) 06/10/93 > + * $FreeBSD$ > */ > -#if defined(__mips_n32) || defined(__mips_n64) > -#define ta0 $8 > -#define ta1 $9 > -#define ta2 $10 > -#define ta3 $11 > -#else > -#define ta0 $12 > -#define ta1 $13 > -#define ta2 $14 > -#define ta3 $15 > -#endif /* __mips_n32 || __mips_n64 */ > - > -#endif /* __ASSEMBLER__ */ > > -#endif /* !_MACHINE_REGDEF_H_ */ > +#define zero $0 /* always zero */ > +#define AT $at /* assembler temp */ > +#define v0 $2 /* return value */ > +#define v1 $3 > +#define a0 $4 /* argument registers */ > +#define a1 $5 > +#define a2 $6 > +#define a3 $7 > +#define t0 $8 /* temp registers (not saved across subroutine calls) */ > +#define t1 $9 > +#define t2 $10 > +#define t3 $11 > +#define t4 $12 > +#define t5 $13 > +#define t6 $14 > +#define t7 $15 > +#define s0 $16 /* saved across subroutine calls (callee saved) */ > +#define s1 $17 > +#define s2 $18 > +#define s3 $19 > +#define s4 $20 > +#define s5 $21 > +#define s6 $22 > +#define s7 $23 > +#define t8 $24 /* two more temp registers */ > +#define t9 $25 > +#define k0 $26 /* kernel temporary */ > +#define k1 $27 > +#define gp $28 /* global pointer */ > +#define sp $29 /* stack pointer */ > +#define s8 $30 /* one more callee saved */ > +#define ra $31 /* return address */ From owner-svn-src-all@FreeBSD.ORG Wed May 1 06:00:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4641060F for ; Wed, 1 May 2013 06:00:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ia0-x22e.google.com (mail-ia0-x22e.google.com [IPv6:2607:f8b0:4001:c02::22e]) by mx1.freebsd.org (Postfix) with ESMTP id 12C841C7E for ; Wed, 1 May 2013 06:00:07 +0000 (UTC) Received: by mail-ia0-f174.google.com with SMTP id h23so1135920iae.33 for ; Tue, 30 Apr 2013 23:00:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=yIK6GE4FZSAhH4lkkivwjmEA+oPQRemaEnA/q2bdGgE=; b=TEPxZq6xM4P0nT2I+Nq9nP9fcWoms70+2jb+IP4CFXfs1Ifj3C3E8nrl8VP1YWAuT2 ZTO3yLW/XyrlWaWUAnE+jslY67Z9AfZsjXpQpYdlKnOtqQLNluaUYWtk++WmuB0mdaqQ zKqkDwtD8Pp4M27dTo82F+2ni8+Cpk9rcKa1azOrRltpwePIupXmOzaFrP1Z/A77dDk4 vuGt5FgpVeTywfAWHcSrtdL9OXxW6GX6/kFy++f+WS8j1Qa3bnUlJmhx7/0BlIjLSAoT 8XOcXcbPqqyUUeU8Kw9TIaUCrN9XGQF8sLGiIJXTUyjE2MfbBCJQO7Gm4Ekc4J7YabPa 6KMQ== X-Received: by 10.50.17.71 with SMTP id m7mr1097901igd.5.1367388006710; Tue, 30 Apr 2013 23:00:06 -0700 (PDT) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id c2sm26459842igv.1.2013.04.30.23.00.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 23:00:05 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r250134 - head/sys/mips/include Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Wed, 1 May 2013 00:00:04 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <6739A162-749B-4BDF-B5FA-E36235EF404A@bsdimp.com> References: <201305010546.r415ktrA088822@svn.freebsd.org> To: Juli Mallett X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQmv21eqRHmE9tYHN41VpRKAUjOT4BvyM/OlzF63PBCOk1JgycgMfDZcQ3A1BwzkV56Fn/ww Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 06:00:07 -0000 On Apr 30, 2013, at 11:55 PM, Juli Mallett wrote: > Warner, >=20 > May I ask why you're bringing in the 4.4BSD version and not the NetBSD > version, which already contained the appropriate ABI gunk? Do we > really need to duplicate their work improving the file since 4.4BSD? The NetBSD version didn't have the CSRG copyright, so I wanted to create = a clear chain of modifications. I'll be done with that within the = hour.... But it turns out I was confused about which file lacked a copyright (I = was also looking at elf_machdep.h), so I'll just bring NetBSD's in now. = Sorry for the churn... Warner > Thanks, > Juli. >=20 > On Tue, Apr 30, 2013 at 10:46 PM, Warner Losh wrote: >> Author: imp >> Date: Wed May 1 05:46:54 2013 >> New Revision: 250134 >> URL: http://svnweb.freebsd.org/changeset/base/250134 >>=20 >> Log: >> Import virgin regdef.h from 4.4 Lite 2's sys/pmax/include/regdef.h, >> expand the %sccs.include.redist.c% directive with the standard >> 3-clause license, and add $FreeBSD$ to keep the commit script happy. >>=20 >> # This may break some mips stuff, which will be fixed in the next = commit. >>=20 >> Modified: >> head/sys/mips/include/regdef.h >>=20 >> Modified: head/sys/mips/include/regdef.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/mips/include/regdef.h Wed May 1 05:14:59 2013 = (r250133) >> +++ head/sys/mips/include/regdef.h Wed May 1 05:46:54 2013 = (r250134) >> @@ -1,86 +1,67 @@ >> -/*- >> - * Copyright (c) 2001, Juniper Networks, Inc. >> - * All rights reserved. >> - * Truman Joe, February 2001. >> +/* >> + * Copyright (c) 1992, 1993 >> + * The Regents of the University of California. All rights = reserved. >> * >> - * regdef.h -- MIPS register definitions. >> + * This code is derived from software contributed to Berkeley by >> + * Ralph Campbell. This file is derived from the MIPS RISC >> + * Architecture book by Gerry Kane. >> * >> - * JNPR: regdef.h,v 1.3 2006/08/07 05:38:57 katta >> - * $FreeBSD$ >> - */ >> - >> -#ifndef _MACHINE_REGDEF_H_ >> -#define _MACHINE_REGDEF_H_ >> - >> -#include /* For API selection */ >> - >> -#if defined(__ASSEMBLER__) >> -/* General purpose CPU register names */ >> -#define zero $0 /* wired zero */ >> -#define AT $at /* assembler temp */ >> -#define v0 $2 /* return value */ >> -#define v1 $3 >> -#define a0 $4 /* argument registers */ >> -#define a1 $5 >> -#define a2 $6 >> -#define a3 $7 >> -#if defined(__mips_n32) || defined(__mips_n64) >> -#define a4 $8 >> -#define a5 $9 >> -#define a6 $10 >> -#define a7 $11 >> -#define t0 $12 /* Temp regs, not saved accross = subroutine calls */ >> -#define t1 $13 >> -#define t2 $14 >> -#define t3 $15 >> -#else >> -#define t0 $8 /* caller saved */ >> -#define t1 $9 >> -#define t2 $10 >> -#define t3 $11 >> -#define t4 $12 /* caller saved - 32 bit env arg reg = 64 bit */ >> -#define t5 $13 >> -#define t6 $14 >> -#define t7 $15 >> -#endif >> -#define s0 $16 /* callee saved */ >> -#define s1 $17 >> -#define s2 $18 >> -#define s3 $19 >> -#define s4 $20 >> -#define s5 $21 >> -#define s6 $22 >> -#define s7 $23 >> -#define t8 $24 /* code generator */ >> -#define t9 $25 >> -#define k0 $26 /* kernel temporary */ >> -#define k1 $27 >> -#define gp $28 /* global pointer */ >> -#define sp $29 /* stack pointer */ >> -#define fp $30 /* frame pointer */ >> -#define s8 $30 /* callee saved */ >> -#define ra $31 /* return address */ >> - >> -/* >> - * These are temp registers whose names can be used in either the = old >> - * or new ABI, although they map to different physical registers. = In >> - * the old ABI, they map to t4-t7, and in the new ABI, they map to = a4-a7. >> + * 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. >> + * 4. Neither the name of the University nor the names of its = contributors >> + * may be used to endorse or promote products derived from this = software >> + * without specific prior written permission. >> * >> - * Because they overlap with the last 4 arg regs in the new ABI, = ta0-ta3 >> - * should be used only when we need more than t0-t3. >> + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. >> + * @(#)regdef.h 8.1 (Berkeley) 06/10/93 >> + * $FreeBSD$ >> */ >> -#if defined(__mips_n32) || defined(__mips_n64) >> -#define ta0 $8 >> -#define ta1 $9 >> -#define ta2 $10 >> -#define ta3 $11 >> -#else >> -#define ta0 $12 >> -#define ta1 $13 >> -#define ta2 $14 >> -#define ta3 $15 >> -#endif /* __mips_n32 || __mips_n64 */ >> - >> -#endif /* __ASSEMBLER__ */ >>=20 >> -#endif /* !_MACHINE_REGDEF_H_ */ >> +#define zero $0 /* always zero */ >> +#define AT $at /* assembler temp */ >> +#define v0 $2 /* return value */ >> +#define v1 $3 >> +#define a0 $4 /* argument registers */ >> +#define a1 $5 >> +#define a2 $6 >> +#define a3 $7 >> +#define t0 $8 /* temp registers (not saved across = subroutine calls) */ >> +#define t1 $9 >> +#define t2 $10 >> +#define t3 $11 >> +#define t4 $12 >> +#define t5 $13 >> +#define t6 $14 >> +#define t7 $15 >> +#define s0 $16 /* saved across subroutine calls (callee = saved) */ >> +#define s1 $17 >> +#define s2 $18 >> +#define s3 $19 >> +#define s4 $20 >> +#define s5 $21 >> +#define s6 $22 >> +#define s7 $23 >> +#define t8 $24 /* two more temp registers */ >> +#define t9 $25 >> +#define k0 $26 /* kernel temporary */ >> +#define k1 $27 >> +#define gp $28 /* global pointer */ >> +#define sp $29 /* stack pointer */ >> +#define s8 $30 /* one more callee saved */ >> +#define ra $31 /* return address */ From owner-svn-src-all@FreeBSD.ORG Wed May 1 06:22:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D30E79BC; Wed, 1 May 2013 06:22:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C48F31D36; Wed, 1 May 2013 06:22:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r416MoDZ002402; Wed, 1 May 2013 06:22:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r416Mo5L002401; Wed, 1 May 2013 06:22:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010622.r416Mo5L002401@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 06:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250136 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 06:22:50 -0000 Author: imp Date: Wed May 1 06:22:50 2013 New Revision: 250136 URL: http://svnweb.freebsd.org/changeset/base/250136 Log: Import NetBSD's version, which is perfectly fine. Submitted by: jmallet@ Modified: head/sys/mips/include/regdef.h Modified: head/sys/mips/include/regdef.h ============================================================================== --- head/sys/mips/include/regdef.h Wed May 1 05:48:32 2013 (r250135) +++ head/sys/mips/include/regdef.h Wed May 1 06:22:50 2013 (r250136) @@ -1,6 +1,8 @@ +/* $NetBSD: regdef.h,v 1.12 2005/12/11 12:18:09 christos Exp $ */ + /* * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Ralph Campbell. This file is derived from the MIPS RISC @@ -14,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -29,44 +31,80 @@ * 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. - * @(#)regdef.h 8.1 (Berkeley) 06/10/93 + * + * @(#)regdef.h 8.1 (Berkeley) 6/10/93 * $FreeBSD$ */ -#ifndef _MIPS_INCLUDE_REGDEF_H_ -#define _MIPS_INCLUDE_REGDEF_H_ +#ifndef _MIPS_REGDEF_H +#define _MIPS_REGDEF_H + +#include /* for API selection */ + +#if defined(__ASSEMBLER__) +#define zero $0 /* always zero */ +#define AT $at /* assembler temporary */ +#define v0 $2 /* return value */ +#define v1 $3 +#define a0 $4 /* argument registers */ +#define a1 $5 +#define a2 $6 +#define a3 $7 +#if defined(__mips_n32) || defined(__mips_n64) +#define a4 $8 +#define a5 $9 +#define a6 $10 +#define a7 $11 +#define t0 $12 /* temp registers (not saved across subroutine calls) */ +#define t1 $13 +#define t2 $14 +#define t3 $15 +#else +#define t0 $8 /* temp registers (not saved across subroutine calls) */ +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#endif /* __mips_n32 || __mips_n64 */ +#define s0 $16 /* saved across subroutine calls (callee saved) */ +#define s1 $17 +#define s2 $18 +#define s3 $19 +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +#define t8 $24 /* two more temporary registers */ +#define t9 $25 +#define k0 $26 /* kernel temporary */ +#define k1 $27 +#define gp $28 /* global pointer */ +#define sp $29 /* stack pointer */ +#define s8 $30 /* one more callee saved */ +#define ra $31 /* return address */ -#define zero $0 /* always zero */ -#define AT $at /* assembler temp */ -#define v0 $2 /* return value */ -#define v1 $3 -#define a0 $4 /* argument registers */ -#define a1 $5 -#define a2 $6 -#define a3 $7 -#define t0 $8 /* temp registers (not saved across subroutine calls) */ -#define t1 $9 -#define t2 $10 -#define t3 $11 -#define t4 $12 -#define t5 $13 -#define t6 $14 -#define t7 $15 -#define s0 $16 /* saved across subroutine calls (callee saved) */ -#define s1 $17 -#define s2 $18 -#define s3 $19 -#define s4 $20 -#define s5 $21 -#define s6 $22 -#define s7 $23 -#define t8 $24 /* two more temp registers */ -#define t9 $25 -#define k0 $26 /* kernel temporary */ -#define k1 $27 -#define gp $28 /* global pointer */ -#define sp $29 /* stack pointer */ -#define s8 $30 /* one more callee saved */ -#define ra $31 /* return address */ +/* + * These are temp registers whose names can be used in either the old + * or new ABI, although they map to different physical registers. In + * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. + * + * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 + * should be used only when we need more than t0-t3. + */ +#if defined(__mips_n32) || defined(__mips_n64) +#define ta0 $8 +#define ta1 $9 +#define ta2 $10 +#define ta3 $11 +#else +#define ta0 $12 +#define ta1 $13 +#define ta2 $14 +#define ta3 $15 +#endif /* __mips_n32 || __mips_n64 */ -#endif /* _MIPS_INCLUDE_REGDEF_H_ */ +#endif /* __ASSEMBLER__ */ +#endif /* _MIPS_REGDEF_H */ From owner-svn-src-all@FreeBSD.ORG Wed May 1 06:55:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 61DD2FA6; Wed, 1 May 2013 06:55:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 534141E61; Wed, 1 May 2013 06:55:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r416tEoW013137; Wed, 1 May 2013 06:55:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r416tEAE013136; Wed, 1 May 2013 06:55:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010655.r416tEAE013136@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 06:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250137 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 06:55:14 -0000 Author: imp Date: Wed May 1 06:55:13 2013 New Revision: 250137 URL: http://svnweb.freebsd.org/changeset/base/250137 Log: Remove asm.h dependency in a hackish way. Fixed comment. Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Wed May 1 06:22:50 2013 (r250136) +++ head/sys/mips/mips/vm_machdep.c Wed May 1 06:55:13 2013 (r250137) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -83,6 +82,18 @@ __FBSDID("$FreeBSD$"); #define NSFBUFS (512 + maxusers * 16) #endif +/* Duplicated from asm.h */ +#if defined(__mips_o32) +#define SZREG 4 +#else +#define SZREG 8 +#endif +#if defined(__mips_o32) || defined(__mips_o64) +#define CALLFRAME_SIZ (SZREG * (4 + 2)) +#elif defined(__mips_n32) || defined(__mips_n64) +#define CALLFRAME_SIZ (SZREG * 4) +#endif + #ifndef __mips_n64 static void sf_buf_init(void *arg); SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); @@ -437,10 +448,11 @@ cpu_set_upcall_kse(struct thread *td, vo register_t sp; /* - * At the point where a function is called, sp must be 8 - * byte aligned[for compatibility with 64-bit CPUs] - * in ``See MIPS Run'' by D. Sweetman, p. 269 - * align stack */ + * At the point where a function is called, sp must be 8 + * byte aligned[for compatibility with 64-bit CPUs] + * in ``See MIPS Run'' by D. Sweetman, p. 269 + * align stack + */ sp = ((register_t)(intptr_t)(stack->ss_sp + stack->ss_size) & ~0x7) - CALLFRAME_SIZ; From owner-svn-src-all@FreeBSD.ORG Wed May 1 06:57:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9FF161E4; Wed, 1 May 2013 06:57:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80B8E1E8D; Wed, 1 May 2013 06:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r416vl48013606; Wed, 1 May 2013 06:57:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r416vkwh013600; Wed, 1 May 2013 06:57:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010657.r416vkwh013600@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 06:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250138 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 06:57:47 -0000 Author: imp Date: Wed May 1 06:57:46 2013 New Revision: 250138 URL: http://svnweb.freebsd.org/changeset/base/250138 Log: Don't include asm.h in non-asm files. Remove #define to get kludges that asm.h used to define Move clever macros to access assembler instructions to trap.c Remove __ASSEMBLER__ ifdefs in regdef.h: they aren't needed anymore. Modified: head/sys/mips/include/asm.h head/sys/mips/include/regdef.h head/sys/mips/mips/db_interface.c head/sys/mips/mips/trap.c Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Wed May 1 06:55:13 2013 (r250137) +++ head/sys/mips/include/asm.h Wed May 1 06:57:46 2013 (r250138) @@ -56,9 +56,7 @@ #ifndef _MACHINE_ASM_H_ #define _MACHINE_ASM_H_ -#ifndef NO_REG_DEFS #include -#endif #include #include @@ -111,26 +109,6 @@ #define WARN_REFERENCES(_sym,_msg) \ .section .gnu.warning. ## _sym ; .ascii _msg ; .text -/* - * These are temp registers whose names can be used in either the old - * or new ABI, although they map to different physical registers. In - * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. - * - * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 - * should be used only when we need more than t0-t3. - */ -#if defined(__mips_n32) || defined(__mips_n64) -#define ta0 $8 -#define ta1 $9 -#define ta2 $10 -#define ta3 $11 -#else -#define ta0 $12 -#define ta1 $13 -#define ta2 $14 -#define ta3 $15 -#endif /* __mips_n32 || __mips_n64 */ - #ifdef __ELF__ # define _C_LABEL(x) x #else @@ -674,97 +652,6 @@ _C_LABEL(x): #define USE_ALT_CP(a) .cplocal a #endif /* __mips_n32 || __mips_n64 */ -#define mfc0_macro(data, spr) \ - __asm __volatile ("mfc0 %0, $%1" \ - : "=r" (data) /* outputs */ \ - : "i" (spr)); /* inputs */ - -#define mtc0_macro(data, spr) \ - __asm __volatile ("mtc0 %0, $%1" \ - : /* outputs */ \ - : "r" (data), "i" (spr)); /* inputs */ - -#define cfc0_macro(data, spr) \ - __asm __volatile ("cfc0 %0, $%1" \ - : "=r" (data) /* outputs */ \ - : "i" (spr)); /* inputs */ - -#define ctc0_macro(data, spr) \ - __asm __volatile ("ctc0 %0, $%1" \ - : /* outputs */ \ - : "r" (data), "i" (spr)); /* inputs */ - - -#define lbu_macro(data, addr) \ - __asm __volatile ("lbu %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define lb_macro(data, addr) \ - __asm __volatile ("lb %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define lwl_macro(data, addr) \ - __asm __volatile ("lwl %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define lwr_macro(data, addr) \ - __asm __volatile ("lwr %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define ldl_macro(data, addr) \ - __asm __volatile ("ldl %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define ldr_macro(data, addr) \ - __asm __volatile ("ldr %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define sb_macro(data, addr) \ - __asm __volatile ("sb %0, 0x0(%1)" \ - : /* outputs */ \ - : "r" (data), "r" (addr)); /* inputs */ - -#define swl_macro(data, addr) \ - __asm __volatile ("swl %0, 0x0(%1)" \ - : /* outputs */ \ - : "r" (data), "r" (addr)); /* inputs */ - -#define swr_macro(data, addr) \ - __asm __volatile ("swr %0, 0x0(%1)" \ - : /* outputs */ \ - : "r" (data), "r" (addr)); /* inputs */ - -#define sdl_macro(data, addr) \ - __asm __volatile ("sdl %0, 0x0(%1)" \ - : /* outputs */ \ - : "r" (data), "r" (addr)); /* inputs */ - -#define sdr_macro(data, addr) \ - __asm __volatile ("sdr %0, 0x0(%1)" \ - : /* outputs */ \ - : "r" (data), "r" (addr)); /* inputs */ - -#define mfgr_macro(data, gr) \ - __asm __volatile ("move %0, $%1" \ - : "=r" (data) /* outputs */ \ - : "i" (gr)); /* inputs */ - -#define dmfc0_macro(data, spr) \ - __asm __volatile ("dmfc0 %0, $%1" \ - : "=r" (data) /* outputs */ \ - : "i" (spr)); /* inputs */ - -#define dmtc0_macro(data, spr, sel) \ - __asm __volatile ("dmtc0 %0, $%1, %2" \ - : /* no outputs */ \ - : "r" (data), "i" (spr), "i" (sel)); /* inputs */ - #define GET_CPU_PCPU(reg) \ PTR_L reg, _C_LABEL(pcpup); Modified: head/sys/mips/include/regdef.h ============================================================================== --- head/sys/mips/include/regdef.h Wed May 1 06:55:13 2013 (r250137) +++ head/sys/mips/include/regdef.h Wed May 1 06:57:46 2013 (r250138) @@ -41,7 +41,6 @@ #include /* for API selection */ -#if defined(__ASSEMBLER__) #define zero $0 /* always zero */ #define AT $at /* assembler temporary */ #define v0 $2 /* return value */ @@ -106,5 +105,4 @@ #define ta3 $15 #endif /* __mips_n32 || __mips_n64 */ -#endif /* __ASSEMBLER__ */ #endif /* _MIPS_REGDEF_H */ Modified: head/sys/mips/mips/db_interface.c ============================================================================== --- head/sys/mips/mips/db_interface.c Wed May 1 06:55:13 2013 (r250137) +++ head/sys/mips/mips/db_interface.c Wed May 1 06:57:46 2013 (r250138) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define NO_REG_DEFS 1 /* Prevent asm.h from including regdef.h */ -#include #include #include Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Wed May 1 06:55:13 2013 (r250137) +++ head/sys/mips/mips/trap.c Wed May 1 06:57:46 2013 (r250138) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" #include "opt_kdtrace.h" -#define NO_REG_DEFS 1 /* Prevent asm.h from including regdef.h */ #include #include #include @@ -85,7 +84,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef DDB #include @@ -127,6 +125,61 @@ SYSCTL_INT(_machdep, OID_AUTO, trap_debu &trap_debug, 0, "Debug information on all traps"); #endif +#define lbu_macro(data, addr) \ + __asm __volatile ("lbu %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define lb_macro(data, addr) \ + __asm __volatile ("lb %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define lwl_macro(data, addr) \ + __asm __volatile ("lwl %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define lwr_macro(data, addr) \ + __asm __volatile ("lwr %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define ldl_macro(data, addr) \ + __asm __volatile ("ldl %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define ldr_macro(data, addr) \ + __asm __volatile ("ldr %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define sb_macro(data, addr) \ + __asm __volatile ("sb %0, 0x0(%1)" \ + : /* outputs */ \ + : "r" (data), "r" (addr)); /* inputs */ + +#define swl_macro(data, addr) \ + __asm __volatile ("swl %0, 0x0(%1)" \ + : /* outputs */ \ + : "r" (data), "r" (addr)); /* inputs */ + +#define swr_macro(data, addr) \ + __asm __volatile ("swr %0, 0x0(%1)" \ + : /* outputs */ \ + : "r" (data), "r" (addr)); /* inputs */ + +#define sdl_macro(data, addr) \ + __asm __volatile ("sdl %0, 0x0(%1)" \ + : /* outputs */ \ + : "r" (data), "r" (addr)); /* inputs */ + +#define sdr_macro(data, addr) \ + __asm __volatile ("sdr %0, 0x0(%1)" \ + : /* outputs */ \ + : "r" (data), "r" (addr)); /* inputs */ + static void log_illegal_instruction(const char *, struct trapframe *); static void log_bad_page_fault(char *, struct trapframe *, int); static void log_frame_dump(struct trapframe *frame); From owner-svn-src-all@FreeBSD.ORG Wed May 1 07:13:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 110EE596; Wed, 1 May 2013 07:13:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03C9E1F14; Wed, 1 May 2013 07:13:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r417Dadg020227; Wed, 1 May 2013 07:13:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r417DahS020226; Wed, 1 May 2013 07:13:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010713.r417DahS020226@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 07:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250139 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 07:13:37 -0000 Author: imp Date: Wed May 1 07:13:36 2013 New Revision: 250139 URL: http://svnweb.freebsd.org/changeset/base/250139 Log: Add a historic footnote. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed May 1 06:57:46 2013 (r250138) +++ head/UPDATING Wed May 1 07:13:36 2013 (r250139) @@ -291,7 +291,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 is now spelled mips64. mipsn32eb is now spelled mipsn32. mipseb is now spelled mips. This is to aid compatibility with third-party software that expects this naming scheme in uname(3). Little-endian - settings are unchanged. + settings are unchanged. If you are updating a big-endian mips64 machine + from before this change, you may need to set MACHINE_ARCH=mips64 in + your environment before the new build system will recognize your machine. 20120306: Disable by default the option VFS_ALLOW_NONMPSAFE for all supported From owner-svn-src-all@FreeBSD.ORG Wed May 1 08:53:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D2362D1B; Wed, 1 May 2013 08:53:40 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C4B141260; Wed, 1 May 2013 08:53:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r418reDg055440; Wed, 1 May 2013 08:53:40 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r418rejw055438; Wed, 1 May 2013 08:53:40 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201305010853.r418rejw055438@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 1 May 2013 08:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250140 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 08:53:40 -0000 Author: lstewart Date: Wed May 1 08:53:40 2013 New Revision: 250140 URL: http://svnweb.freebsd.org/changeset/base/250140 Log: MFC r245783: Simplify and fix a bug in cc_ack_received()'s "are we congestion window limited" logic (refer to [1] for associated discussion). snd_cwnd and snd_wnd are unsigned long and on 64 bit hosts, min() will truncate them to 32 bits and could therefore potentially corrupt the result (although under normal operation, neither variable should legitmately exceed 32 bits). [1] http://lists.freebsd.org/pipermail/freebsd-net/2013-January/034297.html Submitted by: jhb Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Wed May 1 07:13:36 2013 (r250139) +++ stable/9/sys/netinet/tcp_input.c Wed May 1 08:53:40 2013 (r250140) @@ -269,7 +269,7 @@ cc_ack_received(struct tcpcb *tp, struct INP_WLOCK_ASSERT(tp->t_inpcb); tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th); - if (tp->snd_cwnd == min(tp->snd_cwnd, tp->snd_wnd)) + if (tp->snd_cwnd <= tp->snd_wnd) tp->ccv->flags |= CCF_CWND_LIMITED; else tp->ccv->flags &= ~CCF_CWND_LIMITED; From owner-svn-src-all@FreeBSD.ORG Wed May 1 08:57:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 66E58EE3; Wed, 1 May 2013 08:57:46 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 596611280; Wed, 1 May 2013 08:57:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r418vkc2056280; Wed, 1 May 2013 08:57:46 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r418vkWk056279; Wed, 1 May 2013 08:57:46 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201305010857.r418vkWk056279@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 1 May 2013 08:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250141 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 08:57:46 -0000 Author: lstewart Date: Wed May 1 08:57:45 2013 New Revision: 250141 URL: http://svnweb.freebsd.org/changeset/base/250141 Log: MFC r245783: Simplify and fix a bug in cc_ack_received()'s "are we congestion window limited" logic (refer to [1] for associated discussion). snd_cwnd and snd_wnd are unsigned long and on 64 bit hosts, min() will truncate them to 32 bits and could therefore potentially corrupt the result (although under normal operation, neither variable should legitmately exceed 32 bits). [1] http://lists.freebsd.org/pipermail/freebsd-net/2013-January/034297.html Submitted by: jhb Modified: stable/8/sys/netinet/tcp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Wed May 1 08:53:40 2013 (r250140) +++ stable/8/sys/netinet/tcp_input.c Wed May 1 08:57:45 2013 (r250141) @@ -269,7 +269,7 @@ cc_ack_received(struct tcpcb *tp, struct INP_WLOCK_ASSERT(tp->t_inpcb); tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th); - if (tp->snd_cwnd == min(tp->snd_cwnd, tp->snd_wnd)) + if (tp->snd_cwnd <= tp->snd_wnd) tp->ccv->flags |= CCF_CWND_LIMITED; else tp->ccv->flags &= ~CCF_CWND_LIMITED; From owner-svn-src-all@FreeBSD.ORG Wed May 1 09:20:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23895550; Wed, 1 May 2013 09:20:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15A2A1380; Wed, 1 May 2013 09:20:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r419KD8L064309; Wed, 1 May 2013 09:20:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r419KD32064308; Wed, 1 May 2013 09:20:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305010920.r419KD32064308@svn.freebsd.org> From: Alexander Motin Date: Wed, 1 May 2013 09:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250142 - stable/9/sys/dev/usb/storage X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 09:20:14 -0000 Author: mav Date: Wed May 1 09:20:13 2013 New Revision: 250142 URL: http://svnweb.freebsd.org/changeset/base/250142 Log: MFC r245328: Freeze device queue before returning errors to CAM. This is required for proper error recovery, including keeping original request order. Modified: stable/9/sys/dev/usb/storage/umass.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/storage/umass.c ============================================================================== --- stable/9/sys/dev/usb/storage/umass.c Wed May 1 08:57:45 2013 (r250141) +++ stable/9/sys/dev/usb/storage/umass.c Wed May 1 09:20:13 2013 (r250142) @@ -2251,8 +2251,11 @@ umass_cam_action(struct cam_sim *sim, un /*ascq*/ 0x00, /*extra args*/ SSD_ELEM_NONE); ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; - ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | - CAM_AUTOSNS_VALID; + ccb->ccb_h.status = + CAM_SCSI_STATUS_ERROR | + CAM_AUTOSNS_VALID | + CAM_DEV_QFRZN; + xpt_freeze_devq(ccb->ccb_h.path, 1); xpt_done(ccb); goto done; } @@ -2512,7 +2515,8 @@ umass_cam_cb(struct umass_softc *sc, uni * recovered. We return an error to CAM and let CAM * retry the command if necessary. */ - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + xpt_freeze_devq(ccb->ccb_h.path, 1); + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; xpt_done(ccb); break; } @@ -2575,8 +2579,9 @@ umass_cam_sense_cb(struct umass_softc *s * usual. */ + xpt_freeze_devq(ccb->ccb_h.path, 1); ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR - | CAM_AUTOSNS_VALID; + | CAM_AUTOSNS_VALID | CAM_DEV_QFRZN; ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; #if 0 @@ -2587,17 +2592,18 @@ umass_cam_sense_cb(struct umass_softc *s /* the rest of the command was filled in at attach */ - if (umass_std_transform(sc, ccb, + if ((sc->sc_transform)(sc, &sc->cam_scsi_test_unit_ready.opcode, - sizeof(sc->cam_scsi_test_unit_ready))) { + sizeof(sc->cam_scsi_test_unit_ready)) == 1) { umass_command_start(sc, DIR_NONE, NULL, 0, ccb->ccb_h.timeout, &umass_cam_quirk_cb, ccb); + break; } - break; } else { + xpt_freeze_devq(ccb->ccb_h.path, 1); ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR - | CAM_AUTOSNS_VALID; + | CAM_AUTOSNS_VALID | CAM_DEV_QFRZN; ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; } xpt_done(ccb); @@ -2606,15 +2612,16 @@ umass_cam_sense_cb(struct umass_softc *s default: DPRINTF(sc, UDMASS_SCSI, "Autosense failed, " "status %d\n", status); - ccb->ccb_h.status = CAM_AUTOSENSE_FAIL; + xpt_freeze_devq(ccb->ccb_h.path, 1); + ccb->ccb_h.status = CAM_AUTOSENSE_FAIL | CAM_DEV_QFRZN; xpt_done(ccb); } } /* * This completion code just handles the fact that we sent a test-unit-ready - * after having previously failed a READ CAPACITY with CHECK_COND. Even - * though this command succeeded, we have to tell CAM to retry. + * after having previously failed a READ CAPACITY with CHECK_COND. The CCB + * status for CAM is already set earlier. */ static void umass_cam_quirk_cb(struct umass_softc *sc, union ccb *ccb, uint32_t residue, @@ -2623,9 +2630,6 @@ umass_cam_quirk_cb(struct umass_softc *s DPRINTF(sc, UDMASS_SCSI, "Test unit ready " "returned status %d\n", status); - ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR - | CAM_AUTOSNS_VALID; - ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; xpt_done(ccb); } @@ -2914,7 +2918,8 @@ umass_std_transform(struct umass_softc * xpt_done(ccb); return (0); } else if (retval == 0) { - ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_freeze_devq(ccb->ccb_h.path, 1); + ccb->ccb_h.status = CAM_REQ_INVALID | CAM_DEV_QFRZN; xpt_done(ccb); return (0); } From owner-svn-src-all@FreeBSD.ORG Wed May 1 09:56:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01C90D6A; Wed, 1 May 2013 09:56:09 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E78ED14F0; Wed, 1 May 2013 09:56:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r419u9MO077407; Wed, 1 May 2013 09:56:09 GMT (envelope-from benno@svn.freebsd.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r419u996077406; Wed, 1 May 2013 09:56:09 GMT (envelope-from benno@svn.freebsd.org) Message-Id: <201305010956.r419u996077406@svn.freebsd.org> From: Benno Rice Date: Wed, 1 May 2013 09:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250143 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 09:56:10 -0000 Author: benno Date: Wed May 1 09:56:09 2013 New Revision: 250143 URL: http://svnweb.freebsd.org/changeset/base/250143 Log: Optimize SUBDIR_OVERRIDE such that SUBDIR isn't automatically defined if SUBDIR_OVERRIDE is defined. PR: conf/174071 Submitted by: Garrett Cooper Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 1 09:20:13 2013 (r250142) +++ head/Makefile.inc1 Wed May 1 09:56:09 2013 (r250143) @@ -58,6 +58,9 @@ # use that new version. And the new (dynamically-linked) /bin/sh # will expect to find appropriate libraries in /lib and /libexec. # +.if defined(SUBDIR_OVERRIDE) +SUBDIR= ${SUBDIR_OVERRIDE} +.else SUBDIR= share/info lib libexec SUBDIR+=bin .if ${MK_GAMES} != "no" @@ -96,9 +99,6 @@ SUBDIR+=etc SUBDIR+= ${_DIR} .endif .endfor - -.if defined(SUBDIR_OVERRIDE) -SUBDIR= ${SUBDIR_OVERRIDE} .endif .if defined(NOCLEAN) From owner-svn-src-all@FreeBSD.ORG Wed May 1 10:47:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B38C23A3; Wed, 1 May 2013 10:47:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 40A3316A6; Wed, 1 May 2013 10:47:06 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r41Al4dk019148; Wed, 1 May 2013 14:47:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r41Al4Xx019147; Wed, 1 May 2013 14:47:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 1 May 2013 14:47:04 +0400 From: Gleb Smirnoff To: Sergey Kandaurov Subject: Re: svn commit: r250105 - head/sys/dev/hwpmc Message-ID: <20130501104704.GD15182@FreeBSD.org> References: <201304301559.r3UFxM88094038@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Davide Italiano , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 10:47:07 -0000 On Tue, Apr 30, 2013 at 08:10:17PM +0400, Sergey Kandaurov wrote: S> On 30 April 2013 19:59, Davide Italiano wrote: S> > Author: davide S> > Date: Tue Apr 30 15:59:22 2013 S> > New Revision: 250105 S> > URL: http://svnweb.freebsd.org/changeset/base/250105 S> > S> > Log: S> > malloc(9) cannot return NULL if M_WAITOK flag is specified. S> > S> > Modified: S> > head/sys/dev/hwpmc/hwpmc_mod.c S> > head/sys/dev/hwpmc/hwpmc_soft.c S> > S> > Modified: head/sys/dev/hwpmc/hwpmc_mod.c S> > ============================================================================== S> > --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:38:31 2013 (r250104) S> > +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:59:22 2013 (r250105) S> > @@ -2210,11 +2210,8 @@ pmc_allocate_pmc_descriptor(void) S> > struct pmc *pmc; S> > S> > pmc = malloc(sizeof(struct pmc), M_PMC, M_WAITOK|M_ZERO); S> > - S> > - if (pmc != NULL) { S> > - pmc->pm_owner = NULL; S> > - LIST_INIT(&pmc->pm_targets); S> > - } S> > + pmc->pm_owner = NULL; S> > + LIST_INIT(&pmc->pm_targets); S> > S> > PMCDBG(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc); S> S> It looks like zeroing pm_owner can also be omitted with M_ZERO. LIST_INIT is also an assignment of zero. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed May 1 11:10:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E070935; Wed, 1 May 2013 11:10:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4548417A9; Wed, 1 May 2013 11:10:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41BAGhv002759; Wed, 1 May 2013 11:10:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41BAFXT002756; Wed, 1 May 2013 11:10:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305011110.r41BAFXT002756@svn.freebsd.org> From: Alexander Motin Date: Wed, 1 May 2013 11:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250144 - in stable/9/sys: cam/scsi dev/usb/storage X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 11:10:16 -0000 Author: mav Date: Wed May 1 11:10:15 2013 New Revision: 250144 URL: http://svnweb.freebsd.org/changeset/base/250144 Log: MFC r245647 (by kan): Do not pretend to have autosense data when no such data is available. Make umass return an error code if SCSI sense retrieval request has failed. Make sure scsi_error_action honors SF_NO_RETRY and SF_NO_RECOVERY in all cases, even if it cannot parse sense bytes. Modified: stable/9/sys/cam/scsi/scsi_all.c stable/9/sys/dev/usb/storage/umass.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.c Wed May 1 09:56:09 2013 (r250143) +++ stable/9/sys/cam/scsi/scsi_all.c Wed May 1 11:10:15 2013 (r250144) @@ -3071,16 +3071,15 @@ scsi_error_action(struct ccb_scsiio *csi SSQ_PRINT_SENSE; } } - if ((action & SS_MASK) >= SS_START && - (sense_flags & SF_NO_RECOVERY)) { - action &= ~SS_MASK; - action |= SS_FAIL; - } else if ((action & SS_MASK) == SS_RETRY && - (sense_flags & SF_NO_RETRY)) { - action &= ~SS_MASK; - action |= SS_FAIL; - } - + } + if ((action & SS_MASK) >= SS_START && + (sense_flags & SF_NO_RECOVERY)) { + action &= ~SS_MASK; + action |= SS_FAIL; + } else if ((action & SS_MASK) == SS_RETRY && + (sense_flags & SF_NO_RETRY)) { + action &= ~SS_MASK; + action |= SS_FAIL; } if ((sense_flags & SF_PRINT_ALWAYS) != 0) action |= SSQ_PRINT_SENSE; Modified: stable/9/sys/dev/usb/storage/umass.c ============================================================================== --- stable/9/sys/dev/usb/storage/umass.c Wed May 1 09:56:09 2013 (r250143) +++ stable/9/sys/dev/usb/storage/umass.c Wed May 1 11:10:15 2013 (r250144) @@ -2602,9 +2602,13 @@ umass_cam_sense_cb(struct umass_softc *s } } else { xpt_freeze_devq(ccb->ccb_h.path, 1); - ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR - | CAM_AUTOSNS_VALID | CAM_DEV_QFRZN; - ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; + if (key >= 0) { + ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR + | CAM_AUTOSNS_VALID | CAM_DEV_QFRZN; + ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; + } else + ccb->ccb_h.status = CAM_AUTOSENSE_FAIL + | CAM_DEV_QFRZN; } xpt_done(ccb); break; From owner-svn-src-all@FreeBSD.ORG Wed May 1 14:59:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 64CA7C8E; Wed, 1 May 2013 14:59:17 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F42912E9; Wed, 1 May 2013 14:59:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41ExHqW083230; Wed, 1 May 2013 14:59:17 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41ExH9l083229; Wed, 1 May 2013 14:59:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305011459.r41ExH9l083229@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 1 May 2013 14:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250145 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 14:59:17 -0000 Author: trociny Date: Wed May 1 14:59:16 2013 New Revision: 250145 URL: http://svnweb.freebsd.org/changeset/base/250145 Log: Introduce a constant, ELF_NOTE_ROUNDSIZE, which evidently declare our intention to use 4-byte padding for elf notes. MFC after: 3 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed May 1 11:10:15 2013 (r250144) +++ head/sys/kern/imgact_elf.c Wed May 1 14:59:16 2013 (r250145) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include +#define ELF_NOTE_ROUNDSIZE 4 #define OLD_EI_BRAND 8 static int __elfN(check_header)(const Elf_Ehdr *hdr); @@ -161,7 +162,7 @@ __elfN(freebsd_trans_osrel)(const Elf_No uintptr_t p; p = (uintptr_t)(note + 1); - p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); + p += roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE); *osrel = *(const int32_t *)(p); return (TRUE); @@ -186,7 +187,7 @@ kfreebsd_trans_osrel(const Elf_Note *not uintptr_t p; p = (uintptr_t)(note + 1); - p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); + p += roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE); desc = (const Elf32_Word *)p; if (desc[0] != GNU_KFREEBSD_ABI_DESC) @@ -1546,7 +1547,7 @@ __elfN(puthdr)(struct thread *td, void * phdr->p_filesz = notesz; phdr->p_memsz = 0; phdr->p_flags = PF_R; - phdr->p_align = sizeof(Elf32_Size); + phdr->p_align = ELF_NOTE_ROUNDSIZE; phdr++; /* All the writable segments from the program. */ @@ -1574,8 +1575,8 @@ register_note(struct note_info_list *lis return (size); notesize = sizeof(Elf_Note) + /* note header */ - roundup2(8, sizeof(Elf32_Size)) + /* note name ("FreeBSD") */ - roundup2(size, sizeof(Elf32_Size)); /* note description */ + roundup2(8, ELF_NOTE_ROUNDSIZE) + /* note name ("FreeBSD") */ + roundup2(size, ELF_NOTE_ROUNDSIZE); /* note description */ return (notesize); } @@ -1598,12 +1599,12 @@ __elfN(putnote)(struct note_info *ninfo, sbuf_bcat(sb, ¬e, sizeof(note)); sbuf_start_section(sb, &old_len); sbuf_bcat(sb, "FreeBSD", note.n_namesz); - sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); if (note.n_descsz == 0) return; sbuf_start_section(sb, &old_len); ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); - sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); } /* @@ -2004,8 +2005,8 @@ __elfN(parse_notes)(struct image_params nextnote: note = (const Elf_Note *)((const char *)(note + 1) + - roundup2(note->n_namesz, sizeof(Elf32_Addr)) + - roundup2(note->n_descsz, sizeof(Elf32_Addr))); + roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) + + roundup2(note->n_descsz, ELF_NOTE_ROUNDSIZE)); } return (FALSE); From owner-svn-src-all@FreeBSD.ORG Wed May 1 15:01:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7E594E27; Wed, 1 May 2013 15:01:06 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7058F1302; Wed, 1 May 2013 15:01:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41F16uD085353; Wed, 1 May 2013 15:01:06 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41F16n4085352; Wed, 1 May 2013 15:01:06 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305011501.r41F16n4085352@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 1 May 2013 15:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250146 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 15:01:06 -0000 Author: trociny Date: Wed May 1 15:01:05 2013 New Revision: 250146 URL: http://svnweb.freebsd.org/changeset/base/250146 Log: KVM method support for procstat_getgroups, procstat_getumask, procstat_getrlimit, and procstat_getosrel. MFC after: 3 weeks Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Wed May 1 14:59:16 2013 (r250145) +++ head/lib/libprocstat/libprocstat.c Wed May 1 15:01:05 2013 (r250146) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WANT_UCRED +#include +#undef _WANT_UCRED #include #include #include @@ -141,19 +144,30 @@ static int procstat_get_vnode_info_sysct struct vnstat *vn, char *errbuf); static gid_t *procstat_getgroups_core(struct procstat_core *core, unsigned int *count); +static gid_t * procstat_getgroups_kvm(kvm_t *kd, struct kinfo_proc *kp, + unsigned int *count); static gid_t *procstat_getgroups_sysctl(pid_t pid, unsigned int *count); static struct kinfo_kstack *procstat_getkstack_sysctl(pid_t pid, int *cntp); +static int procstat_getosrel_core(struct procstat_core *core, + int *osrelp); +static int procstat_getosrel_kvm(kvm_t *kd, struct kinfo_proc *kp, + int *osrelp); +static int procstat_getosrel_sysctl(pid_t pid, int *osrelp); static int procstat_getpathname_core(struct procstat_core *core, char *pathname, size_t maxlen); static int procstat_getpathname_sysctl(pid_t pid, char *pathname, size_t maxlen); static int procstat_getrlimit_core(struct procstat_core *core, int which, struct rlimit* rlimit); +static int procstat_getrlimit_kvm(kvm_t *kd, struct kinfo_proc *kp, + int which, struct rlimit* rlimit); static int procstat_getrlimit_sysctl(pid_t pid, int which, struct rlimit* rlimit); static int procstat_getumask_core(struct procstat_core *core, unsigned short *maskp); +static int procstat_getumask_kvm(kvm_t *kd, struct kinfo_proc *kp, + unsigned short *maskp); static int procstat_getumask_sysctl(pid_t pid, unsigned short *maskp); static int vntype2psfsttype(int type); @@ -1790,6 +1804,46 @@ procstat_freevmmap(struct procstat *proc } static gid_t * +procstat_getgroups_kvm(kvm_t *kd, struct kinfo_proc *kp, unsigned int *cntp) +{ + struct proc proc; + struct ucred ucred; + gid_t *groups; + size_t len; + + assert(kd != NULL); + assert(kp != NULL); + if (!kvm_read_all(kd, (unsigned long)kp->ki_paddr, &proc, + sizeof(proc))) { + warnx("can't read proc struct at %p for pid %d", + kp->ki_paddr, kp->ki_pid); + return (NULL); + } + if (proc.p_ucred == NOCRED) + return (NULL); + if (!kvm_read_all(kd, (unsigned long)proc.p_ucred, &ucred, + sizeof(ucred))) { + warnx("can't read ucred struct at %p for pid %d", + proc.p_ucred, kp->ki_pid); + return (NULL); + } + len = ucred.cr_ngroups * sizeof(gid_t); + groups = malloc(len); + if (groups == NULL) { + warn("malloc(%zu)", len); + return (NULL); + } + if (!kvm_read_all(kd, (unsigned long)ucred.cr_groups, groups, len)) { + warnx("can't read groups at %p for pid %d", + ucred.cr_groups, kp->ki_pid); + free(groups); + return (NULL); + } + *cntp = ucred.cr_ngroups; + return (groups); +} + +static gid_t * procstat_getgroups_sysctl(pid_t pid, unsigned int *cntp) { int mib[4]; @@ -1834,8 +1888,7 @@ procstat_getgroups(struct procstat *proc { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (NULL); + return (procstat_getgroups_kvm(procstat->kd, kp, cntp)); case PROCSTAT_SYSCTL: return (procstat_getgroups_sysctl(kp->ki_pid, cntp)); case PROCSTAT_CORE: @@ -1854,6 +1907,24 @@ procstat_freegroups(struct procstat *pro } static int +procstat_getumask_kvm(kvm_t *kd, struct kinfo_proc *kp, unsigned short *maskp) +{ + struct filedesc fd; + + assert(kd != NULL); + assert(kp != NULL); + if (kp->ki_fd == NULL) + return (-1); + if (!kvm_read_all(kd, (unsigned long)kp->ki_fd, &fd, sizeof(fd))) { + warnx("can't read filedesc at %p for pid %d", kp->ki_fd, + kp->ki_pid); + return (-1); + } + *maskp = fd.fd_cmask; + return (0); +} + +static int procstat_getumask_sysctl(pid_t pid, unsigned short *maskp) { int error; @@ -1895,8 +1966,7 @@ procstat_getumask(struct procstat *procs { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (-1); + return (procstat_getumask_kvm(procstat->kd, kp, maskp)); case PROCSTAT_SYSCTL: return (procstat_getumask_sysctl(kp->ki_pid, maskp)); case PROCSTAT_CORE: @@ -1908,6 +1978,33 @@ procstat_getumask(struct procstat *procs } static int +procstat_getrlimit_kvm(kvm_t *kd, struct kinfo_proc *kp, int which, + struct rlimit* rlimit) +{ + struct proc proc; + unsigned long offset; + + assert(kd != NULL); + assert(kp != NULL); + assert(which >= 0 && which < RLIM_NLIMITS); + if (!kvm_read_all(kd, (unsigned long)kp->ki_paddr, &proc, + sizeof(proc))) { + warnx("can't read proc struct at %p for pid %d", + kp->ki_paddr, kp->ki_pid); + return (-1); + } + if (proc.p_limit == NULL) + return (-1); + offset = (unsigned long)proc.p_limit + sizeof(struct rlimit) * which; + if (!kvm_read_all(kd, offset, rlimit, sizeof(*rlimit))) { + warnx("can't read rlimit struct at %p for pid %d", + (void *)offset, kp->ki_pid); + return (-1); + } + return (0); +} + +static int procstat_getrlimit_sysctl(pid_t pid, int which, struct rlimit* rlimit) { int error, name[5]; @@ -1958,8 +2055,8 @@ procstat_getrlimit(struct procstat *proc { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (-1); + return (procstat_getrlimit_kvm(procstat->kd, kp, which, + rlimit)); case PROCSTAT_SYSCTL: return (procstat_getrlimit_sysctl(kp->ki_pid, which, rlimit)); case PROCSTAT_CORE: @@ -2032,6 +2129,23 @@ procstat_getpathname(struct procstat *pr } static int +procstat_getosrel_kvm(kvm_t *kd, struct kinfo_proc *kp, int *osrelp) +{ + struct proc proc; + + assert(kd != NULL); + assert(kp != NULL); + if (!kvm_read_all(kd, (unsigned long)kp->ki_paddr, &proc, + sizeof(proc))) { + warnx("can't read proc struct at %p for pid %d", + kp->ki_paddr, kp->ki_pid); + return (-1); + } + *osrelp = proc.p_osrel; + return (0); +} + +static int procstat_getosrel_sysctl(pid_t pid, int *osrelp) { int error, name[4]; @@ -2071,8 +2185,7 @@ procstat_getosrel(struct procstat *procs { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (-1); + return (procstat_getosrel_kvm(procstat->kd, kp, osrelp)); case PROCSTAT_SYSCTL: return (procstat_getosrel_sysctl(kp->ki_pid, osrelp)); case PROCSTAT_CORE: From owner-svn-src-all@FreeBSD.ORG Wed May 1 15:02:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5C148FBF; Wed, 1 May 2013 15:02:59 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D69E1313; Wed, 1 May 2013 15:02:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41F2x8Q085761; Wed, 1 May 2013 15:02:59 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41F2xJI085759; Wed, 1 May 2013 15:02:59 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305011502.r41F2xJI085759@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 1 May 2013 15:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250147 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 15:02:59 -0000 Author: trociny Date: Wed May 1 15:02:58 2013 New Revision: 250147 URL: http://svnweb.freebsd.org/changeset/base/250147 Log: procstat_getpathname: for kvm method, instead of returning the error that the method is not supported, return an empty string. This looks more handy for callers like procstat(1), which will not abort after the failed call and still output some useful information. MFC after: 3 weeks Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Wed May 1 15:01:05 2013 (r250146) +++ head/lib/libprocstat/libprocstat.c Wed May 1 15:02:58 2013 (r250147) @@ -2114,8 +2114,10 @@ procstat_getpathname(struct procstat *pr { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (-1); + /* XXX: Return empty string. */ + if (maxlen > 0) + pathname[0] = '\0'; + return (0); case PROCSTAT_SYSCTL: return (procstat_getpathname_sysctl(kp->ki_pid, pathname, maxlen)); From owner-svn-src-all@FreeBSD.ORG Wed May 1 17:29:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 243F1166; Wed, 1 May 2013 17:29:43 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15D9E1B78; Wed, 1 May 2013 17:29:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41HTgXD036367; Wed, 1 May 2013 17:29:42 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41HTgY2036366; Wed, 1 May 2013 17:29:42 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201305011729.r41HTgY2036366@svn.freebsd.org> From: Niclas Zeising Date: Wed, 1 May 2013 17:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250148 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 17:29:43 -0000 Author: zeising (doc,ports committer) Date: Wed May 1 17:29:42 2013 New Revision: 250148 URL: http://svnweb.freebsd.org/changeset/base/250148 Log: Add OpenBSD 5.3, released today, May 1 2013. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed May 1 15:02:58 2013 (r250147) +++ head/share/misc/bsd-family-tree Wed May 1 17:29:42 2013 (r250148) @@ -261,6 +261,10 @@ FreeBSD 5.2 | | | FreeBSD | | | | | 9.1 | | | | | | | | | + | | | OpenBSD 5.3 | + | | | | | + | | | | | + | | | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | | | | | | v v v v v @@ -558,6 +562,7 @@ NetBSD 6.0 2012-10-17 [NBD] OpenBSD 5.2 2012-11-01 [OBD] DragonFly 3.2.1 2012-11-02 [DFB] FreeBSD 9.1 2012-12-30 [FBD] +OpenBSD 5.3 2013-05-01 [OBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Wed May 1 17:34:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CDB9B33C; Wed, 1 May 2013 17:34:44 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BFBDD1BB1; Wed, 1 May 2013 17:34:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41HYiEf038947; Wed, 1 May 2013 17:34:44 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41HYi7u038946; Wed, 1 May 2013 17:34:44 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305011734.r41HYi7u038946@svn.freebsd.org> From: Davide Italiano Date: Wed, 1 May 2013 17:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250149 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 17:34:44 -0000 Author: davide Date: Wed May 1 17:34:44 2013 New Revision: 250149 URL: http://svnweb.freebsd.org/changeset/base/250149 Log: In case ZFS doesn't use UMA for buffers there's no need to waste memory creating zones that will remain empty. Reviewed by: pjd Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed May 1 17:29:42 2013 (r250148) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed May 1 17:34:44 2013 (r250149) @@ -154,6 +154,8 @@ zio_init(void) sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0); zio_link_cache = kmem_cache_create("zio_link_cache", sizeof (zio_link_t), 0, NULL, NULL, NULL, NULL, NULL, 0); + if (!zio_use_uma) + goto out; /* * For small buffers, we want a cache for each multiple of @@ -217,6 +219,7 @@ zio_init(void) if (zio_data_buf_cache[c - 1] == NULL) zio_data_buf_cache[c - 1] = zio_data_buf_cache[c]; } +out: /* * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs From owner-svn-src-all@FreeBSD.ORG Wed May 1 17:59:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E5C207AF; Wed, 1 May 2013 17:59:41 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D748A1CB0; Wed, 1 May 2013 17:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41Hxfg8046485; Wed, 1 May 2013 17:59:41 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41HxfCm046484; Wed, 1 May 2013 17:59:41 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201305011759.r41HxfCm046484@svn.freebsd.org> From: Niclas Zeising Date: Wed, 1 May 2013 17:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250150 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 17:59:42 -0000 Author: zeising (doc,ports committer) Date: Wed May 1 17:59:41 2013 New Revision: 250150 URL: http://svnweb.freebsd.org/changeset/base/250150 Log: Add DragonFly BSD 3.4.1, released April 29 2013. Submitted by: Nikolai Lifanov Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed May 1 17:34:44 2013 (r250149) +++ head/share/misc/bsd-family-tree Wed May 1 17:59:41 2013 (r250150) @@ -261,7 +261,7 @@ FreeBSD 5.2 | | | FreeBSD | | | | | 9.1 | | | | | | | | | - | | | OpenBSD 5.3 | + | | | OpenBSD 5.3 DragonFly 3.4.1 | | | | | | | | | | | | | | | @@ -562,6 +562,7 @@ NetBSD 6.0 2012-10-17 [NBD] OpenBSD 5.2 2012-11-01 [OBD] DragonFly 3.2.1 2012-11-02 [DFB] FreeBSD 9.1 2012-12-30 [FBD] +DragonFly 3.4.1 2013-04-29 [DFB] OpenBSD 5.3 2013-05-01 [OBD] Bibliography From owner-svn-src-all@FreeBSD.ORG Wed May 1 18:06:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5AE1F36; Wed, 1 May 2013 18:06:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BF951D1F; Wed, 1 May 2013 18:06:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41I6soM049912; Wed, 1 May 2013 18:06:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41I6sGs049910; Wed, 1 May 2013 18:06:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305011806.r41I6sGs049910@svn.freebsd.org> From: Dimitry Andric Date: Wed, 1 May 2013 18:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250151 - in stable: 6/sys/boot/i386/btx/btx 6/sys/boot/pc98/btx/btx 7/sys/boot/i386/btx/btx 7/sys/boot/pc98/btx/btx 8/sys/boot/i386/btx/btx 8/sys/boot/pc98/btx/btx 9/sys/boot/i386/btx/... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 18:06:54 -0000 Author: dim Date: Wed May 1 18:06:53 2013 New Revision: 250151 URL: http://svnweb.freebsd.org/changeset/base/250151 Log: MFC r249846: When rebooting (exiting) from the BTX loader, make sure to restore the GDT from the correct segment, otherwise a triple fault would be caused. In some virtual environments (VMware, VirtualBox, etc) this could lead to a unhandled error or hang in the guest emulation software. Thanks to avg and jhb for a few hints in the right direction. Noticed by: Jeremy Chadwick (and many others) Modified: stable/9/sys/boot/i386/btx/btx/btx.S stable/9/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Changes in other areas also in this revision: Modified: stable/6/sys/boot/i386/btx/btx/btx.S stable/6/sys/boot/pc98/btx/btx/btx.S stable/7/sys/boot/i386/btx/btx/btx.S stable/7/sys/boot/pc98/btx/btx/btx.S stable/8/sys/boot/i386/btx/btx/btx.S stable/8/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/6/sys/ (props changed) stable/7/sys/ (props changed) stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/btx/btx/btx.S ============================================================================== --- stable/9/sys/boot/i386/btx/btx/btx.S Wed May 1 17:59:41 2013 (r250150) +++ stable/9/sys/boot/i386/btx/btx/btx.S Wed May 1 18:06:53 2013 (r250151) @@ -248,7 +248,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ Modified: stable/9/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/9/sys/boot/pc98/btx/btx/btx.S Wed May 1 17:59:41 2013 (r250150) +++ stable/9/sys/boot/pc98/btx/btx/btx.S Wed May 1 18:06:53 2013 (r250151) @@ -248,7 +248,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ From owner-svn-src-all@FreeBSD.ORG Wed May 1 18:06:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 43E07F37; Wed, 1 May 2013 18:06:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C00F1D20; Wed, 1 May 2013 18:06:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41I6smE049919; Wed, 1 May 2013 18:06:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41I6sFO049917; Wed, 1 May 2013 18:06:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305011806.r41I6sFO049917@svn.freebsd.org> From: Dimitry Andric Date: Wed, 1 May 2013 18:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250151 - in stable: 6/sys/boot/i386/btx/btx 6/sys/boot/pc98/btx/btx 7/sys/boot/i386/btx/btx 7/sys/boot/pc98/btx/btx 8/sys/boot/i386/btx/btx 8/sys/boot/pc98/btx/btx 9/sys/boot/i386/btx/... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 18:06:55 -0000 Author: dim Date: Wed May 1 18:06:53 2013 New Revision: 250151 URL: http://svnweb.freebsd.org/changeset/base/250151 Log: MFC r249846: When rebooting (exiting) from the BTX loader, make sure to restore the GDT from the correct segment, otherwise a triple fault would be caused. In some virtual environments (VMware, VirtualBox, etc) this could lead to a unhandled error or hang in the guest emulation software. Thanks to avg and jhb for a few hints in the right direction. Noticed by: Jeremy Chadwick (and many others) Modified: stable/8/sys/boot/i386/btx/btx/btx.S stable/8/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Changes in other areas also in this revision: Modified: stable/6/sys/boot/i386/btx/btx/btx.S stable/6/sys/boot/pc98/btx/btx/btx.S stable/7/sys/boot/i386/btx/btx/btx.S stable/7/sys/boot/pc98/btx/btx/btx.S stable/9/sys/boot/i386/btx/btx/btx.S stable/9/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/6/sys/ (props changed) stable/7/sys/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/8/sys/boot/i386/btx/btx/btx.S ============================================================================== --- stable/8/sys/boot/i386/btx/btx/btx.S Wed May 1 17:59:41 2013 (r250150) +++ stable/8/sys/boot/i386/btx/btx/btx.S Wed May 1 18:06:53 2013 (r250151) @@ -248,7 +248,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ Modified: stable/8/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/8/sys/boot/pc98/btx/btx/btx.S Wed May 1 17:59:41 2013 (r250150) +++ stable/8/sys/boot/pc98/btx/btx/btx.S Wed May 1 18:06:53 2013 (r250151) @@ -248,7 +248,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ From owner-svn-src-all@FreeBSD.ORG Wed May 1 18:06:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CA7B1F38; Wed, 1 May 2013 18:06:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A1CB61D21; Wed, 1 May 2013 18:06:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41I6tow049927; Wed, 1 May 2013 18:06:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41I6tt8049924; Wed, 1 May 2013 18:06:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305011806.r41I6tt8049924@svn.freebsd.org> From: Dimitry Andric Date: Wed, 1 May 2013 18:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r250151 - in stable: 6/sys/boot/i386/btx/btx 6/sys/boot/pc98/btx/btx 7/sys/boot/i386/btx/btx 7/sys/boot/pc98/btx/btx 8/sys/boot/i386/btx/btx 8/sys/boot/pc98/btx/btx 9/sys/boot/i386/btx/... X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 18:06:55 -0000 Author: dim Date: Wed May 1 18:06:53 2013 New Revision: 250151 URL: http://svnweb.freebsd.org/changeset/base/250151 Log: MFC r249846: When rebooting (exiting) from the BTX loader, make sure to restore the GDT from the correct segment, otherwise a triple fault would be caused. In some virtual environments (VMware, VirtualBox, etc) this could lead to a unhandled error or hang in the guest emulation software. Thanks to avg and jhb for a few hints in the right direction. Noticed by: Jeremy Chadwick (and many others) Modified: stable/7/sys/boot/i386/btx/btx/btx.S stable/7/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/7/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/6/sys/boot/i386/btx/btx/btx.S stable/6/sys/boot/pc98/btx/btx/btx.S stable/8/sys/boot/i386/btx/btx/btx.S stable/8/sys/boot/pc98/btx/btx/btx.S stable/9/sys/boot/i386/btx/btx/btx.S stable/9/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/6/sys/ (props changed) stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/7/sys/boot/i386/btx/btx/btx.S ============================================================================== --- stable/7/sys/boot/i386/btx/btx/btx.S Wed May 1 17:59:41 2013 (r250150) +++ stable/7/sys/boot/i386/btx/btx/btx.S Wed May 1 18:06:53 2013 (r250151) @@ -246,7 +246,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ Modified: stable/7/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/7/sys/boot/pc98/btx/btx/btx.S Wed May 1 17:59:41 2013 (r250150) +++ stable/7/sys/boot/pc98/btx/btx/btx.S Wed May 1 18:06:53 2013 (r250151) @@ -246,7 +246,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ From owner-svn-src-all@FreeBSD.ORG Wed May 1 18:06:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5BEF7F39; Wed, 1 May 2013 18:06:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 329BC1D22; Wed, 1 May 2013 18:06:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41I6uYk049938; Wed, 1 May 2013 18:06:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41I6tgB049936; Wed, 1 May 2013 18:06:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305011806.r41I6tgB049936@svn.freebsd.org> From: Dimitry Andric Date: Wed, 1 May 2013 18:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r250151 - in stable: 6/sys/boot/i386/btx/btx 6/sys/boot/pc98/btx/btx 7/sys/boot/i386/btx/btx 7/sys/boot/pc98/btx/btx 8/sys/boot/i386/btx/btx 8/sys/boot/pc98/btx/btx 9/sys/boot/i386/btx/... X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 18:06:56 -0000 Author: dim Date: Wed May 1 18:06:53 2013 New Revision: 250151 URL: http://svnweb.freebsd.org/changeset/base/250151 Log: MFC r249846: When rebooting (exiting) from the BTX loader, make sure to restore the GDT from the correct segment, otherwise a triple fault would be caused. In some virtual environments (VMware, VirtualBox, etc) this could lead to a unhandled error or hang in the guest emulation software. Thanks to avg and jhb for a few hints in the right direction. Noticed by: Jeremy Chadwick (and many others) Modified: stable/6/sys/boot/i386/btx/btx/btx.S stable/6/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/6/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/boot/i386/btx/btx/btx.S stable/7/sys/boot/pc98/btx/btx/btx.S stable/8/sys/boot/i386/btx/btx/btx.S stable/8/sys/boot/pc98/btx/btx/btx.S stable/9/sys/boot/i386/btx/btx/btx.S stable/9/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/7/sys/ (props changed) stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/6/sys/boot/i386/btx/btx/btx.S ============================================================================== --- stable/6/sys/boot/i386/btx/btx/btx.S Wed May 1 17:59:41 2013 (r250150) +++ stable/6/sys/boot/i386/btx/btx/btx.S Wed May 1 18:06:53 2013 (r250151) @@ -246,7 +246,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ Modified: stable/6/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/6/sys/boot/pc98/btx/btx/btx.S Wed May 1 17:59:41 2013 (r250150) +++ stable/6/sys/boot/pc98/btx/btx/btx.S Wed May 1 18:06:53 2013 (r250151) @@ -246,7 +246,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ From owner-svn-src-all@FreeBSD.ORG Wed May 1 20:03:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E04E665C; Wed, 1 May 2013 20:03:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D328D114D; Wed, 1 May 2013 20:03:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41K3oXk091722; Wed, 1 May 2013 20:03:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41K3oig091721; Wed, 1 May 2013 20:03:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305012003.r41K3oig091721@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 May 2013 20:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250152 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 20:03:51 -0000 Author: kib Date: Wed May 1 20:03:50 2013 New Revision: 250152 URL: http://svnweb.freebsd.org/changeset/base/250152 Log: The check to ensure that xstate_bv always has XFEATURE_ENABLED_X87 and XFEATURE_ENABLED_SSE bits set is not needed. CPU correctly handles any bitmask which is subset of the enabled bits in %XCR0. More, CPU instructions XSAVE and XSAVEOPT could write the mask without e.g. XFEATURE_ENABLED_SSE, after the VZEROALL. The check prevents the restoration of the otherwise valid FPU save area. In collaboration with: jhb MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Wed May 1 18:06:53 2013 (r250151) +++ head/sys/amd64/amd64/fpu.c Wed May 1 20:03:50 2013 (r250152) @@ -743,9 +743,6 @@ fpusetxstate(struct thread *td, char *xf */ if (bv & ~xsave_mask) return (EINVAL); - if ((bv & (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) != - (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) - return (EINVAL); hdr = (struct xstate_hdr *)(get_pcb_user_save_td(td) + 1); From owner-svn-src-all@FreeBSD.ORG Wed May 1 20:08:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03BE9831; Wed, 1 May 2013 20:08:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA702117B; Wed, 1 May 2013 20:08:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41K8XIA092734; Wed, 1 May 2013 20:08:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41K8X6x092733; Wed, 1 May 2013 20:08:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305012008.r41K8X6x092733@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 May 2013 20:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250153 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 20:08:34 -0000 Author: kib Date: Wed May 1 20:08:33 2013 New Revision: 250153 URL: http://svnweb.freebsd.org/changeset/base/250153 Log: Partially saved extended state must be handled always, i.e. for both fpu-owned context, and for pcb-saved one. More, the XSAVE could do partial save, same as XSAVEOPT, so qualifier for the handler should be use_xsave and not use_xsaveopt. Since xsave_area_desc is now needed regardless of the XSAVEOPT use, remove the write-only use_xsaveopt variable. In collaboration with: jhb MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Wed May 1 20:03:50 2013 (r250152) +++ head/sys/amd64/amd64/fpu.c Wed May 1 20:08:33 2013 (r250153) @@ -132,7 +132,6 @@ static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, NULL, 1, "Floating point instructions executed in hardware"); -static int use_xsaveopt; int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ static uma_zone_t fpu_save_area_zone; @@ -198,7 +197,6 @@ fpuinit_bsp1(void) * REX byte, and set the bit 4 of the r/m byte. */ ctx_switch_xsave[3] |= 0x10; - use_xsaveopt = 1; } } @@ -296,7 +294,7 @@ fpuinitstate(void *arg __unused) * Create a table describing the layout of the CPU Extended * Save Area. */ - if (use_xsaveopt) { + if (use_xsave) { max_ext_n = flsl(xsave_mask); xsave_area_desc = malloc(max_ext_n * sizeof(struct xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO); @@ -661,7 +659,7 @@ fpugetregs(struct thread *td) struct pcb *pcb; uint64_t *xstate_bv, bit; char *sa; - int max_ext_n, i; + int max_ext_n, i, owned; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { @@ -675,31 +673,31 @@ fpugetregs(struct thread *td) critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { fpusave(get_pcb_user_save_pcb(pcb)); - critical_exit(); - return (_MC_FPOWNED_FPU); + owned = _MC_FPOWNED_FPU; } else { - critical_exit(); - if (use_xsaveopt) { - /* - * Handle partially saved state. - */ - sa = (char *)get_pcb_user_save_pcb(pcb); - xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) + - offsetof(struct xstate_hdr, xstate_bv)); - max_ext_n = flsl(xsave_mask); - for (i = 0; i < max_ext_n; i++) { - bit = 1 << i; - if ((*xstate_bv & bit) != 0) - continue; - bcopy((char *)fpu_initialstate + - xsave_area_desc[i].offset, - sa + xsave_area_desc[i].offset, - xsave_area_desc[i].size); - *xstate_bv |= bit; - } + owned = _MC_FPOWNED_PCB; + } + critical_exit(); + if (use_xsave) { + /* + * Handle partially saved state. + */ + sa = (char *)get_pcb_user_save_pcb(pcb); + xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) + + offsetof(struct xstate_hdr, xstate_bv)); + max_ext_n = flsl(xsave_mask); + for (i = 0; i < max_ext_n; i++) { + bit = 1 << i; + if ((*xstate_bv & bit) != 0) + continue; + bcopy((char *)fpu_initialstate + + xsave_area_desc[i].offset, + sa + xsave_area_desc[i].offset, + xsave_area_desc[i].size); + *xstate_bv |= bit; } - return (_MC_FPOWNED_PCB); } + return (owned); } void From owner-svn-src-all@FreeBSD.ORG Wed May 1 20:10:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9D50A5A; Wed, 1 May 2013 20:10:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9C4D6118F; Wed, 1 May 2013 20:10:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41KANHW093363; Wed, 1 May 2013 20:10:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41KALJt093344; Wed, 1 May 2013 20:10:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012010.r41KALJt093344@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 20:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250154 - in head: lib/libc/sys lib/libthr lib/libthr/thread sys/compat/freebsd32 sys/kern 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 20:10:23 -0000 Author: jilles Date: Wed May 1 20:10:21 2013 New Revision: 250154 URL: http://svnweb.freebsd.org/changeset/base/250154 Log: Add accept4() system call. The accept4() function, compared to accept(), allows setting the new file descriptor atomically close-on-exec and explicitly controlling the non-blocking status on the new socket. (Note that the latter point means that accept() is not equivalent to any form of accept4().) The linuxulator's accept4 implementation leaves a race window where the new file descriptor is not close-on-exec because it calls sys_accept(). This implementation leaves no such race window (by using falloc() flags). The linuxulator could be fixed and simplified by using the new code. Like accept(), accept4() is async-signal-safe, a cancellation point and permitted in capability mode. Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/lib/libc/sys/accept.2 head/lib/libthr/pthread.map head/lib/libthr/thread/thr_syscalls.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/capabilities.conf head/sys/kern/syscalls.master head/sys/kern/uipc_syscalls.c head/sys/sys/socket.h head/sys/sys/syscallsubr.h Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Wed May 1 20:08:33 2013 (r250153) +++ head/lib/libc/sys/Makefile.inc Wed May 1 20:10:21 2013 (r250154) @@ -270,6 +270,7 @@ MAN+= sctp_generic_recvmsg.2 \ wait.2 \ write.2 +MLINKS+=accept.2 accept4.2 MLINKS+=access.2 eaccess.2 \ access.2 faccessat.2 MLINKS+=brk.2 sbrk.2 Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Wed May 1 20:08:33 2013 (r250153) +++ head/lib/libc/sys/Symbol.map Wed May 1 20:10:21 2013 (r250154) @@ -378,6 +378,7 @@ FBSD_1.2 { }; FBSD_1.3 { + accept4; bindat; cap_fcntls_get; cap_fcntls_limit; @@ -461,6 +462,8 @@ FBSDprivate_1.0 { __sys_abort2; _accept; __sys_accept; + _accept4; + __sys_accept4; _access; __sys_access; _acct; Modified: head/lib/libc/sys/accept.2 ============================================================================== --- head/lib/libc/sys/accept.2 Wed May 1 20:08:33 2013 (r250153) +++ head/lib/libc/sys/accept.2 Wed May 1 20:10:21 2013 (r250154) @@ -41,6 +41,8 @@ .In sys/socket.h .Ft int .Fn accept "int s" "struct sockaddr * restrict addr" "socklen_t * restrict addrlen" +.Ft int +.Fn accept4 "int s" "struct sockaddr * restrict addr" "socklen_t * restrict addrlen" "int flags" .Sh DESCRIPTION The argument .Fa s @@ -66,6 +68,26 @@ and signals from the original socket .Fa s . .Pp +The +.Fn accept4 +system call is similar, +but the +.Dv O_NONBLOCK +property of the new socket is instead determined by the +.Dv SOCK_NONBLOCK +flag in the +.Fa flags +argument, +the +.Dv O_ASYNC +property is cleared, +the signal destination is cleared +and the close-on-exec flag on the new file descriptor can be set via the +.Dv SOCK_CLOEXEC +flag in the +.Fa flags +argument. +.Pp If no pending connections are present on the queue, and the original socket is not marked as non-blocking, @@ -141,13 +163,15 @@ properties and the signal destination be but should set them explicitly using .Xr fcntl 2 . .Sh RETURN VALUES -The call returns \-1 on error. -If it succeeds, it returns a non-negative +These calls return \-1 on error. +If they succeed, they return a non-negative integer that is a descriptor for the accepted socket. .Sh ERRORS The .Fn accept -system call will fail if: +and +.Fn accept4 +system calls will fail if: .Bl -tag -width Er .It Bq Er EBADF The descriptor is invalid. @@ -176,6 +200,16 @@ are present to be accepted. A connection arrived, but it was closed while waiting on the listen queue. .El +.Pp +The +.Fn accept4 +system call will also fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa flags +argument is invalid. +.El .Sh SEE ALSO .Xr bind 2 , .Xr connect 2 , @@ -190,3 +224,8 @@ The .Fn accept system call appeared in .Bx 4.2 . +.Pp +The +.Fn accept4 +system call appeared in +.Fx 10.0 . Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Wed May 1 20:08:33 2013 (r250153) +++ head/lib/libthr/pthread.map Wed May 1 20:10:21 2013 (r250154) @@ -181,6 +181,7 @@ FBSDprivate_1.0 { ___wait; ___waitpid; __accept; + __accept4; __aio_suspend; __close; __connect; @@ -408,3 +409,7 @@ FBSD_1.2 { setcontext; swapcontext; }; + +FBSD_1.3 { + accept4; +}; Modified: head/lib/libthr/thread/thr_syscalls.c ============================================================================== --- head/lib/libthr/thread/thr_syscalls.c Wed May 1 20:08:33 2013 (r250153) +++ head/lib/libthr/thread/thr_syscalls.c Wed May 1 20:10:21 2013 (r250154) @@ -101,6 +101,7 @@ extern pid_t __waitpid(pid_t, int *, int extern int __sys_aio_suspend(const struct aiocb * const[], int, const struct timespec *); extern int __sys_accept(int, struct sockaddr *, socklen_t *); +extern int __sys_accept4(int, struct sockaddr *, socklen_t *, int); extern int __sys_connect(int, const struct sockaddr *, socklen_t); extern int __sys_fsync(int); extern int __sys_msync(void *, size_t, int); @@ -129,6 +130,7 @@ int ___usleep(useconds_t useconds); pid_t ___wait(int *); pid_t ___waitpid(pid_t, int *, int); int __accept(int, struct sockaddr *, socklen_t *); +int __accept4(int, struct sockaddr *, socklen_t *, int); int __aio_suspend(const struct aiocb * const iocbs[], int, const struct timespec *); int __close(int); @@ -176,6 +178,26 @@ __accept(int s, struct sockaddr *addr, s return (ret); } +__weak_reference(__accept4, accept4); + +/* + * Cancellation behavior: + * If thread is canceled, no socket is created. + */ +int +__accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags) +{ + struct pthread *curthread; + int ret; + + curthread = _get_curthread(); + _thr_cancel_enter(curthread); + ret = __sys_accept4(s, addr, addrlen, flags); + _thr_cancel_leave(curthread, ret == -1); + + return (ret); +} + __weak_reference(__aio_suspend, aio_suspend); int Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed May 1 20:08:33 2013 (r250153) +++ head/sys/compat/freebsd32/syscalls.master Wed May 1 20:10:21 2013 (r250154) @@ -1022,3 +1022,7 @@ int namelen); } 540 AUE_CHFLAGSAT NOPROTO { int chflagsat(int fd, const char *path, \ u_long flags, int atflag); } +541 AUE_ACCEPT NOPROTO { int accept4(int s, \ + struct sockaddr * __restrict name, \ + __socklen_t * __restrict anamelen, \ + int flags); } Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Wed May 1 20:08:33 2013 (r250153) +++ head/sys/kern/capabilities.conf Wed May 1 20:10:21 2013 (r250154) @@ -78,6 +78,7 @@ abort2 ## relies on existing bindings on a socket, subject to capability rights. ## accept +accept4 ## ## Allow AIO operations by file descriptor, subject to capability rights. Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed May 1 20:08:33 2013 (r250153) +++ head/sys/kern/syscalls.master Wed May 1 20:10:21 2013 (r250154) @@ -972,5 +972,9 @@ int namelen); } 540 AUE_CHFLAGSAT STD { int chflagsat(int fd, const char *path, \ u_long flags, int atflag); } +541 AUE_ACCEPT STD { int accept4(int s, \ + struct sockaddr * __restrict name, \ + __socklen_t * __restrict anamelen, \ + int flags); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Wed May 1 20:08:33 2013 (r250153) +++ head/sys/kern/uipc_syscalls.c Wed May 1 20:10:21 2013 (r250154) @@ -97,10 +97,18 @@ __FBSDID("$FreeBSD$"); #endif /* SCTP */ #endif /* INET || INET6 */ +/* + * Flags for accept1() and kern_accept4(), in addition to SOCK_CLOEXEC + * and SOCK_NONBLOCK. + */ +#define ACCEPT4_INHERIT 0x1 +#define ACCEPT4_COMPAT 0x2 + static int sendit(struct thread *td, int s, struct msghdr *mp, int flags); static int recvit(struct thread *td, int s, struct msghdr *mp, void *namelenp); -static int accept1(struct thread *td, struct accept_args *uap, int compat); +static int accept1(struct thread *td, int s, struct sockaddr *uname, + socklen_t *anamelen, int flags); static int do_sendfile(struct thread *td, struct sendfile_args *uap, int compat); static int getsockname1(struct thread *td, struct getsockname_args *uap, int compat); @@ -317,49 +325,46 @@ sys_listen(td, uap) * accept1() */ static int -accept1(td, uap, compat) +accept1(td, s, uname, anamelen, flags) struct thread *td; - struct accept_args /* { - int s; - struct sockaddr * __restrict name; - socklen_t * __restrict anamelen; - } */ *uap; - int compat; + int s; + struct sockaddr *uname; + socklen_t *anamelen; + int flags; { struct sockaddr *name; socklen_t namelen; struct file *fp; int error; - if (uap->name == NULL) - return (kern_accept(td, uap->s, NULL, NULL, NULL)); + if (uname == NULL) + return (kern_accept4(td, s, NULL, NULL, flags, NULL)); - error = copyin(uap->anamelen, &namelen, sizeof (namelen)); + error = copyin(anamelen, &namelen, sizeof (namelen)); if (error) return (error); - error = kern_accept(td, uap->s, &name, &namelen, &fp); + error = kern_accept4(td, s, &name, &namelen, flags, &fp); /* * return a namelen of zero for older code which might * ignore the return value from accept. */ if (error) { - (void) copyout(&namelen, - uap->anamelen, sizeof(*uap->anamelen)); + (void) copyout(&namelen, anamelen, sizeof(*anamelen)); return (error); } - if (error == 0 && name != NULL) { + if (error == 0 && uname != NULL) { #ifdef COMPAT_OLDSOCK - if (compat) + if (flags & ACCEPT4_COMPAT) ((struct osockaddr *)name)->sa_family = name->sa_family; #endif - error = copyout(name, uap->name, namelen); + error = copyout(name, uname, namelen); } if (error == 0) - error = copyout(&namelen, uap->anamelen, + error = copyout(&namelen, anamelen, sizeof(namelen)); if (error) fdclose(td->td_proc->p_fd, fp, td->td_retval[0], td); @@ -372,6 +377,13 @@ int kern_accept(struct thread *td, int s, struct sockaddr **name, socklen_t *namelen, struct file **fp) { + return (kern_accept4(td, s, name, namelen, ACCEPT4_INHERIT, fp)); +} + +int +kern_accept4(struct thread *td, int s, struct sockaddr **name, + socklen_t *namelen, int flags, struct file **fp) +{ struct filedesc *fdp; struct file *headfp, *nfp = NULL; struct sockaddr *sa = NULL; @@ -400,7 +412,7 @@ kern_accept(struct thread *td, int s, st if (error != 0) goto done; #endif - error = falloc(td, &nfp, &fd, 0); + error = falloc(td, &nfp, &fd, (flags & SOCK_CLOEXEC) ? O_CLOEXEC : 0); if (error) goto done; ACCEPT_LOCK(); @@ -441,7 +453,10 @@ kern_accept(struct thread *td, int s, st TAILQ_REMOVE(&head->so_comp, so, so_list); head->so_qlen--; - so->so_state |= (head->so_state & SS_NBIO); + if (flags & ACCEPT4_INHERIT) + so->so_state |= (head->so_state & SS_NBIO); + else + so->so_state |= (flags & SOCK_NONBLOCK) ? SS_NBIO : 0; so->so_qstate &= ~SQ_COMP; so->so_head = NULL; @@ -454,9 +469,15 @@ kern_accept(struct thread *td, int s, st /* connection has been removed from the listen queue */ KNOTE_UNLOCKED(&head->so_rcv.sb_sel.si_note, 0); - pgid = fgetown(&head->so_sigio); - if (pgid != 0) - fsetown(pgid, &so->so_sigio); + if (flags & ACCEPT4_INHERIT) { + pgid = fgetown(&head->so_sigio); + if (pgid != 0) + fsetown(pgid, &so->so_sigio); + } else { + fflag &= ~(FNONBLOCK | FASYNC); + if (flags & SOCK_NONBLOCK) + fflag |= FNONBLOCK; + } finit(nfp, fflag, DTYPE_SOCKET, so, &socketops); /* Sync socket nonblocking/async state with file flags */ @@ -527,7 +548,18 @@ sys_accept(td, uap) struct accept_args *uap; { - return (accept1(td, uap, 0)); + return (accept1(td, uap->s, uap->name, uap->anamelen, ACCEPT4_INHERIT)); +} + +int +sys_accept4(td, uap) + struct thread *td; + struct accept4_args *uap; +{ + if (uap->flags & ~(SOCK_CLOEXEC | SOCK_NONBLOCK)) + return (EINVAL); + + return (accept1(td, uap->s, uap->name, uap->anamelen, uap->flags)); } #ifdef COMPAT_OLDSOCK @@ -537,7 +569,8 @@ oaccept(td, uap) struct accept_args *uap; { - return (accept1(td, uap, 1)); + return (accept1(td, uap->s, uap->name, uap->anamelen, + ACCEPT4_INHERIT | ACCEPT4_COMPAT)); } #endif /* COMPAT_OLDSOCK */ Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Wed May 1 20:08:33 2013 (r250153) +++ head/sys/sys/socket.h Wed May 1 20:10:21 2013 (r250154) @@ -634,6 +634,7 @@ int accept(int, struct sockaddr * __rest int bind(int, const struct sockaddr *, socklen_t); int connect(int, const struct sockaddr *, socklen_t); #if __BSD_VISIBLE +int accept4(int, struct sockaddr * __restrict, socklen_t * __restrict, int); int bindat(int, int, const struct sockaddr *, socklen_t); int connectat(int, int, const struct sockaddr *, socklen_t); #endif Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Wed May 1 20:08:33 2013 (r250153) +++ head/sys/sys/syscallsubr.h Wed May 1 20:10:21 2013 (r250154) @@ -60,6 +60,8 @@ int kern___getcwd(struct thread *td, u_c u_int buflen); int kern_accept(struct thread *td, int s, struct sockaddr **name, socklen_t *namelen, struct file **fp); +int kern_accept4(struct thread *td, int s, struct sockaddr **name, + socklen_t *namelen, int flags, struct file **fp); int kern_access(struct thread *td, char *path, enum uio_seg pathseg, int flags); int kern_accessat(struct thread *td, int fd, char *path, From owner-svn-src-all@FreeBSD.ORG Wed May 1 20:13:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EDBE7D6C; Wed, 1 May 2013 20:13:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D018011BB; Wed, 1 May 2013 20:13:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41KD05E095495; Wed, 1 May 2013 20:13:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41KCwuq095473; Wed, 1 May 2013 20:12:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012012.r41KCwuq095473@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 20:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250155 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 20:13:01 -0000 Author: jilles Date: Wed May 1 20:12:58 2013 New Revision: 250155 URL: http://svnweb.freebsd.org/changeset/base/250155 Log: Regenerate files for accept4(). Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed May 1 20:10:21 2013 (r250154) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed May 1 20:10:21 2013 (r250154) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #define FREEBSD32_SYS_syscall 0 @@ -438,4 +438,5 @@ #define FREEBSD32_SYS_bindat 538 #define FREEBSD32_SYS_connectat 539 #define FREEBSD32_SYS_chflagsat 540 -#define FREEBSD32_SYS_MAXSYSCALL 541 +#define FREEBSD32_SYS_accept4 541 +#define FREEBSD32_SYS_MAXSYSCALL 542 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ const char *freebsd32_syscallnames[] = { @@ -564,4 +564,5 @@ const char *freebsd32_syscallnames[] = { "bindat", /* 538 = bindat */ "connectat", /* 539 = connectat */ "chflagsat", /* 540 = chflagsat */ + "accept4", /* 541 = accept4 */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #include "opt_compat.h" @@ -601,4 +601,5 @@ struct sysent freebsd32_sysent[] = { { AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 538 = bindat */ { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 539 = connectat */ { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 540 = chflagsat */ + { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 541 = accept4 */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed May 1 20:12:58 2013 (r250155) @@ -3160,6 +3160,16 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* accept4 */ + case 541: { + struct accept4_args *p = params; + iarg[0] = p->s; /* int */ + uarg[1] = (intptr_t) p->name; /* struct sockaddr *__restrict */ + uarg[2] = (intptr_t) p->anamelen; /* __socklen_t *__restrict */ + iarg[3] = p->flags; /* int */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -8443,6 +8453,25 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* accept4 */ + case 541: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct sockaddr *__restrict"; + break; + case 2: + p = "__socklen_t *__restrict"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10245,6 +10274,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* accept4 */ + case 541: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/kern/init_sysent.c Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #include "opt_compat.h" @@ -575,4 +575,5 @@ struct sysent sysent[] = { { AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 538 = bindat */ { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 539 = connectat */ { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 540 = chflagsat */ + { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 541 = accept4 */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/kern/syscalls.c Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ const char *syscallnames[] = { @@ -548,4 +548,5 @@ const char *syscallnames[] = { "bindat", /* 538 = bindat */ "connectat", /* 539 = connectat */ "chflagsat", /* 540 = chflagsat */ + "accept4", /* 541 = accept4 */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/kern/systrace_args.c Wed May 1 20:12:58 2013 (r250155) @@ -3358,6 +3358,16 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* accept4 */ + case 541: { + struct accept4_args *p = params; + iarg[0] = p->s; /* int */ + uarg[1] = (intptr_t) p->name; /* struct sockaddr *__restrict */ + uarg[2] = (intptr_t) p->anamelen; /* __socklen_t *__restrict */ + iarg[3] = p->flags; /* int */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -8945,6 +8955,25 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* accept4 */ + case 541: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct sockaddr *__restrict"; + break; + case 2: + p = "__socklen_t *__restrict"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10878,6 +10907,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* accept4 */ + case 541: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Wed May 1 20:10:21 2013 (r250154) +++ head/sys/sys/syscall.h Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #define SYS_syscall 0 @@ -460,4 +460,5 @@ #define SYS_bindat 538 #define SYS_connectat 539 #define SYS_chflagsat 540 -#define SYS_MAXSYSCALL 541 +#define SYS_accept4 541 +#define SYS_MAXSYSCALL 542 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Wed May 1 20:10:21 2013 (r250154) +++ head/sys/sys/syscall.mk Wed May 1 20:12:58 2013 (r250155) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD +# created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles MIASM = \ syscall.o \ exit.o \ @@ -408,4 +408,5 @@ MIASM = \ cap_fcntls_get.o \ bindat.o \ connectat.o \ - chflagsat.o + chflagsat.o \ + accept4.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed May 1 20:10:21 2013 (r250154) +++ head/sys/sys/sysproto.h Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #ifndef _SYS_SYSPROTO_H_ @@ -1802,6 +1802,12 @@ struct chflagsat_args { char flags_l_[PADL_(u_long)]; u_long flags; char flags_r_[PADR_(u_long)]; char atflag_l_[PADL_(int)]; int atflag; char atflag_r_[PADR_(int)]; }; +struct accept4_args { + char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; + char name_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr *__restrict name; char name_r_[PADR_(struct sockaddr *__restrict)]; + char anamelen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict anamelen; char anamelen_r_[PADR_(__socklen_t *__restrict)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2192,6 +2198,7 @@ int sys_cap_fcntls_get(struct thread *, int sys_bindat(struct thread *, struct bindat_args *); int sys_connectat(struct thread *, struct connectat_args *); int sys_chflagsat(struct thread *, struct chflagsat_args *); +int sys_accept4(struct thread *, struct accept4_args *); #ifdef COMPAT_43 @@ -2896,6 +2903,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_bindat AUE_BINDAT #define SYS_AUE_connectat AUE_CONNECTAT #define SYS_AUE_chflagsat AUE_CHFLAGSAT +#define SYS_AUE_accept4 AUE_ACCEPT #undef PAD_ #undef PADL_ From owner-svn-src-all@FreeBSD.ORG Wed May 1 21:53:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A2290606; Wed, 1 May 2013 21:53:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7B5CB1566; Wed, 1 May 2013 21:53:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41LrdMm030414; Wed, 1 May 2013 21:53:39 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41LrdnL030413; Wed, 1 May 2013 21:53:39 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305012153.r41LrdnL030413@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 1 May 2013 21:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250156 - vendor/flex/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 21:53:39 -0000 Author: jkim Date: Wed May 1 21:53:38 2013 New Revision: 250156 URL: http://svnweb.freebsd.org/changeset/base/250156 Log: Clean up svn:keywords property. Modified: Directory Properties: vendor/flex/dist/FlexLexer.h (props changed) vendor/flex/dist/Makefile.am (props changed) vendor/flex/dist/Makefile.in (props changed) vendor/flex/dist/autogen.sh (props changed) vendor/flex/dist/buf.c (props changed) vendor/flex/dist/ccl.c (props changed) vendor/flex/dist/conf.in (props changed) vendor/flex/dist/configure.in (props changed) vendor/flex/dist/dfa.c (props changed) vendor/flex/dist/ecs.c (props changed) vendor/flex/dist/filter.c (props changed) vendor/flex/dist/flexdef.h (props changed) vendor/flex/dist/flexint.h (props changed) vendor/flex/dist/gen.c (props changed) vendor/flex/dist/gettext.h (props changed) vendor/flex/dist/libmain.c (props changed) vendor/flex/dist/libyywrap.c (props changed) vendor/flex/dist/main.c (props changed) vendor/flex/dist/misc.c (props changed) vendor/flex/dist/mkskel.sh (props changed) vendor/flex/dist/nfa.c (props changed) vendor/flex/dist/options.c (props changed) vendor/flex/dist/options.h (props changed) vendor/flex/dist/parse.c (props changed) vendor/flex/dist/parse.h (props changed) vendor/flex/dist/parse.y (props changed) vendor/flex/dist/regex.c (props changed) vendor/flex/dist/scan.c (props changed) vendor/flex/dist/scan.l (props changed) vendor/flex/dist/scanflags.c (props changed) vendor/flex/dist/scanopt.c (props changed) vendor/flex/dist/scanopt.h (props changed) vendor/flex/dist/skel.c (props changed) vendor/flex/dist/sym.c (props changed) vendor/flex/dist/tables.c (props changed) vendor/flex/dist/tables.h (props changed) vendor/flex/dist/tables_shared.c (props changed) vendor/flex/dist/tables_shared.h (props changed) vendor/flex/dist/tblcmp.c (props changed) vendor/flex/dist/version.h (props changed) vendor/flex/dist/yylex.c (props changed) From owner-svn-src-all@FreeBSD.ORG Wed May 1 22:07:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 961FA8B9; Wed, 1 May 2013 22:07:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF7115CB; Wed, 1 May 2013 22:07:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41M7uGn034953; Wed, 1 May 2013 22:07:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41M7u29034952; Wed, 1 May 2013 22:07:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305012207.r41M7u29034952@svn.freebsd.org> From: Rick Macklem Date: Wed, 1 May 2013 22:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250157 - head/sys/kgssapi/krb5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:07:56 -0000 Author: rmacklem Date: Wed May 1 22:07:55 2013 New Revision: 250157 URL: http://svnweb.freebsd.org/changeset/base/250157 Log: Isilon reported that sec=krb5p NFS mounts had a problem when m_len == 0 for the last mbuf of the list with an encrypted message. This patch replaces the KASSERT() with code that handles this case. Reported by: john.gemignani@isilon.com Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/kgssapi/krb5/krb5_mech.c Modified: head/sys/kgssapi/krb5/krb5_mech.c ============================================================================== --- head/sys/kgssapi/krb5/krb5_mech.c Wed May 1 21:53:38 2013 (r250156) +++ head/sys/kgssapi/krb5/krb5_mech.c Wed May 1 22:07:55 2013 (r250157) @@ -1585,6 +1585,8 @@ m_trim(struct mbuf *m, int len) struct mbuf *n; int off; + if (m == NULL) + return; n = m_getptr(m, len, &off); if (n) { n->m_len = off; @@ -1600,7 +1602,7 @@ krb5_unwrap_old(struct krb5_context *kc, uint8_t sgn_alg[2], uint8_t seal_alg[2]) { OM_uint32 res; - struct mbuf *m, *mlast, *hm, *cm; + struct mbuf *m, *mlast, *hm, *cm, *n; uint8_t *p, dir; size_t mlen, tlen, elen, datalen, padlen; size_t cklen; @@ -1702,9 +1704,25 @@ krb5_unwrap_old(struct krb5_context *kc, /* * Check the trailing pad bytes. + * RFC1964 specifies between 1<->8 bytes, each with a binary value + * equal to the number of bytes. */ - KASSERT(mlast->m_len > 0, ("Unexpected empty mbuf")); - padlen = mlast->m_data[mlast->m_len - 1]; + if (mlast->m_len > 0) + padlen = mlast->m_data[mlast->m_len - 1]; + else { + n = m_getptr(m, tlen + datalen - 1, &i); + /* + * When the position is exactly equal to the # of data bytes + * in the mbuf list, m_getptr() will return the last mbuf in + * the list and an off == m_len for that mbuf, so that case + * needs to be checked as well as a NULL return. + */ + if (n == NULL || n->m_len == i) + return (GSS_S_DEFECTIVE_TOKEN); + padlen = n->m_data[i]; + } + if (padlen < 1 || padlen > 8 || padlen > tlen + datalen) + return (GSS_S_DEFECTIVE_TOKEN); m_copydata(m, tlen + datalen - padlen, padlen, buf); for (i = 0; i < padlen; i++) { if (buf[i] != padlen) { From owner-svn-src-all@FreeBSD.ORG Wed May 1 22:16:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 902D834F; Wed, 1 May 2013 22:16:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 82A481621; Wed, 1 May 2013 22:16:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41MGT5n038457; Wed, 1 May 2013 22:16:29 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41MGTdT038456; Wed, 1 May 2013 22:16:29 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305012216.r41MGTdT038456@svn.freebsd.org> From: Rick Macklem Date: Wed, 1 May 2013 22:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250158 - head/usr.bin/nfsstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:16:29 -0000 Author: rmacklem Date: Wed May 1 22:16:29 2013 New Revision: 250158 URL: http://svnweb.freebsd.org/changeset/base/250158 Log: Document that the NFSv4 server statistics are operation counts and not RPC counts. This is a content change. MFC after: 2 weeks Modified: head/usr.bin/nfsstat/nfsstat.1 Modified: head/usr.bin/nfsstat/nfsstat.1 ============================================================================== --- head/usr.bin/nfsstat/nfsstat.1 Wed May 1 22:07:55 2013 (r250157) +++ head/usr.bin/nfsstat/nfsstat.1 Wed May 1 22:16:29 2013 (r250158) @@ -28,7 +28,7 @@ .\" From: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 14, 2012 +.Dd May 1, 2013 .Dt NFSSTAT 1 .Os .Sh NAME @@ -48,6 +48,10 @@ The command displays statistics kept about .Tn NFS client and server activity. +For the NFSv4 server, the statistics are for operations within the Compound +RPCs and not the count of RPCs. +If you wish to compare RPC counts between NFSv3 and NFSv4, you must use +statistics in the client(s). .Pp The options are as follows: .Bl -tag -width indent From owner-svn-src-all@FreeBSD.ORG Wed May 1 22:42:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 75A0214C; Wed, 1 May 2013 22:42:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 668441734; Wed, 1 May 2013 22:42:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41Mgiul047989; Wed, 1 May 2013 22:42:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41MggOO047980; Wed, 1 May 2013 22:42:42 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012242.r41MggOO047980@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 22:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250159 - in head: include lib/libc/sys sys/compat/freebsd32 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:42:44 -0000 Author: jilles Date: Wed May 1 22:42:42 2013 New Revision: 250159 URL: http://svnweb.freebsd.org/changeset/base/250159 Log: Add pipe2() system call. The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and O_NONBLOCK (on both sides) as part of the function. If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p). If the pointer is not valid, behaviour differs: pipe2() writes into the array from the kernel like socketpair() does, while pipe() writes into the array from an architecture-specific assembler wrapper. Reviewed by: kan, kib Modified: head/include/unistd.h head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/lib/libc/sys/pipe.2 head/sys/compat/freebsd32/syscalls.master head/sys/kern/capabilities.conf head/sys/kern/sys_pipe.c head/sys/kern/syscalls.master Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Wed May 1 22:16:29 2013 (r250158) +++ head/include/unistd.h Wed May 1 22:42:42 2013 (r250159) @@ -533,6 +533,7 @@ char *mktemp(char *); #endif int nfssvc(int, void *); int nlm_syscall(int, int, int, char **); +int pipe2(int *, int); int profil(char *, size_t, vm_offset_t, int); int rcmd(char **, int, const char *, const char *, const char *, int *); int rcmd_af(char **, int, const char *, Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Wed May 1 22:16:29 2013 (r250158) +++ head/lib/libc/sys/Makefile.inc Wed May 1 22:42:42 2013 (r250159) @@ -352,6 +352,7 @@ MLINKS+=pathconf.2 lpathconf.2 MLINKS+=pdfork.2 pdgetpid.2\ pdfork.2 pdkill.2 \ pdfork.2 pdwait4.2 +MLINKS+=pipe.2 pipe2.2 MLINKS+=read.2 pread.2 \ read.2 preadv.2 \ read.2 readv.2 Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Wed May 1 22:16:29 2013 (r250158) +++ head/lib/libc/sys/Symbol.map Wed May 1 22:42:42 2013 (r250159) @@ -393,6 +393,7 @@ FBSD_1.3 { ffclock_getcounter; ffclock_getestimate; ffclock_setestimate; + pipe2; posix_fadvise; wait6; }; Modified: head/lib/libc/sys/pipe.2 ============================================================================== --- head/lib/libc/sys/pipe.2 Wed May 1 22:16:29 2013 (r250158) +++ head/lib/libc/sys/pipe.2 Wed May 1 22:42:42 2013 (r250159) @@ -28,7 +28,7 @@ .\" @(#)pipe.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 30, 2006 +.Dd March 31, 2013 .Dt PIPE 2 .Os .Sh NAME @@ -40,6 +40,8 @@ .In unistd.h .Ft int .Fn pipe "int fildes[2]" +.Ft int +.Fn pipe2 "int fildes[2]" "int flags" .Sh DESCRIPTION The .Fn pipe @@ -50,6 +52,29 @@ which is an object allowing bidirectional data flow, and allocates a pair of file descriptors. .Pp +The +.Fn pipe2 +system call allows control over the attributes of the file descriptors +via the +.Fa flags +argument. +Values for +.Fa flags +are constructed by a bitwise-inclusive OR of flags from the following +list, defined in +.In fcntl.h : +.Bl -tag -width ".Dv O_NONBLOCK" +.It Dv O_CLOEXEC +Set the close-on-exec flag for the new file descriptors. +.It Dv O_NONBLOCK +Set the non-blocking flag for the ends of the pipe. +.El +.Pp +If the +.Fa flags +argument is 0, the behavior is identical to a call to +.Fn pipe . +.Pp By convention, the first descriptor is normally used as the .Em read end of the pipe, @@ -88,7 +113,9 @@ pipe in one direction. .Sh ERRORS The .Fn pipe -system call will fail if: +and +.Fn pipe2 +system calls will fail if: .Bl -tag -width Er .It Bq Er EMFILE Too many descriptors are active. @@ -97,6 +124,16 @@ The system file table is full. .It Bq Er ENOMEM Not enough kernel memory to establish a pipe. .El +.Pp +The +.Fn pipe2 +system call will also fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa flags +argument is invalid. +.El .Sh SEE ALSO .Xr sh 1 , .Xr fork 2 , @@ -111,3 +148,8 @@ function appeared in .Pp Bidirectional pipes were first used on .At V.4 . +.Pp +The +.Fn pipe2 +function appeared in +.Fx 10.0 . Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed May 1 22:16:29 2013 (r250158) +++ head/sys/compat/freebsd32/syscalls.master Wed May 1 22:42:42 2013 (r250159) @@ -1026,3 +1026,4 @@ struct sockaddr * __restrict name, \ __socklen_t * __restrict anamelen, \ int flags); } +542 AUE_PIPE NOPROTO { int pipe2(int *fildes, int flags); } Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Wed May 1 22:16:29 2013 (r250158) +++ head/sys/kern/capabilities.conf Wed May 1 22:42:42 2013 (r250159) @@ -490,6 +490,7 @@ pdkill ## Allow pipe(2). ## pipe +pipe2 ## ## Allow poll(2), which will be scoped by capability rights. Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Wed May 1 22:16:29 2013 (r250158) +++ head/sys/kern/sys_pipe.c Wed May 1 22:42:42 2013 (r250159) @@ -477,6 +477,24 @@ sys_pipe(struct thread *td, struct pipe_ return (0); } +int +sys_pipe2(struct thread *td, struct pipe2_args *uap) +{ + int error, fildes[2]; + + if (uap->flags & ~(O_CLOEXEC | O_NONBLOCK)) + return (EINVAL); + error = kern_pipe2(td, fildes, uap->flags); + if (error) + return (error); + error = copyout(fildes, uap->fildes, 2 * sizeof(int)); + if (error) { + (void)kern_close(td, fildes[0]); + (void)kern_close(td, fildes[1]); + } + return (error); +} + /* * Allocate kva for pipe circular buffer, the space is pageable * This routine will 'realloc' the size of a pipe safely, if it fails Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed May 1 22:16:29 2013 (r250158) +++ head/sys/kern/syscalls.master Wed May 1 22:42:42 2013 (r250159) @@ -976,5 +976,6 @@ struct sockaddr * __restrict name, \ __socklen_t * __restrict anamelen, \ int flags); } +542 AUE_PIPE STD { int pipe2(int *fildes, int flags); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master From owner-svn-src-all@FreeBSD.ORG Wed May 1 22:45:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE5DD2F1; Wed, 1 May 2013 22:45:07 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90ACD174B; Wed, 1 May 2013 22:45:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41Mj7Rn048525; Wed, 1 May 2013 22:45:07 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41Mj5SE048511; Wed, 1 May 2013 22:45:05 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012245.r41Mj5SE048511@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 22:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250160 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:45:07 -0000 Author: jilles Date: Wed May 1 22:45:04 2013 New Revision: 250160 URL: http://svnweb.freebsd.org/changeset/base/250160 Log: Regenerate files for pipe2(). Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed May 1 22:42:42 2013 (r250159) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed May 1 22:42:42 2013 (r250159) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #define FREEBSD32_SYS_syscall 0 @@ -439,4 +439,5 @@ #define FREEBSD32_SYS_connectat 539 #define FREEBSD32_SYS_chflagsat 540 #define FREEBSD32_SYS_accept4 541 -#define FREEBSD32_SYS_MAXSYSCALL 542 +#define FREEBSD32_SYS_pipe2 542 +#define FREEBSD32_SYS_MAXSYSCALL 543 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ const char *freebsd32_syscallnames[] = { @@ -565,4 +565,5 @@ const char *freebsd32_syscallnames[] = { "connectat", /* 539 = connectat */ "chflagsat", /* 540 = chflagsat */ "accept4", /* 541 = accept4 */ + "pipe2", /* 542 = pipe2 */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #include "opt_compat.h" @@ -602,4 +602,5 @@ struct sysent freebsd32_sysent[] = { { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 539 = connectat */ { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 540 = chflagsat */ { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 541 = accept4 */ + { AS(pipe2_args), (sy_call_t *)sys_pipe2, AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 542 = pipe2 */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed May 1 22:45:04 2013 (r250160) @@ -3170,6 +3170,14 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* pipe2 */ + case 542: { + struct pipe2_args *p = params; + uarg[0] = (intptr_t) p->fildes; /* int * */ + iarg[1] = p->flags; /* int */ + *n_args = 2; + break; + } default: *n_args = 0; break; @@ -8472,6 +8480,19 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* pipe2 */ + case 542: + switch(ndx) { + case 0: + p = "int *"; + break; + case 1: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10279,6 +10300,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* pipe2 */ + case 542: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/kern/init_sysent.c Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #include "opt_compat.h" @@ -576,4 +576,5 @@ struct sysent sysent[] = { { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 539 = connectat */ { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 540 = chflagsat */ { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 541 = accept4 */ + { AS(pipe2_args), (sy_call_t *)sys_pipe2, AUE_PIPE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 542 = pipe2 */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/kern/syscalls.c Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ const char *syscallnames[] = { @@ -549,4 +549,5 @@ const char *syscallnames[] = { "connectat", /* 539 = connectat */ "chflagsat", /* 540 = chflagsat */ "accept4", /* 541 = accept4 */ + "pipe2", /* 542 = pipe2 */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/kern/systrace_args.c Wed May 1 22:45:04 2013 (r250160) @@ -3368,6 +3368,14 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* pipe2 */ + case 542: { + struct pipe2_args *p = params; + uarg[0] = (intptr_t) p->fildes; /* int * */ + iarg[1] = p->flags; /* int */ + *n_args = 2; + break; + } default: *n_args = 0; break; @@ -8974,6 +8982,19 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* pipe2 */ + case 542: + switch(ndx) { + case 0: + p = "int *"; + break; + case 1: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10912,6 +10933,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* pipe2 */ + case 542: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Wed May 1 22:42:42 2013 (r250159) +++ head/sys/sys/syscall.h Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #define SYS_syscall 0 @@ -461,4 +461,5 @@ #define SYS_connectat 539 #define SYS_chflagsat 540 #define SYS_accept4 541 -#define SYS_MAXSYSCALL 542 +#define SYS_pipe2 542 +#define SYS_MAXSYSCALL 543 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Wed May 1 22:42:42 2013 (r250159) +++ head/sys/sys/syscall.mk Wed May 1 22:45:04 2013 (r250160) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles +# created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles MIASM = \ syscall.o \ exit.o \ @@ -409,4 +409,5 @@ MIASM = \ bindat.o \ connectat.o \ chflagsat.o \ - accept4.o + accept4.o \ + pipe2.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed May 1 22:42:42 2013 (r250159) +++ head/sys/sys/sysproto.h Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #ifndef _SYS_SYSPROTO_H_ @@ -1808,6 +1808,10 @@ struct accept4_args { char anamelen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict anamelen; char anamelen_r_[PADR_(__socklen_t *__restrict)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; +struct pipe2_args { + char fildes_l_[PADL_(int *)]; int * fildes; char fildes_r_[PADR_(int *)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2199,6 +2203,7 @@ int sys_bindat(struct thread *, struct b int sys_connectat(struct thread *, struct connectat_args *); int sys_chflagsat(struct thread *, struct chflagsat_args *); int sys_accept4(struct thread *, struct accept4_args *); +int sys_pipe2(struct thread *, struct pipe2_args *); #ifdef COMPAT_43 @@ -2904,6 +2909,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_connectat AUE_CONNECTAT #define SYS_AUE_chflagsat AUE_CHFLAGSAT #define SYS_AUE_accept4 AUE_ACCEPT +#define SYS_AUE_pipe2 AUE_PIPE #undef PAD_ #undef PADL_ From owner-svn-src-all@FreeBSD.ORG Wed May 1 22:47:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD6A6479; Wed, 1 May 2013 22:47:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEE251759; Wed, 1 May 2013 22:47:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41Mll0a049001; Wed, 1 May 2013 22:47:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41MllDH048999; Wed, 1 May 2013 22:47:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012247.r41MllDH048999@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 22:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250161 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:47:47 -0000 Author: jilles Date: Wed May 1 22:47:47 2013 New Revision: 250161 URL: http://svnweb.freebsd.org/changeset/base/250161 Log: accept(2), pipe(2): Fix .Dd. Modified: head/lib/libc/sys/accept.2 head/lib/libc/sys/pipe.2 Modified: head/lib/libc/sys/accept.2 ============================================================================== --- head/lib/libc/sys/accept.2 Wed May 1 22:45:04 2013 (r250160) +++ head/lib/libc/sys/accept.2 Wed May 1 22:47:47 2013 (r250161) @@ -28,7 +28,7 @@ .\" @(#)accept.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd April 22, 2013 +.Dd May 1, 2013 .Dt ACCEPT 2 .Os .Sh NAME Modified: head/lib/libc/sys/pipe.2 ============================================================================== --- head/lib/libc/sys/pipe.2 Wed May 1 22:45:04 2013 (r250160) +++ head/lib/libc/sys/pipe.2 Wed May 1 22:47:47 2013 (r250161) @@ -28,7 +28,7 @@ .\" @(#)pipe.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 31, 2013 +.Dd May 1, 2013 .Dt PIPE 2 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Wed May 1 22:50:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1B6196B2; Wed, 1 May 2013 22:50:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E4B317B1; Wed, 1 May 2013 22:50:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41MojAw051125; Wed, 1 May 2013 22:50:45 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41Mojtt051124; Wed, 1 May 2013 22:50:45 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305012250.r41Mojtt051124@svn.freebsd.org> From: Rick Macklem Date: Wed, 1 May 2013 22:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250162 - head/usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:50:46 -0000 Author: rmacklem Date: Wed May 1 22:50:45 2013 New Revision: 250162 URL: http://svnweb.freebsd.org/changeset/base/250162 Log: Document the fact that an NFSv4 mount against a volume on the same host can result in a hung NFS server and is not recommended. This is a content change. MFC after: 2 weeks Modified: head/usr.sbin/nfsd/nfsv4.4 Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Wed May 1 22:47:47 2013 (r250161) +++ head/usr.sbin/nfsd/nfsv4.4 Wed May 1 22:50:45 2013 (r250162) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2012 +.Dd May 1, 2013 .Dt NFSV4 4 .Os .Sh NAME @@ -287,6 +287,13 @@ and daemons at boot time via the ``nfsuserd_flags'' and ``nfscbd_flags'' .Xr rc.conf 5 variables. +.Pp +NFSv4 mount(s) against exported volume(s) on the same host are not recommended, +since this can result in a hung NFS server. +It occurs when an nfsd thread tries to do an NFSv4 VOP_RECLAIM()/Close RPC +as part of acquiring a new vnode. +If all other nfsd threads are blocked waiting for lock(s) held by this nfsd +thread, then there isn't an nfsd thread to service the Close RPC. .Sh FILES .Bl -tag -width /var/db/nfs-stablerestart.bak -compact .It Pa /var/db/nfs-stablerestart From owner-svn-src-all@FreeBSD.ORG Wed May 1 23:04:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 11F4EA4E; Wed, 1 May 2013 23:04:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04ADA1806; Wed, 1 May 2013 23:04:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41N4T2H055388; Wed, 1 May 2013 23:04:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41N4TiU055387; Wed, 1 May 2013 23:04:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012304.r41N4TiU055387@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 23:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250163 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 23:04:30 -0000 Author: jilles Date: Wed May 1 23:04:29 2013 New Revision: 250163 URL: http://svnweb.freebsd.org/changeset/base/250163 Log: Bump __FreeBSD_version for accept4() and pipe2(). Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed May 1 22:50:45 2013 (r250162) +++ head/sys/sys/param.h Wed May 1 23:04:29 2013 (r250163) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000031 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000032 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Wed May 1 23:58:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D8247C11; Wed, 1 May 2013 23:58:39 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B123B1AC1; Wed, 1 May 2013 23:58:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41NwdQ7074236; Wed, 1 May 2013 23:58:39 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41NwdCB074235; Wed, 1 May 2013 23:58:39 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201305012358.r41NwdCB074235@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 1 May 2013 23:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250164 - head/contrib/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 23:58:39 -0000 Author: sjg Date: Wed May 1 23:58:39 2013 New Revision: 250164 URL: http://svnweb.freebsd.org/changeset/base/250164 Log: Local hack to allow smooth transition for ports. bsd.port.mk can set .MAKE.FreeBSD_UL=yes to cause :L and :U to have their old behavior. This should be reverted when 8.3 is EOL. PR: 173299 Reviewed by: obrien Modified: head/contrib/bmake/var.c Modified: head/contrib/bmake/var.c ============================================================================== --- head/contrib/bmake/var.c Wed May 1 23:04:29 2013 (r250163) +++ head/contrib/bmake/var.c Wed May 1 23:58:39 2013 (r250164) @@ -140,6 +140,17 @@ __RCSID("$NetBSD: var.c,v 1.173 2013/02/ #include "job.h" /* + * XXX transition hack for FreeBSD ports. + * bsd.port.mk can set .MAKE.FreeBSD_UL=yes + * to cause us to treat :[LU] as aliases for :t[lu] + * To be reverted when ports converts to :t[lu] (when 8.3 is EOL) + */ +#define MAKE_FREEBSD_UL ".MAKE.FreeBSD_UL" +#ifdef MAKE_FREEBSD_UL +static int FreeBSD_UL = FALSE; +#endif + +/* * This lets us tell if we have replaced the original environ * (which we cannot free). */ @@ -965,6 +976,11 @@ Var_Set(const char *name, const char *va setenv(MAKE_LEVEL_SAFE, tmp, 1); #endif } +#ifdef MAKE_FREEBSD_UL + if (strcmp(MAKE_FREEBSD_UL, name) == 0) { + FreeBSD_UL = getBoolean(MAKE_FREEBSD_UL, FALSE); + } +#endif out: @@ -2660,8 +2676,24 @@ ApplyModifiers(char *nstr, const char *t free(loop.str); break; } - case 'D': case 'U': +#ifdef MAKE_FREEBSD_UL + if (FreeBSD_UL) { + int nc = tstr[1]; + + /* we have to be careful, since :U is used internally */ + if (nc == ':' || nc == endc) { + char *dp = bmake_strdup(nstr); + for (newStr = dp; *dp; dp++) + *dp = toupper((unsigned char)*dp); + cp = tstr + 1; + termc = *cp; + break; /* yes inside the conditional */ + } + /* FALLTHROUGH */ + } +#endif + case 'D': { Buffer buf; /* Buffer for patterns */ int wantit; /* want data in buffer */ @@ -2721,6 +2753,17 @@ ApplyModifiers(char *nstr, const char *t break; } case 'L': +#ifdef MAKE_FREEBSD_UL + if (FreeBSD_UL) { + char *dp = bmake_strdup(nstr); + for (newStr = dp; *dp; dp++) + *dp = tolower((unsigned char)*dp); + cp = tstr + 1; + termc = *cp; + break; + } + /* FALLTHROUGH */ +#endif { if ((v->flags & VAR_JUNK) != 0) v->flags |= VAR_KEEP; From owner-svn-src-all@FreeBSD.ORG Thu May 2 00:40:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F3C37237; Thu, 2 May 2013 00:40:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E61231CA8; Thu, 2 May 2013 00:40:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r420ejOT088910; Thu, 2 May 2013 00:40:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r420ejb7088909; Thu, 2 May 2013 00:40:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305020040.r420ejb7088909@svn.freebsd.org> From: Adrian Chadd Date: Thu, 2 May 2013 00:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250165 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 00:40:46 -0000 Author: adrian Date: Thu May 2 00:40:45 2013 New Revision: 250165 URL: http://svnweb.freebsd.org/changeset/base/250165 Log: Add the AR933x SoC GPIO pin count limitation. Modified: head/sys/mips/atheros/ar71xx_gpio.c Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Wed May 1 23:58:39 2013 (r250164) +++ head/sys/mips/atheros/ar71xx_gpio.c Thu May 2 00:40:45 2013 (r250165) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "gpio_if.h" @@ -136,6 +137,10 @@ ar71xx_gpio_pin_max(device_t dev, int *m case AR71XX_SOC_AR7242: *maxpin = AR724X_GPIO_PINS - 1; break; + case AR71XX_SOC_AR9330: + case AR71XX_SOC_AR9331: + *maxpin = AR933X_GPIO_COUNT - 1; + break; default: *maxpin = AR71XX_GPIO_PINS - 1; } From owner-svn-src-all@FreeBSD.ORG Thu May 2 00:59:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3DEC55CD; Thu, 2 May 2013 00:59:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 169831D4A; Thu, 2 May 2013 00:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r420xegF095257; Thu, 2 May 2013 00:59:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r420xe3Y095253; Thu, 2 May 2013 00:59:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305020059.r420xe3Y095253@svn.freebsd.org> From: Adrian Chadd Date: Thu, 2 May 2013 00:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250166 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal dev/ath/ath_hal/ar9003 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 00:59:41 -0000 Author: adrian Date: Thu May 2 00:59:39 2013 New Revision: 250166 URL: http://svnweb.freebsd.org/changeset/base/250166 Log: Add device identification and probe/attach support for the QCA9565. The QCA9565 is a 1x1 2.4GHz 11n chip with integrated on-chip bluetooth. The AR9300 HAL already has support for this chip; it just wasn't included in the probe/attach path. Tested: * This commit brought to you over a QCA9565 wifi connection from FreeBSD. * .. ie, basic STA, pings, no iperf or antenna diversity checking just yet. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah_devid.h head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Thu May 2 00:40:45 2013 (r250165) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Thu May 2 00:59:39 2013 (r250166) @@ -4089,6 +4089,8 @@ ar9300_probe(uint16_t vendorid, uint16_t return "Atheros AR933x"; case AR9300_DEVID_QCA955X: /* Scorpion */ return "Qualcomm Atheros QCA955x"; + case AR9300_DEVID_QCA9565: /* Aphrodite */ + return "Qualcomm Atheros AR9565"; default: return AH_NULL; } Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu May 2 00:40:45 2013 (r250165) +++ head/sys/dev/ath/ath_hal/ah.c Thu May 2 00:59:39 2013 (r250166) @@ -139,6 +139,9 @@ ath_hal_mac_name(struct ath_hal *ah) return "9550"; case AR_SREV_VERSION_AR9485: return "9485"; + case AR_SREV_VERSION_QCA9565: + /* XXX should say QCA, not AR */ + return "9565"; } return "????"; } Modified: head/sys/dev/ath/ath_hal/ah_devid.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_devid.h Thu May 2 00:40:45 2013 (r250165) +++ head/sys/dev/ath/ath_hal/ah_devid.h Thu May 2 00:59:39 2013 (r250166) @@ -91,6 +91,7 @@ #define AR9300_DEVID_AR9580_PCIE 0x0033 #define AR9300_DEVID_AR946X_PCIE 0x0034 #define AR9300_DEVID_AR9330 0x0035 +#define AR9300_DEVID_QCA9565 0x0036 #define AR9300_DEVID_QCA955X 0x0039 #define AR_SUBVENDOR_ID_NOG 0x0e11 /* No 11G subvendor ID */ Modified: head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h Thu May 2 00:40:45 2013 (r250165) +++ head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h Thu May 2 00:59:39 2013 (r250166) @@ -48,6 +48,7 @@ #define AR_SREV_VERSION_AR9380 0x1C0 #define AR_SREV_VERSION_AR9580 0x1C0 #define AR_SREV_VERSION_AR9460 0x280 +#define AR_SREV_VERSION_QCA9565 0x2c0 #define AR_SREV_VERSION_AR9330 0x200 #define AR_SREV_VERSION_AR9340 0x300 From owner-svn-src-all@FreeBSD.ORG Thu May 2 01:35:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 198DCA1A; Thu, 2 May 2013 01:35:06 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6841E51; Thu, 2 May 2013 01:35:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r421Z6D5009048; Thu, 2 May 2013 01:35:06 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r421Z2W0009017; Thu, 2 May 2013 01:35:02 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201305020135.r421Z2W0009017@svn.freebsd.org> From: Gregory Neil Shapiro Date: Thu, 2 May 2013 01:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r250167 - in releng/8.4/contrib/sendmail: . cf/cf cf/m4 contrib doc/op include/sm libmilter libsm mailstats makemap praliases rmail src test vacation X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 01:35:06 -0000 Author: gshapiro Date: Thu May 2 01:35:02 2013 New Revision: 250167 URL: http://svnweb.freebsd.org/changeset/base/250167 Log: MFC: Merge sendmail 8.14.7 from stable/8 Approved by: re (delphij) Added: releng/8.4/contrib/sendmail/libsm/t-fget.c - copied unchanged from r249868, stable/8/contrib/sendmail/libsm/t-fget.c Modified: releng/8.4/contrib/sendmail/CACerts releng/8.4/contrib/sendmail/FREEBSD-upgrade releng/8.4/contrib/sendmail/PGPKEYS releng/8.4/contrib/sendmail/RELEASE_NOTES releng/8.4/contrib/sendmail/cf/cf/submit.cf releng/8.4/contrib/sendmail/cf/m4/version.m4 releng/8.4/contrib/sendmail/contrib/etrn.pl releng/8.4/contrib/sendmail/doc/op/op.me releng/8.4/contrib/sendmail/include/sm/config.h releng/8.4/contrib/sendmail/include/sm/io.h releng/8.4/contrib/sendmail/libmilter/Makefile.m4 releng/8.4/contrib/sendmail/libmilter/sm_gethost.c releng/8.4/contrib/sendmail/libsm/Makefile.m4 releng/8.4/contrib/sendmail/libsm/cf.c releng/8.4/contrib/sendmail/libsm/fget.c releng/8.4/contrib/sendmail/mailstats/mailstats.c releng/8.4/contrib/sendmail/makemap/makemap.c releng/8.4/contrib/sendmail/praliases/praliases.c releng/8.4/contrib/sendmail/rmail/rmail.c releng/8.4/contrib/sendmail/src/Makefile.m4 releng/8.4/contrib/sendmail/src/alias.c releng/8.4/contrib/sendmail/src/collect.c releng/8.4/contrib/sendmail/src/conf.c releng/8.4/contrib/sendmail/src/control.c releng/8.4/contrib/sendmail/src/deliver.c releng/8.4/contrib/sendmail/src/main.c releng/8.4/contrib/sendmail/src/map.c releng/8.4/contrib/sendmail/src/mci.c releng/8.4/contrib/sendmail/src/milter.c releng/8.4/contrib/sendmail/src/mime.c releng/8.4/contrib/sendmail/src/parseaddr.c releng/8.4/contrib/sendmail/src/queue.c releng/8.4/contrib/sendmail/src/readcf.c releng/8.4/contrib/sendmail/src/recipient.c releng/8.4/contrib/sendmail/src/savemail.c releng/8.4/contrib/sendmail/src/sendmail.h releng/8.4/contrib/sendmail/src/sfsasl.c releng/8.4/contrib/sendmail/src/srvrsmtp.c releng/8.4/contrib/sendmail/src/tls.c releng/8.4/contrib/sendmail/src/usersmtp.c releng/8.4/contrib/sendmail/src/util.c releng/8.4/contrib/sendmail/src/version.c releng/8.4/contrib/sendmail/test/Makefile.m4 releng/8.4/contrib/sendmail/vacation/vacation.c Directory Properties: releng/8.4/contrib/sendmail/ (props changed) Modified: releng/8.4/contrib/sendmail/CACerts ============================================================================== --- releng/8.4/contrib/sendmail/CACerts Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/CACerts Thu May 2 01:35:02 2013 (r250167) @@ -1,4 +1,4 @@ -# $Id: CACerts,v 8.5 2011/05/06 23:05:10 ca Exp $ +# $Id: CACerts,v 8.6 2013/01/18 15:14:17 ca Exp $ # This file contains some CA certificates that are used to sign the # certificates of mail servers of members of the sendmail consortium # who may reply to questions etc sent to sendmail.org. @@ -10,93 +10,93 @@ Certificate: Data: Version: 3 (0x2) Serial Number: - c2:3c:61:67:3b:0a:cc:5e - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2009/emailAddress=ca+ca-rsa2009@esmtp.org + f1:41:b3:3d:ba:bd:33:49 + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org Validity - Not Before: May 14 04:42:18 2009 GMT - Not After : May 13 04:42:18 2012 GMT - Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2009/emailAddress=ca+ca-rsa2009@esmtp.org + Not Before: Mar 10 02:47:46 2012 GMT + Not After : Mar 10 02:47:46 2015 GMT + Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org Subject Public Key Info: Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:d5:f8:d3:48:38:75:df:2e:6b:8b:c4:8d:1d:41: - 5e:ad:4b:96:3d:48:c2:dc:e5:ff:61:98:95:32:03: - e9:b6:71:5a:68:31:bc:e1:5c:aa:0e:70:a7:bc:51: - b7:13:6a:78:54:ae:a6:d0:44:49:1b:5e:37:5b:59: - 20:01:47:a7:ec:41:4c:11:79:8c:25:c1:1b:c0:ed: - 85:b2:de:0f:10:9f:e7:b2:a3:c4:f1:fc:85:51:aa: - d6:68:49:51:3e:04:e1:eb:e9:cd:87:1b:d0:9d:97: - 7b:4c:e1:1e:b1:6a:be:01:0a:a9:97:9a:50:89:e3: - 66:06:4c:07:cb:7e:99:70:13:e8:b4:9c:e7:e6:52: - 38:c0:64:90:42:d0:f5:cf:22:46:22:60:e9:34:70: - 1d:e3:d1:13:33:3a:31:ba:13:06:a8:c2:34:90:47: - c5:a1:bd:2d:7d:98:21:70:de:22:d0:13:11:e5:08: - dd:a0:77:0b:df:34:a7:07:55:de:5a:71:f6:6c:9e: - ec:f7:45:75:1f:22:a9:84:06:c6:4f:84:3d:4e:05: - d7:e4:e5:98:41:61:7b:8e:c9:3b:a6:ed:31:80:7d: - fd:fa:f0:dc:b7:07:82:b8:ec:27:20:39:5f:78:95: - f1:0d:93:8d:f9:4d:21:08:fd:72:89:01:ff:2c:a0: - 71:9d + Public-Key: (2048 bit) + Modulus: + 00:a2:80:fc:c6:ce:7f:60:38:65:f4:38:f9:7a:d9: + 87:fd:47:eb:3f:2c:4a:c9:38:77:6a:77:94:92:7f: + 83:3d:99:57:2c:5f:37:bb:ba:12:10:17:56:fa:eb: + 43:a6:4b:4c:1e:30:32:07:94:2f:5a:d8:65:49:29: + fa:24:d1:f0:0b:45:2d:e5:d5:cb:7d:60:dc:a6:ce: + a4:47:35:30:ee:5e:8d:c2:30:e7:a7:63:32:b0:59: + 80:cc:8c:99:64:77:8f:50:8e:88:51:47:36:ea:9a: + f3:b4:c0:8c:a6:ab:c6:42:57:88:b9:5f:9f:61:15: + bb:79:65:93:ca:a9:fd:17:eb:87:26:8b:eb:b7:2b: + 7e:33:05:2b:ba:c0:46:f7:08:fd:da:c1:50:9b:3d: + 26:83:5c:53:97:89:2c:cc:5f:f2:7b:a8:b7:3d:fb: + f2:b4:89:0d:43:ef:18:5c:21:75:71:cc:f0:c2:a3: + 84:69:c0:a7:f3:9b:de:c1:c7:5a:5c:7e:68:da:49: + 71:af:58:a8:51:9f:bd:f9:3d:bb:a5:92:fa:7b:1d: + 52:f5:fe:90:59:95:27:65:a4:af:97:9a:4f:01:39: + 59:7d:08:6f:a1:8f:42:47:49:bf:12:52:53:39:74: + 8d:62:3b:bd:4c:4f:05:0f:c4:b9:3e:da:a8:0e:96: + 05:2d Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - A7:61:FA:31:AF:A8:E2:5E:93:B6:84:9E:74:08:A2:76:50:87:69:7C + 08:38:E3:88:92:53:6E:F1:56:69:27:44:B5:4C:A0:18:CA:06:97:EB X509v3 Authority Key Identifier: - keyid:A7:61:FA:31:AF:A8:E2:5E:93:B6:84:9E:74:08:A2:76:50:87:69:7C - DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=Claus Assmann CA RSA 2009/emailAddress=ca+ca-rsa2009@esmtp.org - serial:C2:3C:61:67:3B:0A:CC:5E + keyid:08:38:E3:88:92:53:6E:F1:56:69:27:44:B5:4C:A0:18:CA:06:97:EB + DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=Claus Assmann CA RSA 2012/emailAddress=ca+ca-rsa2012@esmtp.org + serial:F1:41:B3:3D:BA:BD:33:49 X509v3 Basic Constraints: - CA:TRUE + CA:TRUE X509v3 Subject Alternative Name: - email:ca+ca-rsa2009@esmtp.org + email:ca+ca-rsa2012@esmtp.org X509v3 Issuer Alternative Name: - email:ca+ca-rsa2009@esmtp.org - Signature Algorithm: md5WithRSAEncryption - b3:38:e0:da:a8:07:d8:cc:b8:4d:8c:20:a6:06:2c:f8:27:db: - 8e:28:0f:39:bd:d9:24:c7:9f:e0:4d:d6:b6:63:42:36:0f:d8: - 70:41:e7:9e:a2:24:64:05:ea:85:97:ac:f2:cc:c2:a6:71:bb: - 30:21:c1:c7:c4:54:34:1d:30:09:f0:9b:74:27:93:59:12:4c: - 53:0b:8c:3e:d0:39:ed:4a:d0:d9:66:24:d8:e7:e5:9c:a8:6d: - 5f:56:5d:9a:91:fe:1b:7d:b9:7c:79:9e:1c:b9:71:74:14:f8: - 0c:30:50:f9:b1:22:56:a8:4d:6f:4b:9b:e5:8a:81:33:1b:77: - 75:f6:d8:ce:d4:90:34:86:34:d1:86:75:a9:e1:23:e6:af:c1: - 8e:28:97:47:20:4d:1b:57:09:39:f4:56:01:d2:87:43:3e:29: - f6:c4:5b:7d:8f:9e:bd:ad:36:79:cf:09:70:43:30:21:98:23: - 31:c8:0d:39:ee:77:e1:4a:44:1a:5c:79:2f:6c:ec:8a:3c:db: - 99:a0:11:bc:1a:46:24:51:e7:75:d6:9a:db:ad:dd:55:d4:dd: - ca:81:a0:10:77:96:91:9c:76:30:38:18:f0:82:43:b3:7c:41: - 64:4c:4e:da:66:22:67:cf:b7:d7:10:ba:ed:f4:6d:43:59:00: - d0:82:1e:07 + email:ca+ca-rsa2012@esmtp.org + Signature Algorithm: sha1WithRSAEncryption + 9a:8f:4d:23:5b:30:80:e1:94:e4:66:9c:3a:17:8b:79:49:5b: + ec:5d:e5:a1:22:2d:71:37:a1:51:e7:1d:b1:0d:a9:9b:aa:a9: + 0d:c7:cd:d6:24:f9:e0:f0:57:be:4f:74:0c:4b:7a:42:4c:70: + 19:2e:8e:eb:cb:1b:00:26:27:eb:1c:42:33:d5:ec:32:b4:6c: + 7d:a3:04:a1:5c:00:49:c9:0d:4c:4d:28:37:06:22:77:ec:40: + 15:25:3a:23:84:ae:1f:da:90:dd:c9:dc:27:ee:7c:ec:e5:df: + b8:ba:1e:3f:ee:c2:91:a2:3f:22:92:1e:f3:06:7e:aa:e9:c3: + 11:2d:3d:2f:85:f7:fc:d7:e2:f8:6d:70:a6:40:62:69:e7:52: + ed:1b:19:38:72:86:08:a1:3d:47:c8:68:82:41:db:db:2a:52: + 25:d7:49:aa:9e:c5:83:22:7d:2f:0b:df:8c:90:2d:b5:aa:33: + c7:9b:e8:39:8f:bb:79:5b:13:2d:4e:a9:69:59:c7:09:26:e2: + b5:53:80:86:72:bb:7c:be:e9:46:5b:d8:b2:78:42:d6:5d:c3: + bb:3a:3b:5f:0f:e8:c3:60:fb:88:9f:3a:2b:9f:d3:7d:9f:c7: + 32:aa:4d:34:a7:66:a1:25:16:95:a6:69:e7:86:a3:5c:b9:b9: + df:58:05:e3 -----BEGIN CERTIFICATE----- -MIIFJzCCBA+gAwIBAgIJAMI8YWc7CsxeMA0GCSqGSIb3DQEBBAUAMIGlMQswCQYD +MIIFJzCCBA+gAwIBAgIJAPFBsz26vTNJMA0GCSqGSIb3DQEBBQUAMIGlMQswCQYD VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIQmVya2VsZXkx FDASBgNVBAoTC0VuZG1haWwgT3JnMQwwCgYDVQQLEwNNVEExIjAgBgNVBAMTGUNs -YXVzIEFzc21hbm4gQ0EgUlNBIDIwMDkxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz -YTIwMDlAZXNtdHAub3JnMB4XDTA5MDUxNDA0NDIxOFoXDTEyMDUxMzA0NDIxOFow +YXVzIEFzc21hbm4gQ0EgUlNBIDIwMTIxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz +YTIwMTJAZXNtdHAub3JnMB4XDTEyMDMxMDAyNDc0NloXDTE1MDMxMDAyNDc0Nlow gaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhC ZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAKBgNVBAsTA01UQTEiMCAG -A1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAwOTEmMCQGCSqGSIb3DQEJARYX -Y2ErY2EtcnNhMjAwOUBlc210cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDV+NNIOHXfLmuLxI0dQV6tS5Y9SMLc5f9hmJUyA+m2cVpoMbzhXKoO -cKe8UbcTanhUrqbQREkbXjdbWSABR6fsQUwReYwlwRvA7YWy3g8Qn+eyo8Tx/IVR -qtZoSVE+BOHr6c2HG9Cdl3tM4R6xar4BCqmXmlCJ42YGTAfLfplwE+i0nOfmUjjA -ZJBC0PXPIkYiYOk0cB3j0RMzOjG6EwaowjSQR8WhvS19mCFw3iLQExHlCN2gdwvf -NKcHVd5acfZsnuz3RXUfIqmEBsZPhD1OBdfk5ZhBYXuOyTum7TGAff368Ny3B4K4 -7CcgOV94lfENk435TSEI/XKJAf8soHGdAgMBAAGjggFWMIIBUjAdBgNVHQ4EFgQU -p2H6Ma+o4l6TtoSedAiidlCHaXwwgdoGA1UdIwSB0jCBz4AUp2H6Ma+o4l6TtoSe -dAiidlCHaXyhgaukgagwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9y +A1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxMjEmMCQGCSqGSIb3DQEJARYX +Y2ErY2EtcnNhMjAxMkBlc210cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCigPzGzn9gOGX0OPl62Yf9R+s/LErJOHdqd5SSf4M9mVcsXze7uhIQ +F1b660OmS0weMDIHlC9a2GVJKfok0fALRS3l1ct9YNymzqRHNTDuXo3CMOenYzKw +WYDMjJlkd49QjohRRzbqmvO0wIymq8ZCV4i5X59hFbt5ZZPKqf0X64cmi+u3K34z +BSu6wEb3CP3awVCbPSaDXFOXiSzMX/J7qLc9+/K0iQ1D7xhcIXVxzPDCo4RpwKfz +m97Bx1pcfmjaSXGvWKhRn735Pbulkvp7HVL1/pBZlSdlpK+Xmk8BOVl9CG+hj0JH +Sb8SUlM5dI1iO71MTwUPxLk+2qgOlgUtAgMBAAGjggFWMIIBUjAdBgNVHQ4EFgQU +CDjjiJJTbvFWaSdEtUygGMoGl+swgdoGA1UdIwSB0jCBz4AUCDjjiJJTbvFWaSdE +tUygGMoGl+uhgaukgagwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9y bmlhMREwDwYDVQQHEwhCZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAK -BgNVBAsTA01UQTEiMCAGA1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAwOTEm -MCQGCSqGSIb3DQEJARYXY2ErY2EtcnNhMjAwOUBlc210cC5vcmeCCQDCPGFnOwrM -XjAMBgNVHRMEBTADAQH/MCIGA1UdEQQbMBmBF2NhK2NhLXJzYTIwMDlAZXNtdHAu -b3JnMCIGA1UdEgQbMBmBF2NhK2NhLXJzYTIwMDlAZXNtdHAub3JnMA0GCSqGSIb3 -DQEBBAUAA4IBAQCzOODaqAfYzLhNjCCmBiz4J9uOKA85vdkkx5/gTda2Y0I2D9hw -QeeeoiRkBeqFl6zyzMKmcbswIcHHxFQ0HTAJ8Jt0J5NZEkxTC4w+0DntStDZZiTY -5+WcqG1fVl2akf4bfbl8eZ4cuXF0FPgMMFD5sSJWqE1vS5vlioEzG3d19tjO1JA0 -hjTRhnWp4SPmr8GOKJdHIE0bVwk59FYB0odDPin2xFt9j569rTZ5zwlwQzAhmCMx -yA057nfhSkQaXHkvbOyKPNuZoBG8GkYkUed11prbrd1V1N3KgaAQd5aRnHYwOBjw -gkOzfEFkTE7aZiJnz7fXELrt9G1DWQDQgh4H +BgNVBAsTA01UQTEiMCAGA1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAxMjEm +MCQGCSqGSIb3DQEJARYXY2ErY2EtcnNhMjAxMkBlc210cC5vcmeCCQDxQbM9ur0z +STAMBgNVHRMEBTADAQH/MCIGA1UdEQQbMBmBF2NhK2NhLXJzYTIwMTJAZXNtdHAu +b3JnMCIGA1UdEgQbMBmBF2NhK2NhLXJzYTIwMTJAZXNtdHAub3JnMA0GCSqGSIb3 +DQEBBQUAA4IBAQCaj00jWzCA4ZTkZpw6F4t5SVvsXeWhIi1xN6FR5x2xDambqqkN +x83WJPng8Fe+T3QMS3pCTHAZLo7ryxsAJifrHEIz1ewytGx9owShXABJyQ1MTSg3 +BiJ37EAVJTojhK4f2pDdydwn7nzs5d+4uh4/7sKRoj8ikh7zBn6q6cMRLT0vhff8 +1+L4bXCmQGJp51LtGxk4coYIoT1HyGiCQdvbKlIl10mqnsWDIn0vC9+MkC21qjPH +m+g5j7t5WxMtTqlpWccJJuK1U4CGcrt8vulGW9iyeELWXcO7OjtfD+jDYPuInzor +n9N9n8cyqk00p2ahJRaVpmnnhqNcubnfWAXj -----END CERTIFICATE----- Modified: releng/8.4/contrib/sendmail/FREEBSD-upgrade ============================================================================== --- releng/8.4/contrib/sendmail/FREEBSD-upgrade Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/FREEBSD-upgrade Thu May 2 01:35:02 2013 (r250167) @@ -1,6 +1,6 @@ $FreeBSD$ -sendmail 8.14.6 +sendmail 8.14.7 originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/ For the import of sendmail, the following directories were renamed: @@ -97,4 +97,4 @@ infrastructure in FreeBSD: usr.sbin/mailwrapper/Makefile gshapiro@FreeBSD.org -29-December-2012 +21-April-2013 Modified: releng/8.4/contrib/sendmail/PGPKEYS ============================================================================== --- releng/8.4/contrib/sendmail/PGPKEYS Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/PGPKEYS Thu May 2 01:35:02 2013 (r250167) @@ -142,6 +142,143 @@ gpExpdV7qPrw9k01j5rod5PjZlG8zV0= -----END PGP PUBLIC KEY BLOCK----- Type Bits KeyID Created Expires Algorithm Use +pub 2048 5207CAD3 2013-01-02 ------- RSA Sign & Encrypt +fingerprint: B87D 4569 86F1 9484 07E5 CCB4 3D68 B25D 5207 CAD3 +uid Sendmail Signing Key/2013 + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.13 (Darwin) + +mQENBFDkiE4BCAC7jVxyAGrnqq7bW4lAe83CxIUT4YHb+Ai49cecSCeOGqPSdlcg +NYdNzi7KKpF9r4ShSctw2mHqWkwE7AimgJL3w5Iw026YtFrGfB5KHnBIC3dWKiJu +ZM20qKx0Y5KqLjZStlajHL/gfhzhHEZXMcgFbYMGQ57Yuug8eEdmBb9ihgQgosdT +RmdNH5zqch4G3Yf246JqeyESBCi8NHbOHzdfEWze3H2mGRmGeKfcnKRPlZV9OEdG +E6ZEN6FBMghthZRa0f0AWw34YGxtvIAXOm/as64qpzJ2ebbH4HWvNRAaWetARG/I +4OwCkvcpqFROXXFOALlFJiAiXkK1RRPcPWyJABEBAAG0MVNlbmRtYWlsIFNpZ25p +bmcgS2V5LzIwMTMgPHNlbmRtYWlsQFNlbmRtYWlsLk9SRz6JATkEEwECACMFAlDk +iE4CGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRA9aLJdUgfK02WeB/9r +tNy5h/ouE9ixuzIDd7q5/n5ApIu0dnjLrieoOIgKPKLUwQMO18cjueKtRcAk1NP/ +BTYodw1rPOuZrtlgIltoAz4EN14SDGqiVVhgNkJVazOQ/4V0/zVAg+AZAngC3IFY +MXI99/HOnhTTZ+lHwDbvZdNu/yY0LDOl0VO41atRD9A/ujbRbjQL+QCkabi+M0Vr +Boz/4JKxbidsG41JFGQMTJxXuglZOWagB/T30/pYR5kxlTT5w7Y++JTGpOsvfAoP +B5wp1rTtsA5d7+oxmmwHBBIlDFidWTt2y8Hk1E+Fx+zHLvqdG6qZuxgtdA1g+DSx +MBbgmUztfAJsRKAJw91RiQEcBBABAgAGBQJQ5Ij4AAoJEI5a6fvO7vQ7IVwH/2U+ +K1L0/wP+Qgbb6Ge+Q6Px0x5YltJE56AoDgjAQof0jVgXXXJXb7uy+KIZnvBRdDeU +4z25qLFCAAoI1Coeu+DStv3q1MauQ6i05EG4qnK0h/VHRKsaGpgBpU6Q0HUzCeUj ++jedYsBxUjKlIQgbNbKh8rc/q38q8zGP5gswH+gbiO4gfLE5vUD+c/j3Bk7vTwjH +wcS82QznXDxFu92M9pe9cjz4OlMhT3KqA9ek/3X0FgkxX8LdIajWXUXrVbxeYEbv +0mrctI0SDMpy7TU8m1fc+87tbUsAC6lZx39dB+6CgYWcegLZGkwBYNhI5FtGSfml +Z7QloikEjxhADUqtHL+JARwEEAECAAYFAlDkiRMACgkQOaTHfal4hLBIyQf+JsMO +NKuvzLXB9jVrvVZE9Eyngomj4j4wVEK2ugFcf4lryi800rUaqO8R7mgR4iIqK9NU +EEwazvyBU+57Qcn5CfxrRTrVWz3GUET3qjsUPOihmSnIg7V9nremQzQG7wWcraJe +Abm1mG0cwXA1Gasak5Z4wD4Q5FmoKTWBYvP8l8lnHmnG12cbDiKCwn1qW6parkW/ +HlAaItO5N7Or58gpKSDrbaLBV0l2jxlOk9eeWkeYdnrF5PAmOf2/32AGRrGC+YI9 +vgqK34Hslxf00v5yjw7wYiYNu4Yq9eCKCXw7cIWzHRAoE951tpQ0AciNS15TWNc4 +MMiK4mUMY/9+YKwllokBHAQQAQIABgUCUOSJGAAKCRBgTfvyhUEKvuC0B/4iqq2K +hZiA5RWoxfXrwJwfaOtAHNgUpuDC51JX48vZB0Ie5lgARjqyCLbVPTIj/A+oRpll +z0FHQuCpYDTzSJs2X3Ol04COrsuWNRanNm2/Jh10m9vubyX1Ge0pGvhm3yFClFKS +O/LoioYWZ370PdQrVkccp5cfEHjiiCqVh3PLzbhPDj9Js9HKRNi0aQ34uJlZc+VK +1lAihymzO23fklJg3heL5HXH+btuJxkyi8aQ1p4meHVFYFqcjO/S7PyNJeMd0gwu +6ykWuL0N7Hq2WDfSYorDKf6fZMm/jQwkAJo26/Nmq0SSkMkviy0aowgjsR0zTudO +Tnpun4pNcYKSkbK9iJwEEAECAAYFAlDkiRsACgkQEolum6d/JCmgvQP7BjbE1xC9 +EFequc5ixwcrKbyvel8JZR4QaMfjZ/YltFJEAtNpiUmyI1s5CVqPnPoMqGJSxbkH +eTiIinsj/lxgImE8sDAdzxfIQc9sUFwm/SZmYnLPBxd0FtziaNPxVY1zHbpBiC4R +vYTBGrYwKDxkMIkI26mQ3C+6jpQHZjCq+ZiInAQQAQIABgUCUOSJHwAKCRDYqvDK +9rMHKT9CBACU3RGc9MLTbgXuA4F/jjbQ98I4Ei61y5i0jAt4Wk9qi3WLCpIEorVA +9LzyqClIioS4HoLLIH944Dr6Q7nC+SwifBGgxWVogEPl8vcMUfmUIkUa/KD9N9Wn +t8nSyaYNYYDefjzBy4veyrZF/zTl9RUjD3Y5h6VRSpVqox3pb3g0QoicBBABAgAG +BQJQ5IkjAAoJEJdDARhwk7hB9oUD/19C8pRVgzlM4aCjbh1DhmF23C6eegE7Z82f +9ZByKKKZscahOXp0vdWHuKvQ/j09rfROcb08k+6EofVg/lyT5yj3+SFy7Md+6RKB +oJVfX4Q3d1kWjawwYoTinMAbiANgEbiERZt9OUvxFq1zB3XjfD/DtsTDXO0Jb9nL +an8Eu9KPiJwEEAECAAYFAlDkiSYACgkQHnuzyK+VliVdngP+IhF8I7YICl7LYK8t +eYHHSQuR0HGRJAY2Sm6AgDvS8d2d6BWHovzhcXWmZt5t4qtO9JoO3arEJPFLi+sM +4zltrZ0G2w2iLuK8puGh4PM2V2PjRVWlhmwVdY4yERdqCwD9+TpgPudxDaOpCpD5 +pry2zkHzgtRVnKaB5wUxQSX/9+2InAQQAQIABgUCUOSJKQAKCRBwoCRNHvmSUT5j +A/0RNa+Q73G4STet1vUxJWyufNOOag82ziISGFX5qZ5HnvVheJuUYlplfx3pLGZs +VyxNPJ86vgdobNXG2dJYn/y/3C/9jIp0NiKJYEMVNlOrDvqoh3/7LdDCQC4dPKj/ +T4nSKgK/ny3Bvz8RHf874fnZZt6xjo+DFTzvktChYBSBh4icBBABAgAGBQJQ5Iks +AAoJEMjV7SmV9hdxzAYEAJ6iOI1YzJlNzZptUsCcBR+40sAL43UaaDXCjhEtRgpy ++EQSpGVEzCvN5sxF4z8QXo82x9zQJWZmYV974KXqIq8jFEuSLZAuVuPs2RlfRyAl +P5lATnXdGzrTXgoNLoXEt/vQqYuqFwqXkVvZcLkGHPwTOysyFH/vy8xLXmRI58RZ +iJwEEAECAAYFAlDkiaAACgkQIYPhsTlvB4lMRgP/b5lffwl6KwYI2d/ZoQVaMN+r +aun6ziVCLqMQRiUR03H06fFo31RmGdPRuQ97jxS8EZPNabygjAfKq3F74DPoSlvL +/8AXhj3UXoERf2XIj03o8we5SG0Tg6zLSNB65NoGR1whRgxwAxCgIRaRfudREYQR +6Vd7WpTHeRWttXLyiIiImwQQAQIABgUCUOSJvAAKCRCJaWK4Z4wKA+BYA/jBXOD2 +4pBFFELiCyFW+iTlzsJt5vwyTLolm8Ez77DkepkYOr6ZGiDb1cp3AL1e2ynwbSxq +NeAvwVfIm5TOO8w+xEYplciupd12QfXVa9MiQwDJm4FOP+Nb6X9MSqlHL8E8XoJv +NPjJoY3zFEYn2OGZrD8UpVdU5Y+pKZtCYxc0iJwEEAECAAYFAlDkicMACgkQOCLb +R8w3Ty3mvQP/e97V+BsqxV9HeqJHnmi4NJYaKpP2HBuXntLSDxyqO8YGa3qKkYjj +/LAXp2QfBpwCWn8D0pQSoUF5jayoeNviKs1cfcuq4dyfdoiVBcWOgJQeUHSO8w/r +hevqzclCuWz1TqW7HKlljUbpvP9LDR9De9T6izc3eR9WuLcqBwV73ZyInAQQAQIA +BgUCUOSJxwAKCRCcHL3i41xWNXa+A/9GD14quBksQf6iWg2CbHufCyUqquvN4IbI +YlskEHvjTtaZ20SC0cGMMPe/X2VbfWOR4UjEdlSGQdLWZ8FjKj0hjSSUf28OcbSd +xXryuFFt0skY2dBW1LHgVDUnHTlK1m9p9k887tL31YUGmA7apZVSILhSnd1jI+G7 +NN3ni31Wo4icBBABAgAGBQJQ5InKAAoJEG9Sk9ijm6ZVMLQD/3BWsllRiwFCsiiL +KBJqnjRCdFTuHOl75g86IniLMXu11r+K4LR9mXbi2bduAzkwP7c9HSAFWli3bhfV +fgf68sogGcHAtQgjgjTg3NvjOPkeMT24PVJzgIUkbgFBmOoe30L7/YyKl7B53FrX +dIcuI0d47bXoUOvjzNueBKzLkA3WiJwEEAECAAYFAlDkic0ACgkQ71iWZNQy4Z18 +0AP/cNp30lU/1dMF4bXbmbYG/dwxzFa8K1RsxJJD/HGFTsPs30o5tp7IpHAA3wiP +QI13HhDA9hfRsuWHyNztL6uHDD4HRiab1j1hNgorzXMYp+EmFSX+LYfd/GPBHX6B +xzGy6HuhurF1cPcvEbdlmcdr50YLaO4WJbHfU+p/9eEMZKOInAQQAQIABgUCUOSJ +0AAKCRDBnB0lEtNGHeMQBACWhsL8KCmh+2XwIweQOboaGA6ShwDHx8CfPxcqv9ZJ +4jsRoHSjiSRK+Gbqh0/5aOppeO6Pg8CppuDJ7jN/l212ZfhR0JUWfC3ySb71BIr/ +NpKw3PqbdPK6ugcfVHd2JkHSqZvDXUgMHftzVZEeD+OSfCMo/ED0QcC+3M3eO4fX +a4icBBABAgAGBQJQ5InUAAoJEMApykAW9MzpXkwD/AgrFlIVjYGNSelqRgl+eaxK +ujeRUwcZOjKvleOa4U5QekaI1pTsbk7whbzABa4i+TS3AWwlhVOuKanJJqWmVLrW +dJY6PgVGhUGdSk+FwXji8MA2aqdfcTCT3L2V6QyqXMEP8K3KAOKdBDIFAd31pap4 +ICuaj09nuybr2UNyOh9KiEYEEBECAAYFAlDki9QACgkQGPUDgCTCeAJMiACfbkQT +VU4gsRwDHBMRB1de9s7cS94An2ObpRui9RhHBRE+FONdzwV7LT+oiJwEEAECAAYF +AlDki+MACgkQfEtnbaAOFWM1RQQAwzWY32cZMx6MYBB40elalCqcwS0sGPG+BLOd ++7qmRPFUk7r/IC56mPgvRMAB3Hk4EF2m8YDfYIT/3u0r9M85tvKfzaB9svbn9xIg +s43a5m6EZRs8O/oeEpGJA5B+ypSMMXj67HrS6UzShGiNVJHD1FQABEYLEIPXOpML +99ko0KKInAQQAQIABgUCUOSL6QAKCRDW4KH+T74q3eJ/A/kBmDLoDkOJqZaIUCgm +DEebLXmh72vglflntChfOZFoJgIRJt+1gH8GTfWL4fecpxv7l3VD32eo14mUIvIl +9EIGinr0iE5jz2sJNLEk+9TQL4oWA2khr1AOsw0+Pq6ju8BYKG9ImM/pUpCX0g+s +YUwkB0pwWpldcrEiWgVg8NfuQ4hGBBARAgAGBQJQ5IvuAAoJECH5xbz3apv1JV0A +nR1zsfcDOhe0eA6LzDCUvkj+GTZmAJ9OdU37HRmxpokcL1YT2vU8fYItmYicBBAB +AgAGBQJQ5Zm8AAoJEM8etQMiMnoB1VUD/2Ee+hUtbUiVsrCTtgyxMh3GYHxSRlsR +DmZ3Ic49V3fPmadCRDpw1I6iKLgeg3qCB/Fg+1pvZ4E09a2knr02wVybe1hvRVsN +6QZnDa5Sp7SYoMj+PGAj1Jv2JcTggBxBpFeHFOElZi0Sc0J8TjzsLWph/SYbiwSr +GGz3QCya5dP/iEYEEBECAAYFAlDl9uwACgkQCaeiStHlggfR0wCeORnxx6UraAW0 +VEphoedU+22CyVcAn1QWbw6Bgktk3+UIN4vzW6YQbGpHiJwEEAECAAYFAlDl+9EA +CgkQXx7Ib4gMnlUD3QP/fan4d5+L3LVrOkAtmQovwZqpB6+fOy671RO3SaE1+lr4 +/twHmKGC1h8jVZzkqRVRQ3tBPvG9lPlweUN9wA2+jpoe8LaqJ2hClDw1gP3EPz0U +lIfJAoeZQOpbTY4DWUFy/vxnHcpQh5H+aJDlhKzSB4E/C/le9ViOzzqPRh4K29yI +RgQQEQIABgUCUOcGZAAKCRDEsQeYhXlqI/CyAJ9WHdCZwVdeFcgjVqv42sy+7d14 +XgCfd2c4qU9ZacQmoZDSU7P5kIrf8xuJASIEEwECAAwFAlDnimMFgweGH4AACgkQ +dZbk85mBCRgEyAf+LgY3QOdXa/9YDdbZXvBQ4myyJH6LD8OnFglI/u1gz/yP5ngm +SeWsODQAm4UzYQxc4fDHDnmVjpTyqyoY70gO9zsMg3eociDtaEi4/J7ZQRlvI5cu +PFreqLe9CivEzSFsuBYsNRmkxsQHAUg59wqhaefjul94RtWLhUXu20Er3CfE4B7I +AXK4ncWgySyCtWxtK2SygOaxKY/enGqtVC2a/ZecB7o1KJ3ghx1w9CzXxRyEtmtT +qaQpoGs40sshQgY9EDUApFU/cXIZmMlmcFEtL8e9R9pptY7FdoeuINwB8nS7epxy +kavIjSW30ALAshGpXrTHWxnOipzey8pbtOrL4okCHAQQAQIABgUCUOlleQAKCRBQ +g+yIQOhvcYDlD/4v2PjuxnM53WVDOABTkxax2dPQ94ErEf01cAr4SZ4UE0j8pH03 +WKKCDGnE+xkX0N9NworDEpkyGAjbTxbpidOWC4r1P526Nhhr+B/4yiybyXg5oR5F +rAQaxdj5dvk3HUSfUoqAaag9P6w/wBEIQcRvZ5L+2eTBYwrsHaRfDoP6ce6fmJic +veYhYDQ3qxx6l3qeRwchTKLEdy0jLdbZl1AFNLRQGU4XOFM3UxKTk4XofEdEK8B0 +L83NjsE1S9IJleQiNM41fNte0SXTJ8J//SGRnKAyMtlclanX2KazTPKGu69pZQRY +om9xH7vJZIRv0pCjQbEc9Caw/mvSNlQWJ5589cLVfaWrQpSmzf6oAoVyzhC4tiWw +s2FmfzUYvvSKX1dpVMWIkYyCLyS7E+px6zFy1e77Pc+uhmAsNDgfTTfwJbBoLAFQ +42f/5mqKhQktiplM6ZzMNB49zwjsFK9Vt1OA9ggHtvo/LzAIoMnQUvijObnE3/+a +PUNKAaqggVJUQgK2htPjyAkUIq1HQ35WzvpaTUn7ADBezTo6Zhl9UbKW9+IuCmwN +w4ZFhhKC5VsWSVZGFVMwRNilSXpyPVYAWkkrEiNreLW7R/OwXUqA3fvK4lFRWpVV +AEcmL5Cygmrv+0SMUgJrymf/HSl6/JVNP0GMZ5l8WvKZ4usxsc0Yt+gjTrkBDQRQ +5IhOAQgAxmVBSjFMrpl+oMm7SG97BeBG/ApRkWyzHoYLXSWoq/lpYWZUyfRxPyvV +kMEnVSerTMfiq80yX/8niFm7SezXBzCFwxjt5d6v1BIs0p1qnEmN6ze9i1wz26fT +Eix+qtFewBbE31+bxCOxFQoIaCGWrR7gq7clNfkLKRjBbJcb/vkPc0S6l5+xaM/j +Zt19a4uBDzy6DfFOjJ/ZWzKCioqPeswJrElszGqB3Wvwip1iOA4Ec379s8mSCzqq +PoQ98jIhqW/vD6eHDdzkEdQJZKwzSVgClHcLehQMCtsGChf+cxCgFQSf+7ZOyu+Y +YbIK06IC/lJG7LGBWOd28+LqKAXamQARAQABiQEfBBgBAgAJBQJQ5IhOAhsMAAoJ +ED1osl1SB8rT698H/Ap1PMyHWdDZxIP7PkJKAGuXjSE3JAw+dNh3vaxF24NFBUvj +J6F5UwZiegCAIatKVF15SycuIDT6TG1NBQPD8Udp5w0lK+sZH0ViZGs5hNggBdiR +uv6yMpaPf6IbO6Of0OInrcni9UQVt1G6o7MseZBnxejuPX0E6CMbB578XfSrdliI +jwcHNo5TEc0IjPw4qpUYRd/cWlo8Cprqu7I6LTDUdXOl01peaGqkGhyUgoY83JyS +xIhNOUZG9qZ7p7MTpngmXX8brCg4ivylPLveAsbhgLLlRQO1ME/j4zyBvM5vWEPB +x4XQOkQ96TXgQoe/dvARKuUcAQl7RvZOIZcBTPs= +=kpXE +-----END PGP PUBLIC KEY BLOCK----- + +Type Bits KeyID Created Expires Algorithm Use pub 2048 CEEEF43B 2011-12-14 ------- RSA Sign & Encrypt fingerprint: CA7A 8F39 A241 9FFF B0A9 AB27 8E5A E9FB CEEE F43B uid Sendmail Signing Key/2012 @@ -2298,4 +2435,4 @@ DnF3FZZEzV7oqPwC2jzv/1dD6GFhtgy0cnyoPGUJ =nES8 -----END PGP PUBLIC KEY BLOCK----- -$Revision: 8.40 $, Last updated $Date: 2012/01/09 04:44:59 $ +$Revision: 8.43 $, Last updated $Date: 2013/01/18 17:40:21 $ Modified: releng/8.4/contrib/sendmail/RELEASE_NOTES ============================================================================== --- releng/8.4/contrib/sendmail/RELEASE_NOTES Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/RELEASE_NOTES Thu May 2 01:35:02 2013 (r250167) @@ -1,11 +1,40 @@ SENDMAIL RELEASE NOTES - $Id: RELEASE_NOTES,v 8.2011 2012/12/21 18:42:16 ca Exp $ + $Id: RELEASE_NOTES,v 8.2024 2013/04/19 15:01:58 ca Exp $ This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. +8.14.7/8.14.7 2013/04/21 + Drop support for IPv4-mapped IPv6 addresses to prevent the MTA + from using a mapped address over a legitimate IPv6 address + and to enforce the proper semantics over the IPv6 + connection. Problem noted by Ulrich Sporlein. + Fix a regression introduced in 8.14.6: the wrong list of + macros was sent to a milter in the EHLO stage. + Problem found by Fabrice Bellet, reported via RedHat + (Jaroslav Skarvada). + Fix handling of ORCPT parameter for DSNs: xtext decoding + was not performed and a wrong syntax check was applied + to the "addr-type" field. Problem noted by Dan Lukes + of Obludarium. + Fix handling of NUL characters in the MIME conversion functions + so that message bodies containing them will be sent + on properly. Note: this usually also affects mails + that are not converted as those functions are used + for other purposes too. Problem noted by Elchonon + Edelson of Lockheed Martin. + Do not perform "duplicate" elimination of recipients if they + resolve to the error mailer using a temporary failure + (4xy) via ruleset 0. Problem noted by Akira Takahashi + of IIJ. + CONTRIB: Updated version of etrn.pl script from John Beck + of Oracle. + Portability: + Unlike gcc, clang doesn't apply full prototypes to K&R + definitions. + 8.14.6/8.14.6 2012/12/23 Fix a regression introduced in 8.14.5: if a server offers two AUTH lines, the MTA would not read them after Modified: releng/8.4/contrib/sendmail/cf/cf/submit.cf ============================================================================== --- releng/8.4/contrib/sendmail/cf/cf/submit.cf Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/cf/cf/submit.cf Thu May 2 01:35:02 2013 (r250167) @@ -16,8 +16,8 @@ ##### ##### SENDMAIL CONFIGURATION FILE ##### -##### built by ca@wiz.smi.sendmail.com on Fri Dec 21 10:45:15 PST 2012 -##### in /extra/home/ca/sm-8.14.6/OpenSource/sendmail-8.14.6/cf/cf +##### built by ca@wiz.smi.sendmail.com on Fri Apr 19 08:04:44 PDT 2013 +##### in /extra/home/ca/sm-8.14.7/OpenSource/sendmail-8.14.7/cf/cf ##### using ../ as configuration include directory ##### ###################################################################### @@ -114,7 +114,7 @@ D{MTAHost}[127.0.0.1] # Configuration version number -DZ8.14.6/Submit +DZ8.14.7/Submit ############### Modified: releng/8.4/contrib/sendmail/cf/m4/version.m4 ============================================================================== --- releng/8.4/contrib/sendmail/cf/m4/version.m4 Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/cf/m4/version.m4 Thu May 2 01:35:02 2013 (r250167) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1998-2012 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2013 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -11,8 +11,8 @@ divert(-1) # the sendmail distribution. # # -VERSIONID(`$Id: version.m4,v 8.222 2012/12/19 05:11:43 ca Exp $') +VERSIONID(`$Id: version.m4,v 8.230 2013/04/18 15:07:16 ca Exp $') # divert(0) # Configuration version number -DZ8.14.6`'ifdef(`confCF_VERSION', `/confCF_VERSION') +DZ8.14.7`'ifdef(`confCF_VERSION', `/confCF_VERSION') Modified: releng/8.4/contrib/sendmail/contrib/etrn.pl ============================================================================== --- releng/8.4/contrib/sendmail/contrib/etrn.pl Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/contrib/etrn.pl Thu May 2 01:35:02 2013 (r250167) @@ -1,22 +1,40 @@ -#!/usr/local/bin/perl -w +#!/usr/perl5/bin/perl -w +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# # # Copyright (c) 1996-2000 by John T. Beck # All rights reserved. # -# Copyright (c) 2000 by Sun Microsystems, Inc. -# All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. # -#ident "@(#)etrn.pl 1.1 00/09/06 SMI" -require 5.005; # minimal Perl version required +require 5.8.4; # minimal Perl version required use strict; +use warnings; use English; -# hardcoded constants, should work fine for BSD-based systems use Socket; use Getopt::Std; -use vars qw($opt_v); -my $sockaddr = 'S n a4 x8'; +our ($opt_v, $opt_b); # system requirements: # must have 'hostname' program. @@ -26,11 +44,12 @@ select(STDERR); chop(my $name = `hostname || uname -n`); -(my $hostname, my $aliases, my $type, my $len, undef) = gethostbyname($name); +my ($hostname) = (gethostbyname($name))[0]; -my $usage = "Usage: $PROGRAM_NAME [-v] host [args]"; -getopts('v'); +my $usage = "Usage: $PROGRAM_NAME [-bv] host [args]"; +getopts('bv'); my $verbose = $opt_v; +my $boot_check = $opt_b; my $server = shift(@ARGV); my @hosts = @ARGV; die $usage unless $server; @@ -86,24 +105,60 @@ if (!@hosts) { die "open $cwfile: $ERRNO"; } } + # Do this automatically if no client hosts are specified. + $boot_check = "yes"; } -($name, $aliases, my $proto) = getprotobyname('tcp'); -($name, $aliases, $port) = getservbyname($port, 'tcp') +my ($proto) = (getprotobyname('tcp'))[2]; +($port) = (getservbyname($port, 'tcp'))[2] unless $port =~ /^\d+/; +if ($boot_check) { + # first connect to localhost to verify that we can accept connections + print "verifying that localhost is accepting SMTP connections\n" + if ($verbose); + my $localhost_ok = 0; + ($name, my $laddr) = (gethostbyname('localhost'))[0, 4]; + (!defined($name)) && die "gethostbyname failed, unknown host localhost"; + + # get a connection + my $sinl = sockaddr_in($port, $laddr); + my $save_errno = 0; + for (my $num_tries = 1; $num_tries < 5; $num_tries++) { + socket(S, &PF_INET, &SOCK_STREAM, $proto) + || die "socket: $ERRNO"; + if (connect(S, $sinl)) { + &alarm("sending 'quit' to $server"); + print S "quit\n"; + alarm(0); + $localhost_ok = 1; + close(S); + alarm(0); + last; + } + print STDERR "localhost connect failed ($num_tries)\n"; + $save_errno = $ERRNO; + sleep(1 << $num_tries); + close(S); + alarm(0); + } + if (! $localhost_ok) { + die "could not connect to localhost: $save_errno\n"; + } +} + # look it up -($name, $aliases, $type, $len, my $thataddr) = gethostbyname($server); +($name, my $thataddr) = (gethostbyname($server))[0, 4]; (!defined($name)) && die "gethostbyname failed, unknown host $server"; - + # get a connection -my $that = pack($sockaddr, &AF_INET, $port, $thataddr); -socket(S, &AF_INET, &SOCK_STREAM, $proto) +my $sinr = sockaddr_in($port, $thataddr); +socket(S, &PF_INET, &SOCK_STREAM, $proto) || die "socket: $ERRNO"; print "server = $server\n" if (defined($verbose)); &alarm("connect to $server"); -if (! connect(S, $that)) { +if (! connect(S, $sinr)) { die "cannot connect to $server: $ERRNO\n"; } alarm(0); Modified: releng/8.4/contrib/sendmail/doc/op/op.me ============================================================================== --- releng/8.4/contrib/sendmail/doc/op/op.me Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/doc/op/op.me Thu May 2 01:35:02 2013 (r250167) @@ -9,7 +9,7 @@ .\" the sendmail distribution. .\" .\" -.\" $Id: op.me,v 8.749 2012/03/02 22:37:11 ca Exp $ +.\" $Id: op.me,v 8.751 2013/04/08 21:41:25 ca Exp $ .\" .\" eqn op.me | pic | troff -me .\" @@ -90,7 +90,7 @@ Sendmail, Inc. .de Ve Version \\$2 .. -.Ve $Revision: 8.749 $ +.Ve $Revision: 8.751 $ .rm Ve .sp For Sendmail Version 8.14 @@ -5547,9 +5547,6 @@ It can have primary types or full types (such as .q text/plain ). -The class is initialized to have -.q text/plain -only. .ip $=s contains the set of subtypes of message that can be treated recursively. By default it contains only @@ -6609,8 +6606,13 @@ Modifier Options (flags) for the client .)b The .i Addr ess -mask may be a numeric address in dot notation +mask may be a numeric address in IPv4 dot notation or IPv6 colon notation or a network name. +Note that if a network name is specified, +only the first IP address returned for it will be used. +This may cause indeterminate behavior for network names +that resolve to multiple addresses. +Therefore, use of an address is recommended. .i Modifier can be the following character: .(b @@ -6778,8 +6780,13 @@ The key is used for error messages and logging. The .i Addr ess -mask may be a numeric address in dot notation +mask may be a numeric address in IPv4 dot notation or IPv6 colon notation or a network name. +Note that if a network name is specified, +only the first IP address returned for it will be used. +This may cause indeterminate behavior for network names +that resolve to multiple addresses. +Therefore, use of an address is recommended. The .i Family key defaults to INET (IPv4). @@ -11471,7 +11478,7 @@ replace it with a blank sheet for double .\".sz 10 .\"Eric Allman .\".sp -.\"Version $Revision: 8.749 $ +.\"Version $Revision: 8.751 $ .\".ce 0 .bp 3 .ce Modified: releng/8.4/contrib/sendmail/include/sm/config.h ============================================================================== --- releng/8.4/contrib/sendmail/include/sm/config.h Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/include/sm/config.h Thu May 2 01:35:02 2013 (r250167) @@ -6,7 +6,7 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * - * $Id: config.h,v 1.47 2004/10/26 21:41:07 gshapiro Exp $ + * $Id: config.h,v 1.48 2013/03/22 22:48:57 gshapiro Exp $ */ /* @@ -24,14 +24,16 @@ /* ** SM_CONF_STDBOOL_H is 1 if exists +** +** Note, unlike gcc, clang doesn't apply full prototypes to K&R definitions. */ # ifndef SM_CONF_STDBOOL_H -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# if !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # define SM_CONF_STDBOOL_H 1 -# else /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */ +# else /* !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */ # define SM_CONF_STDBOOL_H 0 -# endif /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */ +# endif /* !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */ # endif /* ! SM_CONF_STDBOOL_H */ /* Modified: releng/8.4/contrib/sendmail/include/sm/io.h ============================================================================== --- releng/8.4/contrib/sendmail/include/sm/io.h Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/include/sm/io.h Thu May 2 01:35:02 2013 (r250167) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2002, 2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2002, 2004, 2013 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1990 * The Regents of the University of California. All rights reserved. @@ -11,7 +11,7 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * - * $Id: io.h,v 1.24 2004/03/03 19:14:49 ca Exp $ + * $Id: io.h,v 1.25 2013/03/12 15:24:49 ca Exp $ */ /*- @@ -269,7 +269,7 @@ int sm_io_close __P((SM_FILE_T *, int S SM_FILE_T *sm_io_dup __P((SM_FILE_T *)); int sm_io_eof __P((SM_FILE_T *)); int sm_io_error __P((SM_FILE_T *)); -char *sm_io_fgets __P((SM_FILE_T *, int, char *, int)); +int sm_io_fgets __P((SM_FILE_T *, int, char *, int)); int sm_io_flush __P((SM_FILE_T *, int SM_NONVOLATILE)); int PRINTFLIKE(3, 4) Modified: releng/8.4/contrib/sendmail/libmilter/Makefile.m4 ============================================================================== --- releng/8.4/contrib/sendmail/libmilter/Makefile.m4 Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/libmilter/Makefile.m4 Thu May 2 01:35:02 2013 (r250167) @@ -1,4 +1,4 @@ -dnl $Id: Makefile.m4,v 8.88 2012/09/25 17:40:32 ca Exp $ +dnl $Id: Makefile.m4,v 8.92 2013/04/16 20:19:54 ca Exp $ include(confBUILDTOOLSDIR`/M4/switch.m4') dnl only required for compilation of EXTRAS Modified: releng/8.4/contrib/sendmail/libmilter/sm_gethost.c ============================================================================== --- releng/8.4/contrib/sendmail/libmilter/sm_gethost.c Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/libmilter/sm_gethost.c Thu May 2 01:35:02 2013 (r250167) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2001, 2004, 2010 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2001, 2004, 2010, 2013 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -9,7 +9,7 @@ */ #include -SM_RCSID("@(#)$Id: sm_gethost.c,v 8.29 2010/07/27 01:09:31 ca Exp $") +SM_RCSID("@(#)$Id: sm_gethost.c,v 8.30 2013/02/22 22:43:33 gshapiro Exp $") #include #if NETINET || NETINET6 @@ -101,7 +101,12 @@ mi_gethostbyname(name, family) # endif /* SOLARIS == 20300 || SOLARIS == 203 */ #else /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) || (defined(sony_news) && defined(__svr4)) */ # if NETINET6 - int flags = AI_DEFAULT|AI_ALL; +# ifndef SM_IPNODEBYNAME_FLAGS + /* For IPv4-mapped addresses, use: AI_DEFAULT|AI_ALL */ +# define SM_IPNODEBYNAME_FLAGS AI_ADDRCONFIG +# endif /* SM_IPNODEBYNAME_FLAGS */ + + int flags = SM_IPNODEBYNAME_FLAGS; int err; # endif /* NETINET6 */ Modified: releng/8.4/contrib/sendmail/libsm/Makefile.m4 ============================================================================== --- releng/8.4/contrib/sendmail/libsm/Makefile.m4 Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/libsm/Makefile.m4 Thu May 2 01:35:02 2013 (r250167) @@ -1,4 +1,4 @@ -dnl $Id: Makefile.m4,v 1.72 2006/08/16 21:06:31 ca Exp $ +dnl $Id: Makefile.m4,v 1.73 2013/03/12 15:24:50 ca Exp $ define(`confREQUIRE_LIBUNIX') include(confBUILDTOOLSDIR`/M4/switch.m4') @@ -18,6 +18,7 @@ smcheck(`t-exc', `compile-run') smcheck(`t-rpool', `compile-run') smcheck(`t-string', `compile-run') smcheck(`t-smstdio', `compile-run') +smcheck(`t-fget', `compile-run') smcheck(`t-match', `compile-run') smcheck(`t-strio', `compile-run') smcheck(`t-heap', `compile-run') Modified: releng/8.4/contrib/sendmail/libsm/cf.c ============================================================================== --- releng/8.4/contrib/sendmail/libsm/cf.c Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/libsm/cf.c Thu May 2 01:35:02 2013 (r250167) @@ -9,7 +9,7 @@ */ #include -SM_RCSID("@(#)$Id: cf.c,v 1.6 2001/09/11 04:04:47 gshapiro Exp $") +SM_RCSID("@(#)$Id: cf.c,v 1.7 2013/03/12 15:24:50 ca Exp $") #include #include @@ -54,7 +54,7 @@ sm_cf_getopt(path, optc, optv) if (cfp == NULL) return errno; - while (sm_io_fgets(cfp, SM_TIME_DEFAULT, buf, sizeof(buf)) != NULL) + while (sm_io_fgets(cfp, SM_TIME_DEFAULT, buf, sizeof(buf)) >= 0) { p = strchr(buf, '\n'); if (p != NULL) Modified: releng/8.4/contrib/sendmail/libsm/fget.c ============================================================================== --- releng/8.4/contrib/sendmail/libsm/fget.c Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/libsm/fget.c Thu May 2 01:35:02 2013 (r250167) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2013 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -13,7 +13,7 @@ */ #include -SM_RCSID("@(#)$Id: fget.c,v 1.24 2001/09/11 04:04:48 gshapiro Exp $") +SM_RCSID("@(#)$Id: fget.c,v 1.25 2013/03/12 15:24:50 ca Exp $") #include #include #include @@ -33,31 +33,32 @@ SM_RCSID("@(#)$Id: fget.c,v 1.24 2001/09 ** n -- size of 'buf' ** ** Returns: -** success: returns value of 'buf' -** failure: NULL (no characters were read) -** timeout: NULL and errno set to EAGAIN +** success: number of characters +** failure: -1 +** timeout: -1 and errno set to EAGAIN ** ** Side Effects: ** may move the file pointer */ -char * +int sm_io_fgets(fp, timeout, buf, n) register SM_FILE_T *fp; int timeout; char *buf; register int n; { - register int len; - register char *s; - register unsigned char *p, *t; + int len, r; + char *s; + unsigned char *p, *t; SM_REQUIRE_ISA(fp, SmFileMagic); if (n <= 0) /* sanity check */ - return NULL; + return -1; s = buf; n--; /* leave space for NUL */ + r = 0; while (n > 0) { /* If the buffer is empty, refill it. */ @@ -73,7 +74,7 @@ sm_io_fgets(fp, timeout, buf, n) { /* EOF/error: stop with partial or no line */ if (s == buf) - return NULL; + return -1; break; } len = fp->f_r; @@ -93,18 +94,20 @@ sm_io_fgets(fp, timeout, buf, n) if (t != NULL) { len = ++t - p; + r += len; fp->f_r -= len; fp->f_p = t; (void) memcpy((void *) s, (void *) p, len); s[len] = 0; - return buf; + return r; } fp->f_r -= len; fp->f_p += len; (void) memcpy((void *) s, (void *) p, len); s += len; + r += len; n -= len; } *s = 0; - return buf; + return r; } Copied: releng/8.4/contrib/sendmail/libsm/t-fget.c (from r249868, stable/8/contrib/sendmail/libsm/t-fget.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/8.4/contrib/sendmail/libsm/t-fget.c Thu May 2 01:35:02 2013 (r250167, copy of r249868, stable/8/contrib/sendmail/libsm/t-fget.c) @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2013 Sendmail, Inc. and its suppliers. + * All rights reserved. + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the sendmail distribution. + */ + +#include +SM_IDSTR(id, "@(#)$Id: t-fget.c,v 1.1 2013/03/12 15:24:50 ca Exp $") + +#include +#include +#include +#include + +void +check(char *msg, int l) +{ + SM_FILE_T *wfp, *rfp; + char buf[256]; + size_t n; + int r, i; + static char fn[] = "tfget"; + + wfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, fn, + SM_IO_WRONLY_B, NULL); + SM_TEST(wfp != NULL); + for (i = 0; i < l; i++) + { + r = sm_io_putc(wfp, SM_TIME_DEFAULT, msg[i]); + SM_TEST(r >= 0); + } + r = sm_io_close(wfp, SM_TIME_DEFAULT); + SM_TEST(r == 0); + + rfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, fn, + SM_IO_RDONLY_B, NULL); + SM_TEST(rfp != NULL); + n = sizeof(buf); + r = sm_io_fgets(rfp, SM_TIME_DEFAULT, buf, n); + if (l == 0) + { + SM_TEST(r == -1); + SM_TEST(errno == 0); + } + else + { + SM_TEST(r == l); + if (r != l) + fprintf(stderr, "buf='%s', in='%s', r=%d, l=%d\n", + buf, msg, r, l); + } + SM_TEST(memcmp(buf, msg, l) == 0); + r = sm_io_close(rfp, SM_TIME_DEFAULT); + SM_TEST(r == 0); +} + + +int +main(argc, argv) + int argc; + char **argv; +{ + char res[256]; + int l; + + sm_test_begin(argc, argv, "test fget"); + + check("", strlen("")); + check("\n", strlen("\n")); + check("test\n", strlen("test\n")); + + l = snprintf(res, sizeof(res), "%c%s\n", '\0', "test ing"); + check(res, l); + + l = snprintf(res, sizeof(res), "%c%s%c\n", '\0', "test ing", '\0'); + check(res, l); + + l = snprintf(res, sizeof(res), "%c%s%c%s\n", + '\0', "test ing", '\0', "eol"); + check(res, l); + + return sm_test_end(); +} Modified: releng/8.4/contrib/sendmail/mailstats/mailstats.c ============================================================================== --- releng/8.4/contrib/sendmail/mailstats/mailstats.c Thu May 2 00:59:39 2013 (r250166) +++ releng/8.4/contrib/sendmail/mailstats/mailstats.c Thu May 2 01:35:02 2013 (r250167) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2002, 2013 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -20,7 +20,7 @@ SM_IDSTR(copyright, Copyright (c) 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Id: mailstats.c,v 8.100 2002/06/27 23:24:06 gshapiro Exp $") +SM_IDSTR(id, "@(#)$Id: mailstats.c,v 8.102 2013/03/12 15:24:50 ca Exp $") #include #include @@ -68,13 +68,14 @@ main(argc, argv) extern char *ctime(); extern char *optarg; extern int optind; +# define MSOPTS "cC:f:opP" cfile = getcfname(0, 0, SM_GET_SENDMAIL_CF, NULL); sfile = NULL; mnames = true; progmode = false; trunc = false; - while ((ch = getopt(argc, argv, "cC:f:opP")) != -1) + while ((ch = getopt(argc, argv, MSOPTS)) != -1) { switch (ch) { @@ -90,6 +91,7 @@ main(argc, argv) sfile = optarg; break; + case 'o': mnames = false; break; @@ -102,6 +104,7 @@ main(argc, argv) progmode = true; break; + case '?': default: usage: @@ -131,7 +134,7 @@ main(argc, argv) (void) sm_strlcpy(mtable[mno++], "*file*", MNAMELEN + 1); (void) sm_strlcpy(mtable[mno++], "*include*", MNAMELEN + 1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 2 01:36:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD84FB9A; Thu, 2 May 2013 01:36:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D005B1E64; Thu, 2 May 2013 01:36:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r421arKF009392; Thu, 2 May 2013 01:36:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r421aqL5009383; Thu, 2 May 2013 01:36:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305020136.r421aqL5009383@svn.freebsd.org> From: Eitan Adler Date: Thu, 2 May 2013 01:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250168 - in head: share/man/man4 sys/dev/e1000 sys/dev/ixgb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 01:36:53 -0000 Author: eadler Date: Thu May 2 01:36:52 2013 New Revision: 250168 URL: http://svnweb.freebsd.org/changeset/base/250168 Log: Update Intel email address. PR: docs/175349 Submitted by: Lars Eggert Discussed with: jfv Modified: head/share/man/man4/em.4 head/share/man/man4/igb.4 head/share/man/man4/ixgb.4 head/share/man/man4/ixgbe.4 head/sys/dev/e1000/README head/sys/dev/ixgb/README Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Thu May 2 01:35:02 2013 (r250167) +++ head/share/man/man4/em.4 Thu May 2 01:36:52 2013 (r250168) @@ -260,7 +260,7 @@ go to the Intel support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq freebsdnic@mailbox.intel.com . +.Aq freebsd@intel.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , @@ -280,7 +280,7 @@ device driver first appeared in The .Nm driver was written by -.An Intel Corporation Aq freebsdnic@mailbox.intel.com . +.An Intel Corporation Aq freebsd@intel.com . .Sh BUGS Hardware-assisted VLAN processing is disabled by default. You can enable it on an Modified: head/share/man/man4/igb.4 ============================================================================== --- head/share/man/man4/igb.4 Thu May 2 01:35:02 2013 (r250167) +++ head/share/man/man4/igb.4 Thu May 2 01:36:52 2013 (r250168) @@ -205,7 +205,7 @@ go to the Intel support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq freebsdnic@mailbox.intel.com . +.Aq freebsd@intel.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , @@ -225,4 +225,4 @@ device driver first appeared in The .Nm driver was written by -.An Intel Corporation Aq freebsdnic@mailbox.intel.com . +.An Intel Corporation Aq freebsd@intel.com . Modified: head/share/man/man4/ixgb.4 ============================================================================== --- head/share/man/man4/ixgb.4 Thu May 2 01:35:02 2013 (r250167) +++ head/share/man/man4/ixgb.4 Thu May 2 01:36:52 2013 (r250168) @@ -102,7 +102,7 @@ go to the Intel support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq freebsdnic@mailbox.intel.com . +.Aq freebsd@intel.com . .Sh SEE ALSO .Xr arp 4 , .Xr em 4 , @@ -122,4 +122,4 @@ and The .Nm driver was written by -.An Intel Corporation Aq freebsdnic@mailbox.intel.com . +.An Intel Corporation Aq freebsd@intel.com . Modified: head/share/man/man4/ixgbe.4 ============================================================================== --- head/share/man/man4/ixgbe.4 Thu May 2 01:35:02 2013 (r250167) +++ head/share/man/man4/ixgbe.4 Thu May 2 01:36:52 2013 (r250168) @@ -105,7 +105,7 @@ go to the Intel support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq freebsdnic@mailbox.intel.com . +.Aq freebsd@intel.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , @@ -123,4 +123,4 @@ device driver first appeared in The .Nm driver was written by -.An Intel Corporation Aq freebsdnic@mailbox.intel.com . +.An Intel Corporation Aq freebsd@intel.com . Modified: head/sys/dev/e1000/README ============================================================================== --- head/sys/dev/e1000/README Thu May 2 01:35:02 2013 (r250167) +++ head/sys/dev/e1000/README Thu May 2 01:36:52 2013 (r250168) @@ -389,7 +389,7 @@ For general information and support, go http://support.intel.com If an issue is identified, support is through email only at: -freebsdnic@mailbox.intel.com +freebsd@intel.com License Modified: head/sys/dev/ixgb/README ============================================================================== --- head/sys/dev/ixgb/README Thu May 2 01:35:02 2013 (r250167) +++ head/sys/dev/ixgb/README Thu May 2 01:36:52 2013 (r250168) @@ -217,7 +217,7 @@ For general information and support, go If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to -the issue to freebsdnic@mailbox.intel.com. +the issue to freebsd@intel.com. From owner-svn-src-all@FreeBSD.ORG Thu May 2 01:39:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D2F9ED23; Thu, 2 May 2013 01:39:32 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C60791E70; Thu, 2 May 2013 01:39:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r421dWHf009917; Thu, 2 May 2013 01:39:32 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r421dWPF009915; Thu, 2 May 2013 01:39:32 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201305020139.r421dWPF009915@svn.freebsd.org> From: Gregory Neil Shapiro Date: Thu, 2 May 2013 01:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r250169 - releng/8.4/etc/sendmail X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 01:39:32 -0000 Author: gshapiro Date: Thu May 2 01:39:32 2013 New Revision: 250169 URL: http://svnweb.freebsd.org/changeset/base/250169 Log: MFC: Minor changes to force commit these files so new freebsd*.cf files are built to use the new sendmail-8.14.7/cf tree. Merged from stable/8. Approved by: re (delphij) Modified: releng/8.4/etc/sendmail/freebsd.mc releng/8.4/etc/sendmail/freebsd.submit.mc Directory Properties: releng/8.4/etc/sendmail/ (props changed) Modified: releng/8.4/etc/sendmail/freebsd.mc ============================================================================== --- releng/8.4/etc/sendmail/freebsd.mc Thu May 2 01:36:52 2013 (r250168) +++ releng/8.4/etc/sendmail/freebsd.mc Thu May 2 01:39:32 2013 (r250169) @@ -41,7 +41,7 @@ divert(-1) # The best documentation for this .mc file is: # /usr/share/sendmail/cf/README or # /usr/src/contrib/sendmail/cf/README -# +# divert(0) VERSIONID(`$FreeBSD$') Modified: releng/8.4/etc/sendmail/freebsd.submit.mc ============================================================================== --- releng/8.4/etc/sendmail/freebsd.submit.mc Thu May 2 01:36:52 2013 (r250168) +++ releng/8.4/etc/sendmail/freebsd.submit.mc Thu May 2 01:39:32 2013 (r250169) @@ -9,7 +9,6 @@ divert(-1) # # - # # This is the FreeBSD configuration for a set-group-ID sm-msp sendmail # that acts as a initial mail submission program. From owner-svn-src-all@FreeBSD.ORG Thu May 2 03:47:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9474C52; Thu, 2 May 2013 03:47:25 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id DAB08125B; Thu, 2 May 2013 03:47:25 +0000 (UTC) Received: from xyf.my.dom (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r423lN42004614; Thu, 2 May 2013 03:47:24 GMT (envelope-from davidxu@freebsd.org) Message-ID: <5181E1E7.3090708@freebsd.org> Date: Thu, 02 May 2013 11:47:51 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130416 Thunderbird/17.0.5 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r249605 - head/sys/vm References: <201304180534.r3I5YXK4015577@svn.freebsd.org> In-Reply-To: <201304180534.r3I5YXK4015577@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 03:47:26 -0000 On 2013/04/18 13:34, Alan Cox wrote: > Author: alc > Date: Thu Apr 18 05:34:33 2013 > New Revision: 249605 > URL: http://svnweb.freebsd.org/changeset/base/249605 > > Log: > When calculating the number of reserved nodes, discount the pages that will > be used to store the nodes. > > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/vm/vm_radix.c > > Modified: head/sys/vm/vm_radix.c > ============================================================================== > --- head/sys/vm/vm_radix.c Thu Apr 18 05:12:11 2013 (r249604) > +++ head/sys/vm/vm_radix.c Thu Apr 18 05:34:33 2013 (r249605) > @@ -360,10 +360,17 @@ vm_radix_node_zone_init(void *mem, int s > static void > vm_radix_prealloc(void *arg __unused) > { > + int nodes; > > - if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count)) > + /* > + * Calculate the number of reserved nodes, discounting the pages that > + * are needed to store them. > + */ > + nodes = ((vm_paddr_t)cnt.v_page_count * PAGE_SIZE) / (PAGE_SIZE + > + sizeof(struct vm_radix_node)); > + if (!uma_zone_reserve_kva(vm_radix_node_zone, nodes)) > panic("%s: unable to create new zone", __func__); > - uma_prealloc(vm_radix_node_zone, cnt.v_page_count); > + uma_prealloc(vm_radix_node_zone, nodes); > } > SYSINIT(vm_radix_prealloc, SI_SUB_KMEM, SI_ORDER_SECOND, vm_radix_prealloc, > NULL); > FYI, after this change, my network card no longer works, the driver /sys/dev/if_msk.c reports watchdog timeout, backing out this change works again for me. Regards, David Xu From owner-svn-src-all@FreeBSD.ORG Thu May 2 03:50:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B0815DDE for ; Thu, 2 May 2013 03:50:06 +0000 (UTC) (envelope-from j.m.cooper@borgsdemons.com) Received: from nm25.access.bullet.mail.sp2.yahoo.com (nm25.access.bullet.mail.sp2.yahoo.com [98.139.44.152]) by mx1.freebsd.org (Postfix) with ESMTP id 951CA126A for ; Thu, 2 May 2013 03:50:05 +0000 (UTC) Received: from [98.139.44.102] by nm25.access.bullet.mail.sp2.yahoo.com with NNFMP; 02 May 2013 03:46:54 -0000 Received: from [98.137.12.185] by tm7.access.bullet.mail.sp2.yahoo.com with NNFMP; 02 May 2013 03:46:54 -0000 Received: from [127.0.0.1] by smtp110.biz.mail.gq1.yahoo.com with NNFMP; 02 May 2013 03:46:54 -0000 X-Yahoo-Newman-Id: 861821.36083.bm@smtp110.biz.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: TAJF3YQVM1lnF8yI43CSa.1J9E32rRDxjTH9HhhH8TTbSgI JiMS7jkeHO.vEyQ4gCpviOvHzUwfbogj4rK3ZKSxANC8odhlXiqx461rYIjq VorGL37zuNuzMgSt6ApLCNfOTzEWyG3eUnq9yDRzMOR3b61t04cos78vtc7B mERSm2R5Ki_mCXcgp9x3XXpE9s.4pcj9yPHdmZf3aqWMYTe6WsKNx9QpMC3_ b0xEma.t.PF0UPoO1S8VNIbZKCrcyFY7mBIJSpZML.Jm27OazBUtiya0bFVD WXj.C7tTBR2W0m8DnNEKvKOTXbZM83pCEHclMWWowTFixEyoGmjZcRvOi_Y. P0dRbkQU15qsmpc.iPwiRs0PtU22BoB_L_XcjyT51RKcGRXDdDrWMqY_p.wd bvfoGJjy03kPZTpLMR.dTJswlCwJjEwPTE9cAtt4bqsP_uVKt89SSu30Txjm p4B_JzWWTOKgk5ZZWMcsFARNFkA-- X-Yahoo-SMTP: VcsS1ceswBAiCdFGlCDyQjSL5IpjXQVTjtG0dfoKj_spUOjjgZeO X-Rocket-Received: from g7-HP.kc.rr.com (j.m.cooper@76.92.155.168 with plain) by smtp110.biz.mail.gq1.yahoo.com with SMTP; 01 May 2013 20:46:54 -0700 PDT Message-ID: <5181E191.6080905@borgsdemons.com> Date: Wed, 01 May 2013 22:46:25 -0500 From: John Merryweather Cooper User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130404 Thunderbird/17.0.5 MIME-Version: 1.0 To: svn-src-all@freebsd.org Subject: Re: svn commit: r249800 - head/sys/dev/bwn References: <201304231302.r3ND2w5V024981@svn.freebsd.org> <201304291123.41402.jhb@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 03:50:06 -0000 On 04/29/13 12:42, Adrian Chadd wrote: > On 29 April 2013 09:44, hiren panchasara wrote: > >>> Does anyone here have bwn hardware that works? >> >> I do not. > > Have an expresscard slot? Want some? > > > > adrian > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > My bwn in an HP dv9420us laptop worked in 8.x but does not in 9.1. -- -- John M. Cooper From owner-svn-src-all@FreeBSD.ORG Thu May 2 04:22:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 78FC7403; Thu, 2 May 2013 04:22:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6B711132C; Thu, 2 May 2013 04:22:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r424M4kI069018; Thu, 2 May 2013 04:22:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r424M4XR069017; Thu, 2 May 2013 04:22:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305020422.r424M4XR069017@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 04:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250170 - stable/9/libexec/rtld-elf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 04:22:05 -0000 Author: kib Date: Thu May 2 04:22:04 2013 New Revision: 250170 URL: http://svnweb.freebsd.org/changeset/base/250170 Log: MFC r250075: Properly terminate the result string for intermediate results. Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Thu May 2 01:39:32 2013 (r250169) +++ stable/9/libexec/rtld-elf/rtld.c Thu May 2 04:22:04 2013 (r250170) @@ -784,7 +784,7 @@ origin_subst_one(char *real, const char /* * Now, execute the substitution loop. */ - for (p = real, resp = res;;) { + for (p = real, resp = res, *resp = '\0';;) { p1 = strstr(p, kw); if (p1 != NULL) { /* Copy the prefix before keyword. */ @@ -793,6 +793,7 @@ origin_subst_one(char *real, const char /* Keyword replacement. */ memcpy(resp, subst, subst_len); resp += subst_len; + *resp = '\0'; p = p1 + kw_len; } else break; From owner-svn-src-all@FreeBSD.ORG Thu May 2 04:23:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 24080724; Thu, 2 May 2013 04:23:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15D881334; Thu, 2 May 2013 04:23:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r424NvAv069410; Thu, 2 May 2013 04:23:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r424NvJl069409; Thu, 2 May 2013 04:23:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305020423.r424NvJl069409@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 04:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250171 - stable/8/libexec/rtld-elf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 04:23:58 -0000 Author: kib Date: Thu May 2 04:23:57 2013 New Revision: 250171 URL: http://svnweb.freebsd.org/changeset/base/250171 Log: MFC r250075: Properly terminate the result string for intermediate results. Modified: stable/8/libexec/rtld-elf/rtld.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Thu May 2 04:22:04 2013 (r250170) +++ stable/8/libexec/rtld-elf/rtld.c Thu May 2 04:23:57 2013 (r250171) @@ -697,7 +697,7 @@ origin_subst_one(char *real, const char /* * Now, execute the substitution loop. */ - for (p = real, resp = res;;) { + for (p = real, resp = res, *resp = '\0';;) { p1 = strstr(p, kw); if (p1 != NULL) { /* Copy the prefix before keyword. */ @@ -706,6 +706,7 @@ origin_subst_one(char *real, const char /* Keyword replacement. */ memcpy(resp, subst, subst_len); resp += subst_len; + *resp = '\0'; p = p1 + kw_len; } else break; From owner-svn-src-all@FreeBSD.ORG Thu May 2 05:00:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5D5B1BC1 for ; Thu, 2 May 2013 05:00:44 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) by mx1.freebsd.org (Postfix) with ESMTP id D91B2146A for ; Thu, 2 May 2013 05:00:43 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id fh20so158756lab.20 for ; Wed, 01 May 2013 22:00:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=j/PnHtxLVn4XeHrl5IGaOL4aYU6/eSTS0U0+YmQAYSU=; b=idFam6/IE/+BLekVZT4ozdsKeTA3zbF0pqVPrwxun4Wc+f8AcMiokdhQCZ0ooLVp1u 32b+Ex9EBn4EqVdZgQWPNWeJshULpAblRUmbVw+QPzTBzGMqPPQFx07uv4OE38enJV9E QnhHHPzYu1T9onmNxzL8t6GgTJC6MbxWVK0Cei/HsRth//rWRRqKZ4qr4IsBf2qKkeWz MFNkgpZ3hbTpg9uqNiTUVEtxwSRbF4wFD7/AhZul6Tvob26i7U2lkPO8xPrW5xVD0OFs usoPep0AXRCCQM6/aW7IDKeWeoNnYoBm4YHbXGHwk4l4IMxdsayWIKCCVvFXSjrIwGyO XmNA== X-Received: by 10.112.146.6 with SMTP id sy6mr2047289lbb.105.1367470842789; Wed, 01 May 2013 22:00:42 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id x9sm2127434lbi.15.2013.05.01.22.00.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 22:00:42 -0700 (PDT) Message-ID: <5181F2E6.2020603@freebsd.org> Date: Thu, 02 May 2013 09:00:22 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Brooks Davis Subject: Re: svn commit: r250121 - in stable/9: . etc share/mk References: <201304302213.r3UMDuoZ028919@svn.freebsd.org> In-Reply-To: <201304302213.r3UMDuoZ028919@svn.freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnkOxgIDiN5f1wjMkJx460Tqb1PKMFVf3LBsD5rt4QCsHX0eELIggYqnelmIxhr9fmQV558 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 05:00:44 -0000 On 01.05.2013 2:13, Brooks Davis wrote: > + Due to the use of the new -l option to install(1) during build > + and install, you must take care not to directly set the INSTALL > + make variable in your /etc/make.conf, /etc/src.conf, or on the > + command line. If you with to use the -C flag for all installs > + you may be able to add INSTALL+=-C to /etc/make.conf or > + /etc/src.conf. You need to update /usr/src/share/examples/etc/make.conf too, there is # Compare before install #INSTALL=install -C -- bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Thu May 2 05:09:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 31D4BD7C for ; Thu, 2 May 2013 05:09:56 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx1.freebsd.org (Postfix) with ESMTP id ADD1D14A3 for ; Thu, 2 May 2013 05:09:55 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id u10so162711lbi.2 for ; Wed, 01 May 2013 22:09:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=l7V91misio2G/+5tHTtEm8fuRFbsraFa9d3D/2eE8Qw=; b=U6I3kq3PuMrqo6p5ytjxAKC3uvFeZAPAiKEx6K46IEx/2vFtCg1h7yK5Ltr955cYDF M8cLcje4C1QAY3qJRQHO+GToKHGqxlzam0TRYIVIbsh2T0YPSS1SGdwp0RclGLAXBjR4 hZKfFJhTDeIh0A81NIHuxFWW9nvlhsEMClweR8OGprQ7SOj/nfBIbIk5sSznkGeqHIiL w2qS6XLUFO0OxyauyPi+bGyBnEK0rdxE5YYBavmjR7+PbGk+8+PL1NsMrws57bbpsVS8 H5Nvd7cB11OGOz3+1w/VYsghzMQyQP4E50PewneM0AFqRq+QjhVlVE+eOKdkZG6+7zNj K/bw== X-Received: by 10.152.5.106 with SMTP id r10mr1897035lar.18.1367471389362; Wed, 01 May 2013 22:09:49 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id t20sm2161583lbi.5.2013.05.01.22.09.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 22:09:48 -0700 (PDT) Message-ID: <5181F509.2010003@freebsd.org> Date: Thu, 02 May 2013 09:09:29 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Brooks Davis Subject: Re: svn commit: r250121 - in stable/9: . etc share/mk References: <201304302213.r3UMDuoZ028919@svn.freebsd.org> In-Reply-To: <201304302213.r3UMDuoZ028919@svn.freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmnjYNHINM4eR8KwEntvqQEN6r9OZcc2kHtY9XIFtycpids7bQTizJDxJ2l3WPsmPI93hxR Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 05:09:56 -0000 On 01.05.2013 2:13, Brooks Davis wrote: > +# > +# install(1) parameters. > +# > +HRDLINK?= -l h > +SYMLINK?= -l s It is error, there must be no space or "-" sign. -- bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Thu May 2 05:12:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DE5E8EF2 for ; Thu, 2 May 2013 05:12:29 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com [IPv6:2a00:1450:4010:c03::231]) by mx1.freebsd.org (Postfix) with ESMTP id 65FC614AD for ; Thu, 2 May 2013 05:12:29 +0000 (UTC) Received: by mail-la0-f49.google.com with SMTP id eh20so163012lab.22 for ; Wed, 01 May 2013 22:12:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=2g7gmf2bIWFFVInoLbLDrQkjP9dW1Wtb1CwjKEpg5bA=; b=I+UPI/NCH+EFjvsF/cjTko0GeTZx8Z79xcLhV/ojuAoU4MzFVw4mz9PkPfKGAvxC/x 3BEvGqSfzFI7Zi7uVLu+clQj/TjUI02iPwmQ6r/FPy47YrlEaum6YeWnMWoWwjHW/Tmj pfVyhAfEOTVRXJpJUZe7T9TgbKTkimx0/Y6DfRqL3t7BTK6HBxyaRV0/E5qLf1IthcMG 3fWzZ0FdJzYT0BfzQC/DfGqo1luxMprpT16L/KBXuJzBvjfV+pJlDtOx7PTTNKEzaYqI EMZn0Hk1CKpKBxXOlXyw5U4njvpKHjYb0z8OXOKMAyDH1joO33/uWw71oqr/w6LIG0Il phsg== X-Received: by 10.112.129.2 with SMTP id ns2mr2082517lbb.53.1367471548346; Wed, 01 May 2013 22:12:28 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id r9sm2171083lbr.3.2013.05.01.22.12.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 22:12:27 -0700 (PDT) Message-ID: <5181F5A8.1070503@freebsd.org> Date: Thu, 02 May 2013 09:12:08 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Brooks Davis Subject: Re: svn commit: r250121 - in stable/9: . etc share/mk References: <201304302213.r3UMDuoZ028919@svn.freebsd.org> <5181F509.2010003@freebsd.org> In-Reply-To: <5181F509.2010003@freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQln2X6gbyEywbDGd1eDCiPFVxq3YPOV5UnowQ3dMxylYvFGJL36TeISUSv5SIK6fESDpwht Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 05:12:29 -0000 On 02.05.2013 9:09, Andrey Chernov wrote: > On 01.05.2013 2:13, Brooks Davis wrote: >> +# >> +# install(1) parameters. >> +# >> +HRDLINK?= -l h >> +SYMLINK?= -l s > > It is error, there must be no space or "-" sign. Sorry my mistake. All right. -- bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Thu May 2 07:02:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F3C22165; Thu, 2 May 2013 07:02:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E5D69183C; Thu, 2 May 2013 07:02:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4272Ndu024589; Thu, 2 May 2013 07:02:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4272NdU024588; Thu, 2 May 2013 07:02:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305020702.r4272NdU024588@svn.freebsd.org> From: Adrian Chadd Date: Thu, 2 May 2013 07:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250172 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 07:02:24 -0000 Author: adrian Date: Thu May 2 07:02:23 2013 New Revision: 250172 URL: http://svnweb.freebsd.org/changeset/base/250172 Log: Fix this code to compile without warnings - AH_DEBUG was pulling in ichan, but OS_MARK was not using it. It only uses it when AH_DEBUG_ALQ is also defined. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c Thu May 2 04:23:57 2013 (r250171) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c Thu May 2 07:02:23 2013 (r250172) @@ -86,11 +86,15 @@ ar9300_set_channel(struct ath_hal *ah, s u_int8_t clk_25mhz = AH9300(ah)->clk_25mhz; CHAN_CENTERS centers; int load_synth_channel; -#ifdef AH_DEBUG +#ifdef AH_DEBUG_ALQ HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan); #endif -#ifdef AH_DEBUG + /* + * Put this behind AH_DEBUG_ALQ for now until the Hornet + * channel_sel code below is made to work. + */ +#ifdef AH_DEBUG_ALQ OS_MARK(ah, AH_MARK_SETCHANNEL, ichan->channel); #endif From owner-svn-src-all@FreeBSD.ORG Thu May 2 07:05:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 60FE33FE; Thu, 2 May 2013 07:05:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 42FC01865; Thu, 2 May 2013 07:05:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4275ZPa025409; Thu, 2 May 2013 07:05:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4275YlO025406; Thu, 2 May 2013 07:05:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305020705.r4275YlO025406@svn.freebsd.org> From: Adrian Chadd Date: Thu, 2 May 2013 07:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250173 - in head/sys: conf modules/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 07:05:35 -0000 Author: adrian Date: Thu May 2 07:05:34 2013 New Revision: 250173 URL: http://svnweb.freebsd.org/changeset/base/250173 Log: Add the AR9300 HAL into the kernel and module builds. Tested: * make universe (honest!) Modified: head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 2 07:02:23 2013 (r250172) +++ head/sys/conf/files Thu May 2 07:05:34 2013 (r250173) @@ -982,6 +982,54 @@ dev/ath/ath_hal/ar9002/ar9287_cal.c opti dev/ath/ath_hal/ar9002/ar9287_olc.c optional ath_hal | ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +# ar9300 +contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal ${NO_WCONSTANT_CONVERSION}" +contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_keycache.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_paprd.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_power.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal ${NO_WSOMETIMES_UNINITIALIZED}" +contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_timer.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_xmit_ds.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" + # rf backends dev/ath/ath_hal/ar5212/ar2316.c optional ath_rf2316 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" @@ -1006,6 +1054,7 @@ dev/ath/ath_hal/ar9002/ar9285.c optional compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar9002/ar9287.c optional ath_hal | ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" + # ath rate control algorithms dev/ath/ath_rate/amrr/amrr.c optional ath_rate_amrr \ compile-with "${NORMAL_C} -I$S/dev/ath" Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu May 2 07:02:23 2013 (r250172) +++ head/sys/conf/kern.pre.mk Thu May 2 07:05:34 2013 (r250173) @@ -65,7 +65,7 @@ INCLUDES+= -I$S/contrib/altq INCLUDES+= -I$S/contrib/ipfilter # ... and the same for ath -INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath_hal +INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal # ... and the same for the NgATM stuff INCLUDES+= -I$S/contrib/ngatm Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Thu May 2 07:02:23 2013 (r250172) +++ head/sys/modules/ath/Makefile Thu May 2 07:05:34 2013 (r250173) @@ -124,13 +124,13 @@ SRCS+= ah_eeprom_9287.c SRCS+= ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c # + AR9300 HAL -# .PATH: ${.CURDIR}/../../contrib/sys/dev/ath/ath_hal/ar9300 -#SRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c -#SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c -#SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c -#SRCS+= ar9300_stub_funcs.c ar9300_eeprom.c ar9300_paprd.c ar9300_recv_ds.c -#SRCS+= ar9300_freebsd.c ar9300_phy.c ar9300_reset.c ar9300_gpio.c -#SRCS+= ar9300_power.c ar9300_timer.c +.PATH: ${.CURDIR}/../../contrib/dev/ath/ath_hal/ar9300 +SRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c +SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c +SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c +SRCS+= ar9300_stub_funcs.c ar9300_eeprom.c ar9300_paprd.c ar9300_recv_ds.c +SRCS+= ar9300_freebsd.c ar9300_phy.c ar9300_reset.c ar9300_gpio.c +SRCS+= ar9300_power.c ar9300_timer.c # NB: rate control is bound to the driver by symbol names so only pick one .if ${ATH_RATE} == "sample" @@ -149,7 +149,7 @@ SRCS+= amrr.c SRCS+= dfs_null.c CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal -# CFLAGS+= -I. -I${.CURDIR}/../../contrib/sys/dev/ath/ath_hal/ +CFLAGS+= -I. -I${.CURDIR}/../../contrib/dev/ath/ath_hal/ .if !defined(KERNBUILDDIR) opt_ah.h: @@ -164,5 +164,5 @@ CWARNFLAGS.if_ath.c= ${NO_WSOMETIMES_UN CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} # AR9300 HAL build overrides, as there's still some code to tidy up -#CWARNFLAGS.ar9300_eeprom.c= ${NO_WCONSTANT_CONVERSION} -#CWARNFLAGS.ar9300_reset.c= ${NO_WSOMETIMES_UNINITIALIZED} +CWARNFLAGS.ar9300_eeprom.c= ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS.ar9300_reset.c= ${NO_WSOMETIMES_UNINITIALIZED} From owner-svn-src-all@FreeBSD.ORG Thu May 2 12:35:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D17508E8; Thu, 2 May 2013 12:35:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C417E1842; Thu, 2 May 2013 12:35:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42CZFBA041547; Thu, 2 May 2013 12:35:15 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42CZFSN041546; Thu, 2 May 2013 12:35:15 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305021235.r42CZFSN041546@svn.freebsd.org> From: Ed Maste Date: Thu, 2 May 2013 12:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250175 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 12:35:15 -0000 Author: emaste Date: Thu May 2 12:35:15 2013 New Revision: 250175 URL: http://svnweb.freebsd.org/changeset/base/250175 Log: Switch to standard copyright license text The initial version of this came from Sandvine but had "PROVIDED BY NETAPP, INC" in the copyright text, presuambly because the license block was copied from another file. Replace it with standard "AUTHOR AND CONTRIBUTORS" form. Approvided by: grehan@ Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Thu May 2 07:20:26 2013 (r250174) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Thu May 2 12:35:15 2013 (r250175) @@ -12,10 +12,10 @@ * 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 NETAPP, INC ``AS IS'' AND + * 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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * 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) From owner-svn-src-all@FreeBSD.ORG Thu May 2 12:43:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 16401BBF; Thu, 2 May 2013 12:43:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E2E3A1885; Thu, 2 May 2013 12:43:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42ChuGH044735; Thu, 2 May 2013 12:43:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42ChuMH044734; Thu, 2 May 2013 12:43:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305021243.r42ChuMH044734@svn.freebsd.org> From: Rick Macklem Date: Thu, 2 May 2013 12:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250176 - head/usr.sbin/gssd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 12:43:57 -0000 Author: rmacklem Date: Thu May 2 12:43:56 2013 New Revision: 250176 URL: http://svnweb.freebsd.org/changeset/base/250176 Log: Fix the getpwuid_r() call in the gssd daemon so that it handles the ERANGE error return case. Without this fix, authentication of users for certain system setups could fail unexpectedly. Reported by: Elias Martenson (lokedhs@gmail.com) Tested by: Elias Martenson (earlier version) MFC after: 2 weeks Modified: head/usr.sbin/gssd/gssd.c Modified: head/usr.sbin/gssd/gssd.c ============================================================================== --- head/usr.sbin/gssd/gssd.c Thu May 2 12:35:15 2013 (r250175) +++ head/usr.sbin/gssd/gssd.c Thu May 2 12:43:56 2013 (r250176) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifndef WITHOUT_KERBEROS #include #endif @@ -557,8 +558,11 @@ gssd_pname_to_uid_1_svc(pname_to_uid_arg { gss_name_t name = gssd_find_resource(argp->pname); uid_t uid; - char buf[128]; + char buf[1024], *bufp; struct passwd pwd, *pw; + size_t buflen; + int error; + static size_t buflen_hint = 1024; memset(result, 0, sizeof(*result)); if (name) { @@ -567,7 +571,24 @@ gssd_pname_to_uid_1_svc(pname_to_uid_arg name, argp->mech, &uid); if (result->major_status == GSS_S_COMPLETE) { result->uid = uid; - getpwuid_r(uid, &pwd, buf, sizeof(buf), &pw); + buflen = buflen_hint; + for (;;) { + pw = NULL; + bufp = buf; + if (buflen > sizeof(buf)) + bufp = malloc(buflen); + if (bufp == NULL) + break; + error = getpwuid_r(uid, &pwd, bufp, buflen, + &pw); + if (error != ERANGE) + break; + if (buflen > sizeof(buf)) + free(bufp); + buflen += 1024; + if (buflen > buflen_hint) + buflen_hint = buflen; + } if (pw) { int len = NGRPS; int groups[NGRPS]; @@ -584,6 +605,8 @@ gssd_pname_to_uid_1_svc(pname_to_uid_arg result->gidlist.gidlist_len = 0; result->gidlist.gidlist_val = NULL; } + if (bufp != NULL && buflen > sizeof(buf)) + free(bufp); } } else { result->major_status = GSS_S_BAD_NAME; From owner-svn-src-all@FreeBSD.ORG Thu May 2 12:52:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0EA54ED2; Thu, 2 May 2013 12:52:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DCBC11904; Thu, 2 May 2013 12:52:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42Cqnst047959; Thu, 2 May 2013 12:52:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42CqnjQ047958; Thu, 2 May 2013 12:52:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305021252.r42CqnjQ047958@svn.freebsd.org> From: Rick Macklem Date: Thu, 2 May 2013 12:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250177 - head/kerberos5/lib/libgssapi_krb5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 12:52:50 -0000 Author: rmacklem Date: Thu May 2 12:52:49 2013 New Revision: 250177 URL: http://svnweb.freebsd.org/changeset/base/250177 Log: Fix the getpwnam_r() call in the pname_to_uid() kerberos library function so that it handles the ERANGE error return case. Without this fix, authentication of users for certain system setups could fail unexpectedly. Reported by: Elias Martenson (lokedhs@gmail.com) Tested by: Elias Martenson (earlier version) MFC after: 2 weeks Modified: head/kerberos5/lib/libgssapi_krb5/pname_to_uid.c Modified: head/kerberos5/lib/libgssapi_krb5/pname_to_uid.c ============================================================================== --- head/kerberos5/lib/libgssapi_krb5/pname_to_uid.c Thu May 2 12:43:56 2013 (r250176) +++ head/kerberos5/lib/libgssapi_krb5/pname_to_uid.c Thu May 2 12:52:49 2013 (r250177) @@ -26,6 +26,7 @@ */ /* $FreeBSD$ */ +#include #include #include "krb5/gsskrb5_locl.h" @@ -37,8 +38,12 @@ _gsskrb5_pname_to_uid(OM_uint32 *minor_s krb5_context context; krb5_const_principal name = (krb5_const_principal) pname; krb5_error_code kret; - char lname[MAXLOGNAME + 1], buf[128]; + char lname[MAXLOGNAME + 1], buf[1024], *bufp; struct passwd pwd, *pw; + size_t buflen; + int error; + OM_uint32 ret; + static size_t buflen_hint = 1024; GSSAPI_KRB5_INIT (&context); @@ -49,11 +54,30 @@ _gsskrb5_pname_to_uid(OM_uint32 *minor_s } *minor_status = 0; - getpwnam_r(lname, &pwd, buf, sizeof(buf), &pw); + buflen = buflen_hint; + for (;;) { + pw = NULL; + bufp = buf; + if (buflen > sizeof(buf)) + bufp = malloc(buflen); + if (bufp == NULL) + break; + error = getpwnam_r(lname, &pwd, bufp, buflen, &pw); + if (error != ERANGE) + break; + if (buflen > sizeof(buf)) + free(bufp); + buflen += 1024; + if (buflen > buflen_hint) + buflen_hint = buflen; + } if (pw) { *uidp = pw->pw_uid; - return (GSS_S_COMPLETE); + ret = GSS_S_COMPLETE; } else { - return (GSS_S_FAILURE); + ret = GSS_S_FAILURE; } + if (bufp != NULL && buflen > sizeof(buf)) + free(bufp); + return (ret); } From owner-svn-src-all@FreeBSD.ORG Thu May 2 13:34:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C0046C7; Thu, 2 May 2013 13:34:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F22B21CAA; Thu, 2 May 2013 13:34:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42DYeTP063040; Thu, 2 May 2013 13:34:40 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42DYeZX063038; Thu, 2 May 2013 13:34:40 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305021334.r42DYeZX063038@svn.freebsd.org> From: Rick Macklem Date: Thu, 2 May 2013 13:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250178 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 13:34:41 -0000 Author: rmacklem Date: Thu May 2 13:34:40 2013 New Revision: 250178 URL: http://svnweb.freebsd.org/changeset/base/250178 Log: MFC: r249548 Allow the vnode to be unlocked for the weird case of LK_EXCLOTHER. LK_EXCLOTHER is only used to acquire a usecount on a vnode during NFSv4 recovery from an expired lease. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Thu May 2 12:52:49 2013 (r250177) +++ stable/9/sys/kern/vfs_subr.c Thu May 2 13:34:40 2013 (r250178) @@ -4182,7 +4182,7 @@ vop_lock_post(void *ap, int rc) struct vop_lock1_args *a = ap; ASSERT_VI_UNLOCKED(a->a_vp, "VOP_LOCK"); - if (rc == 0) + if (rc == 0 && (a->a_flags & LK_EXCLOTHER) == 0) ASSERT_VOP_LOCKED(a->a_vp, "VOP_LOCK"); #endif } From owner-svn-src-all@FreeBSD.ORG Thu May 2 14:14:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67FD4AB0; Thu, 2 May 2013 14:14:58 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 487291F1E; Thu, 2 May 2013 14:14:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42EEwCO077563; Thu, 2 May 2013 14:14:58 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42EEwI9077561; Thu, 2 May 2013 14:14:58 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305021414.r42EEwI9077561@svn.freebsd.org> From: Steven Hartland Date: Thu, 2 May 2013 14:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250179 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 14:14:58 -0000 Author: smh Date: Thu May 2 14:14:57 2013 New Revision: 250179 URL: http://svnweb.freebsd.org/changeset/base/250179 Log: Update probe flow so that devices with lbp can also disable disksort. Ensure that delete_available is reset so re-probes after a media change, to one with different delete characteristics, will result in the correct methods being flagged as available. Make all ccb state changes use a consistent flow: * free() * xpt_release_ccb() * softc->state = * xpt_schedule() Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu May 2 13:34:40 2013 (r250178) +++ head/sys/cam/scsi/scsi_da.c Thu May 2 14:14:57 2013 (r250179) @@ -2392,7 +2392,7 @@ out: if (!scsi_vpd_supported_page(periph, SVPD_BLOCK_LIMITS)) { /* Not supported skip to next probe */ - softc->state = DA_STATE_PROBE_ATA; + softc->state = DA_STATE_PROBE_BDC; goto skipstate; } @@ -2734,9 +2734,9 @@ dadone(struct cam_periph *periph, union * with the short version of the command. */ if (maxsector == 0xffffffff) { - softc->state = DA_STATE_PROBE_RC16; free(rdcap, M_SCSIDA); xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_RC16; xpt_schedule(periph, priority); return; } @@ -2838,9 +2838,9 @@ dadone(struct cam_periph *periph, union (error_code == SSD_CURRENT_ERROR) && (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { softc->flags &= ~DA_FLAG_CAN_RC16; - softc->state = DA_STATE_PROBE_RC; free(rdcap, M_SCSIDA); xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_RC; xpt_schedule(periph, priority); return; } else @@ -2897,36 +2897,39 @@ dadone(struct cam_periph *periph, union &softc->sysctl_task); xpt_announce_periph(periph, announce_buf); - if (lbp) { - /* - * Based on older SBC-3 spec revisions - * any of the UNMAP methods "may" be - * available via LBP given this flag so - * we flag all of them as availble and - * then remove those which further - * probes confirm aren't available - * later. - * - * We could also check readcap(16) p_type - * flag to exclude one or more invalid - * write same (X) types here - */ - dadeleteflag(softc, DA_DELETE_WS16, 1); - dadeleteflag(softc, DA_DELETE_WS10, 1); - dadeleteflag(softc, DA_DELETE_ZERO, 1); - dadeleteflag(softc, DA_DELETE_UNMAP, 1); - - softc->state = DA_STATE_PROBE_LBP; - xpt_release_ccb(done_ccb); - xpt_schedule(periph, priority); - return; - } } else { xpt_print(periph->path, "fatal error, " "could not acquire reference count\n"); } } + /* Ensure re-probe doesn't see old delete. */ + softc->delete_available = 0; + if (lbp) { + /* + * Based on older SBC-3 spec revisions + * any of the UNMAP methods "may" be + * available via LBP given this flag so + * we flag all of them as availble and + * then remove those which further + * probes confirm aren't available + * later. + * + * We could also check readcap(16) p_type + * flag to exclude one or more invalid + * write same (X) types here + */ + dadeleteflag(softc, DA_DELETE_WS16, 1); + dadeleteflag(softc, DA_DELETE_WS10, 1); + dadeleteflag(softc, DA_DELETE_ZERO, 1); + dadeleteflag(softc, DA_DELETE_UNMAP, 1); + + xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_LBP; + xpt_schedule(periph, priority); + return; + } + xpt_release_ccb(done_ccb); softc->state = DA_STATE_PROBE_BDC; xpt_schedule(periph, priority); @@ -2954,8 +2957,8 @@ dadone(struct cam_periph *periph, union if (lbp->flags & SVPD_LBP_UNMAP) { free(lbp, M_SCSIDA); - softc->state = DA_STATE_PROBE_BLK_LIMITS; xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_BLK_LIMITS; xpt_schedule(periph, priority); return; } @@ -2984,7 +2987,7 @@ dadone(struct cam_periph *periph, union free(lbp, M_SCSIDA); xpt_release_ccb(done_ccb); - softc->state = DA_STATE_PROBE_ATA; + softc->state = DA_STATE_PROBE_BDC; xpt_schedule(periph, priority); return; } @@ -3047,7 +3050,7 @@ dadone(struct cam_periph *periph, union free(block_limits, M_SCSIDA); xpt_release_ccb(done_ccb); - softc->state = DA_STATE_PROBE_ATA; + softc->state = DA_STATE_PROBE_BDC; xpt_schedule(periph, priority); return; } @@ -3084,8 +3087,8 @@ dadone(struct cam_periph *periph, union } free(bdc, M_SCSIDA); - softc->state = DA_STATE_PROBE_ATA; xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_ATA; xpt_schedule(periph, priority); return; } From owner-svn-src-all@FreeBSD.ORG Thu May 2 14:19:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1308C145; Thu, 2 May 2013 14:19:43 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0472F1F6F; Thu, 2 May 2013 14:19:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42EJg1u078502; Thu, 2 May 2013 14:19:42 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42EJgT9078501; Thu, 2 May 2013 14:19:42 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305021419.r42EJgT9078501@svn.freebsd.org> From: Steven Hartland Date: Thu, 2 May 2013 14:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250180 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 14:19:43 -0000 Author: smh Date: Thu May 2 14:19:42 2013 New Revision: 250180 URL: http://svnweb.freebsd.org/changeset/base/250180 Log: Fix probe in progress check in dareprobe Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu May 2 14:14:57 2013 (r250179) +++ head/sys/cam/scsi/scsi_da.c Thu May 2 14:19:42 2013 (r250180) @@ -3200,7 +3200,7 @@ dareprobe(struct cam_periph *periph) softc = (struct da_softc *)periph->softc; /* Probe in progress; don't interfere. */ - if ((softc->flags & DA_FLAG_PROBED) == 0) + if (softc->state != DA_STATE_NORMAL) return; status = cam_periph_acquire(periph); From owner-svn-src-all@FreeBSD.ORG Thu May 2 14:37:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 802EE805; Thu, 2 May 2013 14:37:24 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 61AA11065; Thu, 2 May 2013 14:37:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42EbOfA085187; Thu, 2 May 2013 14:37:24 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42EbOZf085185; Thu, 2 May 2013 14:37:24 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305021437.r42EbOZf085185@svn.freebsd.org> From: Steven Hartland Date: Thu, 2 May 2013 14:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250181 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 14:37:24 -0000 Author: smh Date: Thu May 2 14:37:23 2013 New Revision: 250181 URL: http://svnweb.freebsd.org/changeset/base/250181 Log: Use the existence of ATA Information VPD to determine if we should attempt to query ATA functionality via ATA Pass-Through (16) as this page is defined as "must" for SATL devices, hence indicating that the device is at least likely to support Pass-Through (16). This eliminates errors produced by CTL when ATA Pass-Through (16) fails. Switch ATA probe daerror call to SF_NO_PRINT to avoid errors printing out for devices which return invalid errors. Output details about supported and choosen delete method when verbose booted. Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu May 2 14:19:42 2013 (r250180) +++ head/sys/cam/scsi/scsi_all.h Thu May 2 14:37:23 2013 (r250181) @@ -1430,6 +1430,12 @@ struct scsi_diag_page { }; /* + * ATA Information VPD Page based on + * T10/2126-D Revision 04 + */ +#define SVPD_ATA_INFORMATION 0x89 + +/* * Block Device Characteristics VPD Page based on * T10/1799-D Revision 31 */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu May 2 14:19:42 2013 (r250180) +++ head/sys/cam/scsi/scsi_da.c Thu May 2 14:37:23 2013 (r250181) @@ -918,6 +918,7 @@ static off_t dadeletemaxsize(struct da_ da_delete_methods delete_method); static void dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method); +static void daprobedone(struct cam_periph *periph, union ccb *ccb); static periph_ctor_t daregister; static periph_dtor_t dacleanup; @@ -1680,6 +1681,65 @@ dadeletemaxsize(struct da_softc *softc, } static void +daprobedone(struct cam_periph *periph, union ccb *ccb) +{ + struct da_softc *softc; + + softc = (struct da_softc *)periph->softc; + + dadeletemethodchoose(softc, DA_DELETE_NONE); + + if (bootverbose && (softc->flags & DA_FLAG_PROBED) == 0) { + char buf[80]; + int i, sep; + + snprintf(buf, sizeof(buf), "Delete methods: <"); + sep = 0; + for (i = DA_DELETE_MIN; i <= DA_DELETE_MAX; i++) { + if (softc->delete_available & (1 << i)) { + if (sep) { + strlcat(buf, ",", sizeof(buf)); + } else { + sep = 1; + } + strlcat(buf, da_delete_method_names[i], + sizeof(buf)); + if (i == softc->delete_method) { + strlcat(buf, "(*)", sizeof(buf)); + } + } + } + if (sep == 0) { + if (softc->delete_method == DA_DELETE_NONE) + strlcat(buf, "NONE(*)", sizeof(buf)); + else + strlcat(buf, "DISABLED(*)", sizeof(buf)); + } + strlcat(buf, ">", sizeof(buf)); + printf("%s%d: %s\n", periph->periph_name, + periph->unit_number, buf); + } + + /* + * Since our peripheral may be invalidated by an error + * above or an external event, we must release our CCB + * before releasing the probe lock on the peripheral. + * The peripheral will only go away once the last lock + * is removed, and we need it around for the CCB release + * operation. + */ + xpt_release_ccb(ccb); + softc->state = DA_STATE_NORMAL; + daschedule(periph); + wakeup(&softc->disk->d_mediasize); + if ((softc->flags & DA_FLAG_PROBED) == 0) { + softc->flags |= DA_FLAG_PROBED; + cam_periph_unhold(periph); + } else + cam_periph_release_locked(periph); +} + +static void dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method) { int i, delete_method; @@ -2457,6 +2517,11 @@ out: { struct ata_params *ata_params; + if (!scsi_vpd_supported_page(periph, SVPD_ATA_INFORMATION)) { + daprobedone(periph, start_ccb); + break; + } + ata_params = (struct ata_params*) malloc(sizeof(*ata_params), M_SCSIDA, M_NOWAIT|M_ZERO); @@ -3121,7 +3186,7 @@ dadone(struct cam_periph *periph, union } else { int error; error = daerror(done_ccb, CAM_RETRY_SELTO, - SF_RETRY_UA|SF_QUIET_IR); + SF_RETRY_UA|SF_NO_PRINT); if (error == ERESTART) return; else if (error != 0) { @@ -3137,24 +3202,7 @@ dadone(struct cam_periph *periph, union } free(ata_params, M_SCSIDA); - dadeletemethodchoose(softc, DA_DELETE_NONE); - /* - * Since our peripheral may be invalidated by an error - * above or an external event, we must release our CCB - * before releasing the probe lock on the peripheral. - * The peripheral will only go away once the last lock - * is removed, and we need it around for the CCB release - * operation. - */ - xpt_release_ccb(done_ccb); - softc->state = DA_STATE_NORMAL; - daschedule(periph); - wakeup(&softc->disk->d_mediasize); - if ((softc->flags & DA_FLAG_PROBED) == 0) { - softc->flags |= DA_FLAG_PROBED; - cam_periph_unhold(periph); - } else - cam_periph_release_locked(periph); + daprobedone(periph, done_ccb); return; } case DA_CCB_WAITING: From owner-svn-src-all@FreeBSD.ORG Thu May 2 14:55:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5B734E13; Thu, 2 May 2013 14:55:22 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D6611157; Thu, 2 May 2013 14:55:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42EtMqG091820; Thu, 2 May 2013 14:55:22 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42EtM09091819; Thu, 2 May 2013 14:55:22 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305021455.r42EtM09091819@svn.freebsd.org> From: Davide Italiano Date: Thu, 2 May 2013 14:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250182 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 14:55:22 -0000 Author: davide Date: Thu May 2 14:55:21 2013 New Revision: 250182 URL: http://svnweb.freebsd.org/changeset/base/250182 Log: Suppress a GCC warning. This warning is actually bogus and newer GCC versions than the one in base (dim@ mentioned he tried on 4.7.3 and 4.8.1) do not whine about it, so, at some point this workaround will be reverted. Reported by: ache Discussed with: dim Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Thu May 2 14:37:23 2013 (r250181) +++ head/sys/dev/hwpmc/hwpmc_core.c Thu May 2 14:55:21 2013 (r250182) @@ -1945,7 +1945,7 @@ iap_allocate_pmc(int cpu, int ri, struct caps = a->pm_caps; if ((IAP_PMC_CAPS & caps) != caps) return (EPERM); - + map = 0; /* XXX: silent GCC warning */ arch = iap_is_event_architectural(pm->pm_event, &map); if (arch == EV_IS_ARCH_NOTSUPP) return (EOPNOTSUPP); From owner-svn-src-all@FreeBSD.ORG Thu May 2 15:03:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A7D6E12E; Thu, 2 May 2013 15:03:30 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 99B8411B6; Thu, 2 May 2013 15:03:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42F3UwQ095053; Thu, 2 May 2013 15:03:30 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42F3UBU095052; Thu, 2 May 2013 15:03:30 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305021503.r42F3UBU095052@svn.freebsd.org> From: Steven Hartland Date: Thu, 2 May 2013 15:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250183 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 15:03:30 -0000 Author: smh Date: Thu May 2 15:03:30 2013 New Revision: 250183 URL: http://svnweb.freebsd.org/changeset/base/250183 Log: Enable CAM SCSI to choice ATA TRIM during autodetection and correct method names after increasing the priority of ATA TRIM. Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu May 2 14:55:21 2013 (r250182) +++ head/sys/cam/scsi/scsi_da.c Thu May 2 15:03:30 2013 (r250183) @@ -133,14 +133,14 @@ typedef enum { DA_DELETE_WS16, DA_DELETE_WS10, DA_DELETE_ZERO, - DA_DELETE_MIN = DA_DELETE_UNMAP, + DA_DELETE_MIN = DA_DELETE_ATA_TRIM, DA_DELETE_MAX = DA_DELETE_ZERO } da_delete_methods; static const char *da_delete_method_names[] = - { "NONE", "DISABLE", "UNMAP", "ATA_TRIM", "WS16", "WS10", "ZERO" }; + { "NONE", "DISABLE", "ATA_TRIM", "UNMAP", "WS16", "WS10", "ZERO" }; static const char *da_delete_method_desc[] = - { "NONE", "DISABLED", "UNMAP", "ATA TRIM", "WRITE SAME(16) with UNMAP", + { "NONE", "DISABLED", "ATA TRIM", "UNMAP", "WRITE SAME(16) with UNMAP", "WRITE SAME(10) with UNMAP", "ZERO" }; /* Offsets into our private area for storing information */ From owner-svn-src-all@FreeBSD.ORG Thu May 2 15:05:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 994692D1 for ; Thu, 2 May 2013 15:05:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 66E4111D6 for ; Thu, 2 May 2013 15:05:32 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r42F5Wv3036952 for ; Thu, 2 May 2013 15:05:32 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r42F5WNg036945 for svn-src-all@freebsd.org; Thu, 2 May 2013 15:05:32 GMT (envelope-from bdrewery) Received: (qmail 84190 invoked from network); 2 May 2013 10:05:30 -0500 Received: from unknown (HELO ?173.160.118.90?) (freebsd@shatow.net@173.160.118.90) by sweb.xzibition.com with ESMTPA; 2 May 2013 10:05:30 -0500 Message-ID: <518280BA.1000607@FreeBSD.org> Date: Thu, 02 May 2013 10:05:30 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Andrey Chernov Subject: Re: svn commit: r250121 - in stable/9: . etc share/mk References: <201304302213.r3UMDuoZ028919@svn.freebsd.org> <5181F2E6.2020603@freebsd.org> In-Reply-To: <5181F2E6.2020603@freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2WDQNVDBPGEIGMKLMJRIH" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 15:05:32 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2WDQNVDBPGEIGMKLMJRIH Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 5/2/2013 12:00 AM, Andrey Chernov wrote: > On 01.05.2013 2:13, Brooks Davis wrote: >> + Due to the use of the new -l option to install(1) during build >> + and install, you must take care not to directly set the INSTALL >> + make variable in your /etc/make.conf, /etc/src.conf, or on the >> + command line. If you with to use the -C flag for all installs >> + you may be able to add INSTALL+=3D-C to /etc/make.conf or >> + /etc/src.conf. >=20 > You need to update /usr/src/share/examples/etc/make.conf too, there is > # Compare before install > #INSTALL=3Dinstall -C >=20 I've done so in HEAD r249952, I just need to MFC it now. --=20 Regards, Bryan Drewery ------enig2WDQNVDBPGEIGMKLMJRIH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRgoC+AAoJEG54KsA8mwz51YMP/jqNR/G1w8lA4vDTXoYws16t 5scyiqXMUDno3JjrK+l25/BjCvnVUyyb/7Rot7DhFWIIqAGgOSsvedsM9IquxQuE ypHQwHJGDtOeXqsK2V4sxmsclZHaQ2WYVx9RWlRLCiLQGrP9Ruth2FkWETyjyZDd D/zJB+CqrAYKUTl5f/VpAYevVK/r0Wo+5iSzMq0MYViiCHrQ/Smz8qZs9iTwiHAn DZ0LJ0LHZ30jQZHicGWDKZDqzhb1Z4h36GnxDxuFEe8gx8G0DZAK9jTbq7QAxTio n63QiGz5UKcgQr7ViCjt/OkezYn9AhZ3Aa2/cOFISafrfGFEQ8xG+mbk4g79DMq3 IEM7hy0Fy7a2eR35EZjayZu+DAg1s+TmYK/zKJDcAX8y7MKqdp4v+iv0Un+wJLNY EkRuy1yko0cdUBCrWRHbHFrCO2a30b2/fXHG9PNJTpnj0MzuxJxREreuFgdjaGYI ddywIYdDv/TgkLqpd9jfGHxU4ORTVin06PxsaQL+D27mGcetWJyoDXTfoy1X4wVQ UxpDAUbfSzbTGMYAyO67HueCDQmlTYiVve4SEHKRfj1ndmOnHlsTSVEFVsmnjv8+ 6v7QYWzndfvUgrbWrfbzhfiLCqfZabkd4D52pZUmbp7Tuzwk67oyEM4pxu8P9fbY hN4ZcKIBIepnXXN5NLsF =1oAl -----END PGP SIGNATURE----- ------enig2WDQNVDBPGEIGMKLMJRIH-- From owner-svn-src-all@FreeBSD.ORG Thu May 2 16:01:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3E57467F; Thu, 2 May 2013 16:01:05 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 306E91604; Thu, 2 May 2013 16:01:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42G15XQ015730; Thu, 2 May 2013 16:01:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42G14Lx015724; Thu, 2 May 2013 16:01:04 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305021601.r42G14Lx015724@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 2 May 2013 16:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250184 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 16:01:05 -0000 Author: luigi Date: Thu May 2 16:01:04 2013 New Revision: 250184 URL: http://svnweb.freebsd.org/changeset/base/250184 Log: remove trailing whitespace Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Thu May 2 15:03:30 2013 (r250183) +++ head/sys/dev/netmap/if_em_netmap.h Thu May 2 16:01:04 2013 (r250184) @@ -276,7 +276,7 @@ em_netmap_rxsync(struct ifnet *ifp, u_in k = ring->cur; if (k > lim) return netmap_ring_reinit(kring); - + if (do_lock) EM_RX_LOCK(rxr); Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Thu May 2 15:03:30 2013 (r250183) +++ head/sys/dev/netmap/if_re_netmap.h Thu May 2 16:01:04 2013 (r250184) @@ -150,7 +150,7 @@ re_netmap_txsync(struct ifnet *ifp, u_in /* update avail to what the kernel knows */ ring->avail = kring->nr_hwavail; - + j = kring->nr_hwcur; if (j != k) { /* we have new packets to send */ l = sc->rl_ldata.rl_tx_prodidx; @@ -169,7 +169,7 @@ re_netmap_txsync(struct ifnet *ifp, u_in // XXX what about prodidx ? return netmap_ring_reinit(kring); } - + if (l == lim) /* mark end of ring */ cmd |= RL_TDESC_CMD_EOR; @@ -334,7 +334,7 @@ re_netmap_rxsync(struct ifnet *ifp, u_in */ static void re_netmap_tx_init(struct rl_softc *sc) -{ +{ struct rl_txdesc *txd; struct rl_desc *desc; int i, n; Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu May 2 15:03:30 2013 (r250183) +++ head/sys/dev/netmap/netmap.c Thu May 2 16:01:04 2013 (r250184) @@ -168,10 +168,10 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, bridge #endif /* !linux */ -/* +/* * These are used to handle reference counters for bridge ports. */ -#define ADD_BDG_REF(ifp) refcount_acquire(&NA(ifp)->na_bdg_refcount) +#define ADD_BDG_REF(ifp) refcount_acquire(&NA(ifp)->na_bdg_refcount) #define DROP_BDG_REF(ifp) refcount_release(&NA(ifp)->na_bdg_refcount) static void bdg_netmap_attach(struct ifnet *ifp); @@ -313,7 +313,7 @@ netmap_update_config(struct netmap_adapt txd = na->num_tx_desc; rxr = na->num_rx_rings; rxd = na->num_rx_desc; - } + } if (na->num_tx_rings == txr && na->num_tx_desc == txd && na->num_rx_rings == rxr && na->num_rx_desc == rxd) Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Thu May 2 15:03:30 2013 (r250183) +++ head/sys/dev/netmap/netmap_mem2.c Thu May 2 16:01:04 2013 (r250184) @@ -101,7 +101,7 @@ // #define NMA_LOCK_T safe_spinlock_t #define NMA_LOCK_T struct semaphore #define NMA_LOCK_INIT() sema_init(&nm_mem.nm_mtx, 1) -#define NMA_LOCK_DESTROY() +#define NMA_LOCK_DESTROY() #define NMA_LOCK() down(&nm_mem.nm_mtx) #define NMA_UNLOCK() up(&nm_mem.nm_mtx) #else /* !linux */ @@ -527,12 +527,12 @@ netmap_config_obj_allocator(struct netma objsize += LINE_ROUND - i; } if (objsize < p->objminsize || objsize > p->objmaxsize) { - D("requested objsize %d out of range [%d, %d]", + D("requested objsize %d out of range [%d, %d]", objsize, p->objminsize, p->objmaxsize); goto error; } if (objtotal < p->nummin || objtotal > p->nummax) { - D("requested objtotal %d out of range [%d, %d]", + D("requested objtotal %d out of range [%d, %d]", objtotal, p->nummin, p->nummax); goto error; } @@ -693,7 +693,7 @@ netmap_memory_config(void) /* reset previous allocation */ for (i = 0; i < NETMAP_POOLS_NR; i++) { netmap_reset_obj_allocator(&nm_mem.pools[i]); - } + } nm_mem.finalized = 0; } From owner-svn-src-all@FreeBSD.ORG Thu May 2 16:09:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3D07298E; Thu, 2 May 2013 16:09:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2F26C16D7; Thu, 2 May 2013 16:09:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42G97st017407; Thu, 2 May 2013 16:09:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42G97oM017406; Thu, 2 May 2013 16:09:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305021609.r42G97oM017406@svn.freebsd.org> From: Alexander Motin Date: Thu, 2 May 2013 16:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250185 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 16:09:07 -0000 Author: mav Date: Thu May 2 16:09:06 2013 New Revision: 250185 URL: http://svnweb.freebsd.org/changeset/base/250185 Log: Add IDs for HighPoint RocketRAID 640L/642L/644L -- new series of 4-port 6Gbps PCIe 2.0 x2 SATA controllers, based on Marvell 88SE9235 chips. MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu May 2 16:01:04 2013 (r250184) +++ head/sys/dev/ahci/ahci.c Thu May 2 16:09:06 2013 (r250185) @@ -223,6 +223,9 @@ static struct { {0x06401b4b, 0x00, "HighPoint RocketRAID 640", AHCI_Q_NOBSYRES}, {0x06441103, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, {0x06441b4b, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, + {0x06411103, 0x00, "HighPoint RocketRAID 640L", AHCI_Q_NOBSYRES}, + {0x06421103, 0x00, "HighPoint RocketRAID 642L", AHCI_Q_NOBSYRES}, + {0x06451103, 0x00, "HighPoint RocketRAID 644L", AHCI_Q_NOBSYRES}, {0x044c10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044d10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044e10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, From owner-svn-src-all@FreeBSD.ORG Thu May 2 17:02:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0D961947; Thu, 2 May 2013 17:02:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F39EE1A85; Thu, 2 May 2013 17:02:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42H2oOO036780; Thu, 2 May 2013 17:02:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42H2o5n036779; Thu, 2 May 2013 17:02:50 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305021702.r42H2o5n036779@svn.freebsd.org> From: Eitan Adler Date: Thu, 2 May 2013 17:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250186 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 17:02:52 -0000 Author: eadler Date: Thu May 2 17:02:50 2013 New Revision: 250186 URL: http://svnweb.freebsd.org/changeset/base/250186 Log: Prefer using the C++ version of the standard headers. These place the names within the std namespace (and possibly within the global namespace). The main advantage is that the C++ versions can provide optimized versions or simplified interfaces. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Thu May 2 16:09:06 2013 (r250185) +++ head/sbin/devd/devd.cc Thu May 2 17:02:50 2013 (r250186) @@ -73,19 +73,20 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include +#include +#include +#include +#include + #include -#include #include #include #include #include #include #include -#include -#include -#include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Thu May 2 17:09:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B9C33B51; Thu, 2 May 2013 17:09:00 +0000 (UTC) (envelope-from prvs=1834ac79c3=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id ADC791AC5; Thu, 2 May 2013 17:08:59 +0000 (UTC) Received: from r2d2 ([46.65.172.4]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50003607436.msg; Thu, 02 May 2013 18:08:51 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Thu, 02 May 2013 18:08:51 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 46.65.172.4 X-Return-Path: prvs=1834ac79c3=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <8323FBAA5BD84C7D948801DB8E15D12D@multiplay.co.uk> From: "Steven Hartland" To: "Kenneth D. Merry" References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> <20130501035832.GB79864@nargothrond.kdm.org> Subject: Re: svn commit: r249939 - head/sys/cam/scsi Date: Thu, 2 May 2013 18:09:29 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, trasz@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 17:09:00 -0000 ----- Original Message ----- From: "Kenneth D. Merry" > On Tue, Apr 30, 2013 at 04:16:49 +0100, Steven Hartland wrote: >> ----- Original Message ----- >> From: "Steven Hartland" >> >>On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: >> >>>Author: smh >> >>>Date: Fri Apr 26 16:17:04 2013 >> >>>New Revision: 249939 >> >>>URL: http://svnweb.freebsd.org/changeset/base/249939 >> >>> >> >>>Log: >> >>> Added available delete methods discovery during device probe, >> >>> including the >> >>> maximum sizes for said methods, which are used when processing >> >>> BIO_DELETE >> >>> requests. This includes updating UNMAP support discovery to be based on >> >>> SBC-3 T10/1799-D Revision 31 specification. >> >>> Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) >> >>> sys/cam/scsi/scsi_da.c: >> >>> - Added ATA Data Set Management TRIM support via ATA >> >>> Pass-Through(16) >> >>> as a delete_method >> >>> >> >> >> >>This adds a lot of unnecessary verbosity for devices that don't support >> >>ATA >> >>passthrough. For example: >> >> >> >>(da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 >> >>00 00 00 00 00 00 00 40 ec 00 >> >>(da7:iscsi4:0:0:0): CAM status: SCSI Status Error >> >>(da7:iscsi4:0:0:0): SCSI status: Check Condition >> >>(da7:iscsi4:0:0:0): Retrying command (per sense data) >> >>(2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 >> >>00 00 00 00 40 ec 00 >> >>(2:2:0:0): Tag: 0x00f6, Type: 1 >> >>(2:2:0:0): CTL Status: SCSI Error >> >>(2:2:0:0): SCSI Status: Check Condition >> >>(2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command >> >>operation code) >> >>(2:2:0:0): Command byte 0 is invalid >> >> >> >>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 >> >>00 00 00 00 00 00 00 40 ec 00 >> >>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error >> >>(da8:iscsi4:0:0:1): SCSI status: Check Condition >> >>(da8:iscsi4:0:0:1): Retrying command (per sense data) >> >>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 >> >>00 00 00 00 00 00 00 40 ec 00 >> >>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error >> >>(da8:iscsi4:0:0:1): SCSI status: Check Condition >> >>(da8:iscsi4:0:0:1): Error 5, Retries exhausted >> >> >> >>That is with CTL and and trasz's new iSCSI initiator, but you should see >> >>it >> >>with any CTL configuration. (And probably with any controller or device >> >>that doesn't support ATA passthrough.) >> >> >> >>So, please: >> >>- Check for the presence of VPD page 0x89 before sending an ATA >> >> passthrough command. The spec (sat3r03 in this case) says that >> >> it "shall" be implemented, so I think we can count on that. >> >>- If the target returns an illegal request sense key, don't retry >> >> again. The target will keep returning illegal request >> > >> >Thanks for the report Ken I'll check this on a card I know doesn't support >> >pass-through. >> >> I checked with an areca controller, which I know doesn't support pass16, and >> all is quiet during boot / probe. >> >> I can provoke output at the app layer with camcontrol identify da0, which is >> to be expected, but nothing in /var/log/messages. >> >> daerror handler in scsi_da.c definitely has SF_QUIET_IR so Illegal Request >> should never be output. > > You're correct, it should not print out any messages. > >> I can't provoke this using standard CAM devices even when they don't support >> ATA Pass-Through (16) so I think this is actually an issue with CTL: >> 1. Being verbose when it shouldn't (ctl_process_done - line 12571?) > > That part at least is by design -- it prints out rate-limited messages so > you know when the initiator is sending commands CTL doesn't support. It > comes in handy for figuring out initiator problems sometimes. > >> 2. Retrying Illegal Request commands when it shouldn't (I didn't experince >> this on r250032) > > CTL doesn't do any retries, it leaves that up to the initiator. > > I finally tracked down the problem. The issue is that the iSCSI initiator > wasn't setting the CAM_AUTOSNS_VALID flag in the CCB status field. As a > result, only the CAM status and SCSI status fields were being printed. > SF_QUIET_IR > >> The attached patch implements a check for ATA Information VPD before >> using ATA Pass-Through (16). It's had limited testing but I have >> confirmed it eliminates the use of pass16 under CTL and still enables >> ATA TRIM under on mpt for SATA disks, so looks promising. >> >> If you could test and let me know if it works for you Ken that would >> be appreciated. > > Yes, it does work and eliminates the error message, thanks! I think it is > also a better way to go, just in case we run into a target that has an > issue with the ATA passthrough CDB. A slightly modified version of this is now in the current r250181 http://svnweb.freebsd.org/changeset/base/250181 >> The test case I used for CTL was:- >> kldload ctl >> ctladm create -b ramdisk -s 10485760 >> ctladm port -o on >> >> As a side note while test "kldload ctl" caused kernel panic the once. > > What was the panic message? Unread portion of the kernel message buffer: ctl: CAM Target Layer loaded Fatal trap 9: general protection fault while in kernel mode cpuid = 0; apic id = 00 instruction pointer = 0x20:0xffffffff8029c860 stack pointer = 0x28:0xffffff823b8dc840 frame pointer = 0x28:0xffffff823b8dc910 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 4 (xpt_thrd) > This doesn't look like a CTL-specific problem (not on the surface), but > rather a more general CAM problem: > >> #8 0xffffffff8073e1f2 in calltrap () at >> /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:228 >> #9 0xffffffff8029c860 in cam_periph_alloc (periph_ctor=0xffffffff802af410 >> , periph_oninvalidate=0xfffffe0019cfa200, periph_dtor=> optimized out>, periph_start=0xfffffe0015980a90, name=> out>, type=2159638184, >> path=0xfffffe0015ad79a0, ac_callback=, code=> optimized out>) at /usr/home/smh/freebsd/base/head/sys/cam/cam_periph.c:227 >> #10 0xffffffff802aed6b in scsi_scan_lun (request_ccb=) >> at /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:2266 >> #11 0xffffffff802b2859 in scsi_scan_bus (periph=0x0, >> request_ccb=0xfffffe00234df000) at >> /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:1969 >> #12 0xffffffff802a66c5 in xpt_scanner_thread (dummy=) >> at /usr/home/smh/freebsd/base/head/sys/cam/cam_xpt.c:2411 >> #13 0xffffffff8055cde4 in fork_exit (callout=0xffffffff802a6650 >> , arg=0x0, frame=0xffffff823b8dcc00) at >> /usr/home/smh/freebsd/base/head/sys/kern/kern_fork.c:991 >> #14 0xffffffff8073e72e in fork_trampoline () at >> /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:602 >> #15 0x0000000000000000 in ?? () > > If this is on a stock FreeBSD/head, it looks like it failed on this line in > cam_periph_alloc(): Apart from those patches yes stock FreeBSD/head. > cur_periph = TAILQ_FIRST(&(*p_drv)->units); > > Perhaps there's an issue with the ctl peripheral driver getting added to > the list of peripheral drivers (via periphdriver_register()). The topology > lock isn't held in periphdriver_register(), so it's possible that the > thread was in between the peripheral driver list traversal and the line > above when the peripheral was added. > > It's more likely that the scan request was generated as a result of the CTL > ports going online. And that means that the peripheral driver registration > should have long since been done. > > If you can reproduce the problem, you can probably figure out where the > issue is. I've not been able to reproduce I'm afraid, seems you cant kldunload ctl so needs a reboot between loads, tried 3 times but nothing. I did however notice the following after turning ports off, which may indicated a reference leak:- May 2 17:06:25 head kernel: (da2:ctl2cam0:0:1:0): lost device - 0 outstanding, 2 refs May 2 17:06:25 head kernel: (pass6:ctl2cam0:0:1:0): lost device May 2 17:06:25 head kernel: (pass6:ctl2cam0:0:1:0): removing device entry May 2 17:06:25 head kernel: (da2:ctl2cam0:0:1:0): removing device entry Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-all@FreeBSD.ORG Thu May 2 17:16:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 57DB91000; Thu, 2 May 2013 17:16:56 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) by mx1.freebsd.org (Postfix) with ESMTP id 287991B28; Thu, 2 May 2013 17:16:55 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id r42AnAI9020295; Thu, 2 May 2013 12:16:54 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp1.rice.edu with ESMTP id 1c3847gh73-1; Thu, 02 May 2013 12:16:54 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 3EBF14041F; Thu, 2 May 2013 12:16:53 -0500 (CDT) Message-ID: <51829F82.6050402@rice.edu> Date: Thu, 02 May 2013 12:16:50 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130127 Thunderbird/17.0.2 MIME-Version: 1.0 To: David Xu Subject: Re: svn commit: r249605 - head/sys/vm References: <201304180534.r3I5YXK4015577@svn.freebsd.org> <5181E1E7.3090708@freebsd.org> In-Reply-To: <5181E1E7.3090708@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 17:16:56 -0000 On 05/01/2013 22:47, David Xu wrote: > On 2013/04/18 13:34, Alan Cox wrote: >> Author: alc >> Date: Thu Apr 18 05:34:33 2013 >> New Revision: 249605 >> URL: http://svnweb.freebsd.org/changeset/base/249605 >> >> Log: >> When calculating the number of reserved nodes, discount the pages >> that will >> be used to store the nodes. >> >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/sys/vm/vm_radix.c >> >> Modified: head/sys/vm/vm_radix.c >> ============================================================================== >> >> --- head/sys/vm/vm_radix.c Thu Apr 18 05:12:11 2013 (r249604) >> +++ head/sys/vm/vm_radix.c Thu Apr 18 05:34:33 2013 (r249605) >> @@ -360,10 +360,17 @@ vm_radix_node_zone_init(void *mem, int s >> static void >> vm_radix_prealloc(void *arg __unused) >> { >> + int nodes; >> >> - if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count)) >> + /* >> + * Calculate the number of reserved nodes, discounting the pages >> that >> + * are needed to store them. >> + */ >> + nodes = ((vm_paddr_t)cnt.v_page_count * PAGE_SIZE) / (PAGE_SIZE + >> + sizeof(struct vm_radix_node)); >> + if (!uma_zone_reserve_kva(vm_radix_node_zone, nodes)) >> panic("%s: unable to create new zone", __func__); >> - uma_prealloc(vm_radix_node_zone, cnt.v_page_count); >> + uma_prealloc(vm_radix_node_zone, nodes); >> } >> SYSINIT(vm_radix_prealloc, SI_SUB_KMEM, SI_ORDER_SECOND, >> vm_radix_prealloc, >> NULL); >> > > FYI, after this change, my network card no longer works, the > driver /sys/dev/if_msk.c reports watchdog timeout, backing out > this change works again for me. The only effect of this change should be to reduce the amount of kernel virtual and physical memory preallocated for radix tree nodes by a few percent. I really can't imagine how that impacts the operation of the if_msk.c driver. Can you send me additional info on the affected machine off list? Also, if possible, I'd like to know the values of "nodes" and "cnt.v_page_count". Alan From owner-svn-src-all@FreeBSD.ORG Thu May 2 17:23:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0F91D299; Thu, 2 May 2013 17:23:26 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id A3B771B9B; Thu, 2 May 2013 17:23:25 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r42HNJ3M006724; Thu, 2 May 2013 11:23:19 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r42HNJKu006723; Thu, 2 May 2013 11:23:19 -0600 (MDT) (envelope-from ken) Date: Thu, 2 May 2013 11:23:19 -0600 From: "Kenneth D. Merry" To: Steven Hartland Subject: Re: svn commit: r249939 - head/sys/cam/scsi Message-ID: <20130502172319.GA6226@nargothrond.kdm.org> References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> <20130501035832.GB79864@nargothrond.kdm.org> <8323FBAA5BD84C7D948801DB8E15D12D@multiplay.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8323FBAA5BD84C7D948801DB8E15D12D@multiplay.co.uk> User-Agent: Mutt/1.4.2i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, trasz@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 17:23:26 -0000 On Thu, May 02, 2013 at 18:09:29 +0100, Steven Hartland wrote: > > ----- Original Message ----- > From: "Kenneth D. Merry" > > >On Tue, Apr 30, 2013 at 04:16:49 +0100, Steven Hartland wrote: > >>----- Original Message ----- > >>From: "Steven Hartland" > >>>>On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: > >>>>>Author: smh > >>>>>Date: Fri Apr 26 16:17:04 2013 > >>>>>New Revision: 249939 > >>>>>URL: http://svnweb.freebsd.org/changeset/base/249939 > >>>>> > >>>>>Log: > >>>>> Added available delete methods discovery during device probe, > >>>>> including the > >>>>> maximum sizes for said methods, which are used when processing > >>>>> BIO_DELETE > >>>>> requests. This includes updating UNMAP support discovery to be based > >>on > >>>>> SBC-3 T10/1799-D Revision 31 specification. > >>>>> Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) > >>>>> sys/cam/scsi/scsi_da.c: > >>>>> - Added ATA Data Set Management TRIM support via ATA > >>>>> Pass-Through(16) > >>>>> as a delete_method > >>>>> > >>>> > >>>>This adds a lot of unnecessary verbosity for devices that don't support > >>>>ATA > >>>>passthrough. For example: > >>>> > >>>>(da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 > >>02 >>00 00 00 00 00 00 00 40 ec 00 > >>>>(da7:iscsi4:0:0:0): CAM status: SCSI Status Error > >>>>(da7:iscsi4:0:0:0): SCSI status: Check Condition > >>>>(da7:iscsi4:0:0:0): Retrying command (per sense data) > >>>>(2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 > >>00 >>00 00 00 00 40 ec 00 > >>>>(2:2:0:0): Tag: 0x00f6, Type: 1 > >>>>(2:2:0:0): CTL Status: SCSI Error > >>>>(2:2:0:0): SCSI Status: Check Condition > >>>>(2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command > >>>>operation code) > >>>>(2:2:0:0): Command byte 0 is invalid > >>>> > >>>>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 > >>02 >>00 00 00 00 00 00 00 40 ec 00 > >>>>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error > >>>>(da8:iscsi4:0:0:1): SCSI status: Check Condition > >>>>(da8:iscsi4:0:0:1): Retrying command (per sense data) > >>>>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 > >>02 >>00 00 00 00 00 00 00 40 ec 00 > >>>>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error > >>>>(da8:iscsi4:0:0:1): SCSI status: Check Condition > >>>>(da8:iscsi4:0:0:1): Error 5, Retries exhausted > >>>> > >>>>That is with CTL and and trasz's new iSCSI initiator, but you should > >>see >>it > >>>>with any CTL configuration. (And probably with any controller or device > >>>>that doesn't support ATA passthrough.) > >>>> > >>>>So, please: > >>>>- Check for the presence of VPD page 0x89 before sending an ATA > >>>> passthrough command. The spec (sat3r03 in this case) says that > >>>> it "shall" be implemented, so I think we can count on that. > >>>>- If the target returns an illegal request sense key, don't retry > >>>> again. The target will keep returning illegal request > >>> > >>>Thanks for the report Ken I'll check this on a card I know doesn't > >>support > >>>pass-through. > >> > >>I checked with an areca controller, which I know doesn't support pass16, > >>and > >>all is quiet during boot / probe. > >> > >>I can provoke output at the app layer with camcontrol identify da0, which > >>is > >>to be expected, but nothing in /var/log/messages. > >> > >>daerror handler in scsi_da.c definitely has SF_QUIET_IR so Illegal Request > >>should never be output. > > > >You're correct, it should not print out any messages. > > > >>I can't provoke this using standard CAM devices even when they don't > >>support > >>ATA Pass-Through (16) so I think this is actually an issue with CTL: > >>1. Being verbose when it shouldn't (ctl_process_done - line 12571?) > > > >That part at least is by design -- it prints out rate-limited messages so > >you know when the initiator is sending commands CTL doesn't support. It > >comes in handy for figuring out initiator problems sometimes. > > > >>2. Retrying Illegal Request commands when it shouldn't (I didn't experince > >>this on r250032) > > > >CTL doesn't do any retries, it leaves that up to the initiator. > > > >I finally tracked down the problem. The issue is that the iSCSI initiator > >wasn't setting the CAM_AUTOSNS_VALID flag in the CCB status field. As a > >result, only the CAM status and SCSI status fields were being printed. > >SF_QUIET_IR > > > >>The attached patch implements a check for ATA Information VPD before > >>using ATA Pass-Through (16). It's had limited testing but I have > >>confirmed it eliminates the use of pass16 under CTL and still enables > >>ATA TRIM under on mpt for SATA disks, so looks promising. > >> > >>If you could test and let me know if it works for you Ken that would > >>be appreciated. > > > >Yes, it does work and eliminates the error message, thanks! I think it is > >also a better way to go, just in case we run into a target that has an > >issue with the ATA passthrough CDB. > > A slightly modified version of this is now in the current r250181 > http://svnweb.freebsd.org/changeset/base/250181 > > >>The test case I used for CTL was:- > >>kldload ctl > >>ctladm create -b ramdisk -s 10485760 > >>ctladm port -o on > >> > >>As a side note while test "kldload ctl" caused kernel panic the once. > > > >What was the panic message? > > Unread portion of the kernel message buffer: > ctl: CAM Target Layer loaded > > Fatal trap 9: general protection fault while in kernel mode > cpuid = 0; apic id = 00 > instruction pointer = 0x20:0xffffffff8029c860 > stack pointer = 0x28:0xffffff823b8dc840 > frame pointer = 0x28:0xffffff823b8dc910 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 4 (xpt_thrd) > > >This doesn't look like a CTL-specific problem (not on the surface), but > >rather a more general CAM problem: > > > >>#8 0xffffffff8073e1f2 in calltrap () at > >>/usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:228 > >>#9 0xffffffff8029c860 in cam_periph_alloc > >>(periph_ctor=0xffffffff802af410 , > >>periph_oninvalidate=0xfffffe0019cfa200, periph_dtor= >>out>, periph_start=0xfffffe0015980a90, name=, > >>type=2159638184, > >> path=0xfffffe0015ad79a0, ac_callback=, > >> code=) at > >> /usr/home/smh/freebsd/base/head/sys/cam/cam_periph.c:227 > >>#10 0xffffffff802aed6b in scsi_scan_lun (request_ccb= >>out>) at /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:2266 > >>#11 0xffffffff802b2859 in scsi_scan_bus (periph=0x0, > >>request_ccb=0xfffffe00234df000) at > >>/usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:1969 > >>#12 0xffffffff802a66c5 in xpt_scanner_thread (dummy= >>out>) at /usr/home/smh/freebsd/base/head/sys/cam/cam_xpt.c:2411 > >>#13 0xffffffff8055cde4 in fork_exit (callout=0xffffffff802a6650 > >>, arg=0x0, frame=0xffffff823b8dcc00) at > >>/usr/home/smh/freebsd/base/head/sys/kern/kern_fork.c:991 > >>#14 0xffffffff8073e72e in fork_trampoline () at > >>/usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:602 > >>#15 0x0000000000000000 in ?? () > > > >If this is on a stock FreeBSD/head, it looks like it failed on this line in > >cam_periph_alloc(): > > Apart from those patches yes stock FreeBSD/head. Okay. > > cur_periph = TAILQ_FIRST(&(*p_drv)->units); > > > >Perhaps there's an issue with the ctl peripheral driver getting added to > >the list of peripheral drivers (via periphdriver_register()). The topology > >lock isn't held in periphdriver_register(), so it's possible that the > >thread was in between the peripheral driver list traversal and the line > >above when the peripheral was added. > > > >It's more likely that the scan request was generated as a result of the CTL > >ports going online. And that means that the peripheral driver registration > >should have long since been done. > > > >If you can reproduce the problem, you can probably figure out where the > >issue is. > > I've not been able to reproduce I'm afraid, seems you cant kldunload ctl > so needs a reboot between loads, tried 3 times but nothing. Thanks for trying, I'll be on the lookout for any other reports. > I did however notice the following after turning ports off, which may > indicated a reference leak:- > > May 2 17:06:25 head kernel: (da2:ctl2cam0:0:1:0): lost device - 0 > outstanding, 2 refs > May 2 17:06:25 head kernel: (pass6:ctl2cam0:0:1:0): lost device > May 2 17:06:25 head kernel: (pass6:ctl2cam0:0:1:0): removing device entry > May 2 17:06:25 head kernel: (da2:ctl2cam0:0:1:0): removing device entry The references are normal. The da(4) driver keeps one reference for GEOM until GEOM calls it back after cleaning up its resources. (That's the reference released in dadiskgonecb().) It also has a reference for each open call, and acquires references during probe for things like the sysctl variable initialization. The key thing is the last line, "removing device entry", since it means that every context that has a reference into the da(4) driver has cleaned it up so it can be removed. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Thu May 2 18:08:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02E29EE0; Thu, 2 May 2013 18:08:34 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by mx1.freebsd.org (Postfix) with ESMTP id 130A51DE5; Thu, 2 May 2013 18:08:32 +0000 (UTC) Received: by mail-ee0-f43.google.com with SMTP id b15so430257eek.16 for ; Thu, 02 May 2013 11:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from:x-priority :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer; bh=TBoPVqo5wJRnPvoMpRJy6mbQoEetwN0uRnkrvRDef/c=; b=x14aiWiEpUFOpkWYJ42mrTePVFZjsZNdBkfXMdfVgPF85EJvsvfk/WfBclqeXUg1UV f9WoYu7yraXqE+I6c8LebhLdzdR10gJMiXGs6Uyj5zQ9b90TeTTfNTsGVXylUMMYoV3t ZpxCJGUVFvg8/A3t6tHxkM4oDc2u3P7cRDImlNI+IHUpRPBH/aiG2y4uO7yva+Ewk3PH AMBIFdBNhGW5u5tbBm8xJfZ2DEArMmn7DDenNgHhoQ+Q7OdNJB5p+ywzvd/qg+7PP7e3 3R8aBYPxoWouc5OSQDvcEfqyIoZEJklykO+MttaoIQYlFzuQreHQ3Az/y3jwOJkr0PgO +ZIQ== X-Received: by 10.15.31.197 with SMTP id y45mr22260748eeu.18.1367518106340; Thu, 02 May 2013 11:08:26 -0700 (PDT) Received: from [192.168.1.104] (45.81.datacomsa.pl. [195.34.81.45]) by mx.google.com with ESMTPSA id bp51sm9289779eeb.5.2013.05.02.11.08.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 11:08:25 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Subject: Re: svn commit: r249939 - head/sys/cam/scsi Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= X-Priority: 3 In-Reply-To: <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> Date: Thu, 2 May 2013 20:08:22 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> To: Steven Hartland X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@FreeBSD.org, Steven Hartland , "Kenneth D. Merry" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 18:08:34 -0000 Wiadomo=B6=E6 napisana przez Steven Hartland w dniu 30 kwi 2013, o godz. = 05:16: [..] > If anyone's interested the trace was:- > #0 doadump (textdump=3D0) at pcpu.h:231 > #1 0xffffffff802f6d6e in db_dump (dummy=3D, = dummy2=3D0, dummy3=3D0, dummy4=3D0x0) at = /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:543 > #2 0xffffffff802f683d in db_command (cmd_table=3D) at /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:449 > #3 0xffffffff802f65b4 in db_command_loop () at = /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:502 > #4 0xffffffff802f8f50 in db_trap (type=3D, = code=3D0) at /usr/home/smh/freebsd/base/head/sys/ddb/db_main.c:231 > #5 0xffffffff805c0df3 in kdb_trap (type=3D9, code=3D0, tf=3D) at = /usr/home/smh/freebsd/base/head/sys/kern/subr_kdb.c:654 > #6 0xffffffff8075580a in trap_fatal (frame=3D0xffffff823b8dc790, = eva=3D) at = /usr/home/smh/freebsd/base/head/sys/amd64/amd64/trap.c:867 > #7 0xffffffff807554b7 in trap (frame=3D) at = /usr/home/smh/freebsd/base/head/sys/amd64/amd64/trap.c:224 > #8 0xffffffff8073e1f2 in calltrap () at = /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:228 > #9 0xffffffff8029c860 in cam_periph_alloc = (periph_ctor=3D0xffffffff802af410 , = periph_oninvalidate=3D0xfffffe0019cfa200, periph_dtor=3D, periph_start=3D0xfffffe0015980a90, name=3D, = type=3D2159638184, > path=3D0xfffffe0015ad79a0, ac_callback=3D, = code=3D) at = /usr/home/smh/freebsd/base/head/sys/cam/cam_periph.c:227 > #10 0xffffffff802aed6b in scsi_scan_lun (request_ccb=3D) at = /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:2266 > #11 0xffffffff802b2859 in scsi_scan_bus (periph=3D0x0, = request_ccb=3D0xfffffe00234df000) at = /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:1969 > #12 0xffffffff802a66c5 in xpt_scanner_thread (dummy=3D) at /usr/home/smh/freebsd/base/head/sys/cam/cam_xpt.c:2411 I've seen a panic which is slightly different, but perhaps could be = related: #11 0xffffffff8085fde2 in __mtx_assert (c=3D0xffffff81aeccd8c0,=20 what=3D,=20 file=3D0xffffffff80e6b0aa = "/home/trasz/p4/iscsi/sys/kern/kern_cons.c",=20 line=3D128) at /home/trasz/p4/iscsi/sys/kern/kern_mutex.c:788 #12 0xffffffff802cc8e1 in xpt_compile_path (new_path=3D0xfffffe00150d7180,= =20 perph=3D0xfffffe00112e1e00, path_id=3D, = target_id=3D0,=20 lun_id=3D0) at /home/trasz/p4/iscsi/sys/cam/cam_xpt.c:4664 #13 0xffffffff802cba1b in xpt_create_path = (new_path_ptr=3D0xffffff81aeccdb50,=20 perph=3D0xfffffe00112e1e00, path_id=3D2, target_id=3D0, lun_id=3D0) at /home/trasz/p4/iscsi/sys/cam/cam_xpt.c:3398 #14 0xffffffff802dcca3 in scsi_scan_bus (periph=3D,=20= request_ccb=3D0xfffffe00157e4800) at /home/trasz/p4/iscsi/sys/cam/scsi/scsi_xpt.c:1955 #15 0xffffffff802d0ca4 in xpt_scanner_thread (dummy=3D) at /home/trasz/p4/iscsi/sys/cam/cam_xpt.c:841 It looks like it's impossible for the lock to be not owned in that code path, so it suggests some kind of memory corruption. It can be easily reproduced by creating several SIMs at the exact same time. [..] --=20 If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-all@FreeBSD.ORG Thu May 2 18:35:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8A030AA4; Thu, 2 May 2013 18:35:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C89B1F63; Thu, 2 May 2013 18:35:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42IZCun069058; Thu, 2 May 2013 18:35:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42IZCe0069057; Thu, 2 May 2013 18:35:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305021835.r42IZCe0069057@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 18:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250187 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 18:35:13 -0000 Author: kib Date: Thu May 2 18:35:12 2013 New Revision: 250187 URL: http://svnweb.freebsd.org/changeset/base/250187 Log: Add a hint suggesting why tmpfs does not need a special case there. Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Thu May 2 17:02:50 2013 (r250186) +++ head/sys/vm/vm_mmap.c Thu May 2 18:35:12 2013 (r250187) @@ -1289,7 +1289,7 @@ vm_mmap_vnode(struct thread *td, vm_size vp = (struct vnode *)obj->handle; /* * Bypass filesystems obey the mpsafety of the - * underlying fs. + * underlying fs. Tmpfs never bypasses. */ error = vget(vp, locktype, td); if (error != 0) From owner-svn-src-all@FreeBSD.ORG Thu May 2 18:36:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 298E5C25; Thu, 2 May 2013 18:36:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C2C81F71; Thu, 2 May 2013 18:36:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42Iaqmv069376; Thu, 2 May 2013 18:36:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42IaqZJ069375; Thu, 2 May 2013 18:36:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305021836.r42IaqZJ069375@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 18:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250188 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 18:36:53 -0000 Author: kib Date: Thu May 2 18:36:52 2013 New Revision: 250188 URL: http://svnweb.freebsd.org/changeset/base/250188 Log: The page read or written could be wired. Do not requeue if the page is not on a queue. Reported and tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:35:12 2013 (r250187) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:36:52 2013 (r250188) @@ -494,7 +494,8 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p vm_page_unhold(m); vm_page_deactivate(m); /* Requeue to maintain LRU ordering. */ - vm_page_requeue(m); + if (m->queue != PQ_NONE) + vm_page_requeue(m); vm_page_unlock(m); VM_OBJECT_WUNLOCK(tobj); @@ -609,7 +610,8 @@ tmpfs_mappedwrite(vm_object_t tobj, size vm_page_unhold(tpg); vm_page_deactivate(tpg); /* Requeue to maintain LRU ordering. */ - vm_page_requeue(tpg); + if (tpg->queue != PQ_NONE) + vm_page_requeue(tpg); vm_page_unlock(tpg); VM_OBJECT_WUNLOCK(tobj); From owner-svn-src-all@FreeBSD.ORG Thu May 2 18:44:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2AD2FDF; Thu, 2 May 2013 18:44:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D3A2A2000; Thu, 2 May 2013 18:44:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42IiWEO072438; Thu, 2 May 2013 18:44:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42IiWL1072432; Thu, 2 May 2013 18:44:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305021844.r42IiWL1072432@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 18:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250189 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 18:44:33 -0000 Author: kib Date: Thu May 2 18:44:31 2013 New Revision: 250189 URL: http://svnweb.freebsd.org/changeset/base/250189 Log: For the new regular tmpfs vnode, v_object is initialized before insmntque() is called. The standard insmntque destructor resets the vop vector to deadfs one, and calls vgone() on the vnode. As result, v_object is kept unchanged, which triggers an assertion in the reclaim code, on instmntque() failure. Also, in this case, OBJ_TMPFS flag on the backed vm object is not cleared. Provide the tmpfs insmntque() destructor which properly clears OBJ_TMPFS flag and resets v_object. Reported and tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu May 2 18:36:52 2013 (r250188) +++ head/sys/fs/tmpfs/tmpfs.h Thu May 2 18:44:31 2013 (r250189) @@ -402,6 +402,7 @@ int tmpfs_alloc_dirent(struct tmpfs_moun const char *, u_int, struct tmpfs_dirent **); void tmpfs_free_dirent(struct tmpfs_mount *, struct tmpfs_dirent *); void tmpfs_dirent_init(struct tmpfs_dirent *, const char *, u_int); +void tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj); int tmpfs_alloc_vp(struct mount *, struct tmpfs_node *, int, struct vnode **); void tmpfs_free_vp(struct vnode *); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu May 2 18:36:52 2013 (r250188) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu May 2 18:44:31 2013 (r250189) @@ -429,6 +429,36 @@ tmpfs_free_dirent(struct tmpfs_mount *tm /* --------------------------------------------------------------------- */ +void +tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj) +{ + + if (vp->v_type != VREG || obj == NULL) + return; + + VM_OBJECT_WLOCK(obj); + VI_LOCK(vp); + vm_object_clear_flag(obj, OBJ_TMPFS); + obj->un_pager.swp.swp_tmpfs = NULL; + VI_UNLOCK(vp); + VM_OBJECT_WUNLOCK(obj); +} + +/* + * Need to clear v_object for insmntque failure. + */ +static void +tmpfs_insmntque_dtr(struct vnode *vp, void *dtr_arg) +{ + + tmpfs_destroy_vobject(vp, vp->v_object); + vp->v_object = NULL; + vp->v_data = NULL; + vp->v_op = &dead_vnodeops; + vgone(vp); + vput(vp); +} + /* * Allocates a new vnode for the node node or returns a new reference to * an existing one if the node had already a vnode referencing it. The @@ -540,7 +570,7 @@ loop: panic("tmpfs_alloc_vp: type %p %d", node, (int)node->tn_type); } - error = insmntque(vp, mp); + error = insmntque1(vp, mp, tmpfs_insmntque_dtr, NULL); if (error) vp = NULL; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:36:52 2013 (r250188) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:44:31 2013 (r250189) @@ -1468,23 +1468,12 @@ tmpfs_reclaim(struct vop_reclaim_args *v struct tmpfs_mount *tmp; struct tmpfs_node *node; - vm_object_t obj; node = VP_TO_TMPFS_NODE(vp); tmp = VFS_TO_TMPFS(vp->v_mount); - if (node->tn_type == VREG) { - obj = node->tn_reg.tn_aobj; - if (obj != NULL) { - /* Instead of vnode_destroy_vobject() */ - VM_OBJECT_WLOCK(obj); - VI_LOCK(vp); - vm_object_clear_flag(obj, OBJ_TMPFS); - obj->un_pager.swp.swp_tmpfs = NULL; - VI_UNLOCK(vp); - VM_OBJECT_WUNLOCK(obj); - } - } + if (vp->v_type == VREG) + tmpfs_destroy_vobject(vp, node->tn_reg.tn_aobj); vp->v_object = NULL; cache_purge(vp); From owner-svn-src-all@FreeBSD.ORG Thu May 2 18:46:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BA5C01F6; Thu, 2 May 2013 18:46:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD4A6101B; Thu, 2 May 2013 18:46:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42IkVh3072863; Thu, 2 May 2013 18:46:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42IkVaO072862; Thu, 2 May 2013 18:46:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305021846.r42IkVaO072862@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 18:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250190 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 18:46:31 -0000 Author: kib Date: Thu May 2 18:46:31 2013 New Revision: 250190 URL: http://svnweb.freebsd.org/changeset/base/250190 Log: Fix the v_object leak for non-regular tmpfs vnodes. Reported and tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:44:31 2013 (r250189) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:46:31 2013 (r250190) @@ -264,6 +264,7 @@ tmpfs_open(struct vop_open_args *v) error = EPERM; else { error = 0; + /* For regular files, the call below is nop. */ vnode_create_vobject(vp, node->tn_size, v->a_td); } @@ -1474,6 +1475,8 @@ tmpfs_reclaim(struct vop_reclaim_args *v if (vp->v_type == VREG) tmpfs_destroy_vobject(vp, node->tn_reg.tn_aobj); + else + vnode_destroy_vobject(vp); vp->v_object = NULL; cache_purge(vp); From owner-svn-src-all@FreeBSD.ORG Thu May 2 19:45:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 43807171; Thu, 2 May 2013 19:45:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 346D11292; Thu, 2 May 2013 19:45:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42JjsMu094441; Thu, 2 May 2013 19:45:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42JjrfX094437; Thu, 2 May 2013 19:45:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305021945.r42JjrfX094437@svn.freebsd.org> From: Warner Losh Date: Thu, 2 May 2013 19:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250191 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 19:45:54 -0000 Author: imp Date: Thu May 2 19:45:53 2013 New Revision: 250191 URL: http://svnweb.freebsd.org/changeset/base/250191 Log: Expose cvmx_mgmt_port_num_ports() as a wrapper to the static __cvmx_mgmt_port_num_ports() mostly to avoid exporting a function starting with __. Modified: head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c head/sys/contrib/octeon-sdk/cvmx-mgmt-port.h Modified: head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c Thu May 2 18:46:31 2013 (r250190) +++ head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c Thu May 2 19:45:53 2013 (r250191) @@ -126,6 +126,17 @@ static int __cvmx_mgmt_port_num_ports(vo /** + * Return the number of management ports supported on this board. + * + * @return Number of ports + */ +int cvmx_mgmt_port_num_ports(void) +{ + return __cvmx_mgmt_port_num_ports(); +} + + +/** * Called to initialize a management port for use. Multiple calls * to this function across applications is safe. * Modified: head/sys/contrib/octeon-sdk/cvmx-mgmt-port.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-mgmt-port.h Thu May 2 18:46:31 2013 (r250190) +++ head/sys/contrib/octeon-sdk/cvmx-mgmt-port.h Thu May 2 19:45:53 2013 (r250191) @@ -223,6 +223,13 @@ extern cvmx_helper_link_info_t cvmx_mgmt */ extern int cvmx_mgmt_port_link_set(int port, cvmx_helper_link_info_t link_info); +/** + * Return the number of management ports supported on this board. + * + * @return Number of ports + */ +extern int cvmx_mgmt_port_num_ports(void); + #ifdef __cplusplus } #endif From owner-svn-src-all@FreeBSD.ORG Thu May 2 19:47:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 72EBD2FD; Thu, 2 May 2013 19:47:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC8712A1; Thu, 2 May 2013 19:47:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42JlbqG094780; Thu, 2 May 2013 19:47:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42Jlaf3094778; Thu, 2 May 2013 19:47:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305021947.r42Jlaf3094778@svn.freebsd.org> From: Warner Losh Date: Thu, 2 May 2013 19:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250192 - head/sys/mips/cavium/octe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 19:47:37 -0000 Author: imp Date: Thu May 2 19:47:36 2013 New Revision: 250192 URL: http://svnweb.freebsd.org/changeset/base/250192 Log: Use cvmx_mgmt_port_num_ports() instead of the inlined copy of a previous version of this function. Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/wrapper-cvmx-includes.h Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Thu May 2 19:45:53 2013 (r250191) +++ head/sys/mips/cavium/octe/ethernet-common.c Thu May 2 19:47:36 2013 (r250192) @@ -107,22 +107,7 @@ int cvm_assign_mac_address(uint64_t *mac if (cvm_oct_mac_addr == 0) return ENXIO; - /* - * The offset from mac_addr_base that should be used for the next port - * that is configured. By convention, if any mgmt ports exist on the - * chip, they get the first mac addresses. The ports controlled by - * driver that use this function are numbered sequencially following - * any mgmt addresses that may exist. - * - * XXX Would be nice if __cvmx_mgmt_port_num_ports() were - * not static to cvmx-mgmt-port.c. - */ - if (OCTEON_IS_MODEL(OCTEON_CN56XX)) - cvm_oct_mac_addr_offset = 1; - else if (OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN63XX)) - cvm_oct_mac_addr_offset = 2; - else - cvm_oct_mac_addr_offset = 0; + cvm_oct_mac_addr_offset = cvmx_mgmt_port_num_ports(); cvm_oct_mac_addr += cvm_oct_mac_addr_offset; } Modified: head/sys/mips/cavium/octe/wrapper-cvmx-includes.h ============================================================================== --- head/sys/mips/cavium/octe/wrapper-cvmx-includes.h Thu May 2 19:45:53 2013 (r250191) +++ head/sys/mips/cavium/octe/wrapper-cvmx-includes.h Thu May 2 19:47:36 2013 (r250192) @@ -44,6 +44,7 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Thu May 2 20:00:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C1538681; Thu, 2 May 2013 20:00:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B3DCD1302; Thu, 2 May 2013 20:00:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42K0B18098969; Thu, 2 May 2013 20:00:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42K0Bdk098965; Thu, 2 May 2013 20:00:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305022000.r42K0Bdk098965@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 20:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250193 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 20:00:11 -0000 Author: kib Date: Thu May 2 20:00:11 2013 New Revision: 250193 URL: http://svnweb.freebsd.org/changeset/base/250193 Log: The fsync(2) call should sync the vnode in such way that even after system crash which happen after successfull fsync() return, the data is accessible. For msdosfs, this means that FAT entries for the file must be written. Since we do not track the FAT blocks containing entries for the current file, just do a sloppy sync of the devvp vnode for the mount, which buffers, among other things, contain FAT blocks. Simultaneously, for deupdat(): - optimize by clearing the modified flags before short-circuiting a return, if the mount is read-only; - only ignore the rest of the function for denode with DE_MODIFIED flag clear when the waitfor argument is false. The directory buffer for the entry might be of delayed write; - microoptimize by comparing the updated directory entry with the current block content; - try to cluster the write, fall back to bawrite() if low on resources. Based on the submission by: bde MFC after: 2 weeks Modified: head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Thu May 2 19:47:36 2013 (r250192) +++ head/sys/fs/msdosfs/msdosfs_denode.c Thu May 2 20:00:11 2013 (r250193) @@ -288,16 +288,20 @@ deupdat(dep, waitfor) struct denode *dep; int waitfor; { - int error; + struct direntry dir; + struct timespec ts; struct buf *bp; struct direntry *dirp; - struct timespec ts; + int error; - if (DETOV(dep)->v_mount->mnt_flag & MNT_RDONLY) + if (DETOV(dep)->v_mount->mnt_flag & MNT_RDONLY) { + dep->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS | + DE_MODIFIED); return (0); + } getnanotime(&ts); DETIMES(dep, &ts, &ts, &ts); - if ((dep->de_flag & DE_MODIFIED) == 0) + if ((dep->de_flag & DE_MODIFIED) == 0 && waitfor == 0) return (0); dep->de_flag &= ~DE_MODIFIED; if (dep->de_Attributes & ATTR_DIRECTORY) @@ -307,13 +311,23 @@ deupdat(dep, waitfor) error = readde(dep, &bp, &dirp); if (error) return (error); - DE_EXTERNALIZE(dirp, dep); + DE_EXTERNALIZE(&dir, dep); + if (bcmp(dirp, &dir, sizeof(dir)) == 0) { + if (waitfor == 0 || (bp->b_flags & B_DELWRI) == 0) { + brelse(bp); + return (0); + } + } else + *dirp = dir; + if ((DETOV(dep)->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) + bp->b_flags |= B_CLUSTEROK; if (waitfor) - return (bwrite(bp)); - else { + error = bwrite(bp); + else if (vm_page_count_severe() || buf_dirty_count_severe()) + bawrite(bp); + else bdwrite(bp); - return (0); - } + return (error); } /* Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Thu May 2 19:47:36 2013 (r250192) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Thu May 2 20:00:11 2013 (r250193) @@ -850,9 +850,6 @@ errexit: /* * Flush the blocks of a file to disk. - * - * This function is worthless for vnodes that represent directories. Maybe we - * could just do a sync if they try an fsync on a directory file. */ static int msdosfs_fsync(ap) @@ -863,9 +860,35 @@ msdosfs_fsync(ap) struct thread *a_td; } */ *ap; { + struct vnode *devvp; + int allerror, error; vop_stdfsync(ap); - return (deupdat(VTODE(ap->a_vp), ap->a_waitfor == MNT_WAIT)); + + /* + * If the syncing request comes from fsync(2), sync the entire + * FAT and any other metadata that happens to be on devvp. We + * need this mainly for the FAT. We write the FAT sloppily, and + * syncing it all now is the best we can easily do to get all + * directory entries associated with the file (not just the file) + * fully synced. The other metadata includes critical metadata + * for all directory entries, but only in the MNT_ASYNC case. We + * will soon sync all metadata in the file's directory entry. + * Non-critical metadata for associated directory entries only + * gets synced accidentally, as in most file systems. + */ + if (ap->a_waitfor == MNT_WAIT) { + devvp = VTODE(ap->a_vp)->de_pmp->pm_devvp; + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); + allerror = VOP_FSYNC(devvp, MNT_WAIT, ap->a_td); + VOP_UNLOCK(devvp, 0); + } else + allerror = 0; + + error = deupdat(VTODE(ap->a_vp), ap->a_waitfor == MNT_WAIT); + if (allerror == 0) + allerror = error; + return (allerror); } static int From owner-svn-src-all@FreeBSD.ORG Thu May 2 21:49:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5471B425; Thu, 2 May 2013 21:49:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 450FF1710; Thu, 2 May 2013 21:49:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42Lnhi3041348; Thu, 2 May 2013 21:49:43 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42LnhrK041347; Thu, 2 May 2013 21:49:43 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201305022149.r42LnhrK041347@svn.freebsd.org> From: Bryan Drewery Date: Thu, 2 May 2013 21:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250195 - stable/9/etc/rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 21:49:44 -0000 Author: bdrewery (ports committer) Date: Thu May 2 21:49:43 2013 New Revision: 250195 URL: http://svnweb.freebsd.org/changeset/base/250195 Log: MFC r249489,249555 Run configtest before restarting so that the system is not left without a running sshd. Also call configtest before reload to ensure working config. Modified: stable/9/etc/rc.d/sshd Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/sshd ============================================================================== --- stable/9/etc/rc.d/sshd Thu May 2 21:09:47 2013 (r250194) +++ stable/9/etc/rc.d/sshd Thu May 2 21:49:43 2013 (r250195) @@ -14,6 +14,8 @@ rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" +reload_precmd="sshd_configtest" +restart_precmd="sshd_configtest" configtest_cmd="sshd_configtest" pidfile="/var/run/${name}.pid" extra_commands="configtest keygen reload" From owner-svn-src-all@FreeBSD.ORG Thu May 2 21:51:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9EB695A2; Thu, 2 May 2013 21:51:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F763171D; Thu, 2 May 2013 21:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42Lpvhs043435; Thu, 2 May 2013 21:51:57 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42LpvtB043434; Thu, 2 May 2013 21:51:57 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201305022151.r42LpvtB043434@svn.freebsd.org> From: Bryan Drewery Date: Thu, 2 May 2013 21:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250196 - stable/8/etc/rc.d X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 21:51:57 -0000 Author: bdrewery (ports committer) Date: Thu May 2 21:51:57 2013 New Revision: 250196 URL: http://svnweb.freebsd.org/changeset/base/250196 Log: MFC r249489,249555 Run configtest before restarting so that the system is not left without a running sshd. Also call configtest before reload to ensure working config. Modified: stable/8/etc/rc.d/sshd Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/sshd ============================================================================== --- stable/8/etc/rc.d/sshd Thu May 2 21:49:43 2013 (r250195) +++ stable/8/etc/rc.d/sshd Thu May 2 21:51:57 2013 (r250196) @@ -14,6 +14,8 @@ rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" +reload_precmd="sshd_configtest" +restart_precmd="sshd_configtest" configtest_cmd="sshd_configtest" pidfile="/var/run/${name}.pid" extra_commands="configtest keygen reload" From owner-svn-src-all@FreeBSD.ORG Fri May 3 01:16:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 74DF3EF9; Fri, 3 May 2013 01:16:19 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 67CF11F83; Fri, 3 May 2013 01:16:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r431GJai014835; Fri, 3 May 2013 01:16:19 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r431GJPi014829; Fri, 3 May 2013 01:16:19 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201305030116.r431GJPi014829@svn.freebsd.org> From: Neel Natu Date: Fri, 3 May 2013 01:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250197 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 01:16:19 -0000 Author: neel Date: Fri May 3 01:16:18 2013 New Revision: 250197 URL: http://svnweb.freebsd.org/changeset/base/250197 Log: Implement the NOTIFY_ON_EMPTY capability in the virtio-net device. If this capability is negotiated by the guest then the device will generate an interrupt when it runs out of available tx/rx descriptors. Reviewed by: grehan Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Thu May 2 21:51:57 2013 (r250196) +++ head/usr.sbin/bhyve/pci_virtio_net.c Fri May 3 01:16:18 2013 (r250197) @@ -78,7 +78,8 @@ __FBSDID("$FreeBSD$"); #define VTNET_S_HOSTCAPS \ ( 0x00000020 | /* host supplies MAC */ \ 0x00008000 | /* host can merge Rx buffers */ \ - 0x00010000 ) /* config status available */ + 0x00010000 | /* config status available */ \ + VIRTIO_F_NOTIFY_ON_EMPTY) /* * Queue definitions. @@ -157,7 +158,8 @@ struct pci_vtnet_softc { pthread_cond_t tx_cond; int tx_in_progress; }; -#define vtnet_ctx(sc) ((sc)->vsc_pi->pi_vmctx) +#define vtnet_ctx(sc) ((sc)->vsc_pi->pi_vmctx) +#define notify_on_empty(sc) ((sc)->vsc_features & VIRTIO_F_NOTIFY_ON_EMPTY) /* * Return the size of IO BAR that maps virtio header and device specific @@ -289,6 +291,18 @@ pci_vtnet_update_status(struct pci_vtnet sc->vsc_status = value; } +static void +vtnet_generate_interrupt(struct pci_vtnet_softc *sc, int qidx) +{ + + if (use_msix) { + pci_generate_msix(sc->vsc_pi, sc->vsc_msix_table_idx[qidx]); + } else { + sc->vsc_isr |= 1; + pci_generate_msi(sc->vsc_pi, 0); + } +} + /* * Called to send a buffer chain out to the tap device */ @@ -366,6 +380,10 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc * Drop the packet and try later */ (void) read(sc->vsc_tapfd, dummybuf, sizeof(dummybuf)); + + if (notify_on_empty(sc)) + vtnet_generate_interrupt(sc, VTNET_RXQ); + return; } @@ -418,15 +436,8 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc *hq->hq_used_idx = uidx; hq->hq_cur_aidx = aidx; - if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) { - if (use_msix) { - pci_generate_msix(sc->vsc_pi, - sc->vsc_msix_table_idx[VTNET_RXQ]); - } else { - sc->vsc_isr |= 1; - pci_generate_msi(sc->vsc_pi, 0); - } - } + if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) + vtnet_generate_interrupt(sc, VTNET_RXQ); } static void @@ -536,9 +547,8 @@ pci_vtnet_tx_thread(void *param) { struct pci_vtnet_softc *sc = (struct pci_vtnet_softc *) param; struct vring_hqueue *hq; - int i, ndescs, needintr,error; + int i, ndescs, error; - needintr = 0; hq = &sc->vsc_hq[VTNET_TXQ]; /* @@ -552,31 +562,14 @@ pci_vtnet_tx_thread(void *param) for (;;) { pthread_mutex_lock(&sc->tx_mtx); for (;;) { - if (sc->resetting) { + if (sc->resetting) ndescs = 0; - needintr = 0; - } else + else ndescs = hq_num_avail(hq); if (ndescs != 0) break; - - if (needintr) { - /* - * Generate an interrupt if able - */ - if ((*hq->hq_avail_flags & - VRING_AVAIL_F_NO_INTERRUPT) == 0) { - if (use_msix) { - pci_generate_msix(sc->vsc_pi, - sc->vsc_msix_table_idx[VTNET_TXQ]); - } else { - sc->vsc_isr |= 1; - pci_generate_msi(sc->vsc_pi, 0); - } - } - } - needintr = 0; + sc->tx_in_progress = 0; error = pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx); assert(error == 0); @@ -591,9 +584,16 @@ pci_vtnet_tx_thread(void *param) */ for (i = 0; i < ndescs; i++) pci_vtnet_proctx(sc, hq); - needintr = 1; + ndescs = hq_num_avail(hq); } + + /* + * Generate an interrupt if needed. + */ + if (notify_on_empty(sc) || + (*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) + vtnet_generate_interrupt(sc, VTNET_TXQ); } } Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Thu May 2 21:51:57 2013 (r250196) +++ head/usr.sbin/bhyve/virtio.h Fri May 3 01:16:18 2013 (r250197) @@ -85,6 +85,9 @@ struct virtio_used { #define VTCFG_R_CFG1 24 /* With MSI-X */ #define VTCFG_R_MSIX 20 +/* Feature flags */ +#define VIRTIO_F_NOTIFY_ON_EMPTY (1 << 24) + /* From section 2.3, "Virtqueue Configuration", of the virtio specification */ static inline u_int vring_size(u_int qsz) From owner-svn-src-all@FreeBSD.ORG Fri May 3 02:03:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6FF36427; Fri, 3 May 2013 02:03:36 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C87B81095; Fri, 3 May 2013 02:03:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4323Zr0031701; Fri, 3 May 2013 02:03:35 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4323ZHZ031700; Fri, 3 May 2013 02:03:35 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201305030203.r4323ZHZ031700@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 3 May 2013 02:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250198 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 02:03:36 -0000 Author: edwin Date: Fri May 3 02:03:35 2013 New Revision: 250198 URL: http://svnweb.freebsd.org/changeset/base/250198 Log: Op 30 April 2013 trad koninging Beatrix af en werd kroonprins Willem Alexander de nieuwe koning. Koningsdag is op 27 April. On 30 April 2013 queen Beatrix resigned and crownprince Willem Alexander became the new king. King's day is on 27 April. MFC after: 1 week Modified: head/usr.bin/calendar/calendars/calendar.dutch Modified: head/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- head/usr.bin/calendar/calendars/calendar.dutch Fri May 3 01:16:18 2013 (r250197) +++ head/usr.bin/calendar/calendars/calendar.dutch Fri May 3 02:03:35 2013 (r250198) @@ -13,7 +13,7 @@ Easter=Pasen jan/01 Nieuwjaar jan/06 Driekoningen apr/01 1 april -apr/30 Koninginnedag +apr/27 Koningsdag mei/01 Dag van de Arbeid mei/04 Dodenherdenking mei/05 Bevrijdingsdag @@ -60,13 +60,13 @@ sep/TueThird Prinsjesdag * Het koningshuis */ jan/19 Prinses Margriet (1943) -jan/31 Koningin Beatrix (1938) +jan/31 Prinses Beatrix (1938) feb/17 Prins Willem III (1817 - 1890) feb/18 Prinses Christina (1947) apr/10 Prinses Ariane (2007) apr/19 Prins Hendrik (1876 - 1934) -apr/27 Kroonprins Willem Alexander (1967) -apr/30 Koningin Juliana (1909 - 2004) +apr/27 Koning Willem Alexander (1967) +apr/30 Prinses Juliana (1909 - 2004) apr/30 Mr. Pieter van Vollenhoven (1939) mei/17 Prinses Maxima (1971) jun/26 Prinses Alexia (2005) From owner-svn-src-all@FreeBSD.ORG Fri May 3 02:03:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F1DA6428; Fri, 3 May 2013 02:03:37 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D40431096; Fri, 3 May 2013 02:03:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4323bgp031747; Fri, 3 May 2013 02:03:37 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4323bVs031736; Fri, 3 May 2013 02:03:37 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201305030203.r4323bVs031736@svn.freebsd.org> From: Peter Grehan Date: Fri, 3 May 2013 02:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250199 - in vendor/hyperv: . dist dist/sys dist/sys/dev dist/sys/dev/hyperv dist/sys/dev/hyperv/include dist/sys/dev/hyperv/netvsc dist/sys/dev/hyperv/storvsc dist/sys/dev/hyperv/utili... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 02:03:38 -0000 Author: grehan Date: Fri May 3 02:03:36 2013 New Revision: 250199 URL: http://svnweb.freebsd.org/changeset/base/250199 Log: Initial import of the Microsoft HyperV 'enlightened' drivers. From https://github.com/FreeBSDonHyper-V/VendorBranchForFreeBSDonHyper-V rev: 99eaa0ddb0485c9d76046664100f6beb1a0a0c58 Added: vendor/hyperv/ vendor/hyperv/dist/ vendor/hyperv/dist/README.md vendor/hyperv/dist/sys/ vendor/hyperv/dist/sys/dev/ vendor/hyperv/dist/sys/dev/hyperv/ vendor/hyperv/dist/sys/dev/hyperv/README vendor/hyperv/dist/sys/dev/hyperv/include/ vendor/hyperv/dist/sys/dev/hyperv/include/hyperv.h (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/netvsc/ vendor/hyperv/dist/sys/dev/hyperv/netvsc/hv_net_vsc.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/netvsc/hv_net_vsc.h (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/netvsc/hv_rndis.h (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/netvsc/hv_rndis_filter.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/netvsc/hv_rndis_filter.h (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/storvsc/ vendor/hyperv/dist/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/storvsc/hv_vstorage.h (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/utilities/ vendor/hyperv/dist/sys/dev/hyperv/utilities/hv_util.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/vmbus/ vendor/hyperv/dist/sys/dev/hyperv/vmbus/hv_channel.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/vmbus/hv_channel_mgmt.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/vmbus/hv_connection.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/vmbus/hv_hv.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/vmbus/hv_ring_buffer.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c (contents, props changed) vendor/hyperv/dist/sys/dev/hyperv/vmbus/hv_vmbus_priv.h (contents, props changed) vendor/hyperv/dist/sys/modules/ vendor/hyperv/dist/sys/modules/Makefile (contents, props changed) vendor/hyperv/dist/sys/modules/hyperv/ vendor/hyperv/dist/sys/modules/hyperv/Makefile (contents, props changed) vendor/hyperv/dist/sys/modules/hyperv/netvsc/ vendor/hyperv/dist/sys/modules/hyperv/netvsc/Makefile (contents, props changed) vendor/hyperv/dist/sys/modules/hyperv/storvsc/ vendor/hyperv/dist/sys/modules/hyperv/storvsc/Makefile (contents, props changed) vendor/hyperv/dist/sys/modules/hyperv/utilities/ vendor/hyperv/dist/sys/modules/hyperv/utilities/Makefile (contents, props changed) vendor/hyperv/dist/sys/modules/hyperv/vmbus/ vendor/hyperv/dist/sys/modules/hyperv/vmbus/Makefile (contents, props changed) Added: vendor/hyperv/dist/README.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/hyperv/dist/README.md Fri May 3 02:03:36 2013 (r250199) @@ -0,0 +1,4 @@ +HypervOnFreeBSDVendorBranch +=========================== + +Contains only the Hyper-V driver files and other files that have been touched. \ No newline at end of file Added: vendor/hyperv/dist/sys/dev/hyperv/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/hyperv/dist/sys/dev/hyperv/README Fri May 3 02:03:36 2013 (r250199) @@ -0,0 +1,34 @@ +***** Release rc2.3.0 4/27/2012 ************************************************** + +New features/limitations- + +-Added Fast IDE +-Massive code restructuring to meeting FreeBSD sytle guidelines + +***** Release rc2.2.0 1/4/2012 *************************************************** + +New features/limitations- + +-Port of LIS 2.1 with FreeBSD support code from Citrix, drivers are linked with + Kernel (future drivers will be loadable), port has not been refactored to meet + BSD coding standards + +-SCSI device driver functional, but support for scatter-gather lists is not + implemented-Fast IDE support has not been added-still using emulated IDE + support + +-Network storage device support has been added + +-While the storage and networking devices support multiple controllers, we're + waiting on a resolution from Microsoft to enable persistent and consistent + numbering between boots + +-Hyper-V bus has been ported with support code from Citrix to handle clock + synchronization between guest and host. Clock synchronization and heartbeat + logic have been moved to two, separate drivers-this separation is part + of the initial steps for refactoring and restructuring the Hyper-V bus driver from the + LIS 2.1 codebase + +Bug fixes- + +******************************************************************************* \ No newline at end of file Added: vendor/hyperv/dist/sys/dev/hyperv/include/hyperv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/hyperv/dist/sys/dev/hyperv/include/hyperv.h Fri May 3 02:03:36 2013 (r250199) @@ -0,0 +1,796 @@ +/*- + * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2012 NetApp Inc. + * Copyright (c) 2012 Citrix Inc. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * HyperV definitions for messages that are sent between instances of the + * Channel Management Library in separate partitions, or in some cases, + * back to itself. + */ + +#ifndef __HYPERV_H__ +#define __HYPERV_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +typedef uint8_t hv_bool_uint8_t; + +#define HV_S_OK 0x00000000 +#define HV_E_FAIL 0x80004005 +#define HV_ERROR_NOT_SUPPORTED 0x80070032 +#define HV_ERROR_MACHINE_LOCKED 0x800704F7 + +/* + * A revision number of vmbus that is used for ensuring both ends on a + * partition are using compatible versions. + */ + +#define HV_VMBUS_REVISION_NUMBER 13 + +/* + * Make maximum size of pipe payload of 16K + */ + +#define HV_MAX_PIPE_DATA_PAYLOAD (sizeof(BYTE) * 16384) + +/* + * Define pipe_mode values + */ + +#define HV_VMBUS_PIPE_TYPE_BYTE 0x00000000 +#define HV_VMBUS_PIPE_TYPE_MESSAGE 0x00000004 + +/* + * The size of the user defined data buffer for non-pipe offers + */ + +#define HV_MAX_USER_DEFINED_BYTES 120 + +/* + * The size of the user defined data buffer for pipe offers + */ + +#define HV_MAX_PIPE_USER_DEFINED_BYTES 116 + + +#define HV_MAX_PAGE_BUFFER_COUNT 16 +#define HV_MAX_MULTIPAGE_BUFFER_COUNT 32 + +#define HV_ALIGN_UP(value, align) \ + (((value) & (align-1)) ? \ + (((value) + (align-1)) & ~(align-1) ) : (value)) + +#define HV_ALIGN_DOWN(value, align) ( (value) & ~(align-1) ) + +#define HV_NUM_PAGES_SPANNED(addr, len) \ + ((HV_ALIGN_UP(addr+len, PAGE_SIZE) - \ + HV_ALIGN_DOWN(addr, PAGE_SIZE)) >> PAGE_SHIFT ) + +typedef struct hv_guid { + unsigned char data[16]; +} __packed hv_guid; + +/* + * At the center of the Channel Management library is + * the Channel Offer. This struct contains the + * fundamental information about an offer. + */ + +typedef struct hv_vmbus_channel_offer { + hv_guid interface_type; + hv_guid interface_instance; + uint64_t interrupt_latency_in_100ns_units; + uint32_t interface_revision; + uint32_t server_context_area_size; /* in bytes */ + uint16_t channel_flags; + uint16_t mmio_megabytes; /* in bytes * 1024 * 1024 */ + union + { + /* + * Non-pipes: The user has HV_MAX_USER_DEFINED_BYTES bytes. + */ + struct { + uint8_t user_defined[HV_MAX_USER_DEFINED_BYTES]; + } __packed standard; + + /* + * Pipes: The following structure is an integrated pipe protocol, which + * is implemented on top of standard user-defined data. pipe + * clients have HV_MAX_PIPE_USER_DEFINED_BYTES left for their + * own use. + */ + struct { + uint32_t pipe_mode; + uint8_t user_defined[HV_MAX_PIPE_USER_DEFINED_BYTES]; + } __packed pipe; + } u; + + uint32_t padding; + +} __packed hv_vmbus_channel_offer; + +typedef uint32_t hv_gpadl_handle; + +typedef struct { + uint16_t type; + uint16_t data_offset8; + uint16_t length8; + uint16_t flags; + uint64_t transaction_id; +} __packed hv_vm_packet_descriptor; + +typedef uint32_t hv_previous_packet_offset; + +typedef struct { + hv_previous_packet_offset previous_packet_start_offset; + hv_vm_packet_descriptor descriptor; +} __packed hv_vm_packet_header; + +typedef struct { + uint32_t byte_count; + uint32_t byte_offset; +} __packed hv_vm_transfer_page; + +typedef struct { + hv_vm_packet_descriptor d; + uint16_t transfer_page_set_id; + hv_bool_uint8_t sender_owns_set; + uint8_t reserved; + uint32_t range_count; + hv_vm_transfer_page ranges[1]; +} __packed hv_vm_transfer_page_packet_header; + +typedef struct { + hv_vm_packet_descriptor d; + uint32_t gpadl; + uint32_t reserved; +} __packed hv_vm_gpadl_packet_header; + +typedef struct { + hv_vm_packet_descriptor d; + uint32_t gpadl; + uint16_t transfer_page_set_id; + uint16_t reserved; +} __packed hv_vm_add_remove_transfer_page_set; + +/* + * This structure defines a range in guest + * physical space that can be made + * to look virtually contiguous. + */ + +typedef struct { + uint32_t byte_count; + uint32_t byte_offset; + uint64_t pfn_array[0]; +} __packed hv_gpa_range; + +/* + * This is the format for an Establish Gpadl packet, which contains a handle + * by which this GPADL will be known and a set of GPA ranges associated with + * it. This can be converted to a MDL by the guest OS. If there are multiple + * GPA ranges, then the resulting MDL will be "chained," representing multiple + * VA ranges. + */ + +typedef struct { + hv_vm_packet_descriptor d; + uint32_t gpadl; + uint32_t range_count; + hv_gpa_range range[1]; +} __packed hv_vm_establish_gpadl; + +/* + * This is the format for a Teardown Gpadl packet, which indicates that the + * GPADL handle in the Establish Gpadl packet will never be referenced again. + */ + +typedef struct { + hv_vm_packet_descriptor d; + uint32_t gpadl; + /* for alignment to a 8-byte boundary */ + uint32_t reserved; +} __packed hv_vm_teardown_gpadl; + +/* + * This is the format for a GPA-Direct packet, which contains a set of GPA + * ranges, in addition to commands and/or data. + */ + +typedef struct { + hv_vm_packet_descriptor d; + uint32_t reserved; + uint32_t range_count; + hv_gpa_range range[1]; +} __packed hv_vm_data_gpa_direct; + +/* + * This is the format for a Additional data Packet. + */ +typedef struct { + hv_vm_packet_descriptor d; + uint64_t total_bytes; + uint32_t byte_offset; + uint32_t byte_count; + uint8_t data[1]; +} __packed hv_vm_additional_data; + +typedef union { + hv_vm_packet_descriptor simple_header; + hv_vm_transfer_page_packet_header transfer_page_header; + hv_vm_gpadl_packet_header gpadl_header; + hv_vm_add_remove_transfer_page_set add_remove_transfer_page_header; + hv_vm_establish_gpadl establish_gpadl_header; + hv_vm_teardown_gpadl teardown_gpadl_header; + hv_vm_data_gpa_direct data_gpa_direct_header; +} __packed hv_vm_packet_largest_possible_header; + +typedef enum { + HV_VMBUS_PACKET_TYPE_INVALID = 0x0, + HV_VMBUS_PACKET_TYPES_SYNCH = 0x1, + HV_VMBUS_PACKET_TYPE_ADD_TRANSFER_PAGE_SET = 0x2, + HV_VMBUS_PACKET_TYPE_REMOVE_TRANSFER_PAGE_SET = 0x3, + HV_VMBUS_PACKET_TYPE_ESTABLISH_GPADL = 0x4, + HV_VMBUS_PACKET_TYPE_TEAR_DOWN_GPADL = 0x5, + HV_VMBUS_PACKET_TYPE_DATA_IN_BAND = 0x6, + HV_VMBUS_PACKET_TYPE_DATA_USING_TRANSFER_PAGES = 0x7, + HV_VMBUS_PACKET_TYPE_DATA_USING_GPADL = 0x8, + HV_VMBUS_PACKET_TYPE_DATA_USING_GPA_DIRECT = 0x9, + HV_VMBUS_PACKET_TYPE_CANCEL_REQUEST = 0xa, + HV_VMBUS_PACKET_TYPE_COMPLETION = 0xb, + HV_VMBUS_PACKET_TYPE_DATA_USING_ADDITIONAL_PACKETS = 0xc, + HV_VMBUS_PACKET_TYPE_ADDITIONAL_DATA = 0xd +} hv_vmbus_packet_type; + +#define HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED 1 + +/* + * Version 1 messages + */ +typedef enum { + HV_CHANNEL_MESSAGE_INVALID = 0, + HV_CHANNEL_MESSAGE_OFFER_CHANNEL = 1, + HV_CHANNEL_MESSAGE_RESCIND_CHANNEL_OFFER = 2, + HV_CHANNEL_MESSAGE_REQUEST_OFFERS = 3, + HV_CHANNEL_MESSAGE_ALL_OFFERS_DELIVERED = 4, + HV_CHANNEL_MESSAGE_OPEN_CHANNEL = 5, + HV_CHANNEL_MESSAGE_OPEN_CHANNEL_RESULT = 6, + HV_CHANNEL_MESSAGE_CLOSE_CHANNEL = 7, + HV_CHANNEL_MESSAGEL_GPADL_HEADER = 8, + HV_CHANNEL_MESSAGE_GPADL_BODY = 9, + HV_CHANNEL_MESSAGE_GPADL_CREATED = 10, + HV_CHANNEL_MESSAGE_GPADL_TEARDOWN = 11, + HV_CHANNEL_MESSAGE_GPADL_TORNDOWN = 12, + HV_CHANNEL_MESSAGE_REL_ID_RELEASED = 13, + HV_CHANNEL_MESSAGE_INITIATED_CONTACT = 14, + HV_CHANNEL_MESSAGE_VERSION_RESPONSE = 15, + HV_CHANNEL_MESSAGE_UNLOAD = 16, + +#ifdef HV_VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD + HV_CHANNEL_MESSAGE_VIEW_RANGE_ADD = 17, + HV_CHANNEL_MESSAGE_VIEW_RANGE_REMOVE = 18, +#endif + HV_CHANNEL_MESSAGE_COUNT +} hv_vmbus_channel_msg_type; + +typedef struct { + hv_vmbus_channel_msg_type message_type; + uint32_t padding; +} __packed hv_vmbus_channel_msg_header; + +/* + * Query VMBus Version parameters + */ +typedef struct { + hv_vmbus_channel_msg_header header; + uint32_t version; +} __packed hv_vmbus_channel_query_vmbus_version; + +/* + * VMBus Version Supported parameters + */ +typedef struct { + hv_vmbus_channel_msg_header header; + hv_bool_uint8_t version_supported; +} __packed hv_vmbus_channel_version_supported; + +/* + * Channel Offer parameters + */ +typedef struct { + hv_vmbus_channel_msg_header header; + hv_vmbus_channel_offer offer; + uint32_t child_rel_id; + uint8_t monitor_id; + hv_bool_uint8_t monitor_allocated; +} __packed hv_vmbus_channel_offer_channel; + +/* + * Rescind Offer parameters + */ +typedef struct +{ + hv_vmbus_channel_msg_header header; + uint32_t child_rel_id; +} __packed hv_vmbus_channel_rescind_offer; + + +/* + * Request Offer -- no parameters, SynIC message contains the partition ID + * + * Set Snoop -- no parameters, SynIC message contains the partition ID + * + * Clear Snoop -- no parameters, SynIC message contains the partition ID + * + * All Offers Delivered -- no parameters, SynIC message contains the + * partition ID + * + * Flush Client -- no parameters, SynIC message contains the partition ID + */ + + +/* + * Open Channel parameters + */ +typedef struct +{ + hv_vmbus_channel_msg_header header; + + /* + * Identifies the specific VMBus channel that is being opened. + */ + uint32_t child_rel_id; + + /* + * ID making a particular open request at a channel offer unique. + */ + uint32_t open_id; + + /* + * GPADL for the channel's ring buffer. + */ + hv_gpadl_handle ring_buffer_gpadl_handle; + + /* + * GPADL for the channel's server context save area. + */ + hv_gpadl_handle server_context_area_gpadl_handle; + + /* + * The upstream ring buffer begins at offset zero in the memory described + * by ring_buffer_gpadl_handle. The downstream ring buffer follows it at + * this offset (in pages). + */ + uint32_t downstream_ring_buffer_page_offset; + + /* + * User-specific data to be passed along to the server endpoint. + */ + uint8_t user_data[HV_MAX_USER_DEFINED_BYTES]; + +} __packed hv_vmbus_channel_open_channel; + +typedef uint32_t hv_nt_status; + +/* + * Open Channel Result parameters + */ +typedef struct +{ + hv_vmbus_channel_msg_header header; + uint32_t child_rel_id; + uint32_t open_id; + hv_nt_status status; +} __packed hv_vmbus_channel_open_result; + +/* + * Close channel parameters + */ +typedef struct +{ + hv_vmbus_channel_msg_header header; + uint32_t child_rel_id; +} __packed hv_vmbus_channel_close_channel; + +/* + * Channel Message GPADL + */ +#define HV_GPADL_TYPE_RING_BUFFER 1 +#define HV_GPADL_TYPE_SERVER_SAVE_AREA 2 +#define HV_GPADL_TYPE_TRANSACTION 8 + +/* + * The number of PFNs in a GPADL message is defined by the number of pages + * that would be spanned by byte_count and byte_offset. If the implied number + * of PFNs won't fit in this packet, there will be a follow-up packet that + * contains more + */ + +typedef struct { + hv_vmbus_channel_msg_header header; + uint32_t child_rel_id; + uint32_t gpadl; + uint16_t range_buf_len; + uint16_t range_count; + hv_gpa_range range[0]; +} __packed hv_vmbus_channel_gpadl_header; + +/* + * This is the follow-up packet that contains more PFNs + */ +typedef struct { + hv_vmbus_channel_msg_header header; + uint32_t message_number; + uint32_t gpadl; + uint64_t pfn[0]; +} __packed hv_vmbus_channel_gpadl_body; + +typedef struct { + hv_vmbus_channel_msg_header header; + uint32_t child_rel_id; + uint32_t gpadl; + uint32_t creation_status; +} __packed hv_vmbus_channel_gpadl_created; + +typedef struct { + hv_vmbus_channel_msg_header header; + uint32_t child_rel_id; + uint32_t gpadl; +} __packed hv_vmbus_channel_gpadl_teardown; + +typedef struct { + hv_vmbus_channel_msg_header header; + uint32_t gpadl; +} __packed hv_vmbus_channel_gpadl_torndown; + +typedef struct { + hv_vmbus_channel_msg_header header; + uint32_t child_rel_id; +} __packed hv_vmbus_channel_relid_released; + +typedef struct { + hv_vmbus_channel_msg_header header; + uint32_t vmbus_version_requested; + uint32_t padding2; + uint64_t interrupt_page; + uint64_t monitor_page_1; + uint64_t monitor_page_2; +} __packed hv_vmbus_channel_initiate_contact; + +typedef struct { + hv_vmbus_channel_msg_header header; + hv_bool_uint8_t version_supported; +} __packed hv_vmbus_channel_version_response; + +typedef hv_vmbus_channel_msg_header hv_vmbus_channel_unload; + +#define HW_MACADDR_LEN 6 + +/* + * Fixme: Added to quiet "typeof" errors involving hv_vmbus.h when + * the including C file was compiled with "-std=c99". + */ +#ifndef typeof +#define typeof __typeof +#endif + +#ifndef NULL +#define NULL (void *)0 +#endif + +typedef void *hv_vmbus_handle; + +#ifndef CONTAINING_RECORD +#define CONTAINING_RECORD(address, type, field) ((type *)( \ + (uint8_t *)(address) - \ + (uint8_t *)(&((type *)0)->field))) +#endif /* CONTAINING_RECORD */ + + +#define container_of(ptr, type, member) ({ \ + __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + +enum { + HV_VMBUS_IVAR_TYPE, + HV_VMBUS_IVAR_INSTANCE, + HV_VMBUS_IVAR_NODE, + HV_VMBUS_IVAR_DEVCTX +}; + +#define HV_VMBUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(vmbus, var, HV_VMBUS, ivar, type) + +HV_VMBUS_ACCESSOR(type, TYPE, const char *) +HV_VMBUS_ACCESSOR(devctx, DEVCTX, struct hv_device *) + + +/* + * Common defines for Hyper-V ICs + */ +#define HV_ICMSGTYPE_NEGOTIATE 0 +#define HV_ICMSGTYPE_HEARTBEAT 1 +#define HV_ICMSGTYPE_KVPEXCHANGE 2 +#define HV_ICMSGTYPE_SHUTDOWN 3 +#define HV_ICMSGTYPE_TIMESYNC 4 +#define HV_ICMSGTYPE_VSS 5 + +#define HV_ICMSGHDRFLAG_TRANSACTION 1 +#define HV_ICMSGHDRFLAG_REQUEST 2 +#define HV_ICMSGHDRFLAG_RESPONSE 4 + +typedef struct hv_vmbus_pipe_hdr { + uint32_t flags; + uint32_t msgsize; +} __packed hv_vmbus_pipe_hdr; + +typedef struct hv_vmbus_ic_version { + uint16_t major; + uint16_t minor; +} __packed hv_vmbus_ic_version; + +typedef struct hv_vmbus_icmsg_hdr { + hv_vmbus_ic_version icverframe; + uint16_t icmsgtype; + hv_vmbus_ic_version icvermsg; + uint16_t icmsgsize; + uint32_t status; + uint8_t ictransaction_id; + uint8_t icflags; + uint8_t reserved[2]; +} __packed hv_vmbus_icmsg_hdr; + +typedef struct hv_vmbus_icmsg_negotiate { + uint16_t icframe_vercnt; + uint16_t icmsg_vercnt; + uint32_t reserved; + hv_vmbus_ic_version icversion_data[1]; /* any size array */ +} __packed hv_vmbus_icmsg_negotiate; + +typedef struct hv_vmbus_shutdown_msg_data { + uint32_t reason_code; + uint32_t timeout_seconds; + uint32_t flags; + uint8_t display_message[2048]; +} __packed hv_vmbus_shutdown_msg_data; + +typedef struct hv_vmbus_heartbeat_msg_data { + uint64_t seq_num; + uint32_t reserved[8]; +} __packed hv_vmbus_heartbeat_msg_data; + +typedef struct { + /* + * offset in bytes from the start of ring data below + */ + volatile uint32_t write_index; + /* + * offset in bytes from the start of ring data below + */ + volatile uint32_t read_index; + /* + * NOTE: The interrupt_mask field is used only for channels, but + * vmbus connection also uses this data structure + */ + volatile uint32_t interrupt_mask; + /* pad it to PAGE_SIZE so that data starts on a page */ + uint8_t reserved[4084]; + + /* + * WARNING: Ring data starts here + ring_data_start_offset + * !!! DO NOT place any fields below this !!! + */ + uint8_t buffer[0]; /* doubles as interrupt mask */ +} __packed hv_vmbus_ring_buffer; + +typedef struct { + int length; + int offset; + uint64_t pfn; +} __packed hv_vmbus_page_buffer; + +typedef struct { + int length; + int offset; + uint64_t pfn_array[HV_MAX_MULTIPAGE_BUFFER_COUNT]; +} __packed hv_vmbus_multipage_buffer; + +typedef struct { + hv_vmbus_ring_buffer* ring_buffer; + uint32_t ring_size; /* Include the shared header */ + struct mtx ring_lock; + uint32_t ring_data_size; /* ring_size */ + uint32_t ring_data_start_offset; +} hv_vmbus_ring_buffer_info; + +typedef void (*hv_vmbus_pfn_channel_callback)(void *context); + +typedef enum { + HV_CHANNEL_OFFER_STATE, + HV_CHANNEL_OPENING_STATE, + HV_CHANNEL_OPEN_STATE, + HV_CHANNEL_CLOSING_NONDESTRUCTIVE_STATE, +} hv_vmbus_channel_state; + +typedef struct hv_vmbus_channel { + TAILQ_ENTRY(hv_vmbus_channel) list_entry; + struct hv_device* device; + hv_vmbus_channel_state state; + hv_vmbus_channel_offer_channel offer_msg; + /* + * These are based on the offer_msg.monitor_id. + * Save it here for easy access. + */ + uint8_t monitor_group; + uint8_t monitor_bit; + + uint32_t ring_buffer_gpadl_handle; + /* + * Allocated memory for ring buffer + */ + void* ring_buffer_pages; + uint32_t ring_buffer_page_count; + /* + * send to parent + */ + hv_vmbus_ring_buffer_info outbound; + /* + * receive from parent + */ + hv_vmbus_ring_buffer_info inbound; + + struct mtx inbound_lock; + hv_vmbus_handle control_work_queue; + + hv_vmbus_pfn_channel_callback on_channel_callback; + void* channel_callback_context; + +} hv_vmbus_channel; + +typedef struct hv_device { + hv_guid class_id; + hv_guid device_id; + device_t device; + hv_vmbus_channel* channel; +} hv_device; + + + +int hv_vmbus_channel_recv_packet( + hv_vmbus_channel* channel, + void* buffer, + uint32_t buffer_len, + uint32_t* buffer_actual_len, + uint64_t* request_id); + +int hv_vmbus_channel_recv_packet_raw( + hv_vmbus_channel* channel, + void* buffer, + uint32_t buffer_len, + uint32_t* buffer_actual_len, + uint64_t* request_id); + +int hv_vmbus_channel_open( + hv_vmbus_channel* channel, + uint32_t send_ring_buffer_size, + uint32_t recv_ring_buffer_size, + void* user_data, + uint32_t user_data_len, + hv_vmbus_pfn_channel_callback + pfn_on_channel_callback, + void* context); + +void hv_vmbus_channel_close(hv_vmbus_channel *channel); + +int hv_vmbus_channel_send_packet( + hv_vmbus_channel* channel, + void* buffer, + uint32_t buffer_len, + uint64_t request_id, + hv_vmbus_packet_type type, + uint32_t flags); + +int hv_vmbus_channel_send_packet_pagebuffer( + hv_vmbus_channel* channel, + hv_vmbus_page_buffer page_buffers[], + uint32_t page_count, + void* buffer, + uint32_t buffer_len, + uint64_t request_id); + +int hv_vmbus_channel_send_packet_multipagebuffer( + hv_vmbus_channel* channel, + hv_vmbus_multipage_buffer* multi_page_buffer, + void* buffer, + uint32_t buffer_len, + uint64_t request_id); + +int hv_vmbus_channel_establish_gpadl( + hv_vmbus_channel* channel, + /* must be phys and virt contiguous */ + void* contig_buffer, + /* page-size multiple */ + uint32_t size, + uint32_t* gpadl_handle); + +int hv_vmbus_channel_teardown_gpdal( + hv_vmbus_channel* channel, + uint32_t gpadl_handle); + +/* + * Work abstraction defines + */ +typedef struct hv_work_queue { + struct taskqueue* queue; + struct proc* proc; + struct sema* work_sema; +} hv_work_queue; + +typedef struct hv_work_item { + struct task work; + void (*callback)(void *); + void* context; + hv_work_queue* wq; +} hv_work_item; + +struct hv_work_queue* hv_work_queue_create(char* name); + +void hv_work_queue_close(struct hv_work_queue* wq); + +int hv_queue_work_item( + hv_work_queue* wq, + void (*callback)(void *), + void* context); +/** + * @brief Get physical address from virtual + */ +static inline unsigned long +hv_get_phys_addr(void *virt) +{ + unsigned long ret; + ret = (vtophys(virt) | ((vm_offset_t) virt & PAGE_MASK)); + return (ret); +} + +#endif /* __HYPERV_H__ */ + Added: vendor/hyperv/dist/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/hyperv/dist/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri May 3 02:03:36 2013 (r250199) @@ -0,0 +1,1141 @@ +/*- + * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2010-2012 Citrix Inc. + * Copyright (c) 2012 NetApp Inc. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * HyperV vmbus network VSC (virtual services client) module + * + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "hv_net_vsc.h" +#include "hv_rndis.h" +#include "hv_rndis_filter.h" + + +/* + * Forward declarations + */ +static void hv_nv_on_channel_callback(void *context); +static int hv_nv_init_send_buffer_with_net_vsp(struct hv_device *device); +static int hv_nv_init_rx_buffer_with_net_vsp(struct hv_device *device); +static int hv_nv_destroy_send_buffer(netvsc_dev *net_dev); +static int hv_nv_destroy_rx_buffer(netvsc_dev *net_dev); +static int hv_nv_connect_to_vsp(struct hv_device *device); +static void hv_nv_on_send_completion(struct hv_device *device, + hv_vm_packet_descriptor *pkt); +static void hv_nv_on_receive(struct hv_device *device, + hv_vm_packet_descriptor *pkt); +static void hv_nv_send_receive_completion(struct hv_device *device, + uint64_t tid); + + +/* + * + */ +static inline netvsc_dev * +hv_nv_alloc_net_device(struct hv_device *device) +{ + netvsc_dev *net_dev; + hn_softc_t *sc = device_get_softc(device->device); + + net_dev = malloc(sizeof(netvsc_dev), M_DEVBUF, M_NOWAIT | M_ZERO); + if (net_dev == NULL) { + return (NULL); + } + + net_dev->dev = device; + net_dev->destroy = FALSE; + sc->net_dev = net_dev; + + return (net_dev); +} + +/* + * + */ +static inline netvsc_dev * +hv_nv_get_outbound_net_device(struct hv_device *device) +{ + hn_softc_t *sc = device_get_softc(device->device); + netvsc_dev *net_dev = sc->net_dev;; + + if ((net_dev != NULL) && net_dev->destroy) { + return (NULL); + } + + return (net_dev); +} + +/* + * + */ +static inline netvsc_dev * +hv_nv_get_inbound_net_device(struct hv_device *device) +{ + hn_softc_t *sc = device_get_softc(device->device); + netvsc_dev *net_dev = sc->net_dev;; + + if (net_dev == NULL) { + return (net_dev); + } + /* + * When the device is being destroyed; we only + * permit incoming packets if and only if there + * are outstanding sends. + */ + if (net_dev->destroy && net_dev->num_outstanding_sends == 0) { + return (NULL); + } + + return (net_dev); +} + +/* + * Net VSC initialize receive buffer with net VSP + * + * Net VSP: Network virtual services client, also known as the + * Hyper-V extensible switch and the synthetic data path. + */ +static int +hv_nv_init_rx_buffer_with_net_vsp(struct hv_device *device) +{ + netvsc_dev *net_dev; + nvsp_msg *init_pkt; + int ret = 0; + + net_dev = hv_nv_get_outbound_net_device(device); + if (!net_dev) { + return (ENODEV); + } + + net_dev->rx_buf = contigmalloc(net_dev->rx_buf_size, M_DEVBUF, + M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); + if (net_dev->rx_buf == NULL) { + ret = ENOMEM; + goto cleanup; + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 3 02:07:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B6931709; Fri, 3 May 2013 02:07:02 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8FD8E10A8; Fri, 3 May 2013 02:07:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43272bq032539; Fri, 3 May 2013 02:07:02 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43272uP032538; Fri, 3 May 2013 02:07:02 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201305030207.r43272uP032538@svn.freebsd.org> From: Peter Grehan Date: Fri, 3 May 2013 02:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250200 - vendor/hyperv/20130502 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 02:07:02 -0000 Author: grehan Date: Fri May 3 02:07:02 2013 New Revision: 250200 URL: http://svnweb.freebsd.org/changeset/base/250200 Log: Tag hyperv 20130502 Added: vendor/hyperv/20130502/ - copied from r250199, vendor/hyperv/dist/ From owner-svn-src-all@FreeBSD.ORG Fri May 3 07:45:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 49D03BD7; Fri, 3 May 2013 07:45:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C49E1BBC; Fri, 3 May 2013 07:45:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r437j0IB051331; Fri, 3 May 2013 07:45:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r437iwXr051308; Fri, 3 May 2013 07:44:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305030744.r437iwXr051308@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 07:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250201 - in head: lib/libusb sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 07:45:00 -0000 Author: hselasky Date: Fri May 3 07:44:58 2013 New Revision: 250201 URL: http://svnweb.freebsd.org/changeset/base/250201 Log: Add new USB API to get the port path of a USB device. MFC after: 2 weeks Requested by: emaste @ Modified: head/lib/libusb/Makefile head/lib/libusb/libusb20.3 head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h head/lib/libusb/libusb20_int.h head/lib/libusb/libusb20_ugen20.c head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_ioctl.h Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/Makefile Fri May 3 07:44:58 2013 (r250201) @@ -203,6 +203,7 @@ MLINKS += libusb20.3 libusb20_dev_reset. MLINKS += libusb20.3 libusb20_dev_check_connected.3 MLINKS += libusb20.3 libusb20_dev_set_power_mode.3 MLINKS += libusb20.3 libusb20_dev_get_power_mode.3 +MLINKS += libusb20.3 libusb20_dev_get_port_path.3 MLINKS += libusb20.3 libusb20_dev_get_power_usage.3 MLINKS += libusb20.3 libusb20_dev_set_alt_index.3 MLINKS += libusb20.3 libusb20_dev_get_device_desc.3 Modified: head/lib/libusb/libusb20.3 ============================================================================== --- head/lib/libusb/libusb20.3 Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/libusb20.3 Fri May 3 07:44:58 2013 (r250201) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2013 +.Dd May 3, 2013 .Dt LIBUSB20 3 .Os .Sh NAME @@ -114,6 +114,8 @@ USB access library (libusb -lusb) .Ft const char * .Fn libusb20_dev_get_backend_name "struct libusb20_device *" .Ft int +.Fn libusb20_dev_get_port_path "struct libusb20_device *pdev" "uint8_t *buf" "uint8_t bufsize" +.Ft int .Fn libusb20_dev_get_info "struct libusb20_device *pdev" "struct usb_device_info *pinfo" .Ft int .Fn libusb20_dev_get_iface_desc "struct libusb20_device *pdev" "uint8_t iface_index" "char *buf" "uint8_t len" @@ -552,6 +554,20 @@ returns a zero terminated string describ . .Pp . +.Fn libusb20_dev_get_port_path +retrieves the list of USB port numbers which the datastream for a given USB device follows. +The first port number is the Root HUB port number. +Then children port numbers follow. +The Root HUB device itself has a port path length of zero. +Valid port numbers start at one and range until and including 255. +Typically there should not be more than 16 levels, due to electrical and protocol limitations. +This functions returns the number of actual port levels upon success +else a LIBUSB20_ERROR value is returned which are always negative. +If the actual number of port levels is greater than the maximum +specified, a LIBUSB20_ERROR value is returned. +. +.Pp +. .Fn libusb20_dev_get_info retrieves the BSD specific usb_device_info structure into the memory location given by .Fa pinfo . Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/libusb20.c Fri May 3 07:44:58 2013 (r250201) @@ -75,6 +75,7 @@ dummy_callback(struct libusb20_transfer #define dummy_check_connected (void *)dummy_int #define dummy_set_power_mode (void *)dummy_int #define dummy_get_power_mode (void *)dummy_int +#define dummy_get_port_path (void *)dummy_int #define dummy_get_power_usage (void *)dummy_int #define dummy_kernel_driver_active (void *)dummy_int #define dummy_detach_kernel_driver (void *)dummy_int @@ -722,6 +723,12 @@ libusb20_dev_get_power_mode(struct libus return (power_mode); } +int +libusb20_dev_get_port_path(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize) +{ + return (pdev->methods->get_port_path(pdev, buf, bufsize)); +} + uint16_t libusb20_dev_get_power_usage(struct libusb20_device *pdev) { Modified: head/lib/libusb/libusb20.h ============================================================================== --- head/lib/libusb/libusb20.h Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/libusb20.h Fri May 3 07:44:58 2013 (r250201) @@ -251,6 +251,7 @@ int libusb20_dev_reset(struct libusb20_d int libusb20_dev_check_connected(struct libusb20_device *pdev); int libusb20_dev_set_power_mode(struct libusb20_device *pdev, uint8_t power_mode); uint8_t libusb20_dev_get_power_mode(struct libusb20_device *pdev); +int libusb20_dev_get_port_path(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize); uint16_t libusb20_dev_get_power_usage(struct libusb20_device *pdev); int libusb20_dev_set_alt_index(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index); int libusb20_dev_get_info(struct libusb20_device *pdev, struct usb_device_info *pinfo); Modified: head/lib/libusb/libusb20_int.h ============================================================================== --- head/lib/libusb/libusb20_int.h Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/libusb20_int.h Fri May 3 07:44:58 2013 (r250201) @@ -105,6 +105,7 @@ typedef int (libusb20_process_t)(struct typedef int (libusb20_reset_device_t)(struct libusb20_device *pdev); typedef int (libusb20_set_power_mode_t)(struct libusb20_device *pdev, uint8_t power_mode); typedef int (libusb20_get_power_mode_t)(struct libusb20_device *pdev, uint8_t *power_mode); +typedef int (libusb20_get_port_path_t)(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize); typedef int (libusb20_get_power_usage_t)(struct libusb20_device *pdev, uint16_t *power_usage); typedef int (libusb20_set_alt_index_t)(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index); typedef int (libusb20_set_config_index_t)(struct libusb20_device *pdev, uint8_t index); @@ -128,6 +129,7 @@ typedef void (libusb20_tr_cancel_async_t m(n, check_connected) \ m(n, set_power_mode) \ m(n, get_power_mode) \ + m(n, get_port_path) \ m(n, get_power_usage) \ m(n, set_alt_index) \ m(n, set_config_index) \ Modified: head/lib/libusb/libusb20_ugen20.c ============================================================================== --- head/lib/libusb/libusb20_ugen20.c Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/libusb20_ugen20.c Fri May 3 07:44:58 2013 (r250201) @@ -73,6 +73,7 @@ static libusb20_reset_device_t ugen20_re static libusb20_check_connected_t ugen20_check_connected; static libusb20_set_power_mode_t ugen20_set_power_mode; static libusb20_get_power_mode_t ugen20_get_power_mode; +static libusb20_get_port_path_t ugen20_get_port_path; static libusb20_get_power_usage_t ugen20_get_power_usage; static libusb20_kernel_driver_active_t ugen20_kernel_driver_active; static libusb20_detach_kernel_driver_t ugen20_detach_kernel_driver; @@ -644,6 +645,22 @@ ugen20_get_power_mode(struct libusb20_de } static int +ugen20_get_port_path(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize) +{ + struct usb_device_port_path udpp; + + if (ioctl(pdev->file_ctrl, USB_GET_DEV_PORT_PATH, &udpp)) + return (LIBUSB20_ERROR_OTHER); + + if (udpp.udp_port_level > bufsize) + return (LIBUSB20_ERROR_OVERFLOW); + + memcpy(buf, udpp.udp_port_no, udpp.udp_port_level); + + return (udpp.udp_port_level); /* success */ +} + +static int ugen20_get_power_usage(struct libusb20_device *pdev, uint16_t *power_usage) { int temp; Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Fri May 3 02:07:02 2013 (r250200) +++ head/sys/dev/usb/usb_generic.c Fri May 3 07:44:58 2013 (r250201) @@ -1841,6 +1841,46 @@ ugen_get_power_mode(struct usb_fifo *f) } static int +ugen_get_port_path(struct usb_fifo *f, struct usb_device_port_path *dpp) +{ + struct usb_device *udev = f->udev; + struct usb_device *next; + unsigned int nlevel = 0; + + if (udev == NULL) + goto error; + + dpp->udp_bus = device_get_unit(udev->bus->bdev); + dpp->udp_index = udev->device_index; + + /* count port levels */ + next = udev; + while (next->parent_hub != NULL) { + nlevel++; + next = next->parent_hub; + } + + /* check if too many levels */ + if (nlevel > USB_DEVICE_PORT_PATH_MAX) + goto error; + + /* store port index array */ + next = udev; + while (next->parent_hub != NULL) { + nlevel--; + + dpp->udp_port_no[nlevel] = next->port_no; + dpp->udp_port_level = nlevel; + + next = next->parent_hub; + } + return (0); /* success */ + +error: + return (EINVAL); /* failure */ +} + +static int ugen_get_power_usage(struct usb_fifo *f) { struct usb_device *udev = f->udev; @@ -2041,6 +2081,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo struct usb_device_stats *stat; struct usb_fs_init *pinit; struct usb_fs_uninit *puninit; + struct usb_device_port_path *dpp; uint32_t *ptime; void *addr; int *pint; @@ -2213,6 +2254,10 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo *u.pint = ugen_get_power_mode(f); break; + case USB_GET_DEV_PORT_PATH: + error = ugen_get_port_path(f, u.dpp); + break; + case USB_GET_POWER_USAGE: *u.pint = ugen_get_power_usage(f); break; Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Fri May 3 02:07:02 2013 (r250200) +++ head/sys/dev/usb/usb_ioctl.h Fri May 3 07:44:58 2013 (r250201) @@ -131,6 +131,15 @@ struct usb_device_info { char udi_release[8]; }; +#define USB_DEVICE_PORT_PATH_MAX 32 + +struct usb_device_port_path { + uint8_t udp_bus; /* which bus we are on */ + uint8_t udp_index; /* which device index */ + uint8_t udp_port_level; /* how many levels: 0, 1, 2 ... */ + uint8_t udp_port_no[USB_DEVICE_PORT_PATH_MAX]; +}; + struct usb_device_stats { uint32_t uds_requests_ok[4]; /* Indexed by transfer type UE_XXX */ uint32_t uds_requests_fail[4]; /* Indexed by transfer type UE_XXX */ @@ -277,7 +286,8 @@ struct usb_gen_quirk { #define USB_IFACE_DRIVER_DETACH _IOW ('U', 125, int) #define USB_GET_PLUGTIME _IOR ('U', 126, uint32_t) #define USB_READ_DIR _IOW ('U', 127, struct usb_read_dir) -/* 128 - 134 unused */ +/* 128 - 133 unused */ +#define USB_GET_DEV_PORT_PATH _IOR ('U', 134, struct usb_device_port_path) #define USB_GET_POWER_USAGE _IOR ('U', 135, int) #define USB_SET_TX_FORCE_SHORT _IOW ('U', 136, int) #define USB_SET_TX_TIMEOUT _IOW ('U', 137, int) From owner-svn-src-all@FreeBSD.ORG Fri May 3 08:19:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 366627B1; Fri, 3 May 2013 08:19:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 295B81D8B; Fri, 3 May 2013 08:19:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r438JAcF063171; Fri, 3 May 2013 08:19:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r438J9rB063169; Fri, 3 May 2013 08:19:09 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305030819.r438J9rB063169@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 08:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250202 - in head/sys: conf dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 08:19:10 -0000 Author: hselasky Date: Fri May 3 08:19:09 2013 New Revision: 250202 URL: http://svnweb.freebsd.org/changeset/base/250202 Log: Allow the default USB template to be specified at compile time. Modified: head/sys/conf/options head/sys/dev/usb/usb_device.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri May 3 07:44:58 2013 (r250201) +++ head/sys/conf/options Fri May 3 08:19:09 2013 (r250202) @@ -644,6 +644,7 @@ BUS_DEBUG opt_bus.h USB_DEBUG opt_usb.h USB_HOST_ALIGN opt_usb.h USB_REQ_DEBUG opt_usb.h +USB_TEMPLATE opt_usb.h USB_VERBOSE opt_usb.h USB_EHCI_BIG_ENDIAN_DESC opt_usb.h U3G_DEBUG opt_u3g.h Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri May 3 07:44:58 2013 (r250201) +++ head/sys/dev/usb/usb_device.c Fri May 3 08:19:09 2013 (r250202) @@ -112,7 +112,11 @@ static void usb_cdev_free(struct usb_dev /* This variable is global to allow easy access to it: */ -int usb_template = 0; +#ifdef USB_TEMPLATE +int usb_template = USB_TEMPLATE; +#else +int usb_template; +#endif TUNABLE_INT("hw.usb.usb_template", &usb_template); SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW | CTLFLAG_TUN, From owner-svn-src-all@FreeBSD.ORG Fri May 3 08:20:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C852192E; Fri, 3 May 2013 08:20:10 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB6EA1D96; Fri, 3 May 2013 08:20:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r438KAlO063424; Fri, 3 May 2013 08:20:10 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r438KAaI063423; Fri, 3 May 2013 08:20:10 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201305030820.r438KAaI063423@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 3 May 2013 08:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250203 - head/lib/libpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 08:20:10 -0000 Author: uqs Date: Fri May 3 08:20:10 2013 New Revision: 250203 URL: http://svnweb.freebsd.org/changeset/base/250203 Log: Always install pmc.foo(3) manpages. There is no point in hiding, e.g. pmc.xscale(3) from a developer running on amd64, when the target arch in question will probably never have manual pages installed at all. Reviewed by: sbruno, hiren Modified: head/lib/libpmc/Makefile Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Fri May 3 08:19:09 2013 (r250202) +++ head/lib/libpmc/Makefile Fri May 3 08:20:10 2013 (r250203) @@ -23,35 +23,31 @@ MAN+= pmclog.3 MAN+= pmc.soft.3 # PMC-dependent manual pages -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" MAN+= pmc.atom.3 MAN+= pmc.core.3 MAN+= pmc.core2.3 +MAN+= pmc.corei7.3 +MAN+= pmc.corei7uc.3 MAN+= pmc.haswell.3 MAN+= pmc.haswelluc.3 MAN+= pmc.iaf.3 MAN+= pmc.ivybridge.3 MAN+= pmc.ivybridgexeon.3 -MAN+= pmc.ucf.3 MAN+= pmc.k7.3 MAN+= pmc.k8.3 +MAN+= pmc.mips24k.3 +MAN+= pmc.octeon.3 MAN+= pmc.p4.3 MAN+= pmc.p5.3 MAN+= pmc.p6.3 -MAN+= pmc.corei7.3 -MAN+= pmc.corei7uc.3 MAN+= pmc.sandybridge.3 -MAN+= pmc.sandybridgeuc.3 -MAN+= pmc.sandybridgexeon.3 +MAN+= pmc.sandybridgeuc.3 +MAN+= pmc.sandybridgexeon.3 +MAN+= pmc.tsc.3 +MAN+= pmc.ucf.3 MAN+= pmc.westmere.3 MAN+= pmc.westmereuc.3 -MAN+= pmc.tsc.3 -.elif ${MACHINE_CPUARCH} == "arm" MAN+= pmc.xscale.3 -.elif ${MACHINE_CPUARCH} == "mips" -MAN+= pmc.mips24k.3 -MAN+= pmc.octeon.3 -.endif MLINKS+= \ pmc_allocate.3 pmc_release.3 \ From owner-svn-src-all@FreeBSD.ORG Fri May 3 09:23:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 849F2C1B; Fri, 3 May 2013 09:23:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 683C7110A; Fri, 3 May 2013 09:23:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r439N8XD086665; Fri, 3 May 2013 09:23:08 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r439N7cp086657; Fri, 3 May 2013 09:23:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305030923.r439N7cp086657@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 09:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250204 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 09:23:08 -0000 Author: hselasky Date: Fri May 3 09:23:06 2013 New Revision: 250204 URL: http://svnweb.freebsd.org/changeset/base/250204 Log: Add some defines to limit USB memory usage in reduced memory systems. Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_parse.c head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_device.c Fri May 3 09:23:06 2013 (r250204) @@ -729,10 +729,6 @@ usb_config_parse(struct usb_device *udev while ((id = usb_idesc_foreach(udev->cdesc, &ips))) { - /* check for interface overflow */ - if (ips.iface_index == USB_IFACE_MAX) - break; /* crazy */ - iface = udev->ifaces + ips.iface_index; /* check for specific interface match */ @@ -779,8 +775,11 @@ usb_config_parse(struct usb_device *udev /* iterate all the endpoint descriptors */ while ((ed = usb_edesc_foreach(udev->cdesc, ed))) { - if (temp == USB_EP_MAX) - break; /* crazy */ + /* check if endpoint limit has been reached */ + if (temp >= USB_MAX_EP_UNITS) { + DPRINTF("Endpoint limit reached\n"); + break; + } ep = udev->endpoints + temp; @@ -810,6 +809,7 @@ usb_config_parse(struct usb_device *udev if (cmd == USB_CFG_ALLOC) { udev->ifaces_max = ips.iface_index; +#if (USB_HAVE_FIXED_IFACE == 0) udev->ifaces = NULL; if (udev->ifaces_max != 0) { udev->ifaces = malloc(sizeof(*iface) * udev->ifaces_max, @@ -819,6 +819,8 @@ usb_config_parse(struct usb_device *udev goto done; } } +#endif +#if (USB_HAVE_FIXED_ENDPOINT == 0) if (ep_max != 0) { udev->endpoints = malloc(sizeof(*ep) * ep_max, M_USB, M_WAITOK | M_ZERO); @@ -829,6 +831,7 @@ usb_config_parse(struct usb_device *udev } else { udev->endpoints = NULL; } +#endif USB_BUS_LOCK(udev->bus); udev->endpoints_max = ep_max; /* reset any ongoing clear-stall */ @@ -846,14 +849,14 @@ cleanup: udev->ep_curr = NULL; USB_BUS_UNLOCK(udev->bus); - /* cleanup */ - if (udev->ifaces != NULL) - free(udev->ifaces, M_USB); - if (udev->endpoints != NULL) - free(udev->endpoints, M_USB); - +#if (USB_HAVE_FIXED_IFACE == 0) + free(udev->ifaces, M_USB); udev->ifaces = NULL; +#endif +#if (USB_HAVE_FIXED_ENDPOINT == 0) + free(udev->endpoints, M_USB); udev->endpoints = NULL; +#endif udev->ifaces_max = 0; } } Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_device.h Fri May 3 09:23:06 2013 (r250204) @@ -186,9 +186,17 @@ struct usb_device { struct mtx device_mtx; struct cv ctrlreq_cv; struct cv ref_cv; +#if (USB_HAVE_FIXED_IFACE == 0) struct usb_interface *ifaces; +#else + struct usb_interface ifaces[USB_IFACE_MAX]; +#endif struct usb_endpoint ctrl_ep; /* Control Endpoint 0 */ +#if (USB_HAVE_FIXED_ENDPOINT == 0) struct usb_endpoint *endpoints; +#else + struct usb_endpoint endpoints[USB_MAX_EP_UNITS]; +#endif struct usb_power_save pwr_save;/* power save data */ struct usb_bus *bus; /* our USB BUS */ device_t parent_dev; /* parent device */ Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_freebsd.h Fri May 3 09:23:06 2013 (r250204) @@ -45,6 +45,8 @@ #define USB_HAVE_ROOT_MOUNT_HOLD 1 #define USB_HAVE_ID_SECTION 1 #define USB_HAVE_PER_BUS_PROCESS 1 +#define USB_HAVE_FIXED_ENDPOINT 0 +#define USB_HAVE_FIXED_IFACE 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid @@ -61,9 +63,11 @@ #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ #define USB_BUS_MAX 256 /* units */ #define USB_MAX_DEVICES 128 /* units */ +#define USB_CONFIG_MAX 65535 /* bytes */ #define USB_IFACE_MAX 32 /* units */ #define USB_FIFO_MAX 128 /* units */ #define USB_MAX_EP_STREAMS 8 /* units */ +#define USB_MAX_EP_UNITS 32 /* units */ #define USB_MAX_FS_ISOC_FRAMES_PER_XFER (120) /* units */ #define USB_MAX_HS_ISOC_FRAMES_PER_XFER (8*120) /* units */ Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_freebsd_loader.h Fri May 3 09:23:06 2013 (r250204) @@ -45,6 +45,8 @@ #define USB_HAVE_ROOT_MOUNT_HOLD 0 #define USB_HAVE_ID_SECTION 0 #define USB_HAVE_PER_BUS_PROCESS 0 +#define USB_HAVE_FIXED_ENDPOINT 0 +#define USB_HAVE_FIXED_IFACE 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid @@ -61,8 +63,10 @@ #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ #define USB_BUS_MAX 256 /* units */ #define USB_MAX_DEVICES 128 /* units */ +#define USB_CONFIG_MAX 65535 /* bytes */ #define USB_IFACE_MAX 32 /* units */ #define USB_FIFO_MAX 128 /* units */ +#define USB_MAX_EP_UNITS 32 /* units */ #define USB_MAX_EP_STREAMS 8 /* units */ #define USB_MAX_FS_ISOC_FRAMES_PER_XFER (120) /* units */ Modified: head/sys/dev/usb/usb_parse.c ============================================================================== --- head/sys/dev/usb/usb_parse.c Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_parse.c Fri May 3 09:23:06 2013 (r250204) @@ -49,6 +49,11 @@ #include #include #include + +#define USB_DEBUG_VAR usb_debug + +#include +#include #endif /* USB_GLOBAL_INCLUDE_FILE */ /*------------------------------------------------------------------------* @@ -142,7 +147,7 @@ usb_idesc_foreach(struct usb_config_desc } if (ps->desc == NULL) { - /* first time */ + /* first time or zero descriptors */ } else if (new_iface) { /* new interface */ ps->iface_index ++; @@ -151,6 +156,14 @@ usb_idesc_foreach(struct usb_config_desc /* new alternate interface */ ps->iface_index_alt ++; } +#if (USB_IFACE_MAX <= 0) +#error "USB_IFACE_MAX must be defined greater than zero" +#endif + /* check for too many interfaces */ + if (ps->iface_index >= USB_IFACE_MAX) { + DPRINTF("Interface limit reached\n"); + id = NULL; + } /* store and return current descriptor */ ps->desc = (struct usb_descriptor *)id; Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_request.c Fri May 3 09:23:06 2013 (r250204) @@ -1276,7 +1276,7 @@ usbd_req_get_config_desc_full(struct usb { struct usb_config_descriptor cd; struct usb_config_descriptor *cdesc; - uint16_t len; + uint32_t len; usb_error_t err; DPRINTFN(4, "index=%d\n", index); @@ -1284,19 +1284,21 @@ usbd_req_get_config_desc_full(struct usb *ppcd = NULL; err = usbd_req_get_config_desc(udev, mtx, &cd, index); - if (err) { + if (err) return (err); - } + /* get full descriptor */ len = UGETW(cd.wTotalLength); - if (len < sizeof(*cdesc)) { + if (len < (uint32_t)sizeof(*cdesc)) { /* corrupt descriptor */ return (USB_ERR_INVAL); + } else if (len > USB_CONFIG_MAX) { + DPRINTF("Configuration descriptor was truncated\n"); + len = USB_CONFIG_MAX; } cdesc = malloc(len, mtype, M_WAITOK); - if (cdesc == NULL) { + if (cdesc == NULL) return (USB_ERR_NOMEM); - } err = usbd_req_get_desc(udev, mtx, NULL, cdesc, len, len, 0, UDESC_CONFIG, index, 3); if (err) { From owner-svn-src-all@FreeBSD.ORG Fri May 3 10:13:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 409D9C1F; Fri, 3 May 2013 10:13:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33AEA15A0; Fri, 3 May 2013 10:13:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43ADUXh004612; Fri, 3 May 2013 10:13:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43ADUg4004611; Fri, 3 May 2013 10:13:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305031013.r43ADUg4004611@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 10:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250205 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 10:13:30 -0000 Author: hselasky Date: Fri May 3 10:13:29 2013 New Revision: 250205 URL: http://svnweb.freebsd.org/changeset/base/250205 Log: Always put space before the comma before ##__VA_ARGS__ due to subtle compiler differences. Modified: head/sys/dev/usb/usb_debug.h Modified: head/sys/dev/usb/usb_debug.h ============================================================================== --- head/sys/dev/usb/usb_debug.h Fri May 3 09:23:06 2013 (r250204) +++ head/sys/dev/usb/usb_debug.h Fri May 3 10:13:29 2013 (r250205) @@ -38,7 +38,7 @@ extern int usb_debug; #define DPRINTFN(n,fmt,...) do { \ if ((USB_DEBUG_VAR) >= (n)) { \ printf("%s: " fmt, \ - __FUNCTION__,## __VA_ARGS__); \ + __FUNCTION__ ,##__VA_ARGS__); \ } \ } while (0) #define DPRINTF(...) DPRINTFN(1, __VA_ARGS__) From owner-svn-src-all@FreeBSD.ORG Fri May 3 10:37:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9403AFB9; Fri, 3 May 2013 10:37:59 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85D691670; Fri, 3 May 2013 10:37:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43AbxK7012184; Fri, 3 May 2013 10:37:59 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43AbxDr012183; Fri, 3 May 2013 10:37:59 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305031037.r43AbxDr012183@svn.freebsd.org> From: Steven Hartland Date: Fri, 3 May 2013 10:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250206 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 10:37:59 -0000 Author: smh Date: Fri May 3 10:37:59 2013 New Revision: 250206 URL: http://svnweb.freebsd.org/changeset/base/250206 Log: Fix uninitialized warning in mps Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/dev/mps/mps_mapping.c Modified: head/sys/dev/mps/mps_mapping.c ============================================================================== --- head/sys/dev/mps/mps_mapping.c Fri May 3 10:13:29 2013 (r250205) +++ head/sys/dev/mps/mps_mapping.c Fri May 3 10:37:59 2013 (r250206) @@ -331,6 +331,8 @@ _mapping_get_high_missing_mt_idx(struct u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags); start_idx = 0; + start_idx_ir = 0; + end_idx_ir = 0; end_idx = sc->max_devices; if (ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_RESERVED_TARGETID_0) start_idx = 1; From owner-svn-src-all@FreeBSD.ORG Fri May 3 11:10:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC39B862; Fri, 3 May 2013 11:10:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEC77179D; Fri, 3 May 2013 11:10:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43BA6Sv023519; Fri, 3 May 2013 11:10:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43BA4Rx023357; Fri, 3 May 2013 11:10:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305031110.r43BA4Rx023357@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 11:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250207 - in head/sys/dev/usb: . template X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 11:10:07 -0000 Author: hselasky Date: Fri May 3 11:10:04 2013 New Revision: 250207 URL: http://svnweb.freebsd.org/changeset/base/250207 Log: - Add more defines to limit USB memory usage and number of allocations in reduced memory systems. - Split allocation and freeing of the configuration descriptor into a separate function, so that the configuration descriptor can be made fixed size to save memory allocations. This applies for both device and host mode. Modified: head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_dynamic.c head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_hub.h head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_request.h Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/template/usb_template.c Fri May 3 11:10:04 2013 (r250207) @@ -69,6 +69,7 @@ #include #include +#include #include #endif /* USB_GLOBAL_INCLUDE_FILE */ @@ -1267,7 +1268,7 @@ usb_temp_setup(struct usb_device *udev, goto done; } /* allocate zeroed memory */ - uts->buf = malloc(uts->size, M_USB, M_WAITOK | M_ZERO); + uts->buf = usbd_alloc_config_desc(udev, uts->size); /* * Allow malloc() to return NULL regardless of M_WAITOK flag. * This helps when porting the software to non-FreeBSD @@ -1336,12 +1337,8 @@ done: void usb_temp_unsetup(struct usb_device *udev) { - if (udev->usb_template_ptr) { - - free(udev->usb_template_ptr, M_USB); - - udev->usb_template_ptr = NULL; - } + usbd_free_config_desc(udev, udev->usb_template_ptr); + udev->usb_template_ptr = NULL; } static usb_error_t Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_device.c Fri May 3 11:10:04 2013 (r250207) @@ -493,7 +493,7 @@ usb_unconfigure(struct usb_device *udev, /* free "cdesc" after "ifaces" and "endpoints", if any */ if (udev->cdesc != NULL) { if (udev->flags.usb_mode != USB_MODE_DEVICE) - free(udev->cdesc, M_USB); + usbd_free_config_desc(udev, udev->cdesc); udev->cdesc = NULL; } /* set unconfigured state */ @@ -552,7 +552,7 @@ usbd_set_config_index(struct usb_device } else { /* normal request */ err = usbd_req_get_config_desc_full(udev, - NULL, &cdp, M_USB, index); + NULL, &cdp, index); } if (err) { goto done; Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_device.h Fri May 3 11:10:04 2013 (r250207) @@ -267,6 +267,10 @@ struct usb_device { uint32_t clear_stall_errors; /* number of clear-stall failures */ union usb_device_scratch scratch; + +#if (USB_HAVE_FIXED_CONFIG != 0) + uint32_t config_data[(USB_CONFIG_MAX + 3) / 4]; +#endif }; /* globals */ Modified: head/sys/dev/usb/usb_dynamic.c ============================================================================== --- head/sys/dev/usb/usb_dynamic.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_dynamic.c Fri May 3 11:10:04 2013 (r250207) @@ -53,6 +53,7 @@ #include #include #include +#include #endif /* USB_GLOBAL_INCLUDE_FILE */ /* function prototypes */ @@ -98,12 +99,8 @@ usb_temp_get_desc_w(struct usb_device *u static void usb_temp_unsetup_w(struct usb_device *udev) { - if (udev->usb_template_ptr) { - - free(udev->usb_template_ptr, M_USB); - - udev->usb_template_ptr = NULL; - } + usbd_free_config_desc(udev, udev->usb_template_ptr); + udev->usb_template_ptr = NULL; } void Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_freebsd.h Fri May 3 11:10:04 2013 (r250207) @@ -47,6 +47,8 @@ #define USB_HAVE_PER_BUS_PROCESS 1 #define USB_HAVE_FIXED_ENDPOINT 0 #define USB_HAVE_FIXED_IFACE 0 +#define USB_HAVE_FIXED_CONFIG 0 +#define USB_HAVE_FIXED_PORT 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid @@ -68,6 +70,7 @@ #define USB_FIFO_MAX 128 /* units */ #define USB_MAX_EP_STREAMS 8 /* units */ #define USB_MAX_EP_UNITS 32 /* units */ +#define USB_MAX_PORTS 255 /* units */ #define USB_MAX_FS_ISOC_FRAMES_PER_XFER (120) /* units */ #define USB_MAX_HS_ISOC_FRAMES_PER_XFER (8*120) /* units */ Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_freebsd_loader.h Fri May 3 11:10:04 2013 (r250207) @@ -47,6 +47,8 @@ #define USB_HAVE_PER_BUS_PROCESS 0 #define USB_HAVE_FIXED_ENDPOINT 0 #define USB_HAVE_FIXED_IFACE 0 +#define USB_HAVE_FIXED_CONFIG 0 +#define USB_HAVE_FIXED_PORT 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid @@ -68,6 +70,7 @@ #define USB_FIFO_MAX 128 /* units */ #define USB_MAX_EP_UNITS 32 /* units */ #define USB_MAX_EP_STREAMS 8 /* units */ +#define USB_MAX_PORTS 255 /* units */ #define USB_MAX_FS_ISOC_FRAMES_PER_XFER (120) /* units */ #define USB_MAX_HS_ISOC_FRAMES_PER_XFER (8*120) /* units */ Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_generic.c Fri May 3 11:10:04 2013 (r250207) @@ -688,18 +688,21 @@ ugen_get_cdesc(struct usb_fifo *f, struc if ((ugd->ugd_config_index == USB_UNCONFIG_INDEX) || (ugd->ugd_config_index == udev->curr_config_index)) { cdesc = usbd_get_config_descriptor(udev); - if (cdesc == NULL) { + if (cdesc == NULL) return (ENXIO); - } free_data = 0; } else { +#if (USB_HAVE_FIXED_CONFIG == 0) if (usbd_req_get_config_desc_full(udev, - NULL, &cdesc, M_USBDEV, - ugd->ugd_config_index)) { + NULL, &cdesc, ugd->ugd_config_index)) { return (ENXIO); } free_data = 1; +#else + /* configuration descriptor data is shared */ + return (EINVAL); +#endif } len = UGETW(cdesc->wTotalLength); @@ -713,9 +716,9 @@ ugen_get_cdesc(struct usb_fifo *f, struc error = copyout(cdesc, ugd->ugd_data, len); - if (free_data) { - free(cdesc, M_USBDEV); - } + if (free_data) + usbd_free_config_desc(udev, cdesc); + return (error); } Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_hub.c Fri May 3 11:10:04 2013 (r250207) @@ -100,6 +100,9 @@ struct uhub_current_state { struct uhub_softc { struct uhub_current_state sc_st;/* current state */ +#if (USB_HAVE_FIXED_PORT != 0) + struct usb_hub sc_hub; +#endif device_t sc_dev; /* base device */ struct mtx sc_mtx; /* our mutex */ struct usb_device *sc_udev; /* USB device */ @@ -922,8 +925,8 @@ uhub_attach(device_t dev) struct usb_hub_descriptor hubdesc20; struct usb_hub_ss_descriptor hubdesc30; uint16_t pwrdly; + uint16_t nports; uint8_t x; - uint8_t nports; uint8_t portno; uint8_t removable; uint8_t iface_index; @@ -1067,12 +1070,19 @@ uhub_attach(device_t dev) DPRINTFN(0, "portless HUB\n"); goto error; } + if (nports > USB_MAX_PORTS) { + DPRINTF("Port limit exceeded\n"); + goto error; + } +#if (USB_HAVE_FIXED_PORT == 0) hub = malloc(sizeof(hub[0]) + (sizeof(hub->ports[0]) * nports), M_USBDEV, M_WAITOK | M_ZERO); - if (hub == NULL) { + if (hub == NULL) goto error; - } +#else + hub = &sc->sc_hub; +#endif udev->hub = hub; /* initialize HUB structure */ @@ -1197,10 +1207,10 @@ uhub_attach(device_t dev) error: usbd_transfer_unsetup(sc->sc_xfer, UHUB_N_TRANSFER); - if (udev->hub) { - free(udev->hub, M_USBDEV); - udev->hub = NULL; - } +#if (USB_HAVE_FIXED_PORT == 0) + free(udev->hub, M_USBDEV); +#endif + udev->hub = NULL; mtx_destroy(&sc->sc_mtx); @@ -1240,7 +1250,9 @@ uhub_detach(device_t dev) usb_free_device(child, 0); } +#if (USB_HAVE_FIXED_PORT == 0) free(hub, M_USBDEV); +#endif sc->sc_udev->hub = NULL; mtx_destroy(&sc->sc_mtx); Modified: head/sys/dev/usb/usb_hub.h ============================================================================== --- head/sys/dev/usb/usb_hub.h Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_hub.h Fri May 3 11:10:04 2013 (r250207) @@ -48,7 +48,11 @@ struct usb_hub { uint16_t portpower; /* mA per USB port */ uint8_t isoc_last_time; uint8_t nports; +#if (USB_HAVE_FIXED_PORT == 0) struct usb_port ports[0]; +#else + struct usb_port ports[USB_MAX_PORTS]; +#endif }; /* function prototypes */ Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_request.c Fri May 3 11:10:04 2013 (r250207) @@ -1260,10 +1260,49 @@ done: } /*------------------------------------------------------------------------* + * usbd_alloc_config_desc + * + * This function is used to allocate a zeroed configuration + * descriptor. + * + * Returns: + * NULL: Failure + * Else: Success + *------------------------------------------------------------------------*/ +void * +usbd_alloc_config_desc(struct usb_device *udev, uint32_t size) +{ + if (size > USB_CONFIG_MAX) { + DPRINTF("Configuration descriptor too big\n"); + return (NULL); + } +#if (USB_HAVE_FIXED_CONFIG == 0) + return (malloc(size, M_USBDEV, M_ZERO | M_WAITOK)); +#else + memset(udev->config_data, 0, sizeof(udev->config_data)); + return (udev->config_data); +#endif +} + +/*------------------------------------------------------------------------* + * usbd_alloc_config_desc + * + * This function is used to free a configuration descriptor. + *------------------------------------------------------------------------*/ +void +usbd_free_config_desc(struct usb_device *udev, void *ptr) +{ +#if (USB_HAVE_FIXED_CONFIG == 0) + free(ptr, M_USBDEV); +#endif +} + +/*------------------------------------------------------------------------* * usbd_req_get_config_desc_full * * This function gets the complete USB configuration descriptor and - * ensures that "wTotalLength" is correct. + * ensures that "wTotalLength" is correct. The returned configuration + * descriptor is freed by calling "usbd_free_config_desc()". * * Returns: * 0: Success @@ -1271,8 +1310,7 @@ done: *------------------------------------------------------------------------*/ usb_error_t usbd_req_get_config_desc_full(struct usb_device *udev, struct mtx *mtx, - struct usb_config_descriptor **ppcd, struct malloc_type *mtype, - uint8_t index) + struct usb_config_descriptor **ppcd, uint8_t index) { struct usb_config_descriptor cd; struct usb_config_descriptor *cdesc; @@ -1296,13 +1334,13 @@ usbd_req_get_config_desc_full(struct usb DPRINTF("Configuration descriptor was truncated\n"); len = USB_CONFIG_MAX; } - cdesc = malloc(len, mtype, M_WAITOK); + cdesc = usbd_alloc_config_desc(udev, len); if (cdesc == NULL) return (USB_ERR_NOMEM); err = usbd_req_get_desc(udev, mtx, NULL, cdesc, len, len, 0, UDESC_CONFIG, index, 3); if (err) { - free(cdesc, mtype); + usbd_free_config_desc(udev, cdesc); return (err); } /* make sure that the device is not fooling us: */ Modified: head/sys/dev/usb/usb_request.h ============================================================================== --- head/sys/dev/usb/usb_request.h Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_request.h Fri May 3 11:10:04 2013 (r250207) @@ -44,7 +44,7 @@ usb_error_t usbd_req_get_config_desc(str struct usb_config_descriptor *d, uint8_t conf_index); usb_error_t usbd_req_get_config_desc_full(struct usb_device *udev, struct mtx *mtx, struct usb_config_descriptor **ppcd, - struct malloc_type *mtype, uint8_t conf_index); + uint8_t conf_index); usb_error_t usbd_req_get_desc(struct usb_device *udev, struct mtx *mtx, uint16_t *actlen, void *desc, uint16_t min_len, uint16_t max_len, uint16_t id, uint8_t type, @@ -94,4 +94,7 @@ usb_error_t usbd_req_set_port_link_state usb_error_t usbd_req_set_lpm_info(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t besl, uint8_t addr, uint8_t rwe); +void * usbd_alloc_config_desc(struct usb_device *, uint32_t); +void usbd_free_config_desc(struct usb_device *, void *); + #endif /* _USB_REQUEST_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri May 3 11:53:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 182CE35A; Fri, 3 May 2013 11:53:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EED7F1B76; Fri, 3 May 2013 11:53:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43Br66B039156; Fri, 3 May 2013 11:53:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43Br6ET039155; Fri, 3 May 2013 11:53:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305031153.r43Br6ET039155@svn.freebsd.org> From: Alexander Motin Date: Fri, 3 May 2013 11:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250208 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 11:53:07 -0000 Author: mav Date: Fri May 3 11:53:06 2013 New Revision: 250208 URL: http://svnweb.freebsd.org/changeset/base/250208 Log: Tune support for removable media in da driver: - remove DA_FLAG_SAW_MEDIA flag, almost opposite to DA_FLAG_PACK_INVALID, using the last instead. - allow opening device with no media present, reporting zero media size and non-zero sector size, as geom/notes suggests. That allow to read device attributes and potentially do other things, not related to media. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri May 3 11:10:04 2013 (r250207) +++ head/sys/cam/scsi/scsi_da.c Fri May 3 11:53:06 2013 (r250208) @@ -82,7 +82,6 @@ typedef enum { DA_FLAG_NEW_PACK = 0x002, DA_FLAG_PACK_LOCKED = 0x004, DA_FLAG_PACK_REMOVABLE = 0x008, - DA_FLAG_SAW_MEDIA = 0x010, DA_FLAG_NEED_OTAG = 0x020, DA_FLAG_WENT_IDLE = 0x040, DA_FLAG_RETRY_UA = 0x080, @@ -1026,9 +1025,6 @@ daopen(struct disk *dp) ("daopen\n")); softc = (struct da_softc *)periph->softc; - softc->flags |= DA_FLAG_OPEN; - softc->flags &= ~DA_FLAG_PACK_INVALID; - dareprobe(periph); /* Wait for the disk size update. */ @@ -1037,25 +1033,23 @@ daopen(struct disk *dp) if (error != 0) xpt_print(periph->path, "unable to retrieve capacity data"); - if (periph->flags & CAM_PERIPH_INVALID || - softc->disk->d_sectorsize == 0 || - softc->disk->d_mediasize == 0) + if (periph->flags & CAM_PERIPH_INVALID) error = ENXIO; if (error == 0 && (softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 && (softc->quirks & DA_Q_NO_PREVENT) == 0) daprevent(periph, PR_PREVENT); - if (error == 0) - softc->flags |= DA_FLAG_SAW_MEDIA; + if (error == 0) { + softc->flags &= ~DA_FLAG_PACK_INVALID; + softc->flags |= DA_FLAG_OPEN; + } cam_periph_unhold(periph); cam_periph_unlock(periph); - if (error != 0) { - softc->flags &= ~DA_FLAG_OPEN; + if (error != 0) cam_periph_release(periph); - } return (error); } @@ -2818,9 +2812,10 @@ dadone(struct cam_periph *periph, union * here. */ if (block_size == 0 && maxsector == 0) { - snprintf(announce_buf, sizeof(announce_buf), - "0MB (no media?)"); - } else if (block_size >= MAXPHYS || block_size == 0) { + block_size = 512; + maxsector = -1; + } + if (block_size >= MAXPHYS || block_size == 0) { xpt_print(periph->path, "unsupportable block size %ju\n", (uintmax_t) block_size); @@ -2920,6 +2915,7 @@ dadone(struct cam_periph *periph, union const char *sense_key_desc; const char *asc_desc; + dasetgeom(periph, 512, -1, NULL, 0); scsi_sense_desc(sense_key, asc, ascq, &cgd.inq_data, &sense_key_desc, @@ -3297,8 +3293,8 @@ daerror(union ccb *ccb, u_int32_t cam_fl asc == 0x28 && ascq == 0x00) disk_media_changed(softc->disk, M_NOWAIT); else if (sense_key == SSD_KEY_NOT_READY && - asc == 0x3a && (softc->flags & DA_FLAG_SAW_MEDIA)) { - softc->flags &= ~DA_FLAG_SAW_MEDIA; + asc == 0x3a && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { + softc->flags |= DA_FLAG_PACK_INVALID; disk_media_gone(softc->disk, M_NOWAIT); } } From owner-svn-src-all@FreeBSD.ORG Fri May 3 12:42:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 82FC41CF; Fri, 3 May 2013 12:42:44 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 746A41E6A; Fri, 3 May 2013 12:42:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43CgieC056959; Fri, 3 May 2013 12:42:44 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43Cgiak056958; Fri, 3 May 2013 12:42:44 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305031242.r43Cgiak056958@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 3 May 2013 12:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250209 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 12:42:44 -0000 Author: pluknet Date: Fri May 3 12:42:43 2013 New Revision: 250209 URL: http://svnweb.freebsd.org/changeset/base/250209 Log: Remove the STANDARDS section. querylocale is not part of IEEE Std 1003.1-2008. MFC after: 3 days Modified: head/lib/libc/locale/querylocale.3 Modified: head/lib/libc/locale/querylocale.3 ============================================================================== --- head/lib/libc/locale/querylocale.3 Fri May 3 11:53:06 2013 (r250208) +++ head/lib/libc/locale/querylocale.3 Fri May 3 12:42:43 2013 (r250209) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17 2011 +.Dd May 3, 2013 .Dt QUERYLOCALE 3 .Os .Sh NAME @@ -52,6 +52,3 @@ If more than one bit in the mask is set, .Xr newlocale 3 , .Xr uselocale 3 , .Xr xlocale 3 -.Sh STANDARDS -This function, conforms to -.St -p1003.1-2008 From owner-svn-src-all@FreeBSD.ORG Fri May 3 12:45:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7689937E; Fri, 3 May 2013 12:45:46 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 68E661E90; Fri, 3 May 2013 12:45:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43CjkoE057584; Fri, 3 May 2013 12:45:46 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43Cjj9N057581; Fri, 3 May 2013 12:45:45 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305031245.r43Cjj9N057581@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 3 May 2013 12:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250210 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 12:45:46 -0000 Author: pluknet Date: Fri May 3 12:45:45 2013 New Revision: 250210 URL: http://svnweb.freebsd.org/changeset/base/250210 Log: Remove an extra comma. Modified: head/lib/libc/locale/duplocale.3 head/lib/libc/locale/freelocale.3 head/lib/libc/locale/newlocale.3 Modified: head/lib/libc/locale/duplocale.3 ============================================================================== --- head/lib/libc/locale/duplocale.3 Fri May 3 12:42:43 2013 (r250209) +++ head/lib/libc/locale/duplocale.3 Fri May 3 12:45:45 2013 (r250210) @@ -66,7 +66,7 @@ The locale returned by this call must be .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function, conforms to +This function conforms to .St -p1003.1-2008 .Sh BUGS Ideally, Modified: head/lib/libc/locale/freelocale.3 ============================================================================== --- head/lib/libc/locale/freelocale.3 Fri May 3 12:42:43 2013 (r250209) +++ head/lib/libc/locale/freelocale.3 Fri May 3 12:45:45 2013 (r250210) @@ -57,5 +57,5 @@ Returns 0 on success or -1 on error. .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function, conforms to +This function conforms to .St -p1003.1-2008 . Modified: head/lib/libc/locale/newlocale.3 ============================================================================== --- head/lib/libc/locale/newlocale.3 Fri May 3 12:42:43 2013 (r250209) +++ head/lib/libc/locale/newlocale.3 Fri May 3 12:45:45 2013 (r250210) @@ -108,5 +108,5 @@ You must free the returned locale with .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function, conforms to +This function conforms to .St -p1003.1-2008 From owner-svn-src-all@FreeBSD.ORG Fri May 3 13:27:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0E6E6DD7; Fri, 3 May 2013 13:27:14 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 004F81090; Fri, 3 May 2013 13:27:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43DRDT6072205; Fri, 3 May 2013 13:27:13 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43DRDAr072202; Fri, 3 May 2013 13:27:13 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305031327.r43DRDAr072202@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 3 May 2013 13:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250211 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 13:27:14 -0000 Author: pluknet Date: Fri May 3 13:27:13 2013 New Revision: 250211 URL: http://svnweb.freebsd.org/changeset/base/250211 Log: Also, add a missing period. Modified: head/lib/libc/locale/duplocale.3 head/lib/libc/locale/newlocale.3 head/lib/libc/locale/uselocale.3 Modified: head/lib/libc/locale/duplocale.3 ============================================================================== --- head/lib/libc/locale/duplocale.3 Fri May 3 12:45:45 2013 (r250210) +++ head/lib/libc/locale/duplocale.3 Fri May 3 13:27:13 2013 (r250211) @@ -67,7 +67,7 @@ The locale returned by this call must be .Xr xlocale 3 .Sh STANDARDS This function conforms to -.St -p1003.1-2008 +.St -p1003.1-2008 . .Sh BUGS Ideally, .Xr uselocale 3 Modified: head/lib/libc/locale/newlocale.3 ============================================================================== --- head/lib/libc/locale/newlocale.3 Fri May 3 12:45:45 2013 (r250210) +++ head/lib/libc/locale/newlocale.3 Fri May 3 13:27:13 2013 (r250211) @@ -109,4 +109,4 @@ You must free the returned locale with .Xr xlocale 3 .Sh STANDARDS This function conforms to -.St -p1003.1-2008 +.St -p1003.1-2008 . Modified: head/lib/libc/locale/uselocale.3 ============================================================================== --- head/lib/libc/locale/uselocale.3 Fri May 3 12:45:45 2013 (r250210) +++ head/lib/libc/locale/uselocale.3 Fri May 3 13:27:13 2013 (r250211) @@ -57,4 +57,4 @@ or LC_GLOBAL_LOCALE if this thread has n .Xr xlocale 3 .Sh STANDARDS This function conforms to -.St -p1003.1-2008 +.St -p1003.1-2008 . From owner-svn-src-all@FreeBSD.ORG Fri May 3 13:33:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 24868130; Fri, 3 May 2013 13:33:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1760110DB; Fri, 3 May 2013 13:33:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43DXarv075099; Fri, 3 May 2013 13:33:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43DXaX7075098; Fri, 3 May 2013 13:33:36 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305031333.r43DXaX7075098@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 13:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250212 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 13:33:37 -0000 Author: hselasky Date: Fri May 3 13:33:36 2013 New Revision: 250212 URL: http://svnweb.freebsd.org/changeset/base/250212 Log: Fix compile warning. Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri May 3 13:27:13 2013 (r250211) +++ head/sys/dev/usb/usb_device.c Fri May 3 13:33:36 2013 (r250212) @@ -838,8 +838,9 @@ usb_config_parse(struct usb_device *udev udev->ep_curr = NULL; USB_BUS_UNLOCK(udev->bus); } - +#if (USB_HAVE_FIXED_IFACE == 0) || (USB_HAVE_FIXED_ENDPOINT == 0) done: +#endif if (err) { if (cmd == USB_CFG_ALLOC) { cleanup: From owner-svn-src-all@FreeBSD.ORG Fri May 3 14:59:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3CAC32DD; Fri, 3 May 2013 14:59:36 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C335162E; Fri, 3 May 2013 14:59:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43Exa0a004750; Fri, 3 May 2013 14:59:36 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43ExWeK004724; Fri, 3 May 2013 14:59:32 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305031459.r43ExWeK004724@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 3 May 2013 14:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250213 - stable/9/lib/libc/locale X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 14:59:36 -0000 Author: pluknet Date: Fri May 3 14:59:32 2013 New Revision: 250213 URL: http://svnweb.freebsd.org/changeset/base/250213 Log: MFC r233473,233512,233518,233992,233994,238808,238920,250209-250211. libc/locale: sync mdoc changes with head. r233473: mdoc: document title should be all caps. r233512: mdoc: remove empty lines. r233518: mdoc: remove unknown macro. r233992: mdoc: fix column names, indentation, column separation within each row, and quotation. Also make sure we have the same amount of columns in each row as the number of columns we specify in the head arguments. r233994: mdoc: fix function type. r238808: Start manpage with Dd macro and also remove a trailing whitespace while here. r238920: Remove trailing whitespace. r250209: querylocale(3): remove the STANDARDS section. r250210,r250211: Remove an extra comma, add a missing period. Modified: stable/9/lib/libc/locale/duplocale.3 stable/9/lib/libc/locale/freelocale.3 stable/9/lib/libc/locale/isalnum.3 stable/9/lib/libc/locale/isalpha.3 stable/9/lib/libc/locale/iscntrl.3 stable/9/lib/libc/locale/isdigit.3 stable/9/lib/libc/locale/isgraph.3 stable/9/lib/libc/locale/islower.3 stable/9/lib/libc/locale/isprint.3 stable/9/lib/libc/locale/ispunct.3 stable/9/lib/libc/locale/isspace.3 stable/9/lib/libc/locale/isupper.3 stable/9/lib/libc/locale/iswalnum_l.3 stable/9/lib/libc/locale/isxdigit.3 stable/9/lib/libc/locale/newlocale.3 stable/9/lib/libc/locale/querylocale.3 stable/9/lib/libc/locale/uselocale.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/locale/duplocale.3 ============================================================================== --- stable/9/lib/libc/locale/duplocale.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/duplocale.3 Fri May 3 14:59:32 2013 (r250213) @@ -56,7 +56,6 @@ associated with the current thread by .Xr uselocale 3 . These calls are therefore only thread safe on threads with a unique per-thread locale. -.Pt The locale returned by this call must be freed with .Xr freelocale 3 . .Sh BUGS @@ -76,5 +75,5 @@ for compatibility with Darwin. .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function, conforms to -.St -p1003.1-2008 +This function conforms to +.St -p1003.1-2008 . Modified: stable/9/lib/libc/locale/freelocale.3 ============================================================================== --- stable/9/lib/libc/locale/freelocale.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/freelocale.3 Fri May 3 14:59:32 2013 (r250213) @@ -57,5 +57,5 @@ Returns 0 on success or -1 on error. .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function, conforms to +This function conforms to .St -p1003.1-2008 . Modified: stable/9/lib/libc/locale/isalnum.3 ============================================================================== --- stable/9/lib/libc/locale/isalnum.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/isalnum.3 Fri May 3 14:59:32 2013 (r250213) @@ -62,19 +62,19 @@ or the value of In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ -.It "\&060\ ``0'' \t061\ ``1'' \t062\ ``2'' \t063\ ``3'' \t064\ ``4''" -.It "\&065\ ``5'' \t066\ ``6'' \t067\ ``7'' \t070\ ``8'' \t071\ ``9''" -.It "\&101\ ``A'' \t102\ ``B'' \t103\ ``C'' \t104\ ``D'' \t105\ ``E''" -.It "\&106\ ``F'' \t107\ ``G'' \t110\ ``H'' \t111\ ``I'' \t112\ ``J''" -.It "\&113\ ``K'' \t114\ ``L'' \t115\ ``M'' \t116\ ``N'' \t117\ ``O''" -.It "\&120\ ``P'' \t121\ ``Q'' \t122\ ``R'' \t123\ ``S'' \t124\ ``T''" -.It "\&125\ ``U'' \t126\ ``V'' \t127\ ``W'' \t130\ ``X'' \t131\ ``Y''" -.It "\&132\ ``Z'' \t141\ ``a'' \t142\ ``b'' \t143\ ``c'' \t144\ ``d''" -.It "\&145\ ``e'' \t146\ ``f'' \t147\ ``g'' \t150\ ``h'' \t151\ ``i''" -.It "\&152\ ``j'' \t153\ ``k'' \t154\ ``l'' \t155\ ``m'' \t156\ ``n''" -.It "\&157\ ``o'' \t160\ ``p'' \t161\ ``q'' \t162\ ``r'' \t163\ ``s''" -.It "\&164\ ``t'' \t165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x''" -.It "\&171\ ``y'' \t172\ ``z''" +.It "\&060\ ``0''" Ta "061\ ``1''" Ta "062\ ``2''" Ta "063\ ``3''" Ta "064\ ``4''" +.It "\&065\ ``5''" Ta "066\ ``6''" Ta "067\ ``7''" Ta "070\ ``8''" Ta "071\ ``9''" +.It "\&101\ ``A''" Ta "102\ ``B''" Ta "103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" +.It "\&106\ ``F''" Ta "107\ ``G''" Ta "110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" +.It "\&113\ ``K''" Ta "114\ ``L''" Ta "115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" +.It "\&120\ ``P''" Ta "121\ ``Q''" Ta "122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" +.It "\&125\ ``U''" Ta "126\ ``V''" Ta "127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" +.It "\&132\ ``Z''" Ta "141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" +.It "\&145\ ``e''" Ta "146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" +.It "\&152\ ``j''" Ta "153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" +.It "\&157\ ``o''" Ta "160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" +.It "\&164\ ``t''" Ta "165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" +.It "\&171\ ``y''" Ta "172\ ``z''" Ta \& Ta \& Ta \& .El .Pp The Modified: stable/9/lib/libc/locale/isalpha.3 ============================================================================== --- stable/9/lib/libc/locale/isalpha.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/isalpha.3 Fri May 3 14:59:32 2013 (r250213) @@ -62,18 +62,19 @@ or the value of In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ -.It "\&101\ ``A'' \t102\ ``B'' \t103\ ``C'' \t104\ ``D'' \t105\ ``E''" -.It "\&106\ ``F'' \t107\ ``G'' \t110\ ``H'' \t111\ ``I'' \t112\ ``J''" -.It "\&113\ ``K'' \t114\ ``L'' \t115\ ``M'' \t116\ ``N'' \t117\ ``O''" -.It "\&120\ ``P'' \t121\ ``Q'' \t122\ ``R'' \t123\ ``S'' \t124\ ``T''" -.It "\&125\ ``U'' \t126\ ``V'' \t127\ ``W'' \t130\ ``X'' \t131\ ``Y''" -.It "\&132\ ``Z'' \t141\ ``a'' \t142\ ``b'' \t143\ ``c'' \t144\ ``d''" -.It "\&145\ ``e'' \t146\ ``f'' \t147\ ``g'' \t150\ ``h'' \t151\ ``i''" -.It "\&152\ ``j'' \t153\ ``k'' \t154\ ``l'' \t155\ ``m'' \t156\ ``n''" -.It "\&157\ ``o'' \t160\ ``p'' \t161\ ``q'' \t162\ ``r'' \t163\ ``s''" -.It "\&164\ ``t'' \t165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x''" -.It "\&171\ ``y'' \t172\ ``z''" +.It "\&101\ ``A''" Ta "102\ ``B''" Ta "103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" +.It "\&106\ ``F''" Ta "107\ ``G''" Ta "110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" +.It "\&113\ ``K''" Ta "114\ ``L''" Ta "115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" +.It "\&120\ ``P''" Ta "121\ ``Q''" Ta "122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" +.It "\&125\ ``U''" Ta "126\ ``V''" Ta "127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" +.It "\&132\ ``Z''" Ta "141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" +.It "\&145\ ``e''" Ta "146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" +.It "\&152\ ``j''" Ta "153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" +.It "\&157\ ``o''" Ta "160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" +.It "\&164\ ``t''" Ta "165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" +.It "\&171\ ``y''" Ta "172\ ``z''" Ta \& Ta \& Ta \& .El +.Pp The .Fn isalpha_l function takes an explicit locale argument, whereas the @@ -110,4 +111,3 @@ The .Fn isalpha_l function conforms to .St -p1003.1-2008 . - Modified: stable/9/lib/libc/locale/iscntrl.3 ============================================================================== --- stable/9/lib/libc/locale/iscntrl.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/iscntrl.3 Fri May 3 14:59:32 2013 (r250213) @@ -59,13 +59,13 @@ In the ASCII character set, this include (with their numeric values shown in octal): .Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ -.It "\&000\ NUL \t001\ SOH \t002\ STX \t003\ ETX \t004\ EOT" -.It "\&005\ ENQ \t006\ ACK \t007\ BEL \t010\ BS \t011\ HT" -.It "\&012\ NL \t013\ VT \t014\ NP \t015\ CR \t016\ SO" -.It "\&017\ SI \t020\ DLE \t021\ DC1 \t022\ DC2 \t023\ DC3" -.It "\&024\ DC4 \t025\ NAK \t026\ SYN \t027\ ETB \t030\ CAN" -.It "\&031\ EM \t032\ SUB \t033\ ESC \t034\ FS \t035\ GS" -.It "\&036\ RS \t037\ US \t177\ DEL" +.It "\&000\ NUL" Ta "001\ SOH" Ta "002\ STX" Ta "003\ ETX" Ta "004\ EOT" +.It "\&005\ ENQ" Ta "006\ ACK" Ta "007\ BEL" Ta "010\ BS" Ta "011\ HT" +.It "\&012\ NL" Ta "013\ VT" Ta "014\ NP" Ta "015\ CR" Ta "016\ SO" +.It "\&017\ SI" Ta "020\ DLE" Ta "021\ DC1" Ta "022\ DC2" Ta "023\ DC3" +.It "\&024\ DC4" Ta "025\ NAK" Ta "026\ SYN" Ta "027\ ETB" Ta "030\ CAN" +.It "\&031\ EM" Ta "032\ SUB" Ta "033\ ESC" Ta "034\ FS" Ta "035\ GS" +.It "\&036\ RS" Ta "037\ US" Ta "177\ DEL" Ta \& Ta \& .El .Pp The Modified: stable/9/lib/libc/locale/isdigit.3 ============================================================================== --- stable/9/lib/libc/locale/isdigit.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/isdigit.3 Fri May 3 14:59:32 2013 (r250213) @@ -57,8 +57,8 @@ function tests for a decimal digit chara Regardless of locale, this includes the following characters only: .Pp .Bl -column \&``0''______ \&``0''______ \&``0''______ \&``0''______ \&``0''______ -.It "\&``0''\t``1''\t``2''\t``3''\t``4''" -.It "\&``5''\t``6''\t``7''\t``8''\t``9''" +.It "\&``0''" Ta "``1''" Ta "``2''" Ta "``3''" Ta "``4''" +.It "\&``5''" Ta "``6''" Ta "``7''" Ta "``8''" Ta "``9''" .El .Pp The Modified: stable/9/lib/libc/locale/isgraph.3 ============================================================================== --- stable/9/lib/libc/locale/isgraph.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/isgraph.3 Fri May 3 14:59:32 2013 (r250213) @@ -62,25 +62,25 @@ In the ASCII character set, this include (with their numeric values shown in octal): .Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ -.It "\&041\ ``!'' \t042\ ``""'' \t043\ ``#'' \t044\ ``$'' \t045\ ``%''" -.It "\&046\ ``&'' \t047\ ``''' \t050\ ``('' \t051\ ``)'' \t052\ ``*''" -.It "\&053\ ``+'' \t054\ ``,'' \t055\ ``-'' \t056\ ``.'' \t057\ ``/''" -.It "\&060\ ``0'' \t061\ ``1'' \t062\ ``2'' \t063\ ``3'' \t064\ ``4''" -.It "\&065\ ``5'' \t066\ ``6'' \t067\ ``7'' \t070\ ``8'' \t071\ ``9''" -.It "\&072\ ``:'' \t073\ ``;'' \t074\ ``<'' \t075\ ``='' \t076\ ``>''" -.It "\&077\ ``?'' \t100\ ``@'' \t101\ ``A'' \t102\ ``B'' \t103\ ``C''" -.It "\&104\ ``D'' \t105\ ``E'' \t106\ ``F'' \t107\ ``G'' \t110\ ``H''" -.It "\&111\ ``I'' \t112\ ``J'' \t113\ ``K'' \t114\ ``L'' \t115\ ``M''" -.It "\&116\ ``N'' \t117\ ``O'' \t120\ ``P'' \t121\ ``Q'' \t122\ ``R''" -.It "\&123\ ``S'' \t124\ ``T'' \t125\ ``U'' \t126\ ``V'' \t127\ ``W''" -.It "\&130\ ``X'' \t131\ ``Y'' \t132\ ``Z'' \t133\ ``['' \t134\ ``\e\|''" -.It "\&135\ ``]'' \t136\ ``^'' \t137\ ``_'' \t140\ ```'' \t141\ ``a''" -.It "\&142\ ``b'' \t143\ ``c'' \t144\ ``d'' \t145\ ``e'' \t146\ ``f''" -.It "\&147\ ``g'' \t150\ ``h'' \t151\ ``i'' \t152\ ``j'' \t153\ ``k''" -.It "\&154\ ``l'' \t155\ ``m'' \t156\ ``n'' \t157\ ``o'' \t160\ ``p''" -.It "\&161\ ``q'' \t162\ ``r'' \t163\ ``s'' \t164\ ``t'' \t165\ ``u''" -.It "\&166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y'' \t172\ ``z''" -.It "\&173\ ``{'' \t174\ ``|'' \t175\ ``}'' \t176\ ``~''" +.It "\&041\ ``!''" Ta "042\ ``""''" Ta "043\ ``#''" Ta "044\ ``$''" Ta "045\ ``%''" +.It "\&046\ ``&''" Ta "047\ ``'''" Ta "050\ ``(''" Ta "051\ ``)''" Ta "052\ ``*''" +.It "\&053\ ``+''" Ta "054\ ``,''" Ta "055\ ``-''" Ta "056\ ``.''" Ta "057\ ``/''" +.It "\&060\ ``0''" Ta "061\ ``1''" Ta "062\ ``2''" Ta "063\ ``3''" Ta "064\ ``4''" +.It "\&065\ ``5''" Ta "066\ ``6''" Ta "067\ ``7''" Ta "070\ ``8''" Ta "071\ ``9''" +.It "\&072\ ``:''" Ta "073\ ``;''" Ta "074\ ``<''" Ta "075\ ``=''" Ta "076\ ``>''" +.It "\&077\ ``?''" Ta "100\ ``@''" Ta "101\ ``A''" Ta "102\ ``B''" Ta "103\ ``C''" +.It "\&104\ ``D''" Ta "105\ ``E''" Ta "106\ ``F''" Ta "107\ ``G''" Ta "110\ ``H''" +.It "\&111\ ``I''" Ta "112\ ``J''" Ta "113\ ``K''" Ta "114\ ``L''" Ta "115\ ``M''" +.It "\&116\ ``N''" Ta "117\ ``O''" Ta "120\ ``P''" Ta "121\ ``Q''" Ta "122\ ``R''" +.It "\&123\ ``S''" Ta "124\ ``T''" Ta "125\ ``U''" Ta "126\ ``V''" Ta "127\ ``W''" +.It "\&130\ ``X''" Ta "131\ ``Y''" Ta "132\ ``Z''" Ta "133\ ``[''" Ta "134\ ``\e\|''" +.It "\&135\ ``]''" Ta "136\ ``^''" Ta "137\ ``_''" Ta "140\ ```''" Ta "141\ ``a''" +.It "\&142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" Ta "145\ ``e''" Ta "146\ ``f''" +.It "\&147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" Ta "152\ ``j''" Ta "153\ ``k''" +.It "\&154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" Ta "157\ ``o''" Ta "160\ ``p''" +.It "\&161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" Ta "164\ ``t''" Ta "165\ ``u''" +.It "\&166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" Ta "171\ ``y''" Ta "172\ ``z''" +.It "\&173\ ``{''" Ta "174\ ``|''" Ta "175\ ``}''" Ta "176\ ``~''" Ta \& .El .Pp The Modified: stable/9/lib/libc/locale/islower.3 ============================================================================== --- stable/9/lib/libc/locale/islower.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/islower.3 Fri May 3 14:59:32 2013 (r250213) @@ -59,18 +59,18 @@ In the ASCII character set, this include (with their numeric values shown in octal): .Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ -.It "\&141\ ``a'' \t142\ ``b'' \t143\ ``c'' \t144\ ``d'' \t145\ ``e''" -.It "\&146\ ``f'' \t147\ ``g'' \t150\ ``h'' \t151\ ``i'' \t152\ ``j''" -.It "\&153\ ``k'' \t154\ ``l'' \t155\ ``m'' \t156\ ``n'' \t157\ ``o''" -.It "\&160\ ``p'' \t161\ ``q'' \t162\ ``r'' \t163\ ``s'' \t164\ ``t''" -.It "\&165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y''" -.It "\&172\ ``z''" +.It "\&141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" Ta "145\ ``e''" +.It "\&146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" Ta "152\ ``j''" +.It "\&153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" Ta "157\ ``o''" +.It "\&160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" Ta "164\ ``t''" +.It "\&165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" Ta "171\ ``y''" +.It "\&172\ ``z''" Ta \& Ta \& Ta \& Ta \& .El The .Fn islower_l function takes an explicit locale argument, whereas the .Fn islower -function uses the current global or per-thread locale. +function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn islower Modified: stable/9/lib/libc/locale/isprint.3 ============================================================================== --- stable/9/lib/libc/locale/isprint.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/isprint.3 Fri May 3 14:59:32 2013 (r250213) @@ -58,25 +58,25 @@ In the ASCII character set, this include (with their numeric values shown in octal): .Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ -.It "\&040\ sp \t041\ ``!'' \t042\ ``""'' \t043\ ``#'' \t044\ ``$''" -.It "\&045\ ``%'' \t046\ ``&'' \t047\ ``''' \t050\ ``('' \t051\ ``)''" -.It "\&052\ ``*'' \t053\ ``+'' \t054\ ``,'' \t055\ ``-'' \t056\ ``.''" -.It "\&057\ ``/'' \t060\ ``0'' \t061\ ``1'' \t062\ ``2'' \t063\ ``3''" -.It "\&064\ ``4'' \t065\ ``5'' \t066\ ``6'' \t067\ ``7'' \t070\ ``8''" -.It "\&071\ ``9'' \t072\ ``:'' \t073\ ``;'' \t074\ ``<'' \t075\ ``=''" -.It "\&076\ ``>'' \t077\ ``?'' \t100\ ``@'' \t101\ ``A'' \t102\ ``B''" -.It "\&103\ ``C'' \t104\ ``D'' \t105\ ``E'' \t106\ ``F'' \t107\ ``G''" -.It "\&110\ ``H'' \t111\ ``I'' \t112\ ``J'' \t113\ ``K'' \t114\ ``L''" -.It "\&115\ ``M'' \t116\ ``N'' \t117\ ``O'' \t120\ ``P'' \t121\ ``Q''" -.It "\&122\ ``R'' \t123\ ``S'' \t124\ ``T'' \t125\ ``U'' \t126\ ``V''" -.It "\&127\ ``W'' \t130\ ``X'' \t131\ ``Y'' \t132\ ``Z'' \t133\ ``[''" -.It "\&134\ ``\e\|'' \t135\ ``]'' \t136\ ``^'' \t137\ ``_'' \t140\ ```''" -.It "\&141\ ``a'' \t142\ ``b'' \t143\ ``c'' \t144\ ``d'' \t145\ ``e''" -.It "\&146\ ``f'' \t147\ ``g'' \t150\ ``h'' \t151\ ``i'' \t152\ ``j''" -.It "\&153\ ``k'' \t154\ ``l'' \t155\ ``m'' \t156\ ``n'' \t157\ ``o''" -.It "\&160\ ``p'' \t161\ ``q'' \t162\ ``r'' \t163\ ``s'' \t164\ ``t''" -.It "\&165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y''" -.It "\&172\ ``z'' \t173\ ``{'' \t174\ ``|'' \t175\ ``}'' \t176\ ``~''" +.It "\&040\ sp" Ta "041\ ``!''" Ta "042\ ``""''" Ta "043\ ``#''" Ta "044\ ``$''" +.It "\&045\ ``%''" Ta "046\ ``&''" Ta "047\ ``'''" Ta "050\ ``(''" Ta "051\ ``)''" +.It "\&052\ ``*''" Ta "053\ ``+''" Ta "054\ ``,''" Ta "055\ ``-''" Ta "056\ ``.''" +.It "\&057\ ``/''" Ta "060\ ``0''" Ta "061\ ``1''" Ta "062\ ``2''" Ta "063\ ``3''" +.It "\&064\ ``4''" Ta "065\ ``5''" Ta "066\ ``6''" Ta "067\ ``7''" Ta "070\ ``8''" +.It "\&071\ ``9''" Ta "072\ ``:''" Ta "073\ ``;''" Ta "074\ ``<''" Ta "075\ ``=''" +.It "\&076\ ``>''" Ta "077\ ``?''" Ta "100\ ``@''" Ta "101\ ``A''" Ta "102\ ``B''" +.It "\&103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" Ta "106\ ``F''" Ta "107\ ``G''" +.It "\&110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" Ta "113\ ``K''" Ta "114\ ``L''" +.It "\&115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" Ta "120\ ``P''" Ta "121\ ``Q''" +.It "\&122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" Ta "125\ ``U''" Ta "126\ ``V''" +.It "\&127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" Ta "132\ ``Z''" Ta "133\ ``[''" +.It "\&134\ ``\e\|''" Ta "135\ ``]''" Ta "136\ ``^''" Ta "137\ ``_''" Ta "140\ ```''" +.It "\&141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" Ta "145\ ``e''" +.It "\&146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" Ta "152\ ``j''" +.It "\&153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" Ta "157\ ``o''" +.It "\&160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" Ta "164\ ``t''" +.It "\&165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" Ta "171\ ``y''" +.It "\&172\ ``z''" Ta "173\ ``{''" Ta "174\ ``|''" Ta "175\ ``}''" Ta "176\ ``~''" .El .Sh RETURN VALUES The Modified: stable/9/lib/libc/locale/ispunct.3 ============================================================================== --- stable/9/lib/libc/locale/ispunct.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/ispunct.3 Fri May 3 14:59:32 2013 (r250213) @@ -64,13 +64,13 @@ In the ASCII character set, this include (with their numeric values shown in octal): .Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ -.It "\&041\ ``!'' \t042\ ``""'' \t043\ ``#'' \t044\ ``$'' \t045\ ``%''" -.It "\&046\ ``&'' \t047\ ``''' \t050\ ``('' \t051\ ``)'' \t052\ ``*''" -.It "\&053\ ``+'' \t054\ ``,'' \t055\ ``-'' \t056\ ``.'' \t057\ ``/''" -.It "\&072\ ``:'' \t073\ ``;'' \t074\ ``<'' \t075\ ``='' \t076\ ``>''" -.It "\&077\ ``?'' \t100\ ``@'' \t133\ ``['' \t134\ ``\e\|'' \t135\ ``]''" -.It "\&136\ ``^'' \t137\ ``_'' \t140\ ```'' \t173\ ``{'' \t174\ ``|''" -.It "\&175\ ``}'' \t176\ ``~''" +.It "\&041\ ``!''" Ta "042\ ``""''" Ta "043\ ``#''" Ta "044\ ``$''" Ta "045\ ``%''" +.It "\&046\ ``&''" Ta "047\ ``'''" Ta "050\ ``(''" Ta "051\ ``)''" Ta "052\ ``*''" +.It "\&053\ ``+''" Ta "054\ ``,''" Ta "055\ ``-''" Ta "056\ ``.''" Ta "057\ ``/''" +.It "\&072\ ``:''" Ta "073\ ``;''" Ta "074\ ``<''" Ta "075\ ``=''" Ta "076\ ``>''" +.It "\&077\ ``?''" Ta "100\ ``@''" Ta "133\ ``[''" Ta "134\ ``\e\|''" Ta "135\ ``]''" +.It "\&136\ ``^''" Ta "137\ ``_''" Ta "140\ ```''" Ta "173\ ``{''" Ta "174\ ``|''" +.It "\&175\ ``}''" Ta "176\ ``~''" Ta \& Ta \& Ta \& .El .Pp The Modified: stable/9/lib/libc/locale/isspace.3 ============================================================================== --- stable/9/lib/libc/locale/isspace.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/isspace.3 Fri May 3 14:59:32 2013 (r250213) @@ -53,7 +53,7 @@ function tests for white-space character For any locale, this includes the following standard characters: .Pp .Bl -column \&`\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ -.It "\&``\et''\t``\en''\t``\ev''\t``\ef''\t``\er''\t`` ''" +.It "\&``\et''" Ta "``\en''" Ta "``\ev''" Ta "``\ef''" Ta "``\er''" Ta "`` ''" .El .Pp In the "C" locale, Modified: stable/9/lib/libc/locale/isupper.3 ============================================================================== --- stable/9/lib/libc/locale/isupper.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/isupper.3 Fri May 3 14:59:32 2013 (r250213) @@ -57,12 +57,12 @@ In the ASCII character set, this include (with their numeric values shown in octal): .Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ -.It "\&101\ ``A'' \t102\ ``B'' \t103\ ``C'' \t104\ ``D'' \t105\ ``E''" -.It "\&106\ ``F'' \t107\ ``G'' \t110\ ``H'' \t111\ ``I'' \t112\ ``J''" -.It "\&113\ ``K'' \t114\ ``L'' \t115\ ``M'' \t116\ ``N'' \t117\ ``O''" -.It "\&120\ ``P'' \t121\ ``Q'' \t122\ ``R'' \t123\ ``S'' \t124\ ``T''" -.It "\&125\ ``U'' \t126\ ``V'' \t127\ ``W'' \t130\ ``X'' \t131\ ``Y''" -.It "\&132\ ``Z''" +.It "\&101\ ``A''" Ta "102\ ``B''" Ta "103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" +.It "\&106\ ``F''" Ta "107\ ``G''" Ta "110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" +.It "\&113\ ``K''" Ta "114\ ``L''" Ta "115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" +.It "\&120\ ``P''" Ta "121\ ``Q''" Ta "122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" +.It "\&125\ ``U''" Ta "126\ ``V''" Ta "127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" +.It "\&132\ ``Z''" Ta \& Ta \& Ta \& Ta \& .El .Sh RETURN VALUES The Modified: stable/9/lib/libc/locale/iswalnum_l.3 ============================================================================== --- stable/9/lib/libc/locale/iswalnum_l.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/iswalnum_l.3 Fri May 3 14:59:32 2013 (r250213) @@ -24,8 +24,8 @@ .\" .\" $FreeBSD$ .\" -.Dt ISWALNUM_L 3 .Dd July 25, 2012 +.Dt ISWALNUM_L 3 .Os .Sh NAME .Nm iswalnum_l , @@ -161,7 +161,7 @@ except for .Fn iswphonogram_l , .Fn iswrune_l , .Fn iswspecial_l -and +and .Fn nextwctype_l which are .Fx Modified: stable/9/lib/libc/locale/isxdigit.3 ============================================================================== --- stable/9/lib/libc/locale/isxdigit.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/isxdigit.3 Fri May 3 14:59:32 2013 (r250213) @@ -53,11 +53,11 @@ function tests for any hexadecimal-digit Regardless of locale, this includes the following characters only: .Pp .Bl -column \&``0''______ \&``0''______ \&``0''______ \&``0''______ \&``0''______ -.It "\&``0''\t``1''\t``2''\t``3''\t``4''" -.It "\&``5''\t``6''\t``7''\t``8''\t``9''" -.It "\&``A''\t``B''\t``C''\t``D''\t``E''" -.It "\&``F''\t``a''\t``b''\t``c''\t``d''" -.It "\&``e''\t``f''" +.It "\&``0''" Ta "``1''" Ta "``2''" Ta "``3''" Ta "``4''" +.It "\&``5''" Ta "``6''" Ta "``7''" Ta "``8''" Ta "``9''" +.It "\&``A''" Ta "``B''" Ta "``C''" Ta "``D''" Ta "``E''" +.It "\&``F''" Ta "``a''" Ta "``b''" Ta "``c''" Ta "``d''" +.It "\&``e''" Ta "``f''" Ta \& Ta \& Ta \& .El .Pp The Modified: stable/9/lib/libc/locale/newlocale.3 ============================================================================== --- stable/9/lib/libc/locale/newlocale.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/newlocale.3 Fri May 3 14:59:32 2013 (r250213) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .Dd September 17 2011 -.Dt newlocale 3 +.Dt NEWLOCALE 3 .Os .Sh NAME .Nm newlocale @@ -36,7 +36,7 @@ .Lb libc .Sh SYNOPSIS .In xlocale -.Ft +.Ft locale_t .Fn newlocale "int mask" "const char * locale" "locale_t base" .Sh DESCRIPTION Creates a new locale, inheriting some properties from an existing locale. @@ -48,7 +48,6 @@ name specified in the parameter. Any other components will be inherited from .Fa base . -.Pt The .Fa mask is either @@ -93,7 +92,6 @@ Set a locale for formatting dates and ti .Xr strftime 3 function. .El - This function uses the same rules for loading locale components as .Xr setlocale 3 . .Sh RETURN VALUES @@ -110,5 +108,5 @@ You must free the returned locale with .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function, conforms to -.St -p1003.1-2008 +This function conforms to +.St -p1003.1-2008 . Modified: stable/9/lib/libc/locale/querylocale.3 ============================================================================== --- stable/9/lib/libc/locale/querylocale.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/querylocale.3 Fri May 3 14:59:32 2013 (r250213) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17 2011 +.Dd May 3, 2013 .Dt QUERYLOCALE 3 .Os .Sh NAME @@ -52,6 +52,3 @@ If more than one bit in the mask is set, .Xr newlocale 3 , .Xr uselocale 3 , .Xr xlocale 3 -.Sh STANDARDS -This function, conforms to -.St -p1003.1-2008 Modified: stable/9/lib/libc/locale/uselocale.3 ============================================================================== --- stable/9/lib/libc/locale/uselocale.3 Fri May 3 13:33:36 2013 (r250212) +++ stable/9/lib/libc/locale/uselocale.3 Fri May 3 14:59:32 2013 (r250213) @@ -57,4 +57,4 @@ or LC_GLOBAL_LOCALE if this thread has n .Xr xlocale 3 .Sh STANDARDS This function conforms to -.St -p1003.1-2008 +.St -p1003.1-2008 . From owner-svn-src-all@FreeBSD.ORG Fri May 3 15:28:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE8F2893; Fri, 3 May 2013 15:28:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0E3A189E; Fri, 3 May 2013 15:28:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43FSWdl015559; Fri, 3 May 2013 15:28:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43FSVfj015555; Fri, 3 May 2013 15:28:31 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305031528.r43FSVfj015555@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 3 May 2013 15:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250214 - in head: bin/sh tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 15:28:32 -0000 Author: jilles Date: Fri May 3 15:28:31 2013 New Revision: 250214 URL: http://svnweb.freebsd.org/changeset/base/250214 Log: sh: Improve error handling in read builtin: * If read -t times out, return status as if interrupted by SIGALRM (formerly 1). * If a trapped signal interrupts read, return status 128+sig (formerly 1). * If [EINTR] occurs but there is no trap, retry the read (for example because of a SIGWINCH in interactive mode). * If a read error occurs, write an error message and return status 2. As before, a variable assignment error returns 2 and discards the remaining data read. Added: head/tools/regression/bin/sh/builtins/read7.0 (contents, props changed) head/tools/regression/bin/sh/builtins/read8.0 (contents, props changed) Modified: head/bin/sh/miscbltin.c head/bin/sh/sh.1 Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Fri May 3 14:59:32 2013 (r250213) +++ head/bin/sh/miscbltin.c Fri May 3 15:28:31 2013 (r250214) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "mystring.h" #include "syntax.h" +#include "trap.h" #undef eflag @@ -102,6 +103,8 @@ readcmd(int argc __unused, char **argv _ struct timeval tv; char *tvptr; fd_set ifds; + ssize_t nread; + int sig; rflag = 0; prompt = NULL; @@ -156,8 +159,10 @@ readcmd(int argc __unused, char **argv _ /* * If there's nothing ready, return an error. */ - if (status <= 0) - return(1); + if (status <= 0) { + sig = pendingsig; + return (128 + (sig != 0 ? sig : SIGALRM)); + } } status = 0; @@ -165,7 +170,19 @@ readcmd(int argc __unused, char **argv _ backslash = 0; STARTSTACKSTR(p); for (;;) { - if (read(STDIN_FILENO, &c, 1) != 1) { + nread = read(STDIN_FILENO, &c, 1); + if (nread == -1) { + if (errno == EINTR) { + sig = pendingsig; + if (sig == 0) + continue; + status = 128 + sig; + break; + } + warning("read error: %s", strerror(errno)); + status = 2; + break; + } else if (nread != 1) { status = 1; break; } Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri May 3 14:59:32 2013 (r250213) +++ head/bin/sh/sh.1 Fri May 3 15:28:31 2013 (r250214) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd April 21, 2013 +.Dd May 3, 2013 .Dt SH 1 .Os .Sh NAME @@ -2372,7 +2372,9 @@ option is specified and the elapses before a complete line of input is supplied, the .Ic read -command will return an exit status of 1 without assigning any values. +command will return an exit status as if terminated by +.Dv SIGALRM +without assigning any values. The .Ar timeout value may optionally be followed by one of @@ -2388,6 +2390,11 @@ is assumed. The .Fl e option exists only for backward compatibility with older scripts. +.Pp +The exit status is 0 on success, 1 on end of file, +between 2 and 128 if an error occurs +and greater than 128 if a trapped signal interrupts +.Ic read . .It Ic readonly Oo Fl p Oc Op Ar name ... Each specified .Ar name Added: head/tools/regression/bin/sh/builtins/read7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/read7.0 Fri May 3 15:28:31 2013 (r250214) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +{ errmsg=`read x <&- 2>&1 >&3`; } 3>&1 +r=$? +[ "$r" -ge 2 ] && [ "$r" -le 128 ] && [ -n "$errmsg" ] Added: head/tools/regression/bin/sh/builtins/read8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/read8.0 Fri May 3 15:28:31 2013 (r250214) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX` +trap 'rm -rf $T' 0 +cd $T || exit 3 +mkfifo fifo1 +trapped= +trap trapped=1 QUIT +{ kill -QUIT $$; sleep 1; exit 4; } >fifo1 & +read dummy Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 983CEE1; Fri, 3 May 2013 15:52:44 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 702851B71; Fri, 3 May 2013 15:52:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43FqiuA024583; Fri, 3 May 2013 15:52:44 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43FqiPN024580; Fri, 3 May 2013 15:52:44 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305031552.r43FqiPN024580@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 3 May 2013 15:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250215 - stable/9/lib/libc/locale X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 15:52:44 -0000 Author: pluknet Date: Fri May 3 15:52:43 2013 New Revision: 250215 URL: http://svnweb.freebsd.org/changeset/base/250215 Log: MFC r228269,228921: - libc: Eliminate 13 relative relocations in wctype(). - libc: Eliminate some relative relocations in setlocale(). Modified: stable/9/lib/libc/locale/setlocale.c stable/9/lib/libc/locale/wctype.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/locale/setlocale.c ============================================================================== --- stable/9/lib/libc/locale/setlocale.c Fri May 3 15:28:31 2013 (r250214) +++ stable/9/lib/libc/locale/setlocale.c Fri May 3 15:52:43 2013 (r250215) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); /* * Category names for getenv() */ -static char *categories[_LC_LAST] = { +static const char categories[_LC_LAST][12] = { "LC_ALL", "LC_COLLATE", "LC_CTYPE", Modified: stable/9/lib/libc/locale/wctype.c ============================================================================== --- stable/9/lib/libc/locale/wctype.c Fri May 3 15:28:31 2013 (r250214) +++ stable/9/lib/libc/locale/wctype.c Fri May 3 15:52:43 2013 (r250215) @@ -57,35 +57,54 @@ iswctype_l(wint_t wc, wctype_t charclass wctype_t wctype_l(const char *property, locale_t locale) { - static const struct { - const char *name; - wctype_t mask; - } props[] = { - { "alnum", _CTYPE_A|_CTYPE_D }, - { "alpha", _CTYPE_A }, - { "blank", _CTYPE_B }, - { "cntrl", _CTYPE_C }, - { "digit", _CTYPE_D }, - { "graph", _CTYPE_G }, - { "lower", _CTYPE_L }, - { "print", _CTYPE_R }, - { "punct", _CTYPE_P }, - { "space", _CTYPE_S }, - { "upper", _CTYPE_U }, - { "xdigit", _CTYPE_X }, - { "ideogram", _CTYPE_I }, /* BSD extension */ - { "special", _CTYPE_T }, /* BSD extension */ - { "phonogram", _CTYPE_Q }, /* BSD extension */ - { "rune", 0xFFFFFF00L }, /* BSD extension */ - { NULL, 0UL }, /* Default */ + const char *propnames = + "alnum\0" + "alpha\0" + "blank\0" + "cntrl\0" + "digit\0" + "graph\0" + "lower\0" + "print\0" + "punct\0" + "space\0" + "upper\0" + "xdigit\0" + "ideogram\0" /* BSD extension */ + "special\0" /* BSD extension */ + "phonogram\0" /* BSD extension */ + "rune\0"; /* BSD extension */ + static const wctype_t propmasks[] = { + _CTYPE_A|_CTYPE_D, + _CTYPE_A, + _CTYPE_B, + _CTYPE_C, + _CTYPE_D, + _CTYPE_G, + _CTYPE_L, + _CTYPE_R, + _CTYPE_P, + _CTYPE_S, + _CTYPE_U, + _CTYPE_X, + _CTYPE_I, + _CTYPE_T, + _CTYPE_Q, + 0xFFFFFF00L }; - int i; + size_t len1, len2; + const char *p; + const wctype_t *q; - i = 0; - while (props[i].name != NULL && strcmp(props[i].name, property) != 0) - i++; + len1 = strlen(property); + q = propmasks; + for (p = propnames; (len2 = strlen(p)) != 0; p += len2 + 1) { + if (len1 == len2 && memcmp(property, p, len1) == 0) + return (*q); + q++; + } - return (props[i].mask); + return (0UL); } wctype_t wctype(const char *property) From owner-svn-src-all@FreeBSD.ORG Fri May 3 15:54:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DBAD7273; Fri, 3 May 2013 15:54:13 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDA871B8F; Fri, 3 May 2013 15:54:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43FsDNk024899; Fri, 3 May 2013 15:54:13 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43FsDQK024898; Fri, 3 May 2013 15:54:13 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305031554.r43FsDQK024898@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 3 May 2013 15:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250216 - stable/9/lib/libc/locale X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 15:54:13 -0000 Author: pluknet Date: Fri May 3 15:54:13 2013 New Revision: 250216 URL: http://svnweb.freebsd.org/changeset/base/250216 Log: MFC r244091: Improve style(9) compliance of function declarations. Modified: stable/9/lib/libc/locale/setrunelocale.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/locale/setrunelocale.c ============================================================================== --- stable/9/lib/libc/locale/setrunelocale.c Fri May 3 15:52:43 2013 (r250215) +++ stable/9/lib/libc/locale/setrunelocale.c Fri May 3 15:54:13 2013 (r250216) @@ -73,9 +73,11 @@ static int __setrunelocale(struct xloca #define __collate_chain_pri_table (table->__collate_chain_pri_table) -static void destruct_ctype(void *v) +static void +destruct_ctype(void *v) { struct xlocale_ctype *l = v; + if (strcmp(l->runes->__encoding, "EUC") == 0) free(l->runes->__variable); if (&_DefaultRuneLocale != l->runes) @@ -83,13 +85,17 @@ static void destruct_ctype(void *v) free(l); } -const _RuneLocale *__getCurrentRuneLocale(void) +const _RuneLocale * +__getCurrentRuneLocale(void) { + return XLOCALE_CTYPE(__get_locale())->runes; } -static void free_runes(_RuneLocale *rl) +static void +free_runes(_RuneLocale *rl) { + /* FIXME: The "EUC" check here is a hideous abstraction violation. */ if ((rl != &_DefaultRuneLocale) && (rl)) { if (strcmp(rl->__encoding, "EUC") == 0) { @@ -191,7 +197,8 @@ __wrap_setrunelocale(const char *locale) #ifndef __NO_TLS void -__set_thread_rune_locale(locale_t loc) { +__set_thread_rune_locale(locale_t loc) +{ if (loc == NULL) { _ThreadRuneLocale = &_DefaultRuneLocale; @@ -205,6 +212,7 @@ void * __ctype_load(const char *locale, locale_t unused) { struct xlocale_ctype *l = calloc(sizeof(struct xlocale_ctype), 1); + l->header.header.destructor = destruct_ctype; if (__setrunelocale(l, locale)) { From owner-svn-src-all@FreeBSD.ORG Fri May 3 16:29:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 16E01EE3; Fri, 3 May 2013 16:29:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 08F341EA0; Fri, 3 May 2013 16:29:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43GTpTv036697; Fri, 3 May 2013 16:29:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43GTpO3036696; Fri, 3 May 2013 16:29:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305031629.r43GTpO3036696@svn.freebsd.org> From: Dimitry Andric Date: Fri, 3 May 2013 16:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250217 - head/lib/clang/include/llvm/Config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 16:29:52 -0000 Author: dim Date: Fri May 3 16:29:51 2013 New Revision: 250217 URL: http://svnweb.freebsd.org/changeset/base/250217 Log: Allow building clang on older FreeBSD releases, where log2() does not exist yet. With this change, I have verified that building head on 8.1-RELEASE works. Noticed by: Ryan Stone Modified: head/lib/clang/include/llvm/Config/config.h Modified: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- head/lib/clang/include/llvm/Config/config.h Fri May 3 15:54:13 2013 (r250216) +++ head/lib/clang/include/llvm/Config/config.h Fri May 3 16:29:51 2013 (r250217) @@ -5,6 +5,9 @@ #ifndef CONFIG_H #define CONFIG_H +/* Get __FreeBSD_version. */ +#include + /* Bug report URL. */ #define BUG_REPORT_URL "http://llvm.org/bugs/" @@ -248,7 +251,9 @@ #define HAVE_LOG10 1 /* Define to 1 if you have the `log2' function. */ +#if __FreeBSD_version >= 900027 || (__FreeBSD_version < 900000 && __FreeBSD_version >= 802502) #define HAVE_LOG2 1 +#endif /* Define to 1 if you have the `longjmp' function. */ #define HAVE_LONGJMP 1 From owner-svn-src-all@FreeBSD.ORG Fri May 3 16:41:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ED53D6DD for ; Fri, 3 May 2013 16:41:00 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com [IPv6:2a00:1450:4010:c03::232]) by mx1.freebsd.org (Postfix) with ESMTP id 753F81F9C for ; Fri, 3 May 2013 16:41:00 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id fl20so1689629lab.37 for ; Fri, 03 May 2013 09:40:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=uQq6lalcNh3vFPNzKVi/f16f58rnqlKOhinny5bXaEI=; b=PeZpSTJAyh0hM919WLILWvtH4cN8VDXgj+pU8fVf4v0vV7RhHE4MhA0IocqthyT094 dH8zqIRsHdvYw7GgpZv9ha87ZPDzF2ygZo1XwJ8qAabUjG8TrHNvF5Z1LEGN41yV7SQL qfDnIZOWWoSVswLwlkWf4jO6GrrF7FD6Db6IJxA+7HYW0tAvF+mBl0DvRh+ScN778WIV Dkz8AnnHfj9wjRnoHJGzNQOqexJrnJKQermXvhwqku0QX/Z+WpFutJkgmIDd1nfMr+jd J4nsFflmOjUsmKQQxKbfv3RokNix+tqYXU5+zYoABc0GHhvd6ejNjpBTXoxK8OJoJt21 HLKA== X-Received: by 10.152.87.116 with SMTP id w20mr4511976laz.0.1367599259311; Fri, 03 May 2013 09:40:59 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id sl5sm4436768lbb.10.2013.05.03.09.40.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 09:40:58 -0700 (PDT) Message-ID: <5183E899.4000503@freebsd.org> Date: Fri, 03 May 2013 20:40:57 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Sergey Kandaurov Subject: Re: svn commit: r250215 - stable/9/lib/libc/locale References: <201305031552.r43FqiPN024580@svn.freebsd.org> In-Reply-To: <201305031552.r43FqiPN024580@svn.freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmMQAeqd4mkt7zPkdzxQ9Nnzu05H9dJnRI7EGjXII/Rn9EsjWHru/thYBL+JPOSxHVvz+9k Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 16:41:01 -0000 I don't think this change is optimal (cause slowdown) since you add unneeded strlen() in the loop for known-sized elements plus one strlen() for tested property, and wctype_l() itself can be called very often, so we definitely don't need slowdown here. Since most of elements have equal sizes, your len1 == len2 condition gains almost nothing for valid calls. On 03.05.2013 19:52, Sergey Kandaurov wrote: > Modified: stable/9/lib/libc/locale/wctype.c > ============================================================================== > --- stable/9/lib/libc/locale/wctype.c Fri May 3 15:28:31 2013 (r250214) > +++ stable/9/lib/libc/locale/wctype.c Fri May 3 15:52:43 2013 (r250215) > @@ -57,35 +57,54 @@ iswctype_l(wint_t wc, wctype_t charclass > wctype_t > wctype_l(const char *property, locale_t locale) > { > - static const struct { > - const char *name; > - wctype_t mask; > - } props[] = { > - { "alnum", _CTYPE_A|_CTYPE_D }, > - { "alpha", _CTYPE_A }, > - { "blank", _CTYPE_B }, > - { "cntrl", _CTYPE_C }, > - { "digit", _CTYPE_D }, > - { "graph", _CTYPE_G }, > - { "lower", _CTYPE_L }, > - { "print", _CTYPE_R }, > - { "punct", _CTYPE_P }, > - { "space", _CTYPE_S }, > - { "upper", _CTYPE_U }, > - { "xdigit", _CTYPE_X }, > - { "ideogram", _CTYPE_I }, /* BSD extension */ > - { "special", _CTYPE_T }, /* BSD extension */ > - { "phonogram", _CTYPE_Q }, /* BSD extension */ > - { "rune", 0xFFFFFF00L }, /* BSD extension */ > - { NULL, 0UL }, /* Default */ > + const char *propnames = > + "alnum\0" > + "alpha\0" > + "blank\0" > + "cntrl\0" > + "digit\0" > + "graph\0" > + "lower\0" > + "print\0" > + "punct\0" > + "space\0" > + "upper\0" > + "xdigit\0" > + "ideogram\0" /* BSD extension */ > + "special\0" /* BSD extension */ > + "phonogram\0" /* BSD extension */ > + "rune\0"; /* BSD extension */ > + static const wctype_t propmasks[] = { > + _CTYPE_A|_CTYPE_D, > + _CTYPE_A, > + _CTYPE_B, > + _CTYPE_C, > + _CTYPE_D, > + _CTYPE_G, > + _CTYPE_L, > + _CTYPE_R, > + _CTYPE_P, > + _CTYPE_S, > + _CTYPE_U, > + _CTYPE_X, > + _CTYPE_I, > + _CTYPE_T, > + _CTYPE_Q, > + 0xFFFFFF00L > }; > - int i; > + size_t len1, len2; > + const char *p; > + const wctype_t *q; > > - i = 0; > - while (props[i].name != NULL && strcmp(props[i].name, property) != 0) > - i++; > + len1 = strlen(property); > + q = propmasks; > + for (p = propnames; (len2 = strlen(p)) != 0; p += len2 + 1) { > + if (len1 == len2 && memcmp(property, p, len1) == 0) > + return (*q); > + q++; > + } > > - return (props[i].mask); > + return (0UL); > } > > wctype_t wctype(const char *property) > -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Fri May 3 17:20:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 813C7493; Fri, 3 May 2013 17:20:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 5F99C12D1; Fri, 3 May 2013 17:20:19 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id ACE7AB990; Fri, 3 May 2013 13:20:18 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r250193 - head/sys/fs/msdosfs Date: Fri, 3 May 2013 11:55:47 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305022000.r42K0Bdk098965@svn.freebsd.org> In-Reply-To: <201305022000.r42K0Bdk098965@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305031155.47559.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 03 May 2013 13:20:18 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 17:20:19 -0000 On Thursday, May 02, 2013 4:00:11 pm Konstantin Belousov wrote: > Author: kib > Date: Thu May 2 20:00:11 2013 > New Revision: 250193 > URL: http://svnweb.freebsd.org/changeset/base/250193 > > Log: > The fsync(2) call should sync the vnode in such way that even after > system crash which happen after successfull fsync() return, the data > is accessible. For msdosfs, this means that FAT entries for the file > must be written. > > Since we do not track the FAT blocks containing entries for the > current file, just do a sloppy sync of the devvp vnode for the mount, > which buffers, among other things, contain FAT blocks. > > Simultaneously, for deupdat(): > - optimize by clearing the modified flags before short-circuiting a > return, if the mount is read-only; > - only ignore the rest of the function for denode with DE_MODIFIED > flag clear when the waitfor argument is false. The directory buffer > for the entry might be of delayed write; > - microoptimize by comparing the updated directory entry with the > current block content; > - try to cluster the write, fall back to bawrite() if low on > resources. > > Based on the submission by: bde > MFC after: 2 weeks Does this fix kern/62762? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri May 3 17:49:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C9A7C4A4; Fri, 3 May 2013 17:49:07 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) by mx1.freebsd.org (Postfix) with ESMTP id BDC0F15EE; Fri, 3 May 2013 17:49:06 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id m6so862174wiv.13 for ; Fri, 03 May 2013 10:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=4upWFZKPCuvR9X1CDRCNQhw1mSSeii7hf+7Pgz3qfmw=; b=j4qbzSfiKlE/O962C5JXI4C4yS1ApQGd+bjnZu1P6XYDKiYv4jR822f7MMxr6fuceg l5D5k/E5pENZ/XISbZ7mYbOECtQZ2m2YsydSs0pyW0uQrl+XgQ4rnRrI2SEIgSzycbp2 brDAgZPYoFGXE8WA8S+PJWfyhUeOdcPa74AqtwySkwm0672yOwaoC4y0x64Jguo0h1DU elZM9B/mCkIsUX07IRcezl7mVHtKaAQYaGfn2/AvG+Gds0T5Sn2tt7nzOw6BkguS9Rke E4+OB5pJhV+afurm+ecplH3KGgZJR5K2WotJtkDcfq7D+EgIZOeJIxkYJ/X/eqkdQ6Pb u9uA== MIME-Version: 1.0 X-Received: by 10.180.90.203 with SMTP id by11mr14724705wib.10.1367603345899; Fri, 03 May 2013 10:49:05 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.194.29.199 with HTTP; Fri, 3 May 2013 10:49:05 -0700 (PDT) In-Reply-To: <5183E899.4000503@freebsd.org> References: <201305031552.r43FqiPN024580@svn.freebsd.org> <5183E899.4000503@freebsd.org> Date: Fri, 3 May 2013 21:49:05 +0400 X-Google-Sender-Auth: RjNJkhVqVBILRMLpNHU2wzLB9Hg Message-ID: Subject: Re: svn commit: r250215 - stable/9/lib/libc/locale From: Sergey Kandaurov To: Andrey Chernov Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 17:49:07 -0000 On 3 May 2013 20:40, Andrey Chernov wrote: > I don't think this change is optimal (cause slowdown) since you add > unneeded strlen() in the loop for known-sized elements plus one strlen() > for tested property, and wctype_l() itself can be called very often, so > we definitely don't need slowdown here. > Since most of elements have equal sizes, your len1 == len2 condition > gains almost nothing for valid calls. Thanks, you are correct. With this change I got 2-6 times slowdown depending on the specified wctype. I will look at how it can be optimized. > > On 03.05.2013 19:52, Sergey Kandaurov wrote: >> Modified: stable/9/lib/libc/locale/wctype.c >> ============================================================================== >> --- stable/9/lib/libc/locale/wctype.c Fri May 3 15:28:31 2013 (r250214) >> +++ stable/9/lib/libc/locale/wctype.c Fri May 3 15:52:43 2013 (r250215) >> @@ -57,35 +57,54 @@ iswctype_l(wint_t wc, wctype_t charclass >> wctype_t >> wctype_l(const char *property, locale_t locale) >> { >> - static const struct { >> - const char *name; >> - wctype_t mask; >> - } props[] = { >> - { "alnum", _CTYPE_A|_CTYPE_D }, >> - { "alpha", _CTYPE_A }, >> - { "blank", _CTYPE_B }, >> - { "cntrl", _CTYPE_C }, >> - { "digit", _CTYPE_D }, >> - { "graph", _CTYPE_G }, >> - { "lower", _CTYPE_L }, >> - { "print", _CTYPE_R }, >> - { "punct", _CTYPE_P }, >> - { "space", _CTYPE_S }, >> - { "upper", _CTYPE_U }, >> - { "xdigit", _CTYPE_X }, >> - { "ideogram", _CTYPE_I }, /* BSD extension */ >> - { "special", _CTYPE_T }, /* BSD extension */ >> - { "phonogram", _CTYPE_Q }, /* BSD extension */ >> - { "rune", 0xFFFFFF00L }, /* BSD extension */ >> - { NULL, 0UL }, /* Default */ >> + const char *propnames = >> + "alnum\0" >> + "alpha\0" >> + "blank\0" >> + "cntrl\0" >> + "digit\0" >> + "graph\0" >> + "lower\0" >> + "print\0" >> + "punct\0" >> + "space\0" >> + "upper\0" >> + "xdigit\0" >> + "ideogram\0" /* BSD extension */ >> + "special\0" /* BSD extension */ >> + "phonogram\0" /* BSD extension */ >> + "rune\0"; /* BSD extension */ >> + static const wctype_t propmasks[] = { >> + _CTYPE_A|_CTYPE_D, >> + _CTYPE_A, >> + _CTYPE_B, >> + _CTYPE_C, >> + _CTYPE_D, >> + _CTYPE_G, >> + _CTYPE_L, >> + _CTYPE_R, >> + _CTYPE_P, >> + _CTYPE_S, >> + _CTYPE_U, >> + _CTYPE_X, >> + _CTYPE_I, >> + _CTYPE_T, >> + _CTYPE_Q, >> + 0xFFFFFF00L >> }; >> - int i; >> + size_t len1, len2; >> + const char *p; >> + const wctype_t *q; >> >> - i = 0; >> - while (props[i].name != NULL && strcmp(props[i].name, property) != 0) >> - i++; >> + len1 = strlen(property); >> + q = propmasks; >> + for (p = propnames; (len2 = strlen(p)) != 0; p += len2 + 1) { >> + if (len1 == len2 && memcmp(property, p, len1) == 0) >> + return (*q); >> + q++; >> + } >> >> - return (props[i].mask); >> + return (0UL); >> } >> >> wctype_t wctype(const char *property) >> > > -- > http://ache.vniz.net/ > bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri May 3 18:37:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 21D40EB1; Fri, 3 May 2013 18:37:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 12FEA1BF6; Fri, 3 May 2013 18:37:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43IboiW083482; Fri, 3 May 2013 18:37:50 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43Iboth083479; Fri, 3 May 2013 18:37:50 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201305031837.r43Iboth083479@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 3 May 2013 18:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250218 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 18:37:51 -0000 Author: np Date: Fri May 3 18:37:50 2013 New Revision: 250218 URL: http://svnweb.freebsd.org/changeset/base/250218 Log: cxgbe/tom: Do not use M_PROTO1 to mark rx zero-copy mbufs as special. All the M_PROTOn flags are clobbered when an mbuf is appended to the socket buffer. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri May 3 16:29:51 2013 (r250217) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri May 3 18:37:50 2013 (r250218) @@ -827,15 +827,8 @@ do_peer_close(struct sge_iq *iq, const s sb = &so->so_rcv; SOCKBUF_LOCK(sb); if (__predict_false(toep->ddp_flags & (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE))) { - m = m_get(M_NOWAIT, MT_DATA); - if (m == NULL) - CXGBE_UNIMPLEMENTED("mbuf alloc failure"); - - m->m_len = be32toh(cpl->rcv_nxt) - tp->rcv_nxt; - m->m_flags |= M_DDP; /* Data is already where it should be */ - m->m_data = "nothing to see here"; + m = get_ddp_mbuf(be32toh(cpl->rcv_nxt) - tp->rcv_nxt); tp->rcv_nxt = be32toh(cpl->rcv_nxt); - toep->ddp_flags &= ~(DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE); KASSERT(toep->sb_cc >= sb->sb_cc, Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Fri May 3 16:29:51 2013 (r250217) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Fri May 3 18:37:50 2013 (r250218) @@ -217,13 +217,7 @@ insert_ddp_data(struct toepcb *toep, uin INP_WLOCK_ASSERT(inp); SOCKBUF_LOCK_ASSERT(sb); - m = m_get(M_NOWAIT, MT_DATA); - if (m == NULL) - CXGBE_UNIMPLEMENTED("mbuf alloc failure"); - m->m_len = n; - m->m_flags |= M_DDP; /* Data is already where it should be */ - m->m_data = "nothing to see here"; - + m = get_ddp_mbuf(n); tp->rcv_nxt += n; #ifndef USE_DDP_RX_FLOW_CONTROL KASSERT(tp->rcv_wnd >= n, ("%s: negative window size", __func__)); @@ -457,13 +451,7 @@ handle_ddp_data(struct toepcb *toep, __b KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__)); tp->rcv_wnd -= len; #endif - - m = m_get(M_NOWAIT, MT_DATA); - if (m == NULL) - CXGBE_UNIMPLEMENTED("mbuf alloc failure"); - m->m_len = len; - m->m_flags |= M_DDP; /* Data is already where it should be */ - m->m_data = "nothing to see here"; + m = get_ddp_mbuf(len); SOCKBUF_LOCK(sb); if (report & F_DDP_BUF_COMPLETE) @@ -1022,6 +1010,29 @@ soreceive_rcvoob(struct socket *so, stru CXGBE_UNIMPLEMENTED(__func__); } +static char ddp_magic_str[] = "nothing to see here"; + +struct mbuf * +get_ddp_mbuf(int len) +{ + struct mbuf *m; + + m = m_get(M_NOWAIT, MT_DATA); + if (m == NULL) + CXGBE_UNIMPLEMENTED("mbuf alloc failure"); + m->m_len = len; + m->m_data = &ddp_magic_str[0]; + + return (m); +} + +static inline int +is_ddp_mbuf(struct mbuf *m) +{ + + return (m->m_data == &ddp_magic_str[0]); +} + /* * Copy an mbuf chain into a uio limited by len if set. */ @@ -1040,7 +1051,7 @@ m_mbuftouio_ddp(struct uio *uio, struct for (; m != NULL; m = m->m_next) { length = min(m->m_len, total - progress); - if (m->m_flags & M_DDP) { + if (is_ddp_mbuf(m)) { enum uio_seg segflag = uio->uio_segflg; uio->uio_segflg = UIO_NOCOPY; Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Fri May 3 16:29:51 2013 (r250217) +++ head/sys/dev/cxgbe/tom/t4_tom.h Fri May 3 18:37:50 2013 (r250218) @@ -49,8 +49,6 @@ #define DDP_RSVD_WIN (16 * 1024U) #define SB_DDP_INDICATE SB_IN_TOE /* soreceive must respond to indicate */ -#define M_DDP M_PROTO1 - #define USE_DDP_RX_FLOW_CONTROL /* TOE PCB flags */ @@ -279,6 +277,7 @@ void t4_init_ddp(struct adapter *, struc void t4_uninit_ddp(struct adapter *, struct tom_data *); int t4_soreceive_ddp(struct socket *, struct sockaddr **, struct uio *, struct mbuf **, struct mbuf **, int *); +struct mbuf *get_ddp_mbuf(int); void enable_ddp(struct adapter *, struct toepcb *toep); void release_ddp_resources(struct toepcb *toep); void insert_ddp_data(struct toepcb *, uint32_t); From owner-svn-src-all@FreeBSD.ORG Fri May 3 18:54:01 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DAEE04AF; Fri, 3 May 2013 18:54:01 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3181D81; Fri, 3 May 2013 18:54:01 +0000 (UTC) Received: from [88.198.91.248] (helo=[IPv6:::1]) by id.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1UYL7A-00070M-8k; Fri, 03 May 2013 11:53:54 -0700 Message-ID: <518407BE.2020501@freebsd.org> Date: Fri, 03 May 2013 11:53:50 -0700 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Tim Kientzle Subject: Re: svn commit: r249774 - head/sys/boot/fdt/dts References: <201304221853.r3MIram6060889@svn.freebsd.org> <8DA5B1ED-C616-4D2F-9235-E37A89F7EABE@kientzle.com> In-Reply-To: <8DA5B1ED-C616-4D2F-9235-E37A89F7EABE@kientzle.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 4/29/2013 9:31 PM, Tim Kientzle wrote: > On Apr 22, 2013, at 11:53 AM, Oleksandr Tymoshenko wrote: > >> Author: gonzo >> Date: Mon Apr 22 18:53:36 2013 >> New Revision: 249774 >> URL: http://svnweb.freebsd.org/changeset/base/249774 >> >> Log: >> Split BeagleBone DTS to generic AM335x part and Beagle-bone specific >> >> Added: >> head/sys/boot/fdt/dts/am335x.dtsi (contents, props changed) >> Modified: >> head/sys/boot/fdt/dts/beaglebone.dts >> >> Added: head/sys/boot/fdt/dts/am335x.dtsi >> ============================================================================== >> + >> +/ { >> + compatible = "ti,am335x"; >> >> Modified: head/sys/boot/fdt/dts/beaglebone.dts >> ============================================================================== >> >> +/include/ "am335x.dtsi" >> + >> / { >> model = "beaglebone"; >> - compatible = "beaglebone", "ti,am335x"; > > This used to have two "compatible" names; now it only has one. > > Is there a way to have both again? > > (Mostly I'm just curious; I'm still learning FDT conventions.) > [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 18:54:01 -0000 On 4/29/2013 9:31 PM, Tim Kientzle wrote: > On Apr 22, 2013, at 11:53 AM, Oleksandr Tymoshenko wrote: > >> Author: gonzo >> Date: Mon Apr 22 18:53:36 2013 >> New Revision: 249774 >> URL: http://svnweb.freebsd.org/changeset/base/249774 >> >> Log: >> Split BeagleBone DTS to generic AM335x part and Beagle-bone specific >> >> Added: >> head/sys/boot/fdt/dts/am335x.dtsi (contents, props changed) >> Modified: >> head/sys/boot/fdt/dts/beaglebone.dts >> >> Added: head/sys/boot/fdt/dts/am335x.dtsi >> ============================================================================== >> + >> +/ { >> + compatible = "ti,am335x"; >> >> Modified: head/sys/boot/fdt/dts/beaglebone.dts >> ============================================================================== >> >> +/include/ "am335x.dtsi" >> + >> / { >> model = "beaglebone"; >> - compatible = "beaglebone", "ti,am335x"; > > This used to have two "compatible" names; now it only has one. > > Is there a way to have both again? > > (Mostly I'm just curious; I'm still learning FDT conventions.) > I think it was wrong of me to move compatible property to dtsi. I'll move it back to main .dts file. Thanks for spotting. From owner-svn-src-all@FreeBSD.ORG Fri May 3 18:58:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 56A1F98F; Fri, 3 May 2013 18:58:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4829B1DF9; Fri, 3 May 2013 18:58:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43Iwcgf090427; Fri, 3 May 2013 18:58:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43IwcAv090426; Fri, 3 May 2013 18:58:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305031858.r43IwcAv090426@svn.freebsd.org> From: John Baldwin Date: Fri, 3 May 2013 18:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250219 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 18:58:38 -0000 Author: jhb Date: Fri May 3 18:58:37 2013 New Revision: 250219 URL: http://svnweb.freebsd.org/changeset/base/250219 Log: Fix two bugs in the current NUMA-aware allocation code: - vm_phys_alloc_freelist_pages() can be called by vm_page_alloc_freelist() to allocate a page from a specific freelist. In the NUMA case it did not properly map the public VM_FREELIST_* constants to the correct backing freelists, nor did it try all NUMA domains for allocations from VM_FREELIST_DEFAULT. - vm_phys_alloc_pages() did not pin the thread and each call to vm_phys_alloc_freelist_pages() fetched the current domain to choose which freelist to use. If a thread migrated domains during the loop in vm_phys_alloc_pages() it could skip one of the freelists. If the other freelists were out of memory then it is possible that vm_phys_alloc_pages() would fail to allocate a page even though pages were available resulting in a panic in vm_page_alloc(). Reviewed by: alc MFC after: 1 week Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Fri May 3 18:37:50 2013 (r250218) +++ head/sys/vm/vm_phys.c Fri May 3 18:58:37 2013 (r250219) @@ -122,6 +122,8 @@ SYSCTL_OID(_vm, OID_AUTO, phys_lookup_li NULL, 0, sysctl_vm_phys_lookup_lists, "A", "Phys Lookup Lists"); #endif +static vm_page_t vm_phys_alloc_domain_pages(int domain, int flind, int pool, + int order); static void _vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int flind, int domain); static void vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int flind); @@ -435,10 +437,20 @@ vm_page_t vm_phys_alloc_pages(int pool, int order) { vm_page_t m; - int flind; + int domain, flind; + + KASSERT(pool < VM_NFREEPOOL, + ("vm_phys_alloc_pages: pool %d is out of range", pool)); + KASSERT(order < VM_NFREEORDER, + ("vm_phys_alloc_pages: order %d is out of range", order)); +#if VM_NDOMAIN > 1 + domain = PCPU_GET(domain); +#else + domain = 0; +#endif for (flind = 0; flind < vm_nfreelists; flind++) { - m = vm_phys_alloc_freelist_pages(flind, pool, order); + m = vm_phys_alloc_domain_pages(domain, flind, pool, order); if (m != NULL) return (m); } @@ -451,11 +463,12 @@ vm_phys_alloc_pages(int pool, int order) */ vm_page_t vm_phys_alloc_freelist_pages(int flind, int pool, int order) -{ - struct vm_freelist *fl; - struct vm_freelist *alt; - int domain, oind, pind; +{ +#if VM_NDOMAIN > 1 vm_page_t m; + int i, ndomains; +#endif + int domain; KASSERT(flind < VM_NFREELIST, ("vm_phys_alloc_freelist_pages: freelist %d is out of range", flind)); @@ -465,10 +478,39 @@ vm_phys_alloc_freelist_pages(int flind, ("vm_phys_alloc_freelist_pages: order %d is out of range", order)); #if VM_NDOMAIN > 1 + /* + * This routine expects to be called with a VM_FREELIST_* constant. + * On a system with multiple domains we need to adjust the flind + * appropriately. If it is for VM_FREELIST_DEFAULT we need to + * iterate over the per-domain lists. + */ domain = PCPU_GET(domain); + ndomains = vm_nfreelists - VM_NFREELIST + 1; + if (flind == VM_FREELIST_DEFAULT) { + m = NULL; + for (i = 0; i < ndomains; i++, flind++) { + m = vm_phys_alloc_domain_pages(domain, flind, pool, + order); + if (m != NULL) + break; + } + return (m); + } else if (flind > VM_FREELIST_DEFAULT) + flind += ndomains - 1; #else domain = 0; #endif + return (vm_phys_alloc_domain_pages(domain, flind, pool, order)); +} + +static vm_page_t +vm_phys_alloc_domain_pages(int domain, int flind, int pool, int order) +{ + struct vm_freelist *fl; + struct vm_freelist *alt; + int oind, pind; + vm_page_t m; + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); fl = (*vm_phys_lookup_lists[domain][flind])[pool]; for (oind = order; oind < VM_NFREEORDER; oind++) { From owner-svn-src-all@FreeBSD.ORG Fri May 3 19:08:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7108F115; Fri, 3 May 2013 19:08:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 62BC11E95; Fri, 3 May 2013 19:08:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43J8xkB094419; Fri, 3 May 2013 19:08:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43J8xnI094418; Fri, 3 May 2013 19:08:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305031908.r43J8xnI094418@svn.freebsd.org> From: John Baldwin Date: Fri, 3 May 2013 19:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250220 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 19:08:59 -0000 Author: jhb Date: Fri May 3 19:08:58 2013 New Revision: 250220 URL: http://svnweb.freebsd.org/changeset/base/250220 Log: Fix FIONREAD on regular files. The computed result was being ignored and it was being passed down to VOP_IOCTL() where it promptly resulted in ENOTTY due to a missing else for the past 8 years. While here, use a shared vnode lock while fetching the current file's size. MFC after: 1 week Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri May 3 18:58:37 2013 (r250219) +++ head/sys/kern/vfs_vnops.c Fri May 3 19:08:58 2013 (r250220) @@ -1364,13 +1364,12 @@ vn_ioctl(fp, com, data, active_cred, td) case VREG: case VDIR: if (com == FIONREAD) { - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(vp, &vattr, active_cred); VOP_UNLOCK(vp, 0); if (!error) *(int *)data = vattr.va_size - fp->f_offset; - } - if (com == FIONBIO || com == FIOASYNC) /* XXX */ + } else if (com == FIONBIO || com == FIOASYNC) /* XXX */ error = 0; else error = VOP_IOCTL(vp, com, data, fp->f_flag, From owner-svn-src-all@FreeBSD.ORG Fri May 3 19:55:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D1F60A05; Fri, 3 May 2013 19:55:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 793F1109A; Fri, 3 May 2013 19:55:42 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id A8F093592E6; Fri, 3 May 2013 21:55:40 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 844EA28493; Fri, 3 May 2013 21:55:40 +0200 (CEST) Date: Fri, 3 May 2013 21:55:40 +0200 From: Jilles Tjoelker To: Sergey Kandaurov Subject: Re: svn commit: r250215 - stable/9/lib/libc/locale Message-ID: <20130503195540.GA52657@stack.nl> References: <201305031552.r43FqiPN024580@svn.freebsd.org> <5183E899.4000503@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 19:55:42 -0000 On Fri, May 03, 2013 at 09:49:05PM +0400, Sergey Kandaurov wrote: > On 3 May 2013 20:40, Andrey Chernov wrote: > > I don't think this change is optimal (cause slowdown) since you add > > unneeded strlen() in the loop for known-sized elements plus one strlen() > > for tested property, and wctype_l() itself can be called very often, so > > we definitely don't need slowdown here. > > Since most of elements have equal sizes, your len1 == len2 condition > > gains almost nothing for valid calls. > Thanks, you are correct. With this change I got 2-6 times slowdown depending > on the specified wctype. I will look at how it can be optimized. As the original author of this change, I mainly considered programs that do not use wctype(), which gain a reduced memory footprint and rtld load. For programs that do use it, I expect fewer cache misses because there is less pointer chasing. It is certainly right that sh(1) will call wctype() fairly often if a pattern contains a [[:ctype:]] after a *. If the slowness is because of the strlen() calls, the propnames can be constructed like "\5alnum\5alpha"... The slowness could also be because strcmp() is implemented less badly than memcmp(). With the current code, memcmp() can be changed to strcmp(). Some sort of perfect hashing can also be an option, although it makes it harder to add new properties or adds a build dependency on gperf(1) that we would like to get rid of. Sorry, I have not run my own benchmarks yet. > > On 03.05.2013 19:52, Sergey Kandaurov wrote: > >> Modified: stable/9/lib/libc/locale/wctype.c > >> ============================================================================== > >> --- stable/9/lib/libc/locale/wctype.c Fri May 3 15:28:31 2013 (r250214) > >> +++ stable/9/lib/libc/locale/wctype.c Fri May 3 15:52:43 2013 (r250215) > >> @@ -57,35 +57,54 @@ iswctype_l(wint_t wc, wctype_t charclass > >> wctype_t > >> wctype_l(const char *property, locale_t locale) > >> { > >> - static const struct { > >> - const char *name; > >> - wctype_t mask; > >> - } props[] = { > >> - { "alnum", _CTYPE_A|_CTYPE_D }, > >> - { "alpha", _CTYPE_A }, > >> - { "blank", _CTYPE_B }, > >> - { "cntrl", _CTYPE_C }, > >> - { "digit", _CTYPE_D }, > >> - { "graph", _CTYPE_G }, > >> - { "lower", _CTYPE_L }, > >> - { "print", _CTYPE_R }, > >> - { "punct", _CTYPE_P }, > >> - { "space", _CTYPE_S }, > >> - { "upper", _CTYPE_U }, > >> - { "xdigit", _CTYPE_X }, > >> - { "ideogram", _CTYPE_I }, /* BSD extension */ > >> - { "special", _CTYPE_T }, /* BSD extension */ > >> - { "phonogram", _CTYPE_Q }, /* BSD extension */ > >> - { "rune", 0xFFFFFF00L }, /* BSD extension */ > >> - { NULL, 0UL }, /* Default */ > >> + const char *propnames = > >> + "alnum\0" > >> + "alpha\0" > >> + "blank\0" > >> + "cntrl\0" > >> + "digit\0" > >> + "graph\0" > >> + "lower\0" > >> + "print\0" > >> + "punct\0" > >> + "space\0" > >> + "upper\0" > >> + "xdigit\0" > >> + "ideogram\0" /* BSD extension */ > >> + "special\0" /* BSD extension */ > >> + "phonogram\0" /* BSD extension */ > >> + "rune\0"; /* BSD extension */ > >> + static const wctype_t propmasks[] = { > >> + _CTYPE_A|_CTYPE_D, > >> + _CTYPE_A, > >> + _CTYPE_B, > >> + _CTYPE_C, > >> + _CTYPE_D, > >> + _CTYPE_G, > >> + _CTYPE_L, > >> + _CTYPE_R, > >> + _CTYPE_P, > >> + _CTYPE_S, > >> + _CTYPE_U, > >> + _CTYPE_X, > >> + _CTYPE_I, > >> + _CTYPE_T, > >> + _CTYPE_Q, > >> + 0xFFFFFF00L > >> }; > >> - int i; > >> + size_t len1, len2; > >> + const char *p; > >> + const wctype_t *q; > >> > >> - i = 0; > >> - while (props[i].name != NULL && strcmp(props[i].name, property) != 0) > >> - i++; > >> + len1 = strlen(property); > >> + q = propmasks; > >> + for (p = propnames; (len2 = strlen(p)) != 0; p += len2 + 1) { > >> + if (len1 == len2 && memcmp(property, p, len1) == 0) > >> + return (*q); > >> + q++; > >> + } > >> > >> - return (props[i].mask); > >> + return (0UL); > >> } > >> > >> wctype_t wctype(const char *property) -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Fri May 3 20:09:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC4C1C6; Fri, 3 May 2013 20:09:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E1D55113B; Fri, 3 May 2013 20:09:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43K9HNO015643; Fri, 3 May 2013 20:09:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43K9HQM015642; Fri, 3 May 2013 20:09:17 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201305032009.r43K9HQM015642@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 3 May 2013 20:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250221 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:09:18 -0000 Author: np Date: Fri May 3 20:09:17 2013 New Revision: 250221 URL: http://svnweb.freebsd.org/changeset/base/250221 Log: cxgbe: Switch to a better way to install firmware. 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 Fri May 3 19:08:58 2013 (r250220) +++ head/sys/dev/cxgbe/t4_main.c Fri May 3 20:09:17 2013 (r250221) @@ -2037,7 +2037,7 @@ prep_firmware(struct adapter *sc) should_install_kld_fw(sc, card_fw_usable, be32toh(kld_fw->fw_ver), be32toh(card_fw->fw_ver))) { - rc = -t4_load_fw(sc, fw->data, fw->datasize); + rc = -t4_fw_upgrade(sc, sc->mbox, fw->data, fw->datasize, 0); if (rc != 0) { device_printf(sc->dev, "failed to install firmware: %d\n", rc); From owner-svn-src-all@FreeBSD.ORG Fri May 3 20:35:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 04A42E07; Fri, 3 May 2013 20:35:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6F36612B8; Fri, 3 May 2013 20:35:49 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r43KZfUB000628; Fri, 3 May 2013 23:35:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r43KZfUB000628 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r43KZflx000627; Fri, 3 May 2013 23:35:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 3 May 2013 23:35:41 +0300 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r250193 - head/sys/fs/msdosfs Message-ID: <20130503203541.GS3047@kib.kiev.ua> References: <201305022000.r42K0Bdk098965@svn.freebsd.org> <201305031155.47559.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4YkaNtrv9TjfxRWe" Content-Disposition: inline In-Reply-To: <201305031155.47559.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:35:50 -0000 --4YkaNtrv9TjfxRWe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 03, 2013 at 11:55:47AM -0400, John Baldwin wrote: > On Thursday, May 02, 2013 4:00:11 pm Konstantin Belousov wrote: > > Author: kib > > Date: Thu May 2 20:00:11 2013 > > New Revision: 250193 > > URL: http://svnweb.freebsd.org/changeset/base/250193 > >=20 > > Log: > > The fsync(2) call should sync the vnode in such way that even after > > system crash which happen after successfull fsync() return, the data > > is accessible. For msdosfs, this means that FAT entries for the file > > must be written. > > =20 > > Since we do not track the FAT blocks containing entries for the > > current file, just do a sloppy sync of the devvp vnode for the mount, > > which buffers, among other things, contain FAT blocks. =2E.. > Does this fix kern/62762? >=20 Supposedly yes, I even possibly have seen this PR before. At least, it is understandable why do you remember about it now. I definitely do not want to take the approach of precisely calculating the list of FAT blocks which needs to be synced. --4YkaNtrv9TjfxRWe Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRhB+cAAoJEJDCuSvBvK1BvD8P/Rww9IT+1xhgWqaLRdEix/TW LtOU7gVduHTu2u0V7IQ1I7Eh8sa12+TgGGAM5a48oe9HoZrefMRDXiOZyJtuXTkR UZWDvTMS8XbDMH7jBpkr7KPwwMLls4ab/9FZ2aj2yi0FaYm6YfwKi0bglw4LsxOt sOvafc34kw3WhKgGAeaoagVUXRyHIrC6JbkjolSi/dE44pwpjd13/WacSE4ZXBAj 7nk3+koUCrSDoGyJePHvYNr5u8wE+5LPYrGpL5HG3XA+35G2wiAcVv0DSM+HmxXf C8d2se7IGwkWmOwqyxLBYdGXYAtf2M6VlgYwMK7kC/siprV7OhAJ/MN5i2FYVShZ JcN6IkacgqKzC2ER38I4FYrYrXYGvpu9bkxXbLpAwwccnaWMIkyMWkMqChZOPDvJ OI0XTOEHv+8xJGdDyJQnLr2i6lj86L6BBKyx3rL9c6BLppvJRfmxgu3A09W7vQh9 MSGgISgdFMHNHqlN7UD7EOS8lpQPmErTyPp34/7rpRCYGnynWOjzWSA9GS2kuqi8 wB8p+UywJ9RS9Hgq3kYSb202/4s7MfgQQs91ePLuPEg1oH2OCZsU049lBOw/gvJI LdTklxD8qEwQEmyoNHh5exFYcCupbpAvTC30LD3kx79DXDfSa2w9hEakKmazrsvu XmhdIpQ4havDnFuXao3Q =RkOO -----END PGP SIGNATURE----- --4YkaNtrv9TjfxRWe-- From owner-svn-src-all@FreeBSD.ORG Fri May 3 20:39:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 80B4D2DB; Fri, 3 May 2013 20:39:54 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 590D112ED; Fri, 3 May 2013 20:39:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43Kdsa8026588; Fri, 3 May 2013 20:39:54 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43KdsZp026587; Fri, 3 May 2013 20:39:54 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305032039.r43KdsZp026587@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 3 May 2013 20:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250222 - head/tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:39:54 -0000 Author: jilles Date: Fri May 3 20:39:53 2013 New Revision: 250222 URL: http://svnweb.freebsd.org/changeset/base/250222 Log: sh: Remove racy test case for read builtin. This test case sometimes fails because of an EINTR-related race condition. Fixing this race condition likely requires an extra system call per byte, which would make the read builtin even slower than it already is, or very complicated trickery. Therefore, remove the test case for now. Deleted: head/tools/regression/bin/sh/builtins/read8.0 From owner-svn-src-all@FreeBSD.ORG Fri May 3 20:48:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 859B4ED0; Fri, 3 May 2013 20:48:40 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 7926F136D; Fri, 3 May 2013 20:48:39 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id hq12so1121157wib.5 for ; Fri, 03 May 2013 13:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=3XogMX/q2KUQF44N3E9Auwt27FvBpe6T6vwz4sRgrQE=; b=cwZsTPiDBjG3eydxRKrBU/W/vzhs9DFINMGL0gUIgOX47Xi9ccjOro5y13pjI2I5ZW sgX0NuORjvppOCX3WJd3V8C8obTVVkubiyHFilZ/rE9FVAB0XBs0dzB/ZhsY3hdQjbLz x2M55f7crLJ1G4fdxROL2IZgibezYXL/DkFXFWlTgeUDr34cIc93QNAHOcnUkXXA4l+I LE58lt8lbF2boex/FxgM3hXesJOnquaPAq5u25BsEOtultdW8yikxVbEDdIKm2gCHkqV L3wFBRUD5yWlzKnBXr4tJdG5bhZ3ygjtOzH3VvyawNjt+W+HhW5qFFMf+A4XnTbJMhhN IS8Q== MIME-Version: 1.0 X-Received: by 10.194.92.231 with SMTP id cp7mr16030959wjb.3.1367614118676; Fri, 03 May 2013 13:48:38 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.194.29.199 with HTTP; Fri, 3 May 2013 13:48:38 -0700 (PDT) In-Reply-To: <20130503195540.GA52657@stack.nl> References: <201305031552.r43FqiPN024580@svn.freebsd.org> <5183E899.4000503@freebsd.org> <20130503195540.GA52657@stack.nl> Date: Sat, 4 May 2013 00:48:38 +0400 X-Google-Sender-Auth: StXQvw9ial6WGk3GnWKPyi32r_A Message-ID: Subject: Re: svn commit: r250215 - stable/9/lib/libc/locale From: Sergey Kandaurov To: Jilles Tjoelker Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:48:40 -0000 On 3 May 2013 23:55, Jilles Tjoelker wrote: > On Fri, May 03, 2013 at 09:49:05PM +0400, Sergey Kandaurov wrote: >> On 3 May 2013 20:40, Andrey Chernov wrote: >> > I don't think this change is optimal (cause slowdown) since you add >> > unneeded strlen() in the loop for known-sized elements plus one strlen() >> > for tested property, and wctype_l() itself can be called very often, so >> > we definitely don't need slowdown here. >> > Since most of elements have equal sizes, your len1 == len2 condition >> > gains almost nothing for valid calls. > >> Thanks, you are correct. With this change I got 2-6 times slowdown depending >> on the specified wctype. I will look at how it can be optimized. > > As the original author of this change, I mainly considered programs that > do not use wctype(), which gain a reduced memory footprint and rtld > load. For programs that do use it, I expect fewer cache misses because > there is less pointer chasing. > > It is certainly right that sh(1) will call wctype() fairly often if a > pattern contains a [[:ctype:]] after a *. > > If the slowness is because of the strlen() calls, the propnames can be > constructed like "\5alnum\5alpha"... > > The slowness could also be because strcmp() is implemented less badly > than memcmp(). With the current code, memcmp() can be changed to > strcmp(). > > Some sort of perfect hashing can also be an option, although it makes it > harder to add new properties or adds a build dependency on gperf(1) that > we would like to get rid of. > > Sorry, I have not run my own benchmarks yet. I hacked a bit on wctype. Speaking about speed, it shows about 1-3.5x improvement over the previous fast version (before r250215). Time spend for 2097152 wctype() calls for each of wctype property current previous mine alnum 0.090554676 0.035821210 0.033270579 alpha 0.172074310 0.052461036 0.044916572 blank 0.261109989 0.055735281 0.036682745 cntrl 0.357318986 0.069249831 0.038292782 digit 0.436381530 0.094194364 0.039249005 graph 0.540954812 0.085580099 0.043331460 lower 0.618306476 0.095665215 0.044070399 print 0.707443135 0.132559305 0.048216097 punct 0.788922052 0.142809109 0.062871432 space 0.888263108 0.150516644 0.054086142 upper 0.966903461 0.173593592 0.054027834 xdigit 0.406611275 0.201614227 0.060695939 ideogram 0.439763499 0.239640723 0.068566486 special 0.523128094 0.249156298 0.099278051 phonogram 0.564975870 0.260972651 0.135751471 rune 0.637392247 0.235195497 0.064093971 Index: locale/wctype.c =================================================================== --- locale/wctype.c (revision 250217) +++ locale/wctype.c (working copy) @@ -74,6 +74,9 @@ "special\0" /* BSD extension */ "phonogram\0" /* BSD extension */ "rune\0"; /* BSD extension */ + static const size_t propnamlen[] = { + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 8, 7, 9, 4, 0 + }; static const wctype_t propmasks[] = { _CTYPE_A|_CTYPE_D, _CTYPE_A, @@ -92,16 +95,17 @@ _CTYPE_Q, 0xFFFFFF00L }; - size_t len1, len2; + const size_t *len2; const char *p; const wctype_t *q; - len1 = strlen(property); q = propmasks; - for (p = propnames; (len2 = strlen(p)) != 0; p += len2 + 1) { - if (len1 == len2 && memcmp(property, p, len1) == 0) + len2 = propnamlen; + for (p = propnames; *len2 != 0; ) { + if (property[0] == p[0] && strcmp(property, p) == 0) return (*q); - q++; + p += *len2 + 1; + q++; len2++; } return (0UL); -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri May 3 20:54:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B92CA4B0; Fri, 3 May 2013 20:54:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 97B9613B9; Fri, 3 May 2013 20:54:51 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DB876B939; Fri, 3 May 2013 16:54:50 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r250219 - head/sys/vm Date: Fri, 3 May 2013 16:47:11 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305031858.r43IwcAv090426@svn.freebsd.org> In-Reply-To: <201305031858.r43IwcAv090426@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305031647.11408.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 03 May 2013 16:54:51 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:54:51 -0000 On Friday, May 03, 2013 2:58:38 pm John Baldwin wrote: > Author: jhb > Date: Fri May 3 18:58:37 2013 > New Revision: 250219 > URL: http://svnweb.freebsd.org/changeset/base/250219 > > Log: > Fix two bugs in the current NUMA-aware allocation code: > - vm_phys_alloc_freelist_pages() can be called by vm_page_alloc_freelist() > to allocate a page from a specific freelist. In the NUMA case it did not > properly map the public VM_FREELIST_* constants to the correct backing > freelists, nor did it try all NUMA domains for allocations from > VM_FREELIST_DEFAULT. In practice this should never occur as only mips uses this function and the mips code doesn't support multiple domains yet. > - vm_phys_alloc_pages() did not pin the thread and each call to > vm_phys_alloc_freelist_pages() fetched the current domain to choose > which freelist to use. If a thread migrated domains during the loop > in vm_phys_alloc_pages() it could skip one of the freelists. If the > other freelists were out of memory then it is possible that > vm_phys_alloc_pages() would fail to allocate a page even though pages > were available resulting in a panic in vm_page_alloc(). I have seen multiple instances of this panic in production loads however. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri May 3 20:54:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8D9BC4B2; Fri, 3 May 2013 20:54:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6A4A613BA; Fri, 3 May 2013 20:54:54 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 914E8B945; Fri, 3 May 2013 16:54:53 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r250193 - head/sys/fs/msdosfs Date: Fri, 3 May 2013 16:50:12 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305022000.r42K0Bdk098965@svn.freebsd.org> <201305031155.47559.jhb@freebsd.org> <20130503203541.GS3047@kib.kiev.ua> In-Reply-To: <20130503203541.GS3047@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201305031650.12397.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 03 May 2013 16:54:53 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:54:54 -0000 On Friday, May 03, 2013 4:35:41 pm Konstantin Belousov wrote: > On Fri, May 03, 2013 at 11:55:47AM -0400, John Baldwin wrote: > > On Thursday, May 02, 2013 4:00:11 pm Konstantin Belousov wrote: > > > Author: kib > > > Date: Thu May 2 20:00:11 2013 > > > New Revision: 250193 > > > URL: http://svnweb.freebsd.org/changeset/base/250193 > > > > > > Log: > > > The fsync(2) call should sync the vnode in such way that even after > > > system crash which happen after successfull fsync() return, the data > > > is accessible. For msdosfs, this means that FAT entries for the file > > > must be written. > > > > > > Since we do not track the FAT blocks containing entries for the > > > current file, just do a sloppy sync of the devvp vnode for the mount, > > > which buffers, among other things, contain FAT blocks. > ... > > > Does this fix kern/62762? > > > > Supposedly yes, I even possibly have seen this PR before. > At least, it is understandable why do you remember about it now. > > I definitely do not want to take the approach of precisely calculating > the list of FAT blocks which needs to be synced. No, that seems too painful. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri May 3 21:11:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A92B58B9; Fri, 3 May 2013 21:11:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9AB63151E; Fri, 3 May 2013 21:11:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43LBxZx040522; Fri, 3 May 2013 21:11:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43LBvZ3040508; Fri, 3 May 2013 21:11:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305032111.r43LBvZ3040508@svn.freebsd.org> From: John Baldwin Date: Fri, 3 May 2013 21:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250223 - in head: lib/libprocstat sys/kern sys/sys usr.bin/fstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 21:11:59 -0000 Author: jhb Date: Fri May 3 21:11:57 2013 New Revision: 250223 URL: http://svnweb.freebsd.org/changeset/base/250223 Log: Similar to 233760 and 236717, export some more useful info about the kernel-based POSIX semaphore descriptors to userland via procstat(1) and fstat(1): - Change sem file descriptors to track the pathname they are associated with and add a ksem_info() method to copy the path out to a caller-supplied buffer. - Use the fo_stat() method of shared memory objects and ksem_info() to export the path, mode, and value of a semaphore via struct kinfo_file. - Add a struct semstat to the libprocstat(3) interface along with a procstat_get_sem_info() to export the mode and value of a semaphore. - Teach fstat about semaphores and to display their path, mode, and value. MFC after: 2 weeks Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h head/sys/kern/kern_descrip.c head/sys/kern/uipc_sem.c head/sys/sys/ksem.h head/sys/sys/user.h head/usr.bin/fstat/fstat.1 head/usr.bin/fstat/fstat.c Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Fri May 3 20:39:53 2013 (r250222) +++ head/lib/libprocstat/Symbol.map Fri May 3 21:11:57 2013 (r250223) @@ -22,6 +22,7 @@ FBSD_1.3 { procstat_freegroups; procstat_freekstack; procstat_freevmmap; + procstat_get_sem_info; procstat_get_shm_info; procstat_getargv; procstat_getauxv; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Fri May 3 20:39:53 2013 (r250222) +++ head/lib/libprocstat/libprocstat.3 Fri May 3 21:11:57 2013 (r250223) @@ -53,6 +53,7 @@ .Nm procstat_freevmmap , .Nm procstat_get_pipe_info , .Nm procstat_get_pts_info , +.Nm procstat_get_sem_info , .Nm procstat_get_shm_info , .Nm procstat_get_socket_info , .Nm procstat_get_vnode_info @@ -115,6 +116,13 @@ .Fa "char *errbuf" .Fc .Ft int +.Fo procstat_get_sem_info +.Fa "struct procstat *procstat" +.Fa "struct filestat *fst" +.Fa "struct semstat *sem" +.Fa "char *errbuf" +.Fc +.Ft int .Fo procstat_get_shm_info .Fa "struct procstat *procstat" .Fa "struct filestat *fst" @@ -463,12 +471,13 @@ function call. The .Fn procstat_get_pipe_info , .Fn procstat_get_pts_info , +.Fn procstat_get_sem_info , .Fn procstat_get_shm_info , .Fn procstat_get_socket_info and .Fn procstat_get_vnode_info functions are used to retrieve information about pipes, pseudo-terminals, -shared memory objects, +semaphores, shared memory objects, sockets, and vnodes, respectively. Each of them have a similar interface API. The @@ -505,6 +514,8 @@ argument indicates an actual error messa .Nm procstat_get_pipe_info .It Li PS_FST_TYPE_PTS .Nm procstat_get_pts_info +.It Li PS_FST_TYPE_SEM +.Nm procstat_get_sem_info .It Li PS_FST_TYPE_SHM .Nm procstat_get_shm_info .El @@ -517,6 +528,7 @@ argument indicates an actual error messa .Xr elf 3 , .Xr kvm 3 , .Xr queue 3 , +.Xr sem_open 3 , .Xr sysctl 3 , .Xr pts 4 , .Xr core 5 , Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Fri May 3 20:39:53 2013 (r250222) +++ head/lib/libprocstat/libprocstat.c Fri May 3 21:11:57 2013 (r250223) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define _WANT_FILE #include #include +#include #include #define _KERNEL #include @@ -129,6 +130,10 @@ static int procstat_get_pts_info_sysctl( struct ptsstat *pts, char *errbuf); static int procstat_get_pts_info_kvm(kvm_t *kd, struct filestat *fst, struct ptsstat *pts, char *errbuf); +static int procstat_get_sem_info_sysctl(struct filestat *fst, + struct semstat *sem, char *errbuf); +static int procstat_get_sem_info_kvm(kvm_t *kd, struct filestat *fst, + struct semstat *sem, char *errbuf); static int procstat_get_shm_info_sysctl(struct filestat *fst, struct shmstat *shm, char *errbuf); static int procstat_get_shm_info_kvm(kvm_t *kd, struct filestat *fst, @@ -556,6 +561,10 @@ procstat_getfiles_kvm(struct procstat *p data = file.f_data; break; #endif + case DTYPE_SEM: + type = PS_FST_TYPE_SEM; + data = file.f_data; + break; case DTYPE_SHM: type = PS_FST_TYPE_SHM; data = file.f_data; @@ -1003,6 +1012,87 @@ procstat_get_pts_info_sysctl(struct file } int +procstat_get_sem_info(struct procstat *procstat, struct filestat *fst, + struct semstat *sem, char *errbuf) +{ + + assert(sem); + if (procstat->type == PROCSTAT_KVM) { + return (procstat_get_sem_info_kvm(procstat->kd, fst, sem, + errbuf)); + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { + return (procstat_get_sem_info_sysctl(fst, sem, errbuf)); + } else { + warnx("unknown access method: %d", procstat->type); + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + return (1); + } +} + +static int +procstat_get_sem_info_kvm(kvm_t *kd, struct filestat *fst, + struct semstat *sem, char *errbuf) +{ + struct ksem ksem; + void *ksemp; + char *path; + int i; + + assert(kd); + assert(sem); + assert(fst); + bzero(sem, sizeof(*sem)); + ksemp = fst->fs_typedep; + if (ksemp == NULL) + goto fail; + if (!kvm_read_all(kd, (unsigned long)ksemp, &ksem, + sizeof(struct ksem))) { + warnx("can't read ksem at %p", (void *)ksemp); + goto fail; + } + sem->mode = S_IFREG | ksem.ks_mode; + sem->value = ksem.ks_value; + if (fst->fs_path == NULL && ksem.ks_path != NULL) { + path = malloc(MAXPATHLEN); + for (i = 0; i < MAXPATHLEN - 1; i++) { + if (!kvm_read_all(kd, (unsigned long)ksem.ks_path + i, + path + i, 1)) + break; + if (path[i] == '\0') + break; + } + path[i] = '\0'; + if (i == 0) + free(path); + else + fst->fs_path = path; + } + return (0); + +fail: + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + return (1); +} + +static int +procstat_get_sem_info_sysctl(struct filestat *fst, struct semstat *sem, + char *errbuf __unused) +{ + struct kinfo_file *kif; + + assert(sem); + assert(fst); + bzero(sem, sizeof(*sem)); + kif = fst->fs_typedep; + if (kif == NULL) + return (0); + sem->value = kif->kf_un.kf_sem.kf_sem_value; + sem->mode = kif->kf_un.kf_sem.kf_sem_mode; + return (0); +} + +int procstat_get_shm_info(struct procstat *procstat, struct filestat *fst, struct shmstat *shm, char *errbuf) { Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Fri May 3 20:39:53 2013 (r250222) +++ head/lib/libprocstat/libprocstat.h Fri May 3 21:11:57 2013 (r250223) @@ -133,6 +133,10 @@ struct pipestat { uint64_t addr; uint64_t peer; }; +struct semstat { + uint32_t value; + uint16_t mode; +}; struct shmstat { uint64_t size; uint16_t mode; @@ -177,6 +181,8 @@ int procstat_get_pipe_info(struct procst struct pipestat *pipe, char *errbuf); int procstat_get_pts_info(struct procstat *procstat, struct filestat *fst, struct ptsstat *pts, char *errbuf); +int procstat_get_sem_info(struct procstat *procstat, struct filestat *fst, + struct semstat *sem, char *errbuf); int procstat_get_shm_info(struct procstat *procstat, struct filestat *fst, struct shmstat *shm, char *errbuf); int procstat_get_socket_info(struct procstat *procstat, struct filestat *fst, Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri May 3 20:39:53 2013 (r250222) +++ head/sys/kern/kern_descrip.c Fri May 3 21:11:57 2013 (r250223) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -111,6 +112,7 @@ MALLOC_DECLARE(M_FADVISE); static uma_zone_t file_zone; +void (*ksem_info)(struct ksem *ks, char *path, size_t size, uint32_t *value); static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); @@ -123,6 +125,7 @@ static int fill_pipe_info(struct pipe *p static int fill_procdesc_info(struct procdesc *pdp, struct kinfo_file *kif); static int fill_pts_info(struct tty *tp, struct kinfo_file *kif); +static int fill_sem_info(struct file *fp, struct kinfo_file *kif); static int fill_shm_info(struct file *fp, struct kinfo_file *kif); static int fill_socket_info(struct socket *so, struct kinfo_file *kif); static int fill_vnode_info(struct vnode *vp, struct kinfo_file *kif); @@ -2968,6 +2971,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE struct shmfd *shmfd; struct socket *so; struct vnode *vp; + struct ksem *ks; struct file *fp; struct proc *p; struct tty *tp; @@ -2996,6 +3000,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE continue; bzero(kif, sizeof(*kif)); kif->kf_structsize = sizeof(*kif); + ks = NULL; vp = NULL; so = NULL; tp = NULL; @@ -3041,6 +3046,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE case DTYPE_SEM: kif->kf_type = KF_TYPE_SEM; + ks = fp->f_data; break; case DTYPE_PTS: @@ -3150,6 +3156,8 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE } if (shmfd != NULL) shm_path(shmfd, kif->kf_path, sizeof(kif->kf_path)); + if (ks != NULL && ksem_info != NULL) + ksem_info(ks, kif->kf_path, sizeof(kif->kf_path), NULL); error = SYSCTL_OUT(req, kif, sizeof(*kif)); if (error) break; @@ -3220,6 +3228,9 @@ export_fd_to_sb(void *data, int type, in case KF_TYPE_PROCDESC: error = fill_procdesc_info((struct procdesc *)data, kif); break; + case KF_TYPE_SEM: + error = fill_sem_info((struct file *)data, kif); + break; case KF_TYPE_SHM: error = fill_shm_info((struct file *)data, kif); break; @@ -3387,6 +3398,7 @@ kern_proc_filedesc_out(struct proc *p, case DTYPE_SEM: type = KF_TYPE_SEM; + data = fp; break; case DTYPE_PTS: @@ -3621,6 +3633,25 @@ fill_procdesc_info(struct procdesc *pdp, } static int +fill_sem_info(struct file *fp, struct kinfo_file *kif) +{ + struct thread *td; + struct stat sb; + + td = curthread; + if (fp->f_data == NULL) + return (1); + if (fo_stat(fp, &sb, td->td_ucred, td) != 0) + return (1); + if (ksem_info == NULL) + return (1); + ksem_info(fp->f_data, kif->kf_path, sizeof(kif->kf_path), + &kif->kf_un.kf_sem.kf_sem_value); + kif->kf_un.kf_sem.kf_sem_mode = sb.st_mode; + return (0); +} + +static int fill_shm_info(struct file *fp, struct kinfo_file *kif) { struct thread *td; Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Fri May 3 20:39:53 2013 (r250222) +++ head/sys/kern/uipc_sem.c Fri May 3 21:11:57 2013 (r250223) @@ -71,7 +71,6 @@ FEATURE(p1003_1b_semaphores, "POSIX P100 * TODO * * - Resource limits? - * - Update fstat(1) * - Replace global sem_lock with mtx_pool locks? * - Add a MAC check_create() hook for creating new named semaphores. */ @@ -407,6 +406,7 @@ ksem_insert(char *path, Fnv32_t fnv, str map->km_path = path; map->km_fnv = fnv; map->km_ksem = ksem_hold(ks); + ks->ks_path = path; LIST_INSERT_HEAD(KSEM_HASH(fnv), map, km_link); } @@ -428,6 +428,7 @@ ksem_remove(char *path, Fnv32_t fnv, str error = ksem_access(map->km_ksem, ucred); if (error) return (error); + map->km_ksem->ks_path = NULL; LIST_REMOVE(map, km_link); ksem_drop(map->km_ksem); free(map->km_path, M_KSEM); @@ -439,6 +440,20 @@ ksem_remove(char *path, Fnv32_t fnv, str return (ENOENT); } +static void +ksem_info_impl(struct ksem *ks, char *path, size_t size, uint32_t *value) +{ + + if (ks->ks_path == NULL) + return; + sx_slock(&ksem_dict_lock); + if (ks->ks_path != NULL) + strlcpy(path, ks->ks_path, size); + if (value != NULL) + *value = ks->ks_value; + sx_sunlock(&ksem_dict_lock); +} + static int ksem_create_copyout_semid(struct thread *td, semid_t *semidp, int fd, int compat32) @@ -1014,6 +1029,7 @@ ksem_module_init(void) p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 200112L); p31b_setcfg(CTL_P1003_1B_SEM_NSEMS_MAX, SEM_MAX); p31b_setcfg(CTL_P1003_1B_SEM_VALUE_MAX, SEM_VALUE_MAX); + ksem_info = ksem_info_impl; error = syscall_helper_register(ksem_syscalls); if (error) @@ -1035,6 +1051,7 @@ ksem_module_destroy(void) #endif syscall_helper_unregister(ksem_syscalls); + ksem_info = NULL; p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 0); hashdestroy(ksem_dictionary, M_KSEM, ksem_hash); sx_destroy(&ksem_dict_lock); Modified: head/sys/sys/ksem.h ============================================================================== --- head/sys/sys/ksem.h Fri May 3 20:39:53 2013 (r250222) +++ head/sys/sys/ksem.h Fri May 3 21:11:57 2013 (r250223) @@ -29,7 +29,7 @@ #ifndef _POSIX4_KSEM_H_ #define _POSIX4_KSEM_H_ -#ifndef _KERNEL +#if !defined(_KERNEL) && !defined(_WANT_FILE) #error "no user-servicable parts inside" #endif @@ -57,9 +57,15 @@ struct ksem { struct timespec ks_birthtime; struct label *ks_label; /* MAC label */ + const char *ks_path; }; #define KS_ANONYMOUS 0x0001 /* Anonymous (unnamed) semaphore. */ #define KS_DEAD 0x0002 /* No new waiters allowed. */ +#ifdef _KERNEL +extern void (*ksem_info)(struct ksem *ks, char *path, size_t size, + uint32_t *value); +#endif + #endif /* !_POSIX4_KSEM_H_ */ Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Fri May 3 20:39:53 2013 (r250222) +++ head/sys/sys/user.h Fri May 3 21:11:57 2013 (r250223) @@ -365,6 +365,10 @@ struct kinfo_file { uint32_t kf_file_pad1; } kf_file; struct { + uint32_t kf_sem_value; + uint16_t kf_sem_mode; + } kf_sem; + struct { uint64_t kf_pipe_addr; uint64_t kf_pipe_peer; uint32_t kf_pipe_buffer_cnt; Modified: head/usr.bin/fstat/fstat.1 ============================================================================== --- head/usr.bin/fstat/fstat.1 Fri May 3 20:39:53 2013 (r250222) +++ head/usr.bin/fstat/fstat.1 Fri May 3 21:11:57 2013 (r250223) @@ -155,6 +155,8 @@ using a symbolic format (see otherwise, the mode is printed as an octal number. .It Li SZ\&|DV +If the file is a semaphore, +prints the current value of the semaphore. If the file is not a character or block special, prints the size of the file in bytes. Otherwise, if the Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Fri May 3 20:39:53 2013 (r250222) +++ head/usr.bin/fstat/fstat.c Fri May 3 21:11:57 2013 (r250223) @@ -84,6 +84,8 @@ static void print_pipe_info(struct procs struct filestat *fst); static void print_pts_info(struct procstat *procstat, struct filestat *fst); +static void print_sem_info(struct procstat *procstat, + struct filestat *fst); static void print_shm_info(struct procstat *procstat, struct filestat *fst); static void print_socket_info(struct procstat *procstat, @@ -294,6 +296,9 @@ print_file_info(struct procstat *procsta case PS_FST_TYPE_SHM: print_shm_info(procstat, fst); break; + case PS_FST_TYPE_SEM: + print_sem_info(procstat, fst); + break; default: if (vflg) fprintf(stderr, @@ -424,6 +429,30 @@ print_pts_info(struct procstat *procstat } static void +print_sem_info(struct procstat *procstat, struct filestat *fst) +{ + struct semstat sem; + char errbuf[_POSIX2_LINE_MAX]; + char mode[15]; + int error; + + error = procstat_get_sem_info(procstat, fst, &sem, errbuf); + if (error != 0) { + printf("* error"); + return; + } + if (nflg) { + printf(" "); + (void)snprintf(mode, sizeof(mode), "%o", sem.mode); + } else { + printf(" %-15s", fst->fs_path != NULL ? fst->fs_path : "-"); + strmode(sem.mode, mode); + } + printf(" %10s %6u", mode, sem.value); + print_access_flags(fst->fs_fflags); +} + +static void print_shm_info(struct procstat *procstat, struct filestat *fst) { struct shmstat shm; From owner-svn-src-all@FreeBSD.ORG Fri May 3 21:17:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9D8EB73; Fri, 3 May 2013 21:17:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id C8A7F1563; Fri, 3 May 2013 21:17:33 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1F2A1B939; Fri, 3 May 2013 17:17:33 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r250223 - in head: lib/libprocstat sys/kern sys/sys usr.bin/fstat Date: Fri, 3 May 2013 17:17:13 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305032111.r43LBvZ3040508@svn.freebsd.org> In-Reply-To: <201305032111.r43LBvZ3040508@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305031717.13612.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 03 May 2013 17:17:33 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 21:17:34 -0000 On Friday, May 03, 2013 5:11:57 pm John Baldwin wrote: > Author: jhb > Date: Fri May 3 21:11:57 2013 > New Revision: 250223 > URL: http://svnweb.freebsd.org/changeset/base/250223 > > Log: > Similar to 233760 and 236717, export some more useful info about the > kernel-based POSIX semaphore descriptors to userland via procstat(1) and > fstat(1): > - Change sem file descriptors to track the pathname they are associated > with and add a ksem_info() method to copy the path out to a > caller-supplied buffer. > - Use the fo_stat() method of shared memory objects and ksem_info() to > export the path, mode, and value of a semaphore via struct kinfo_file. > - Add a struct semstat to the libprocstat(3) interface along with a > procstat_get_sem_info() to export the mode and value of a semaphore. > - Teach fstat about semaphores and to display their path, mode, and value. > > MFC after: 2 weeks I do realize that the POSIX semaphore API only uses these descriptors for 8.x and earlier, but this is still useful info if you are using 8.x (where I will MFC this), or if you are using an 8.x world or chroot with a newer kernel. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri May 3 22:17:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6D43EE7F for ; Fri, 3 May 2013 22:17:43 +0000 (UTC) (envelope-from darren780@yahoo.com) Received: from nm22-vm2.bullet.mail.ne1.yahoo.com (nm22-vm2.bullet.mail.ne1.yahoo.com [98.138.91.210]) by mx1.freebsd.org (Postfix) with ESMTP id 0D12A1821 for ; Fri, 3 May 2013 22:17:42 +0000 (UTC) Received: from [98.138.90.57] by nm22.bullet.mail.ne1.yahoo.com with NNFMP; 03 May 2013 22:14:50 -0000 Received: from [98.138.87.10] by tm10.bullet.mail.ne1.yahoo.com with NNFMP; 03 May 2013 22:14:50 -0000 Received: from [127.0.0.1] by omp1010.mail.ne1.yahoo.com with NNFMP; 03 May 2013 22:14:50 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 225256.75099.bm@omp1010.mail.ne1.yahoo.com Received: (qmail 40466 invoked by uid 60001); 3 May 2013 22:14:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1367619290; bh=AUGlXfNScDeRCStGpR5gjSw7Xapa0lq84IS6Nn7kZcM=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=ySLkw3YUbFBmC2x1MNQDONfDaPX6o2DVBMvS2N4fZOkYEZtqVTxRl2KFFBdlUQjaHwYh0HlMhBupQJSGY3dlty0muux4ZTzXwIEjtZamDCEOXZBVjcGXgSsbPTvH79ZZ7keOkDKrACDEsK0agufToavKY3vwlVj0mFsHwRtlojE= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=L1jd2veublm8OMBqSlhOSQw9xIfDl9WXfBQ3q4X1SiqUEYLtggflUC9pNiqImPrq/JyUy/W2HadBvN7/Wad5f36FX8PhgRMq/Tw6oEM6hVFPwfhKnoISnSb4FCxiKY9MmTF4z38e90CV4fZPw3/AAns1S/EMnmdS3JLt7zqjHi8=; X-YMail-OSG: fdX0kBUVM1nE58d0qUgV8fcU0RGLkMrV1zrWcDQ4PmlOho3 AXkAVScwsDD9G_q3jHyZuWozMWElfgyyEIREGnZtfsW7GIKKi_Tnfb0hHgwO OTfsk09iz95TmC2H8ng5WoxjZAimD4XuFihcmFi0G19cFtfYVTny9ptHHDeg 3kCZfjvK4.W572Q.3KzgSpgnHpFYZ_I2PvzmF9KajDQFT0Wlts1wbRwR34gZ ysCX6WFSLIUCdvKYcnGJa4dUllPhMXUaEC18PZnguXLz1MuxKwLRYPKhzBDP p434NiMnnIhyx_bSgibgv1t4b86Fb1G8eJ786tQegKHdphf3h5QPsBrBUB3j OgvznTslxHNnYGH4Iq4_v257NW_CIdtvjp6s3dK8gMvyM4fD8OukO4HMEdya lfOQlHGUuUI7R8SXwrkJaPGICtm4zTE1hsVbVcX_NKoGmv8AEUfb3V6Sxvws KcX180qUonEgDrPwhl_7Rf7WCe86XYQV5iU3_.J59v5NQrVQ1aMle5Fe9dVf lYFBcjrQP1ZtaT4vsAeEHRnlJKO57RaTbvwUI4WLasO.GLzAxoOet4pOQi.z KFgz5zjY9x0QMH_6hFrJVum2L1TV_XsHBF2_5.nStOO5Xxt_ad0C0jX3SjTM 3un2a_DLV.r1T2ztVm6J5UXgUlQPWOI5_obRlXQCQ8480uEvk9d556Q-- Received: from [174.3.151.166] by web121406.mail.ne1.yahoo.com via HTTP; Fri, 03 May 2013 15:14:50 PDT X-Rocket-MIMEInfo: 002.001, CgpJJ3ZlIGJlZW4gdHJ5aW5nIHRvIGZvbGxvdyB0aGUgaW5zdHJ1Y3Rpb25zIGF0IGh0dHA6Ly93d3cuZnJlZWJzZC5vcmcvZG9jL2VuL2Jvb2tzLy4uLmJsdWV0b290aC5odG1sIGhvd2V2ZXIgSSBhbSBqdXN0IG5vdCBnZXR0aW5nIHRoZSBzYW1lIHJlc3VsdHMuCgpCQ00yMDcwMkEwIGlzIHN1cHBvcnRlZCBhcyBJIGZvdW5kIGl0IG1lbnRpb25lZCBpbiB0aGUgbmdfdWJ0LmMgZHJpdmVyLgoKCgovKiBCcm9hZGNvbSBVU0IgZG9uZ2xlcywgbW9zdGx5IEJDTTIwNzAyIGFuZCBCQ00yMDcwMkEwICovIHsgVVMBMAEBAQE- X-Mailer: YahooMailWebService/0.8.141.536 References: <1367610956.77651.YahooMailNeo@web121402.mail.ne1.yahoo.com> Message-ID: <1367619290.34225.YahooMailNeo@web121406.mail.ne1.yahoo.com> Date: Fri, 3 May 2013 15:14:50 -0700 (PDT) From: Darren Subject: kern/174707: [PATCH] ng_ubt: Add vendor IDs for Broadcom USB dongles (BCM20702) To: "svn-src-all@freebsd.org" In-Reply-To: <1367610956.77651.YahooMailNeo@web121402.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Darren List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 22:17:43 -0000 =0A=0AI've been trying to follow the instructions at http://www.freebsd.org= /doc/en/books/...bluetooth.html however I am just not getting the same resu= lts.=0A=0ABCM20702A0 is supported as I found it mentioned in the ng_ubt.c d= river.=0A=0A=0A=0A/* Broadcom USB dongles, mostly BCM20702 and BCM20702A0 *= / { USB_VENDOR(USB_VENDOR_BROADCOM), USB_IFACE_CLASS(UICLASS_VENDOR), USB_I= FACE_SUBCLASS(UDSUBCLASS_RF), USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) },=0A};= =0A=0Augen7.2: at usbus7=0Aubt0: on usbus7=0AWARNING: attempt to domain_add(netgraph= ) after domainfinalize()Also no device exists:=0A=0A=0A% cd /dev=0A% ls *bt= *=0Als: No match.=0A%=0A=0A% service bluetooth start ubt0=0A/etc/rc.d/bluet= ooth: ERROR: Unable to setup Bluetooth stack for device ubt0=0A=0AFreeBSD .= ed.shawcable.net 9.1-STABLE FreeBSD 9.1-STABLE #0 r250139: Wed May=A0 1 06:= 32:31 MDT 2013 darren@.ed.shawcable.net:/usr/obj/usr/src/sys/GENERIC=A0 amd= 64=0A=0A# sysctl -a | grep ubt=0Adev.ubt.0.%desc: Broadcom Corp BCM20702A0,= rev 2.00/1.12, addr 2=0Adev.ubt.0.%driver: ubt=0Adev.ubt.0.%location: bus= =3D1 hubaddr=3D1 port=3D7 devaddr=3D2 interface=3D0=0Adev.ubt.0.%pnpinfo: v= endor=3D0x0a5c product=3D0x21e8 devclass=3D0xff devsubclass=3D0x01 sernum= =3D"0002723E8944" release=3D0x0112 mode=3Dhost intclass=3D0xff intsubclass= =3D0x01 intprotocol=3D0x01 =0Adev.ubt.0.%parent: uhub7=0A From owner-svn-src-all@FreeBSD.ORG Fri May 3 22:32:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3164E79F; Fri, 3 May 2013 22:32:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2150B189B; Fri, 3 May 2013 22:32:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43MWsgi070166; Fri, 3 May 2013 22:32:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43MWouj070134; Fri, 3 May 2013 22:32:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305032232.r43MWouj070134@svn.freebsd.org> From: Xin LI Date: Fri, 3 May 2013 22:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250224 - in vendor/libz/dist: . contrib test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 22:32:54 -0000 Author: delphij Date: Fri May 3 22:32:49 2013 New Revision: 250224 URL: http://svnweb.freebsd.org/changeset/base/250224 Log: Vendor import of zlib 1.2.8. Modified: vendor/libz/dist/ChangeLog vendor/libz/dist/README vendor/libz/dist/compress.c vendor/libz/dist/contrib/README.contrib vendor/libz/dist/deflate.c vendor/libz/dist/deflate.h vendor/libz/dist/gzguts.h vendor/libz/dist/gzlib.c vendor/libz/dist/gzread.c vendor/libz/dist/gzwrite.c vendor/libz/dist/infback.c vendor/libz/dist/inffast.c vendor/libz/dist/inflate.c vendor/libz/dist/inftrees.c vendor/libz/dist/test/example.c vendor/libz/dist/test/minigzip.c vendor/libz/dist/trees.c vendor/libz/dist/uncompr.c vendor/libz/dist/zconf.h vendor/libz/dist/zlib.3 vendor/libz/dist/zlib.h vendor/libz/dist/zutil.c vendor/libz/dist/zutil.h Modified: vendor/libz/dist/ChangeLog ============================================================================== --- vendor/libz/dist/ChangeLog Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/ChangeLog Fri May 3 22:32:49 2013 (r250224) @@ -1,6 +1,69 @@ ChangeLog file for zlib +Changes in 1.2.8 (28 Apr 2013) +- Update contrib/minizip/iowin32.c for Windows RT [Vollant] +- Do not force Z_CONST for C++ +- Clean up contrib/vstudio [Ro§] +- Correct spelling error in zlib.h +- Fix mixed line endings in contrib/vstudio + +Changes in 1.2.7.3 (13 Apr 2013) +- Fix version numbers and DLL names in contrib/vstudio/*/zlib.rc + +Changes in 1.2.7.2 (13 Apr 2013) +- Change check for a four-byte type back to hexadecimal +- Fix typo in win32/Makefile.msc +- Add casts in gzwrite.c for pointer differences + +Changes in 1.2.7.1 (24 Mar 2013) +- Replace use of unsafe string functions with snprintf if available +- Avoid including stddef.h on Windows for Z_SOLO compile [Niessink] +- Fix gzgetc undefine when Z_PREFIX set [Turk] +- Eliminate use of mktemp in Makefile (not always available) +- Fix bug in 'F' mode for gzopen() +- Add inflateGetDictionary() function +- Correct comment in deflate.h +- Use _snprintf for snprintf in Microsoft C +- On Darwin, only use /usr/bin/libtool if libtool is not Apple +- Delete "--version" file if created by "ar --version" [Richard G.] +- Fix configure check for veracity of compiler error return codes +- Fix CMake compilation of static lib for MSVC2010 x64 +- Remove unused variable in infback9.c +- Fix argument checks in gzlog_compress() and gzlog_write() +- Clean up the usage of z_const and respect const usage within zlib +- Clean up examples/gzlog.[ch] comparisons of different types +- Avoid shift equal to bits in type (caused endless loop) +- Fix unintialized value bug in gzputc() introduced by const patches +- Fix memory allocation error in examples/zran.c [Nor] +- Fix bug where gzopen(), gzclose() would write an empty file +- Fix bug in gzclose() when gzwrite() runs out of memory +- Check for input buffer malloc failure in examples/gzappend.c +- Add note to contrib/blast to use binary mode in stdio +- Fix comparisons of differently signed integers in contrib/blast +- Check for invalid code length codes in contrib/puff +- Fix serious but very rare decompression bug in inftrees.c +- Update inflateBack() comments, since inflate() can be faster +- Use underscored I/O function names for WINAPI_FAMILY +- Add _tr_flush_bits to the external symbols prefixed by --zprefix +- Add contrib/vstudio/vc10 pre-build step for static only +- Quote --version-script argument in CMakeLists.txt +- Don't specify --version-script on Apple platforms in CMakeLists.txt +- Fix casting error in contrib/testzlib/testzlib.c +- Fix types in contrib/minizip to match result of get_crc_table() +- Simplify contrib/vstudio/vc10 with 'd' suffix +- Add TOP support to win32/Makefile.msc +- Suport i686 and amd64 assembler builds in CMakeLists.txt +- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h +- Add vc11 and vc12 build files to contrib/vstudio +- Add gzvprintf() as an undocumented function in zlib +- Fix configure for Sun shell +- Remove runtime check in configure for four-byte integer type +- Add casts and consts to ease user conversion to C++ +- Add man pages for minizip and miniunzip +- In Makefile uninstall, don't rm if preceding cd fails +- Do not return Z_BUF_ERROR if deflateParam() has nothing to write + Changes in 1.2.7 (2 May 2012) - Replace use of memmove() with a simple copy for portability - Test for existence of strerror Modified: vendor/libz/dist/README ============================================================================== --- vendor/libz/dist/README Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/README Fri May 3 22:32:49 2013 (r250224) @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.7 is a general purpose data compression library. All the code is +zlib 1.2.8 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an ar issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.7 are documented in the file ChangeLog. +The changes made in version 1.2.8 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . @@ -84,7 +84,7 @@ Acknowledgments: Copyright notice: - (C) 1995-2012 Jean-loup Gailly and Mark Adler + (C) 1995-2013 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages Modified: vendor/libz/dist/compress.c ============================================================================== --- vendor/libz/dist/compress.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/compress.c Fri May 3 22:32:49 2013 (r250224) @@ -29,7 +29,7 @@ int ZEXPORT compress2 (dest, destLen, so z_stream stream; int err; - stream.next_in = (Bytef*)source; + stream.next_in = (z_const Bytef *)source; stream.avail_in = (uInt)sourceLen; #ifdef MAXSEG_64K /* Check for source > 64K on 16-bit machine: */ Modified: vendor/libz/dist/contrib/README.contrib ============================================================================== --- vendor/libz/dist/contrib/README.contrib Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/contrib/README.contrib Fri May 3 22:32:49 2013 (r250224) @@ -75,3 +75,4 @@ untgz/ by Pedro A. Aranda Gutierrez vstudio/ by Gilles Vollant Building a minizip-enhanced zlib with Microsoft Visual Studio + Includes vc11 from kreuzerkrieg and vc12 from davispuh Modified: vendor/libz/dist/deflate.c ============================================================================== --- vendor/libz/dist/deflate.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/deflate.c Fri May 3 22:32:49 2013 (r250224) @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.7 Copyright 1995-2012 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -305,7 +305,7 @@ int ZEXPORT deflateInit2_(strm, level, m if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || s->pending_buf == Z_NULL) { s->status = FINISH_STATE; - strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); + strm->msg = ERR_MSG(Z_MEM_ERROR); deflateEnd (strm); return Z_MEM_ERROR; } @@ -329,7 +329,7 @@ int ZEXPORT deflateSetDictionary (strm, uInt str, n; int wrap; unsigned avail; - unsigned char *next; + z_const unsigned char *next; if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL) return Z_STREAM_ERROR; @@ -359,7 +359,7 @@ int ZEXPORT deflateSetDictionary (strm, avail = strm->avail_in; next = strm->next_in; strm->avail_in = dictLength; - strm->next_in = (Bytef *)dictionary; + strm->next_in = (z_const Bytef *)dictionary; fill_window(s); while (s->lookahead >= MIN_MATCH) { str = s->strstart; @@ -513,6 +513,8 @@ int ZEXPORT deflateParams(strm, level, s strm->total_in != 0) { /* Flush the last buffer: */ err = deflate(strm, Z_BLOCK); + if (err == Z_BUF_ERROR && s->pending == 0) + err = Z_OK; } if (s->level != level) { s->level = level; Modified: vendor/libz/dist/deflate.h ============================================================================== --- vendor/libz/dist/deflate.h Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/deflate.h Fri May 3 22:32:49 2013 (r250224) @@ -104,7 +104,7 @@ typedef struct internal_state { int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ gz_headerp gzhead; /* gzip header information to write */ uInt gzindex; /* where in extra, name, or comment */ - Byte method; /* STORED (for zip only) or DEFLATED */ + Byte method; /* can only be DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ /* used by deflate.c: */ Modified: vendor/libz/dist/gzguts.h ============================================================================== --- vendor/libz/dist/gzguts.h Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/gzguts.h Fri May 3 22:32:49 2013 (r250224) @@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -35,6 +35,13 @@ # include #endif +#ifdef WINAPI_FAMILY +# define open _open +# define read _read +# define write _write +# define close _close +#endif + #ifdef NO_DEFLATE /* for compatibility with old definition */ # define NO_GZCOMPRESS #endif @@ -60,7 +67,7 @@ #ifndef HAVE_VSNPRINTF # ifdef MSDOS /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), - but for now we just assume it doesn't. */ + but for now we just assume it doesn't. */ # define NO_vsnprintf # endif # ifdef __TURBOC__ @@ -88,6 +95,14 @@ # endif #endif +/* unlike snprintf (which is required in C99, yet still not supported by + Microsoft more than a decade later!), _snprintf does not guarantee null + termination of the result -- however this is only used in gzlib.c where + the result is assured to fit in the space provided */ +#ifdef _MSC_VER +# define snprintf _snprintf +#endif + #ifndef local # define local static #endif @@ -127,7 +142,8 @@ # define DEF_MEM_LEVEL MAX_MEM_LEVEL #endif -/* default i/o buffer size -- double this for output when reading */ +/* default i/o buffer size -- double this for output when reading (this and + twice this must be able to fit in an unsigned type) */ #define GZBUFSIZE 8192 /* gzip modes, also provide a little integrity check on the passed structure */ Modified: vendor/libz/dist/gzlib.c ============================================================================== --- vendor/libz/dist/gzlib.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/gzlib.c Fri May 3 22:32:49 2013 (r250224) @@ -1,5 +1,5 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004, 2010, 2011, 2012 Mark Adler + * Copyright (C) 2004, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -108,7 +108,7 @@ local gzFile gz_open(path, fd, mode) return NULL; /* allocate gzFile structure to return */ - state = malloc(sizeof(gz_state)); + state = (gz_statep)malloc(sizeof(gz_state)); if (state == NULL) return NULL; state->size = 0; /* no buffers allocated yet */ @@ -162,8 +162,10 @@ local gzFile gz_open(path, fd, mode) break; case 'F': state->strategy = Z_FIXED; + break; case 'T': state->direct = 1; + break; default: /* could consider as an error, but just ignore */ ; } @@ -194,8 +196,8 @@ local gzFile gz_open(path, fd, mode) } else #endif - len = strlen(path); - state->path = malloc(len + 1); + len = strlen((const char *)path); + state->path = (char *)malloc(len + 1); if (state->path == NULL) { free(state); return NULL; @@ -208,7 +210,11 @@ local gzFile gz_open(path, fd, mode) *(state->path) = 0; else #endif +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(state->path, len + 1, "%s", (const char *)path); +#else strcpy(state->path, path); +#endif /* compute the flags for open() */ oflag = @@ -236,7 +242,7 @@ local gzFile gz_open(path, fd, mode) #ifdef _WIN32 fd == -2 ? _wopen(path, oflag, 0666) : #endif - open(path, oflag, 0666)); + open((const char *)path, oflag, 0666)); if (state->fd == -1) { free(state->path); free(state); @@ -282,9 +288,13 @@ gzFile ZEXPORT gzdopen(fd, mode) char *path; /* identifier for error messages */ gzFile gz; - if (fd == -1 || (path = malloc(7 + 3 * sizeof(int))) == NULL) + if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL) return NULL; +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(path, 7 + 3 * sizeof(int), "", fd); /* for debugging */ +#else sprintf(path, "", fd); /* for debugging */ +#endif gz = gz_open(path, fd, mode); free(path); return gz; @@ -531,7 +541,8 @@ const char * ZEXPORT gzerror(file, errnu /* return error information */ if (errnum != NULL) *errnum = state->err; - return state->msg == NULL ? "" : state->msg; + return state->err == Z_MEM_ERROR ? "out of memory" : + (state->msg == NULL ? "" : state->msg); } /* -- see zlib.h -- */ @@ -582,21 +593,24 @@ void ZLIB_INTERNAL gz_error(state, err, if (msg == NULL) return; - /* for an out of memory error, save as static string */ - if (err == Z_MEM_ERROR) { - state->msg = (char *)msg; + /* for an out of memory error, return literal string when requested */ + if (err == Z_MEM_ERROR) return; - } /* construct error message with path */ - if ((state->msg = malloc(strlen(state->path) + strlen(msg) + 3)) == NULL) { + if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) == + NULL) { state->err = Z_MEM_ERROR; - state->msg = (char *)"out of memory"; return; } +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(state->msg, strlen(state->path) + strlen(msg) + 3, + "%s%s%s", state->path, ": ", msg); +#else strcpy(state->msg, state->path); strcat(state->msg, ": "); strcat(state->msg, msg); +#endif return; } Modified: vendor/libz/dist/gzread.c ============================================================================== --- vendor/libz/dist/gzread.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/gzread.c Fri May 3 22:32:49 2013 (r250224) @@ -1,5 +1,5 @@ /* gzread.c -- zlib functions for reading gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -58,7 +58,8 @@ local int gz_avail(state) return -1; if (state->eof == 0) { if (strm->avail_in) { /* copy what's there to the start */ - unsigned char *p = state->in, *q = strm->next_in; + unsigned char *p = state->in; + unsigned const char *q = strm->next_in; unsigned n = strm->avail_in; do { *p++ = *q++; @@ -90,8 +91,8 @@ local int gz_look(state) /* allocate read buffers and inflate memory */ if (state->size == 0) { /* allocate buffers */ - state->in = malloc(state->want); - state->out = malloc(state->want << 1); + state->in = (unsigned char *)malloc(state->want); + state->out = (unsigned char *)malloc(state->want << 1); if (state->in == NULL || state->out == NULL) { if (state->out != NULL) free(state->out); @@ -352,14 +353,14 @@ int ZEXPORT gzread(file, buf, len) /* large len -- read directly into user buffer */ else if (state->how == COPY) { /* read directly */ - if (gz_load(state, buf, len, &n) == -1) + if (gz_load(state, (unsigned char *)buf, len, &n) == -1) return -1; } /* large len -- decompress directly into user buffer */ else { /* state->how == GZIP */ strm->avail_out = len; - strm->next_out = buf; + strm->next_out = (unsigned char *)buf; if (gz_decomp(state) == -1) return -1; n = state->x.have; @@ -378,7 +379,11 @@ int ZEXPORT gzread(file, buf, len) } /* -- see zlib.h -- */ -#undef gzgetc +#ifdef Z_PREFIX_SET +# undef z_gzgetc +#else +# undef gzgetc +#endif int ZEXPORT gzgetc(file) gzFile file; { @@ -518,7 +523,7 @@ char * ZEXPORT gzgets(file, buf, len) /* look for end-of-line in current output buffer */ n = state->x.have > left ? left : state->x.have; - eol = memchr(state->x.next, '\n', n); + eol = (unsigned char *)memchr(state->x.next, '\n', n); if (eol != NULL) n = (unsigned)(eol - state->x.next) + 1; Modified: vendor/libz/dist/gzwrite.c ============================================================================== --- vendor/libz/dist/gzwrite.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/gzwrite.c Fri May 3 22:32:49 2013 (r250224) @@ -1,5 +1,5 @@ /* gzwrite.c -- zlib functions for writing gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -19,7 +19,7 @@ local int gz_init(state) z_streamp strm = &(state->strm); /* allocate input buffer */ - state->in = malloc(state->want); + state->in = (unsigned char *)malloc(state->want); if (state->in == NULL) { gz_error(state, Z_MEM_ERROR, "out of memory"); return -1; @@ -28,7 +28,7 @@ local int gz_init(state) /* only need output buffer and deflate state if compressing */ if (!state->direct) { /* allocate output buffer */ - state->out = malloc(state->want); + state->out = (unsigned char *)malloc(state->want); if (state->out == NULL) { free(state->in); gz_error(state, Z_MEM_ERROR, "out of memory"); @@ -168,7 +168,6 @@ int ZEXPORT gzwrite(file, buf, len) unsigned len; { unsigned put = len; - unsigned n; gz_statep state; z_streamp strm; @@ -208,16 +207,19 @@ int ZEXPORT gzwrite(file, buf, len) if (len < state->size) { /* copy to input buffer, compress when full */ do { + unsigned have, copy; + if (strm->avail_in == 0) strm->next_in = state->in; - n = state->size - strm->avail_in; - if (n > len) - n = len; - memcpy(strm->next_in + strm->avail_in, buf, n); - strm->avail_in += n; - state->x.pos += n; - buf = (char *)buf + n; - len -= n; + have = (unsigned)((strm->next_in + strm->avail_in) - state->in); + copy = state->size - have; + if (copy > len) + copy = len; + memcpy(state->in + have, buf, copy); + strm->avail_in += copy; + state->x.pos += copy; + buf = (const char *)buf + copy; + len -= copy; if (len && gz_comp(state, Z_NO_FLUSH) == -1) return 0; } while (len); @@ -229,7 +231,7 @@ int ZEXPORT gzwrite(file, buf, len) /* directly compress user buffer to file */ strm->avail_in = len; - strm->next_in = (voidp)buf; + strm->next_in = (z_const Bytef *)buf; state->x.pos += len; if (gz_comp(state, Z_NO_FLUSH) == -1) return 0; @@ -244,6 +246,7 @@ int ZEXPORT gzputc(file, c) gzFile file; int c; { + unsigned have; unsigned char buf[1]; gz_statep state; z_streamp strm; @@ -267,12 +270,16 @@ int ZEXPORT gzputc(file, c) /* try writing to input buffer for speed (state->size == 0 if buffer not initialized) */ - if (strm->avail_in < state->size) { + if (state->size) { if (strm->avail_in == 0) strm->next_in = state->in; - strm->next_in[strm->avail_in++] = c; - state->x.pos++; - return c & 0xff; + have = (unsigned)((strm->next_in + strm->avail_in) - state->in); + if (have < state->size) { + state->in[have] = c; + strm->avail_in++; + state->x.pos++; + return c & 0xff; + } } /* no room in buffer or not initialized, use gz_write() */ @@ -300,12 +307,11 @@ int ZEXPORT gzputs(file, str) #include /* -- see zlib.h -- */ -int ZEXPORTVA gzprintf (gzFile file, const char *format, ...) +int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) { int size, len; gz_statep state; z_streamp strm; - va_list va; /* get internal structure */ if (file == NULL) @@ -335,25 +341,20 @@ int ZEXPORTVA gzprintf (gzFile file, con /* do the printf() into the input buffer, put length in len */ size = (int)(state->size); state->in[size - 1] = 0; - va_start(va, format); #ifdef NO_vsnprintf # ifdef HAS_vsprintf_void (void)vsprintf((char *)(state->in), format, va); - va_end(va); for (len = 0; len < size; len++) if (state->in[len] == 0) break; # else len = vsprintf((char *)(state->in), format, va); - va_end(va); # endif #else # ifdef HAS_vsnprintf_void (void)vsnprintf((char *)(state->in), size, format, va); - va_end(va); len = strlen((char *)(state->in)); # else len = vsnprintf((char *)(state->in), size, format, va); - va_end(va); # endif #endif @@ -368,6 +369,17 @@ int ZEXPORTVA gzprintf (gzFile file, con return len; } +int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) +{ + va_list va; + int ret; + + va_start(va, format); + ret = gzvprintf(file, format, va); + va_end(va); + return ret; +} + #else /* !STDC && !Z_HAVE_STDARG_H */ /* -- see zlib.h -- */ @@ -547,9 +559,9 @@ int ZEXPORT gzclose_w(file) } /* flush, free memory, and close file */ + if (gz_comp(state, Z_FINISH) == -1) + ret = state->err; if (state->size) { - if (gz_comp(state, Z_FINISH) == -1) - ret = state->err; if (!state->direct) { (void)deflateEnd(&(state->strm)); free(state->out); Modified: vendor/libz/dist/infback.c ============================================================================== --- vendor/libz/dist/infback.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/infback.c Fri May 3 22:32:49 2013 (r250224) @@ -255,7 +255,7 @@ out_func out; void FAR *out_desc; { struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ + z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ unsigned have, left; /* available input and output */ unsigned long hold; /* bit buffer */ Modified: vendor/libz/dist/inffast.c ============================================================================== --- vendor/libz/dist/inffast.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/inffast.c Fri May 3 22:32:49 2013 (r250224) @@ -1,5 +1,5 @@ /* inffast.c -- fast decoding - * Copyright (C) 1995-2008, 2010 Mark Adler + * Copyright (C) 1995-2008, 2010, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -69,8 +69,8 @@ z_streamp strm; unsigned start; /* inflate()'s starting value for strm->avail_out */ { struct inflate_state FAR *state; - unsigned char FAR *in; /* local strm->next_in */ - unsigned char FAR *last; /* while in < last, enough input available */ + z_const unsigned char FAR *in; /* local strm->next_in */ + z_const unsigned char FAR *last; /* have enough input while in < last */ unsigned char FAR *out; /* local strm->next_out */ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ unsigned char FAR *end; /* while out < end, enough space available */ Modified: vendor/libz/dist/inflate.c ============================================================================== --- vendor/libz/dist/inflate.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/inflate.c Fri May 3 22:32:49 2013 (r250224) @@ -93,11 +93,12 @@ /* function prototypes */ local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, unsigned out)); +local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, + unsigned copy)); #ifdef BUILDFIXED void makefixed OF((void)); #endif -local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, +local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, unsigned len)); int ZEXPORT inflateResetKeep(strm) @@ -375,12 +376,13 @@ void makefixed() output will fall in the output data, making match copies simpler and faster. The advantage may be dependent on the size of the processor's data caches. */ -local int updatewindow(strm, out) +local int updatewindow(strm, end, copy) z_streamp strm; -unsigned out; +const Bytef *end; +unsigned copy; { struct inflate_state FAR *state; - unsigned copy, dist; + unsigned dist; state = (struct inflate_state FAR *)strm->state; @@ -400,19 +402,18 @@ unsigned out; } /* copy state->wsize or less output bytes into the circular window */ - copy = out - strm->avail_out; if (copy >= state->wsize) { - zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); + zmemcpy(state->window, end - state->wsize, state->wsize); state->wnext = 0; state->whave = state->wsize; } else { dist = state->wsize - state->wnext; if (dist > copy) dist = copy; - zmemcpy(state->window + state->wnext, strm->next_out - copy, dist); + zmemcpy(state->window + state->wnext, end - copy, dist); copy -= dist; if (copy) { - zmemcpy(state->window, strm->next_out - copy, copy); + zmemcpy(state->window, end - copy, copy); state->wnext = copy; state->whave = state->wsize; } @@ -606,7 +607,7 @@ z_streamp strm; int flush; { struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ + z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ unsigned have, left; /* available input and output */ unsigned long hold; /* bit buffer */ @@ -920,7 +921,7 @@ int flush; while (state->have < 19) state->lens[order[state->have++]] = 0; state->next = state->codes; - state->lencode = (code const FAR *)(state->next); + state->lencode = (const code FAR *)(state->next); state->lenbits = 7; ret = inflate_table(CODES, state->lens, 19, &(state->next), &(state->lenbits), state->work); @@ -994,7 +995,7 @@ int flush; values here (9 and 6) without reading the comments in inftrees.h concerning the ENOUGH constants, which depend on those values */ state->next = state->codes; - state->lencode = (code const FAR *)(state->next); + state->lencode = (const code FAR *)(state->next); state->lenbits = 9; ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), &(state->lenbits), state->work); @@ -1003,7 +1004,7 @@ int flush; state->mode = BAD; break; } - state->distcode = (code const FAR *)(state->next); + state->distcode = (const code FAR *)(state->next); state->distbits = 6; ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, &(state->next), &(state->distbits), state->work); @@ -1230,7 +1231,7 @@ int flush; RESTORE(); if (state->wsize || (out != strm->avail_out && state->mode < BAD && (state->mode < CHECK || flush != Z_FINISH))) - if (updatewindow(strm, out)) { + if (updatewindow(strm, strm->next_out, out - strm->avail_out)) { state->mode = MEM; return Z_MEM_ERROR; } @@ -1264,6 +1265,29 @@ z_streamp strm; return Z_OK; } +int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) +z_streamp strm; +Bytef *dictionary; +uInt *dictLength; +{ + struct inflate_state FAR *state; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + + /* copy dictionary */ + if (state->whave && dictionary != Z_NULL) { + zmemcpy(dictionary, state->window + state->wnext, + state->whave - state->wnext); + zmemcpy(dictionary + state->whave - state->wnext, + state->window, state->wnext); + } + if (dictLength != Z_NULL) + *dictLength = state->whave; + return Z_OK; +} + int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) z_streamp strm; const Bytef *dictionary; @@ -1271,8 +1295,6 @@ uInt dictLength; { struct inflate_state FAR *state; unsigned long dictid; - unsigned char *next; - unsigned avail; int ret; /* check state */ @@ -1291,13 +1313,7 @@ uInt dictLength; /* copy dictionary to window using updatewindow(), which will amend the existing dictionary if appropriate */ - next = strm->next_out; - avail = strm->avail_out; - strm->next_out = (Bytef *)dictionary + dictLength; - strm->avail_out = 0; - ret = updatewindow(strm, dictLength); - strm->avail_out = avail; - strm->next_out = next; + ret = updatewindow(strm, dictionary + dictLength, dictLength); if (ret) { state->mode = MEM; return Z_MEM_ERROR; @@ -1337,7 +1353,7 @@ gz_headerp head; */ local unsigned syncsearch(have, buf, len) unsigned FAR *have; -unsigned char FAR *buf; +const unsigned char FAR *buf; unsigned len; { unsigned got; Modified: vendor/libz/dist/inftrees.c ============================================================================== --- vendor/libz/dist/inftrees.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/inftrees.c Fri May 3 22:32:49 2013 (r250224) @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2012 Mark Adler + * Copyright (C) 1995-2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.7 Copyright 1995-2012 Mark Adler "; + " inflate 1.2.8 Copyright 1995-2013 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 78, 68}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, @@ -208,8 +208,8 @@ unsigned short FAR *work; mask = used - 1; /* mask for comparing low */ /* check available table space */ - if ((type == LENS && used >= ENOUGH_LENS) || - (type == DISTS && used >= ENOUGH_DISTS)) + if ((type == LENS && used > ENOUGH_LENS) || + (type == DISTS && used > ENOUGH_DISTS)) return 1; /* process all codes and make table entries */ @@ -277,8 +277,8 @@ unsigned short FAR *work; /* check for enough space */ used += 1U << curr; - if ((type == LENS && used >= ENOUGH_LENS) || - (type == DISTS && used >= ENOUGH_DISTS)) + if ((type == LENS && used > ENOUGH_LENS) || + (type == DISTS && used > ENOUGH_DISTS)) return 1; /* point entry in root table to sub-table */ Modified: vendor/libz/dist/test/example.c ============================================================================== --- vendor/libz/dist/test/example.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/test/example.c Fri May 3 22:32:49 2013 (r250224) @@ -26,7 +26,7 @@ } \ } -const char hello[] = "hello, hello!"; +z_const char hello[] = "hello, hello!"; /* "hello world" would be more standard, but the repeated "hello" * stresses the compression code better, sorry... */ @@ -212,7 +212,7 @@ void test_deflate(compr, comprLen) err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); CHECK_ERR(err, "deflateInit"); - c_stream.next_in = (Bytef*)hello; + c_stream.next_in = (z_const unsigned char *)hello; c_stream.next_out = compr; while (c_stream.total_in != len && c_stream.total_out < comprLen) { @@ -387,7 +387,7 @@ void test_flush(compr, comprLen) err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); CHECK_ERR(err, "deflateInit"); - c_stream.next_in = (Bytef*)hello; + c_stream.next_in = (z_const unsigned char *)hello; c_stream.next_out = compr; c_stream.avail_in = 3; c_stream.avail_out = (uInt)*comprLen; @@ -476,7 +476,7 @@ void test_dict_deflate(compr, comprLen) c_stream.next_out = compr; c_stream.avail_out = (uInt)comprLen; - c_stream.next_in = (Bytef*)hello; + c_stream.next_in = (z_const unsigned char *)hello; c_stream.avail_in = (uInt)strlen(hello)+1; err = deflate(&c_stream, Z_FINISH); Modified: vendor/libz/dist/test/minigzip.c ============================================================================== --- vendor/libz/dist/test/minigzip.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/test/minigzip.c Fri May 3 22:32:49 2013 (r250224) @@ -40,6 +40,10 @@ # define SET_BINARY_MODE(file) #endif +#ifdef _MSC_VER +# define snprintf _snprintf +#endif + #ifdef VMS # define unlink delete # define GZ_SUFFIX "-gz" @@ -463,8 +467,12 @@ void file_compress(file, mode) exit(1); } +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(outfile, sizeof(outfile), "%s%s", file, GZ_SUFFIX); +#else strcpy(outfile, file); strcat(outfile, GZ_SUFFIX); +#endif in = fopen(file, "rb"); if (in == NULL) { @@ -499,7 +507,11 @@ void file_uncompress(file) exit(1); } +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(buf, sizeof(buf), "%s", file); +#else strcpy(buf, file); +#endif if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) { infile = file; @@ -508,7 +520,11 @@ void file_uncompress(file) } else { outfile = file; infile = buf; +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(buf + len, sizeof(buf) - len, "%s", GZ_SUFFIX); +#else strcat(infile, GZ_SUFFIX); +#endif } in = gzopen(infile, "rb"); if (in == NULL) { @@ -546,7 +562,11 @@ int main(argc, argv) gzFile file; char *bname, outmode[20]; +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(outmode, sizeof(outmode), "%s", "wb6 "); +#else strcpy(outmode, "wb6 "); +#endif prog = argv[0]; bname = strrchr(argv[0], '/'); Modified: vendor/libz/dist/trees.c ============================================================================== --- vendor/libz/dist/trees.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/trees.c Fri May 3 22:32:49 2013 (r250224) @@ -146,8 +146,8 @@ local void send_tree OF((deflate_st local int build_bl_tree OF((deflate_state *s)); local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, int blcodes)); -local void compress_block OF((deflate_state *s, ct_data *ltree, - ct_data *dtree)); +local void compress_block OF((deflate_state *s, const ct_data *ltree, + const ct_data *dtree)); local int detect_data_type OF((deflate_state *s)); local unsigned bi_reverse OF((unsigned value, int length)); local void bi_windup OF((deflate_state *s)); @@ -972,7 +972,8 @@ void ZLIB_INTERNAL _tr_flush_block(s, bu } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { #endif send_bits(s, (STATIC_TREES<<1)+last, 3); - compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); + compress_block(s, (const ct_data *)static_ltree, + (const ct_data *)static_dtree); #ifdef DEBUG s->compressed_len += 3 + s->static_len; #endif @@ -980,7 +981,8 @@ void ZLIB_INTERNAL _tr_flush_block(s, bu send_bits(s, (DYN_TREES<<1)+last, 3); send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, max_blindex+1); - compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); + compress_block(s, (const ct_data *)s->dyn_ltree, + (const ct_data *)s->dyn_dtree); #ifdef DEBUG s->compressed_len += 3 + s->opt_len; #endif @@ -1057,8 +1059,8 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc */ local void compress_block(s, ltree, dtree) deflate_state *s; - ct_data *ltree; /* literal tree */ - ct_data *dtree; /* distance tree */ + const ct_data *ltree; /* literal tree */ + const ct_data *dtree; /* distance tree */ { unsigned dist; /* distance of matched string */ int lc; /* match length or unmatched char (if dist == 0) */ Modified: vendor/libz/dist/uncompr.c ============================================================================== --- vendor/libz/dist/uncompr.c Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/uncompr.c Fri May 3 22:32:49 2013 (r250224) @@ -30,7 +30,7 @@ int ZEXPORT uncompress (dest, destLen, s z_stream stream; int err; - stream.next_in = (Bytef*)source; + stream.next_in = (z_const Bytef *)source; stream.avail_in = (uInt)sourceLen; /* Check for source > 64K on 16-bit machine: */ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; Modified: vendor/libz/dist/zconf.h ============================================================================== --- vendor/libz/dist/zconf.h Fri May 3 21:11:57 2013 (r250223) +++ vendor/libz/dist/zconf.h Fri May 3 22:32:49 2013 (r250224) @@ -1,5 +1,5 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 3 22:33:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A17EC90A; Fri, 3 May 2013 22:33:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7A68818A7; Fri, 3 May 2013 22:33:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43MXf5D070386; Fri, 3 May 2013 22:33:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43MXfkh070385; Fri, 3 May 2013 22:33:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305032233.r43MXfkh070385@svn.freebsd.org> From: Xin LI Date: Fri, 3 May 2013 22:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250225 - vendor/libz/1.2.8 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 22:33:41 -0000 Author: delphij Date: Fri May 3 22:33:41 2013 New Revision: 250225 URL: http://svnweb.freebsd.org/changeset/base/250225 Log: Tag zlib 1.2.8. Added: vendor/libz/1.2.8/ - copied from r250224, vendor/libz/dist/ From owner-svn-src-all@FreeBSD.ORG Fri May 3 23:29:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F309D288; Fri, 3 May 2013 23:29:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E43EE1B36; Fri, 3 May 2013 23:29:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43NTewx089008; Fri, 3 May 2013 23:29:40 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43NTc3j088990; Fri, 3 May 2013 23:29:38 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305032329.r43NTc3j088990@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 3 May 2013 23:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250226 - in head/usr.bin/m4: . TEST X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 23:29:41 -0000 Author: jkim Date: Fri May 3 23:29:38 2013 New Revision: 250226 URL: http://svnweb.freebsd.org/changeset/base/250226 Log: Reduce diff with upstream. Modified: head/usr.bin/m4/TEST/ack.m4 head/usr.bin/m4/TEST/hanoi.m4 head/usr.bin/m4/TEST/hash.m4 head/usr.bin/m4/TEST/sqroot.m4 head/usr.bin/m4/TEST/string.m4 head/usr.bin/m4/TEST/test.m4 head/usr.bin/m4/eval.c head/usr.bin/m4/extern.h head/usr.bin/m4/m4.1 head/usr.bin/m4/main.c head/usr.bin/m4/parser.y head/usr.bin/m4/tokenizer.l Modified: head/usr.bin/m4/TEST/ack.m4 ============================================================================== --- head/usr.bin/m4/TEST/ack.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/ack.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: ack.m4,v 1.2 1996/06/26 05:36:18 deraadt Exp $ +# $OpenBSD: ack.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: ack.m4,v 1.4 1995/09/28 05:37:54 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/TEST/hanoi.m4 ============================================================================== --- head/usr.bin/m4/TEST/hanoi.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/hanoi.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: hanoi.m4,v 1.2 1996/06/26 05:36:19 deraadt Exp $ +# $OpenBSD: hanoi.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: hanoi.m4,v 1.4 1995/09/28 05:37:56 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/TEST/hash.m4 ============================================================================== --- head/usr.bin/m4/TEST/hash.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/hash.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: hash.m4,v 1.2 1996/06/26 05:36:19 deraadt Exp $ +# $OpenBSD: hash.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: hash.m4,v 1.4 1995/09/28 05:37:58 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/TEST/sqroot.m4 ============================================================================== --- head/usr.bin/m4/TEST/sqroot.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/sqroot.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: sqroot.m4,v 1.2 1996/06/26 05:36:20 deraadt Exp $ +# $OpenBSD: sqroot.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: sqroot.m4,v 1.4 1995/09/28 05:38:01 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/TEST/string.m4 ============================================================================== --- head/usr.bin/m4/TEST/string.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/string.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: string.m4,v 1.2 1996/06/26 05:36:20 deraadt Exp $ +# $OpenBSD: string.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: string.m4,v 1.4 1995/09/28 05:38:03 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/TEST/test.m4 ============================================================================== --- head/usr.bin/m4/TEST/test.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/test.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: test.m4,v 1.2 1996/06/26 05:36:21 deraadt Exp $ +# $OpenBSD: test.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: test.m4,v 1.4 1995/09/28 05:38:05 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/eval.c ============================================================================== --- head/usr.bin/m4/eval.c Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/eval.c Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.69 2011/03/24 11:23:08 espie Exp $ */ +/* $OpenBSD: eval.c,v 1.70 2012/04/12 17:00:11 espie Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /* Modified: head/usr.bin/m4/extern.h ============================================================================== --- head/usr.bin/m4/extern.h Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/extern.h Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.51 2011/09/27 07:24:02 espie Exp $ */ +/* $OpenBSD: extern.h,v 1.52 2012/04/12 17:00:11 espie Exp $ */ /* $NetBSD: extern.h,v 1.3 1996/01/13 23:25:24 pk Exp $ */ /*- Modified: head/usr.bin/m4/m4.1 ============================================================================== --- head/usr.bin/m4/m4.1 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/m4.1 Fri May 3 23:29:38 2013 (r250226) @@ -1,5 +1,5 @@ -.\" $NetBSD: m4.1,v 1.22 2010/05/14 17:14:28 joerg Exp $ -.\" @(#) $OpenBSD: m4.1,v 1.56 2009/10/14 17:19:47 sthen Exp $ +.\" $NetBSD: m4.1,v 1.23 2012/04/08 22:00:39 wiz Exp $ +.\" @(#) $OpenBSD: m4.1,v 1.59 2010/10/21 13:20:51 jmc Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -33,14 +33,14 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2009 +.Dd October 21, 2010 .Dt M4 1 .Os .Sh NAME .Nm m4 .Nd macro language processor .Sh SYNOPSIS -.Nm m4 +.Nm .Op Fl gPs .Oo .Sm off @@ -50,18 +50,16 @@ .Op Fl d Ar flags .Op Fl I Ar dirname .Op Fl o Ar filename -.Bk -words .Op Fl t Ar macro .Op Fl U Ns Ar name .Op Ar -.Ek .Sh DESCRIPTION The -.Nm m4 +.Nm utility is a macro processor that can be used as a front end to any language (e.g., C, ratfor, fortran, lex, and yacc). If no input files are given, -.Nm m4 +.Nm reads from the standard input, otherwise files specified on the command line are processed in the given order. @@ -69,7 +67,7 @@ Input files can be regular files, files single dash .Pq Sq - , denoting standard input. -.Nm m4 +.Nm writes the processed text to the standard output, unless told otherwise. .Pp @@ -77,7 +75,7 @@ Macro calls have the form name(argument1 .Pp There cannot be any space following the macro name and the open parenthesis -.Sq \&( . +.Pq Sq \&( . If the macro name is not followed by an open parenthesis it is processed with no arguments. .Pp @@ -169,7 +167,7 @@ Undefine the symbol .Ar name . .El .Sh SYNTAX -.Nm m4 +.Nm provides the following built-in macros. They may be redefined, losing their original meaning. Return values are null unless otherwise stated. @@ -240,7 +238,7 @@ macro definitions (even for built-in mac .It Fn divert num There are 10 output queues (numbered 0-9). At the end of processing -.Nm m4 +.Nm concatenates all the queues in numerical order to produce the final output. Initially the output queue is 0. @@ -259,7 +257,7 @@ Prints the first argument on the standar .It Fn esyscmd cmd Passes its first argument to a shell and returns the shell's standard output. Note that the shell shares its standard input and standard error with -.Nm m4 . +.Nm . .It Fn eval expr Computes the first argument as an arithmetic expression using 32-bit arithmetic. @@ -348,6 +346,9 @@ Multiple calls to get inserted in sequence at the final .Dv EOF . .It Fn maketemp template +Like +.Ic mkstemp . +.It Fn mkstemp template Invokes .Xr mkstemp 3 on the first argument, and returns the modified string. @@ -431,10 +432,16 @@ Returns the current file's line number. .It Ic __file__ Returns the current file's name. .El +.Sh EXIT STATUS +.Ex -std m4 +.Pp +But note that the +.Ic m4exit +macro can modify the exit status. .Sh STANDARDS The .Nm -utility is compliant with the +utility is mostly compliant with the .St -p1003.1-2008 specification. .Pp @@ -456,6 +463,12 @@ and .Ic __file__ are extensions to that specification. .Pp +.Ic maketemp +is not supposed to be a synonym for +.Ic mkstemp , +but instead to be an insecure temporary file name creation function. +The change causes no known compatibility issues. +.Pp The output format of tracing and of .Ic dumpdef are not specified in any standard, @@ -480,7 +493,7 @@ replaces the top-most definition only. Other implementations may erase all definitions on the stack instead. .Pp All built-ins do expand without arguments in many other -.Nm m4 . +.Nm . .Pp Many other .Nm Modified: head/usr.bin/m4/main.c ============================================================================== --- head/usr.bin/m4/main.c Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/main.c Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.80 2011/09/27 07:24:02 espie Exp $ */ +/* $OpenBSD: main.c,v 1.81 2012/04/12 17:00:11 espie Exp $ */ /* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */ /*- Modified: head/usr.bin/m4/parser.y ============================================================================== --- head/usr.bin/m4/parser.y Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/parser.y Fri May 3 23:29:38 2013 (r250226) @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: parser.y,v 1.6 2008/08/21 21:00:14 espie Exp $ */ +/* $OpenBSD: parser.y,v 1.7 2012/04/12 17:00:11 espie Exp $ */ /* * Copyright (c) 2004 Marc Espie * Modified: head/usr.bin/m4/tokenizer.l ============================================================================== --- head/usr.bin/m4/tokenizer.l Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/tokenizer.l Fri May 3 23:29:38 2013 (r250226) @@ -1,6 +1,6 @@ %option nounput noinput %{ -/* $OpenBSD: tokenizer.l,v 1.7 2010/03/22 20:40:44 espie Exp $ */ +/* $OpenBSD: tokenizer.l,v 1.8 2012/04/12 17:00:11 espie Exp $ */ /* * Copyright (c) 2004 Marc Espie * From owner-svn-src-all@FreeBSD.ORG Fri May 3 23:51:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 04DC6732; Fri, 3 May 2013 23:51:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D99B71BE3; Fri, 3 May 2013 23:51:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43NpZCd097827; Fri, 3 May 2013 23:51:35 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43NpXGH097804; Fri, 3 May 2013 23:51:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305032351.r43NpXGH097804@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 3 May 2013 23:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250227 - in head: contrib/binutils/binutils contrib/binutils/ld lib/libc/net lib/libipsec sbin/devd usr.bin/ar usr.bin/csup usr.bin/xlint/lint1 usr.sbin/apmd usr.sbin/config usr.sbin/j... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 23:51:36 -0000 Author: jkim Date: Fri May 3 23:51:32 2013 New Revision: 250227 URL: http://svnweb.freebsd.org/changeset/base/250227 Log: Improve compatibility with recent flex from flex.sourceforge.net. Modified: head/contrib/binutils/binutils/arlex.l head/contrib/binutils/ld/ldlex.l head/lib/libc/net/nslexer.l head/lib/libipsec/policy_token.l head/sbin/devd/token.l head/usr.bin/ar/acplex.l head/usr.bin/csup/token.l head/usr.bin/xlint/lint1/scan.l head/usr.sbin/apmd/apmdlex.l head/usr.sbin/config/lang.l head/usr.sbin/jail/jaillex.l head/usr.sbin/kbdcontrol/lex.l head/usr.sbin/ndiscvt/inf-token.l head/usr.sbin/rrenumd/lexer.l Modified: head/contrib/binutils/binutils/arlex.l ============================================================================== --- head/contrib/binutils/binutils/arlex.l Fri May 3 23:29:38 2013 (r250226) +++ head/contrib/binutils/binutils/arlex.l Fri May 3 23:51:32 2013 (r250227) @@ -28,13 +28,13 @@ Foundation, Inc., 51 Franklin Street - F #include "libiberty.h" #include "arparse.h" -#define YY_NO_UNPUT - extern int yylex (void); int linenumber; %} +%option nounput + %a 10000 %o 25000 Modified: head/contrib/binutils/ld/ldlex.l ============================================================================== --- head/contrib/binutils/ld/ldlex.l Fri May 3 23:29:38 2013 (r250226) +++ head/contrib/binutils/ld/ldlex.l Fri May 3 23:51:32 2013 (r250227) @@ -63,8 +63,6 @@ const char *lex_string = NULL; #undef YY_INPUT #define YY_INPUT(buf,result,max_size) yy_input (buf, &result, max_size) -#define YY_NO_UNPUT - #define MAX_INCLUDE_DEPTH 10 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; static const char *file_name_stack[MAX_INCLUDE_DEPTH]; @@ -72,7 +70,7 @@ static unsigned int lineno_stack[MAX_INC static unsigned int include_stack_ptr = 0; static int vers_node_nesting = 0; -static void yy_input (char *, int *, int); +static void yy_input (char *, yy_size_t *, yy_size_t); static void comment (void); static void lex_warn_invalid (char *where, char *what); @@ -94,6 +92,8 @@ int yywrap (void) { return 1; } #endif %} +%option nounput + %a 4000 %o 5000 @@ -612,7 +612,7 @@ ldlex_popstate (void) either the number of characters read, or 0 to indicate EOF. */ static void -yy_input (char *buf, int *result, int max_size) +yy_input (char *buf, yy_size_t *result, yy_size_t max_size) { *result = 0; if (YY_CURRENT_BUFFER->yy_input_file) Modified: head/lib/libc/net/nslexer.l ============================================================================== --- head/lib/libc/net/nslexer.l Fri May 3 23:29:38 2013 (r250226) +++ head/lib/libc/net/nslexer.l Fri May 3 23:51:32 2013 (r250227) @@ -53,11 +53,10 @@ static char *rcsid = #include "nsparser.h" -#define YY_NO_INPUT -#define YY_NO_UNPUT - %} +%option noinput +%option nounput %option yylineno BLANK [ \t] Modified: head/lib/libipsec/policy_token.l ============================================================================== --- head/lib/libipsec/policy_token.l Fri May 3 23:29:38 2013 (r250226) +++ head/lib/libipsec/policy_token.l Fri May 3 23:51:32 2013 (r250227) @@ -139,8 +139,8 @@ void __policy__strbuffer__init__(msg) char *msg; { - if (yy_current_buffer) - yy_delete_buffer(yy_current_buffer); + if (YY_CURRENT_BUFFER) + yy_delete_buffer(YY_CURRENT_BUFFER); strbuffer = (YY_BUFFER_STATE)yy_scan_string(msg); yy_switch_to_buffer(strbuffer); Modified: head/sbin/devd/token.l ============================================================================== --- head/sbin/devd/token.l Fri May 3 23:29:38 2013 (r250226) +++ head/sbin/devd/token.l Fri May 3 23:51:32 2013 (r250227) @@ -37,8 +37,6 @@ #include "y.tab.h" int lineno = 1; -#define YY_NO_UNPUT -#define YY_NO_INPUT static void update_lineno(const char *cp) @@ -50,6 +48,9 @@ update_lineno(const char *cp) %} +%option nounput +%option noinput + %% [ \t]+ ; Modified: head/usr.bin/ar/acplex.l ============================================================================== --- head/usr.bin/ar/acplex.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.bin/ar/acplex.l Fri May 3 23:51:32 2013 (r250227) @@ -36,14 +36,14 @@ __FBSDID("$FreeBSD$"); #include "y.tab.h" -#define YY_NO_UNPUT -#define YY_NO_INPUT int lineno = 1; int yylex(void); %} +%option nounput +%option noinput %option noyywrap %% Modified: head/usr.bin/csup/token.l ============================================================================== --- head/usr.bin/csup/token.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.bin/csup/token.l Fri May 3 23:51:32 2013 (r250227) @@ -35,12 +35,11 @@ #include "misc.h" #include "token.h" -#define YY_NO_UNPUT - int lineno = 1; %} +%option nounput %option noyywrap %% Modified: head/usr.bin/xlint/lint1/scan.l ============================================================================== --- head/usr.bin/xlint/lint1/scan.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.bin/xlint/lint1/scan.l Fri May 3 23:51:32 2013 (r250227) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include "cgram.h" #define CHAR_MASK (~(~0 << CHAR_BIT)) -#define YY_NO_UNPUT /* Current position (its also updated when an included file is parsed) */ pos_t curr_pos = { 1, "", 0 }; @@ -86,6 +85,8 @@ static int wcstrg(void); %} +%option nounput + L [_A-Za-z] D [0-9] NZD [1-9] Modified: head/usr.sbin/apmd/apmdlex.l ============================================================================== --- head/usr.sbin/apmd/apmdlex.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/apmd/apmdlex.l Fri May 3 23:51:32 2013 (r250227) @@ -36,14 +36,14 @@ #include "apmd.h" #include "y.tab.h" -/* We don't need it, avoid the warning. */ -#define YY_NO_UNPUT -#define YY_NO_INPUT - int lineno; int first_time; %} +/* We don't need it, avoid the warning. */ +%option nounput +%option noinput + %s TOP %% Modified: head/usr.sbin/config/lang.l ============================================================================== --- head/usr.sbin/config/lang.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/config/lang.l Fri May 3 23:51:32 2013 (r250227) @@ -38,9 +38,6 @@ #include "y.tab.h" #include "config.h" -#define YY_NO_UNPUT -#define YY_NO_INPUT - /* * Data for returning to previous files from include files. */ @@ -97,6 +94,10 @@ unsigned int hex(const char *); int yyerror(const char *); %} + +%option nounput +%option noinput + ID [A-Za-z_][-A-Za-z_0-9]* PATH [./][-/.%^A-Za-z_0-9]+ %START TOEOL Modified: head/usr.sbin/jail/jaillex.l ============================================================================== --- head/usr.sbin/jail/jaillex.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/jail/jaillex.l Fri May 3 23:51:32 2013 (r250227) @@ -36,9 +36,6 @@ __FBSDID("$FreeBSD$"); #include "jailp.h" #include "y.tab.h" -#define YY_NO_INPUT -#define YY_NO_UNPUT - extern int yynerrs; static ssize_t text2lval(size_t triml, size_t trimr, int tovar); @@ -47,6 +44,9 @@ static int instr; static int lineno = 1; %} +%option noinput +%option nounput + %start _ DQ %% Modified: head/usr.sbin/kbdcontrol/lex.l ============================================================================== --- head/usr.sbin/kbdcontrol/lex.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/kbdcontrol/lex.l Fri May 3 23:51:32 2013 (r250227) @@ -31,11 +31,12 @@ %{ #include "lex.h" -#define YY_NO_UNPUT -#define YY_NO_INPUT %} +%option nounput +%option noinput + D [0-9] X [0-9a-fA-F] A . Modified: head/usr.sbin/ndiscvt/inf-token.l ============================================================================== --- head/usr.sbin/ndiscvt/inf-token.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/ndiscvt/inf-token.l Fri May 3 23:51:32 2013 (r250227) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include "y.tab.h" int lineno = 1; -#define YY_NO_UNPUT -#define YY_NO_INPUT int yylex(void); void yyerror(const char *); @@ -59,6 +57,9 @@ update_lineno(const char *cp) %} +%option nounput +%option noinput + %% [ \t]+ ; Modified: head/usr.sbin/rrenumd/lexer.l ============================================================================== --- head/usr.sbin/rrenumd/lexer.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/rrenumd/lexer.l Fri May 3 23:51:32 2013 (r250227) @@ -32,8 +32,6 @@ */ %{ -#define YY_NO_UNPUT - #include #include #include @@ -64,6 +62,8 @@ void yyerror(const char *); int yylex(void); %} +%option nounput + /* common section */ nl \n ws [ \t]+ From owner-svn-src-all@FreeBSD.ORG Sat May 4 00:31:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2DB28C1E; Sat, 4 May 2013 00:31:42 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 20BCC1D01; Sat, 4 May 2013 00:31:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r440VfQS012178; Sat, 4 May 2013 00:31:41 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r440VfBT012177; Sat, 4 May 2013 00:31:41 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201305040031.r440VfBT012177@svn.freebsd.org> From: Colin Percival Date: Sat, 4 May 2013 00:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250228 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 00:31:42 -0000 Author: cperciva Date: Sat May 4 00:31:41 2013 New Revision: 250228 URL: http://svnweb.freebsd.org/changeset/base/250228 Log: MFC r250000: Move IPPROTO_IPV6 from #ifdef __BSD_VISIBLE to #if __POSIX_VISIBLE >= 201112 since POSIX 2001 states that it shall be defined. Modified: stable/9/sys/netinet/in.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/in.h ============================================================================== --- stable/9/sys/netinet/in.h Fri May 3 23:51:32 2013 (r250227) +++ stable/9/sys/netinet/in.h Sat May 4 00:31:41 2013 (r250228) @@ -123,6 +123,7 @@ __END_DECLS #endif /* !_KERNEL && __BSD_VISIBLE */ #if __POSIX_VISIBLE >= 200112 +#define IPPROTO_IPV6 41 /* IP6 header */ #define IPPROTO_RAW 255 /* raw IP packet */ #define INET_ADDRSTRLEN 16 #endif @@ -174,7 +175,6 @@ __END_DECLS #define IPPROTO_CMTP 38 /* Control Message Transport */ #define IPPROTO_TPXX 39 /* TP++ Transport */ #define IPPROTO_IL 40 /* IL transport protocol */ -#define IPPROTO_IPV6 41 /* IP6 header */ #define IPPROTO_SDRP 42 /* Source Demand Routing */ #define IPPROTO_ROUTING 43 /* IP6 routing header */ #define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ From owner-svn-src-all@FreeBSD.ORG Sat May 4 04:03:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 851B521E; Sat, 4 May 2013 04:03:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E44A1259; Sat, 4 May 2013 04:03:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4443pno086623; Sat, 4 May 2013 04:03:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4443px0086622; Sat, 4 May 2013 04:03:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305040403.r4443px0086622@svn.freebsd.org> From: Adrian Chadd Date: Sat, 4 May 2013 04:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250229 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 04:03:51 -0000 Author: adrian Date: Sat May 4 04:03:50 2013 New Revision: 250229 URL: http://svnweb.freebsd.org/changeset/base/250229 Log: The holding buffer logic needs to be used for _all_ transmission, not just "when the queue is busy." After talking with the MAC team, it turns out that the linked list implementation sometimes will not accept a TxDP update and will instead re-read the link pointer. So even if the hardware has finished transmitting a chain and has hit EOL/VEOL, it may still re-read the link pointer to begin transmitting again. So, always set ATH_BUF_BUSY on the last buffer in the chain (to mark the last descriptor as the holding descriptor) and never blank the axq_link pointer. Tested: * AR5416, STA mode TODO: * much more thorough testing with the pre-11n NICs, just to verify that they behave the same way. * test TDMA on the 11n and non-11n hardware. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat May 4 00:31:41 2013 (r250228) +++ head/sys/dev/ath/if_ath.c Sat May 4 04:03:50 2013 (r250229) @@ -3928,19 +3928,20 @@ ath_tx_processq(struct ath_softc *sc, st break; } ATH_TXQ_REMOVE(txq, bf, bf_list); - if (txq->axq_depth > 0) { - /* - * More frames follow. Mark the buffer busy - * so it's not re-used while the hardware may - * still re-read the link field in the descriptor. - * - * Use the last buffer in an aggregate as that - * is where the hardware may be - intermediate - * descriptors won't be "busy". - */ - bf->bf_last->bf_flags |= ATH_BUF_BUSY; - } else - txq->axq_link = NULL; + + /* + * Always mark the last buffer in this list as busy. + * + * The hardware may re-read the holding descriptor + * even if we hit the end of the list and try writing + * a new TxDP. + * + * If there's no holding descriptor then this is the + * last buffer in the list of buffers after a fresh + * reset; it'll soon become the holding buffer. + */ + bf->bf_last->bf_flags |= ATH_BUF_BUSY; + if (bf->bf_state.bfs_aggr) txq->axq_aggr_depth--; From owner-svn-src-all@FreeBSD.ORG Sat May 4 11:20:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 43C7ADCC for ; Sat, 4 May 2013 11:20:47 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) by mx1.freebsd.org (Postfix) with ESMTP id BDEDE10D2 for ; Sat, 4 May 2013 11:20:46 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id fh20so2197377lab.34 for ; Sat, 04 May 2013 04:20:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=pYULphCAcd6pRso0V99G46/2hddjxaHWEuBnXGlMWbc=; b=QnoNIQf/1IQ3wA4CmnkZ6T7e8W7V8emv6hVzguPizzfzODpVdnxWtQoSDCC5ssE9T2 7rnZfLYzotBsezV6eFE/u2eRNVXDb7xzkuy9YYeone67zFz9coorAgJlcEoSh1CgzOSK aMXOzDQp4gnArvESDViVjuGsrem94LAdp7iYe0LWUJQ4ZrO3xX5uet3Jo4gJgpgjuqz2 e3BfDyPkyoeuc2pUPNh2NXdFyKVBjZr0PFcVdtsUX4ffZ9nzfCcBBGy7+ynHvAf7NC1r qUwWUVrJOOtybAgczoHl/c0URkpUzRuua9vRWcq8hoU+s2E3VyXyAF/XGMVxgvjtGPby IlYg== X-Received: by 10.112.171.7 with SMTP id aq7mr5619790lbc.130.1367666052680; Sat, 04 May 2013 04:14:12 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id r9sm5494184lbr.3.2013.05.04.04.14.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 04 May 2013 04:14:12 -0700 (PDT) Message-ID: <5184ED7E.3040703@freebsd.org> Date: Sat, 04 May 2013 15:14:06 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Sergey Kandaurov Subject: Re: svn commit: r250215 - stable/9/lib/libc/locale References: <201305031552.r43FqiPN024580@svn.freebsd.org> <5183E899.4000503@freebsd.org> <20130503195540.GA52657@stack.nl> In-Reply-To: OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlyN1oS6rEPvbAYm6BQ7SQMmEzG3ZG5H5NIQ3pPXUS5eF4kWtBWKFowA0IL+ZRAGSmlirzn Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org, Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 11:20:47 -0000 On 04.05.2013 0:48, Sergey Kandaurov wrote: > On 3 May 2013 23:55, Jilles Tjoelker wrote: >> Some sort of perfect hashing can also be an option, although it makes it >> harder to add new properties or adds a build dependency on gperf(1) that >> we would like to get rid of. > I hacked a bit on wctype. Speaking about speed, it shows about 1-3.5x > improvement over the previous fast version (before r250215). > > Time spend for 2097152 wctype() calls for each of wctype property > current previous mine > alnum 0.090554676 0.035821210 0.033270579 > alpha 0.172074310 0.052461036 0.044916572 > blank 0.261109989 0.055735281 0.036682745 > cntrl 0.357318986 0.069249831 0.038292782 > digit 0.436381530 0.094194364 0.039249005 > graph 0.540954812 0.085580099 0.043331460 > lower 0.618306476 0.095665215 0.044070399 > print 0.707443135 0.132559305 0.048216097 > punct 0.788922052 0.142809109 0.062871432 > space 0.888263108 0.150516644 0.054086142 > upper 0.966903461 0.173593592 0.054027834 > xdigit 0.406611275 0.201614227 0.060695939 > ideogram 0.439763499 0.239640723 0.068566486 > special 0.523128094 0.249156298 0.099278051 > phonogram 0.564975870 0.260972651 0.135751471 > rune 0.637392247 0.235195497 0.064093971 > > Index: locale/wctype.c > =================================================================== > --- locale/wctype.c (revision 250217) > +++ locale/wctype.c (working copy) > @@ -74,6 +74,9 @@ > "special\0" /* BSD extension */ > "phonogram\0" /* BSD extension */ > "rune\0"; /* BSD extension */ > + static const size_t propnamlen[] = { > + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 8, 7, 9, 4, 0 > + }; > static const wctype_t propmasks[] = { > _CTYPE_A|_CTYPE_D, > _CTYPE_A, > @@ -92,16 +95,17 @@ > _CTYPE_Q, > 0xFFFFFF00L > }; > - size_t len1, len2; > + const size_t *len2; > const char *p; > const wctype_t *q; > > - len1 = strlen(property); > q = propmasks; > - for (p = propnames; (len2 = strlen(p)) != 0; p += len2 + 1) { > - if (len1 == len2 && memcmp(property, p, len1) == 0) > + len2 = propnamlen; > + for (p = propnames; *len2 != 0; ) { > + if (property[0] == p[0] && strcmp(property, p) == 0) > return (*q); > - q++; > + p += *len2 + 1; > + q++; len2++; > } > > return (0UL); > This version looks better. IMHO adding full hashing here will be overkill, but much simpler trick still exist yet unused for speedup: sorting properties by character codes and break the loop as early as strcmp() returns bigger value. BTW, I don't run tests and look in asm code for sure, but it seems property[0] == p[0] is unneeded because almost every compiler tries to inline strcmp(). -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Sat May 4 11:26:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C29876D; Sat, 4 May 2013 11:26:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F3B511C2; Sat, 4 May 2013 11:26:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r449lqpP005675; Sat, 4 May 2013 09:47:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r449lqMf005674; Sat, 4 May 2013 09:47:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305040947.r449lqMf005674@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 4 May 2013 09:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250230 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 11:26:17 -0000 Author: jilles Date: Sat May 4 09:47:51 2013 New Revision: 250230 URL: http://svnweb.freebsd.org/changeset/base/250230 Log: libkvm: Use O_CLOEXEC instead of separate fcntl(F_SETFD) call. MFC after: 1 week Modified: head/lib/libkvm/kvm.c Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Sat May 4 04:03:50 2013 (r250229) +++ head/lib/libkvm/kvm.c Sat May 4 09:47:51 2013 (r250230) @@ -166,7 +166,7 @@ _kvm_open(kvm_t *kd, const char *uf, con if (mf == 0) mf = _PATH_MEM; - if ((kd->pmfd = open(mf, flag, 0)) < 0) { + if ((kd->pmfd = open(mf, flag | O_CLOEXEC, 0)) < 0) { _kvm_syserr(kd, kd->program, "%s", mf); goto failed; } @@ -179,10 +179,6 @@ _kvm_open(kvm_t *kd, const char *uf, con _kvm_syserr(kd, kd->program, "empty file"); goto failed; } - if (fcntl(kd->pmfd, F_SETFD, FD_CLOEXEC) < 0) { - _kvm_syserr(kd, kd->program, "%s", mf); - goto failed; - } if (S_ISCHR(st.st_mode)) { /* * If this is a character special device, then check that @@ -194,11 +190,8 @@ _kvm_open(kvm_t *kd, const char *uf, con kd->vmfd = open(_PATH_DEVNULL, O_RDONLY); return (kd); } else if (strcmp(mf, _PATH_MEM) == 0) { - if ((kd->vmfd = open(_PATH_KMEM, flag)) < 0) { - _kvm_syserr(kd, kd->program, "%s", _PATH_KMEM); - goto failed; - } - if (fcntl(kd->vmfd, F_SETFD, FD_CLOEXEC) < 0) { + if ((kd->vmfd = open(_PATH_KMEM, flag | O_CLOEXEC)) < + 0) { _kvm_syserr(kd, kd->program, "%s", _PATH_KMEM); goto failed; } @@ -210,11 +203,7 @@ _kvm_open(kvm_t *kd, const char *uf, con * Initialize the virtual address translation machinery, * but first setup the namelist fd. */ - if ((kd->nlfd = open(uf, O_RDONLY, 0)) < 0) { - _kvm_syserr(kd, kd->program, "%s", uf); - goto failed; - } - if (fcntl(kd->nlfd, F_SETFD, FD_CLOEXEC) < 0) { + if ((kd->nlfd = open(uf, O_RDONLY | O_CLOEXEC, 0)) < 0) { _kvm_syserr(kd, kd->program, "%s", uf); goto failed; } From owner-svn-src-all@FreeBSD.ORG Sat May 4 11:45:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 500C16C; Sat, 4 May 2013 11:45:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 42C141512; Sat, 4 May 2013 11:45:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44BjnGk046876; Sat, 4 May 2013 11:45:49 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44Bjn64046875; Sat, 4 May 2013 11:45:49 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305041145.r44Bjn64046875@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 4 May 2013 11:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250231 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 11:45:49 -0000 Author: jilles Date: Sat May 4 11:45:48 2013 New Revision: 250231 URL: http://svnweb.freebsd.org/changeset/base/250231 Log: libkvm: Make second /dev/null file descriptor close-on-exec as well. MFC after: 1 week Modified: head/lib/libkvm/kvm.c Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Sat May 4 09:47:51 2013 (r250230) +++ head/lib/libkvm/kvm.c Sat May 4 11:45:48 2013 (r250231) @@ -187,7 +187,7 @@ _kvm_open(kvm_t *kd, const char *uf, con * case you're working with a live kernel.) */ if (strcmp(mf, _PATH_DEVNULL) == 0) { - kd->vmfd = open(_PATH_DEVNULL, O_RDONLY); + kd->vmfd = open(_PATH_DEVNULL, O_RDONLY | O_CLOEXEC); return (kd); } else if (strcmp(mf, _PATH_MEM) == 0) { if ((kd->vmfd = open(_PATH_KMEM, flag | O_CLOEXEC)) < From owner-svn-src-all@FreeBSD.ORG Sat May 4 11:49:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABEA23A6; Sat, 4 May 2013 11:49:02 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E37215A9; Sat, 4 May 2013 11:49:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44Bn2IQ047460; Sat, 4 May 2013 11:49:02 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44Bn2ma047459; Sat, 4 May 2013 11:49:02 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305041149.r44Bn2ma047459@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 4 May 2013 11:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250232 - stable/9/usr.sbin/syslogd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 11:49:02 -0000 Author: jilles Date: Sat May 4 11:49:02 2013 New Revision: 250232 URL: http://svnweb.freebsd.org/changeset/base/250232 Log: MFC r249983: syslogd: Use closefrom() instead of getdtablesize()/close() loop. When syslogd forks a process for '|' destinations, it closes all file descriptors greater than 2. Use closefrom() for this instead of a getdtablesize()/close() loop because it is both faster and avoids leaving file descriptors open because the limit was lowered after they were opened. Modified: stable/9/usr.sbin/syslogd/syslogd.c Directory Properties: stable/9/usr.sbin/syslogd/ (props changed) Modified: stable/9/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/9/usr.sbin/syslogd/syslogd.c Sat May 4 11:45:48 2013 (r250231) +++ stable/9/usr.sbin/syslogd/syslogd.c Sat May 4 11:49:02 2013 (r250232) @@ -2476,7 +2476,7 @@ validate(struct sockaddr *sa, const char static int p_open(const char *prog, pid_t *rpid) { - int pfd[2], nulldesc, i; + int pfd[2], nulldesc; pid_t pid; sigset_t omask, mask; char *argv[4]; /* sh -c cmd NULL */ @@ -2526,8 +2526,7 @@ p_open(const char *prog, pid_t *rpid) dup2(pfd[0], STDIN_FILENO); dup2(nulldesc, STDOUT_FILENO); dup2(nulldesc, STDERR_FILENO); - for (i = getdtablesize(); i > 2; i--) - (void)close(i); + closefrom(3); (void)execvp(_PATH_BSHELL, argv); _exit(255); From owner-svn-src-all@FreeBSD.ORG Sat May 4 12:03:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3E833E55; Sat, 4 May 2013 12:03:17 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 2D98F16AD; Sat, 4 May 2013 12:03:16 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id l18so2403330wgh.24 for ; Sat, 04 May 2013 05:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=8+V196CJephydOu44Eavc6IR53NuHKC+pExxJdQDqOc=; b=vl+TxozZC1VyQmQBsyBrdxljDJr+vnpw5tlYgOWkS6KSQwmod6YAtJaK2LAj63SPT6 giHN+ed0xTHX+WvUjPxqB4skx+oaGQZtvvjbwS06NT8ucQ0TaISSRvSz2tYsOjiNu9A4 9nBVfMzC8kBJ6ZRTUh5I4faqAH6NzyJQLM9ybsq1i97LksljR/fRSW4ENcbcYwdLO9Ci PeBHfBs8HIdbB5AmvbcAZ12UGlVyYO1E+ubcngJKjHOTQiQgrWF7fmHkkxJi1Y4md7lC UZ1H1HuE/vx/FyOtXFVt0v+Nn+cwZytYFe1ex89/mJRvADPZLlJv8Fs6tkuuvfCquKs0 NAqw== MIME-Version: 1.0 X-Received: by 10.180.82.74 with SMTP id g10mr1866689wiy.10.1367668995367; Sat, 04 May 2013 05:03:15 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.194.29.199 with HTTP; Sat, 4 May 2013 05:03:15 -0700 (PDT) In-Reply-To: <5184ED7E.3040703@freebsd.org> References: <201305031552.r43FqiPN024580@svn.freebsd.org> <5183E899.4000503@freebsd.org> <20130503195540.GA52657@stack.nl> <5184ED7E.3040703@freebsd.org> Date: Sat, 4 May 2013 16:03:15 +0400 X-Google-Sender-Auth: VbTiFWBd0feDaoWc7YirzTPfzJU Message-ID: Subject: Re: svn commit: r250215 - stable/9/lib/libc/locale From: Sergey Kandaurov To: Andrey Chernov Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org, Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 12:03:17 -0000 On 4 May 2013 15:14, Andrey Chernov wrote: > On 04.05.2013 0:48, Sergey Kandaurov wrote: >> On 3 May 2013 23:55, Jilles Tjoelker wrote: >>> Some sort of perfect hashing can also be an option, although it makes it >>> harder to add new properties or adds a build dependency on gperf(1) that >>> we would like to get rid of. >> I hacked a bit on wctype. Speaking about speed, it shows about 1-3.5x >> improvement over the previous fast version (before r250215). >> >> Time spend for 2097152 wctype() calls for each of wctype property >> current previous mine >> alnum 0.090554676 0.035821210 0.033270579 >> alpha 0.172074310 0.052461036 0.044916572 >> blank 0.261109989 0.055735281 0.036682745 >> cntrl 0.357318986 0.069249831 0.038292782 >> digit 0.436381530 0.094194364 0.039249005 >> graph 0.540954812 0.085580099 0.043331460 >> lower 0.618306476 0.095665215 0.044070399 >> print 0.707443135 0.132559305 0.048216097 >> punct 0.788922052 0.142809109 0.062871432 >> space 0.888263108 0.150516644 0.054086142 >> upper 0.966903461 0.173593592 0.054027834 >> xdigit 0.406611275 0.201614227 0.060695939 >> ideogram 0.439763499 0.239640723 0.068566486 >> special 0.523128094 0.249156298 0.099278051 >> phonogram 0.564975870 0.260972651 0.135751471 >> rune 0.637392247 0.235195497 0.064093971 >> >> Index: locale/wctype.c >> =================================================================== >> --- locale/wctype.c (revision 250217) >> +++ locale/wctype.c (working copy) >> @@ -74,6 +74,9 @@ >> "special\0" /* BSD extension */ >> "phonogram\0" /* BSD extension */ >> "rune\0"; /* BSD extension */ >> + static const size_t propnamlen[] = { >> + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 8, 7, 9, 4, 0 >> + }; >> static const wctype_t propmasks[] = { >> _CTYPE_A|_CTYPE_D, >> _CTYPE_A, >> @@ -92,16 +95,17 @@ >> _CTYPE_Q, >> 0xFFFFFF00L >> }; >> - size_t len1, len2; >> + const size_t *len2; >> const char *p; >> const wctype_t *q; >> >> - len1 = strlen(property); >> q = propmasks; >> - for (p = propnames; (len2 = strlen(p)) != 0; p += len2 + 1) { >> - if (len1 == len2 && memcmp(property, p, len1) == 0) >> + len2 = propnamlen; >> + for (p = propnames; *len2 != 0; ) { >> + if (property[0] == p[0] && strcmp(property, p) == 0) >> return (*q); >> - q++; >> + p += *len2 + 1; >> + q++; len2++; >> } >> >> return (0UL); >> [...] > > BTW, I don't run tests and look in asm code for sure, but it seems > property[0] == p[0] is unneeded because almost every compiler tries to > inline strcmp(). Doesn't seem so (in-lining), see below. Apparently property[0] == p[0] is cheaper than strcmp() for negative checks. Removing this condition brings perf. numbers back to the "previous" column. Looking into asm: # property[0] == p[0] 4d: 44 3a 75 00 cmp 0x0(%rbp),%r14b 51: 75 dd jne 30 # strcmp() 53: 48 89 ee mov %rbp,%rsi 56: 4c 89 ff mov %r15,%rdi 59: e8 00 00 00 00 callq 5e 5e: 85 c0 test %eax,%eax 60: 75 ce jne 30 -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Sat May 4 12:41:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 391228B6; Sat, 4 May 2013 12:41:04 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-we0-x229.google.com (mail-we0-x229.google.com [IPv6:2a00:1450:400c:c03::229]) by mx1.freebsd.org (Postfix) with ESMTP id 50566186C; Sat, 4 May 2013 12:41:03 +0000 (UTC) Received: by mail-we0-f169.google.com with SMTP id x51so1984272wey.0 for ; Sat, 04 May 2013 05:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=0mE7dYBuu4KpFnO0RB65EE2grqgRnkEWmiip/Gjkubo=; b=UpvyOEH8vdn0Km5z/CNIzQGZh3X/Qa7soN9PKj0LhZ82oZPfjL8tqKE42LqaFud/Hn 4BkFNeugePP0fpIccJGw88MLhc4kSuZnGoCbHg5IeYY0HqDNASTg3pVDaHNpPQoCkyjl 34Lt1rHrVHbmOMykcTx5s/mHxTUYH/pkyVl1hB4u6iUeE2T2OwaS92oPPG+UhKixzdan i6KnkHeBwNmIAcybdjHrozA8w5XaThbgr8sz6bmFedYzWSSgHNtmxYqi7pX5/agDQNUf wAQT3Ne6X+4CU6l4GFDb74tIcoZVymtWiuyIJuHXxNCmpmjjT0Y+hiZyPUwhBfe9rwqc Ui7g== X-Received: by 10.194.63.109 with SMTP id f13mr17476569wjs.11.1367650773267; Fri, 03 May 2013 23:59:33 -0700 (PDT) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id o3sm1425687wia.2.2013.05.03.23.59.31 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 03 May 2013 23:59:32 -0700 (PDT) Sender: Baptiste Daroussin Date: Sat, 4 May 2013 08:59:29 +0200 From: Baptiste Daroussin To: Jung-uk Kim Subject: Re: svn commit: r250226 - in head/usr.bin/m4: . TEST Message-ID: <20130504065929.GU12114@ithaqua.etoilebsd.net> References: <201305032329.r43NTc3j088990@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GVLQrlG8+/jMfW4X" Content-Disposition: inline In-Reply-To: <201305032329.r43NTc3j088990@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 12:41:04 -0000 --GVLQrlG8+/jMfW4X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 03, 2013 at 11:29:38PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Fri May 3 23:29:38 2013 > New Revision: 250226 > URL: http://svnweb.freebsd.org/changeset/base/250226 >=20 > Log: > Reduce diff with upstream. >=20 > Modified: > head/usr.bin/m4/TEST/ack.m4 > head/usr.bin/m4/TEST/hanoi.m4 > head/usr.bin/m4/TEST/hash.m4 > head/usr.bin/m4/TEST/sqroot.m4 > head/usr.bin/m4/TEST/string.m4 > head/usr.bin/m4/TEST/test.m4 The above should go into tools/regression/usr.bin/m4 this where I put the o= ther regression tests. > head/usr.bin/m4/eval.c > head/usr.bin/m4/extern.h > head/usr.bin/m4/m4.1 > head/usr.bin/m4/main.c > head/usr.bin/m4/parser.y > head/usr.bin/m4/tokenizer.l >=20 thx I forgot to sync the headers because the last code in m4 was first writ= ten and committed in freebsd when I planned to update our flex to spirceforge version of flex ;) regards, Bapt --GVLQrlG8+/jMfW4X Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlGEsdEACgkQ8kTtMUmk6Ewd4QCeNyaELMPPf6Pc7xfrkQhzds9t rtYAnjlU0li1msy+hH9B8yJAz57fFt3d =+bPJ -----END PGP SIGNATURE----- --GVLQrlG8+/jMfW4X-- From owner-svn-src-all@FreeBSD.ORG Sat May 4 12:44:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42689A76; Sat, 4 May 2013 12:44:01 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1B9321889; Sat, 4 May 2013 12:44:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44Ci0D4067342; Sat, 4 May 2013 12:44:00 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44Ci0fg067341; Sat, 4 May 2013 12:44:00 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305041244.r44Ci0fg067341@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 4 May 2013 12:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250233 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 12:44:01 -0000 Author: pluknet Date: Sat May 4 12:44:00 2013 New Revision: 250233 URL: http://svnweb.freebsd.org/changeset/base/250233 Log: Bump date. Modified: head/lib/libprocstat/libprocstat.3 Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat May 4 11:49:02 2013 (r250232) +++ head/lib/libprocstat/libprocstat.3 Sat May 4 12:44:00 2013 (r250233) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2013 +.Dd May 3, 2013 .Dt LIBPROCSTAT 3 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sat May 4 12:56:14 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0A72EFF7; Sat, 4 May 2013 12:56:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7871924; Sat, 4 May 2013 12:56:12 +0000 (UTC) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r448mGXj031476; Sat, 4 May 2013 18:48:17 +1000 Received: from etaplex.bde.org ([139.218.225.48]) (authenticated sender brde) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r448lfjp003183 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 May 2013 18:48:12 +1000 Date: Sat, 4 May 2013 18:47:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@etaplex.bde.org To: jhb@FreeBSD.org Subject: Re: svn commit: r250220 - head/sys/kern In-Reply-To: <201305031908.r43J8xnI094418@svn.freebsd.org> Message-ID: <20130504184721.E619@etaplex.bde.org> References: <201305031908.r43J8xnI094418@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.0 cv=QtMGRiOd c=1 sm=1 a=5CeyE4nVUmB46QZCKVgZLQ==:17 a=8aH1kwsY6JcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=wdVBXaQ1PWgcX4Dgn0YA:9 a=CjuIK1q_8ugA:10 a=5CeyE4nVUmB46QZCKVgZLQ==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 12:56:14 -0000 > Log: > Fix FIONREAD on regular files. The computed result was being ignored and > it was being passed down to VOP_IOCTL() where it promptly resulted in > ENOTTY due to a missing else for the past 8 years. While here, use a > shared vnode lock while fetching the current file's size. In another thread I complained to kib about using the bad style of not returning as soon as possible, but instead sometimes returning and sometimes falling through a complicated if-else ladder to get to the return at the end. > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Fri May 3 18:58:37 2013 (r250219) > +++ head/sys/kern/vfs_vnops.c Fri May 3 19:08:58 2013 (r250220) > @@ -1364,13 +1364,12 @@ vn_ioctl(fp, com, data, active_cred, td) > case VREG: > case VDIR: > if (com == FIONREAD) { > - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > + vn_lock(vp, LK_SHARED | LK_RETRY); > error = VOP_GETATTR(vp, &vattr, active_cred); > VOP_UNLOCK(vp, 0); > if (!error) > *(int *)data = vattr.va_size - fp->f_offset; Old versions were missing the bug because they just returned here. > - } > - if (com == FIONBIO || com == FIOASYNC) /* XXX */ > + } else if (com == FIONBIO || com == FIOASYNC) /* XXX */ > error = 0; This depended on the FIONREAD clause always returning. This was simpler since it just returned 0 instead of setting error and falling through a not-so-complicated if-else ladder to the return statement. But old versions used the bad style of falling through the default case for the VREG and VDIR cases. > else > error = VOP_IOCTL(vp, com, data, fp->f_flag, Better yet, in the old versions the default case was intended to return ENOTTY, but this was hacked out, so the VREG and VDIR cases that didn't already return fell through the null default statement into the VFIFO+VCHR+VBLK case that did essentially this ioctl, because a few file systems like cd9660 have some magic ioctls. So the old versions needed the earlier returns even more, to avoid special cases on falling through. The default case is now obfuscated by setting error to ENOTTY at the start of the function. After this fix, that setting applies only to the default case. The setting is missing the style bug if initializing error in its declaration. Only the initialization of vp has that bug. Bruce From owner-svn-src-all@FreeBSD.ORG Sat May 4 12:57:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AB4A5DD; Sat, 4 May 2013 12:57:21 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8554E192F; Sat, 4 May 2013 12:57:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44CvLCJ071810; Sat, 4 May 2013 12:57:21 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44CvLsT071809; Sat, 4 May 2013 12:57:21 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305041257.r44CvLsT071809@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 4 May 2013 12:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250234 - head/lib/libc/nls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 12:57:21 -0000 Author: pluknet Date: Sat May 4 12:57:21 2013 New Revision: 250234 URL: http://svnweb.freebsd.org/changeset/base/250234 Log: Add entry for errno ECAPMODE. MFC after: 3 days Modified: head/lib/libc/nls/C.msg Modified: head/lib/libc/nls/C.msg ============================================================================== --- head/lib/libc/nls/C.msg Sat May 4 12:44:00 2013 (r250233) +++ head/lib/libc/nls/C.msg Sat May 4 12:57:21 2013 (r250234) @@ -191,6 +191,8 @@ $ EPROTO 92 Protocol error $ ENOTCAPABLE 93 Capabilities insufficient +$ ECAPMODE +94 Not permitted in capability mode $ $ strsignal() support catalog $ From owner-svn-src-all@FreeBSD.ORG Sat May 4 14:00:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7A8DDA3; Sat, 4 May 2013 14:00:17 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 81D151C3E; Sat, 4 May 2013 14:00:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44E0Hs0093601; Sat, 4 May 2013 14:00:17 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44E0GvD093597; Sat, 4 May 2013 14:00:16 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201305041400.r44E0GvD093597@svn.freebsd.org> From: Chris Rees Date: Sat, 4 May 2013 14:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250235 - in head: etc/rc.d sbin/mount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 14:00:17 -0000 Author: crees (ports committer) Date: Sat May 4 14:00:16 2013 New Revision: 250235 URL: http://svnweb.freebsd.org/changeset/base/250235 Log: Introduce and use new flag -L to mount for mounting only late filesystems. Previously, rc.d/mountlate mounted *all* filesystems, causing problems with background NFS mounts being mounted twice. PR: conf/137629 Submitted by: eadler (original concept) Reviewed by: mjg Approved by: hrs Modified: head/etc/rc.d/mountlate head/sbin/mount/mount.8 head/sbin/mount/mount.c Modified: head/etc/rc.d/mountlate ============================================================================== --- head/etc/rc.d/mountlate Sat May 4 12:57:21 2013 (r250234) +++ head/etc/rc.d/mountlate Sat May 4 14:00:16 2013 (r250235) @@ -21,19 +21,10 @@ mountlate_start() # Mount "late" filesystems. # err=0 - latefs= - # / (root) fs is always remounted, so remove from list - latefs="`/sbin/mount -d -a -l | grep -v ' /$'`" - case ${latefs} in - '') - ;; - *) - echo -n 'Mounting late file systems:' - mount -a -l - err=$? - echo '.' - ;; - esac + echo -n 'Mounting late file systems:' + mount -a -L + err=$? + echo '.' case ${err} in 0) Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Sat May 4 12:57:21 2013 (r250234) +++ head/sbin/mount/mount.8 Sat May 4 14:00:16 2013 (r250235) @@ -106,6 +106,13 @@ a file system mount status from read-wri Also forces the R/W mount of an unclean file system (dangerous; use with caution). +.It Fl L +When used in conjunction with the +.Fl a +option, mount +.Em only +those file systems which are marked as +.Dq Li late . .It Fl l When used in conjunction with the .Fl a Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Sat May 4 12:57:21 2013 (r250234) +++ head/sbin/mount/mount.c Sat May 4 14:00:16 2013 (r250235) @@ -245,14 +245,15 @@ main(int argc, char *argv[]) struct fstab *fs; struct statfs *mntbuf; int all, ch, i, init_flags, late, failok, mntsize, rval, have_fstab, ro; + int onlylate; char *cp, *ep, *options; - all = init_flags = late = 0; + all = init_flags = late = onlylate = 0; ro = 0; options = NULL; vfslist = NULL; vfstype = "ufs"; - while ((ch = getopt(argc, argv, "adF:flo:prt:uvw")) != -1) + while ((ch = getopt(argc, argv, "adF:fLlo:prt:uvw")) != -1) switch (ch) { case 'a': all = 1; @@ -266,6 +267,10 @@ main(int argc, char *argv[]) case 'f': init_flags |= MNT_FORCE; break; + case 'L': + onlylate = 1; + late = 1; + break; case 'l': late = 1; break; @@ -327,6 +332,8 @@ main(int argc, char *argv[]) continue; if (hasopt(fs->fs_mntops, "noauto")) continue; + if (!hasopt(fs->fs_mntops, "late") && onlylate) + continue; if (hasopt(fs->fs_mntops, "late") && !late) continue; if (hasopt(fs->fs_mntops, "failok")) From owner-svn-src-all@FreeBSD.ORG Sat May 4 14:03:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 73853F31; Sat, 4 May 2013 14:03:20 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6504A1C50; Sat, 4 May 2013 14:03:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44E3KvG095839; Sat, 4 May 2013 14:03:20 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44E3JNJ095829; Sat, 4 May 2013 14:03:19 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305041403.r44E3JNJ095829@svn.freebsd.org> From: Davide Italiano Date: Sat, 4 May 2013 14:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250236 - in head: contrib/smbfs/lib/smb contrib/smbfs/mount_smbfs sys/fs/smbfs sys/netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 14:03:20 -0000 Author: davide Date: Sat May 4 14:03:18 2013 New Revision: 250236 URL: http://svnweb.freebsd.org/changeset/base/250236 Log: Completely rewrite the interface to smbdev switching from dev_clone to cdevpriv(9). This commit changes the semantic of mount_smbfs in userland as well, which now passes file descriptor in order to to mount a specific filesystem istance. Reviewed by: attilio, ed Tested by: martymac Modified: head/contrib/smbfs/lib/smb/ctx.c head/contrib/smbfs/mount_smbfs/mount_smbfs.c head/sys/fs/smbfs/smbfs.h head/sys/fs/smbfs/smbfs_vfsops.c head/sys/netsmb/smb_dev.c head/sys/netsmb/smb_dev.h Modified: head/contrib/smbfs/lib/smb/ctx.c ============================================================================== --- head/contrib/smbfs/lib/smb/ctx.c Sat May 4 14:00:16 2013 (r250235) +++ head/contrib/smbfs/lib/smb/ctx.c Sat May 4 14:03:18 2013 (r250236) @@ -602,40 +602,12 @@ smb_ctx_gethandle(struct smb_ctx *ctx) int fd, i; char buf[20]; - /* - * First, try to open as cloned device - */ fd = open("/dev/"NSMB_NAME, O_RDWR); if (fd >= 0) { ctx->ct_fd = fd; return 0; } - /* - * well, no clone capabilities available - we have to scan - * all devices in order to get free one - */ - for (i = 0; i < 1024; i++) { - snprintf(buf, sizeof(buf), "/dev/%s%d", NSMB_NAME, i); - fd = open(buf, O_RDWR); - if (fd >= 0) { - ctx->ct_fd = fd; - return 0; - } - } - /* - * This is a compatibility with old /dev/net/nsmb device - */ - for (i = 0; i < 1024; i++) { - snprintf(buf, sizeof(buf), "/dev/net/%s%d", NSMB_NAME, i); - fd = open(buf, O_RDWR); - if (fd >= 0) { - ctx->ct_fd = fd; - return 0; - } - if (errno == ENOENT) - return ENOENT; - } - return ENOENT; + return ENOENT; } int Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.c ============================================================================== --- head/contrib/smbfs/mount_smbfs/mount_smbfs.c Sat May 4 14:00:16 2013 (r250235) +++ head/contrib/smbfs/mount_smbfs/mount_smbfs.c Sat May 4 14:03:18 2013 (r250236) @@ -82,7 +82,7 @@ main(int argc, char *argv[]) struct xvfsconf vfc; #endif char *next; - int opt, error, mntflags, caseopt, dev; + int opt, error, mntflags, caseopt, fd; uid_t uid; gid_t gid; mode_t dir_mode, file_mode; @@ -90,7 +90,7 @@ main(int argc, char *argv[]) iov = NULL; iovlen = 0; - dev = 0; + fd = 0; uid = (uid_t)-1; gid = (gid_t)-1; caseopt = 0; @@ -266,11 +266,11 @@ main(int argc, char *argv[]) exit(1); } - dev = ctx->ct_fd; + fd = ctx->ct_fd; build_iovec(&iov, &iovlen, "fstype", strdup("smbfs"), -1); build_iovec(&iov, &iovlen, "fspath", mount_point, -1); - build_iovec_argf(&iov, &iovlen, "dev", "%d", dev); + build_iovec_argf(&iov, &iovlen, "fd", "%d", fd); build_iovec(&iov, &iovlen, "mountpoint", mount_point, -1); build_iovec_argf(&iov, &iovlen, "uid", "%d", uid); build_iovec_argf(&iov, &iovlen, "gid", "%d", gid); Modified: head/sys/fs/smbfs/smbfs.h ============================================================================== --- head/sys/fs/smbfs/smbfs.h Sat May 4 14:00:16 2013 (r250235) +++ head/sys/fs/smbfs/smbfs.h Sat May 4 14:03:18 2013 (r250236) @@ -75,6 +75,7 @@ struct smbmount { mode_t sm_dir_mode; struct mount * sm_mp; struct smbnode * sm_root; + struct smb_dev * sm_dev; struct ucred * sm_owner; uint64_t sm_flags; long sm_nextino; Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Sat May 4 14:00:16 2013 (r250235) +++ head/sys/fs/smbfs/smbfs_vfsops.c Sat May 4 14:03:18 2013 (r250236) @@ -122,7 +122,7 @@ smbfs_cmount(struct mntarg *ma, void * d } static const char *smbfs_opts[] = { - "dev", "soft", "intr", "strong", "have_nls", "long", + "fd", "soft", "intr", "strong", "have_nls", "long", "mountpoint", "rootpath", "uid", "gid", "file_mode", "dir_mode", "caseopt", "errmsg", NULL }; @@ -135,10 +135,12 @@ smbfs_mount(struct mount *mp) struct smb_share *ssp = NULL; struct vnode *vp; struct thread *td; + struct smb_dev *dev; struct smb_cred *scred; int error, v; char *pc, *pe; + dev = NULL; td = curthread; if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) return EOPNOTSUPP; @@ -150,26 +152,29 @@ smbfs_mount(struct mount *mp) scred = smbfs_malloc_scred(); smb_makescred(scred, td, td->td_ucred); - if (1 != vfs_scanopt(mp->mnt_optnew, "dev", "%d", &v)) { - vfs_mount_error(mp, "No dev option"); + + /* Ask userspace of `fd`, the file descriptor of this session */ + if (1 != vfs_scanopt(mp->mnt_optnew, "fd", "%d", &v)) { + vfs_mount_error(mp, "No fd option"); smbfs_free_scred(scred); return (EINVAL); } - error = smb_dev2share(v, SMBM_EXEC, scred, &ssp); + error = smb_dev2share(v, SMBM_EXEC, scred, &ssp, &dev); + smp = malloc(sizeof(*smp), M_SMBFSDATA, M_WAITOK | M_ZERO); if (error) { printf("invalid device handle %d (%d)\n", v, error); - vfs_mount_error(mp, "invalid device handle %d (%d)\n", v, error); + vfs_mount_error(mp, "invalid device handle %d %d\n", v, error); smbfs_free_scred(scred); + free(smp, M_SMBFSDATA); return error; } vcp = SSTOVC(ssp); smb_share_unlock(ssp, 0); mp->mnt_stat.f_iosize = SSTOVC(ssp)->vc_txmax; - - smp = malloc(sizeof(*smp), M_SMBFSDATA, M_WAITOK | M_ZERO); - mp->mnt_data = smp; + mp->mnt_data = smp; smp->sm_share = ssp; smp->sm_root = NULL; + smp->sm_dev = dev; if (1 != vfs_scanopt(mp->mnt_optnew, "caseopt", "%d", &smp->sm_caseopt)) { vfs_mount_error(mp, "Invalid caseopt"); @@ -238,8 +243,15 @@ smbfs_mount(struct mount *mp) bad: if (ssp) smb_share_put(ssp, scred); - smbfs_free_scred(scred); - return error; + smbfs_free_scred(scred); + SMB_LOCK(); + if (error && smp->sm_dev == dev) { + smp->sm_dev = NULL; + sdp_trydestroy(dev); + } + SMB_UNLOCK(); + free(smp, M_SMBFSDATA); + return error; } /* Unmount the filesystem described by mp. */ @@ -249,6 +261,7 @@ smbfs_unmount(struct mount *mp, int mntf struct thread *td; struct smbmount *smp = VFSTOSMBFS(mp); struct smb_cred *scred; + struct smb_dev *dev; int error, flags; SMBVDEBUG("smbfs_unmount: flags=%04x\n", mntflags); @@ -277,7 +290,13 @@ smbfs_unmount(struct mount *mp, int mntf if (error) goto out; smb_share_put(smp->sm_share, scred); + SMB_LOCK(); + dev = smp->sm_dev; + if (!dev) + panic("No private data for mount point"); + sdp_trydestroy(dev); mp->mnt_data = NULL; + SMB_UNLOCK(); free(smp, M_SMBFSDATA); MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; Modified: head/sys/netsmb/smb_dev.c ============================================================================== --- head/sys/netsmb/smb_dev.c Sat May 4 14:00:16 2013 (r250235) +++ head/sys/netsmb/smb_dev.c Sat May 4 14:03:18 2013 (r250236) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -55,20 +56,16 @@ __FBSDID("$FreeBSD$"); #include #include -#define SMB_GETDEV(dev) ((struct smb_dev*)(dev)->si_drv1) -#define SMB_CHECKMINOR(dev) do { \ - sdp = SMB_GETDEV(dev); \ - if (sdp == NULL) return ENXIO; \ - } while(0) +static struct cdev *nsmb_dev; static d_open_t nsmb_dev_open; -static d_close_t nsmb_dev_close; static d_ioctl_t nsmb_dev_ioctl; MODULE_DEPEND(netsmb, libiconv, 1, 1, 2); MODULE_VERSION(netsmb, NSMB_VERSION); static int smb_version = NSMB_VERSION; +struct sx smb_lock; SYSCTL_DECL(_net_smb); @@ -76,110 +73,97 @@ SYSCTL_INT(_net_smb, OID_AUTO, version, static MALLOC_DEFINE(M_NSMBDEV, "NETSMBDEV", "NET/SMB device"); - -/* -int smb_dev_queue(struct smb_dev *ndp, struct smb_rq *rqp, int prio); -*/ - static struct cdevsw nsmb_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT | D_NEEDMINOR, .d_open = nsmb_dev_open, - .d_close = nsmb_dev_close, .d_ioctl = nsmb_dev_ioctl, .d_name = NSMB_NAME }; -static eventhandler_tag nsmb_dev_tag; -static struct clonedevs *nsmb_clones; - -static void -nsmb_dev_clone(void *arg, struct ucred *cred, char *name, int namelen, - struct cdev **dev) +static int +nsmb_dev_init(void) { - int i, u; - if (*dev != NULL) - return; + nsmb_dev = make_dev(&nsmb_cdevsw, 0, UID_ROOT, GID_OPERATOR, + 0600, "nsmb"); + if (nsmb_dev == NULL) + return (ENOMEM); + return (0); +} - if (strcmp(name, NSMB_NAME) == 0) - u = -1; - else if (dev_stdclone(name, NULL, NSMB_NAME, &u) != 1) - return; - i = clone_create(&nsmb_clones, &nsmb_cdevsw, &u, dev, 0); - if (i) - *dev = make_dev_credf(MAKEDEV_REF, &nsmb_cdevsw, u, cred, - UID_ROOT, GID_WHEEL, 0600, "%s%d", NSMB_NAME, u); +static void +nsmb_dev_destroy(void) +{ + + MPASS(nsmb_dev != NULL); + destroy_dev(nsmb_dev); + nsmb_dev = NULL; } -static int -nsmb_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +static struct smb_dev * +smbdev_alloc(struct cdev *dev) { struct smb_dev *sdp; - struct ucred *cred = td->td_ucred; - int s; - sdp = SMB_GETDEV(dev); - if (sdp && (sdp->sd_flags & NSMBFL_OPEN)) - return EBUSY; - if (sdp == NULL) { - sdp = malloc(sizeof(*sdp), M_NSMBDEV, M_WAITOK); - dev->si_drv1 = (void*)sdp; - } - /* - * XXX: this is just crazy - make a device for an already passed device... - * someone should take care of it. - */ - if ((dev->si_flags & SI_NAMED) == 0) - make_dev(&nsmb_cdevsw, dev2unit(dev), cred->cr_uid, - cred->cr_gid, 0700, NSMB_NAME"%d", dev2unit(dev)); - bzero(sdp, sizeof(*sdp)); -/* - STAILQ_INIT(&sdp->sd_rqlist); - STAILQ_INIT(&sdp->sd_rplist); - bzero(&sdp->sd_pollinfo, sizeof(struct selinfo)); -*/ - s = splimp(); + sdp = malloc(sizeof(struct smb_dev), M_NSMBDEV, M_WAITOK | M_ZERO); + sdp->dev = dev; sdp->sd_level = -1; sdp->sd_flags |= NSMBFL_OPEN; - splx(s); - return 0; + sdp->refcount = 1; + return (sdp); +} + +void +sdp_dtor(void *arg) +{ + struct smb_dev *dev; + + dev = (struct smb_dev *)arg; + SMB_LOCK(); + sdp_trydestroy(dev); + SMB_UNLOCK(); } static int -nsmb_dev_close(struct cdev *dev, int flag, int fmt, struct thread *td) +nsmb_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { struct smb_dev *sdp; + int error; + + sdp = smbdev_alloc(dev); + error = devfs_set_cdevpriv(sdp, sdp_dtor); + if (error) { + free(sdp, M_NSMBDEV); + return (error); + } + return (0); +} + +void +sdp_trydestroy(struct smb_dev *sdp) +{ struct smb_vc *vcp; struct smb_share *ssp; struct smb_cred *scred; - int s; + SMB_LOCKASSERT(); + if (!sdp) + panic("No smb_dev upon device close"); + MPASS(sdp->refcount > 0); + sdp->refcount--; + if (sdp->refcount) + return; scred = malloc(sizeof(struct smb_cred), M_NSMBDEV, M_WAITOK); - SMB_CHECKMINOR(dev); - s = splimp(); - if ((sdp->sd_flags & NSMBFL_OPEN) == 0) { - splx(s); - free(scred, M_NSMBDEV); - return EBADF; - } - smb_makescred(scred, td, NULL); + smb_makescred(scred, curthread, NULL); ssp = sdp->sd_share; if (ssp != NULL) smb_share_rele(ssp, scred); vcp = sdp->sd_vc; if (vcp != NULL) smb_vc_rele(vcp, scred); -/* - smb_flushq(&sdp->sd_rqlist); - smb_flushq(&sdp->sd_rplist); -*/ - dev->si_drv1 = NULL; - free(sdp, M_NSMBDEV); - destroy_dev_sched(dev); - splx(s); free(scred, M_NSMBDEV); - return 0; + free(sdp, M_NSMBDEV); + return; } @@ -192,11 +176,11 @@ nsmb_dev_ioctl(struct cdev *dev, u_long struct smb_cred *scred; int error = 0; - SMB_CHECKMINOR(dev); - if ((sdp->sd_flags & NSMBFL_OPEN) == 0) - return EBADF; - + error = devfs_get_cdevpriv((void **)&sdp); + if (error) + return (error); scred = malloc(sizeof(struct smb_cred), M_NSMBDEV, M_WAITOK); + SMB_LOCK(); smb_makescred(scred, td, NULL); switch (cmd) { case SMBIOC_OPENSESSION: @@ -345,6 +329,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long } out: free(scred, M_NSMBDEV); + SMB_UNLOCK(); return error; } @@ -363,18 +348,18 @@ nsmb_dev_load(module_t mod, int cmd, voi smb_sm_done(); break; } - clone_setup(&nsmb_clones); - nsmb_dev_tag = EVENTHANDLER_REGISTER(dev_clone, nsmb_dev_clone, 0, 1000); + error = nsmb_dev_init(); + if (error) + break; + sx_init(&smb_lock, "samba device lock"); break; case MOD_UNLOAD: smb_iod_done(); error = smb_sm_done(); if (error) break; - EVENTHANDLER_DEREGISTER(dev_clone, nsmb_dev_tag); - drain_dev_clone_events(); - clone_cleanup(&nsmb_clones); - destroy_dev_drain(&nsmb_cdevsw); + nsmb_dev_destroy(); + sx_destroy(&smb_lock); break; default: error = EINVAL; @@ -385,58 +370,40 @@ nsmb_dev_load(module_t mod, int cmd, voi DEV_MODULE (dev_netsmb, nsmb_dev_load, 0); -/* - * Convert a file descriptor to appropriate smb_share pointer - */ -static struct file* -nsmb_getfp(struct filedesc* fdp, int fd, int flag) -{ - struct file* fp; - - FILEDESC_SLOCK(fdp); - if ((fp = fget_locked(fdp, fd)) == NULL || (fp->f_flag & flag) == 0) { - FILEDESC_SUNLOCK(fdp); - return (NULL); - } - fhold(fp); - FILEDESC_SUNLOCK(fdp); - return (fp); -} - int smb_dev2share(int fd, int mode, struct smb_cred *scred, - struct smb_share **sspp) + struct smb_share **sspp, struct smb_dev **ssdp) { - struct file *fp; - struct vnode *vp; + struct file *fp, *fptmp; struct smb_dev *sdp; struct smb_share *ssp; - struct cdev *dev; + struct thread *td; int error; - fp = nsmb_getfp(scred->scr_td->td_proc->p_fd, fd, FREAD | FWRITE); - if (fp == NULL) - return EBADF; - vp = fp->f_vnode; - if (vp == NULL) { - fdrop(fp, curthread); - return EBADF; - } - if (vp->v_type != VCHR) { - fdrop(fp, curthread); - return EBADF; - } - dev = vp->v_rdev; - SMB_CHECKMINOR(dev); + td = curthread; + error = fget(td, fd, CAP_READ, &fp); + if (error) + return (error); + fptmp = td->td_fpop; + td->td_fpop = fp; + error = devfs_get_cdevpriv((void **)&sdp); + td->td_fpop = fptmp; + fdrop(fp, td); + if (error || sdp == NULL) + return (error); + SMB_LOCK(); + *ssdp = sdp; ssp = sdp->sd_share; if (ssp == NULL) { - fdrop(fp, curthread); - return ENOTCONN; + SMB_UNLOCK(); + return (ENOTCONN); } error = smb_share_get(ssp, LK_EXCLUSIVE, scred); - if (error == 0) + if (error == 0) { + sdp->refcount++; *sspp = ssp; - fdrop(fp, curthread); + } + SMB_UNLOCK(); return error; } Modified: head/sys/netsmb/smb_dev.h ============================================================================== --- head/sys/netsmb/smb_dev.h Sat May 4 14:00:16 2013 (r250235) +++ head/sys/netsmb/smb_dev.h Sat May 4 14:03:18 2013 (r250236) @@ -155,22 +155,28 @@ struct smbioc_rw { STAILQ_HEAD(smbrqh, smb_rq); struct smb_dev { + struct cdev * dev; int sd_opened; int sd_level; struct smb_vc * sd_vc; /* reference to VC */ struct smb_share *sd_share; /* reference to share if any */ int sd_poll; int sd_seq; -/* struct ifqueue sd_rdqueue; - struct ifqueue sd_wrqueue; - struct selinfo sd_pollinfo; - struct smbrqh sd_rqlist; - struct smbrqh sd_rplist; - struct ucred *sd_owner;*/ int sd_flags; + int refcount; + int usecount; }; +extern struct sx smb_lock; +#define SMB_LOCK() sx_xlock(&smb_lock) +#define SMB_UNLOCK() sx_unlock(&smb_lock) +#define SMB_LOCKASSERT() sx_assert(&smb_lock, SA_XLOCKED) + struct smb_cred; + +void sdp_dtor(void *arg); +void sdp_trydestroy(struct smb_dev *dev); + /* * Compound user interface */ @@ -185,7 +191,7 @@ int smb_usr_simplerequest(struct smb_sh int smb_usr_t2request(struct smb_share *ssp, struct smbioc_t2rq *data, struct smb_cred *scred); int smb_dev2share(int fd, int mode, struct smb_cred *scred, - struct smb_share **sspp); + struct smb_share **sspp, struct smb_dev **ssdp); #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Sat May 4 14:18:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DFE6A7A1; Sat, 4 May 2013 14:18:11 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D21F61CF4; Sat, 4 May 2013 14:18:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44EIBIg001218; Sat, 4 May 2013 14:18:11 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44EIB0i001211; Sat, 4 May 2013 14:18:11 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305041418.r44EIB0i001211@svn.freebsd.org> From: Davide Italiano Date: Sat, 4 May 2013 14:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250237 - in head/sys: fs/smbfs netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 14:18:12 -0000 Author: davide Date: Sat May 4 14:18:10 2013 New Revision: 250237 URL: http://svnweb.freebsd.org/changeset/base/250237 Log: Overhaul locking in netsmb, getting rid of the obsolete lockmgr() primitive. This solves a long standing LOR between smb_conn and smb_vc. Tested by: martymac, pho (previous version) Modified: head/sys/fs/smbfs/smbfs_vfsops.c head/sys/netsmb/smb_conn.c head/sys/netsmb/smb_conn.h head/sys/netsmb/smb_dev.c Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Sat May 4 14:03:18 2013 (r250236) +++ head/sys/fs/smbfs/smbfs_vfsops.c Sat May 4 14:18:10 2013 (r250237) @@ -169,7 +169,7 @@ smbfs_mount(struct mount *mp) return error; } vcp = SSTOVC(ssp); - smb_share_unlock(ssp, 0); + smb_share_unlock(ssp); mp->mnt_stat.f_iosize = SSTOVC(ssp)->vc_txmax; mp->mnt_data = smp; smp->sm_share = ssp; @@ -286,7 +286,7 @@ smbfs_unmount(struct mount *mp, int mntf return error; scred = smbfs_malloc_scred(); smb_makescred(scred, td, td->td_ucred); - error = smb_share_lock(smp->sm_share, LK_EXCLUSIVE); + error = smb_share_lock(smp->sm_share); if (error) goto out; smb_share_put(smp->sm_share, scred); Modified: head/sys/netsmb/smb_conn.c ============================================================================== --- head/sys/netsmb/smb_conn.c Sat May 4 14:03:18 2013 (r250236) +++ head/sys/netsmb/smb_conn.c Sat May 4 14:18:10 2013 (r250237) @@ -59,8 +59,6 @@ static MALLOC_DEFINE(M_SMBCONN, "smb_con static void smb_co_init(struct smb_connobj *cp, int level, char *ilockname, char *lockname); static void smb_co_done(struct smb_connobj *cp); -static int smb_co_lockstatus(struct smb_connobj *cp); - static int smb_vc_disconnect(struct smb_vc *vcp); static void smb_vc_free(struct smb_connobj *cp); static void smb_vc_gone(struct smb_connobj *cp, struct smb_cred *scred); @@ -77,7 +75,9 @@ smb_sm_init(void) { smb_co_init(&smb_vclist, SMBL_SM, "smbsm ilock", "smbsm"); - smb_co_unlock(&smb_vclist, 0); + sx_xlock(&smb_vclist.co_interlock); + smb_co_unlock(&smb_vclist); + sx_unlock(&smb_vclist.co_interlock); return 0; } @@ -90,23 +90,29 @@ smb_sm_done(void) SMBERROR("%d connections still active\n", smb_vclist.co_usecount - 1); return EBUSY; } - lockmgr(&smb_vclist.co_lock, LK_DRAIN, NULL); smb_co_done(&smb_vclist); return 0; } static int -smb_sm_lockvclist(int flags) +smb_sm_lockvclist(void) { + int error; + + sx_xlock(&smb_vclist.co_interlock); + error = smb_co_lock(&smb_vclist); + sx_unlock(&smb_vclist.co_interlock); - return smb_co_lock(&smb_vclist, flags | LK_CANRECURSE); + return error; } static void smb_sm_unlockvclist(void) { - smb_co_unlock(&smb_vclist, LK_RELEASE); + sx_xlock(&smb_vclist.co_interlock); + smb_co_unlock(&smb_vclist); + sx_unlock(&smb_vclist.co_interlock); } static int @@ -123,7 +129,7 @@ smb_sm_lookupint(struct smb_vcspec *vcsp vcp = NULL; SMBCO_FOREACH(scp, &smb_vclist) { vcp = (struct smb_vc *)scp; - error = smb_vc_lock(vcp, LK_EXCLUSIVE); + error = smb_vc_lock(vcp); if (error) continue; @@ -160,7 +166,7 @@ smb_sm_lookupint(struct smb_vcspec *vcsp err1: error = 1; fail: - smb_vc_unlock(vcp, 0); + smb_vc_unlock(vcp); } if (vcp) { smb_vc_ref(vcp); @@ -179,7 +185,7 @@ smb_sm_lookup(struct smb_vcspec *vcspec, *vcpp = vcp = NULL; - error = smb_sm_lockvclist(LK_EXCLUSIVE); + error = smb_sm_lockvclist(); if (error) return error; error = smb_sm_lookupint(vcspec, shspec, scred, vcpp); @@ -211,7 +217,7 @@ out: if (error == 0) *vcpp = vcp; else if (vcp) { - smb_vc_lock(vcp, LK_EXCLUSIVE); + smb_vc_lock(vcp); smb_vc_put(vcp, scred); } return error; @@ -224,20 +230,26 @@ static void smb_co_init(struct smb_connobj *cp, int level, char *ilockname, char *lockname) { SLIST_INIT(&cp->co_children); - smb_sl_init(&cp->co_interlock, ilockname); - lockinit(&cp->co_lock, PZERO, lockname, 0, 0); + sx_init_flags(&cp->co_interlock, ilockname, SX_RECURSE); + cv_init(&cp->co_lock, "smblock"); + cp->co_lockcnt = 0; + cp->co_locker = NULL; cp->co_level = level; cp->co_usecount = 1; - if (smb_co_lock(cp, LK_EXCLUSIVE) != 0) - panic("smb_co_init: lock failed"); + sx_xlock(&cp->co_interlock); + smb_co_lock(cp); + sx_unlock(&cp->co_interlock); } static void smb_co_done(struct smb_connobj *cp) { - smb_sl_destroy(&cp->co_interlock); - lockmgr(&cp->co_lock, LK_RELEASE, NULL); - lockdestroy(&cp->co_lock); + + sx_destroy(&cp->co_interlock); + cv_destroy(&cp->co_lock); + cp->co_locker = NULL; + cp->co_flags = 0; + cp->co_lockcnt = 0; } static void @@ -249,7 +261,9 @@ smb_co_gone(struct smb_connobj *cp, stru cp->co_gone(cp, scred); parent = cp->co_parent; if (parent) { - smb_co_lock(parent, LK_EXCLUSIVE); + sx_xlock(&parent->co_interlock); + smb_co_lock(parent); + sx_unlock(&parent->co_interlock); SLIST_REMOVE(&parent->co_children, cp, smb_connobj, co_next); smb_co_put(parent, scred); } @@ -261,56 +275,51 @@ void smb_co_ref(struct smb_connobj *cp) { - SMB_CO_LOCK(cp); + sx_xlock(&cp->co_interlock); cp->co_usecount++; - SMB_CO_UNLOCK(cp); + sx_unlock(&cp->co_interlock); } void smb_co_rele(struct smb_connobj *cp, struct smb_cred *scred) { - SMB_CO_LOCK(cp); + sx_xlock(&cp->co_interlock); + smb_co_unlock(cp); if (cp->co_usecount > 1) { cp->co_usecount--; - SMB_CO_UNLOCK(cp); + sx_unlock(&cp->co_interlock); return; } if (cp->co_usecount == 0) { SMBERROR("negative use_count for object %d", cp->co_level); - SMB_CO_UNLOCK(cp); + sx_unlock(&cp->co_interlock); return; } cp->co_usecount--; cp->co_flags |= SMBO_GONE; - - lockmgr(&cp->co_lock, LK_DRAIN | LK_INTERLOCK, &cp->co_interlock); + sx_unlock(&cp->co_interlock); smb_co_gone(cp, scred); } int -smb_co_get(struct smb_connobj *cp, int flags, struct smb_cred *scred) +smb_co_get(struct smb_connobj *cp, struct smb_cred *scred) { int error; - if ((flags & LK_INTERLOCK) == 0) - SMB_CO_LOCK(cp); + MPASS(sx_xholder(&cp->co_interlock) == curthread); cp->co_usecount++; - error = smb_co_lock(cp, flags | LK_INTERLOCK); - if (error) { - SMB_CO_LOCK(cp); + error = smb_co_lock(cp); + if (error) cp->co_usecount--; - SMB_CO_UNLOCK(cp); - return error; - } - return 0; + return error; } void smb_co_put(struct smb_connobj *cp, struct smb_cred *scred) { - SMB_CO_LOCK(cp); + sx_xlock(&cp->co_interlock); if (cp->co_usecount > 1) { cp->co_usecount--; } else if (cp->co_usecount == 1) { @@ -319,50 +328,51 @@ smb_co_put(struct smb_connobj *cp, struc } else { SMBERROR("negative usecount"); } - lockmgr(&cp->co_lock, LK_RELEASE | LK_INTERLOCK, &cp->co_interlock); + smb_co_unlock(cp); + sx_unlock(&cp->co_interlock); if ((cp->co_flags & SMBO_GONE) == 0) return; - lockmgr(&cp->co_lock, LK_DRAIN, NULL); smb_co_gone(cp, scred); } int -smb_co_lockstatus(struct smb_connobj *cp) +smb_co_lock(struct smb_connobj *cp) { - return lockstatus(&cp->co_lock); -} -int -smb_co_lock(struct smb_connobj *cp, int flags) -{ - - if (cp->co_flags & SMBO_GONE) - return EINVAL; - if ((flags & LK_TYPE_MASK) == 0) - flags |= LK_EXCLUSIVE; - if (smb_co_lockstatus(cp) == LK_EXCLUSIVE && - (flags & LK_CANRECURSE) == 0) { - SMBERROR("recursive lock for object %d\n", cp->co_level); - return 0; + MPASS(sx_xholder(&cp->co_interlock) == curthread); + for (;;) { + if (cp->co_flags & SMBO_GONE) + return EINVAL; + if (cp->co_locker == NULL) { + cp->co_locker = curthread; + return 0; + } + if (cp->co_locker == curthread) { + cp->co_lockcnt++; + return 0; + } + cv_wait(&cp->co_lock, &cp->co_interlock); } - return lockmgr(&cp->co_lock, flags, &cp->co_interlock); } void -smb_co_unlock(struct smb_connobj *cp, int flags) +smb_co_unlock(struct smb_connobj *cp) { - (void)lockmgr(&cp->co_lock, flags | LK_RELEASE, &cp->co_interlock); + + MPASS(sx_xholder(&cp->co_interlock) == curthread); + MPASS(cp->co_locker == curthread); + if (cp->co_lockcnt != 0) { + cp->co_lockcnt--; + return; + } + cp->co_locker = NULL; + cv_signal(&cp->co_lock); } static void smb_co_addchild(struct smb_connobj *parent, struct smb_connobj *child) { - KASSERT(smb_co_lockstatus(parent) == LK_EXCLUSIVE, - ("smb_co_addchild: parent not locked")); - KASSERT(smb_co_lockstatus(child) == LK_EXCLUSIVE, - ("smb_co_addchild: child not locked")); - smb_co_ref(parent); SLIST_INSERT_HEAD(&parent->co_children, child, co_next); child->co_parent = parent; @@ -543,9 +553,16 @@ smb_vc_rele(struct smb_vc *vcp, struct s } int -smb_vc_get(struct smb_vc *vcp, int flags, struct smb_cred *scred) +smb_vc_get(struct smb_vc *vcp, struct smb_cred *scred) { - return smb_co_get(VCTOCP(vcp), flags, scred); + struct smb_connobj *cp; + int error; + + cp = VCTOCP(vcp); + sx_xlock(&cp->co_interlock); + error = smb_co_get(cp, scred); + sx_unlock(&cp->co_interlock); + return error; } void @@ -555,15 +572,28 @@ smb_vc_put(struct smb_vc *vcp, struct sm } int -smb_vc_lock(struct smb_vc *vcp, int flags) +smb_vc_lock(struct smb_vc *vcp) { - return smb_co_lock(VCTOCP(vcp), flags); + struct smb_connobj *cp; + int error; + + cp = VCTOCP(vcp); + sx_xlock(&cp->co_interlock); + error = smb_co_lock(cp); + sx_unlock(&cp->co_interlock); + return error; } void -smb_vc_unlock(struct smb_vc *vcp, int flags) +smb_vc_unlock(struct smb_vc *vcp) { - smb_co_unlock(VCTOCP(vcp), flags); + + struct smb_connobj *cp; + + cp = VCTOCP(vcp); + sx_xlock(&cp->co_interlock); + smb_co_unlock(cp); + sx_unlock(&cp->co_interlock); } int @@ -623,12 +653,12 @@ smb_vc_lookupshare(struct smb_vc *vcp, s dp->scred = scred; SMBCO_FOREACH(scp, VCTOCP(vcp)) { ssp = (struct smb_share *)scp; - error = smb_share_lock(ssp, LK_EXCLUSIVE); + error = smb_share_lock(ssp); if (error) continue; if (smb_vc_cmpshare(ssp, dp) == 0) break; - smb_share_unlock(ssp, 0); + smb_share_unlock(ssp); } if (ssp) { smb_share_ref(ssp); @@ -690,10 +720,10 @@ u_short smb_vc_nextmid(struct smb_vc *vcp) { u_short r; - - SMB_CO_LOCK(&vcp->obj); + + sx_xlock(&vcp->obj.co_interlock); r = vcp->vc_mid++; - SMB_CO_UNLOCK(&vcp->obj); + sx_unlock(&vcp->obj.co_interlock); return r; } @@ -784,27 +814,46 @@ smb_share_rele(struct smb_share *ssp, st } int -smb_share_get(struct smb_share *ssp, int flags, struct smb_cred *scred) +smb_share_get(struct smb_share *ssp, struct smb_cred *scred) { - return smb_co_get(SSTOCP(ssp), flags, scred); + struct smb_connobj *cp = SSTOCP(ssp); + int error; + + sx_xlock(&cp->co_interlock); + error = smb_co_get(cp, scred); + sx_unlock(&cp->co_interlock); + return error; } void smb_share_put(struct smb_share *ssp, struct smb_cred *scred) { + smb_co_put(SSTOCP(ssp), scred); } int -smb_share_lock(struct smb_share *ssp, int flags) +smb_share_lock(struct smb_share *ssp) { - return smb_co_lock(SSTOCP(ssp), flags); + struct smb_connobj *cp; + int error; + + cp = SSTOCP(ssp); + sx_xlock(&cp->co_interlock); + error = smb_co_lock(cp); + sx_unlock(&cp->co_interlock); + return error; } void -smb_share_unlock(struct smb_share *ssp, int flags) +smb_share_unlock(struct smb_share *ssp) { - smb_co_unlock(SSTOCP(ssp), flags); + struct smb_connobj *cp; + + cp = SSTOCP(ssp); + sx_xlock(&cp->co_interlock); + smb_co_unlock(cp); + sx_unlock(&cp->co_interlock); } int @@ -878,34 +927,34 @@ smb_sysctl_treedump(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error) return (error); - error = smb_sm_lockvclist(LK_SHARED); + error = smb_sm_lockvclist(); if (error) return error; SMBCO_FOREACH(scp1, &smb_vclist) { vcp = (struct smb_vc *)scp1; - error = smb_vc_lock(vcp, LK_SHARED); + error = smb_vc_lock(vcp); if (error) continue; smb_vc_getinfo(vcp, &vci); error = SYSCTL_OUT(req, &vci, sizeof(struct smb_vc_info)); if (error) { - smb_vc_unlock(vcp, 0); + smb_vc_unlock(vcp); break; } SMBCO_FOREACH(scp2, VCTOCP(vcp)) { ssp = (struct smb_share *)scp2; - error = smb_share_lock(ssp, LK_SHARED); + error = smb_share_lock(ssp); if (error) { error = 0; continue; } smb_share_getinfo(ssp, &ssi); - smb_share_unlock(ssp, 0); + smb_share_unlock(ssp); error = SYSCTL_OUT(req, &ssi, sizeof(struct smb_share_info)); if (error) break; } - smb_vc_unlock(vcp, 0); + smb_vc_unlock(vcp); if (error) break; } Modified: head/sys/netsmb/smb_conn.h ============================================================================== --- head/sys/netsmb/smb_conn.h Sat May 4 14:03:18 2013 (r250236) +++ head/sys/netsmb/smb_conn.h Sat May 4 14:18:10 2013 (r250237) @@ -158,9 +158,11 @@ struct smb_share_info { #ifdef _KERNEL -#include -#include #include +#include +#include +#include +#include #define CONNADDREQ(a1,a2) ((a1)->sa_len == (a2)->sa_len && \ bcmp(a1, a2, (a1)->sa_len) == 0) @@ -190,14 +192,13 @@ struct smb_connobj; typedef void smb_co_gone_t (struct smb_connobj *cp, struct smb_cred *scred); typedef void smb_co_free_t (struct smb_connobj *cp); -#define SMB_CO_LOCK(cp) smb_sl_lock(&(cp)->co_interlock) -#define SMB_CO_UNLOCK(cp) smb_sl_unlock(&(cp)->co_interlock) - struct smb_connobj { + struct cv co_lock; + struct thread *co_locker; + struct sx co_interlock; + int co_lockcnt; int co_level; /* SMBL_ */ int co_flags; - struct lock co_lock; - struct smb_slock co_interlock; int co_usecount; struct smb_connobj * co_parent; SLIST_HEAD(,smb_connobj)co_children; @@ -225,7 +226,6 @@ struct smb_connobj { #define SMBC_ST_LOCK(vcp) smb_sl_lock(&(vcp)->vc_stlock) #define SMBC_ST_UNLOCK(vcp) smb_sl_unlock(&(vcp)->vc_stlock) - struct smb_vc { struct smb_connobj obj; char * vc_srvname; @@ -361,10 +361,10 @@ int smb_sm_lookup(struct smb_vcspec *vc */ void smb_co_ref(struct smb_connobj *cp); void smb_co_rele(struct smb_connobj *cp, struct smb_cred *scred); -int smb_co_get(struct smb_connobj *cp, int flags, struct smb_cred *scred); +int smb_co_get(struct smb_connobj *cp, struct smb_cred *scred); void smb_co_put(struct smb_connobj *cp, struct smb_cred *scred); -int smb_co_lock(struct smb_connobj *cp, int flags); -void smb_co_unlock(struct smb_connobj *cp, int flags); +int smb_co_lock(struct smb_connobj *cp); +void smb_co_unlock(struct smb_connobj *cp); /* * session level functions @@ -373,12 +373,12 @@ int smb_vc_create(struct smb_vcspec *vc struct smb_cred *scred, struct smb_vc **vcpp); int smb_vc_connect(struct smb_vc *vcp, struct smb_cred *scred); int smb_vc_access(struct smb_vc *vcp, struct smb_cred *scred, mode_t mode); -int smb_vc_get(struct smb_vc *vcp, int flags, struct smb_cred *scred); +int smb_vc_get(struct smb_vc *vcp, struct smb_cred *scred); void smb_vc_put(struct smb_vc *vcp, struct smb_cred *scred); void smb_vc_ref(struct smb_vc *vcp); void smb_vc_rele(struct smb_vc *vcp, struct smb_cred *scred); -int smb_vc_lock(struct smb_vc *vcp, int flags); -void smb_vc_unlock(struct smb_vc *vcp, int flags); +int smb_vc_lock(struct smb_vc *vcp); +void smb_vc_unlock(struct smb_vc *vcp); int smb_vc_lookupshare(struct smb_vc *vcp, struct smb_sharespec *shspec, struct smb_cred *scred, struct smb_share **sspp); const char * smb_vc_getpass(struct smb_vc *vcp); @@ -392,10 +392,10 @@ int smb_share_create(struct smb_vc *vcp int smb_share_access(struct smb_share *ssp, struct smb_cred *scred, mode_t mode); void smb_share_ref(struct smb_share *ssp); void smb_share_rele(struct smb_share *ssp, struct smb_cred *scred); -int smb_share_get(struct smb_share *ssp, int flags, struct smb_cred *scred); +int smb_share_get(struct smb_share *ssp, struct smb_cred *scred); void smb_share_put(struct smb_share *ssp, struct smb_cred *scred); -int smb_share_lock(struct smb_share *ssp, int flags); -void smb_share_unlock(struct smb_share *ssp, int flags); +int smb_share_lock(struct smb_share *ssp); +void smb_share_unlock(struct smb_share *ssp); void smb_share_invalidate(struct smb_share *ssp); int smb_share_valid(struct smb_share *ssp); const char * smb_share_getpass(struct smb_share *ssp); Modified: head/sys/netsmb/smb_dev.c ============================================================================== --- head/sys/netsmb/smb_dev.c Sat May 4 14:03:18 2013 (r250236) +++ head/sys/netsmb/smb_dev.c Sat May 4 14:18:10 2013 (r250237) @@ -156,11 +156,15 @@ sdp_trydestroy(struct smb_dev *sdp) scred = malloc(sizeof(struct smb_cred), M_NSMBDEV, M_WAITOK); smb_makescred(scred, curthread, NULL); ssp = sdp->sd_share; - if (ssp != NULL) + if (ssp != NULL) { + smb_share_lock(ssp); smb_share_rele(ssp, scred); + } vcp = sdp->sd_vc; - if (vcp != NULL) + if (vcp != NULL) { + smb_vc_lock(vcp); smb_vc_rele(vcp, scred); + } free(scred, M_NSMBDEV); free(sdp, M_NSMBDEV); return; @@ -193,7 +197,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long if (error) break; sdp->sd_vc = vcp; - smb_vc_unlock(vcp, 0); + smb_vc_unlock(vcp); sdp->sd_level = SMBL_VC; break; case SMBIOC_OPENSHARE: @@ -210,7 +214,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long if (error) break; sdp->sd_share = ssp; - smb_share_unlock(ssp, 0); + smb_share_unlock(ssp); sdp->sd_level = SMBL_SHARE; break; case SMBIOC_REQUEST: @@ -240,7 +244,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long error = ENOTCONN; goto out; } - error = smb_vc_get(vcp, LK_EXCLUSIVE, scred); + error = smb_vc_get(vcp, scred); if (error) break; if (on && (vcp->obj.co_flags & SMBV_PERMANENT) == 0) { @@ -260,7 +264,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long error = ENOTCONN; goto out; } - error = smb_share_get(ssp, LK_EXCLUSIVE, scred); + error = smb_share_get(ssp, scred); if (error) break; if (on && (ssp->obj.co_flags & SMBS_PERMANENT) == 0) { @@ -290,12 +294,12 @@ nsmb_dev_ioctl(struct cdev *dev, u_long break; if (vcp) { sdp->sd_vc = vcp; - smb_vc_unlock(vcp, 0); + smb_vc_unlock(vcp); sdp->sd_level = SMBL_VC; } if (ssp) { sdp->sd_share = ssp; - smb_share_unlock(ssp, 0); + smb_share_unlock(ssp); sdp->sd_level = SMBL_SHARE; } break; @@ -398,7 +402,7 @@ smb_dev2share(int fd, int mode, struct s SMB_UNLOCK(); return (ENOTCONN); } - error = smb_share_get(ssp, LK_EXCLUSIVE, scred); + error = smb_share_get(ssp, scred); if (error == 0) { sdp->refcount++; *sspp = ssp; From owner-svn-src-all@FreeBSD.ORG Sat May 4 14:21:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4E90B981 for ; Sat, 4 May 2013 14:21:33 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com [IPv6:2a00:1450:4010:c03::22e]) by mx1.freebsd.org (Postfix) with ESMTP id C7FC91D0A for ; Sat, 4 May 2013 14:21:32 +0000 (UTC) Received: by mail-la0-f46.google.com with SMTP id fk20so2263631lab.19 for ; Sat, 04 May 2013 07:21:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=glWyhahccLBnIUAeHYrGWWWWdhCsru1MrxFbQzPizGg=; b=e1CMRRWj1x50t7KkcSmhh/zfTNRUbjDVS++IQ2U9jMcnOhtzR/i6X8CPuf9NVRSUKS CweJQO1cO+ofsZiYpak22xG1USIkAeasyIbWx0VrasGYdtrk0krgmMBYjdG48a6rewv5 kL2t9LGmwezoo3GSGvE/DZ83Z6BcrT5LX2yAc4Fdaa9Qkyk5Sn8mdn7JOTOgc4V6b26X O7YqZfhGSqfwsNFy4l8T/mI167DDp2pDjQDhoc5g6psPly3Z4Cio+defu/NN9k7ZpCtF i+7glYoTdy8QmxNhSDkiixtVMDIjmwJkmJLjFMHjOM+38GN36MnXY/SJiUj0vnUFT6pR 5mJw== X-Received: by 10.112.160.66 with SMTP id xi2mr5632608lbb.97.1367677291555; Sat, 04 May 2013 07:21:31 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id s1sm5929074lag.2.2013.05.04.07.21.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 04 May 2013 07:21:31 -0700 (PDT) Message-ID: <51851969.6020802@freebsd.org> Date: Sat, 04 May 2013 18:21:29 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Sergey Kandaurov Subject: Re: svn commit: r250215 - stable/9/lib/libc/locale References: <201305031552.r43FqiPN024580@svn.freebsd.org> <5183E899.4000503@freebsd.org> <20130503195540.GA52657@stack.nl> <5184ED7E.3040703@freebsd.org> In-Reply-To: OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmYZf6ULcZRODKxMy6sMD6qnwlb2N+6cUJSPTq6tHIrqq40B0KlPihV4bTzJS5N9CclZU2f Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org, Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 14:21:33 -0000 On 04.05.2013 16:03, Sergey Kandaurov wrote: >> BTW, I don't run tests and look in asm code for sure, but it seems >> property[0] == p[0] is unneeded because almost every compiler tries to >> inline strcmp(). > > Doesn't seem so (in-lining), see below. Yes, system's GNU cc don't inline strcmp() but inlines memcmp(): repz cmpsb I don't have clang nearby right now to test what it does. -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Sat May 4 14:27:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 79D50C31; Sat, 4 May 2013 14:27:29 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 513C21D34; Sat, 4 May 2013 14:27:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44ERTQo004466; Sat, 4 May 2013 14:27:29 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44ERTRT004465; Sat, 4 May 2013 14:27:29 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305041427.r44ERTRT004465@svn.freebsd.org> From: Davide Italiano Date: Sat, 4 May 2013 14:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250238 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 14:27:29 -0000 Author: davide Date: Sat May 4 14:27:28 2013 New Revision: 250238 URL: http://svnweb.freebsd.org/changeset/base/250238 Log: Change VM_OBJECT_LOCK/UNLOCK() -> VM_OBJECT_WLOCK/WUNLOCK() to reflect the recent switch of the vm object lock to a rwlock. Reported by: attilio Modified: head/sys/fs/smbfs/smbfs_io.c Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Sat May 4 14:18:10 2013 (r250237) +++ head/sys/fs/smbfs/smbfs_io.c Sat May 4 14:27:28 2013 (r250238) @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -460,7 +461,7 @@ smbfs_getpages(ap) */ m = pages[reqpage]; - VM_OBJECT_LOCK(object); + VM_OBJECT_WLOCK(object); if (m->valid != 0) { for (i = 0; i < npages; ++i) { if (i != reqpage) { @@ -469,10 +470,10 @@ smbfs_getpages(ap) vm_page_unlock(pages[i]); } } - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); return 0; } - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); scred = smbfs_malloc_scred(); smb_makescred(scred, td, cred); @@ -500,7 +501,7 @@ smbfs_getpages(ap) relpbuf(bp, &smbfs_pbuf_freecnt); - VM_OBJECT_LOCK(object); + VM_OBJECT_WLOCK(object); if (error && (uio.uio_resid == count)) { printf("smbfs_getpages: error %d\n",error); for (i = 0; i < npages; i++) { @@ -510,7 +511,7 @@ smbfs_getpages(ap) vm_page_unlock(pages[i]); } } - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); return VM_PAGER_ERROR; } @@ -548,7 +549,7 @@ smbfs_getpages(ap) if (i != reqpage) vm_page_readahead_finish(m); } - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); return 0; #endif /* SMBFS_RWGENERIC */ } @@ -667,9 +668,9 @@ smbfs_vinvalbuf(struct vnode *vp, struct np->n_flag |= NFLUSHINPROG; if (vp->v_bufobj.bo_object != NULL) { - VM_OBJECT_LOCK(vp->v_bufobj.bo_object); + VM_OBJECT_WLOCK(vp->v_bufobj.bo_object); vm_object_page_clean(vp->v_bufobj.bo_object, 0, 0, OBJPC_SYNC); - VM_OBJECT_UNLOCK(vp->v_bufobj.bo_object); + VM_OBJECT_WUNLOCK(vp->v_bufobj.bo_object); } error = vinvalbuf(vp, V_SAVE, PCATCH, 0); From owner-svn-src-all@FreeBSD.ORG Sat May 4 15:10:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B36DE4C5; Sat, 4 May 2013 15:10:01 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A56AC1EE6; Sat, 4 May 2013 15:10:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44FA1G3019097; Sat, 4 May 2013 15:10:01 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44FA1kB019096; Sat, 4 May 2013 15:10:01 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201305041510.r44FA1kB019096@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 4 May 2013 15:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250239 - head/share/man/man4/man4.i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 15:10:01 -0000 Author: gavin Date: Sat May 4 15:10:01 2013 New Revision: 250239 URL: http://svnweb.freebsd.org/changeset/base/250239 Log: Kill yet another reference to UserConfig Modified: head/share/man/man4/man4.i386/npx.4 Modified: head/share/man/man4/man4.i386/npx.4 ============================================================================== --- head/share/man/man4/man4.i386/npx.4 Sat May 4 14:27:28 2013 (r250238) +++ head/share/man/man4/man4.i386/npx.4 Sat May 4 15:10:01 2013 (r250239) @@ -99,7 +99,7 @@ The flags can be used to control cases where it does not work or is slower. Setting them at boot time -using userconfig works correctly +using hints works correctly (the optimizations are not used until later in the bootstrap when From owner-svn-src-all@FreeBSD.ORG Sat May 4 15:42:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6933AAD8; Sat, 4 May 2013 15:42:56 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4AB28128; Sat, 4 May 2013 15:42:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44Fgucs031526; Sat, 4 May 2013 15:42:56 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44FguPv031525; Sat, 4 May 2013 15:42:56 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201305041542.r44FguPv031525@svn.freebsd.org> From: Hiroki Sato Date: Sat, 4 May 2013 15:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250240 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 15:42:56 -0000 Author: hrs Date: Sat May 4 15:42:55 2013 New Revision: 250240 URL: http://svnweb.freebsd.org/changeset/base/250240 Log: - Fix exit status when ip6addrctl_verbose=yes [*] - Use the absolute pathname for ip6addrctl. - Use "install" instead of "add" to reduce the number of invocations. Reported by: Tatsuki Makino [*] PR: conf/175006 [*] MFC after: 1 week Modified: head/etc/rc.d/ip6addrctl Modified: head/etc/rc.d/ip6addrctl ============================================================================== --- head/etc/rc.d/ip6addrctl Sat May 4 15:10:01 2013 (r250239) +++ head/etc/rc.d/ip6addrctl Sat May 4 15:42:55 2013 (r250240) @@ -24,38 +24,42 @@ config_file="/etc/ip6addrctl.conf" set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces set_rcvar_obsolete ipv6_prefer ip6addrctl_policy +IP6ADDRCTL_CMD="/usr/sbin/ip6addrctl" + ip6addrctl_prefer_ipv6() { afexists inet6 || return 0 - ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::1/128 50 0 - ip6addrctl add ::/0 40 1 - ip6addrctl add ::ffff:0:0/96 35 4 - ip6addrctl add 2002::/16 30 2 - ip6addrctl add 2001::/32 5 5 - ip6addrctl add fc00::/7 3 13 - ip6addrctl add ::/96 1 3 - ip6addrctl add fec0::/10 1 11 - ip6addrctl add 3ffe::/16 1 12 - checkyesno ip6addrctl_verbose && ip6addrctl + ${IP6ADDRCTL_CMD} flush >/dev/null 2>&1 + cat </dev/null 2>&1 - ip6addrctl add ::1/128 50 0 - ip6addrctl add ::/0 40 1 - ip6addrctl add ::ffff:0:0/96 100 4 - ip6addrctl add 2002::/16 30 2 - ip6addrctl add 2001::/32 5 5 - ip6addrctl add fc00::/7 3 13 - ip6addrctl add ::/96 1 3 - ip6addrctl add fec0::/10 1 11 - ip6addrctl add 3ffe::/16 1 12 - checkyesno ip6addrctl_verbose && ip6addrctl + ${IP6ADDRCTL_CMD} flush >/dev/null 2>&1 + cat </dev/null 2>&1 - ip6addrctl install "${config_file}" - checkyesno ip6addrctl_verbose && ip6addrctl + ${IP6ADDRCTL_CMD} flush >/dev/null 2>&1 + ${IP6ADDRCTL_CMD} install "${config_file}" else if checkyesno ipv6_activate_all_interfaces; then ip6addrctl_prefer_ipv6 @@ -92,7 +95,7 @@ ip6addrctl_start() ip6addrctl_prefer_ipv4 ;; [Nn][Oo][Nn][Ee]) - ip6addrctl flush >/dev/null 2>&1 + ${IP6ADDRCTL_CMD} flush >/dev/null 2>&1 ;; *) warn "\$ip6addrctl_policy is invalid: ${ip6addrctl_policy}. " \ @@ -100,6 +103,11 @@ ip6addrctl_start() ip6addrctl_prefer_ipv4 ;; esac + + if checkyesno ip6addrctl_verbose; then + echo 'Address selection policy table for IPv4 and IPv6:' + ${IP6ADDRCTL_CMD} + fi } ip6addrctl_stop() From owner-svn-src-all@FreeBSD.ORG Sat May 4 15:43:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5AAE8C49; Sat, 4 May 2013 15:43:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CF1112C; Sat, 4 May 2013 15:43:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44FhApG031619; Sat, 4 May 2013 15:43:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44Fh9iI031615; Sat, 4 May 2013 15:43:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305041543.r44Fh9iI031615@svn.freebsd.org> From: Dimitry Andric Date: Sat, 4 May 2013 15:43:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250241 - stable/9/contrib/libcxxrt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 15:43:10 -0000 Author: dim Date: Sat May 4 15:43:09 2013 New Revision: 250241 URL: http://svnweb.freebsd.org/changeset/base/250241 Log: MFC r245304 (by theraven): Merge new version of libcxxrt. This brings in three fixes: - Don't treat pointers to members as pointers in catch blocks (they're usually fat pointers). - Correctly catch foreign exceptions in catchalls. - Ensure that a happens-before relationship is established when setting terminate handlers in one thread and calling them in another. MFC r245327 (by theraven): Fix libcxxrt / libc++ build with the clang in head. Pointy hat to: theraven MFC r245745 (by theraven): Import new fix from libcxxrt. This fixes the case where you attempt to rethrow an exception when you haven't caught one. This is largely a cosmetic fix, as (unless you have a very unusual terminate handler installed) it will print a nice error and then abort, rather than just aborting. MFC r246462 (by theraven): Fix a copy-and-paste error in libcxxrt. MFC r249993: Merge libcxxrt c812a07cd2f95c1403baf0bbe0366e7618d1d6d3: * Don't call the _fast version of the TLS accessor in terminate() or unexpected(). 1) TLS may not have been set up yet. 2) When we're in one of these functions, Really Bad Stuff has happened and potentially saving a few cycles really isn't important. * Merge in fixes from FreeBSD trunk to make atomics work with recent clang. Added: stable/9/contrib/libcxxrt/atomic.h - copied, changed from r245304, head/contrib/libcxxrt/atomic.h Modified: stable/9/contrib/libcxxrt/exception.cc stable/9/contrib/libcxxrt/memory.cc stable/9/contrib/libcxxrt/typeinfo.h Directory Properties: stable/9/contrib/libcxxrt/ (props changed) Copied and modified: stable/9/contrib/libcxxrt/atomic.h (from r245304, head/contrib/libcxxrt/atomic.h) ============================================================================== --- head/contrib/libcxxrt/atomic.h Fri Jan 11 15:05:55 2013 (r245304, copy source) +++ stable/9/contrib/libcxxrt/atomic.h Sat May 4 15:43:09 2013 (r250241) @@ -9,9 +9,9 @@ * Swap macro that enforces a happens-before relationship with a corresponding * ATOMIC_LOAD. */ -#if __has_feature(cxx_atomic) +#if __has_builtin(__c11_atomic_exchange) #define ATOMIC_SWAP(addr, val)\ - __atomic_exchange(addr, val, __ATOMIC_ACQ_REL) + __c11_atomic_exchange((_Atomic(__typeof__(val))*)addr, val, __ATOMIC_ACQ_REL) #elif __has_builtin(__sync_swap) #define ATOMIC_SWAP(addr, val)\ __sync_swap(addr, val) @@ -20,9 +20,9 @@ __sync_lock_test_and_set(addr, val) #endif -#if __has_feature(cxx_atomic) +#if __has_builtin(__c11_atomic_load) #define ATOMIC_LOAD(addr)\ - __atomic_load(addr, __ATOMIC_ACQUIRE) + __c11_atomic_load((_Atomic(__typeof__(*addr))*)addr, __ATOMIC_ACQUIRE) #else #define ATOMIC_LOAD(addr)\ (__sync_synchronize(), *addr) Modified: stable/9/contrib/libcxxrt/exception.cc ============================================================================== --- stable/9/contrib/libcxxrt/exception.cc Sat May 4 15:42:55 2013 (r250240) +++ stable/9/contrib/libcxxrt/exception.cc Sat May 4 15:43:09 2013 (r250241) @@ -32,6 +32,7 @@ #include #include "typeinfo.h" #include "dwarf_eh.h" +#include "atomic.h" #include "cxxabi.h" #pragma weak pthread_key_create @@ -155,6 +156,17 @@ struct __cxa_thread_info */ _Unwind_Exception *currentCleanup; /** + * Our state with respect to foreign exceptions. Usually none, set to + * caught if we have just caught an exception and rethrown if we are + * rethrowing it. + */ + enum + { + none, + caught, + rethrown + } foreign_exception_state; + /** * The public part of this structure, accessible from outside of this * module. */ @@ -308,7 +320,16 @@ static void thread_cleanup(void* thread_ __cxa_thread_info *info = (__cxa_thread_info*)thread_info; if (info->globals.caughtExceptions) { - free_exception_list(info->globals.caughtExceptions); + // If this is a foreign exception, ask it to clean itself up. + if (info->foreign_exception_state != __cxa_thread_info::none) + { + _Unwind_Exception *e = (_Unwind_Exception*)info->globals.caughtExceptions; + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + } + else + { + free_exception_list(info->globals.caughtExceptions); + } } free(thread_info); } @@ -780,7 +801,8 @@ extern "C" void __cxa_decrement_exceptio */ extern "C" void __cxa_rethrow() { - __cxa_eh_globals *globals = __cxa_get_globals(); + __cxa_thread_info *ti = thread_info(); + __cxa_eh_globals *globals = &ti->globals; // Note: We don't remove this from the caught list here, because // __cxa_end_catch will be called when we unwind out of the try block. We // could probably make this faster by providing an alternative rethrow @@ -795,6 +817,15 @@ extern "C" void __cxa_rethrow() std::terminate(); } + if (ti->foreign_exception_state != __cxa_thread_info::none) + { + ti->foreign_exception_state = __cxa_thread_info::rethrown; + _Unwind_Exception *e = (_Unwind_Exception*)ex; + _Unwind_Reason_Code err = _Unwind_Resume_or_Rethrow(e); + report_failure(err, ex); + return; + } + assert(ex->handlerCount > 0 && "Rethrowing uncaught exception!"); // ex->handlerCount will be decremented in __cxa_end_catch in enclosing @@ -848,9 +879,9 @@ static bool check_type_signature(__cxa_e void *&adjustedPtr) { void *exception_ptr = (void*)(ex+1); - const std::type_info *ex_type = ex->exceptionType; + const std::type_info *ex_type = ex ? ex->exceptionType : 0; - bool is_ptr = ex_type->__is_pointer_p(); + bool is_ptr = ex ? ex_type->__is_pointer_p() : false; if (is_ptr) { exception_ptr = *(void**)exception_ptr; @@ -911,8 +942,8 @@ static handler_type check_action_record( action_record = displacement ? action_record_offset_base + displacement : 0; // We only check handler types for C++ exceptions - foreign exceptions - // are only allowed for cleanup. - if (filter > 0 && 0 != ex) + // are only allowed for cleanups and catchalls. + if (filter > 0) { std::type_info *handler_type = get_type_info_entry(context, lsda, filter); if (check_type_signature(ex, handler_type, adjustedPtr)) @@ -1133,8 +1164,10 @@ extern "C" void *__cxa_begin_catch(void extern "C" void *__cxa_begin_catch(void *e) #endif { - // Decrement the uncaught exceptions count - __cxa_eh_globals *globals = __cxa_get_globals(); + // We can't call the fast version here, because if the first exception that + // we see is a foreign exception then we won't have called it yet. + __cxa_thread_info *ti = thread_info(); + __cxa_eh_globals *globals = &ti->globals; globals->uncaughtExceptions--; _Unwind_Exception *exceptionObject = (_Unwind_Exception*)e; @@ -1177,9 +1210,22 @@ extern "C" void *__cxa_begin_catch(void { ex->handlerCount++; } + ti->foreign_exception_state = __cxa_thread_info::none; return ex->adjustedPtr; } + else + { + // If this is a foreign exception, then we need to be able to + // store it. We can't chain foreign exceptions, so we give up + // if there are already some outstanding ones. + if (globals->caughtExceptions != 0) + { + std::terminate(); + } + globals->caughtExceptions = (__cxa_exception*)exceptionObject; + ti->foreign_exception_state = __cxa_thread_info::caught; + } // exceptionObject is the pointer to the _Unwind_Exception within the // __cxa_exception. The throw object is after this return ((char*)exceptionObject + sizeof(_Unwind_Exception)); @@ -1195,10 +1241,23 @@ extern "C" void __cxa_end_catch() { // We can call the fast version here because the slow version is called in // __cxa_throw(), which must have been called before we end a catch block - __cxa_eh_globals *globals = __cxa_get_globals_fast(); + __cxa_thread_info *ti = thread_info_fast(); + __cxa_eh_globals *globals = &ti->globals; __cxa_exception *ex = globals->caughtExceptions; assert(0 != ex && "Ending catch when no exception is on the stack!"); + + if (ti->foreign_exception_state != __cxa_thread_info::none) + { + globals->caughtExceptions = 0; + if (ti->foreign_exception_state != __cxa_thread_info::rethrown) + { + _Unwind_Exception *e = (_Unwind_Exception*)ti->globals.caughtExceptions; + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + } + ti->foreign_exception_state = __cxa_thread_info::none; + return; + } bool deleteException = true; @@ -1328,7 +1387,7 @@ namespace std { if (thread_local_handlers) { return pathscale::set_unexpected(f); } - return __sync_lock_test_and_set(&unexpectedHandler, f); + return ATOMIC_SWAP(&unexpectedHandler, f); } /** * Sets the function that is called to terminate the program. @@ -1336,7 +1395,8 @@ namespace std terminate_handler set_terminate(terminate_handler f) throw() { if (thread_local_handlers) { return pathscale::set_terminate(f); } - return __sync_lock_test_and_set(&terminateHandler, f); + + return ATOMIC_SWAP(&terminateHandler, f); } /** * Terminates the program, calling a custom terminate implementation if @@ -1344,7 +1404,7 @@ namespace std */ void terminate() { - static __cxa_thread_info *info = thread_info_fast(); + static __cxa_thread_info *info = thread_info(); if (0 != info && 0 != info->terminateHandler) { info->terminateHandler(); @@ -1361,7 +1421,7 @@ namespace std */ void unexpected() { - static __cxa_thread_info *info = thread_info_fast(); + static __cxa_thread_info *info = thread_info(); if (0 != info && 0 != info->unexpectedHandler) { info->unexpectedHandler(); @@ -1390,7 +1450,7 @@ namespace std { return info->unexpectedHandler; } - return unexpectedHandler; + return ATOMIC_LOAD(&unexpectedHandler); } /** * Returns the current terminate handler. @@ -1402,7 +1462,7 @@ namespace std { return info->terminateHandler; } - return terminateHandler; + return ATOMIC_LOAD(&terminateHandler); } } #ifdef __arm__ Modified: stable/9/contrib/libcxxrt/memory.cc ============================================================================== --- stable/9/contrib/libcxxrt/memory.cc Sat May 4 15:42:55 2013 (r250240) +++ stable/9/contrib/libcxxrt/memory.cc Sat May 4 15:43:09 2013 (r250241) @@ -36,14 +36,8 @@ #include #include #include "stdexcept.h" +#include "atomic.h" -#ifndef __has_builtin -#define __has_builtin(x) 0 -#endif - -#if !__has_builtin(__sync_swap) -#define __sync_swap __sync_lock_test_and_set -#endif namespace std { @@ -67,7 +61,12 @@ namespace std __attribute__((weak)) new_handler set_new_handler(new_handler handler) { - return __sync_swap(&new_handl, handler); + return ATOMIC_SWAP(&new_handl, handler); + } + __attribute__((weak)) + new_handler get_new_handler(void) + { + return ATOMIC_LOAD(&new_handl); } } @@ -75,12 +74,17 @@ namespace std __attribute__((weak)) void* operator new(size_t size) { + if (0 == size) + { + size = 1; + } void * mem = malloc(size); while (0 == mem) { - if (0 != new_handl) + new_handler h = std::get_new_handler(); + if (0 != h) { - new_handl(); + h(); } else { @@ -95,14 +99,19 @@ void* operator new(size_t size) __attribute__((weak)) void* operator new(size_t size, const std::nothrow_t &) throw() { + if (0 == size) + { + size = 1; + } void *mem = malloc(size); while (0 == mem) { - if (0 != new_handl) + new_handler h = std::get_new_handler(); + if (0 != h) { try { - new_handl(); + h(); } catch (...) { Modified: stable/9/contrib/libcxxrt/typeinfo.h ============================================================================== --- stable/9/contrib/libcxxrt/typeinfo.h Sat May 4 15:42:55 2013 (r250240) +++ stable/9/contrib/libcxxrt/typeinfo.h Sat May 4 15:43:09 2013 (r250241) @@ -70,6 +70,14 @@ namespace std */ public: /** + * Returns true if this is some pointer type, false otherwise. + */ + virtual bool __is_pointer_p() const { return false; } + /** + * Returns true if this is some function type, false otherwise. + */ + virtual bool __is_function_p() const { return false; } + /** * Catch function. Allows external libraries to implement * their own basic types. This is used, for example, in the * GNUstep Objective-C runtime to allow Objective-C types to be @@ -95,14 +103,6 @@ namespace std { return false; } - /** - * Returns true if this is some pointer type, false otherwise. - */ - virtual bool __is_pointer_p() const { return false; } - /** - * Returns true if this is some function type, false otherwise. - */ - virtual bool __is_function_p() const { return false; } }; } @@ -284,7 +284,6 @@ namespace ABI_NAMESPACE /** Pointer is a pointer to a member of an incomplete class. */ __incomplete_class_mask = 0x10 }; - virtual bool __is_pointer_p() const { return true; } virtual bool __do_catch(const type_info *thrown_type, void **thrown_object, unsigned outer) const; @@ -296,6 +295,7 @@ namespace ABI_NAMESPACE struct __pointer_type_info : public __pbase_type_info { virtual ~__pointer_type_info(); + virtual bool __is_pointer_p() const { return true; } }; /** From owner-svn-src-all@FreeBSD.ORG Sat May 4 16:41:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 667CB4C2; Sat, 4 May 2013 16:41:17 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48C0E327; Sat, 4 May 2013 16:41:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44GfGk7052044; Sat, 4 May 2013 16:41:16 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44GfEKJ052029; Sat, 4 May 2013 16:41:14 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <201305041641.r44GfEKJ052029@svn.freebsd.org> From: Stefan Farfeleder Date: Sat, 4 May 2013 16:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250242 - head/tools/regression/usr.bin/xargs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 16:41:17 -0000 Author: stefanf Date: Sat May 4 16:41:14 2013 New Revision: 250242 URL: http://svnweb.freebsd.org/changeset/base/250242 Log: Add a few xargs tests related to -0, -n and quoting. Added: head/tools/regression/usr.bin/xargs/regress.0.in (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0I.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0J.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0L.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.n1.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.n2.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.n3.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.quotes.in (contents, props changed) head/tools/regression/usr.bin/xargs/regress.quotes.out (contents, props changed) Modified: head/tools/regression/usr.bin/xargs/regress.sh Added: head/tools/regression/usr.bin/xargs/regress.0.in ============================================================================== Binary file. No diff available. Added: head/tools/regression/usr.bin/xargs/regress.0.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,8 @@ +quick ' brown +fox jumped +over "the lazy +dog +quick brown fox +jumped over the +lazy dog + Added: head/tools/regression/usr.bin/xargs/regress.0I.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0I.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,18 @@ +The quick ' brown quick ' brownquick ' brown quick ' brown +The fox jumped +over "the lazy fox jumped +over "the lazyfox jumped +over "the lazy fox jumped +over "the lazy +The +The dog +quick brown fox dog +quick brown foxdog +quick brown fox dog +quick brown fox +The jumped over the jumped over thejumped over the jumped over the +The lazy dog + lazy dog +lazy dog + lazy dog + Added: head/tools/regression/usr.bin/xargs/regress.0J.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0J.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,4 @@ +The quick ' brown fox jumped +over "the lazy dog +quick brown fox jumped over the lazy dog + again. Added: head/tools/regression/usr.bin/xargs/regress.0L.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0L.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,6 @@ +quick ' brown fox jumped +over "the lazy +dog +quick brown fox +jumped over the lazy dog + Added: head/tools/regression/usr.bin/xargs/regress.n1.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.n1.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,8 @@ +quick +brown +fox +jumped +over +the +lazy +dog Added: head/tools/regression/usr.bin/xargs/regress.n2.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.n2.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the +lazy dog Added: head/tools/regression/usr.bin/xargs/regress.n3.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.n3.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,3 @@ +quick brown fox +jumped over the +lazy dog Added: head/tools/regression/usr.bin/xargs/regress.quotes.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.quotes.in Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,4 @@ +a 'b "c' \'d +e\ f "g ' h" +i\ +j Added: head/tools/regression/usr.bin/xargs/regress.quotes.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.quotes.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,7 @@ +a +b "c +'d +e f +g ' h +i +j Modified: head/tools/regression/usr.bin/xargs/regress.sh ============================================================================== --- head/tools/regression/usr.bin/xargs/regress.sh Sat May 4 15:43:09 2013 (r250241) +++ head/tools/regression/usr.bin/xargs/regress.sh Sat May 4 16:41:14 2013 (r250242) @@ -1,6 +1,6 @@ # $FreeBSD$ -echo 1..5 +echo 1..13 REGRESSION_START($1) @@ -9,5 +9,13 @@ REGRESSION_TEST(`I', `xargs -I% echo The REGRESSION_TEST(`J', `xargs -J% echo The % again. < regress.in') REGRESSION_TEST(`L', `xargs -L3 echo < regress.in') REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % < regress.in') +REGRESSION_TEST(`n1', `xargs -n1 echo < regress.in') +REGRESSION_TEST(`n2', `xargs -n2 echo < regress.in') +REGRESSION_TEST(`n3', `xargs -n3 echo < regress.in') +REGRESSION_TEST(`0', `xargs -0 -n1 echo < regress.0.in') +REGRESSION_TEST(`0I', `xargs -0 -I% echo The % %% % < regress.0.in') +REGRESSION_TEST(`0J', `xargs -0 -J% echo The % again. < regress.0.in') +REGRESSION_TEST(`0L', `xargs -0 -L2 echo < regress.0.in') +REGRESSION_TEST(`quotes', `xargs -n1 echo < regress.quotes.in') REGRESSION_END() From owner-svn-src-all@FreeBSD.ORG Sat May 4 16:42:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CD8FA645; Sat, 4 May 2013 16:42:20 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) by mx1.freebsd.org (Postfix) with ESMTP id BE167335; Sat, 4 May 2013 16:42:19 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id j13so2387120wgh.4 for ; Sat, 04 May 2013 09:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=9MgvaCdM+b9S1BDRQlzN5s3o/8Td0goZeDVEXaWysgA=; b=HPXyNvOsWbVKahuOxjd8a7ZwTKk+RYLbxNsUIJUvUKp55wuCwBXUc4uVPWM9sB1ZW7 yiumbE+Qay6mi5ShkvBokGx0acqvMIkLfoHCRCCzCRtPQxNovsIM8Bu1miSkuNyI0hzH vwXYcfl46SFrjISyYjlAO1DQMRqwfccQLY9tjvojKiEN93YCnBvO1Oe+MI9N93SYtQP4 FSXIX8Ww3JUE/d/qea5h21b/ozVLDctxJopnB1eei5azajVsL36mA7aQO1dEr2COyUNP OxV9uoUYajAK0oVqV2nWQrVQlG4YS21DqebIzZdBt63MIgegeOj0WHAqHZVAbUBqmnqy 0yGQ== MIME-Version: 1.0 X-Received: by 10.194.78.137 with SMTP id b9mr18876809wjx.10.1367685738781; Sat, 04 May 2013 09:42:18 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.194.29.199 with HTTP; Sat, 4 May 2013 09:42:18 -0700 (PDT) In-Reply-To: <51851969.6020802@freebsd.org> References: <201305031552.r43FqiPN024580@svn.freebsd.org> <5183E899.4000503@freebsd.org> <20130503195540.GA52657@stack.nl> <5184ED7E.3040703@freebsd.org> <51851969.6020802@freebsd.org> Date: Sat, 4 May 2013 20:42:18 +0400 X-Google-Sender-Auth: NXXOKYIQf5Qaty25auKGgsY3GTk Message-ID: Subject: Re: svn commit: r250215 - stable/9/lib/libc/locale From: Sergey Kandaurov To: Andrey Chernov Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org, Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 16:42:20 -0000 On 4 May 2013 18:21, Andrey Chernov wrote: > On 04.05.2013 16:03, Sergey Kandaurov wrote: >>> BTW, I don't run tests and look in asm code for sure, but it seems >>> property[0] == p[0] is unneeded because almost every compiler tries to >>> inline strcmp(). >> >> Doesn't seem so (in-lining), see below. > > Yes, system's GNU cc don't inline strcmp() but inlines memcmp(): > repz > cmpsb > I don't have clang nearby right now to test what it does. I've checked gcc46 and clang3.2, and they behave similarly (poor). It's worth to note that inlined memcmp didn't help with performance relative to strcmp(). note2 - it's surprising that only base gcc inlined memcmp. This explains the difference between base gcc and {gcc46, clang} in the table below. 1 - base gcc 4.2 2 - gcc46 3 - base clang 3.2 a - if (property[0] == p[0] && strcmp(property, p) == 0) b - if (property[0] == p[0] && memcmp(property, p, *len2) == 0) c - if (memcmp(property, p, *len2) == 0) Time spend for 2097152 wctype() calls for each of wctype property 1a 2a 3a 1b 2b 3b 1c 2c 3c alnum 0.034 0.036 0.034 0.049 0.071 0.073 0.046 0.068 0.069 alpha 0.045 0.049 0.046 0.111 0.156 0.158 0.107 0.153 0.154 blank 0.037 0.041 0.038 0.053 0.075 0.079 0.153 0.224 0.223 cntrl 0.039 0.044 0.042 0.058 0.078 0.081 0.206 0.300 0.301 digit 0.039 0.044 0.043 0.059 0.080 0.085 0.259 0.378 0.378 graph 0.043 0.049 0.050 0.061 0.082 0.087 0.313 0.455 0.455 lower 0.044 0.049 0.051 0.062 0.085 0.090 0.365 0.532 0.533 print 0.048 0.054 0.059 0.067 0.088 0.092 0.419 0.610 0.610 punct 0.060 0.067 0.103 0.127 0.183 0.211 0.477 0.692 0.692 space 0.053 0.059 0.067 0.072 0.092 0.097 0.525 0.764 0.765 upper 0.054 0.059 0.068 0.074 0.094 0.100 0.578 0.841 0.842 xdigit 0.060 0.066 0.077 0.079 0.099 0.106 0.635 0.922 0.985 ideogram 0.068 0.074 0.084 0.087 0.089 0.094 0.695 0.986 0.985 special 0.098 0.104 0.113 0.169 0.210 0.212 0.753 1.116 1.118 phonogram 0.136 0.156 0.187 0.240 0.285 0.325 0.815 1.181 1.183 rune 0.064 0.070 0.087 0.099 0.104 0.113 0.842 1.293 1.283 -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Sat May 4 16:55:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C20699F2; Sat, 4 May 2013 16:55:48 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B52923E9; Sat, 4 May 2013 16:55:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44Gtm83056333; Sat, 4 May 2013 16:55:48 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44Gtm6W056332; Sat, 4 May 2013 16:55:48 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305041655.r44Gtm6W056332@svn.freebsd.org> From: Davide Italiano Date: Sat, 4 May 2013 16:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250243 - head/sys/netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 16:55:48 -0000 Author: davide Date: Sat May 4 16:55:48 2013 New Revision: 250243 URL: http://svnweb.freebsd.org/changeset/base/250243 Log: If the kernel is compiled with VMIMAGE support, the first attempt of mounting smbfs share will cause a panic. Fix setting setting/restoring vnet context when needed. PR: kern/168077 Submitted by: dteske Modified: head/sys/netsmb/smb_trantcp.c Modified: head/sys/netsmb/smb_trantcp.c ============================================================================== --- head/sys/netsmb/smb_trantcp.c Sat May 4 16:41:14 2013 (r250242) +++ head/sys/netsmb/smb_trantcp.c Sat May 4 16:55:48 2013 (r250243) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -79,13 +80,17 @@ static int nb_setsockopt_int(struct socket *so, int level, int name, int val) { struct sockopt sopt; + int error; bzero(&sopt, sizeof(sopt)); sopt.sopt_level = level; sopt.sopt_name = name; sopt.sopt_val = &val; sopt.sopt_valsize = sizeof(val); - return sosetopt(so, &sopt); + CURVNET_SET(so->so_vnet); + error = sosetopt(so, &sopt); + CURVNET_RESTORE(); + return error; } static int @@ -299,8 +304,10 @@ nbssn_recvhdr(struct nbpcb *nbp, int *le auio.uio_offset = 0; auio.uio_resid = sizeof(len); auio.uio_td = td; + CURVNET_SET(so->so_vnet); error = soreceive(so, (struct sockaddr **)NULL, &auio, (struct mbuf **)NULL, (struct mbuf **)NULL, &flags); + CURVNET_RESTORE(); if (error) return error; if (auio.uio_resid > 0) { @@ -384,8 +391,10 @@ nbssn_recv(struct nbpcb *nbp, struct mbu */ do { rcvflg = MSG_WAITALL; + CURVNET_SET(so->so_vnet); error = soreceive(so, (struct sockaddr **)NULL, &auio, &tm, (struct mbuf **)NULL, &rcvflg); + CURVNET_RESTORE(); } while (error == EWOULDBLOCK || error == EINTR || error == ERESTART); if (error) From owner-svn-src-all@FreeBSD.ORG Sat May 4 17:00:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B688CD9; Sat, 4 May 2013 17:00:12 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 167A15F5; Sat, 4 May 2013 17:00:12 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id x12so2869721ief.12 for ; Sat, 04 May 2013 10:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=4hENH6PAExYQM/32EQK4cBeP6Z+FRRrUyRRSwGgCgJw=; b=mK6e9fKAaQ9rmHMaPYbtgNBedbLDI3QkaGnVAm4hQzhMeK7/WJgu3N7xipl1tc6XuH fst8FUEHNtTCLk6CUYgu14BnA2kGHaz+JX1KFlfAOtAeLioIk5ocJNr+nUItduMIYr/p tQD1SBR9YMo9dmNzK3PQT9sCMej8po8bTxGvDb4leIffoiYyU/gytMwTZ6so8tBUpdg3 jkTmHdWmLVJHIsuAzJhZmuRy0FvIRc3y4W3hHJGD77grA9LZRyPPwUJhoX8jd/ebxrld oykDKZVXh5OCZ8BDhx2CBFtZrdQ+sm7LX99Nj1/VF5HN6RBuoyUdNowl5XvdlO0pWZue 42Uw== MIME-Version: 1.0 X-Received: by 10.50.40.66 with SMTP id v2mr794328igk.100.1367686811725; Sat, 04 May 2013 10:00:11 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Sat, 4 May 2013 10:00:11 -0700 (PDT) In-Reply-To: <201305041418.r44EIB0i001211@svn.freebsd.org> References: <201305041418.r44EIB0i001211@svn.freebsd.org> Date: Sat, 4 May 2013 19:00:11 +0200 X-Google-Sender-Auth: iGBgrf5xbJsLdx9tZOe6p3TmwbE Message-ID: Subject: Re: svn commit: r250237 - in head/sys: fs/smbfs netsmb From: Attilio Rao To: Davide Italiano Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 17:00:12 -0000 On Sat, May 4, 2013 at 4:18 PM, Davide Italiano wrote: > Author: davide > Date: Sat May 4 14:18:10 2013 > New Revision: 250237 > URL: http://svnweb.freebsd.org/changeset/base/250237 > > Log: > Overhaul locking in netsmb, getting rid of the obsolete lockmgr() primitive. > This solves a long standing LOR between smb_conn and smb_vc. I've only skimmed through the patch so I may be missing something important, but can you please clarify how did you replace LK_DRAIN in, for example, smb_co_rele()? Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sat May 4 17:06:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01851F00; Sat, 4 May 2013 17:06:49 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEC6C658; Sat, 4 May 2013 17:06:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44H6m4Y060230; Sat, 4 May 2013 17:06:48 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44H6lrD060222; Sat, 4 May 2013 17:06:47 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305041706.r44H6lrD060222@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 4 May 2013 17:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250244 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 17:06:49 -0000 Author: pluknet Date: Sat May 4 17:06:47 2013 New Revision: 250244 URL: http://svnweb.freebsd.org/changeset/base/250244 Log: mdoc: missing comma in .Dd macro. Modified: head/lib/libc/locale/duplocale.3 head/lib/libc/locale/freelocale.3 head/lib/libc/locale/newlocale.3 head/lib/libc/locale/uselocale.3 head/lib/libc/locale/xlocale.3 Modified: head/lib/libc/locale/duplocale.3 ============================================================================== --- head/lib/libc/locale/duplocale.3 Sat May 4 16:55:48 2013 (r250243) +++ head/lib/libc/locale/duplocale.3 Sat May 4 17:06:47 2013 (r250244) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17 2011 +.Dd September 17, 2011 .Dt DUPLOCALE 3 .Os .Sh NAME Modified: head/lib/libc/locale/freelocale.3 ============================================================================== --- head/lib/libc/locale/freelocale.3 Sat May 4 16:55:48 2013 (r250243) +++ head/lib/libc/locale/freelocale.3 Sat May 4 17:06:47 2013 (r250244) @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 17 2011 +.Dd September 17, 2011 .Dt FREELOCALE 3 .Os .Sh NAME Modified: head/lib/libc/locale/newlocale.3 ============================================================================== --- head/lib/libc/locale/newlocale.3 Sat May 4 16:55:48 2013 (r250243) +++ head/lib/libc/locale/newlocale.3 Sat May 4 17:06:47 2013 (r250244) @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 17 2011 +.Dd September 17, 2011 .Dt NEWLOCALE 3 .Os .Sh NAME Modified: head/lib/libc/locale/uselocale.3 ============================================================================== --- head/lib/libc/locale/uselocale.3 Sat May 4 16:55:48 2013 (r250243) +++ head/lib/libc/locale/uselocale.3 Sat May 4 17:06:47 2013 (r250244) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17 2011 +.Dd September 17, 2011 .Dt USELOCALE 3 .Os .Sh NAME Modified: head/lib/libc/locale/xlocale.3 ============================================================================== --- head/lib/libc/locale/xlocale.3 Sat May 4 16:55:48 2013 (r250243) +++ head/lib/libc/locale/xlocale.3 Sat May 4 17:06:47 2013 (r250244) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17 2011 +.Dd September 17, 2011 .Dt XLOCALE 3 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sat May 4 17:21:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D9B4F306; Sat, 4 May 2013 17:21:44 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC60F6DC; Sat, 4 May 2013 17:21:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44HLihs066292; Sat, 4 May 2013 17:21:44 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44HLiXb066291; Sat, 4 May 2013 17:21:44 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305041721.r44HLiXb066291@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 4 May 2013 17:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250245 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 17:21:44 -0000 Author: pluknet Date: Sat May 4 17:21:44 2013 New Revision: 250245 URL: http://svnweb.freebsd.org/changeset/base/250245 Log: Document that the return type is different from 1003.1-2008. MFC after: 1 week Modified: head/lib/libc/locale/freelocale.3 Modified: head/lib/libc/locale/freelocale.3 ============================================================================== --- head/lib/libc/locale/freelocale.3 Sat May 4 17:06:47 2013 (r250244) +++ head/lib/libc/locale/freelocale.3 Sat May 4 17:21:44 2013 (r250245) @@ -57,5 +57,12 @@ Returns 0 on success or -1 on error. .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function conforms to -.St -p1003.1-2008 . +The +.Fn freelocale +function +differs from +.St -p1003.1-2008 +in that its return type is +.Vt int +rather than +.Vt void . From owner-svn-src-all@FreeBSD.ORG Sat May 4 18:24:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 236C8630; Sat, 4 May 2013 18:24:31 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 054279F5; Sat, 4 May 2013 18:24:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44IOUK2087897; Sat, 4 May 2013 18:24:30 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44IOUUO087896; Sat, 4 May 2013 18:24:30 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201305041824.r44IOUUO087896@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 4 May 2013 18:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250246 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 18:24:31 -0000 Author: melifaro Date: Sat May 4 18:24:30 2013 New Revision: 250246 URL: http://svnweb.freebsd.org/changeset/base/250246 Log: Use unified method for accessing / updating cached rule pointers. MFC after: 2 weeks Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Sat May 4 17:21:44 2013 (r250245) +++ head/sys/netpfil/ipfw/ip_fw2.c Sat May 4 18:24:30 2013 (r250246) @@ -780,6 +780,38 @@ set_match(struct ip_fw_args *args, int s } /* + * Helper function to enable cached rule lookups using + * x_next and next_rule fields in ipfw rule. + */ +static int +jump_fast(struct ip_fw_chain *chain, struct ip_fw *f, int num, + int tablearg, int jump_backwards) +{ + int f_pos; + + /* If possible use cached f_pos (in f->next_rule), + * whose version is written in f->next_rule + * (horrible hacks to avoid changing the ABI). + */ + if (num != IP_FW_TABLEARG && (uintptr_t)f->x_next == chain->id) + f_pos = (uintptr_t)f->next_rule; + else { + int i = IP_FW_ARG_TABLEARG(num); + /* make sure we do not jump backward */ + if (jump_backwards == 0 && i <= f->rulenum) + i = f->rulenum + 1; + f_pos = ipfw_find_rule(chain, i, 0); + /* update the cache */ + if (num != IP_FW_TABLEARG) { + f->next_rule = (void *)(uintptr_t)f_pos; + f->x_next = (void *)(uintptr_t)chain->id; + } + } + + return (f_pos); +} + +/* * The main check routine for the firewall. * * All arguments are in args so we can modify them and return them @@ -2123,27 +2155,7 @@ do { \ case O_SKIPTO: IPFW_INC_RULE_COUNTER(f, pktlen); - /* If possible use cached f_pos (in f->next_rule), - * whose version is written in f->next_rule - * (horrible hacks to avoid changing the ABI). - */ - if (cmd->arg1 != IP_FW_TABLEARG && - (uintptr_t)f->x_next == chain->id) { - f_pos = (uintptr_t)f->next_rule; - } else { - int i = IP_FW_ARG_TABLEARG(cmd->arg1); - /* make sure we do not jump backward */ - if (i <= f->rulenum) - i = f->rulenum + 1; - f_pos = ipfw_find_rule(chain, i, 0); - /* update the cache */ - if (cmd->arg1 != IP_FW_TABLEARG) { - f->next_rule = - (void *)(uintptr_t)f_pos; - f->x_next = - (void *)(uintptr_t)chain->id; - } - } + f_pos = jump_fast(chain, f, cmd->arg1, tablearg, 0); /* * Skip disabled rules, and re-enter * the inner loop with the correct @@ -2232,25 +2244,8 @@ do { \ if (IS_CALL) { stack[mtag->m_tag_id] = f->rulenum; mtag->m_tag_id++; - if (cmd->arg1 != IP_FW_TABLEARG && - (uintptr_t)f->x_next == chain->id) { - f_pos = (uintptr_t)f->next_rule; - } else { - jmpto = IP_FW_ARG_TABLEARG( - cmd->arg1); - f_pos = ipfw_find_rule(chain, - jmpto, 0); - /* update the cache */ - if (cmd->arg1 != - IP_FW_TABLEARG) { - f->next_rule = - (void *)(uintptr_t) - f_pos; - f->x_next = - (void *)(uintptr_t) - chain->id; - } - } + f_pos = jump_fast(chain, f, cmd->arg1, + tablearg, 1); } else { /* `return' action */ mtag->m_tag_id--; jmpto = stack[mtag->m_tag_id] + 1; From owner-svn-src-all@FreeBSD.ORG Sat May 4 18:38:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B5E4A1A; Sat, 4 May 2013 18:38:17 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1B0BA48; Sat, 4 May 2013 18:38:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44IcGRw092010; Sat, 4 May 2013 18:38:16 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44IcG0b092009; Sat, 4 May 2013 18:38:16 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201305041838.r44IcG0b092009@svn.freebsd.org> From: Matthew D Fleming Date: Sat, 4 May 2013 18:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250247 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 18:38:17 -0000 Author: mdf Date: Sat May 4 18:38:16 2013 New Revision: 250247 URL: http://svnweb.freebsd.org/changeset/base/250247 Log: Add missing vdrop() in error case. Submitted by: Fahad (mohd.fahadullah@isilon.com) MFC after: 1 week Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat May 4 18:24:30 2013 (r250246) +++ head/sys/kern/vfs_subr.c Sat May 4 18:38:16 2013 (r250247) @@ -731,6 +731,7 @@ vlrureclaim(struct mount *mp) (vp->v_object != NULL && vp->v_object->resident_page_count > trigger)) { VOP_UNLOCK(vp, LK_INTERLOCK); + vdrop(vp); goto next_iter_mntunlocked; } KASSERT((vp->v_iflag & VI_DOOMED) == 0, From owner-svn-src-all@FreeBSD.ORG Sat May 4 18:44:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6CB2BBBD; Sat, 4 May 2013 18:44:15 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 440E4A68; Sat, 4 May 2013 18:44:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44IiFOE094710; Sat, 4 May 2013 18:44:15 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44IiEfS094708; Sat, 4 May 2013 18:44:14 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201305041844.r44IiEfS094708@svn.freebsd.org> From: Matthew D Fleming Date: Sat, 4 May 2013 18:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250248 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 18:44:15 -0000 Author: mdf Date: Sat May 4 18:44:14 2013 New Revision: 250248 URL: http://svnweb.freebsd.org/changeset/base/250248 Log: MFC r248933: Use a shared lock for VOP_GETEXTATTR, as it is a read-like operation. Modified: stable/9/sys/kern/vfs_extattr.c stable/9/sys/kern/vfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/vfs_extattr.c ============================================================================== --- stable/9/sys/kern/vfs_extattr.c Sat May 4 18:38:16 2013 (r250247) +++ stable/9/sys/kern/vfs_extattr.c Sat May 4 18:44:14 2013 (r250248) @@ -339,7 +339,7 @@ extattr_get_vp(struct vnode *vp, int att int error; VFS_ASSERT_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); /* * Slightly unusual semantics: if the user provides a NULL data Modified: stable/9/sys/kern/vfs_vnops.c ============================================================================== --- stable/9/sys/kern/vfs_vnops.c Sat May 4 18:38:16 2013 (r250247) +++ stable/9/sys/kern/vfs_vnops.c Sat May 4 18:44:14 2013 (r250248) @@ -1744,7 +1744,7 @@ vn_extattr_get(struct vnode *vp, int iof auio.uio_resid = *buflen; if ((ioflg & IO_NODELOCKED) == 0) - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held"); From owner-svn-src-all@FreeBSD.ORG Sat May 4 18:49:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C99D6D55; Sat, 4 May 2013 18:49:05 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA22DA82; Sat, 4 May 2013 18:49:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44In5A3095621; Sat, 4 May 2013 18:49:05 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44In5HK095619; Sat, 4 May 2013 18:49:05 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201305041849.r44In5HK095619@svn.freebsd.org> From: Matthew D Fleming Date: Sat, 4 May 2013 18:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250249 - in stable/8/sys: . amd64/amd64 dev/sound i386/i386 kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 18:49:05 -0000 Author: mdf Date: Sat May 4 18:49:04 2013 New Revision: 250249 URL: http://svnweb.freebsd.org/changeset/base/250249 Log: MFC r248933: Use a shared lock for VOP_GETEXTATTR, as it is a read-like operation. Modified: stable/8/sys/kern/vfs_extattr.c stable/8/sys/kern/vfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/Makefile (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/amd64/amd64/intr_machdep.c (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/arm/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/bsm/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/conf/ (props changed) stable/8/sys/contrib/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/crypto/ (props changed) stable/8/sys/ddb/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/aac/ (props changed) stable/8/sys/dev/acpi_support/ (props changed) stable/8/sys/dev/acpica/ (props changed) stable/8/sys/dev/adb/ (props changed) stable/8/sys/dev/adlink/ (props changed) stable/8/sys/dev/advansys/ (props changed) stable/8/sys/dev/ae/ (props changed) stable/8/sys/dev/age/ (props changed) stable/8/sys/dev/agp/ (props changed) stable/8/sys/dev/aha/ (props changed) stable/8/sys/dev/ahb/ (props changed) stable/8/sys/dev/ahci/ (props changed) stable/8/sys/dev/aic/ (props changed) stable/8/sys/dev/aic7xxx/ (props changed) stable/8/sys/dev/alc/ (props changed) stable/8/sys/dev/ale/ (props changed) stable/8/sys/dev/amd/ (props changed) stable/8/sys/dev/amdsbwd/ (props changed) stable/8/sys/dev/amdtemp/ (props changed) stable/8/sys/dev/amr/ (props changed) stable/8/sys/dev/an/ (props changed) stable/8/sys/dev/arcmsr/ (props changed) stable/8/sys/dev/asmc/ (props changed) stable/8/sys/dev/asr/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/ath/ (props changed) stable/8/sys/dev/atkbdc/ (props changed) stable/8/sys/dev/auxio/ (props changed) stable/8/sys/dev/bce/ (props changed) stable/8/sys/dev/bfe/ (props changed) stable/8/sys/dev/bge/ (props changed) stable/8/sys/dev/bktr/ (props changed) stable/8/sys/dev/bm/ (props changed) stable/8/sys/dev/buslogic/ (props changed) stable/8/sys/dev/bwi/ (props changed) stable/8/sys/dev/bwn/ (props changed) stable/8/sys/dev/cardbus/ (props changed) stable/8/sys/dev/cas/ (props changed) stable/8/sys/dev/ce/ (props changed) stable/8/sys/dev/cfe/ (props changed) stable/8/sys/dev/cfi/ (props changed) stable/8/sys/dev/ciss/ (props changed) stable/8/sys/dev/cm/ (props changed) stable/8/sys/dev/cmx/ (props changed) stable/8/sys/dev/coretemp/ (props changed) stable/8/sys/dev/cp/ (props changed) stable/8/sys/dev/cpuctl/ (props changed) stable/8/sys/dev/cpufreq/ (props changed) stable/8/sys/dev/cs/ (props changed) stable/8/sys/dev/ct/ (props changed) stable/8/sys/dev/ctau/ (props changed) stable/8/sys/dev/cx/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/cxgbe/ (props changed) stable/8/sys/dev/cy/ (props changed) stable/8/sys/dev/dc/ (props changed) stable/8/sys/dev/dcons/ (props changed) stable/8/sys/dev/de/ (props changed) stable/8/sys/dev/digi/ (props changed) stable/8/sys/dev/dpms/ (props changed) stable/8/sys/dev/dpt/ (props changed) stable/8/sys/dev/drm/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/ed/ (props changed) stable/8/sys/dev/eisa/ (props changed) stable/8/sys/dev/en/ (props changed) stable/8/sys/dev/ep/ (props changed) stable/8/sys/dev/esp/ (props changed) stable/8/sys/dev/et/ (props changed) stable/8/sys/dev/ex/ (props changed) stable/8/sys/dev/exca/ (props changed) stable/8/sys/dev/fatm/ (props changed) stable/8/sys/dev/fb/ (props changed) stable/8/sys/dev/fdc/ (props changed) stable/8/sys/dev/fe/ (props changed) stable/8/sys/dev/firewire/ (props changed) stable/8/sys/dev/flash/ (props changed) stable/8/sys/dev/fxp/ (props changed) stable/8/sys/dev/gem/ (props changed) stable/8/sys/dev/glxsb/ (props changed) stable/8/sys/dev/hatm/ (props changed) stable/8/sys/dev/hifn/ (props changed) stable/8/sys/dev/hme/ (props changed) stable/8/sys/dev/hpt27xx/ (props changed) stable/8/sys/dev/hptiop/ (props changed) stable/8/sys/dev/hptmv/ (props changed) stable/8/sys/dev/hptrr/ (props changed) stable/8/sys/dev/hwpmc/ (props changed) stable/8/sys/dev/ic/ (props changed) stable/8/sys/dev/ichsmb/ (props changed) stable/8/sys/dev/ichwd/ (props changed) stable/8/sys/dev/ida/ (props changed) stable/8/sys/dev/ie/ (props changed) stable/8/sys/dev/ieee488/ (props changed) stable/8/sys/dev/if_ndis/ (props changed) stable/8/sys/dev/iicbus/ (props changed) stable/8/sys/dev/iir/ (props changed) stable/8/sys/dev/io/ (props changed) stable/8/sys/dev/ipmi/ (props changed) stable/8/sys/dev/ips/ (props changed) stable/8/sys/dev/ipw/ (props changed) stable/8/sys/dev/isci/ (props changed) stable/8/sys/dev/iscsi/ (props changed) stable/8/sys/dev/isp/ (props changed) stable/8/sys/dev/ispfw/ (props changed) stable/8/sys/dev/iwi/ (props changed) stable/8/sys/dev/iwn/ (props changed) stable/8/sys/dev/ixgb/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/jme/ (props changed) stable/8/sys/dev/joy/ (props changed) stable/8/sys/dev/kbd/ (props changed) stable/8/sys/dev/kbdmux/ (props changed) stable/8/sys/dev/ksyms/ (props changed) stable/8/sys/dev/le/ (props changed) stable/8/sys/dev/led/ (props changed) stable/8/sys/dev/lge/ (props changed) stable/8/sys/dev/lindev/ (props changed) stable/8/sys/dev/lmc/ (props changed) stable/8/sys/dev/malo/ (props changed) stable/8/sys/dev/mc146818/ (props changed) stable/8/sys/dev/mca/ (props changed) stable/8/sys/dev/mcd/ (props changed) stable/8/sys/dev/md/ (props changed) stable/8/sys/dev/mem/ (props changed) stable/8/sys/dev/mfi/ (props changed) stable/8/sys/dev/mge/ (props changed) stable/8/sys/dev/mii/ (props changed) stable/8/sys/dev/mk48txx/ (props changed) stable/8/sys/dev/mlx/ (props changed) stable/8/sys/dev/mly/ (props changed) stable/8/sys/dev/mmc/ (props changed) stable/8/sys/dev/mn/ (props changed) stable/8/sys/dev/mps/ (props changed) stable/8/sys/dev/mpt/ (props changed) stable/8/sys/dev/mse/ (props changed) stable/8/sys/dev/msk/ (props changed) stable/8/sys/dev/mvs/ (props changed) stable/8/sys/dev/mwl/ (props changed) stable/8/sys/dev/mxge/ (props changed) stable/8/sys/dev/my/ (props changed) stable/8/sys/dev/ncv/ (props changed) stable/8/sys/dev/netmap/ (props changed) stable/8/sys/dev/nfe/ (props changed) stable/8/sys/dev/nge/ (props changed) stable/8/sys/dev/nmdm/ (props changed) stable/8/sys/dev/nsp/ (props changed) stable/8/sys/dev/null/ (props changed) stable/8/sys/dev/nve/ (props changed) stable/8/sys/dev/nvram/ (props changed) stable/8/sys/dev/nxge/ (props changed) stable/8/sys/dev/oce/ (props changed) stable/8/sys/dev/ofw/ (props changed) stable/8/sys/dev/patm/ (props changed) stable/8/sys/dev/pbio/ (props changed) stable/8/sys/dev/pccard/ (props changed) stable/8/sys/dev/pccbb/ (props changed) stable/8/sys/dev/pcf/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/8/sys/dev/pcn/ (props changed) stable/8/sys/dev/pdq/ (props changed) stable/8/sys/dev/powermac_nvram/ (props changed) stable/8/sys/dev/ppbus/ (props changed) stable/8/sys/dev/ppc/ (props changed) stable/8/sys/dev/pst/ (props changed) stable/8/sys/dev/puc/ (props changed) stable/8/sys/dev/quicc/ (props changed) stable/8/sys/dev/ral/ (props changed) stable/8/sys/dev/random/ (props changed) stable/8/sys/dev/rc/ (props changed) stable/8/sys/dev/re/ (props changed) stable/8/sys/dev/rndtest/ (props changed) stable/8/sys/dev/rp/ (props changed) stable/8/sys/dev/safe/ (props changed) stable/8/sys/dev/sbni/ (props changed) stable/8/sys/dev/scc/ (props changed) stable/8/sys/dev/scd/ (props changed) stable/8/sys/dev/sdhci/ (props changed) stable/8/sys/dev/sec/ (props changed) stable/8/sys/dev/sf/ (props changed) stable/8/sys/dev/sge/ (props changed) stable/8/sys/dev/si/ (props changed) stable/8/sys/dev/siba/ (props changed) stable/8/sys/dev/siis/ (props changed) stable/8/sys/dev/sio/ (props changed) stable/8/sys/dev/sis/ (props changed) stable/8/sys/dev/sk/ (props changed) stable/8/sys/dev/smbus/ (props changed) stable/8/sys/dev/smc/ (props changed) stable/8/sys/dev/sn/ (props changed) stable/8/sys/dev/snc/ (props changed) stable/8/sys/dev/snp/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/chip.h (props changed) stable/8/sys/dev/sound/clone.c (props changed) stable/8/sys/dev/sound/clone.h (props changed) stable/8/sys/dev/sound/driver.c (props changed) stable/8/sys/dev/sound/isa/ (props changed) stable/8/sys/dev/sound/macio/ (props changed) stable/8/sys/dev/sound/midi/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/sound/pcm/ (props changed) stable/8/sys/dev/sound/sbus/ (props changed) stable/8/sys/dev/sound/unit.c (props changed) stable/8/sys/dev/sound/unit.h (props changed) stable/8/sys/dev/sound/usb/ (props changed) stable/8/sys/dev/sound/version.h (props changed) stable/8/sys/dev/speaker/ (props changed) stable/8/sys/dev/spibus/ (props changed) stable/8/sys/dev/ste/ (props changed) stable/8/sys/dev/stg/ (props changed) stable/8/sys/dev/stge/ (props changed) stable/8/sys/dev/streams/ (props changed) stable/8/sys/dev/sym/ (props changed) stable/8/sys/dev/syscons/ (props changed) stable/8/sys/dev/tdfx/ (props changed) stable/8/sys/dev/ti/ (props changed) stable/8/sys/dev/tl/ (props changed) stable/8/sys/dev/tpm/ (props changed) stable/8/sys/dev/trm/ (props changed) stable/8/sys/dev/tsec/ (props changed) stable/8/sys/dev/twa/ (props changed) stable/8/sys/dev/twe/ (props changed) stable/8/sys/dev/tws/ (props changed) stable/8/sys/dev/tx/ (props changed) stable/8/sys/dev/txp/ (props changed) stable/8/sys/dev/uart/ (props changed) stable/8/sys/dev/ubsec/ (props changed) stable/8/sys/dev/usb/ (props changed) stable/8/sys/dev/utopia/ (props changed) stable/8/sys/dev/vge/ (props changed) stable/8/sys/dev/viawd/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/dev/vkbd/ (props changed) stable/8/sys/dev/vr/ (props changed) stable/8/sys/dev/vte/ (props changed) stable/8/sys/dev/vx/ (props changed) stable/8/sys/dev/watchdog/ (props changed) stable/8/sys/dev/wb/ (props changed) stable/8/sys/dev/wbwd/ (props changed) stable/8/sys/dev/wds/ (props changed) stable/8/sys/dev/wi/ (props changed) stable/8/sys/dev/wl/ (props changed) stable/8/sys/dev/wpi/ (props changed) stable/8/sys/dev/xe/ (props changed) stable/8/sys/dev/xen/ (props changed) stable/8/sys/dev/xl/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/gdb/ (props changed) stable/8/sys/geom/ (props changed) stable/8/sys/gnu/ (props changed) stable/8/sys/i386/ (props changed) stable/8/sys/i386/i386/intr_machdep.c (props changed) stable/8/sys/ia64/ (props changed) stable/8/sys/isa/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/kgssapi/ (props changed) stable/8/sys/libkern/ (props changed) stable/8/sys/mips/ (props changed) stable/8/sys/modules/ (props changed) stable/8/sys/net/ (props changed) stable/8/sys/net80211/ (props changed) stable/8/sys/netatalk/ (props changed) stable/8/sys/netgraph/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) stable/8/sys/netipsec/ (props changed) stable/8/sys/netipx/ (props changed) stable/8/sys/netnatm/ (props changed) stable/8/sys/netncp/ (props changed) stable/8/sys/netsmb/ (props changed) stable/8/sys/nfs/ (props changed) stable/8/sys/nfsclient/ (props changed) stable/8/sys/nfsserver/ (props changed) stable/8/sys/nlm/ (props changed) stable/8/sys/opencrypto/ (props changed) stable/8/sys/pc98/ (props changed) stable/8/sys/pci/ (props changed) stable/8/sys/powerpc/ (props changed) stable/8/sys/rpc/ (props changed) stable/8/sys/security/ (props changed) stable/8/sys/sparc64/ (props changed) stable/8/sys/sun4v/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/tools/ (props changed) stable/8/sys/ufs/ (props changed) stable/8/sys/vm/ (props changed) stable/8/sys/x86/ (props changed) stable/8/sys/xdr/ (props changed) stable/8/sys/xen/ (props changed) Modified: stable/8/sys/kern/vfs_extattr.c ============================================================================== --- stable/8/sys/kern/vfs_extattr.c Sat May 4 18:44:14 2013 (r250248) +++ stable/8/sys/kern/vfs_extattr.c Sat May 4 18:49:04 2013 (r250249) @@ -338,7 +338,7 @@ extattr_get_vp(struct vnode *vp, int att int error; VFS_ASSERT_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); /* * Slightly unusual semantics: if the user provides a NULL data Modified: stable/8/sys/kern/vfs_vnops.c ============================================================================== --- stable/8/sys/kern/vfs_vnops.c Sat May 4 18:44:14 2013 (r250248) +++ stable/8/sys/kern/vfs_vnops.c Sat May 4 18:49:04 2013 (r250249) @@ -1337,7 +1337,7 @@ vn_extattr_get(struct vnode *vp, int iof auio.uio_resid = *buflen; if ((ioflg & IO_NODELOCKED) == 0) - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held"); From owner-svn-src-all@FreeBSD.ORG Sat May 4 18:51:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 895B7FB9; Sat, 4 May 2013 18:51:46 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qc0-x235.google.com (mail-qc0-x235.google.com [IPv6:2607:f8b0:400d:c01::235]) by mx1.freebsd.org (Postfix) with ESMTP id 0CC37A9A; Sat, 4 May 2013 18:51:45 +0000 (UTC) Received: by mail-qc0-f181.google.com with SMTP id s25so1195963qcq.12 for ; Sat, 04 May 2013 11:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=89TV9eijeRfD5FXZQFvS5uflZMkHQAw3ZWp1dAOSs5U=; b=Tx151tfJOPfsaU2OPW0lvKEEcju9eSiWuGyGacPAWI9yiO9SjBcWeYyOnfuMPlcIUZ /mzMuMQ4JttjUGpYmKLqBVTnv3FFa47ubVAUYYbVC8KFJhJVG8A18WV6dYZNCC09QuaH 5hJi9DhnJ/ALUumDyXjVtzjxdFQNCDjd1vjMPnMGX+MTOM3QDH2QyK/ubKyBWSAcsipY QkycPjYW69XbZ4MO5pBfkVMyBVXDlM9yWH6UXDSb135xWF608Wt3ZXNt7mdKdlrWUBNC /vn5lXb+u+70Uz2iy5+wy1iix8Bc1ycf4vQdyZ1ckuCsyThLp1rGqXoltCXvkCOih5q0 qMvw== MIME-Version: 1.0 X-Received: by 10.229.7.1 with SMTP id b1mr6408924qcb.62.1367693505569; Sat, 04 May 2013 11:51:45 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.229.127.152 with HTTP; Sat, 4 May 2013 11:51:45 -0700 (PDT) In-Reply-To: <201305041849.r44In5HK095619@svn.freebsd.org> References: <201305041849.r44In5HK095619@svn.freebsd.org> Date: Sat, 4 May 2013 11:51:45 -0700 X-Google-Sender-Auth: aTC6m8fQBEHg1nvWBq6du8-ngwU Message-ID: Subject: Re: svn commit: r250249 - in stable/8/sys: . amd64/amd64 dev/sound i386/i386 kern From: mdf@FreeBSD.org To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 18:51:46 -0000 On Sat, May 4, 2013 at 11:49 AM, Matthew D Fleming wrote: > Author: mdf > Date: Sat May 4 18:49:04 2013 > New Revision: 250249 > URL: http://svnweb.freebsd.org/changeset/base/250249 > > Log: > MFC r248933: > > Use a shared lock for VOP_GETEXTATTR, as it is a read-like operation. > > Modified: > stable/8/sys/kern/vfs_extattr.c > stable/8/sys/kern/vfs_vnops.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/Makefile (props changed) > stable/8/sys/amd64/ (props changed) > stable/8/sys/amd64/amd64/intr_machdep.c (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/arm/ (props changed) > stable/8/sys/boot/ (props changed) > stable/8/sys/bsm/ (props changed) > stable/8/sys/cam/ (props changed) > stable/8/sys/cddl/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/compat/ (props changed) > stable/8/sys/conf/ (props changed) > stable/8/sys/contrib/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/crypto/ (props changed) > stable/8/sys/ddb/ (props changed) > stable/8/sys/dev/ (props changed) > stable/8/sys/dev/aac/ (props changed) > stable/8/sys/dev/acpi_support/ (props changed) > stable/8/sys/dev/acpica/ (props changed) > stable/8/sys/dev/adb/ (props changed) > stable/8/sys/dev/adlink/ (props changed) > stable/8/sys/dev/advansys/ (props changed) > stable/8/sys/dev/ae/ (props changed) > stable/8/sys/dev/age/ (props changed) > stable/8/sys/dev/agp/ (props changed) > stable/8/sys/dev/aha/ (props changed) > stable/8/sys/dev/ahb/ (props changed) > stable/8/sys/dev/ahci/ (props changed) > stable/8/sys/dev/aic/ (props changed) > stable/8/sys/dev/aic7xxx/ (props changed) > stable/8/sys/dev/alc/ (props changed) > stable/8/sys/dev/ale/ (props changed) > stable/8/sys/dev/amd/ (props changed) > stable/8/sys/dev/amdsbwd/ (props changed) > stable/8/sys/dev/amdtemp/ (props changed) > stable/8/sys/dev/amr/ (props changed) > stable/8/sys/dev/an/ (props changed) > stable/8/sys/dev/arcmsr/ (props changed) > stable/8/sys/dev/asmc/ (props changed) > stable/8/sys/dev/asr/ (props changed) > stable/8/sys/dev/ata/ (props changed) > stable/8/sys/dev/ath/ (props changed) > stable/8/sys/dev/atkbdc/ (props changed) > stable/8/sys/dev/auxio/ (props changed) > stable/8/sys/dev/bce/ (props changed) > stable/8/sys/dev/bfe/ (props changed) > stable/8/sys/dev/bge/ (props changed) > stable/8/sys/dev/bktr/ (props changed) > stable/8/sys/dev/bm/ (props changed) > stable/8/sys/dev/buslogic/ (props changed) > stable/8/sys/dev/bwi/ (props changed) > stable/8/sys/dev/bwn/ (props changed) > stable/8/sys/dev/cardbus/ (props changed) > stable/8/sys/dev/cas/ (props changed) > stable/8/sys/dev/ce/ (props changed) > stable/8/sys/dev/cfe/ (props changed) > stable/8/sys/dev/cfi/ (props changed) > stable/8/sys/dev/ciss/ (props changed) > stable/8/sys/dev/cm/ (props changed) > stable/8/sys/dev/cmx/ (props changed) > stable/8/sys/dev/coretemp/ (props changed) > stable/8/sys/dev/cp/ (props changed) > stable/8/sys/dev/cpuctl/ (props changed) > stable/8/sys/dev/cpufreq/ (props changed) > stable/8/sys/dev/cs/ (props changed) > stable/8/sys/dev/ct/ (props changed) > stable/8/sys/dev/ctau/ (props changed) > stable/8/sys/dev/cx/ (props changed) > stable/8/sys/dev/cxgb/ (props changed) > stable/8/sys/dev/cxgbe/ (props changed) > stable/8/sys/dev/cy/ (props changed) > stable/8/sys/dev/dc/ (props changed) > stable/8/sys/dev/dcons/ (props changed) > stable/8/sys/dev/de/ (props changed) > stable/8/sys/dev/digi/ (props changed) > stable/8/sys/dev/dpms/ (props changed) > stable/8/sys/dev/dpt/ (props changed) > stable/8/sys/dev/drm/ (props changed) > stable/8/sys/dev/e1000/ (props changed) > stable/8/sys/dev/ed/ (props changed) > stable/8/sys/dev/eisa/ (props changed) > stable/8/sys/dev/en/ (props changed) > stable/8/sys/dev/ep/ (props changed) > stable/8/sys/dev/esp/ (props changed) > stable/8/sys/dev/et/ (props changed) > stable/8/sys/dev/ex/ (props changed) > stable/8/sys/dev/exca/ (props changed) > stable/8/sys/dev/fatm/ (props changed) > stable/8/sys/dev/fb/ (props changed) > stable/8/sys/dev/fdc/ (props changed) > stable/8/sys/dev/fe/ (props changed) > stable/8/sys/dev/firewire/ (props changed) > stable/8/sys/dev/flash/ (props changed) > stable/8/sys/dev/fxp/ (props changed) > stable/8/sys/dev/gem/ (props changed) > stable/8/sys/dev/glxsb/ (props changed) > stable/8/sys/dev/hatm/ (props changed) > stable/8/sys/dev/hifn/ (props changed) > stable/8/sys/dev/hme/ (props changed) > stable/8/sys/dev/hpt27xx/ (props changed) > stable/8/sys/dev/hptiop/ (props changed) > stable/8/sys/dev/hptmv/ (props changed) > stable/8/sys/dev/hptrr/ (props changed) > stable/8/sys/dev/hwpmc/ (props changed) > stable/8/sys/dev/ic/ (props changed) > stable/8/sys/dev/ichsmb/ (props changed) > stable/8/sys/dev/ichwd/ (props changed) > stable/8/sys/dev/ida/ (props changed) > stable/8/sys/dev/ie/ (props changed) > stable/8/sys/dev/ieee488/ (props changed) > stable/8/sys/dev/if_ndis/ (props changed) > stable/8/sys/dev/iicbus/ (props changed) > stable/8/sys/dev/iir/ (props changed) > stable/8/sys/dev/io/ (props changed) > stable/8/sys/dev/ipmi/ (props changed) > stable/8/sys/dev/ips/ (props changed) > stable/8/sys/dev/ipw/ (props changed) > stable/8/sys/dev/isci/ (props changed) > stable/8/sys/dev/iscsi/ (props changed) > stable/8/sys/dev/isp/ (props changed) > stable/8/sys/dev/ispfw/ (props changed) > stable/8/sys/dev/iwi/ (props changed) > stable/8/sys/dev/iwn/ (props changed) > stable/8/sys/dev/ixgb/ (props changed) > stable/8/sys/dev/ixgbe/ (props changed) > stable/8/sys/dev/jme/ (props changed) > stable/8/sys/dev/joy/ (props changed) > stable/8/sys/dev/kbd/ (props changed) > stable/8/sys/dev/kbdmux/ (props changed) > stable/8/sys/dev/ksyms/ (props changed) > stable/8/sys/dev/le/ (props changed) > stable/8/sys/dev/led/ (props changed) > stable/8/sys/dev/lge/ (props changed) > stable/8/sys/dev/lindev/ (props changed) > stable/8/sys/dev/lmc/ (props changed) > stable/8/sys/dev/malo/ (props changed) > stable/8/sys/dev/mc146818/ (props changed) > stable/8/sys/dev/mca/ (props changed) > stable/8/sys/dev/mcd/ (props changed) > stable/8/sys/dev/md/ (props changed) > stable/8/sys/dev/mem/ (props changed) > stable/8/sys/dev/mfi/ (props changed) > stable/8/sys/dev/mge/ (props changed) > stable/8/sys/dev/mii/ (props changed) > stable/8/sys/dev/mk48txx/ (props changed) > stable/8/sys/dev/mlx/ (props changed) > stable/8/sys/dev/mly/ (props changed) > stable/8/sys/dev/mmc/ (props changed) > stable/8/sys/dev/mn/ (props changed) > stable/8/sys/dev/mps/ (props changed) > stable/8/sys/dev/mpt/ (props changed) > stable/8/sys/dev/mse/ (props changed) > stable/8/sys/dev/msk/ (props changed) > stable/8/sys/dev/mvs/ (props changed) > stable/8/sys/dev/mwl/ (props changed) > stable/8/sys/dev/mxge/ (props changed) > stable/8/sys/dev/my/ (props changed) > stable/8/sys/dev/ncv/ (props changed) > stable/8/sys/dev/netmap/ (props changed) > stable/8/sys/dev/nfe/ (props changed) > stable/8/sys/dev/nge/ (props changed) > stable/8/sys/dev/nmdm/ (props changed) > stable/8/sys/dev/nsp/ (props changed) > stable/8/sys/dev/null/ (props changed) > stable/8/sys/dev/nve/ (props changed) > stable/8/sys/dev/nvram/ (props changed) > stable/8/sys/dev/nxge/ (props changed) > stable/8/sys/dev/oce/ (props changed) > stable/8/sys/dev/ofw/ (props changed) > stable/8/sys/dev/patm/ (props changed) > stable/8/sys/dev/pbio/ (props changed) > stable/8/sys/dev/pccard/ (props changed) > stable/8/sys/dev/pccbb/ (props changed) > stable/8/sys/dev/pcf/ (props changed) > stable/8/sys/dev/pci/ (props changed) > stable/8/sys/dev/pcn/ (props changed) > stable/8/sys/dev/pdq/ (props changed) > stable/8/sys/dev/powermac_nvram/ (props changed) > stable/8/sys/dev/ppbus/ (props changed) > stable/8/sys/dev/ppc/ (props changed) > stable/8/sys/dev/pst/ (props changed) > stable/8/sys/dev/puc/ (props changed) > stable/8/sys/dev/quicc/ (props changed) > stable/8/sys/dev/ral/ (props changed) > stable/8/sys/dev/random/ (props changed) > stable/8/sys/dev/rc/ (props changed) > stable/8/sys/dev/re/ (props changed) > stable/8/sys/dev/rndtest/ (props changed) > stable/8/sys/dev/rp/ (props changed) > stable/8/sys/dev/safe/ (props changed) > stable/8/sys/dev/sbni/ (props changed) > stable/8/sys/dev/scc/ (props changed) > stable/8/sys/dev/scd/ (props changed) > stable/8/sys/dev/sdhci/ (props changed) > stable/8/sys/dev/sec/ (props changed) > stable/8/sys/dev/sf/ (props changed) > stable/8/sys/dev/sge/ (props changed) > stable/8/sys/dev/si/ (props changed) > stable/8/sys/dev/siba/ (props changed) > stable/8/sys/dev/siis/ (props changed) > stable/8/sys/dev/sio/ (props changed) > stable/8/sys/dev/sis/ (props changed) > stable/8/sys/dev/sk/ (props changed) > stable/8/sys/dev/smbus/ (props changed) > stable/8/sys/dev/smc/ (props changed) > stable/8/sys/dev/sn/ (props changed) > stable/8/sys/dev/snc/ (props changed) > stable/8/sys/dev/snp/ (props changed) > stable/8/sys/dev/sound/ (props changed) > stable/8/sys/dev/sound/chip.h (props changed) > stable/8/sys/dev/sound/clone.c (props changed) > stable/8/sys/dev/sound/clone.h (props changed) > stable/8/sys/dev/sound/driver.c (props changed) > stable/8/sys/dev/sound/isa/ (props changed) > stable/8/sys/dev/sound/macio/ (props changed) > stable/8/sys/dev/sound/midi/ (props changed) > stable/8/sys/dev/sound/pci/ (props changed) > stable/8/sys/dev/sound/pcm/ (props changed) > stable/8/sys/dev/sound/sbus/ (props changed) > stable/8/sys/dev/sound/unit.c (props changed) > stable/8/sys/dev/sound/unit.h (props changed) > stable/8/sys/dev/sound/usb/ (props changed) > stable/8/sys/dev/sound/version.h (props changed) > stable/8/sys/dev/speaker/ (props changed) > stable/8/sys/dev/spibus/ (props changed) > stable/8/sys/dev/ste/ (props changed) > stable/8/sys/dev/stg/ (props changed) > stable/8/sys/dev/stge/ (props changed) > stable/8/sys/dev/streams/ (props changed) > stable/8/sys/dev/sym/ (props changed) > stable/8/sys/dev/syscons/ (props changed) > stable/8/sys/dev/tdfx/ (props changed) > stable/8/sys/dev/ti/ (props changed) > stable/8/sys/dev/tl/ (props changed) > stable/8/sys/dev/tpm/ (props changed) > stable/8/sys/dev/trm/ (props changed) > stable/8/sys/dev/tsec/ (props changed) > stable/8/sys/dev/twa/ (props changed) > stable/8/sys/dev/twe/ (props changed) > stable/8/sys/dev/tws/ (props changed) > stable/8/sys/dev/tx/ (props changed) > stable/8/sys/dev/txp/ (props changed) > stable/8/sys/dev/uart/ (props changed) > stable/8/sys/dev/ubsec/ (props changed) > stable/8/sys/dev/usb/ (props changed) > stable/8/sys/dev/utopia/ (props changed) > stable/8/sys/dev/vge/ (props changed) > stable/8/sys/dev/viawd/ (props changed) > stable/8/sys/dev/virtio/ (props changed) > stable/8/sys/dev/vkbd/ (props changed) > stable/8/sys/dev/vr/ (props changed) > stable/8/sys/dev/vte/ (props changed) > stable/8/sys/dev/vx/ (props changed) > stable/8/sys/dev/watchdog/ (props changed) > stable/8/sys/dev/wb/ (props changed) > stable/8/sys/dev/wbwd/ (props changed) > stable/8/sys/dev/wds/ (props changed) > stable/8/sys/dev/wi/ (props changed) > stable/8/sys/dev/wl/ (props changed) > stable/8/sys/dev/wpi/ (props changed) > stable/8/sys/dev/xe/ (props changed) > stable/8/sys/dev/xen/ (props changed) > stable/8/sys/dev/xl/ (props changed) > stable/8/sys/fs/ (props changed) > stable/8/sys/gdb/ (props changed) > stable/8/sys/geom/ (props changed) > stable/8/sys/gnu/ (props changed) > stable/8/sys/i386/ (props changed) > stable/8/sys/i386/i386/intr_machdep.c (props changed) > stable/8/sys/ia64/ (props changed) > stable/8/sys/isa/ (props changed) > stable/8/sys/kern/ (props changed) > stable/8/sys/kgssapi/ (props changed) > stable/8/sys/libkern/ (props changed) > stable/8/sys/mips/ (props changed) > stable/8/sys/modules/ (props changed) > stable/8/sys/net/ (props changed) > stable/8/sys/net80211/ (props changed) > stable/8/sys/netatalk/ (props changed) > stable/8/sys/netgraph/ (props changed) > stable/8/sys/netinet/ (props changed) > stable/8/sys/netinet6/ (props changed) > stable/8/sys/netipsec/ (props changed) > stable/8/sys/netipx/ (props changed) > stable/8/sys/netnatm/ (props changed) > stable/8/sys/netncp/ (props changed) > stable/8/sys/netsmb/ (props changed) > stable/8/sys/nfs/ (props changed) > stable/8/sys/nfsclient/ (props changed) > stable/8/sys/nfsserver/ (props changed) > stable/8/sys/nlm/ (props changed) > stable/8/sys/opencrypto/ (props changed) > stable/8/sys/pc98/ (props changed) > stable/8/sys/pci/ (props changed) > stable/8/sys/powerpc/ (props changed) > stable/8/sys/rpc/ (props changed) > stable/8/sys/security/ (props changed) > stable/8/sys/sparc64/ (props changed) > stable/8/sys/sun4v/ (props changed) > stable/8/sys/sys/ (props changed) > stable/8/sys/tools/ (props changed) > stable/8/sys/ufs/ (props changed) > stable/8/sys/vm/ (props changed) > stable/8/sys/x86/ (props changed) > stable/8/sys/xdr/ (props changed) > stable/8/sys/xen/ (props changed) > This seems like an excessive amount of mergeinfo properties. Is stable/8 just borked that way (compared to 9) or did my svn client mess up somehow (which wouldn't make much sense since it worked for stable/9 okay)? I'm using svn 1.6.13 on this laptop. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Sat May 4 18:54:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D98AF1B2; Sat, 4 May 2013 18:54:31 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by mx1.freebsd.org (Postfix) with ESMTP id ED5F5AAA; Sat, 4 May 2013 18:54:30 +0000 (UTC) Received: by mail-ee0-f43.google.com with SMTP id b15so1222069eek.2 for ; Sat, 04 May 2013 11:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=eblBClD65oIY+6oG6qcWfJbs3zzvdjGTqP0pX8SMMkE=; b=h7dvl/xO3h2twape04jnfPcI9pMhWCBlB8g9lwkuPCOdJjA1rbuLmbU1YsFkXI6OYD KE3FrIhRjRwaC4OatXoxZEZNbcFFu+sbUbxISCvircwuVZR/hTH7p0/bbImwXy+1gAl2 ttr37Ia5PSPpEgB/SXYhjk8ZbmWjLYicdwijtj+eIS9m1BMbJBPunWSIqaFgGILyHwyh 5CttxDGD7gTmqQneV9neEy3TCAAGwb9eYQxj+XzfkacnEKlKd6nqgFFoQ/Kp3ZHnVb7k IGkwpqHoMq/pLR8rODJXifQISKQRNc92Ck6Su6B8gYA3OfKMnMOv64odbFdiHikfuyQ5 iylA== X-Received: by 10.14.127.5 with SMTP id c5mr26733377eei.45.1367693663755; Sat, 04 May 2013 11:54:23 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id bn53sm23205068eeb.7.2013.05.04.11.54.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 04 May 2013 11:54:22 -0700 (PDT) Sender: Mikolaj Golub Date: Sat, 4 May 2013 21:54:20 +0300 From: Mikolaj Golub To: John Baldwin Subject: Re: svn commit: r250223 - in head: lib/libprocstat sys/kern sys/sys usr.bin/fstat Message-ID: <20130504185419.GA32075@gmail.com> References: <201305032111.r43LBvZ3040508@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305032111.r43LBvZ3040508@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 18:54:31 -0000 On Fri, May 03, 2013 at 09:11:57PM +0000, John Baldwin wrote: > +static int > +procstat_get_sem_info_kvm(kvm_t *kd, struct filestat *fst, > + struct semstat *sem, char *errbuf) > +{ > + struct ksem ksem; > + void *ksemp; > + char *path; > + int i; > + > + assert(kd); > + assert(sem); > + assert(fst); > + bzero(sem, sizeof(*sem)); > + ksemp = fst->fs_typedep; > + if (ksemp == NULL) > + goto fail; > + if (!kvm_read_all(kd, (unsigned long)ksemp, &ksem, > + sizeof(struct ksem))) { > + warnx("can't read ksem at %p", (void *)ksemp); > + goto fail; > + } > + sem->mode = S_IFREG | ksem.ks_mode; > + sem->value = ksem.ks_value; > + if (fst->fs_path == NULL && ksem.ks_path != NULL) { > + path = malloc(MAXPATHLEN); > + for (i = 0; i < MAXPATHLEN - 1; i++) { > + if (!kvm_read_all(kd, (unsigned long)ksem.ks_path + i, > + path + i, 1)) > + break; > + if (path[i] == '\0') > + break; > + } > + path[i] = '\0'; > + if (i == 0) > + free(path); > + else > + fst->fs_path = path; > + } > + return (0); > + > +fail: > + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); > + return (1); > +} I would like to make errbuf optional (for all libprocstat functions that provide it) adding a check before printing to errbuf: if (errbuf != NULL) snprintf(errbuf, ... It looks like there are callers who are not interested in errbuf content. E.g. currently procstat(1) passes NULL when calling functions that require errbuf, namely procstat_get_socket_info and procstat_get_vnode_info, potentially crashing here if an error occurs. Do you (anyone) have objections? -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sat May 4 19:06:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 47FCA410; Sat, 4 May 2013 19:06:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 079D3AEC; Sat, 4 May 2013 19:06:14 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::3182:ceec:e196:7d98] (unknown [IPv6:2001:7b8:3a7:0:3182:ceec:e196:7d98]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3C0C65C45; Sat, 4 May 2013 21:06:12 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r250249 - in stable/8/sys: . amd64/amd64 dev/sound i386/i386 kern From: Dimitry Andric In-Reply-To: Date: Sat, 4 May 2013 21:06:12 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <9AFDCE3E-8967-428A-89C2-4C9F9888E040@FreeBSD.org> References: <201305041849.r44In5HK095619@svn.freebsd.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1503) Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 19:06:15 -0000 On May 4, 2013, at 20:51, mdf@FreeBSD.org wrote: > On Sat, May 4, 2013 at 11:49 AM, Matthew D Fleming = wrote: > Author: mdf > Date: Sat May 4 18:49:04 2013 > New Revision: 250249 > URL: http://svnweb.freebsd.org/changeset/base/250249 ...lots of changed properties... > stable/8/sys/xen/ (props changed) >=20 > This seems like an excessive amount of mergeinfo properties. Is = stable/8 just borked that way (compared to 9) or did my svn client mess = up somehow (which wouldn't make much sense since it worked for stable/9 = okay)? >=20 > I'm using svn 1.6.13 on this laptop. It will probably help if you upgrade to svn 1.7, which has marginally = better merge logic. For some reason, 1.6 tends to add lots of property = changes to each subdirectory, when merging. This was mostly fixed in = 1.7. From owner-svn-src-all@FreeBSD.ORG Sat May 4 19:07:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3683557B; Sat, 4 May 2013 19:07:24 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D3CBAF3; Sat, 4 May 2013 19:07:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44J7NLx002533; Sat, 4 May 2013 19:07:23 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44J7N0T002529; Sat, 4 May 2013 19:07:23 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305041907.r44J7N0T002529@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 4 May 2013 19:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250250 - in head: lib/libc/gen lib/libc/nls lib/libc/sys 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 19:07:24 -0000 Author: pluknet Date: Sat May 4 19:07:22 2013 New Revision: 250250 URL: http://svnweb.freebsd.org/changeset/base/250250 Log: POSIX 1003.1-2008: add ENOTRECOVERABLE, EOWNERDEAD errnos. Modified: head/lib/libc/gen/errlst.c head/lib/libc/nls/C.msg head/lib/libc/sys/intro.2 head/sys/sys/errno.h Modified: head/lib/libc/gen/errlst.c ============================================================================== --- head/lib/libc/gen/errlst.c Sat May 4 18:49:04 2013 (r250249) +++ head/lib/libc/gen/errlst.c Sat May 4 19:07:22 2013 (r250250) @@ -152,5 +152,7 @@ const char *const sys_errlist[] = { "Protocol error", /* 92 - EPROTO */ "Capabilities insufficient", /* 93 - ENOTCAPABLE */ "Not permitted in capability mode", /* 94 - ECAPMODE */ + "State not recoverable", /* 95 - ENOTRECOVERABLE */ + "Previous owner died", /* 96 - EOWNERDEAD */ }; const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); Modified: head/lib/libc/nls/C.msg ============================================================================== --- head/lib/libc/nls/C.msg Sat May 4 18:49:04 2013 (r250249) +++ head/lib/libc/nls/C.msg Sat May 4 19:07:22 2013 (r250250) @@ -193,6 +193,10 @@ $ ENOTCAPABLE 93 Capabilities insufficient $ ECAPMODE 94 Not permitted in capability mode +$ ENOTRECOVERABLE +95 State not recoverable +$ EOWNERDEAD +96 Previous owner died $ $ strsignal() support catalog $ Modified: head/lib/libc/sys/intro.2 ============================================================================== --- head/lib/libc/sys/intro.2 Sat May 4 18:49:04 2013 (r250249) +++ head/lib/libc/sys/intro.2 Sat May 4 19:07:22 2013 (r250250) @@ -28,7 +28,7 @@ .\" @(#)intro.2 8.5 (Berkeley) 2/27/95 .\" $FreeBSD$ .\" -.Dd April 27, 2013 +.Dd May 4, 2013 .Dt INTRO 2 .Os .Sh NAME @@ -470,6 +470,10 @@ An operation on a capability file descri the capability allows. .It Er 94 ECAPMODE Em "Not permitted in capability mode" . The system call or operation is not permitted for capability mode processes. +.It Er 95 ENOTRECOVERABLE Em "State not recoverable" . +The state protected by a robust mutex is not recoverable. +.It Er 96 EOWNERDEAD Em "Previous owner died" . +The owner of a robust mutex terminated while holding the mutex lock. .El .Sh DEFINITIONS .Bl -tag -width Ds Modified: head/sys/sys/errno.h ============================================================================== --- head/sys/sys/errno.h Sat May 4 18:49:04 2013 (r250249) +++ head/sys/sys/errno.h Sat May 4 19:07:22 2013 (r250250) @@ -176,10 +176,12 @@ __END_DECLS #ifndef _POSIX_SOURCE #define ENOTCAPABLE 93 /* Capabilities insufficient */ #define ECAPMODE 94 /* Not permitted in capability mode */ +#define ENOTRECOVERABLE 95 /* State not recoverable */ +#define EOWNERDEAD 96 /* Previous owner died */ #endif /* _POSIX_SOURCE */ #ifndef _POSIX_SOURCE -#define ELAST 94 /* Must be equal largest errno */ +#define ELAST 96 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Sat May 4 19:16:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 94C188A9; Sat, 4 May 2013 19:16:28 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 77931B40; Sat, 4 May 2013 19:16:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44JGSLU006056; Sat, 4 May 2013 19:16:28 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44JGROb006042; Sat, 4 May 2013 19:16:27 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201305041916.r44JGROb006042@svn.freebsd.org> From: Hiroki Sato Date: Sat, 4 May 2013 19:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250251 - in head: sbin/ping6 sys/netinet sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 19:16:28 -0000 Author: hrs Date: Sat May 4 19:16:26 2013 New Revision: 250251 URL: http://svnweb.freebsd.org/changeset/base/250251 Log: Use FF02:0:0:0:0:2:FF00::/104 prefix for IPv6 Node Information Group Address. Although KAME implementation used FF02:0:0:0:0:2::/96 based on older versions of draft-ietf-ipngwg-icmp-name-lookup, it has been changed in RFC 4620. The kernel always joins the /104-prefixed address, and additionally does /96-prefixed one only when net.inet6.icmp6.nodeinfo_oldmcprefix=1. The default value of the sysctl is 1. ping6(8) -N flag now uses /104-prefixed one. When this flag is specified twice, it uses /96-prefixed one instead. Reviewed by: ume Based on work by: Thomas Scheffler PR: conf/174957 MFC after: 2 weeks Modified: head/sbin/ping6/ping6.8 head/sbin/ping6/ping6.c head/sys/netinet/icmp6.h head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_ifattach.h head/sys/netinet6/in6_proto.c Modified: head/sbin/ping6/ping6.8 ============================================================================== --- head/sbin/ping6/ping6.8 Sat May 4 19:07:22 2013 (r250250) +++ head/sbin/ping6/ping6.8 Sat May 4 19:16:26 2013 (r250251) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2010 +.Dd May 5, 2013 .Dt PING6 8 .Os .Sh NAME @@ -215,8 +215,8 @@ unicast and multicast packets. Numeric output only. No attempt will be made to lookup symbolic names from addresses in the reply. .It Fl N -Probe node information multicast group -.Pq Li ff02::2:xxxx:xxxx . +Probe node information multicast group address +.Pq Li ff02::2:ffxx:xxxx . .Ar host must be string hostname of the target (must not be a numeric IPv6 address). @@ -227,6 +227,15 @@ Since node information multicast group i outgoing interface needs to be specified by .Fl I option. +.Pp +When specified twice, the address +.Pq Li ff02::2:xxxx:xxxx +is used instead. +The former is in RFC 4620, the latter is in an old Internet Draft +draft-ietf-ipngwg-icmp-name-lookup. +Note that KAME-derived implementations including +.Fx +use the latter. .It Fl o Exit successfully after receiving one reply packet. .It Fl p Ar pattern Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Sat May 4 19:07:22 2013 (r250250) +++ head/sbin/ping6/ping6.c Sat May 4 19:16:26 2013 (r250251) @@ -287,7 +287,7 @@ void pr_retip(struct ip6_hdr *, u_char void summary(void); void tvsub(struct timeval *, struct timeval *); int setpolicy(int, char *); -char *nigroup(char *); +char *nigroup(char *, int); void usage(void); int @@ -306,6 +306,7 @@ main(int argc, char *argv[]) struct addrinfo hints; int cc, i; int ch, hold, packlen, preload, optval, ret_ga; + int nig_oldmcprefix = -1; u_char *datap; char *e, *target, *ifname = NULL, *gateway = NULL; int ip6optlen = 0; @@ -490,6 +491,7 @@ main(int argc, char *argv[]) break; case 'N': options |= F_NIGROUP; + nig_oldmcprefix++; break; case 'o': options |= F_ONCE; @@ -605,7 +607,7 @@ main(int argc, char *argv[]) } if (options & F_NIGROUP) { - target = nigroup(argv[argc - 1]); + target = nigroup(argv[argc - 1], nig_oldmcprefix); if (target == NULL) { usage(); /*NOTREACHED*/ @@ -2723,7 +2725,7 @@ setpolicy(int so __unused, char *policy) #endif char * -nigroup(char *name) +nigroup(char *name, int nig_oldmcprefix) { char *p; char *q; @@ -2733,6 +2735,7 @@ nigroup(char *name) size_t l; char hbuf[NI_MAXHOST]; struct in6_addr in6; + int valid; p = strchr(name, '.'); if (!p) @@ -2748,7 +2751,7 @@ nigroup(char *name) *q = tolower(*(unsigned char *)q); } - /* generate 8 bytes of pseudo-random value. */ + /* generate 16 bytes of pseudo-random value. */ memset(&ctxt, 0, sizeof(ctxt)); MD5Init(&ctxt); c = l & 0xff; @@ -2756,9 +2759,23 @@ nigroup(char *name) MD5Update(&ctxt, (unsigned char *)name, l); MD5Final(digest, &ctxt); - if (inet_pton(AF_INET6, "ff02::2:0000:0000", &in6) != 1) + if (nig_oldmcprefix) { + /* draft-ietf-ipngwg-icmp-name-lookup */ + valid = inet_pton(AF_INET6, "ff02::2:0000:0000", &in6); + } else { + /* RFC 4620 */ + valid = inet_pton(AF_INET6, "ff02::2:ff00:0000", &in6); + } + if (valid != 1) return NULL; /*XXX*/ - bcopy(digest, &in6.s6_addr[12], 4); + + if (nig_oldmcprefix) { + /* draft-ietf-ipngwg-icmp-name-lookup */ + bcopy(digest, &in6.s6_addr[12], 4); + } else { + /* RFC 4620 */ + bcopy(digest, &in6.s6_addr[13], 3); + } if (inet_ntop(AF_INET6, &in6, hbuf, sizeof(hbuf)) == NULL) return NULL; Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Sat May 4 19:07:22 2013 (r250250) +++ head/sys/netinet/icmp6.h Sat May 4 19:16:26 2013 (r250251) @@ -659,7 +659,8 @@ void kmod_icmp6stat_inc(int statnum); #define ICMPV6CTL_MLD_SOMAXSRC 22 #define ICMPV6CTL_MLD_VERSION 23 #define ICMPV6CTL_ND6_MAXQLEN 24 -#define ICMPV6CTL_MAXID 25 +#define ICMPV6CTL_NODEINFO_OLDMCPREFIX 25 +#define ICMPV6CTL_MAXID 26 #define RTF_PROBEMTU RTF_PROTO1 Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat May 4 19:07:22 2013 (r250250) +++ head/sys/netinet6/in6.c Sat May 4 19:16:26 2013 (r250251) @@ -106,6 +106,9 @@ __FBSDID("$FreeBSD$"); #include #include +VNET_DECLARE(int, icmp6_nodeinfo_oldmcprefix); +#define V_icmp6_nodeinfo_oldmcprefix VNET(icmp6_nodeinfo_oldmcprefix) + /* * Definitions of some costant IP6 addresses. */ @@ -947,6 +950,17 @@ in6_update_ifa_join_mc(struct ifnet *ifp else LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); } + if (V_icmp6_nodeinfo_oldmcprefix && + in6_nigroup_oldmcprefix(ifp, NULL, -1, &mltaddr.sin6_addr) == 0) { + imm = in6_joingroup(ifp, &mltaddr.sin6_addr, &error, delay); + if (imm == NULL) + nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " + "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, + &mltaddr.sin6_addr), if_name(ifp), error)); + /* XXX not very fatal, go on... */ + else + LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); + } /* * Join interface-local all-nodes address. Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Sat May 4 19:07:22 2013 (r250250) +++ head/sys/netinet6/in6_ifattach.c Sat May 4 19:16:26 2013 (r250251) @@ -616,13 +616,16 @@ in6_ifattach_loopback(struct ifnet *ifp) /* * compute NI group address, based on the current hostname setting. - * see draft-ietf-ipngwg-icmp-name-lookup-* (04 and later). + * see RFC 4620. * * when ifp == NULL, the caller is responsible for filling scopeid. + * + * If oldmcprefix == 1, FF02:0:0:0:0:2::/96 is used for NI group address + * while it is FF02:0:0:0:0:2:FF00::/104 in RFC 4620. */ -int -in6_nigroup(struct ifnet *ifp, const char *name, int namelen, - struct in6_addr *in6) +static int +in6_nigroup0(struct ifnet *ifp, const char *name, int namelen, + struct in6_addr *in6, int oldmcprefix) { struct prison *pr; const char *p; @@ -667,7 +670,7 @@ in6_nigroup(struct ifnet *ifp, const cha *q = *q - 'A' + 'a'; } - /* generate 8 bytes of pseudo-random value. */ + /* generate 16 bytes of pseudo-random value. */ bzero(&ctxt, sizeof(ctxt)); MD5Init(&ctxt); MD5Update(&ctxt, &l, sizeof(l)); @@ -677,13 +680,36 @@ in6_nigroup(struct ifnet *ifp, const cha bzero(in6, sizeof(*in6)); in6->s6_addr16[0] = IPV6_ADDR_INT16_MLL; in6->s6_addr8[11] = 2; - bcopy(digest, &in6->s6_addr32[3], sizeof(in6->s6_addr32[3])); + if (oldmcprefix == 0) { + in6->s6_addr8[12] = 0xff; + /* Copy the first 24 bits of 128-bit hash into the address. */ + bcopy(digest, &in6->s6_addr8[13], 3); + } else { + /* Copy the first 32 bits of 128-bit hash into the address. */ + bcopy(digest, &in6->s6_addr32[3], sizeof(in6->s6_addr32[3])); + } if (in6_setscope(in6, ifp, NULL)) return (-1); /* XXX: should not fail */ return 0; } +int +in6_nigroup(struct ifnet *ifp, const char *name, int namelen, + struct in6_addr *in6) +{ + + return (in6_nigroup0(ifp, name, namelen, in6, 0)); +} + +int +in6_nigroup_oldmcprefix(struct ifnet *ifp, const char *name, int namelen, + struct in6_addr *in6) +{ + + return (in6_nigroup0(ifp, name, namelen, in6, 1)); +} + /* * XXX multiple loopback interface needs more care. for instance, * nodelocal address needs to be configured onto only one of them. Modified: head/sys/netinet6/in6_ifattach.h ============================================================================== --- head/sys/netinet6/in6_ifattach.h Sat May 4 19:07:22 2013 (r250250) +++ head/sys/netinet6/in6_ifattach.h Sat May 4 19:16:26 2013 (r250251) @@ -40,6 +40,7 @@ int in6_get_tmpifid(struct ifnet *, u_in void in6_tmpaddrtimer(void *); int in6_get_hw_ifid(struct ifnet *, struct in6_addr *); int in6_nigroup(struct ifnet *, const char *, int, struct in6_addr *); +int in6_nigroup_oldmcprefix(struct ifnet *, const char *, int, struct in6_addr *); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_IFATTACH_H_ */ Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Sat May 4 19:07:22 2013 (r250250) +++ head/sys/netinet6/in6_proto.c Sat May 4 19:16:26 2013 (r250251) @@ -438,6 +438,7 @@ VNET_DEFINE(int, icmp6errppslim) = 100; /* control how to respond to NI queries */ VNET_DEFINE(int, icmp6_nodeinfo) = (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK); +VNET_DEFINE(int, icmp6_nodeinfo_oldmcprefix) = 1; /* * sysctl related items. @@ -602,6 +603,11 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6 CTLFLAG_RW, &VNET_NAME(nd6_useloopback), 0, ""); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO, nodeinfo, CTLFLAG_RW, &VNET_NAME(icmp6_nodeinfo), 0, ""); +SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO_OLDMCPREFIX, + nodeinfo_oldmcprefix, CTLFLAG_RW, + &VNET_NAME(icmp6_nodeinfo_oldmcprefix), 0, + "Join old IPv6 NI group address in draft-ietf-ipngwg-icmp-name-lookup" + " for compatibility with KAME implememtation."); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT, errppslimit, CTLFLAG_RW, &VNET_NAME(icmp6errppslim), 0, ""); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT, nd6_maxnudhint, From owner-svn-src-all@FreeBSD.ORG Sat May 4 19:50:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81ED694; Sat, 4 May 2013 19:50:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 72E62D48; Sat, 4 May 2013 19:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44Jop35018758; Sat, 4 May 2013 19:50:51 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44JopMp018757; Sat, 4 May 2013 19:50:51 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201305041950.r44JopMp018757@svn.freebsd.org> From: Ian Lepore Date: Sat, 4 May 2013 19:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250252 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 19:50:51 -0000 Author: ian Date: Sat May 4 19:50:50 2013 New Revision: 250252 URL: http://svnweb.freebsd.org/changeset/base/250252 Log: EABI unwinder enhancements... When it's time to stop unwinding, don't exit the loop until after printing info about the current frame. Also, if executing the unwind function for a frame doesn't change the values of any registers, log that and exit the loop rather than looping endlessly. Modified: head/sys/arm/arm/db_trace.c Modified: head/sys/arm/arm/db_trace.c ============================================================================== --- head/sys/arm/arm/db_trace.c Sat May 4 19:16:26 2013 (r250251) +++ head/sys/arm/arm/db_trace.c Sat May 4 19:50:50 2013 (r250252) @@ -342,8 +342,11 @@ db_stack_trace_cmd(struct unwind_state * c_db_sym_t sym; u_int reg, i; char *sep; + uint16_t upd_mask; + bool finished; - while (1) { + finished = false; + while (!finished) { /* Reset the mask of updated registers */ state->update_mask = 0; @@ -353,28 +356,20 @@ db_stack_trace_cmd(struct unwind_state * /* Find the item to run */ index = db_find_index(state->start_pc); - if (index->insn == EXIDX_CANTUNWIND) { - db_printf("Unable to unwind\n"); - break; - } else if (index->insn & (1 << 31)) { - /* The data is within the instruction */ - state->insn = &index->insn; - } else { - /* We have a prel31 offset to the unwind table */ - uint32_t prel31_tbl = db_expand_prel31(index->insn); - - state->insn = (uint32_t *)((uintptr_t)&index->insn + - prel31_tbl); + if (index->insn != EXIDX_CANTUNWIND) { + if (index->insn & (1 << 31)) { + /* The data is within the instruction */ + state->insn = &index->insn; + } else { + /* A prel31 offset to the unwind table */ + state->insn = (uint32_t *) + ((uintptr_t)&index->insn + + db_expand_prel31(index->insn)); + } + /* Run the unwind function */ + finished = db_unwind_tab(state); } - /* Run the unwind function */ - if (db_unwind_tab(state) != 0) - break; - - /* This is not a kernel address, stop processing */ - if (state->registers[PC] < VM_MIN_KERNEL_ADDRESS) - break; - /* Print the frame details */ sym = db_search_symbol(state->start_pc, DB_STGY_ANY, &offset); if (sym == C_DB_SYM_NULL) { @@ -393,12 +388,11 @@ db_stack_trace_cmd(struct unwind_state * state->registers[SP], state->registers[FP]); /* Don't print the registers we have already printed */ - state->update_mask &= ~((1 << SP) | (1 << FP) | (1 << LR) | - (1 << PC)); + upd_mask = state->update_mask & + ~((1 << SP) | (1 << FP) | (1 << LR) | (1 << PC)); sep = "\n\t"; - for (i = 0, reg = 0; state->update_mask != 0; - state->update_mask >>= 1, reg++) { - if ((state->update_mask & 1) != 0) { + for (i = 0, reg = 0; upd_mask != 0; upd_mask >>= 1, reg++) { + if ((upd_mask & 1) != 0) { db_printf("%s%sr%d = 0x%08x", sep, (reg < 10) ? " " : "", reg, state->registers[reg]); @@ -412,6 +406,25 @@ db_stack_trace_cmd(struct unwind_state * } } db_printf("\n"); + + /* Stop if directed to do so, or if we've unwound back to the + * kernel entry point, or if the unwind function didn't change + * anything (to avoid getting stuck in this loop forever). + * If the latter happens, it's an indication that the unwind + * information is incorrect somehow for the function named in + * the last frame printed before you see the unwind failure + * message (maybe it needs a STOP_UNWINDING). + */ + if (index->insn == EXIDX_CANTUNWIND) { + db_printf("Unable to unwind further\n"); + finished = true; + } else if (state->registers[PC] < VM_MIN_KERNEL_ADDRESS) { + db_printf("Unable to unwind into user mode\n"); + finished = true; + } else if (state->update_mask == 0) { + db_printf("Unwind failure (no registers changed)\n"); + finished = true; + } } } #endif From owner-svn-src-all@FreeBSD.ORG Sat May 4 19:59:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B66A402; Sat, 4 May 2013 19:59:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73CB3D72; Sat, 4 May 2013 19:59:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44JxaFl020438; Sat, 4 May 2013 19:59:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44JxZDg020435; Sat, 4 May 2013 19:59:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201305041959.r44JxZDg020435@svn.freebsd.org> From: Ian Lepore Date: Sat, 4 May 2013 19:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250253 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 19:59:36 -0000 Author: ian Date: Sat May 4 19:59:35 2013 New Revision: 250253 URL: http://svnweb.freebsd.org/changeset/base/250253 Log: Insert STOP_UNWINDING directives in the _start (kernel entry point) and fork_trampoline (thread entry point) assembler routines, because it's not possible to unwind beyond those points. Also insert STOP_UNWINDING in the exception_exit routine, to prevent an unwind-loop at that point. This is just a stopgap until we get around to instrumenting all assembler functions with proper unwind metadata. Modified: head/sys/arm/arm/exception.S head/sys/arm/arm/locore.S head/sys/arm/arm/swtch.S Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Sat May 4 19:50:50 2013 (r250252) +++ head/sys/arm/arm/exception.S Sat May 4 19:59:35 2013 (r250253) @@ -196,15 +196,20 @@ END(address_exception_entry) * Interrupts are disabled at suitable points to avoid ASTs * being posted between testing and exit to user mode. * - * This function uses PULLFRAMEFROMSVCANDEXIT and - * DO_AST - * only be called if the exception handler used PUSHFRAMEINSVC + * This function uses PULLFRAMEFROMSVCANDEXIT and DO_AST and can + * only be called if the exception handler used PUSHFRAMEINSVC. * + * For EABI, don't try to unwind any further than this. This is a + * stopgap measure to avoid getting stuck in a loop in the unwinder, + * which happens because we don't yet provide the proper unwind info + * here that describes which registers are being restored. */ -exception_exit: +ASENTRY_NP(exception_exit) + STOP_UNWINDING DO_AST PULLFRAMEFROMSVCANDEXIT +END(exception_exit) /* * undefined_entry: Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Sat May 4 19:50:50 2013 (r250252) +++ head/sys/arm/arm/locore.S Sat May 4 19:59:35 2013 (r250253) @@ -77,6 +77,8 @@ __FBSDID("$FreeBSD$"); */ ENTRY_NP(btext) ASENTRY_NP(_start) + STOP_UNWINDING /* Can't unwind into the bootloader! */ + mov r9, r0 /* 0 or boot mode from boot2 */ mov r8, r1 /* Save Machine type */ mov ip, r2 /* Save meta data */ Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Sat May 4 19:50:50 2013 (r250252) +++ head/sys/arm/arm/swtch.S Sat May 4 19:59:35 2013 (r250253) @@ -540,6 +540,7 @@ ENTRY(savectx) END(savectx) ENTRY(fork_trampoline) + STOP_UNWINDING /* Can't unwind beyond the thread enty point */ mov r1, r5 mov r2, sp mov r0, r4 From owner-svn-src-all@FreeBSD.ORG Sat May 4 20:02:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D292874A; Sat, 4 May 2013 20:02:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3F11D8F; Sat, 4 May 2013 20:02:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44K2YJt022997; Sat, 4 May 2013 20:02:34 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44K2YWi022996; Sat, 4 May 2013 20:02:34 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201305042002.r44K2YWi022996@svn.freebsd.org> From: Ian Lepore Date: Sat, 4 May 2013 20:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250254 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 20:02:34 -0000 Author: ian Date: Sat May 4 20:02:34 2013 New Revision: 250254 URL: http://svnweb.freebsd.org/changeset/base/250254 Log: Fix comment block formatting. Modified: head/sys/arm/arm/db_trace.c Modified: head/sys/arm/arm/db_trace.c ============================================================================== --- head/sys/arm/arm/db_trace.c Sat May 4 19:59:35 2013 (r250253) +++ head/sys/arm/arm/db_trace.c Sat May 4 20:02:34 2013 (r250254) @@ -407,7 +407,8 @@ db_stack_trace_cmd(struct unwind_state * } db_printf("\n"); - /* Stop if directed to do so, or if we've unwound back to the + /* + * Stop if directed to do so, or if we've unwound back to the * kernel entry point, or if the unwind function didn't change * anything (to avoid getting stuck in this loop forever). * If the latter happens, it's an indication that the unwind From owner-svn-src-all@FreeBSD.ORG Sat May 4 21:26:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 145A72EF; Sat, 4 May 2013 21:26:12 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06B0899; Sat, 4 May 2013 21:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44LQBPE052399; Sat, 4 May 2013 21:26:11 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44LQBoX052398; Sat, 4 May 2013 21:26:11 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201305042126.r44LQBoX052398@svn.freebsd.org> From: Tim Kientzle Date: Sat, 4 May 2013 21:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250255 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 21:26:12 -0000 Author: kientzle Date: Sat May 4 21:26:11 2013 New Revision: 250255 URL: http://svnweb.freebsd.org/changeset/base/250255 Log: Make a debugging printf a little more useful. Modified: head/sys/arm/arm/trap.c Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Sat May 4 20:02:34 2013 (r250254) +++ head/sys/arm/arm/trap.c Sat May 4 21:26:11 2013 (r250255) @@ -240,8 +240,8 @@ data_abort_handler(trapframe_t *tf) far = cpu_faultaddress(); fsr = cpu_faultstatus(); #if 0 - printf("data abort: %p (from %p %p)\n", (void*)far, (void*)tf->tf_pc, - (void*)tf->tf_svc_lr); + printf("data abort: fault address=%p (from pc=%p lr=%p)\n", + (void*)far, (void*)tf->tf_pc, (void*)tf->tf_svc_lr); #endif /* Update vmmeter statistics */ From owner-svn-src-all@FreeBSD.ORG Sat May 4 21:56:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B121D7DB; Sat, 4 May 2013 21:56:40 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A14D31FD; Sat, 4 May 2013 21:56:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44LuebZ063487; Sat, 4 May 2013 21:56:40 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44Luexb063485; Sat, 4 May 2013 21:56:40 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305042156.r44Luexb063485@svn.freebsd.org> From: Rick Macklem Date: Sat, 4 May 2013 21:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250257 - in stable/9/sys: fs/nfsclient nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 21:56:40 -0000 Author: rmacklem Date: Sat May 4 21:56:39 2013 New Revision: 250257 URL: http://svnweb.freebsd.org/changeset/base/250257 Log: MFC: r249623 Both NFS clients can deadlock when using the "rdirplus" mount option. This can occur when an nfsiod thread that already holds a buffer lock attempts to acquire a vnode lock on an entry in the directory (a LOR) when another thread holding the vnode lock is waiting on an nfsiod thread. This patch avoids the deadlock by disabling readahead for this case, so the nfsiod threads never do readdirplus. Since readaheads for directories need the directory offset cookie from the previous read, they cannot normally happen in parallel. As such, testing by jhb@ and myself didn't find any performance degredation when this patch is applied. If there is a case where this results in a significant performance degradation, mounting without the "rdirplus" option can be done to re-enable readahead for directories. Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c stable/9/sys/nfsclient/nfs_bio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Sat May 4 21:36:47 2013 (r250256) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Sat May 4 21:56:39 2013 (r250257) @@ -1401,10 +1401,18 @@ ncl_asyncio(struct nfsmount *nmp, struct * Commits are usually short and sweet so lets save some cpu and * leave the async daemons for more important rpc's (such as reads * and writes). + * + * Readdirplus RPCs do vget()s to acquire the vnodes for entries + * in the directory in order to update attributes. This can deadlock + * with another thread that is waiting for async I/O to be done by + * an nfsiod thread while holding a lock on one of these vnodes. + * To avoid this deadlock, don't allow the async nfsiod threads to + * perform Readdirplus RPCs. */ mtx_lock(&ncl_iod_mutex); - if (bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && - (nmp->nm_bufqiods > ncl_numasync / 2)) { + if ((bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && + (nmp->nm_bufqiods > ncl_numasync / 2)) || + (bp->b_vp->v_type == VDIR && (nmp->nm_flag & NFSMNT_RDIRPLUS))) { mtx_unlock(&ncl_iod_mutex); return(EIO); } Modified: stable/9/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/9/sys/nfsclient/nfs_bio.c Sat May 4 21:36:47 2013 (r250256) +++ stable/9/sys/nfsclient/nfs_bio.c Sat May 4 21:56:39 2013 (r250257) @@ -1344,10 +1344,18 @@ nfs_asyncio(struct nfsmount *nmp, struct * Commits are usually short and sweet so lets save some cpu and * leave the async daemons for more important rpc's (such as reads * and writes). + * + * Readdirplus RPCs do vget()s to acquire the vnodes for entries + * in the directory in order to update attributes. This can deadlock + * with another thread that is waiting for async I/O to be done by + * an nfsiod thread while holding a lock on one of these vnodes. + * To avoid this deadlock, don't allow the async nfsiod threads to + * perform Readdirplus RPCs. */ mtx_lock(&nfs_iod_mtx); - if (bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && - (nmp->nm_bufqiods > nfs_numasync / 2)) { + if ((bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && + (nmp->nm_bufqiods > nfs_numasync / 2)) || + (bp->b_vp->v_type == VDIR && (nmp->nm_flag & NFSMNT_RDIRPLUS))) { mtx_unlock(&nfs_iod_mtx); return(EIO); } From owner-svn-src-all@FreeBSD.ORG Sat May 4 22:05:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 56B57429; Sat, 4 May 2013 22:05:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 38894266; Sat, 4 May 2013 22:05:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44M5i6K067478; Sat, 4 May 2013 22:05:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44M5hLR067470; Sat, 4 May 2013 22:05:43 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305042205.r44M5hLR067470@svn.freebsd.org> From: Rick Macklem Date: Sat, 4 May 2013 22:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250258 - in stable/9/sys: fs/nfsclient nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 22:05:44 -0000 Author: rmacklem Date: Sat May 4 22:05:43 2013 New Revision: 250258 URL: http://svnweb.freebsd.org/changeset/base/250258 Log: MFC: r249630 When an NFS unmount occurs, once vflush() writes the last dirty buffer for the last vnode on the mount back to the server, it returns. At that point, the code continues with the unmount, including freeing up the nfs specific part of the mount structure. It is possible that an nfsiod thread will try to check for an empty I/O queue in the nfs specific part of the mount structure after it has been free'd by the unmount. This patch avoids this problem by setting the iodmount entries for the mount back to NULL while holding the mutex in the unmount and checking the appropriate entry is non-NULL after acquiring the mutex in the nfsiod thread. Modified: stable/9/sys/fs/nfsclient/nfs_clnfsiod.c stable/9/sys/fs/nfsclient/nfs_clvfsops.c stable/9/sys/nfsclient/nfs_nfsiod.c stable/9/sys/nfsclient/nfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clnfsiod.c Sat May 4 21:56:39 2013 (r250257) +++ stable/9/sys/fs/nfsclient/nfs_clnfsiod.c Sat May 4 22:05:43 2013 (r250258) @@ -304,6 +304,14 @@ nfssvc_iod(void *instance) } mtx_lock(&ncl_iod_mutex); /* + * Make sure the nmp hasn't been dismounted as soon as + * ncl_doio() completes for the last buffer. + */ + nmp = ncl_iodmount[myiod]; + if (nmp == NULL) + break; + + /* * If there are more than one iod on this mount, then defect * so that the iods can be shared out fairly between the mounts */ Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Sat May 4 21:56:39 2013 (r250257) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Sat May 4 22:05:43 2013 (r250258) @@ -80,6 +80,9 @@ extern int nfscl_ticks; extern struct timeval nfsboottime; extern struct nfsstats newnfsstats; extern int nfsrv_useacl; +extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON]; +extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON]; +extern struct mtx ncl_iod_mutex; MALLOC_DEFINE(M_NEWNFSREQ, "newnfsclient_req", "New NFS request header"); MALLOC_DEFINE(M_NEWNFSMNT, "newnfsmnt", "New NFS mount struct"); @@ -1410,7 +1413,7 @@ nfs_unmount(struct mount *mp, int mntfla { struct thread *td; struct nfsmount *nmp; - int error, flags = 0, trycnt = 0; + int error, flags = 0, i, trycnt = 0; td = curthread; @@ -1445,6 +1448,14 @@ nfs_unmount(struct mount *mp, int mntfla */ if ((mntflags & MNT_FORCE) == 0) nfscl_umount(nmp, td); + /* Make sure no nfsiods are assigned to this mount. */ + mtx_lock(&ncl_iod_mutex); + for (i = 0; i < NFS_MAXASYNCDAEMON; i++) + if (ncl_iodmount[i] == nmp) { + ncl_iodwant[i] = NFSIOD_AVAILABLE; + ncl_iodmount[i] = NULL; + } + mtx_unlock(&ncl_iod_mutex); newnfs_disconnect(&nmp->nm_sockreq); crfree(nmp->nm_sockreq.nr_cred); FREE(nmp->nm_nam, M_SONAME); Modified: stable/9/sys/nfsclient/nfs_nfsiod.c ============================================================================== --- stable/9/sys/nfsclient/nfs_nfsiod.c Sat May 4 21:56:39 2013 (r250257) +++ stable/9/sys/nfsclient/nfs_nfsiod.c Sat May 4 22:05:43 2013 (r250258) @@ -308,6 +308,14 @@ nfssvc_iod(void *instance) mtx_unlock(&Giant); mtx_lock(&nfs_iod_mtx); /* + * Make sure the nmp hasn't been dismounted as soon as + * nfs_doio() completes for the last buffer. + */ + nmp = nfs_iodmount[myiod]; + if (nmp == NULL) + break; + + /* * If there are more than one iod on this mount, then defect * so that the iods can be shared out fairly between the mounts */ Modified: stable/9/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/9/sys/nfsclient/nfs_vfsops.c Sat May 4 21:56:39 2013 (r250257) +++ stable/9/sys/nfsclient/nfs_vfsops.c Sat May 4 22:05:43 2013 (r250258) @@ -1362,7 +1362,7 @@ static int nfs_unmount(struct mount *mp, int mntflags) { struct nfsmount *nmp; - int error, flags = 0; + int error, flags = 0, i; if (mntflags & MNT_FORCE) flags |= FORCECLOSE; @@ -1387,6 +1387,14 @@ nfs_unmount(struct mount *mp, int mntfla /* * We are now committed to the unmount. */ + /* Make sure no nfsiods are assigned to this mount. */ + mtx_lock(&nfs_iod_mtx); + for (i = 0; i < NFS_MAXASYNCDAEMON; i++) + if (nfs_iodmount[i] == nmp) { + nfs_iodwant[i] = NFSIOD_AVAILABLE; + nfs_iodmount[i] = NULL; + } + mtx_unlock(&nfs_iod_mtx); nfs_disconnect(nmp); free(nmp->nm_nam, M_SONAME); From owner-svn-src-all@FreeBSD.ORG Sat May 4 22:50:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E76139B8; Sat, 4 May 2013 22:50:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C56453F6; Sat, 4 May 2013 22:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44MoFKv083373; Sat, 4 May 2013 22:50:15 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44MoFE3083372; Sat, 4 May 2013 22:50:15 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201305042250.r44MoFE3083372@svn.freebsd.org> From: Alan Cox Date: Sat, 4 May 2013 22:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250259 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 22:50:16 -0000 Author: alc Date: Sat May 4 22:50:15 2013 New Revision: 250259 URL: http://svnweb.freebsd.org/changeset/base/250259 Log: Optimize vm_radix_lookup_ge() and vm_radix_lookup_le(). Specifically, change the way that these functions ascend the tree when the search for a matching leaf fails at an interior node. Rather than returning to the root of the tree and repeating the lookup with an updated key, maintain a stack of interior nodes that were visited during the descent and use that stack to resume the lookup at the closest ancestor that might have a matching descendant. Sponsored by: EMC / Isilon Storage Division Reviewed by: attilio Tested by: pho Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Sat May 4 22:05:43 2013 (r250258) +++ head/sys/vm/vm_radix.c Sat May 4 22:50:15 2013 (r250259) @@ -257,54 +257,6 @@ vm_radix_keybarr(struct vm_radix_node *r } /* - * Adjusts the idx key to the first upper level available, based on a valid - * initial level and map of available levels. - * Returns a value bigger than 0 to signal that there are not valid levels - * available. - */ -static __inline int -vm_radix_addlev(vm_pindex_t *idx, boolean_t *levels, uint16_t ilev) -{ - - for (; levels[ilev] == FALSE || - vm_radix_slot(*idx, ilev) == (VM_RADIX_COUNT - 1); ilev--) - if (ilev == 0) - return (1); - - /* - * The following computation cannot overflow because *idx's slot at - * ilev is less than VM_RADIX_COUNT - 1. - */ - *idx = vm_radix_trimkey(*idx, ilev); - *idx += VM_RADIX_UNITLEVEL(ilev); - return (0); -} - -/* - * Adjusts the idx key to the first lower level available, based on a valid - * initial level and map of available levels. - * Returns a value bigger than 0 to signal that there are not valid levels - * available. - */ -static __inline int -vm_radix_declev(vm_pindex_t *idx, boolean_t *levels, uint16_t ilev) -{ - - for (; levels[ilev] == FALSE || - vm_radix_slot(*idx, ilev) == 0; ilev--) - if (ilev == 0) - return (1); - - /* - * The following computation cannot overflow because *idx's slot at - * ilev is greater than 0. - */ - *idx = vm_radix_trimkey(*idx, ilev); - *idx -= 1; - return (0); -} - -/* * Internal helper for vm_radix_reclaim_allnodes(). * This function is recursive. */ @@ -499,15 +451,14 @@ vm_radix_lookup(struct vm_radix *rtree, vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index) { + struct vm_radix_node *stack[VM_RADIX_LIMIT]; vm_pindex_t inc; vm_page_t m; struct vm_radix_node *child, *rnode; - int slot; - uint16_t difflev; - boolean_t maplevels[VM_RADIX_LIMIT + 1]; #ifdef INVARIANTS int loops = 0; #endif + int slot, tos; rnode = vm_radix_getroot(rtree); if (rnode == NULL) @@ -519,34 +470,45 @@ vm_radix_lookup_ge(struct vm_radix *rtre else return (NULL); } -restart: - KASSERT(++loops < 1000, ("%s: too many loops", __func__)); - for (difflev = 0; difflev < (VM_RADIX_LIMIT + 1); difflev++) - maplevels[difflev] = FALSE; + tos = 0; for (;;) { - maplevels[rnode->rn_clev] = TRUE; - /* * If the keys differ before the current bisection node, * then the search key might rollback to the earliest * available bisection node or to the smallest key * in the current node (if the owner is bigger than the * search key). - * The maplevels array records any node has been seen - * at a given level. This aids the search for a valid - * bisection node. */ if (vm_radix_keybarr(rnode, index)) { if (index > rnode->rn_owner) { - difflev = vm_radix_keydiff(index, - rnode->rn_owner); - if (vm_radix_addlev(&index, maplevels, - difflev) > 0) - break; - rnode = vm_radix_getroot(rtree); - goto restart; +ascend: + KASSERT(++loops < 1000, + ("vm_radix_lookup_ge: too many loops")); + + /* + * Pop nodes from the stack until either the + * stack is empty or a node that could have a + * matching descendant is found. + */ + do { + if (tos == 0) + return (NULL); + rnode = stack[--tos]; + } while (vm_radix_slot(index, + rnode->rn_clev) == (VM_RADIX_COUNT - 1)); + + /* + * The following computation cannot overflow + * because index's slot at the current level + * is less than VM_RADIX_COUNT - 1. + */ + index = vm_radix_trimkey(index, + rnode->rn_clev); + index += VM_RADIX_UNITLEVEL(rnode->rn_clev); } else index = rnode->rn_owner; + KASSERT(!vm_radix_keybarr(rnode, index), + ("vm_radix_lookup_ge: keybarr failed")); } slot = vm_radix_slot(index, rnode->rn_clev); child = rnode->rn_child[slot]; @@ -580,18 +542,18 @@ restart: ("vm_radix_lookup_ge: child is radix node")); /* - * If a valid page or edge bigger than the search slot is - * found in the traversal, skip to the next higher-level key. + * If a page or edge bigger than the search slot is not found + * in the current node, ascend to the next higher-level node. */ - if (rnode->rn_clev == 0 || vm_radix_addlev(&index, maplevels, - rnode->rn_clev - 1) > 0) - break; - rnode = vm_radix_getroot(rtree); - goto restart; + goto ascend; descend: + KASSERT(rnode->rn_clev < VM_RADIX_LIMIT, + ("vm_radix_lookup_ge: pushing leaf's parent")); + KASSERT(tos < VM_RADIX_LIMIT, + ("vm_radix_lookup_ge: stack overflow")); + stack[tos++] = rnode; rnode = child; } - return (NULL); } /* @@ -600,15 +562,14 @@ descend: vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index) { + struct vm_radix_node *stack[VM_RADIX_LIMIT]; vm_pindex_t inc; vm_page_t m; struct vm_radix_node *child, *rnode; - int slot; - uint16_t difflev; - boolean_t maplevels[VM_RADIX_LIMIT + 1]; #ifdef INVARIANTS int loops = 0; #endif + int slot, tos; rnode = vm_radix_getroot(rtree); if (rnode == NULL) @@ -620,36 +581,47 @@ vm_radix_lookup_le(struct vm_radix *rtre else return (NULL); } -restart: - KASSERT(++loops < 1000, ("%s: too many loops", __func__)); - for (difflev = 0; difflev < (VM_RADIX_LIMIT + 1); difflev++) - maplevels[difflev] = FALSE; + tos = 0; for (;;) { - maplevels[rnode->rn_clev] = TRUE; - /* * If the keys differ before the current bisection node, * then the search key might rollback to the earliest * available bisection node or to the largest key * in the current node (if the owner is smaller than the * search key). - * The maplevels array records any node has been seen - * at a given level. This aids the search for a valid - * bisection node. */ if (vm_radix_keybarr(rnode, index)) { if (index > rnode->rn_owner) { index = rnode->rn_owner + VM_RADIX_COUNT * - VM_RADIX_UNITLEVEL(rnode->rn_clev) - 1; + VM_RADIX_UNITLEVEL(rnode->rn_clev); } else { - difflev = vm_radix_keydiff(index, - rnode->rn_owner); - if (vm_radix_declev(&index, maplevels, - difflev) > 0) - break; - rnode = vm_radix_getroot(rtree); - goto restart; +ascend: + KASSERT(++loops < 1000, + ("vm_radix_lookup_le: too many loops")); + + /* + * Pop nodes from the stack until either the + * stack is empty or a node that could have a + * matching descendant is found. + */ + do { + if (tos == 0) + return (NULL); + rnode = stack[--tos]; + } while (vm_radix_slot(index, + rnode->rn_clev) == 0); + + /* + * The following computation cannot overflow + * because index's slot at the current level + * is greater than 0. + */ + index = vm_radix_trimkey(index, + rnode->rn_clev); } + index--; + KASSERT(!vm_radix_keybarr(rnode, index), + ("vm_radix_lookup_le: keybarr failed")); } slot = vm_radix_slot(index, rnode->rn_clev); child = rnode->rn_child[slot]; @@ -683,18 +655,18 @@ restart: ("vm_radix_lookup_le: child is radix node")); /* - * If a valid page or edge smaller than the search slot is - * found in the traversal, skip to the next higher-level key. + * If a page or edge smaller than the search slot is not found + * in the current node, ascend to the next higher-level node. */ - if (rnode->rn_clev == 0 || vm_radix_declev(&index, maplevels, - rnode->rn_clev - 1) > 0) - break; - rnode = vm_radix_getroot(rtree); - goto restart; + goto ascend; descend: + KASSERT(rnode->rn_clev < VM_RADIX_LIMIT, + ("vm_radix_lookup_le: pushing leaf's parent")); + KASSERT(tos < VM_RADIX_LIMIT, + ("vm_radix_lookup_le: stack overflow")); + stack[tos++] = rnode; rnode = child; } - return (NULL); } /*