From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 01:00:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2B0BB1F; Sun, 16 Nov 2014 01:00:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DCEAE86; Sun, 16 Nov 2014 01:00:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG10fZL041559; Sun, 16 Nov 2014 01:00:41 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG10eSo041551; Sun, 16 Nov 2014 01:00:40 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201411160100.sAG10eSo041551@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Sun, 16 Nov 2014 01:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274559 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 01:00:41 -0000 Author: edwin Date: Sun Nov 16 01:00:39 2014 New Revision: 274559 URL: https://svnweb.freebsd.org/changeset/base/274559 Log: MFV of 274557,tzdata{2014j} Release 2014j - 2014-11-10 17:37:11 -0800 Changes affecting current and future time stamps Turks & Caicos' switch from US eastern time to UTC-4 year-round did not occur on 2014-11-02 at 02:00. It's currently scheduled for 2015-11-01 at 02:00. (Thanks to Chris Walton.) Changes affecting past time stamps Many pre-1989 time stamps have been corrected for Asia/Seoul and Asia/Pyongyang, based on sources for the Korean-language Wikipedia entry for time in Korea. (Thanks to Sanghyuk Jung.) Also, no longer guess that Pyongyang mimicked Seoul time after World War II, as this is politically implausible. Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Africa/Addis_Ababa, Africa/Asmara, Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala, Africa/Mogadishu, Indian/Antananarivo, Indian/Comoro, and Indian/Mayotte. Changes affecting commentary The commentary is less enthusiastic about Shanks as a source, and is more careful to distinguish UT from UTC. Modified: head/contrib/tzdata/africa head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/europe head/contrib/tzdata/northamerica head/contrib/tzdata/southamerica Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Sun Nov 16 00:50:02 2014 (r274558) +++ head/contrib/tzdata/africa Sun Nov 16 01:00:39 2014 (r274559) @@ -6,20 +6,19 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2013-02-21): +# From Paul Eggert (2014-10-31): # -# A good source for time zone historical data outside the U.S. is +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. -# -# Except where otherwise noted, Shanks & Pottenger is the source for -# entries through 1990, and IATA SSIM is the source for entries afterwards. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # # Another source occasionally used is Edward W. Whitman, World Time Differences, # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which @@ -65,7 +64,6 @@ # 3:00 CAST Central Africa Summer Time (no longer used) # 3:00 SAST South Africa Summer Time (no longer used) # 3:00 EAT East Africa Time -# 4:00 EAST East Africa Summer Time (no longer used) # Algeria # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -146,9 +144,7 @@ Zone Africa/Ndjamena 1:00:12 - LMT 1912 1:00 - WAT # Comoros -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro - 3:00 - EAT +# See Africa/Nairobi. # Democratic Republic of the Congo # See Africa/Lagos for the western part and Africa/Maputo for the eastern. @@ -172,9 +168,7 @@ Link Africa/Abidjan Africa/Sao_Tome # Sà Link Africa/Abidjan Atlantic/St_Helena # St Helena # Djibouti -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul - 3:00 - EAT +# See Africa/Nairobi. ############################################################################### @@ -387,27 +381,8 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct # See Africa/Lagos. # Eritrea -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Asmara 2:35:32 - LMT 1870 - 2:35:32 - AMT 1890 # Asmara Mean Time - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT - 3:00 - EAT - # Ethiopia -# From Paul Eggert (2014-07-31): -# Like the Swahili of Kenya and Tanzania, many Ethiopians keep a -# 12-hour clock starting at our 06:00, so their "8 o'clock" is our -# 02:00 or 14:00. Keep this in mind when you ask the time in Amharic. -# -# Shanks & Pottenger write that Ethiopia had six narrowly-spaced time -# zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in -# 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50 -# was for Adis Dera. Quite likely the Shanks data entries are wrong -# anyway. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Addis_Ababa 2:34:48 - LMT 1870 - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT - 3:00 - EAT +# See Africa/Nairobi. # Gabon # See Africa/Lagos. @@ -451,6 +426,15 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 J 2:30 - BEAT 1940 2:45 - BEAUT 1960 3:00 - EAT +Link Africa/Nairobi Africa/Addis_Ababa # Ethiopia +Link Africa/Nairobi Africa/Asmara # Eritrea +Link Africa/Nairobi Africa/Dar_es_Salaam # Tanzania +Link Africa/Nairobi Africa/Djibouti +Link Africa/Nairobi Africa/Kampala # Uganda +Link Africa/Nairobi Africa/Mogadishu # Somalia +Link Africa/Nairobi Indian/Antananarivo # Madagascar +Link Africa/Nairobi Indian/Comoro +Link Africa/Nairobi Indian/Mayotte # Lesotho # See Africa/Johannesburg. @@ -528,11 +512,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920 2:00 - EET # Madagascar -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Antananarivo 3:10:04 - LMT 1911 Jul - 3:00 - EAT 1954 Feb 27 23:00s - 3:00 1:00 EAST 1954 May 29 23:00s - 3:00 - EAT +# See Africa/Nairobi. # Malawi # See Africa/Maputo. @@ -635,9 +615,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # no information; probably like Indian/Mauritius # Mayotte -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou - 3:00 - EAT +# See Africa/Nairobi. # Morocco # See the 'europe' file for Spanish Morocco (Africa/Ceuta). @@ -1049,11 +1027,7 @@ Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # See Africa/Abidjan. # Somalia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Mogadishu 3:01:28 - LMT 1893 Nov - 3:00 - EAT 1931 - 2:30 - BEAT 1957 - 3:00 - EAT +# See Africa/Nairobi. # South Africa # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1096,11 +1070,7 @@ Link Africa/Khartoum Africa/Juba # See Africa/Johannesburg. # Tanzania -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Dar_es_Salaam 2:37:08 - LMT 1931 - 3:00 - EAT 1948 - 2:45 - BEAUT 1961 - 3:00 - EAT +# See Africa/Nairobi. # Togo # See Africa/Abidjan. @@ -1206,12 +1176,7 @@ Zone Africa/Tunis 0:40:44 - LMT 1881 May 1:00 Tunisia CE%sT # Uganda -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kampala 2:09:40 - LMT 1928 Jul - 3:00 - EAT 1930 - 2:30 - BEAT 1948 - 2:45 - BEAUT 1957 - 3:00 - EAT +# See Africa/Nairobi. # Zambia # Zimbabwe Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Sun Nov 16 00:50:02 2014 (r274558) +++ head/contrib/tzdata/asia Sun Nov 16 01:00:39 2014 (r274559) @@ -6,20 +6,19 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2013-08-11): +# From Paul Eggert (2014-10-31): # -# A good source for time zone historical data outside the U.S. is +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. -# -# Except where otherwise noted, Shanks & Pottenger is the source for -# entries through 1990, and IATA SSIM is the source for entries afterwards. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # # Another source occasionally used is Edward W. Whitman, World Time Differences, # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which @@ -1663,44 +1662,70 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May # Korea (North and South) # From Annie I. Bang (2006-07-10): -# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp -# The Ministry of Commerce, Industry and Energy has already -# commissioned a research project [to reintroduce DST] and has said -# the system may begin as early as 2008.... Korea ran a daylight -# saving program from 1949-61 but stopped it during the 1950-53 Korean War. - -# From Shanks & Pottenger: -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule ROK 1960 only - May 15 0:00 1:00 D -Rule ROK 1960 only - Sep 13 0:00 0 S -Rule ROK 1987 1988 - May Sun>=8 0:00 1:00 D -Rule ROK 1987 1988 - Oct Sun>=8 0:00 0 S - -# From Paul Eggert (2014-07-01): -# The following entries are from Shanks & Pottenger, except that I -# guessed that time zone abbreviations through 1945 followed the same +# http://www.koreaherald.com/view.php?ud=200607100012 +# Korea ran a daylight saving program from 1949-61 but stopped it +# during the 1950-53 Korean War. The system was temporarily enforced +# between 1987 and 1988 ... + +# From Sanghyuk Jung (2014-10-29): +# http://mm.icann.org/pipermail/tz/2014-October/021830.html +# According to the Korean Wikipedia +# http://ko.wikipedia.org/wiki/한국_표준시 +# [oldid=12896437 2014-09-04 08:03 UTC] +# DST in Republic of Korea was as follows.... And I checked old +# newspapers in Korean, all articles correspond with data in Wikipedia. +# For example, the article in 1948 (Korean Language) proved that DST +# started at June 1 in that year. For another example, the article in +# 1988 said that DST started at 2:00 AM in that year. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule ROK 1948 only - Jun 1 0:00 1:00 D +Rule ROK 1948 only - Sep 13 0:00 0 S +Rule ROK 1949 only - Apr 3 0:00 1:00 D +Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S +Rule ROK 1950 only - Apr 1 0:00 1:00 D +Rule ROK 1951 only - May 6 0:00 1:00 D +Rule ROK 1955 only - May 5 0:00 1:00 D +Rule ROK 1955 only - Sep 9 0:00 0 S +Rule ROK 1956 only - May 20 0:00 1:00 D +Rule ROK 1956 only - Sep 30 0:00 0 S +Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D +Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S +Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D +Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S + +# From Paul Eggert (2014-10-30): +# The Korean Wikipedia entry gives the following sources for UT offsets: +# +# 1908: Official Journal Article No. 3994 (Edict No. 5) +# 1912: Governor-General of Korea Official Gazette Issue No. 367 +# (Announcement No. 338) +# 1954: Presidential Decree No. 876 (1954-03-17) +# 1961: Law No. 676 (1961-08-07) +# 1987: Law No. 3919 (1986-12-31) +# +# The Wikipedia entry also has confusing information about a change +# to UT+9 in April 1910, but then what would be the point of the later change +# to UT+9 on 1912-01-01? Omit the 1910 change for now. +# +# I guessed that time zone abbreviations through 1945 followed the same # rules as discussed under Taiwan, with nominal switches from JST to KST # when the respective cities were taken over by the Allies after WWII. +# +# For Pyongyang we have no information; guess no changes since World War II. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Seoul 8:27:52 - LMT 1890 - 8:30 - KST 1904 Dec - 9:00 - JCST 1928 - 8:30 - KST 1932 +Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 + 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Sep 8 9:00 - KST 1954 Mar 21 - 8:00 ROK K%sT 1961 Aug 10 - 8:30 - KST 1968 Oct + 8:30 ROK K%sT 1961 Aug 10 9:00 ROK K%sT -Zone Asia/Pyongyang 8:23:00 - LMT 1890 - 8:30 - KST 1904 Dec - 9:00 - JCST 1928 - 8:30 - KST 1932 +Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1 + 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 1954 Mar 21 - 8:00 - KST 1961 Aug 10 9:00 - KST ############################################################################### Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Sun Nov 16 00:50:02 2014 (r274558) +++ head/contrib/tzdata/australasia Sun Nov 16 01:00:39 2014 (r274559) @@ -797,19 +797,19 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2013-02-21): -# A good source for time zone historical data outside the U.S. is +# From Paul Eggert (2014-10-31): +# +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. -# -# Except where otherwise noted, Shanks & Pottenger is the source for -# entries through 1990, and IATA SSIM is the source for entries afterwards. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # # Another source occasionally used is Edward W. Whitman, World Time Differences, # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Sun Nov 16 00:50:02 2014 (r274558) +++ head/contrib/tzdata/europe Sun Nov 16 01:00:39 2014 (r274559) @@ -6,16 +6,19 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2014-05-31): -# A good source for time zone historical data outside the U.S. is +# From Paul Eggert (2014-10-31): +# +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -287,6 +290,14 @@ # "Timeball on the ballast office is down. Dunsink time." # -- James Joyce, Ulysses +# "Countess Markievicz ... claimed that the [1916] abolition of Dublin Mean Time +# was among various actions undertaken by the 'English' government that +# would 'put the whole country into the SF (Sinn Féin) camp'. She claimed +# Irish 'public feeling (was) outraged by forcing of English time on us'." +# -- Parsons M. Dublin lost its time zone - and 25 minutes - after 1916 Rising. +# Irish Times 2014-10-27. +# http://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411 + # From Joseph S. Myers (2005-01-26): # Irish laws are available online at . # These include various relating to legal time, for example: @@ -594,6 +605,7 @@ Rule Russia 1992 only - Sep lastSat 23: Rule Russia 1993 2010 - Mar lastSun 2:00s 1:00 S Rule Russia 1993 1995 - Sep lastSun 2:00s 0 - Rule Russia 1996 2010 - Oct lastSun 2:00s 0 - +# As described below, Russia's 2014 change affects Zone data, not Rule data. # From Alexander Krivenyshev (2011-06-14): # According to Kremlin press service, Russian President Dmitry Medvedev Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Sun Nov 16 00:50:02 2014 (r274558) +++ head/contrib/tzdata/northamerica Sun Nov 16 01:00:39 2014 (r274559) @@ -991,19 +991,19 @@ Zone America/Menominee -5:50:27 - LMT 18 ################################################################################ -# From Paul Eggert (2006-03-22): -# A good source for time zone historical data outside the U.S. is +# From Paul Eggert (2014-10-31): +# +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. -# -# Except where otherwise noted, Shanks & Pottenger is the source for -# entries through 1990, and IATA SSIM is the source for entries afterwards. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # # Other sources occasionally used include: # @@ -3131,13 +3131,17 @@ Zone America/Miquelon -3:44:40 - LMT 191 # From Paul Eggert (2014-08-19): # The 2014-08-13 Cabinet meeting decided to stay on UTC-4 year-round. See: # http://tcweeklynews.com/daylight-savings-time-to-be-maintained-p5353-127.htm -# Model this as a switch from EST/EDT to AST on 2014-11-02 at 02:00. +# Model this as a switch from EST/EDT to AST ... +# From Chris Walton (2014-11-04): +# ... the TCI government appears to have delayed the switch to +# "permanent daylight saving time" by one year.... +# http://tcweeklynews.com/time-change-to-go-ahead-this-november-p5437-127.htm # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Grand_Turk -4:44:32 - LMT 1890 -5:07:11 - KMT 1912 Feb # Kingston Mean Time -5:00 - EST 1979 - -5:00 US E%sT 2014 Nov 2 2:00 + -5:00 US E%sT 2015 Nov Sun>=1 2:00 -4:00 - AST # British Virgin Is Modified: head/contrib/tzdata/southamerica ============================================================================== --- head/contrib/tzdata/southamerica Sun Nov 16 00:50:02 2014 (r274558) +++ head/contrib/tzdata/southamerica Sun Nov 16 01:00:39 2014 (r274559) @@ -6,23 +6,23 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2006-03-22): -# A good source for time zone historical data outside the U.S. is +# From Paul Eggert (2014-10-31): +# +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). -# -# For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. -# http://www.jstor.org/stable/1774359 +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # -# Except where otherwise noted, Shanks & Pottenger is the source for -# entries through 1990, and IATA SSIM is the source for entries afterwards. +# For data circa 1899, a common source is: +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 # # Earlier editions of these tables used the North American style (e.g. ARST and # ARDT for Argentine Standard and Daylight Time), but the following quote From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 01:18:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DB0FE6E; Sun, 16 Nov 2014 01:18:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E822F95; Sun, 16 Nov 2014 01:18:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG1Igc4048215; Sun, 16 Nov 2014 01:18:42 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG1IfUh048213; Sun, 16 Nov 2014 01:18:41 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201411160118.sAG1IfUh048213@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 16 Nov 2014 01:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274560 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 01:18:42 -0000 Author: jmg Date: Sun Nov 16 01:18:41 2014 New Revision: 274560 URL: https://svnweb.freebsd.org/changeset/base/274560 Log: prevent doing filter ops locking for staticly compiled filter ops... This significantly reduces lock contention when adding/removing knotes on busy multi-kq system... Next step is to cache these references per kq.. i.e. kq refs it once and keeps a local ref count so that the same refs don't get accessed by many cpus... only allocate a knote when we might use it... Add a new flag, _FORCEONESHOT.. This allows a thread to force the delivery of another event in a safe manner, say waking up an idle http connection to force it to be reaped... If we are _DISABLE'ing a knote, don't bother to call f_event on it, it's disabled, so won't be delivered anyways.. Tested by: adrian Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sun Nov 16 01:00:39 2014 (r274559) +++ head/sys/kern/kern_event.c Sun Nov 16 01:18:41 2014 (r274560) @@ -281,19 +281,20 @@ MTX_SYSINIT(kqueue_filterops, &filterops MTX_DEF); static struct { struct filterops *for_fop; + int for_nolock; int for_refcnt; } sysfilt_ops[EVFILT_SYSCOUNT] = { - { &file_filtops }, /* EVFILT_READ */ - { &file_filtops }, /* EVFILT_WRITE */ + { &file_filtops, 1 }, /* EVFILT_READ */ + { &file_filtops, 1 }, /* EVFILT_WRITE */ { &null_filtops }, /* EVFILT_AIO */ - { &file_filtops }, /* EVFILT_VNODE */ - { &proc_filtops }, /* EVFILT_PROC */ - { &sig_filtops }, /* EVFILT_SIGNAL */ - { &timer_filtops }, /* EVFILT_TIMER */ - { &file_filtops }, /* EVFILT_PROCDESC */ - { &fs_filtops }, /* EVFILT_FS */ + { &file_filtops, 1 }, /* EVFILT_VNODE */ + { &proc_filtops, 1 }, /* EVFILT_PROC */ + { &sig_filtops, 1 }, /* EVFILT_SIGNAL */ + { &timer_filtops, 1 }, /* EVFILT_TIMER */ + { &file_filtops, 1 }, /* EVFILT_PROCDESC */ + { &fs_filtops, 1 }, /* EVFILT_FS */ { &null_filtops }, /* EVFILT_LIO */ - { &user_filtops }, /* EVFILT_USER */ + { &user_filtops, 1 }, /* EVFILT_USER */ { &null_filtops }, /* EVFILT_SENDFILE */ }; @@ -465,6 +466,10 @@ knote_fork(struct knlist *list, int pid) list->kl_lock(list->kl_lockarg); SLIST_FOREACH(kn, &list->kl_list, kn_selnext) { + /* + * XXX - Why do we skip the kn if it is _INFLUX? Does this + * mean we will not properly wake up some notes? + */ if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) continue; kq = kn->kn_kq; @@ -1002,6 +1007,9 @@ kqueue_fo_find(int filt) if (filt > 0 || filt + EVFILT_SYSCOUNT < 0) return NULL; + if (sysfilt_ops[~filt].for_nolock) + return sysfilt_ops[~filt].for_fop; + mtx_lock(&filterops_lock); sysfilt_ops[~filt].for_refcnt++; if (sysfilt_ops[~filt].for_fop == NULL) @@ -1018,6 +1026,9 @@ kqueue_fo_release(int filt) if (filt > 0 || filt + EVFILT_SYSCOUNT < 0) return; + if (sysfilt_ops[~filt].for_nolock) + return; + mtx_lock(&filterops_lock); KASSERT(sysfilt_ops[~filt].for_refcnt > 0, ("filter object refcount not valid on release")); @@ -1051,7 +1062,10 @@ kqueue_register(struct kqueue *kq, struc if (fops == NULL) return EINVAL; - tkn = knote_alloc(waitok); /* prevent waiting with locks */ + if (kev->flags & EV_ADD) + tkn = knote_alloc(waitok); /* prevent waiting with locks */ + else + tkn = NULL; findkn: if (fops->f_isfd) { @@ -1162,7 +1176,7 @@ findkn: kev->data = 0; kn->kn_kevent = *kev; kn->kn_kevent.flags &= ~(EV_ADD | EV_DELETE | - EV_ENABLE | EV_DISABLE); + EV_ENABLE | EV_DISABLE | EV_FORCEONESHOT); kn->kn_status = KN_INFLUX|KN_DETACHED; error = knote_attach(kn, kq); @@ -1195,6 +1209,11 @@ findkn: goto done; } + if (kev->flags & EV_FORCEONESHOT) { + kn->kn_flags |= EV_ONESHOT; + KNOTE_ACTIVATE(kn, 1); + } + /* * The user may change some filter values after the initial EV_ADD, * but doing so will not reset any filter which has already been @@ -1219,18 +1238,21 @@ findkn: * kn_knlist. */ done_ev_add: - event = kn->kn_fop->f_event(kn, 0); + if ((kev->flags & EV_DISABLE) && + ((kn->kn_status & KN_DISABLED) == 0)) { + kn->kn_status |= KN_DISABLED; + } + + if ((kn->kn_status & KN_DISABLED) == 0) + event = kn->kn_fop->f_event(kn, 0); + else + event = 0; KQ_LOCK(kq); if (event) KNOTE_ACTIVATE(kn, 1); kn->kn_status &= ~(KN_INFLUX | KN_SCAN); KN_LIST_UNLOCK(kn); - if ((kev->flags & EV_DISABLE) && - ((kn->kn_status & KN_DISABLED) == 0)) { - kn->kn_status |= KN_DISABLED; - } - if ((kev->flags & EV_ENABLE) && (kn->kn_status & KN_DISABLED)) { kn->kn_status &= ~KN_DISABLED; if ((kn->kn_status & KN_ACTIVE) && Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Sun Nov 16 01:00:39 2014 (r274559) +++ head/sys/sys/event.h Sun Nov 16 01:18:41 2014 (r274560) @@ -69,6 +69,7 @@ struct kevent { #define EV_DELETE 0x0002 /* delete event from kq */ #define EV_ENABLE 0x0004 /* enable event */ #define EV_DISABLE 0x0008 /* disable event (not reported) */ +#define EV_FORCEONESHOT 0x0100 /* enable _ONESHOT and force trigger */ /* flags */ #define EV_ONESHOT 0x0010 /* only report one occurrence */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 04:07:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 547701C9; Sun, 16 Nov 2014 04:07:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41671F6; Sun, 16 Nov 2014 04:07:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG47slC027583; Sun, 16 Nov 2014 04:07:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG47sIU027582; Sun, 16 Nov 2014 04:07:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411160407.sAG47sIU027582@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 16 Nov 2014 04:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274564 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 04:07:54 -0000 Author: markj Date: Sun Nov 16 04:07:53 2014 New Revision: 274564 URL: https://svnweb.freebsd.org/changeset/base/274564 Log: Fix a couple of bugs around the handling of structs and unions of size zero. These would cause ctfconvert(1) to return an error when attempting to resolve valid C types. Reviewed by: Robert Mustacchi MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sun Nov 16 04:02:50 2014 (r274563) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sun Nov 16 04:07:53 2014 (r274564) @@ -766,7 +766,8 @@ die_array_resolve(tdesc_t *tdp, tdesc_t debug(3, "trying to resolve array %d (cont %d)\n", tdp->t_id, tdp->t_ardef->ad_contents->t_id); - if ((sz = tdesc_size(tdp->t_ardef->ad_contents)) == 0) { + if ((sz = tdesc_size(tdp->t_ardef->ad_contents)) == 0 && + (tdp->t_ardef->ad_contents->t_flags & TDESC_F_RESOLVED) == 0) { debug(3, "unable to resolve array %s (%d) contents %d\n", tdesc_name(tdp), tdp->t_id, tdp->t_ardef->ad_contents->t_id); @@ -1138,12 +1139,17 @@ die_sou_resolve(tdesc_t *tdp, tdesc_t ** /* * For empty members, or GCC/C99 flexible array - * members, a size of 0 is correct. + * members, a size of 0 is correct. Structs and unions + * consisting of flexible array members will also have + * size 0. */ if (mt->t_members == NULL) continue; if (mt->t_type == ARRAY && mt->t_ardef->ad_nelems == 0) continue; + if ((mt->t_flags & TDESC_F_RESOLVED) != 0 && + (mt->t_type == STRUCT || mt->t_type == UNION)) + continue; dw->dw_nunres++; return (1); From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 04:10:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34C58318; Sun, 16 Nov 2014 04:10:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21620103; Sun, 16 Nov 2014 04:10:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG4ANYi030218; Sun, 16 Nov 2014 04:10:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG4AN9e030198; Sun, 16 Nov 2014 04:10:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411160410.sAG4AN9e030198@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 16 Nov 2014 04:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274565 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 04:10:24 -0000 Author: markj Date: Sun Nov 16 04:10:23 2014 New Revision: 274565 URL: https://svnweb.freebsd.org/changeset/base/274565 Log: Remove an incorrect optimization. The type IDs of each member of a struct or union must be checked when determine whether two types are equivalent. This bug could cause ctfmerge(1) to incorrectly merge distinct types. Reviewed by: Robert Mustacchi MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Sun Nov 16 04:07:53 2014 (r274564) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Sun Nov 16 04:10:23 2014 (r274565) @@ -287,19 +287,11 @@ equiv_su(tdesc_t *stdp, tdesc_t *ttdp, e while (ml1 && ml2) { if (ml1->ml_offset != ml2->ml_offset || - strcmp(ml1->ml_name, ml2->ml_name) != 0) + strcmp(ml1->ml_name, ml2->ml_name) != 0 || + ml1->ml_size != ml2->ml_size || + !equiv_node(ml1->ml_type, ml2->ml_type, ed)) return (0); - /* - * Don't do the recursive equivalency checking more than - * we have to. - */ - if (olm1 == NULL || olm1->ml_type->t_id != ml1->ml_type->t_id) { - if (ml1->ml_size != ml2->ml_size || - !equiv_node(ml1->ml_type, ml2->ml_type, ed)) - return (0); - } - olm1 = ml1; ml1 = ml1->ml_next; ml2 = ml2->ml_next; From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 04:13:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5F29819; Sun, 16 Nov 2014 04:13:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B344E1BB; Sun, 16 Nov 2014 04:13:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG4DhrU032073; Sun, 16 Nov 2014 04:13:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG4DhbG032072; Sun, 16 Nov 2014 04:13:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411160413.sAG4DhbG032072@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 16 Nov 2014 04:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274569 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 04:13:43 -0000 Author: markj Date: Sun Nov 16 04:13:42 2014 New Revision: 274569 URL: https://svnweb.freebsd.org/changeset/base/274569 Log: Only compare visitation counters if they've both been set for the current type graph walk. Reviewed by: Robert Mustacchi MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Sun Nov 16 04:13:09 2014 (r274568) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Sun Nov 16 04:13:42 2014 (r274569) @@ -349,7 +349,7 @@ equiv_node(tdesc_t *ctdp, tdesc_t *mtdp, int (*equiv)(tdesc_t *, tdesc_t *, equiv_data_t *); int mapping; - if (ctdp->t_emark > ed->ed_clear_mark || + if (ctdp->t_emark > ed->ed_clear_mark && mtdp->t_emark > ed->ed_clear_mark) return (ctdp->t_emark == mtdp->t_emark); From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:05:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92CD1C49; Sun, 16 Nov 2014 05:05:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8058A7DE; Sun, 16 Nov 2014 05:05:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG55Jmi055206; Sun, 16 Nov 2014 05:05:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG55JRP055205; Sun, 16 Nov 2014 05:05:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160505.sAG55JRP055205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 05:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274571 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:05:19 -0000 Author: ngie Date: Sun Nov 16 05:05:18 2014 New Revision: 274571 URL: https://svnweb.freebsd.org/changeset/base/274571 Log: Use _exit instead of exit so the file descriptors aren't flushed twice in the child processes Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libpthread/t_fork.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_fork.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_fork.c Sun Nov 16 04:13:44 2014 (r274570) +++ head/contrib/netbsd-tests/lib/libpthread/t_fork.c Sun Nov 16 05:05:18 2014 (r274571) @@ -61,7 +61,11 @@ print_pid(void *arg) thread_survived = 1; if (parent != getpid()) { +#ifdef __FreeBSD__ + _exit(1); +#else exit(1); +#endif } return NULL; } @@ -95,7 +99,11 @@ ATF_TC_BODY(fork, tc) ATF_REQUIRE_EQ_MSG(WEXITSTATUS(status), 0, "thread survived in child"); } else { sleep(5); +#ifdef __FreeBSD__ + _exit(thread_survived ? 1 : 0); +#else exit(thread_survived ? 1 : 0); +#endif } } From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:06:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29838D94; Sun, 16 Nov 2014 05:06:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0C587EF; Sun, 16 Nov 2014 05:06:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG56ZLk055392; Sun, 16 Nov 2014 05:06:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG56ZJd055391; Sun, 16 Nov 2014 05:06:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160506.sAG56ZJd055391@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 05:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274572 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:06:36 -0000 Author: ngie Date: Sun Nov 16 05:06:35 2014 New Revision: 274572 URL: https://svnweb.freebsd.org/changeset/base/274572 Log: Only expect timeouts on powerpc with NetBSD Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_mutex.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Sun Nov 16 05:05:18 2014 (r274571) +++ head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Sun Nov 16 05:06:35 2014 (r274572) @@ -117,9 +117,11 @@ ATF_TC(mutex2); ATF_TC_HEAD(mutex2, tc) { atf_tc_set_md_var(tc, "descr", "Checks mutexes"); +#ifdef __NetBSD__ #if defined(__powerpc__) atf_tc_set_md_var(tc, "timeout", "40"); #endif +#endif } ATF_TC_BODY(mutex2, tc) { @@ -129,9 +131,11 @@ ATF_TC_BODY(mutex2, tc) printf("1: Mutex-test 2\n"); +#ifdef __NetBSD__ #if defined(__powerpc__) atf_tc_expect_timeout("PR port-powerpc/44387"); #endif +#endif PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL)); @@ -158,6 +162,7 @@ ATF_TC_BODY(mutex2, tc) global_x, (long)joinval); ATF_REQUIRE_EQ(global_x, 20000000); +#ifdef __NetBSD__ #if defined(__powerpc__) /* XXX force a timeout in ppc case since an un-triggered race otherwise looks like a "failure" */ @@ -165,6 +170,7 @@ ATF_TC_BODY(mutex2, tc) complain about unexpected success */ sleep(41); #endif +#endif } static void * @@ -188,9 +194,11 @@ ATF_TC_HEAD(mutex3, tc) { atf_tc_set_md_var(tc, "descr", "Checks mutexes using a static " "initializer"); +#ifdef __NetBSD__ #if defined(__powerpc__) atf_tc_set_md_var(tc, "timeout", "40"); #endif +#endif } ATF_TC_BODY(mutex3, tc) { @@ -200,9 +208,11 @@ ATF_TC_BODY(mutex3, tc) printf("1: Mutex-test 3\n"); +#ifdef __NetBSD__ #if defined(__powerpc__) atf_tc_expect_timeout("PR port-powerpc/44387"); #endif +#endif global_x = 0; count = count2 = 10000000; @@ -227,6 +237,7 @@ ATF_TC_BODY(mutex3, tc) global_x, (long)joinval); ATF_REQUIRE_EQ(global_x, 20000000); +#ifdef __NetBSD__ #if defined(__powerpc__) /* XXX force a timeout in ppc case since an un-triggered race otherwise looks like a "failure" */ @@ -234,6 +245,7 @@ ATF_TC_BODY(mutex3, tc) complain about unexpected success */ sleep(41); #endif +#endif } static void * From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:08:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07D99F11; Sun, 16 Nov 2014 05:08:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E922A805; Sun, 16 Nov 2014 05:08:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG58JCJ055638; Sun, 16 Nov 2014 05:08:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG58JdG055637; Sun, 16 Nov 2014 05:08:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160508.sAG58JdG055637@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 05:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274573 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:08:20 -0000 Author: ngie Date: Sun Nov 16 05:08:19 2014 New Revision: 274573 URL: https://svnweb.freebsd.org/changeset/base/274573 Log: Expect :pthread_detach to fail with EINVAL instead of ESRCH on FreeBSD PR: 191906 In collaboration with: pho Modified: head/contrib/netbsd-tests/lib/libpthread/t_detach.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_detach.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_detach.c Sun Nov 16 05:06:35 2014 (r274572) +++ head/contrib/netbsd-tests/lib/libpthread/t_detach.c Sun Nov 16 05:08:19 2014 (r274573) @@ -75,6 +75,10 @@ ATF_TC_BODY(pthread_detach, tc) rv = pthread_join(t, NULL); ATF_REQUIRE(rv == EINVAL); +#if defined(__FreeBSD__) + atf_tc_expect_fail("PR # 191906: fails with EINVAL, not ESRCH"); +#endif + /* * As usual, ESRCH should follow if * we try to detach an invalid thread. From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:09:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1F07115; Sun, 16 Nov 2014 05:09:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F033813; Sun, 16 Nov 2014 05:09:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG59OFc055814; Sun, 16 Nov 2014 05:09:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG59Os9055813; Sun, 16 Nov 2014 05:09:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160509.sAG59Os9055813@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 05:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274574 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:09:24 -0000 Author: ngie Date: Sun Nov 16 05:09:23 2014 New Revision: 274574 URL: https://svnweb.freebsd.org/changeset/base/274574 Log: Add pthread_np.h #include and initialize the pthread attribute on FreeBSD Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libpthread/t_join.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_join.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_join.c Sun Nov 16 05:08:19 2014 (r274573) +++ head/contrib/netbsd-tests/lib/libpthread/t_join.c Sun Nov 16 05:09:23 2014 (r274574) @@ -37,6 +37,10 @@ __RCSID("$NetBSD: t_join.c,v 1.8 2012/03 #include +#ifdef __FreeBSD__ +#include +#endif + #include "h_common.h" #ifdef CHECK_STACK_ALIGNMENT @@ -152,6 +156,9 @@ threadfunc2(void *arg) j = (uintptr_t)arg; +#ifdef __FreeBSD__ + pthread_attr_init(&attr); +#endif ATF_REQUIRE(pthread_attr_get_np(pthread_self(), &attr) == 0); ATF_REQUIRE(pthread_attr_getstacksize(&attr, &stacksize) == 0); ATF_REQUIRE(stacksize == STACKSIZE * (j + 1)); From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:11:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37C3B25A; Sun, 16 Nov 2014 05:11:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24A1C8A7; Sun, 16 Nov 2014 05:11:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG5B8Rn057214; Sun, 16 Nov 2014 05:11:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG5B8wt057213; Sun, 16 Nov 2014 05:11:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160511.sAG5B8wt057213@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 05:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274575 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:11:08 -0000 Author: ngie Date: Sun Nov 16 05:11:07 2014 New Revision: 274575 URL: https://svnweb.freebsd.org/changeset/base/274575 Log: #ifdef out a printf on !NetBSD that causes the testcase to fail when comparing the output from the helper program Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libpthread/h_cancel.c Modified: head/contrib/netbsd-tests/lib/libpthread/h_cancel.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/h_cancel.c Sun Nov 16 05:09:23 2014 (r274574) +++ head/contrib/netbsd-tests/lib/libpthread/h_cancel.c Sun Nov 16 05:11:07 2014 (r274575) @@ -42,7 +42,9 @@ main(void) char str1[] = "You should see this.\n"; char str2[] = "You should not see this.\n"; +#ifdef __NetBSD__ printf("Cancellation test: Self-cancellation and disabling.\n"); +#endif pthread_cancel(pthread_self()); From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:13:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C12173CA; Sun, 16 Nov 2014 05:13:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94F718B3; Sun, 16 Nov 2014 05:13:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG5DBXU059780; Sun, 16 Nov 2014 05:13:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG5DB13059779; Sun, 16 Nov 2014 05:13:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160513.sAG5DB13059779@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 05:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274576 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:13:11 -0000 Author: ngie Date: Sun Nov 16 05:13:10 2014 New Revision: 274576 URL: https://svnweb.freebsd.org/changeset/base/274576 Log: Port helper program to FreeBSD, similar to ../../lib/libc/stdlib/h_atexit.c Submitted by: pho In collaboration with: kib Modified: head/contrib/netbsd-tests/lib/libpthread/h_atexit.c Modified: head/contrib/netbsd-tests/lib/libpthread/h_atexit.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/h_atexit.c Sun Nov 16 05:11:07 2014 (r274575) +++ head/contrib/netbsd-tests/lib/libpthread/h_atexit.c Sun Nov 16 05:13:10 2014 (r274576) @@ -47,9 +47,19 @@ __RCSID("$NetBSD: h_atexit.c,v 1.1 2010/ extern int __cxa_atexit(void (*func)(void *), void *, void *); extern void __cxa_finalize(void *); +#ifdef __FreeBSD__ +/* + * See comments in ../../lib/libc/stdlib/h_atexit.c about the deviation + * between FreeBSD and NetBSD with this helper program + */ +static void *dso_handle_1 = (void *)1; +static void *dso_handle_2 = (void *)2; +static void *dso_handle_3 = (void *)3; +#else static int dso_handle_1; static int dso_handle_2; static int dso_handle_3; +#endif static int arg_1; static int arg_2; @@ -170,8 +180,17 @@ main(int argc, char *argv[]) exiting_state = 5; +#if defined(__FreeBSD__) ASSERT(0 == atexit(normal_handler_0)); ASSERT(0 == atexit(normal_handler_1)); + ASSERT(0 == __cxa_atexit(cxa_handler_4, &arg_1, dso_handle_1)); + ASSERT(0 == __cxa_atexit(cxa_handler_5, &arg_1, dso_handle_1)); + ASSERT(0 == __cxa_atexit(cxa_handler_3, &arg_2, dso_handle_2)); + ASSERT(0 == __cxa_atexit(cxa_handler_2, &arg_3, dso_handle_3)); + + __cxa_finalize(dso_handle_1); + __cxa_finalize(dso_handle_2); +#else ASSERT(0 == __cxa_atexit(cxa_handler_4, &arg_1, &dso_handle_1)); ASSERT(0 == __cxa_atexit(cxa_handler_5, &arg_1, &dso_handle_1)); ASSERT(0 == __cxa_atexit(cxa_handler_3, &arg_2, &dso_handle_2)); @@ -179,5 +198,6 @@ main(int argc, char *argv[]) __cxa_finalize(&dso_handle_1); __cxa_finalize(&dso_handle_2); +#endif exit(0); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:13:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EFC850C; Sun, 16 Nov 2014 05:13:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BEE18B9; Sun, 16 Nov 2014 05:13:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG5Deuw059876; Sun, 16 Nov 2014 05:13:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG5DeLb059872; Sun, 16 Nov 2014 05:13:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160513.sAG5DeLb059872@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 05:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274577 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:13:41 -0000 Author: ngie Date: Sun Nov 16 05:13:39 2014 New Revision: 274577 URL: https://svnweb.freebsd.org/changeset/base/274577 Log: Add missing sys/time.h #include for timespecsub macro in lib/libnetbsd/sys/time.h Modified: head/contrib/netbsd-tests/lib/libpthread/t_condwait.c head/contrib/netbsd-tests/lib/libpthread/t_once.c head/contrib/netbsd-tests/lib/libpthread/t_sem.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_condwait.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_condwait.c Sun Nov 16 05:13:10 2014 (r274576) +++ head/contrib/netbsd-tests/lib/libpthread/t_condwait.c Sun Nov 16 05:13:39 2014 (r274577) @@ -40,6 +40,10 @@ __RCSID("$NetBSD: t_condwait.c,v 1.4 201 #include "isqemu.h" +#ifdef __FreeBSD__ +#include +#endif + #define WAITTIME 2 /* Timeout wait secound */ static const int debug = 1; Modified: head/contrib/netbsd-tests/lib/libpthread/t_once.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_once.c Sun Nov 16 05:13:10 2014 (r274576) +++ head/contrib/netbsd-tests/lib/libpthread/t_once.c Sun Nov 16 05:13:39 2014 (r274577) @@ -46,6 +46,10 @@ static int x; #define NTHREADS 25 +#ifdef __FreeBSD__ +#include +#endif + static void ofunc(void) { Modified: head/contrib/netbsd-tests/lib/libpthread/t_sem.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_sem.c Sun Nov 16 05:13:10 2014 (r274576) +++ head/contrib/netbsd-tests/lib/libpthread/t_sem.c Sun Nov 16 05:13:39 2014 (r274577) @@ -111,6 +111,10 @@ __RCSID("$NetBSD: t_sem.c,v 1.8 2014/11/ static sem_t sem; +#ifdef __FreeBSD__ +#include +#endif + ATF_TC(named); ATF_TC_HEAD(named, tc) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:20:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 427146BC; Sun, 16 Nov 2014 05:20:00 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 2FF898E4; Sun, 16 Nov 2014 05:19:59 +0000 (UTC) Received: from AlfredMacbookAir.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 0E1B3341F852; Sat, 15 Nov 2014 21:19:59 -0800 (PST) Message-ID: <546833FE.9060904@freebsd.org> Date: Sat, 15 Nov 2014 21:19:58 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274573 - head/contrib/netbsd-tests/lib/libpthread References: <201411160508.sAG58JdG055637@svn.freebsd.org> In-Reply-To: <201411160508.sAG58JdG055637@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:20:00 -0000 This looks easy enough to fix under _thr_find_thread() in libthread. Any interest in fixing it? Might be worth hacking _thr_find_thread() to take an ERRNO to return based on NULL until we chase down all the paths into it just in case EINVAL is a valid ptr. Also, just wondering what happens on other platforms, does it elicit a crash? Ie. is NULL a safe value to pass in on other platforms? -Alfred On 11/15/14, 9:08 PM, Garrett Cooper wrote: > Author: ngie > Date: Sun Nov 16 05:08:19 2014 > New Revision: 274573 > URL: https://svnweb.freebsd.org/changeset/base/274573 > > Log: > Expect :pthread_detach to fail with EINVAL instead of ESRCH on FreeBSD > > PR: 191906 > In collaboration with: pho > > Modified: > head/contrib/netbsd-tests/lib/libpthread/t_detach.c > > Modified: head/contrib/netbsd-tests/lib/libpthread/t_detach.c > ============================================================================== > --- head/contrib/netbsd-tests/lib/libpthread/t_detach.c Sun Nov 16 05:06:35 2014 (r274572) > +++ head/contrib/netbsd-tests/lib/libpthread/t_detach.c Sun Nov 16 05:08:19 2014 (r274573) > @@ -75,6 +75,10 @@ ATF_TC_BODY(pthread_detach, tc) > rv = pthread_join(t, NULL); > ATF_REQUIRE(rv == EINVAL); > > +#if defined(__FreeBSD__) > + atf_tc_expect_fail("PR # 191906: fails with EINVAL, not ESRCH"); > +#endif > + > /* > * As usual, ESRCH should follow if > * we try to detach an invalid thread. > From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:22:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 521E7823; Sun, 16 Nov 2014 05:22:30 +0000 (UTC) Received: from mail-pd0-x235.google.com (mail-pd0-x235.google.com [IPv6:2607:f8b0:400e:c02::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19963987; Sun, 16 Nov 2014 05:22:30 +0000 (UTC) Received: by mail-pd0-f181.google.com with SMTP id z10so1871219pdj.12 for ; Sat, 15 Nov 2014 21:22:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=stlMvgWO5+uttI9pxzGJxk8fLp+DEhf3z7jzWGn5Gdc=; b=FXkhkz1jK1kmMLL9zfwVGo9g4q9T5j7r+nNDzygmBzQn9lxhGtBifIOw98fcMntBZf f+qk0npBUpclW/IRjRaIawjMA+NhaRff+JxsOyNdwKiEAhIZ8TLV/peCEoKOZiml90Xw yIw+ZUROBMPaKQ6e2ysUt7Tuqd0QwM8gr4vox/45Ya9MJYjVoaCcraVi89Xy4F2JUVj8 PfY2tYkQw0nNbOIGfNeMw6GdQ10ESago+lRECsJ6eQx/UlWJD4ggNOOtDEnUDY8ltFzm dFQB/4eRG9duE3yvJiBQiJvjWcVKoEeDLj/Ks0il3DaDtX8qQ7x/lLNonkqsW9RiKd6s un0A== X-Received: by 10.68.209.230 with SMTP id mp6mr20812399pbc.27.1416115349582; Sat, 15 Nov 2014 21:22:29 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:29f3:7219:6a42:c3? ([2601:8:ab80:7d6:29f3:7219:6a42:c3]) by mx.google.com with ESMTPSA id eb5sm8121331pbd.5.2014.11.15.21.22.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Nov 2014 21:22:29 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_63F81ADA-A815-41A3-BF1D-6A55904D5EA7"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274573 - head/contrib/netbsd-tests/lib/libpthread From: Garrett Cooper In-Reply-To: <546833FE.9060904@freebsd.org> Date: Sat, 15 Nov 2014 21:22:27 -0800 Message-Id: <45B1482F-352E-4874-8A89-1EC225A32E93@gmail.com> References: <201411160508.sAG58JdG055637@svn.freebsd.org> <546833FE.9060904@freebsd.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:22:30 -0000 --Apple-Mail=_63F81ADA-A815-41A3-BF1D-6A55904D5EA7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 15, 2014, at 21:19, Alfred Perlstein wrote: > This looks easy enough to fix under _thr_find_thread() in libthread. >=20 > Any interest in fixing it? Yes, if it=92s POSIXly correct and doesn=92t break everything else. > Might be worth hacking _thr_find_thread() to take an ERRNO to return = based on NULL until we chase down all the paths into it just in case = EINVAL is a valid ptr. K. Thanks for the hint! > Also, just wondering what happens on other platforms, does it elicit a = crash? Ie. is NULL a safe value to pass in on other platforms? I wish I knew what happened on !x86 platforms=85 I honestly don=92t have = access to ARM/MIPS/PowerPC, so I can=92t say :/. Thanks! --Apple-Mail=_63F81ADA-A815-41A3-BF1D-6A55904D5EA7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUaDSTAAoJEMZr5QU6S73endAH+waK3sgNyS3a1P63IL8QHLN9 JJJDeHhZTN3NiJDca+ulsudhSvfgy01Ms505Zm82QqUZcet4bz6c94gX0udyNu14 CfE6c1fV2jEt1Az2n7fPBR9ILY8fJMz+XaPyzut2V5JFzwW5bnuH8WJuWkk/MVR/ nGRXkhSQPVpnD45NnWSWyXkBecpObhCpTZc/Lrp0K6hmH7jjlOT6I08MEzUp0qkY 1ULZYUqh/8KYOHGNFYak2dEx5fVWC/QYWSRR9ltZsl2epocbDhP8e9jeEC02UvfD 2F+98HVHIkB1IX1drgYiM7xab0o5ErtdVhXk4CFXzFiN6BkhT9vxnPGlasHvU14= =6TSV -----END PGP SIGNATURE----- --Apple-Mail=_63F81ADA-A815-41A3-BF1D-6A55904D5EA7-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:24:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8FDC9EA; Sun, 16 Nov 2014 05:24:25 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id C4A4E9A3; Sun, 16 Nov 2014 05:24:25 +0000 (UTC) Received: from AlfredMacbookAir.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id EA0F5341F84E; Sat, 15 Nov 2014 21:24:24 -0800 (PST) Message-ID: <54683508.3030104@freebsd.org> Date: Sat, 15 Nov 2014 21:24:24 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Garrett Cooper Subject: Re: svn commit: r274573 - head/contrib/netbsd-tests/lib/libpthread References: <201411160508.sAG58JdG055637@svn.freebsd.org> <546833FE.9060904@freebsd.org> <45B1482F-352E-4874-8A89-1EC225A32E93@gmail.com> In-Reply-To: <45B1482F-352E-4874-8A89-1EC225A32E93@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:24:26 -0000 On 11/15/14, 9:22 PM, Garrett Cooper wrote: > On Nov 15, 2014, at 21:19, Alfred Perlstein wrote: > >> This looks easy enough to fix under _thr_find_thread() in libthread. >> >> Any interest in fixing it? > Yes, if it’s POSIXly correct and doesn’t break everything else. > >> Might be worth hacking _thr_find_thread() to take an ERRNO to return based on NULL until we chase down all the paths into it just in case EINVAL is a valid ptr. > K. Thanks for the hint! > >> Also, just wondering what happens on other platforms, does it elicit a crash? Ie. is NULL a safe value to pass in on other platforms? > I wish I knew what happened on !x86 platforms… I honestly don’t have access to ARM/MIPS/PowerPC, so I can’t say :/. > > Thanks! Oh, I meant Linux and Solaris, or even other BSD. -Alfred From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:26:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7E37B39; Sun, 16 Nov 2014 05:26:10 +0000 (UTC) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE4A49AF; Sun, 16 Nov 2014 05:26:10 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id v10so19025242pde.22 for ; Sat, 15 Nov 2014 21:26:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=Uq/r9+i4JjqdkBH+wIIbVylW0NO75d7K5tRnBYQ9rqQ=; b=WtfTrnowUp+viIEENgcL7BUbLUDbZeV/ORvgEjpqg0S/1oQR6LL8fFXSLgs+0F9zKU wuGyrX+QUmoXWY5VALPZDwdwNRRDS//3Nr7aoo9VNd4vNejztYqh6HK1eEFjyps3vVAP HI1trmaM92Yqukj4SPVwj1SeS95MTFWaat8Pi2COkCx3HSI+cRjN7VtmPwnS3ikPU3I/ pm2gO3jjIp26Goctpm+iqhJIwJgslnBmVbw/1fOxm3YWKC48wZZK5KuIbGfg58AEmfTx kcnbaQYjukwFIi4hwYG0oPypYVcx4EWei3oEeUtKzhE5/j5En0xJGRZ+B/vWoPe8Fk/c Xd5A== X-Received: by 10.66.188.167 with SMTP id gb7mr20948485pac.23.1416115570240; Sat, 15 Nov 2014 21:26:10 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:29f3:7219:6a42:c3? ([2601:8:ab80:7d6:29f3:7219:6a42:c3]) by mx.google.com with ESMTPSA id yc4sm31757736pab.27.2014.11.15.21.26.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Nov 2014 21:26:09 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_F8772231-BC84-4605-BE87-DB4A39B987D2"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274573 - head/contrib/netbsd-tests/lib/libpthread From: Garrett Cooper In-Reply-To: <54683508.3030104@freebsd.org> Date: Sat, 15 Nov 2014 21:26:08 -0800 Message-Id: References: <201411160508.sAG58JdG055637@svn.freebsd.org> <546833FE.9060904@freebsd.org> <45B1482F-352E-4874-8A89-1EC225A32E93@gmail.com> <54683508.3030104@freebsd.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:26:11 -0000 --Apple-Mail=_F8772231-BC84-4605-BE87-DB4A39B987D2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 15, 2014, at 21:24, Alfred Perlstein wrote: > On 11/15/14, 9:22 PM, Garrett Cooper wrote: >> On Nov 15, 2014, at 21:19, Alfred Perlstein = wrote: >>=20 >>> This looks easy enough to fix under _thr_find_thread() in libthread. >>>=20 >>> Any interest in fixing it? >> Yes, if it=92s POSIXly correct and doesn=92t break everything else. >>=20 >>> Might be worth hacking _thr_find_thread() to take an ERRNO to return = based on NULL until we chase down all the paths into it just in case = EINVAL is a valid ptr. >> K. Thanks for the hint! >>=20 >>> Also, just wondering what happens on other platforms, does it elicit = a crash? Ie. is NULL a safe value to pass in on other platforms? >> I wish I knew what happened on !x86 platforms=85 I honestly don=92t = have access to ARM/MIPS/PowerPC, so I can=92t say :/. >>=20 >> Thanks! >=20 > Oh, I meant Linux and Solaris, or even other BSD. Ah, good question. pho@ ran some of the tests in contrib/netbsd-tests on = Linux/OSX before to do a side-by-side comparison, but I haven=92t setup = the necessary environment to do that testing [yet]. --Apple-Mail=_F8772231-BC84-4605-BE87-DB4A39B987D2 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUaDVwAAoJEMZr5QU6S73e+V0H/0e+fH3FN4BfXneSMSd57va3 bw33x/Mp7LfsCBtRuTzXdO3zdkNxWFgih5N62TM8VhAzkvzHoVXg7dl+/BZrVkwL eDROZTikq+1T1iTmJTkm4piYjoJAAU6pAENF2+XFGocEgeqhaa3SDv/Pyks/sGSw vOSV1EeX0eeM0F5vfw6NRe58tSi8aeV5kTu/fLEMJ6+afH+WJ/k/dfGVt08HXqUJ mm++jTSbciBXBmSvLiyfAV5M9zr1rbFQhbATYIQoLKhq2xM2Z5yOMGosLSkrmdty rX/UxzEXs7LvYKzvGwO3u99VEYo52wGvGIy5fC8zfUCPu8nNrD38a50rqfsB8Sw= =DJfS -----END PGP SIGNATURE----- --Apple-Mail=_F8772231-BC84-4605-BE87-DB4A39B987D2-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 05:31:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD59ACC4; Sun, 16 Nov 2014 05:31:33 +0000 (UTC) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A955A59; Sun, 16 Nov 2014 05:31:33 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id tr6so1203479ieb.36 for ; Sat, 15 Nov 2014 21:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=TdBGAsENA7go24V9/9/eOtMIqevOmg8dWBOFfulTHik=; b=pyS3D0PdsrFp/34NxdmgtvUyjCfk8zeDhIBrkok9o8JW/dL6nH+nWDE9QVQ7XXHhsy 6djGU2SaKAIkzH5R1HHVjn8UNsLcWcJrCd02NkaDfnXJeoDdCt1TCIVtTq2hQvhBaCmM DK0TYL+NKYLONk6yWl+4HeAiszl6YuBQMywi9o1zP5n1xOb0hsTI6epmzT/l13xRg4Ps tD+JK9RmeDdbONyYQri5jVRx3b3dHwaOqAvJuvumA2j17gvDlZBEwGZtz6fv88CN7YSC C2XVxyyEw0TicXhl1KX93ydOkfEsKOxFBkL+Ls+ELY8ouqXceGUTHPvFlarrdB/RD0Xr HeRg== X-Received: by 10.107.164.75 with SMTP id n72mr12884836ioe.17.1416115892973; Sat, 15 Nov 2014 21:31:32 -0800 (PST) Received: from [192.168.20.5] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id p5sm3907763iga.5.2014.11.15.21.31.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Nov 2014 21:31:32 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_F1B63001-3EAE-475F-B42B-FC9EF821AD8D"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274573 - head/contrib/netbsd-tests/lib/libpthread From: Garrett Cooper In-Reply-To: Date: Sat, 15 Nov 2014 21:31:25 -0800 Message-Id: <22C52F4A-B9EC-4C32-9D26-474B7EF0CEF2@gmail.com> References: <201411160508.sAG58JdG055637@svn.freebsd.org> <546833FE.9060904@freebsd.org> <45B1482F-352E-4874-8A89-1EC225A32E93@gmail.com> <54683508.3030104@freebsd.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 05:31:34 -0000 --Apple-Mail=_F1B63001-3EAE-475F-B42B-FC9EF821AD8D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 15, 2014, at 21:26, Garrett Cooper wrote: > On Nov 15, 2014, at 21:24, Alfred Perlstein = wrote: >=20 >> On 11/15/14, 9:22 PM, Garrett Cooper wrote: >>> On Nov 15, 2014, at 21:19, Alfred Perlstein = wrote: >>>=20 >>>> This looks easy enough to fix under _thr_find_thread() in = libthread. >>>>=20 >>>> Any interest in fixing it? >>> Yes, if it=92s POSIXly correct and doesn=92t break everything else. >>>=20 >>>> Might be worth hacking _thr_find_thread() to take an ERRNO to = return based on NULL until we chase down all the paths into it just in = case EINVAL is a valid ptr. >>> K. Thanks for the hint! >>>=20 >>>> Also, just wondering what happens on other platforms, does it = elicit a crash? Ie. is NULL a safe value to pass in on other platforms? >>> I wish I knew what happened on !x86 platforms=85 I honestly don=92t = have access to ARM/MIPS/PowerPC, so I can=92t say :/. >>>=20 >>> Thanks! >>=20 >> Oh, I meant Linux and Solaris, or even other BSD. >=20 > Ah, good question. pho@ ran some of the tests in contrib/netbsd-tests = on Linux/OSX before to do a side-by-side comparison, but I haven=92t = setup the necessary environment to do that testing [yet]. FWIW, there=92s some weirdness with one of the testcases that was never = fully integrated in at Isilon where it blocks on a random mutex in = libthr=85 trying to figure out what=92s causing it to do that, but this = might be related... --Apple-Mail=_F1B63001-3EAE-475F-B42B-FC9EF821AD8D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUaDatAAoJEMZr5QU6S73eZy8IAK9A6R+XfpGWKPSqYT/cjDtp UupQUnew12ZiipVGl5MSDQBfGyl+ns16+JYmg3ZVsm/BY6XkeBhszhcr5ZNzCxxT fV1wLI7adeaEyKSe+R0kgV8NAgrcEHMm3OXk2ourHqtmuudnlBdwmjIUTQU018VS q5Gf+N++b3vftpp1H90nydIWzsusELoGg+OdlqB6JY3nudVhKpaOYT9IRBlKcT3q TGRYWq217sORjJHzgr5v4bljmmsTpFNaluKJKMe90GM3SYRcY4yTPCGM1c5nsEl+ tg4bEGsuRZskvbgEACK1d+lWkp1xPEnwt4BMKRzVJ6Wh5ABc2UY6mOVoVub9R4k= =ITZU -----END PGP SIGNATURE----- --Apple-Mail=_F1B63001-3EAE-475F-B42B-FC9EF821AD8D-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 06:35:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D73AEE6; Sun, 16 Nov 2014 06:35:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2F28F96; Sun, 16 Nov 2014 06:35:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG6ZM4e096835; Sun, 16 Nov 2014 06:35:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG6ZLFL096822; Sun, 16 Nov 2014 06:35:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160635.sAG6ZLFL096822@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 06:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274578 - in head: etc/mtree lib/libthr lib/libthr/tests lib/libthr/tests/dlopen lib/libthr/tests/dlopen/dso X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 06:35:23 -0000 Author: ngie Date: Sun Nov 16 06:35:20 2014 New Revision: 274578 URL: https://svnweb.freebsd.org/changeset/base/274578 Log: Add reachover Makefiles for contrib/netbsd-tests/lib/libpthread as lib/libthr/tests A variant of this code has been tested on amd64/i386 for some time by EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the code will remain off until it's proven it works on virtual hardware or real hardware on other architectures Original work by: pho Sponsored by: EMC / Isilon Storage Division Added: head/lib/libthr/Makefile.amd64 (contents, props changed) head/lib/libthr/Makefile.i386 (contents, props changed) head/lib/libthr/tests/ head/lib/libthr/tests/Makefile (contents, props changed) head/lib/libthr/tests/dlopen/ head/lib/libthr/tests/dlopen/Makefile (contents, props changed) head/lib/libthr/tests/dlopen/dso/ head/lib/libthr/tests/dlopen/dso/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/lib/libthr/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun Nov 16 05:13:39 2014 (r274577) +++ head/etc/mtree/BSD.tests.dist Sun Nov 16 06:35:20 2014 (r274578) @@ -149,6 +149,10 @@ .. libproc .. + libthr + dlopen + .. + .. libutil .. .. Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Sun Nov 16 05:13:39 2014 (r274577) +++ head/lib/libthr/Makefile Sun Nov 16 06:35:20 2014 (r274578) @@ -64,4 +64,6 @@ SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpth CFLAGS+=-DSYSCALL_COMPAT .endif +.include + .include Added: head/lib/libthr/Makefile.amd64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/Makefile.amd64 Sun Nov 16 06:35:20 2014 (r274578) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Added: head/lib/libthr/Makefile.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/Makefile.i386 Sun Nov 16 06:35:20 2014 (r274578) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Added: head/lib/libthr/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/tests/Makefile Sun Nov 16 06:35:20 2014 (r274578) @@ -0,0 +1,58 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H} +SRCTOP= ${.CURDIR:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread + +TESTSDIR= ${TESTSBASE}/lib/libthr + +# TODO: t_name (missing pthread_getname_np support in FreeBSD) +NETBSD_ATF_TESTS_C= barrier_test +NETBSD_ATF_TESTS_C+= cond_test +NETBSD_ATF_TESTS_C+= condwait_test +NETBSD_ATF_TESTS_C+= detach_test +NETBSD_ATF_TESTS_C+= equal_test +NETBSD_ATF_TESTS_C+= fork_test +NETBSD_ATF_TESTS_C+= fpu_test +NETBSD_ATF_TESTS_C+= join_test +NETBSD_ATF_TESTS_C+= kill_test +NETBSD_ATF_TESTS_C+= mutex_test +NETBSD_ATF_TESTS_C+= once_test +NETBSD_ATF_TESTS_C+= preempt_test +NETBSD_ATF_TESTS_C+= rwlock_test +NETBSD_ATF_TESTS_C+= sem_test +NETBSD_ATF_TESTS_C+= sigmask_test +NETBSD_ATF_TESTS_C+= sigsuspend_test +NETBSD_ATF_TESTS_C+= siglongjmp_test +NETBSD_ATF_TESTS_C+= sleep_test +NETBSD_ATF_TESTS_C+= swapcontext_test + +NETBSD_ATF_TESTS_SH= atexit_test +NETBSD_ATF_TESTS_SH+= cancel_test +NETBSD_ATF_TESTS_SH+= exit_test +NETBSD_ATF_TESTS_SH+= resolv_test + +DPADD+= ${LIBPTHREAD} +LDADD+= -lpthread +DPADD.fpu_test+= ${LIBM} +LDADD.fpu_test+= -lm +DPADD.sem_test+= ${LIBRT} +LDADD.sem_test+= -lrt + +BINDIR= ${TESTSDIR} + +PROGS= h_atexit +PROGS+= h_cancel +PROGS+= h_exit +PROGS+= h_resolv + +FILESDIR= ${TESTSDIR} +FILES= d_mach + +TESTS_SUBDIRS= dlopen + +.include + +CFLAGS.condwait_test+= -I${SRCTOP}/contrib/netbsd-tests/lib/libc/gen + +.include Added: head/lib/libthr/tests/dlopen/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/tests/dlopen/Makefile Sun Nov 16 06:35:20 2014 (r274578) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H:H} +SRCTOP= ${.CURDIR:H:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread/dlopen + +.include + +TESTSDIR= ${TESTSBASE}/lib/libthr/dlopen + +CFLAGS+= -DTESTDIR=\"${TESTSDIR:Q}/\" +LDFLAGS+= -L${.OBJDIR}/dso -Wl,-rpath=${TESTDIR} + +.if !defined(NO_PIC) +SUBDIR+= dso + +NETBSD_ATF_TESTS_C= dlopen_test +NETBSD_ATF_TESTS_C+= main_pthread_create_test +# XXX: this blocks running the testcase +#NETBSD_ATF_TESTS_C+= dso_pthread_create_test + +.for t in dlopen_test main_pthread_create_test +DPADD.$t+= ${LIBPTHREAD} +LDADD.$t+= -lpthread +.endfor +.endif + +.include + +.include Added: head/lib/libthr/tests/dlopen/dso/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/tests/dlopen/dso/Makefile Sun Nov 16 06:35:20 2014 (r274578) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H:H:H} +SRCTOP= ${.CURDIR:H:H:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread/dlopen/dso + +SHLIB= h_pthread_dlopen +SHLIB_MAJOR= 1 +SHLIB_NAME= h_pthread_dlopen.so.${SHLIB_MAJOR} +SRCS= h_pthread_dlopen.c + +DPADD+= ${LIBPTHREAD} +LDADD+= -lpthread + +LIBDIR= ${TESTSBASE}/lib/libthr/dlopen + +.include + +.include From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 06:59:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80C4C31F; Sun, 16 Nov 2014 06:59:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D1DC196; Sun, 16 Nov 2014 06:59:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG6xx5W006662; Sun, 16 Nov 2014 06:59:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG6xxda006661; Sun, 16 Nov 2014 06:59:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160659.sAG6xxda006661@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 06:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274579 - head/contrib/netbsd-tests/lib/librt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 06:59:59 -0000 Author: ngie Date: Sun Nov 16 06:59:58 2014 New Revision: 274579 URL: https://svnweb.freebsd.org/changeset/base/274579 Log: Call sem_unlink on semaphores before attempting to create them Due to the lack of uniqueness in the semaphore name, and the fact that the tests don't have cleanup routines, an interrupted test can leave a semaphore "laying around", causing all subsequent attempts to run the test to fail I will file a NetBSD PR for this issue soon Modified: head/contrib/netbsd-tests/lib/librt/t_sem.c Modified: head/contrib/netbsd-tests/lib/librt/t_sem.c ============================================================================== --- head/contrib/netbsd-tests/lib/librt/t_sem.c Sun Nov 16 06:35:20 2014 (r274578) +++ head/contrib/netbsd-tests/lib/librt/t_sem.c Sun Nov 16 06:59:58 2014 (r274579) @@ -86,6 +86,9 @@ ATF_TC_BODY(basic, tc) if (sysconf(_SC_SEMAPHORES) == -1) atf_tc_skip("POSIX semaphores not supported"); +#ifdef __FreeBSD__ + sem_unlink("/sem_b"); +#endif sem_b = sem_open("/sem_b", O_CREAT | O_EXCL, 0644, 0); ATF_REQUIRE(sem_b != SEM_FAILED); @@ -127,6 +130,9 @@ ATF_TC_BODY(child, tc) if (sysconf(_SC_SEMAPHORES) == -1) atf_tc_skip("POSIX semaphores not supported"); +#ifdef __FreeBSD__ + sem_unlink("/sem_a"); +#endif sem_a = sem_open("/sem_a", O_CREAT | O_EXCL, 0644, 0); ATF_REQUIRE(sem_a != SEM_FAILED); From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 07:03:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EADB7470; Sun, 16 Nov 2014 07:03:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBF00234; Sun, 16 Nov 2014 07:03:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG73L4h010640; Sun, 16 Nov 2014 07:03:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG73KLR010633; Sun, 16 Nov 2014 07:03:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160703.sAG73KLR010633@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 07:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274580 - in head: etc/mtree lib/librt lib/librt/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 07:03:22 -0000 Author: ngie Date: Sun Nov 16 07:03:19 2014 New Revision: 274580 URL: https://svnweb.freebsd.org/changeset/base/274580 Log: Add reachover Makefiles for contrib/netbsd-tests/lib/librt A variant of this code has been tested on amd64/i386 for some time by EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the code will remain off until it's proven it works on virtual hardware or real hardware on other architectures Sponsored by: EMC / Isilon Storage Division Added: head/lib/librt/Makefile.amd64 (contents, props changed) head/lib/librt/Makefile.i386 (contents, props changed) head/lib/librt/tests/ head/lib/librt/tests/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/lib/librt/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun Nov 16 06:59:58 2014 (r274579) +++ head/etc/mtree/BSD.tests.dist Sun Nov 16 07:03:19 2014 (r274580) @@ -149,6 +149,8 @@ .. libproc .. + librt + .. libthr dlopen .. Modified: head/lib/librt/Makefile ============================================================================== --- head/lib/librt/Makefile Sun Nov 16 06:59:58 2014 (r274579) +++ head/lib/librt/Makefile Sun Nov 16 07:03:19 2014 (r274580) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB=rt SHLIB_MAJOR= 1 CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR} @@ -18,4 +20,6 @@ PRECIOUSLIB= VERSION_MAP= ${.CURDIR}/Version.map +.include + .include Added: head/lib/librt/Makefile.amd64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/librt/Makefile.amd64 Sun Nov 16 07:03:19 2014 (r274580) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Added: head/lib/librt/Makefile.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/librt/Makefile.i386 Sun Nov 16 07:03:19 2014 (r274580) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Added: head/lib/librt/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/librt/tests/Makefile Sun Nov 16 07:03:19 2014 (r274580) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H} +SRCTOP= ${.CURDIR:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/librt + +TESTSDIR= ${TESTSBASE}/lib/librt + +DPADD+= ${LIBRT} +LDADD+= -lrt + +NETBSD_ATF_TESTS_C= sched_test +NETBSD_ATF_TESTS_C+= sem_test + +.include + +.include From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 07:55:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C9149F7; Sun, 16 Nov 2014 07:55:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5D988E; Sun, 16 Nov 2014 07:55:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG7tTrT033875; Sun, 16 Nov 2014 07:55:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG7tTKR033873; Sun, 16 Nov 2014 07:55:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160755.sAG7tTKR033873@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 07:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274581 - in head: lib/libc/tests/gen tools/regression/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 07:55:29 -0000 Author: ngie Date: Sun Nov 16 07:55:28 2014 New Revision: 274581 URL: https://svnweb.freebsd.org/changeset/base/274581 Log: Convert tools/regression/lib/libc/gen/test-arc4random into an ATF testcase and rename as lib/libc/gen/arc4random_test Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/gen/arc4random_test.c - copied, changed from r274390, head/tools/regression/lib/libc/gen/test-arc4random.c Deleted: head/tools/regression/lib/libc/gen/test-arc4random.c Modified: head/lib/libc/tests/gen/Makefile Modified: head/lib/libc/tests/gen/Makefile ============================================================================== --- head/lib/libc/tests/gen/Makefile Sun Nov 16 07:03:19 2014 (r274580) +++ head/lib/libc/tests/gen/Makefile Sun Nov 16 07:55:28 2014 (r274581) @@ -4,6 +4,8 @@ TESTSDIR= ${TESTSBASE}/lib/libc/gen +ATF_TESTS_C= arc4random_test + # TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid, t_sleep # TODO: t_siginfo (fixes require further inspection) # TODO: t_sethostname_test (consistently screws up the hostname) Copied and modified: head/lib/libc/tests/gen/arc4random_test.c (from r274390, head/tools/regression/lib/libc/gen/test-arc4random.c) ============================================================================== --- head/tools/regression/lib/libc/gen/test-arc4random.c Tue Nov 11 18:15:05 2014 (r274390, copy source) +++ head/lib/libc/tests/gen/arc4random_test.c Sun Nov 16 07:55:28 2014 (r274581) @@ -27,13 +27,14 @@ #include __FBSDID("$FreeBSD$"); -#include #include +#include #include #include #include #include #include +#include /* * BUFSIZE is the number of bytes of rc4 output to compare. The probability @@ -45,7 +46,9 @@ __FBSDID("$FreeBSD$"); * Test whether arc4random_buf() returns the same sequence of bytes in both * parent and child processes. (Hint: It shouldn't.) */ -int main(int argc, char *argv[]) { +ATF_TC_WITHOUT_HEAD(test_arc4random); +ATF_TC_BODY(test_arc4random, tc) +{ struct shared_page { char parentbuf[BUFSIZE]; char childbuf[BUFSIZE]; @@ -65,10 +68,7 @@ int main(int argc, char *argv[]) { arc4random_buf(&c, 1); pid = fork(); - if (pid < 0) { - printf("fail 1 - fork\n"); - exit(1); - } + ATF_REQUIRE(0 <= pid); if (pid == 0) { /* child */ arc4random_buf(page->childbuf, BUFSIZE); @@ -79,11 +79,14 @@ int main(int argc, char *argv[]) { arc4random_buf(page->parentbuf, BUFSIZE); wait(&status); } - if (memcmp(page->parentbuf, page->childbuf, BUFSIZE) == 0) { - printf("fail 1 - sequences are the same\n"); - exit(1); - } + ATF_CHECK_MSG(memcmp(page->parentbuf, page->childbuf, BUFSIZE) != 0, + "sequences are the same"); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, test_arc4random); - printf("ok 1 - sequences are different\n"); - exit(0); + return (atf_no_error()); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 07:58:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AEAFC35; Sun, 16 Nov 2014 07:58:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 677528AD; Sun, 16 Nov 2014 07:58:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG7w7v4034344; Sun, 16 Nov 2014 07:58:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG7w7IR034343; Sun, 16 Nov 2014 07:58:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411160758.sAG7w7IR034343@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 07:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274582 - head/tools/regression/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 07:58:07 -0000 Author: ngie Date: Sun Nov 16 07:58:06 2014 New Revision: 274582 URL: https://svnweb.freebsd.org/changeset/base/274582 Log: Remove test-arc4random from this Makefile so others can continue to use this as-is for the time being Modified: head/tools/regression/lib/libc/gen/Makefile Modified: head/tools/regression/lib/libc/gen/Makefile ============================================================================== --- head/tools/regression/lib/libc/gen/Makefile Sun Nov 16 07:55:28 2014 (r274581) +++ head/tools/regression/lib/libc/gen/Makefile Sun Nov 16 07:58:06 2014 (r274582) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTS= test-arc4random test-fmtcheck test-fmtmsg test-fnmatch \ +TESTS= test-fmtcheck test-fmtmsg test-fnmatch \ test-fpclassify test-ftw test-popen test-posix_spawn test-wordexp .PHONY: tests From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 09:44:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 930B8D38; Sun, 16 Nov 2014 09:44:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65001177; Sun, 16 Nov 2014 09:44:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG9iVM5084772; Sun, 16 Nov 2014 09:44:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG9iUTJ084769; Sun, 16 Nov 2014 09:44:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411160944.sAG9iUTJ084769@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 16 Nov 2014 09:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274583 - head/usr.sbin/watchdogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 09:44:31 -0000 Author: delphij Date: Sun Nov 16 09:44:30 2014 New Revision: 274583 URL: https://svnweb.freebsd.org/changeset/base/274583 Log: Default to use 10 seconds as nap interval instead of 1. Previously, we have a nap interval of 1 second while we have a timeout of 128 seconds by default, which could be an overkill, and for some hardware the patting action may be expensive. Note that the choice of nap interval is still arbitrary. We preferred a safe value where even when the system is very heavily loaded, the watchdog should not shoot the system down if it's not really hung. According to the manual page of Linux's watchdog daemon, the nap interval time of theirs is 10 seconds, which seems to be a reasonable value -- according to Intel documentation AP-725 (Document Number: 292273-001), ICH5's maximum timeout is about 37.5 seconds, which the ichwd(4) driver would set when we requested 128 seconds (although it should probably feed back this as an error and do not set the timeout). Since that's the shortest maximum value, 10 seconds seems to be a right choice for us too. Discussed with: alfred MFC after: 1 month Modified: head/usr.sbin/watchdogd/watchdogd.8 head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/watchdogd.8 ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.8 Sun Nov 16 07:58:06 2014 (r274582) +++ head/usr.sbin/watchdogd/watchdogd.8 Sun Nov 16 09:44:30 2014 (r274583) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 18, 2014 +.Dd November 16, 2014 .Dt WATCHDOGD 8 .Os .Sh NAME @@ -79,7 +79,7 @@ reboot if there are problems with the sc The .Fl s Ar sleep argument can be used to control the sleep period between each execution -of the check and defaults to one second. +of the check and defaults to 10 seconds. .Pp The .Fl t Ar timeout Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Sun Nov 16 07:58:06 2014 (r274582) +++ head/usr.sbin/watchdogd/watchdogd.c Sun Nov 16 09:44:30 2014 (r274583) @@ -87,7 +87,7 @@ static int is_dry_run = 0; /* do not ar static int do_timedog = 0; static int do_syslog = 1; static int fd = -1; -static int nap = 1; +static int nap = 10; static int carp_thresh_seconds = -1; static char *test_cmd = NULL; From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 14:56:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 500BE1D2; Sun, 16 Nov 2014 14:56:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C651C4; Sun, 16 Nov 2014 14:56:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGEuWU2029738; Sun, 16 Nov 2014 14:56:32 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGEuWVj029737; Sun, 16 Nov 2014 14:56:32 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411161456.sAGEuWVj029737@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 16 Nov 2014 14:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274585 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 14:56:32 -0000 Author: melifaro Date: Sun Nov 16 14:56:31 2014 New Revision: 274585 URL: https://svnweb.freebsd.org/changeset/base/274585 Log: Make witness happy: destroy rte lock before free. MFC after: 2 weeks Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Nov 16 13:57:53 2014 (r274584) +++ head/sys/net/route.c Sun Nov 16 14:56:31 2014 (r274585) @@ -517,6 +517,7 @@ rtfree(struct rtentry *rt) /* * and the rtentry itself of course */ + RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); return; } From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 17:53:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7780A7D; Sun, 16 Nov 2014 17:53:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C30EA2AE; Sun, 16 Nov 2014 17:53:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGHrmx5012728; Sun, 16 Nov 2014 17:53:48 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGHrmfA012727; Sun, 16 Nov 2014 17:53:48 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411161753.sAGHrmfA012727@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Sun, 16 Nov 2014 17:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274587 - head/sys/dev/drm2/radeon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 17:53:49 -0000 Author: dumbbell Date: Sun Nov 16 17:53:48 2014 New Revision: 274587 URL: https://svnweb.freebsd.org/changeset/base/274587 Log: drm/radeon: Lower priority of a message related to invalid EDID Like in r259717, the prority goes from "error" to "debug" to avoid spamming logs when the connectors are polled. PR: 194770 Submitted by: Larry Rosenman MFC after: 1 week Modified: head/sys/dev/drm2/radeon/radeon_connectors.c Modified: head/sys/dev/drm2/radeon/radeon_connectors.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_connectors.c Sun Nov 16 15:31:49 2014 (r274586) +++ head/sys/dev/drm2/radeon/radeon_connectors.c Sun Nov 16 17:53:48 2014 (r274587) @@ -954,7 +954,7 @@ radeon_dvi_detect(struct drm_connector * radeon_connector->edid = drm_get_edid(&radeon_connector->base, radeon_connector->ddc_bus->adapter); if (!radeon_connector->edid) { - DRM_ERROR("%s: probed a monitor but no|invalid EDID\n", + DRM_DEBUG_KMS("%s: probed a monitor but no|invalid EDID\n", drm_get_connector_name(connector)); /* rs690 seems to have a problem with connectors not existing and always * return a block of 0's. If we see this just stop polling on this output */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 18:08:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD307DD1; Sun, 16 Nov 2014 18:08:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C965C3CB; Sun, 16 Nov 2014 18:08:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGI81iO018210; Sun, 16 Nov 2014 18:08:01 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGI81RG018208; Sun, 16 Nov 2014 18:08:01 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411161808.sAGI81RG018208@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 16 Nov 2014 18:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274588 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 18:08:02 -0000 Author: melifaro Date: Sun Nov 16 18:08:00 2014 New Revision: 274588 URL: https://svnweb.freebsd.org/changeset/base/274588 Log: Fix r273112: do not turn DROP_EN by default. Due to adapter->hw.fc.requested_mode is filled with default value after ixgbe_initialize_receive_units(), this leads to enabling DROP_EN in most cases. Tested by: ae MFC after: 1 week Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Nov 16 17:53:48 2014 (r274587) +++ head/sys/dev/ixgbe/ixgbe.c Sun Nov 16 18:08:00 2014 (r274588) @@ -4385,7 +4385,7 @@ ixgbe_initialize_receive_units(struct ad * this code is moved elsewhere. */ if (adapter->num_queues > 1 && - adapter->hw.fc.requested_mode == ixgbe_fc_none) { + adapter->fc == ixgbe_fc_none) { srrctl |= IXGBE_SRRCTL_DROP_EN; } else { srrctl &= ~IXGBE_SRRCTL_DROP_EN; From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 18:15:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BE871A2; Sun, 16 Nov 2014 18:15:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 285CC68F; Sun, 16 Nov 2014 18:15:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGIFOip022642; Sun, 16 Nov 2014 18:15:24 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGIFO9C022641; Sun, 16 Nov 2014 18:15:24 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411161815.sAGIFO9C022641@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 16 Nov 2014 18:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274589 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 18:15:24 -0000 Author: melifaro Date: Sun Nov 16 18:15:23 2014 New Revision: 274589 URL: https://svnweb.freebsd.org/changeset/base/274589 Log: Revert r274585: rte lock is properly destroyed in uma dtor callback. Pointed by: glebius Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Nov 16 18:08:00 2014 (r274588) +++ head/sys/net/route.c Sun Nov 16 18:15:23 2014 (r274589) @@ -517,7 +517,6 @@ rtfree(struct rtentry *rt) /* * and the rtentry itself of course */ - RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); return; } From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 18:26:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 519B2AE9; Sun, 16 Nov 2014 18:26:12 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F13377DB; Sun, 16 Nov 2014 18:26:11 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1Xq4EQ-000Afs-PY; Sun, 16 Nov 2014 22:07:26 +0400 Date: Sun, 16 Nov 2014 22:07:26 +0400 From: Slawa Olhovchenkov To: Xin LI Subject: Re: svn commit: r274337 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris... Message-ID: <20141116180726.GA40905@zxy.spb.ru> References: <201411100820.sAA8KMSO019943@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411100820.sAA8KMSO019943@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 18:26:12 -0000 On Mon, Nov 10, 2014 at 08:20:22AM +0000, Xin LI wrote: > Author: delphij > Date: Mon Nov 10 08:20:21 2014 > New Revision: 274337 > URL: https://svnweb.freebsd.org/changeset/base/274337 > > Log: > MFV r274273: > > ZFS large block support. > > Please note that booting from datasets that have recordsize greater > than 128KB is not supported (but it's Okay to enable the feature on > the pool). This *may* remain unchanged because of memory constraint. > > Limited safety belt is provided for mounted root filesystem but use > caution is advised. > > Illumos issue: > 5027 zfs large block support > > MFC after: 1 month Thanks! Please, add tunnable and sysctl for modify dsl_dataset.c:zfs_max_recordsize From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 19:47:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B2A3E11; Sun, 16 Nov 2014 19:47:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC0D7F3C; Sun, 16 Nov 2014 19:47:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGJlTfi065419; Sun, 16 Nov 2014 19:47:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGJlTGW065418; Sun, 16 Nov 2014 19:47:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411161947.sAGJlTGW065418@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 19:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274591 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 19:47:30 -0000 Author: ngie Date: Sun Nov 16 19:47:29 2014 New Revision: 274591 URL: https://svnweb.freebsd.org/changeset/base/274591 Log: Add freebsd-testing and myself to MAINTAINERS for contrib/netbsd-tests and contrib/pjdfstest Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Sun Nov 16 18:44:46 2014 (r274590) +++ head/MAINTAINERS Sun Nov 16 19:47:29 2014 (r274591) @@ -80,6 +80,8 @@ contrib/pf glebius Pre-commit review rec file obrien Insists to keep file blocked from other's unapproved commits contrib/bzip2 obrien Pre-commit review required. +contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. +contrib/pjdfstest freebsd-testing,ngie Pre-commit review requested. geom_concat pjd Pre-commit review preferred. geom_eli pjd Pre-commit review preferred. geom_gate pjd Pre-commit review preferred. From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 19:57:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C38EBAC; Sun, 16 Nov 2014 19:57:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7733E86; Sun, 16 Nov 2014 19:57:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGJvmSZ070112; Sun, 16 Nov 2014 19:57:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGJvlFj070108; Sun, 16 Nov 2014 19:57:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411161957.sAGJvlFj070108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 19:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274592 - in head: lib/libc/tests/stdio tools/regression/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 19:57:48 -0000 Author: ngie Date: Sun Nov 16 19:57:47 2014 New Revision: 274592 URL: https://svnweb.freebsd.org/changeset/base/274592 Log: Convert tools/regression/lib/libc/stdio/test-fmemopen into an ATF testcase and rename as lib/libc/stdio/fmemopen2_test Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/stdio/fmemopen2_test.c - copied, changed from r274390, head/tools/regression/lib/libc/stdio/test-fmemopen.c Deleted: head/tools/regression/lib/libc/stdio/test-fmemopen.c Modified: head/lib/libc/tests/stdio/Makefile head/tools/regression/lib/libc/stdio/Makefile Modified: head/lib/libc/tests/stdio/Makefile ============================================================================== --- head/lib/libc/tests/stdio/Makefile Sun Nov 16 19:47:29 2014 (r274591) +++ head/lib/libc/tests/stdio/Makefile Sun Nov 16 19:57:47 2014 (r274592) @@ -2,6 +2,8 @@ TESTSDIR= ${TESTSBASE}/lib/libc/stdio +ATF_TESTS_C= fmemopen2_test + NETBSD_ATF_TESTS_C= clearerr_test NETBSD_ATF_TESTS_C+= fflush_test NETBSD_ATF_TESTS_C+= fmemopen_test Copied and modified: head/lib/libc/tests/stdio/fmemopen2_test.c (from r274390, head/tools/regression/lib/libc/stdio/test-fmemopen.c) ============================================================================== --- head/tools/regression/lib/libc/stdio/test-fmemopen.c Tue Nov 11 18:15:05 2014 (r274390, copy source) +++ head/lib/libc/tests/stdio/fmemopen2_test.c Sun Nov 16 19:57:47 2014 (r274592) @@ -31,14 +31,14 @@ SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include #include #include #include #include +#include -void -test_preexisting() +ATF_TC_WITHOUT_HEAD(test_preexisting); +ATF_TC_BODY(test_preexisting, tc) { /* * Use a pre-existing buffer. @@ -55,55 +55,55 @@ test_preexisting() /* Open a FILE * using fmemopen. */ fp = fmemopen(buf, sizeof(buf), "w"); - assert(fp != NULL); + ATF_REQUIRE(fp != NULL); /* Write to the buffer. */ nofw = fwrite(str, 1, sizeof(str), fp); - assert(nofw == sizeof(str)); + ATF_REQUIRE(nofw == sizeof(str)); /* Close the FILE *. */ rc = fclose(fp); - assert(rc == 0); + ATF_REQUIRE(rc == 0); /* Re-open the FILE * to read back the data. */ fp = fmemopen(buf, sizeof(buf), "r"); - assert(fp != NULL); + ATF_REQUIRE(fp != NULL); /* Read from the buffer. */ bzero(buf2, sizeof(buf2)); nofr = fread(buf2, 1, sizeof(buf2), fp); - assert(nofr == sizeof(buf2)); + ATF_REQUIRE(nofr == sizeof(buf2)); /* * Since a write on a FILE * retrieved by fmemopen * will add a '\0' (if there's space), we can check * the strings for equality. */ - assert(strcmp(str, buf2) == 0); + ATF_REQUIRE(strcmp(str, buf2) == 0); /* Close the FILE *. */ rc = fclose(fp); - assert(rc == 0); + ATF_REQUIRE(rc == 0); /* Now open a FILE * on the first 4 bytes of the string. */ fp = fmemopen(str, 4, "w"); - assert(fp != NULL); + ATF_REQUIRE(fp != NULL); /* * Try to write more bytes than we shoud, we'll get a short count (4). */ nofw = fwrite(str2, 1, sizeof(str2), fp); - assert(nofw == 4); + ATF_REQUIRE(nofw == 4); /* Close the FILE *. */ rc = fclose(fp); /* Check that the string was not modified after the first 4 bytes. */ - assert(strcmp(str, str3) == 0); + ATF_REQUIRE(strcmp(str, str3) == 0); } -void -test_autoalloc() +ATF_TC_WITHOUT_HEAD(test_autoalloc); +ATF_TC_BODY(test_autoalloc, tc) { /* * Let fmemopen allocate the buffer. @@ -117,38 +117,38 @@ test_autoalloc() /* Open a FILE * using fmemopen. */ fp = fmemopen(NULL, 512, "w+"); - assert(fp != NULL); + ATF_REQUIRE(fp != NULL); /* fill the buffer */ for (i = 0; i < 512; i++) { nofw = fwrite("a", 1, 1, fp); - assert(nofw == 1); + ATF_REQUIRE(nofw == 1); } /* Get the current position into the stream. */ pos = ftell(fp); - assert(pos == 512); + ATF_REQUIRE(pos == 512); /* * Try to write past the end, we should get a short object count (0) */ nofw = fwrite("a", 1, 1, fp); - assert(nofw == 0); + ATF_REQUIRE(nofw == 0); /* Close the FILE *. */ rc = fclose(fp); - assert(rc == 0); + ATF_REQUIRE(rc == 0); /* Open a FILE * using a wrong mode */ fp = fmemopen(NULL, 512, "r"); - assert(fp == NULL); + ATF_REQUIRE(fp == NULL); fp = fmemopen(NULL, 512, "w"); - assert(fp == NULL); + ATF_REQUIRE(fp == NULL); } -void -test_data_length() +ATF_TC_WITHOUT_HEAD(test_data_length); +ATF_TC_BODY(test_data_length, tc) { /* * Here we test that a read operation doesn't go past the end of the @@ -166,56 +166,56 @@ test_data_length() /* Open a FILE * for updating our buffer. */ fp = fmemopen(buf, sizeof(buf), "w+"); - assert(fp != NULL); + ATF_REQUIRE(fp != NULL); /* Write our string into the buffer. */ nofw = fwrite(str, 1, sizeof(str), fp); - assert(nofw == sizeof(str)); + ATF_REQUIRE(nofw == sizeof(str)); /* * Now seek to the end and check that ftell * gives us sizeof(str). */ rc = fseek(fp, 0, SEEK_END); - assert(rc == 0); + ATF_REQUIRE(rc == 0); pos = ftell(fp); - assert(pos == sizeof(str)); + ATF_REQUIRE(pos == sizeof(str)); /* Close the FILE *. */ rc = fclose(fp); - assert(rc == 0); + ATF_REQUIRE(rc == 0); /* Reopen the buffer for appending. */ fp = fmemopen(buf, sizeof(buf), "a+"); - assert(fp != NULL); + ATF_REQUIRE(fp != NULL); /* We should now be writing after the first string. */ nofw = fwrite(str2, 1, sizeof(str2), fp); - assert(nofw == sizeof(str2)); + ATF_REQUIRE(nofw == sizeof(str2)); /* Rewind the FILE *. */ rc = fseek(fp, 0, SEEK_SET); - assert(rc == 0); + ATF_REQUIRE(rc == 0); /* Make sure we're at the beginning. */ pos = ftell(fp); - assert(pos == 0); + ATF_REQUIRE(pos == 0); /* Read the whole buffer. */ nofr = fread(str3, 1, sizeof(buf), fp); - assert(nofr == sizeof(str3)); + ATF_REQUIRE(nofr == sizeof(str3)); /* Make sure the two strings are there. */ - assert(strncmp(str3, str, sizeof(str) - 1) == 0); - assert(strncmp(str3 + sizeof(str) - 1, str2, sizeof(str2)) == 0); + ATF_REQUIRE(strncmp(str3, str, sizeof(str) - 1) == 0); + ATF_REQUIRE(strncmp(str3 + sizeof(str) - 1, str2, sizeof(str2)) == 0); /* Close the FILE *. */ rc = fclose(fp); - assert(rc == 0); + ATF_REQUIRE(rc == 0); } -void -test_binary() +ATF_TC_WITHOUT_HEAD(test_binary); +ATF_TC_BODY(test_binary, tc) { /* * Make sure that NULL bytes are never appended when opening a buffer @@ -233,23 +233,23 @@ test_binary() /* Open a FILE * in binary mode. */ fp = fmemopen(buf, sizeof(buf), "w+b"); - assert(fp != NULL); + ATF_REQUIRE(fp != NULL); /* Write some data into it. */ nofw = fwrite(str, 1, strlen(str), fp); - assert(nofw == strlen(str)); + ATF_REQUIRE(nofw == strlen(str)); /* Make sure that the buffer doesn't contain any NULL bytes. */ for (i = 0; i < sizeof(buf); i++) - assert(buf[i] != '\0'); + ATF_REQUIRE(buf[i] != '\0'); /* Close the FILE *. */ rc = fclose(fp); - assert(rc == 0); + ATF_REQUIRE(rc == 0); } -void -test_append_binary_pos() +ATF_TC_WITHOUT_HEAD(test_append_binary_pos); +ATF_TC_BODY(test_append_binary_pos, tc) { /* * For compatibility with other implementations (glibc), we set the @@ -260,7 +260,7 @@ test_append_binary_pos() FILE *fp; fp = fmemopen(NULL, 16, "ab+"); - assert(ftell(fp) == 0L); + ATF_REQUIRE(ftell(fp) == 0L); fclose(fp); /* @@ -268,12 +268,12 @@ test_append_binary_pos() */ char buf[] = "Hello"; fp = fmemopen(buf, sizeof(buf), "ab+"); - assert(ftell(fp) == strlen(buf)); + ATF_REQUIRE(ftell(fp) == strlen(buf)); fclose(fp); } -void -test_size_0() +ATF_TC_WITHOUT_HEAD(test_size_0); +ATF_TC_BODY(test_size_0, tc) { /* * POSIX mandates that we return EINVAL if size is 0. @@ -282,18 +282,19 @@ test_size_0() FILE *fp; fp = fmemopen(NULL, 0, "r+"); - assert(fp == NULL); - assert(errno == EINVAL); + ATF_REQUIRE(fp == NULL); + ATF_REQUIRE(errno == EINVAL); } -int -main(void) +ATF_TP_ADD_TCS(tp) { - test_autoalloc(); - test_preexisting(); - test_data_length(); - test_binary(); - test_append_binary_pos(); - test_size_0(); - return (0); + + ATF_TP_ADD_TC(tp, test_autoalloc); + ATF_TP_ADD_TC(tp, test_preexisting); + ATF_TP_ADD_TC(tp, test_data_length); + ATF_TP_ADD_TC(tp, test_binary); + ATF_TP_ADD_TC(tp, test_append_binary_pos); + ATF_TP_ADD_TC(tp, test_size_0); + + return (atf_no_error()); } Modified: head/tools/regression/lib/libc/stdio/Makefile ============================================================================== --- head/tools/regression/lib/libc/stdio/Makefile Sun Nov 16 19:47:29 2014 (r274591) +++ head/tools/regression/lib/libc/stdio/Makefile Sun Nov 16 19:57:47 2014 (r274592) @@ -1,7 +1,6 @@ # $FreeBSD$ TESTS= test-fdopen \ - test-fmemopen \ test-fopen \ test-freopen \ test-getdelim \ From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:10:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4D53783; Sun, 16 Nov 2014 20:10:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8818E19A; Sun, 16 Nov 2014 20:10:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKAc08075446; Sun, 16 Nov 2014 20:10:38 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKAcsj075445; Sun, 16 Nov 2014 20:10:38 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201411162010.sAGKAcsj075445@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 16 Nov 2014 20:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274593 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:10:38 -0000 Author: sbruno Date: Sun Nov 16 20:10:37 2014 New Revision: 274593 URL: https://svnweb.freebsd.org/changeset/base/274593 Log: Flush out many more static binaries that can be used in a jail for building pkgs via poudriere. This removes a significant amount of emulation speeding up run times. Phabric: D1172 Reviewed by: imp MFC after: 2 weeks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Nov 16 19:57:47 2014 (r274592) +++ head/Makefile.inc1 Sun Nov 16 20:10:37 2014 (r274593) @@ -1455,8 +1455,20 @@ native-xtools: .MAKE mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${OBJTREE}/nxb-bin/usr/include >/dev/null .for _tool in \ + bin/cat \ + bin/chmod \ + bin/cp \ bin/csh \ + bin/expr \ + bin/ln \ + bin/ls \ + bin/mkdir \ + bin/ps \ + bin/realpath \ + bin/rm \ + bin/rmdir \ bin/sh \ + bin/sleep \ ${_clang_tblgen} \ usr.bin/ar \ ${_binutils} \ @@ -1465,18 +1477,38 @@ native-xtools: .MAKE ${_clang_libs} \ ${_clang} \ sbin/md5 \ + sbin/sysctl \ + gnu/usr.bin/diff \ usr.bin/awk \ + usr.bin/basename \ usr.bin/bmake \ usr.bin/bzip2 \ + usr.bin/cmp \ + usr.bin/dirname \ + usr.bin/env \ usr.bin/fetch \ + usr.bin/find \ + usr.bin/grep \ usr.bin/gzip \ + usr.bin/id \ usr.bin/lex \ usr.bin/lorder \ + usr.bin/mktemp \ + usr.bin/mt \ + usr.bin/patch \ usr.bin/sed \ + usr.bin/sort \ usr.bin/tar \ + usr.bin/touch \ + usr.bin/tr \ + usr.bin/true \ + usr.bin/uniq \ usr.bin/unzip \ + usr.bin/xargs \ + usr.bin/xinstall \ usr.bin/xz \ - usr.bin/yacc + usr.bin/yacc \ + usr.sbin/chown ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool} && \ ${NXBMAKE} DIRPRFX=${_tool}/ obj && \ From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:14:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AD80B77; Sun, 16 Nov 2014 20:14:16 +0000 (UTC) Received: from mail-pd0-x22d.google.com (mail-pd0-x22d.google.com [IPv6:2607:f8b0:400e:c02::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12B85260; Sun, 16 Nov 2014 20:14:16 +0000 (UTC) Received: by mail-pd0-f173.google.com with SMTP id v10so19893653pde.32 for ; Sun, 16 Nov 2014 12:14:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=NB9qMkUycPhUh0FoQYbdLhO6o0f4rtAh8pwpe1S5XSA=; b=XQbPSkgdeLnSJc45k0aIz4K9EjGnu7wgL/DCHR3Cvc0sbioOkUX5sDOBlX2adyoYpv dgdZ7QSlEwK7YXqTW7zB6yf7zA7/9EqOOd3urbKzzB85t7E8c2FBmiajLwlmyELLhYKA WoYuLRsayIlpCTJK/A3wc9bXwgdxUmvuGq3uGM1XcGjd9aEHUTcXkVPuy281McnOdQEU pyTHaZGV2vpCWbk38+fdV/0B8iA0vcGL7E6KJV9IlnTFZCQ1AgHf9/kBbZwSqPret417 o93GwqiJ6bXUFYrrRSfgaQAUHq6GBu6Ic3jw+uNdWKOmoAy3pInNvbgi6Xmxoqi8JG7v YwHw== X-Received: by 10.66.65.168 with SMTP id y8mr25326011pas.48.1416168855563; Sun, 16 Nov 2014 12:14:15 -0800 (PST) Received: from [192.168.20.5] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id ra4sm33259086pab.33.2014.11.16.12.14.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Nov 2014 12:14:15 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_F6257969-704D-407E-A954-26B041EB66E6"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274593 - head From: Garrett Cooper In-Reply-To: <201411162010.sAGKAcsj075445@svn.freebsd.org> Date: Sun, 16 Nov 2014 12:14:13 -0800 Message-Id: References: <201411162010.sAGKAcsj075445@svn.freebsd.org> To: Sean Bruno X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:14:16 -0000 --Apple-Mail=_F6257969-704D-407E-A954-26B041EB66E6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 16, 2014, at 12:10, Sean Bruno wrote: > Author: sbruno > Date: Sun Nov 16 20:10:37 2014 > New Revision: 274593 > URL: https://svnweb.freebsd.org/changeset/base/274593 >=20 > Log: > Flush out many more static binaries that can be used in a jail for = building > pkgs via poudriere. This removes a significant amount of emulation = speeding > up run times. >=20 > Phabric: D1172 > Reviewed by: imp > MFC after: 2 weeks Hi Sean! I=92m wondering if you=92d be interested in reviewing some of = the changes I have in my =93faster-build=94 branch up on github: = https://github.com/yaneurabeya/freebsd/tree/faster-build . I=92m = basically looking at building just the native and cross-compiler = toolchain piece of clang, parallelizing this portion of the build, etc. = I haven=92t resolved the building of the native compiler piece, but I=92ve= parallelized some things around here. Thanks! --Apple-Mail=_F6257969-704D-407E-A954-26B041EB66E6 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUaQWVAAoJEMZr5QU6S73ehF0H/AiQK5mmuTiu3tSR4oRAkU+S gB7XJndv1H2taWHggLPyEVYXhT8Rtxg0CWU/QxP9Nv89Cg+PMSIIk77XLtEMbK/+ PgKWZStTkjxbRdvaWrb10mmI6YRZtgCxLlgmZMhcBdDstowuJQ8rGDx1Gy5iNguq nGxMBWCQnWjohkDbxIyyb5OVkqx95y2XRKtQ2Wfk7DAnYIazb5xE8WCtZyTTMVRK qf4NL2CK5Y2KRluJjSrdqliavWZMm0Xoa7Vb/7c6U+wP4edhAk296MAC0r+hxK0H 6ngF95Gg5HbmE91rUh9HP6c3eXAZgxuVMVA/fioD5ZuDCxEqJHxrnwcHQUQEq0o= =Dvx2 -----END PGP SIGNATURE----- --Apple-Mail=_F6257969-704D-407E-A954-26B041EB66E6-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:29:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6637767B; Sun, 16 Nov 2014 20:29:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 470273A6; Sun, 16 Nov 2014 20:29:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKTxwe084626; Sun, 16 Nov 2014 20:29:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKTw7n084622; Sun, 16 Nov 2014 20:29:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411162029.sAGKTw7n084622@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 20:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274595 - in head: lib/libc/tests/gen tools/regression/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:29:59 -0000 Author: ngie Date: Sun Nov 16 20:29:57 2014 New Revision: 274595 URL: https://svnweb.freebsd.org/changeset/base/274595 Log: Convert tools/regression/lib/libc/stdio/test-fpclassify into an ATF testcase and Rename as lib/libc/stdio/fpclassify2_test Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/gen/fpclassify2_test.c - copied, changed from r274390, head/tools/regression/lib/libc/gen/test-fpclassify.c Deleted: head/tools/regression/lib/libc/gen/test-fpclassify.c Modified: head/lib/libc/tests/gen/Makefile head/tools/regression/lib/libc/gen/Makefile Modified: head/lib/libc/tests/gen/Makefile ============================================================================== --- head/lib/libc/tests/gen/Makefile Sun Nov 16 20:12:49 2014 (r274594) +++ head/lib/libc/tests/gen/Makefile Sun Nov 16 20:29:57 2014 (r274595) @@ -5,6 +5,7 @@ TESTSDIR= ${TESTSBASE}/lib/libc/gen ATF_TESTS_C= arc4random_test +ATF_TESTS_C+= fpclassify2_test # TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid, t_sleep # TODO: t_siginfo (fixes require further inspection) Copied and modified: head/lib/libc/tests/gen/fpclassify2_test.c (from r274390, head/tools/regression/lib/libc/gen/test-fpclassify.c) ============================================================================== --- head/tools/regression/lib/libc/gen/test-fpclassify.c Tue Nov 11 18:15:05 2014 (r274390, copy source) +++ head/lib/libc/tests/gen/fpclassify2_test.c Sun Nov 16 20:29:57 2014 (r274595) @@ -26,51 +26,47 @@ * $FreeBSD$ */ -#include #include #include #include +#include -int -main(void) +ATF_TC_WITHOUT_HEAD(test_fpclassify); +ATF_TC_BODY(test_fpclassify, tc) { - assert(fpclassify((float)0) == FP_ZERO); - assert(fpclassify((float)-0.0) == FP_ZERO); - assert(fpclassify((float)1) == FP_NORMAL); - assert(fpclassify((float)1000) == FP_NORMAL); -#ifndef __alpha__ - assert(fpclassify(0x1.2p-150f) == FP_SUBNORMAL); -#endif - assert(fpclassify(HUGE_VALF) == FP_INFINITE); - assert(fpclassify((float)HUGE_VAL) == FP_INFINITE); - assert(fpclassify((float)HUGE_VALL) == FP_INFINITE); - assert(fpclassify(NAN) == FP_NAN); - - assert(fpclassify((double)0) == FP_ZERO); - assert(fpclassify((double)-0) == FP_ZERO); - assert(fpclassify((double)1) == FP_NORMAL); - assert(fpclassify((double)1000) == FP_NORMAL); -#ifndef __alpha__ - assert(fpclassify(0x1.2p-1075) == FP_SUBNORMAL); -#endif - assert(fpclassify(HUGE_VAL) == FP_INFINITE); - assert(fpclassify((double)HUGE_VALF) == FP_INFINITE); - assert(fpclassify((double)HUGE_VALL) == FP_INFINITE); - assert(fpclassify((double)NAN) == FP_NAN); - - assert(fpclassify((long double)0) == FP_ZERO); - assert(fpclassify((long double)-0.0) == FP_ZERO); - assert(fpclassify((long double)1) == FP_NORMAL); - assert(fpclassify((long double)1000) == FP_NORMAL); -#ifndef __alpha__ - assert(fpclassify(0x1.2p-16383L) == FP_SUBNORMAL); -#endif - assert(fpclassify(HUGE_VALL) == FP_INFINITE); - assert(fpclassify((long double)HUGE_VALF) == FP_INFINITE); - assert(fpclassify((long double)HUGE_VAL) == FP_INFINITE); - assert(fpclassify((long double)NAN) == FP_NAN); + ATF_CHECK(fpclassify((float)0) == FP_ZERO); + ATF_CHECK(fpclassify((float)-0.0) == FP_ZERO); + ATF_CHECK(fpclassify((float)1) == FP_NORMAL); + ATF_CHECK(fpclassify((float)1000) == FP_NORMAL); + ATF_CHECK(fpclassify(HUGE_VALF) == FP_INFINITE); + ATF_CHECK(fpclassify((float)HUGE_VAL) == FP_INFINITE); + ATF_CHECK(fpclassify((float)HUGE_VALL) == FP_INFINITE); + ATF_CHECK(fpclassify(NAN) == FP_NAN); + + ATF_CHECK(fpclassify((double)0) == FP_ZERO); + ATF_CHECK(fpclassify((double)-0) == FP_ZERO); + ATF_CHECK(fpclassify((double)1) == FP_NORMAL); + ATF_CHECK(fpclassify((double)1000) == FP_NORMAL); + ATF_CHECK(fpclassify(HUGE_VAL) == FP_INFINITE); + ATF_CHECK(fpclassify((double)HUGE_VALF) == FP_INFINITE); + ATF_CHECK(fpclassify((double)HUGE_VALL) == FP_INFINITE); + ATF_CHECK(fpclassify((double)NAN) == FP_NAN); + + ATF_CHECK(fpclassify((long double)0) == FP_ZERO); + ATF_CHECK(fpclassify((long double)-0.0) == FP_ZERO); + ATF_CHECK(fpclassify((long double)1) == FP_NORMAL); + ATF_CHECK(fpclassify((long double)1000) == FP_NORMAL); + ATF_CHECK(fpclassify(HUGE_VALL) == FP_INFINITE); + ATF_CHECK(fpclassify((long double)HUGE_VALF) == FP_INFINITE); + ATF_CHECK(fpclassify((long double)HUGE_VAL) == FP_INFINITE); + ATF_CHECK(fpclassify((long double)NAN) == FP_NAN); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, test_fpclassify); - printf("PASS fpclassify()\n"); - exit(0); + return (atf_no_error()); } Modified: head/tools/regression/lib/libc/gen/Makefile ============================================================================== --- head/tools/regression/lib/libc/gen/Makefile Sun Nov 16 20:12:49 2014 (r274594) +++ head/tools/regression/lib/libc/gen/Makefile Sun Nov 16 20:29:57 2014 (r274595) @@ -1,7 +1,7 @@ # $FreeBSD$ TESTS= test-fmtcheck test-fmtmsg test-fnmatch \ - test-fpclassify test-ftw test-popen test-posix_spawn test-wordexp + test-ftw test-popen test-posix_spawn test-wordexp .PHONY: tests tests: ${TESTS} From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:34:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C97D2CC7; Sun, 16 Nov 2014 20:34:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6034654; Sun, 16 Nov 2014 20:34:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKYEJ4088654; Sun, 16 Nov 2014 20:34:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKYEwt088653; Sun, 16 Nov 2014 20:34:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411162034.sAGKYEwt088653@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Nov 2014 20:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274596 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:34:14 -0000 Author: ian Date: Sun Nov 16 20:34:14 2014 New Revision: 274596 URL: https://svnweb.freebsd.org/changeset/base/274596 Log: Indent a couple lines properly and expand a comment. No functional changes. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 20:29:57 2014 (r274595) +++ head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 20:34:14 2014 (r274596) @@ -1336,7 +1336,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus (void *)bpage->vaddr, bpage->datacount); cpu_dcache_wb_range((vm_offset_t)bpage->vaddr, - bpage->datacount); + bpage->datacount); l2cache_wb_range((vm_offset_t)bpage->vaddr, (vm_offset_t)bpage->busaddr, bpage->datacount); @@ -1390,12 +1390,16 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus /* * For COHERENT memory no cache maintenance is necessary, but ensure all - * writes have reached memory for the PREWRITE case. + * writes have reached memory for the PREWRITE case. No action is + * needed for a PREREAD without PREWRITE also set, because that would + * imply that the cpu had written to the COHERENT buffer and expected + * the dma device to see that change, and by definition a PREWRITE sync + * is required to make that happen. */ if (map->flags & DMAMAP_COHERENT) { if (op & BUS_DMASYNC_PREWRITE) { - dsb(); - cpu_l2cache_drain_writebuf(); + dsb(); + cpu_l2cache_drain_writebuf(); } return; } From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:34:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 237A1E53; Sun, 16 Nov 2014 20:34:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F89D660; Sun, 16 Nov 2014 20:34:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKYkiB088759; Sun, 16 Nov 2014 20:34:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKYkXv088758; Sun, 16 Nov 2014 20:34:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411162034.sAGKYkXv088758@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 20:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274597 - head/contrib/netbsd-tests/lib/libm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:34:47 -0000 Author: ngie Date: Sun Nov 16 20:34:46 2014 New Revision: 274597 URL: https://svnweb.freebsd.org/changeset/base/274597 Log: Skip the long-double epsilon checks on FreeBSD/i386 Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libm/t_precision.c Modified: head/contrib/netbsd-tests/lib/libm/t_precision.c ============================================================================== --- head/contrib/netbsd-tests/lib/libm/t_precision.c Sun Nov 16 20:34:14 2014 (r274596) +++ head/contrib/netbsd-tests/lib/libm/t_precision.c Sun Nov 16 20:34:46 2014 (r274597) @@ -58,6 +58,7 @@ ATF_TC_BODY(t_precision, tc) x += DBL_EPSILON; ATF_CHECK(x == 2.0); +#if !defined(__FreeBSD__) || !defined(__i386__) y += LDBL_EPSILON; ATF_CHECK(y != 1.0L); y -= 1; @@ -65,6 +66,7 @@ ATF_TC_BODY(t_precision, tc) y = 2; y += LDBL_EPSILON; ATF_CHECK(y == 2.0L); +#endif } ATF_TP_ADD_TCS(tp) From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:35:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 308241AE; Sun, 16 Nov 2014 20:35:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CA9466B; Sun, 16 Nov 2014 20:35:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKZW1O088944; Sun, 16 Nov 2014 20:35:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKZWRV088943; Sun, 16 Nov 2014 20:35:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411162035.sAGKZWRV088943@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 20:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274598 - head/contrib/netbsd-tests/lib/libm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:35:33 -0000 Author: ngie Date: Sun Nov 16 20:35:32 2014 New Revision: 274598 URL: https://svnweb.freebsd.org/changeset/base/274598 Log: Reset errno to 0 before running scalbn to be sure that the tested errno is valid Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libm/t_scalbn.c Modified: head/contrib/netbsd-tests/lib/libm/t_scalbn.c ============================================================================== --- head/contrib/netbsd-tests/lib/libm/t_scalbn.c Sun Nov 16 20:34:46 2014 (r274597) +++ head/contrib/netbsd-tests/lib/libm/t_scalbn.c Sun Nov 16 20:35:32 2014 (r274598) @@ -81,6 +81,9 @@ ATF_TC_BODY(scalbn_val, tc) double rv; for (i = 0; i < tcnt; i++) { +#ifdef __FreeBSD__ + errno = 0; +#endif rv = scalbn(tests[i].inval, tests[i].exp); ATF_CHECK_EQ_MSG(errno, tests[i].error, "test %zu: errno %d instead of %d", i, errno, From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:37:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE5B033C; Sun, 16 Nov 2014 20:37:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAA3B689; Sun, 16 Nov 2014 20:37:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKbkn6089248; Sun, 16 Nov 2014 20:37:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKbkju089247; Sun, 16 Nov 2014 20:37:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411162037.sAGKbkju089247@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 20:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274599 - head/contrib/netbsd-tests/lib/libm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:37:47 -0000 Author: ngie Date: Sun Nov 16 20:37:46 2014 New Revision: 274599 URL: https://svnweb.freebsd.org/changeset/base/274599 Log: Alias isinff to isinf on FreeBSD isinf on FreeBSD automatically picks the appropriate type per math.h Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libm/t_pow.c Modified: head/contrib/netbsd-tests/lib/libm/t_pow.c ============================================================================== --- head/contrib/netbsd-tests/lib/libm/t_pow.c Sun Nov 16 20:35:32 2014 (r274598) +++ head/contrib/netbsd-tests/lib/libm/t_pow.c Sun Nov 16 20:37:46 2014 (r274599) @@ -34,6 +34,10 @@ __RCSID("$NetBSD: t_pow.c,v 1.3 2014/03/ #include #include +#ifdef __FreeBSD__ +#define isinff isinf +#endif + /* * pow(3) */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:39:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4CAC48B; Sun, 16 Nov 2014 20:39:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1646696; Sun, 16 Nov 2014 20:39:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKdB8u089471; Sun, 16 Nov 2014 20:39:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKdBgL089470; Sun, 16 Nov 2014 20:39:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411162039.sAGKdBgL089470@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 20:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274600 - head/contrib/netbsd-tests/lib/libm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:39:11 -0000 Author: ngie Date: Sun Nov 16 20:39:11 2014 New Revision: 274600 URL: https://svnweb.freebsd.org/changeset/base/274600 Log: - Expect exp2_powers to fail on FreeBSD/i386 - Expect exp2_values to fail on FreeBSD due to the small epsilon Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libm/t_exp.c Modified: head/contrib/netbsd-tests/lib/libm/t_exp.c ============================================================================== --- head/contrib/netbsd-tests/lib/libm/t_exp.c Sun Nov 16 20:37:46 2014 (r274599) +++ head/contrib/netbsd-tests/lib/libm/t_exp.c Sun Nov 16 20:39:11 2014 (r274600) @@ -131,6 +131,10 @@ ATF_LIBM_TEST(exp2_powers, "Test exp2(x) }; unsigned int i; +#if defined(__FreeBSD__) && defined(__i386__) + atf_tc_expect_fail("a number of the assertions fail on i386"); +#endif + for (i = 0; i < __arraycount(v); i++) { T_LIBM_CHECK(i, exp2, v[i].x, v[i].d_y, 0.0); T_LIBM_CHECK(i, exp2f, v[i].x, v[i].f_y, 0.0); @@ -173,6 +177,11 @@ ATF_LIBM_TEST(exp2_values, "Test exp2(x) }; unsigned int i; +#ifdef __FreeBSD__ + atf_tc_expect_fail("Some of the cases produce failures on FreeBSD " + "due to the error epsilon being so small"); +#endif + for (i = 0; i < __arraycount(v); i++) { T_LIBM_CHECK(i, exp2, v[i].x, v[i].y, v[i].d_eps); if (i > 1) From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:42:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CB155F9; Sun, 16 Nov 2014 20:42:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4B50797; Sun, 16 Nov 2014 20:42:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKgUeW093370; Sun, 16 Nov 2014 20:42:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKgU6i093369; Sun, 16 Nov 2014 20:42:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411162042.sAGKgU6i093369@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Nov 2014 20:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274601 - head/contrib/netbsd-tests/lib/libm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:42:31 -0000 Author: ngie Date: Sun Nov 16 20:42:30 2014 New Revision: 274601 URL: https://svnweb.freebsd.org/changeset/base/274601 Log: - Skip over the testcases that call cbrtl on platforms where LDBL_PREC == 53 (arm, mips, powerpc). This fixes the build on these platforms, based on some ad hoc tinderbox runs I did a while ago - Skip cast the arguments to powl as long double so powl properly interprets those arugments at compile-time when picking the type Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libm/t_cbrt.c Modified: head/contrib/netbsd-tests/lib/libm/t_cbrt.c ============================================================================== --- head/contrib/netbsd-tests/lib/libm/t_cbrt.c Sun Nov 16 20:39:11 2014 (r274600) +++ head/contrib/netbsd-tests/lib/libm/t_cbrt.c Sun Nov 16 20:42:30 2014 (r274601) @@ -237,6 +237,7 @@ ATF_TC_BODY(cbrtf_zero_pos, tc) atf_tc_fail_nonfatal("cbrtf(+0.0) != +0.0"); } +#if !defined(__FreeBSD__) || LDBL_PREC != 53 /* * cbrtl(3) */ @@ -270,7 +271,11 @@ ATF_TC_BODY(cbrtl_powl, tc) for (i = 0; i < __arraycount(x); i++) { y = cbrtl(x[i]); +#ifdef __FreeBSD__ + z = powl(x[i], (long double)1.0 / 3.0); +#else z = powl(x[i], 1.0 / 3.0); +#endif if (fabsl(y - z) > eps * fabsl(1 + x[i])) atf_tc_fail_nonfatal("cbrtl(%0.03Lf) != " @@ -337,6 +342,7 @@ ATF_TC_BODY(cbrtl_zero_pos, tc) if (fabsl(y) > 0.0 || signbit(y) != 0) atf_tc_fail_nonfatal("cbrtl(+0.0) != +0.0"); } +#endif ATF_TP_ADD_TCS(tp) { @@ -355,12 +361,14 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, cbrtf_zero_neg); ATF_TP_ADD_TC(tp, cbrtf_zero_pos); +#if !defined(__FreeBSD__) || LDBL_PREC != 53 ATF_TP_ADD_TC(tp, cbrtl_nan); ATF_TP_ADD_TC(tp, cbrtl_powl); ATF_TP_ADD_TC(tp, cbrtl_inf_neg); ATF_TP_ADD_TC(tp, cbrtl_inf_pos); ATF_TP_ADD_TC(tp, cbrtl_zero_neg); ATF_TP_ADD_TC(tp, cbrtl_zero_pos); +#endif return atf_no_error(); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:55:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3995DC7B; Sun, 16 Nov 2014 20:55:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2629F880; Sun, 16 Nov 2014 20:55:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKtquP098429; Sun, 16 Nov 2014 20:55:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKtqC0098428; Sun, 16 Nov 2014 20:55:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411162055.sAGKtqC0098428@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Nov 2014 20:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274602 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:55:52 -0000 Author: ian Date: Sun Nov 16 20:55:51 2014 New Revision: 274602 URL: https://svnweb.freebsd.org/changeset/base/274602 Log: Do not do a cache invalidate on a PREREAD sync that is also a PREWRITE sync. The PREWRITE handling does a writeback of any dirty cachelines, so there's no danger of an eviction during the DMA corrupting the buffer. There will be an invalidate done during POSTREAD, so doing it before the read too is wasted time. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 20:42:30 2014 (r274601) +++ head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 20:55:51 2014 (r274602) @@ -1345,7 +1345,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus dmat->bounce_zone->total_bounced++; } - if (op & BUS_DMASYNC_PREREAD) { + if ((op & BUS_DMASYNC_PREREAD) && !(op & BUS_DMASYNC_PREWRITE)) { bpage = STAILQ_FIRST(&map->bpages); while (bpage != NULL) { cpu_dcache_inv_range((vm_offset_t)bpage->vaddr, From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:59:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27B50F77; Sun, 16 Nov 2014 20:59:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13DB78AB; Sun, 16 Nov 2014 20:59:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKxROH098887; Sun, 16 Nov 2014 20:59:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKxRAe098886; Sun, 16 Nov 2014 20:59:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411162059.sAGKxRAe098886@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Nov 2014 20:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274603 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 20:59:28 -0000 Author: ian Date: Sun Nov 16 20:59:27 2014 New Revision: 274603 URL: https://svnweb.freebsd.org/changeset/base/274603 Log: Do the cache invalidate sequence from the outermost to innermost, required for correct operation. Submitted by: Michal Meloun Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 20:55:51 2014 (r274602) +++ head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 20:59:27 2014 (r274603) @@ -1372,8 +1372,8 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus len = (len - (len & arm_dcache_align_mask)) + arm_dcache_align; - cpu_dcache_inv_range(startv, len); l2cache_inv_range(startv, startp, len); + cpu_dcache_inv_range(startv, len); if (bpage->datavaddr != 0) bcopy((void *)bpage->vaddr, (void *)bpage->datavaddr, From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 21:22:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86460AEE; Sun, 16 Nov 2014 21:22:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A211BB1; Sun, 16 Nov 2014 21:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGLMhWv012137; Sun, 16 Nov 2014 21:22:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGLMhZh012136; Sun, 16 Nov 2014 21:22:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411162122.sAGLMhZh012136@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Nov 2014 21:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274604 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 21:22:43 -0000 Author: ian Date: Sun Nov 16 21:22:42 2014 New Revision: 274604 URL: https://svnweb.freebsd.org/changeset/base/274604 Log: Correct the sequence of busdma sync ops involved with PRE/POSTREAD syncs. We used to invalidate the cache for PREREAD alone, or writeback+invalidate for PREREAD with PREWRITE, then treat POSTREAD as a no-op. Prefetching on modern systems can lead to parts of a DMA buffer getting pulled into the caches while DMA is in progress (due to access of "nearby" data), so it's mandatory to invalidate during the POSTREAD sync even if a PREREAD invalidate also happened. In the PREREAD case the invalidate is done to ensure that there are no dirty cache lines that might get automatically evicted during the DMA, corrupting the buffer. In a PREREAD+PREWRITE case the writeback which is required for PREWRITE handling is suffficient to avoid corruption caused by eviction and no invalidate need be done until POSTREAD time. Submitted by: Michal Meloun Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 20:59:27 2014 (r274603) +++ head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 21:22:42 2014 (r274604) @@ -1416,6 +1416,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus switch (op) { case BUS_DMASYNC_PREWRITE: + case BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD: while (sl != end) { cpu_dcache_wb_range(sl->vaddr, sl->datacount); l2cache_wb_range(sl->vaddr, sl->busaddr, @@ -1433,19 +1434,19 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus } break; - case BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD: - while (sl != end) { - cpu_dcache_wbinv_range(sl->vaddr, sl->datacount); - l2cache_wbinv_range(sl->vaddr, - sl->busaddr, sl->datacount); - sl++; - } + case BUS_DMASYNC_POSTWRITE: break; case BUS_DMASYNC_POSTREAD: - case BUS_DMASYNC_POSTWRITE: case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE: + while (sl != end) { + l2cache_inv_range(sl->vaddr, sl->busaddr, + sl->datacount); + cpu_dcache_inv_range(sl->vaddr, sl->datacount); + sl++; + } break; + default: panic("unsupported combination of sync operations: 0x%08x\n", op); break; From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 21:39:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB5142A4; Sun, 16 Nov 2014 21:39:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7D1ACCE; Sun, 16 Nov 2014 21:39:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGLduwQ017565; Sun, 16 Nov 2014 21:39:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGLduHO017564; Sun, 16 Nov 2014 21:39:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411162139.sAGLduHO017564@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Nov 2014 21:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274605 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 21:39:57 -0000 Author: ian Date: Sun Nov 16 21:39:56 2014 New Revision: 274605 URL: https://svnweb.freebsd.org/changeset/base/274605 Log: No functional changes. Remove a couple outdated or inane comments and add new comment blocks describing why the cache maintenance sequences are done in the order they are for each case. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 21:22:42 2014 (r274604) +++ head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 21:39:56 2014 (r274605) @@ -1314,17 +1314,20 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus /* * If the buffer was from user space, it is possible that this is not * the same vm map, especially on a POST operation. It's not clear that - * dma on userland buffers can work at all right now, certainly not if a - * partial cacheline flush has to be handled. To be safe, until we're - * able to test direct userland dma, panic on a map mismatch. + * dma on userland buffers can work at all right now. To be safe, until + * we're able to test direct userland dma, panic on a map mismatch. */ if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { if (!pmap_dmap_iscurrent(map->pmap)) panic("_bus_dmamap_sync: wrong user map for bounce sync."); - /* Handle data bouncing. */ + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " "performing bounce", __func__, dmat, dmat->flags, op); + /* + * For PREWRITE do a writeback. Clean the caches from the + * innermost to the outermost levels. + */ if (op & BUS_DMASYNC_PREWRITE) { while (bpage != NULL) { if (bpage->datavaddr != 0) @@ -1345,6 +1348,17 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus dmat->bounce_zone->total_bounced++; } + /* + * Do an invalidate for PREREAD unless a writeback was already + * done above due to PREWRITE also being set. The reason for a + * PREREAD invalidate is to prevent dirty lines currently in the + * cache from being evicted during the DMA. If a writeback was + * done due to PREWRITE also being set there will be no dirty + * lines and the POSTREAD invalidate handles the rest. The + * invalidate is done from the innermost to outermost level. If + * L2 were done first, a dirty cacheline could be automatically + * evicted from L1 before we invalidated it, re-dirtying the L2. + */ if ((op & BUS_DMASYNC_PREREAD) && !(op & BUS_DMASYNC_PREWRITE)) { bpage = STAILQ_FIRST(&map->bpages); while (bpage != NULL) { @@ -1356,6 +1370,16 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus bpage = STAILQ_NEXT(bpage, links); } } + + /* + * Re-invalidate the caches on a POSTREAD, even though they were + * already invalidated at PREREAD time. Aggressive prefetching + * due to accesses to other data near the dma buffer could have + * brought buffer data into the caches which is now stale. The + * caches are invalidated from the outermost to innermost; the + * prefetches could be happening right now, and if L1 were + * invalidated first, stale L2 data could be prefetched into L1. + */ if (op & BUS_DMASYNC_POSTREAD) { while (bpage != NULL) { vm_offset_t startv; @@ -1404,10 +1428,16 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus return; } + /* + * Cache maintenance for normal (non-COHERENT non-bounce) buffers. All + * the comments about the sequences for flushing cache levels in the + * bounce buffer code above apply here as well. In particular, the fact + * that the sequence is inner-to-outer for PREREAD invalidation and + * outer-to-inner for POSTREAD invalidation is not a mistake. + */ if (map->sync_count != 0) { if (!pmap_dmap_iscurrent(map->pmap)) panic("_bus_dmamap_sync: wrong user map for sync."); - /* ARM caches are not self-snooping for dma */ sl = &map->slist[0]; end = &map->slist[map->sync_count]; From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 21:46:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6915B66A; Sun, 16 Nov 2014 21:46:54 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D145DAE; Sun, 16 Nov 2014 21:46:54 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id h11so4014376wiw.1 for ; Sun, 16 Nov 2014 13:46:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sz1YznBWxlhN7YE3i/TWkQ//vymTHcWK2tQMlAXcWaQ=; b=xosIKVz5X3i3ejIqXNEPG1tXXH3UlcAyVxktbmE4ZIeZ4v7D4/H78dUCO+oOoL3zF7 ZgNn/uLRW2XnhRRrOr6KhSlSLOOQb6khFPYYM2DQrWx+EsZeVhHRi1/iWmWcrmoPNPNq zoYyNaUmEIGfTvkA0rlQ6SAcbYPPY+qW0PfVU4znxXBbalpxoW05JMuXS2eAspZ3hb4k D0oTgC1mYFcuYVJcty34hV7655ZPObuqffifz9EOV5nvskjuh/uqVcgojdubFJo6cO0M onzgbrWJ3eVCAbBZFM1w0zlCeoJ30KtruqWuED6eqWbYIXr3+M7SgMlehgBvc1Lu9Q/O ACAg== MIME-Version: 1.0 X-Received: by 10.194.248.195 with SMTP id yo3mr32698209wjc.60.1416174412493; Sun, 16 Nov 2014 13:46:52 -0800 (PST) Received: by 10.27.179.168 with HTTP; Sun, 16 Nov 2014 13:46:52 -0800 (PST) In-Reply-To: <201411160944.sAG9iUTJ084769@svn.freebsd.org> References: <201411160944.sAG9iUTJ084769@svn.freebsd.org> Date: Sun, 16 Nov 2014 16:46:52 -0500 Message-ID: Subject: Re: svn commit: r274583 - head/usr.sbin/watchdogd From: Benjamin Kaduk To: Xin LI Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 21:46:54 -0000 On Sun, Nov 16, 2014 at 4:44 AM, Xin LI wrote: > Author: delphij > Date: Sun Nov 16 09:44:30 2014 > New Revision: 274583 > URL: https://svnweb.freebsd.org/changeset/base/274583 > > Log: > Default to use 10 seconds as nap interval instead of 1. > > Previously, we have a nap interval of 1 second while we have a timeout of > 128 seconds by default, which could be an overkill, and for some hardware > the patting action may be expensive. > > Note that the choice of nap interval is still arbitrary. We preferred > a safe value where even when the system is very heavily loaded, the > watchdog should not shoot the system down if it's not really hung. > According to the manual page of Linux's watchdog daemon, the nap interval > time of theirs is 10 seconds, which seems to be a reasonable value -- > according to Intel documentation AP-725 (Document Number: 292273-001), > ICH5's maximum timeout is about 37.5 seconds, which the ichwd(4) driver > would set when we requested 128 seconds (although it should probably > feed back this as an error and do not set the timeout). Since that's > the shortest maximum value, 10 seconds seems to be a right choice for > us too. > > Discussed with: alfred > MFC after: 1 month > relnotes: yes? -Ben From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 23:31:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 084203A9; Sun, 16 Nov 2014 23:31:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E91FE9DC; Sun, 16 Nov 2014 23:31:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGNVNFh073088; Sun, 16 Nov 2014 23:31:23 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGNVNiS073087; Sun, 16 Nov 2014 23:31:23 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201411162331.sAGNVNiS073087@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 16 Nov 2014 23:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274607 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 23:31:24 -0000 Author: sbruno Date: Sun Nov 16 23:31:23 2014 New Revision: 274607 URL: https://svnweb.freebsd.org/changeset/base/274607 Log: Add mv, echo and hostname to the native-xtools target. Missed these when profiling. MFC after: 2 weeks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Nov 16 23:02:32 2014 (r274606) +++ head/Makefile.inc1 Sun Nov 16 23:31:23 2014 (r274607) @@ -1459,10 +1459,13 @@ native-xtools: .MAKE bin/chmod \ bin/cp \ bin/csh \ + bin/echo \ bin/expr \ + bin/hostname \ bin/ln \ bin/ls \ bin/mkdir \ + bin/mv \ bin/ps \ bin/realpath \ bin/rm \ From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 01:05:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A13924F; Mon, 17 Nov 2014 01:05:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2509B2DB; Mon, 17 Nov 2014 01:05:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAH15Wxa017797; Mon, 17 Nov 2014 01:05:32 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAH15Ugb017789; Mon, 17 Nov 2014 01:05:30 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411170105.sAH15Ugb017789@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 17 Nov 2014 01:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274611 - in head: sbin/route sys/net 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 01:05:32 -0000 Author: melifaro Date: Mon Nov 17 01:05:29 2014 New Revision: 274611 URL: https://svnweb.freebsd.org/changeset/base/274611 Log: Finish r274175: do control plane MTU tracking. Update route MTU in case of ifnet MTU change. Add new RTF_FIXEDMTU to track explicitly specified MTU. Old behavior: ifconfig em0 mtu 1500->9000 -> all routes traversing em0 do not change MTU. User has to manually update all routes. ifconfig em0 mtu 9000->1500 -> all routes traversing em0 do not change MTU. However, if ip[6]_output finds route with rt_mtu > interface mtu, rt_mtu gets updated. New behavior: ifconfig em0 mtu 1500->9000 -> all interface routes in all fibs gets updated with new MTU unless RTF_FIXEDMTU flag set on them. ifconfig em0 mtu 9000->1500 -> all routes in all fibs gets updated with new MTU unless RTF_FIXEDMTU flag set on them AND rt_mtu is less than ifp mtu. route add ... -mtu XXX automatically sets RTF_FIXEDMTU flag. route change .. -mtu 0 automatically removes RTF_FIXEDMTU flag. PR: 194238 MFC after: 1 month CR: D1125 Modified: head/sbin/route/route.c head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Mon Nov 17 01:01:45 2014 (r274610) +++ head/sbin/route/route.c Mon Nov 17 01:05:29 2014 (r274611) @@ -1587,7 +1587,7 @@ static const char routeflags[] = "\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" "\012XRESOLVE\013LLINFO\014STATIC\015BLACKHOLE" "\017PROTO2\020PROTO1\021PRCLONING\022WASCLONED\023PROTO3" - "\025PINNED\026LOCAL\027BROADCAST\030MULTICAST\035STICKY"; + "\024FIXEDMTU\025PINNED\026LOCAL\027BROADCAST\030MULTICAST\035STICKY"; static const char ifnetflags[] = "\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5PTP\6b6\7RUNNING\010NOARP" "\011PPROMISC\012ALLMULTI\013OACTIVE\014SIMPLEX\015LINK0\016LINK1" Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Nov 17 01:01:45 2014 (r274610) +++ head/sys/net/if.c Mon Nov 17 01:05:29 2014 (r274611) @@ -2494,6 +2494,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, #ifdef INET6 nd6_setmtu(ifp); #endif + rt_updatemtu(ifp); } break; } Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Nov 17 01:01:45 2014 (r274610) +++ head/sys/net/route.c Mon Nov 17 01:05:29 2014 (r274611) @@ -141,6 +141,14 @@ static int rtrequest1_fib_change(struct struct rtentry **, u_int); static void rt_setmetrics(const struct rt_addrinfo *, struct rtentry *); +struct if_mtuinfo +{ + struct ifnet *ifp; + int mtu; +}; + +static int if_updatemtu_cb(struct radix_node *, void *); + /* * handler for net.my_fibnum */ @@ -947,6 +955,70 @@ bad: return (error); } +static int +if_updatemtu_cb(struct radix_node *rn, void *arg) +{ + struct rtentry *rt; + struct if_mtuinfo *ifmtu; + + rt = (struct rtentry *)rn; + ifmtu = (struct if_mtuinfo *)arg; + + if (rt->rt_ifp != ifmtu->ifp) + return (0); + + if (rt->rt_mtu >= ifmtu->mtu) { + /* We have to decrease mtu regardless of flags */ + rt->rt_mtu = ifmtu->mtu; + return (0); + } + + /* + * New MTU is bigger. Check if are allowed to alter it + */ + if ((rt->rt_flags & (RTF_FIXEDMTU | RTF_GATEWAY | RTF_HOST)) != 0) { + + /* + * Skip routes with user-supplied MTU and + * non-interface routes + */ + return (0); + } + + /* We are safe to update route MTU */ + rt->rt_mtu = ifmtu->mtu; + + return (0); +} + +void +rt_updatemtu(struct ifnet *ifp) +{ + struct if_mtuinfo ifmtu; + struct radix_node_head *rnh; + int i, j; + + ifmtu.ifp = ifp; + + /* + * Try to update rt_mtu for all routes using this interface + * Unfortunately the only way to do this is to traverse all + * routing tables in all fibs/domains. + */ + for (i = 1; i <= AF_MAX; i++) { + ifmtu.mtu = if_getmtu_family(ifp, i); + for (j = 0; j < rt_numfibs; j++) { + rnh = rt_tables_get_rnh(j, i); + if (rnh == NULL) + continue; + RADIX_NODE_HEAD_LOCK(rnh); + rnh->rnh_walktree(rnh, if_updatemtu_cb, &ifmtu); + RADIX_NODE_HEAD_UNLOCK(rnh); + } + } +} + + #if 0 int p_sockaddr(char *buf, int buflen, struct sockaddr *s); int rt_print(char *buf, int buflen, struct rtentry *rt); @@ -1408,6 +1480,7 @@ rtrequest1_fib_change(struct radix_node_ int error = 0; int free_ifa = 0; int family, mtu; + struct if_mtuinfo ifmtu; rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], info->rti_info[RTAX_NETMASK], rnh); @@ -1478,12 +1551,19 @@ rtrequest1_fib_change(struct radix_node_ if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest != NULL) rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, info); - /* Ensure route MTU is not bigger than interface MTU */ + /* Alter route MTU if necessary */ if (rt->rt_ifp != NULL) { family = info->rti_info[RTAX_DST]->sa_family; mtu = if_getmtu_family(rt->rt_ifp, family); - if (rt->rt_mtu > mtu) + /* Set default MTU */ + if (rt->rt_mtu == 0) rt->rt_mtu = mtu; + if (rt->rt_mtu != mtu) { + /* Check if we really need to update */ + ifmtu.ifp = rt->rt_ifp; + ifmtu.mtu = mtu; + if_updatemtu_cb(rt->rt_nodes, &ifmtu); + } } if (ret_nrt) { @@ -1501,8 +1581,24 @@ static void rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt) { - if (info->rti_mflags & RTV_MTU) + if (info->rti_mflags & RTV_MTU) { + if (info->rti_rmx->rmx_mtu != 0) { + + /* + * MTU was explicitly provided by user. + * Keep it. + */ + rt->rt_flags |= RTF_FIXEDMTU; + } else { + + /* + * User explicitly sets MTU to 0. + * Assume rollback to default. + */ + rt->rt_flags &= ~RTF_FIXEDMTU; + } rt->rt_mtu = info->rti_rmx->rmx_mtu; + } if (info->rti_mflags & RTV_WEIGHT) rt->rt_weight = info->rti_rmx->rmx_weight; /* Kernel -> userland timebase conversion. */ Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Nov 17 01:01:45 2014 (r274610) +++ head/sys/net/route.h Mon Nov 17 01:05:29 2014 (r274611) @@ -151,7 +151,7 @@ struct rtentry { /* 0x10000 unused, was RTF_PRCLONING */ /* 0x20000 unused, was RTF_WASCLONED */ #define RTF_PROTO3 0x40000 /* protocol specific routing flag */ -/* 0x80000 unused */ +#define RTF_FIXEDMTU 0x80000 /* MTU was explicitly specified */ #define RTF_PINNED 0x100000 /* route is immutable */ #define RTF_LOCAL 0x200000 /* route represents a local address */ #define RTF_BROADCAST 0x400000 /* route represents a bcast address */ @@ -378,6 +378,7 @@ int rtsock_routemsg(int, struct ifnet *i int rt_expunge(struct radix_node_head *, struct rtentry *); void rtfree(struct rtentry *); int rt_check(struct rtentry **, struct rtentry **, struct sockaddr *); +void rt_updatemtu(struct ifnet *); /* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */ /* Thes are used by old code not yet converted to use multiple FIBS */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Nov 17 01:01:45 2014 (r274610) +++ head/sys/netinet/ip_output.c Mon Nov 17 01:05:29 2014 (r274611) @@ -322,20 +322,10 @@ again: * Calculate MTU. If we have a route that is up, use that, * otherwise use the interface's MTU. */ - if (rte != NULL && (rte->rt_flags & (RTF_UP|RTF_HOST))) { - /* - * This case can happen if the user changed the MTU - * of an interface after enabling IP on it. Because - * most netifs don't keep track of routes pointing to - * them, there is no way for one to update all its - * routes when the MTU is changed. - */ - if (rte->rt_mtu > ifp->if_mtu) - rte->rt_mtu = ifp->if_mtu; + if (rte != NULL && (rte->rt_flags & (RTF_UP|RTF_HOST))) mtu = rte->rt_mtu; - } else { + else mtu = ifp->if_mtu; - } /* Catch a possible divide by zero later. */ KASSERT(mtu > 0, ("%s: mtu %d <= 0, rte=%p (rt_flags=0x%08x) ifp=%p", __func__, mtu, rte, (rte != NULL) ? rte->rt_flags : 0, ifp)); Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Nov 17 01:01:45 2014 (r274610) +++ head/sys/netinet6/ip6_output.c Mon Nov 17 01:05:29 2014 (r274611) @@ -1275,17 +1275,6 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s */ alwaysfrag = 1; mtu = IPV6_MMTU; - } else if (mtu > ifmtu) { - /* - * The MTU on the route is larger than the MTU on - * the interface! This shouldn't happen, unless the - * MTU of the interface has been changed after the - * interface was brought up. Change the MTU in the - * route to match the interface MTU (as long as the - * field isn't locked). - */ - mtu = ifmtu; - ro_pmtu->ro_rt->rt_mtu = mtu; } } else if (ifp) { mtu = IN6_LINKMTU(ifp); From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 06:03:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A0A3472; Mon, 17 Nov 2014 06:03:18 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D385FD; Mon, 17 Nov 2014 06:03:17 +0000 (UTC) Received: from Xins-MBP.home.us.delphij.net (c-24-5-244-32.hsd1.ca.comcast.net [24.5.244.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 7F31C22216; Sun, 16 Nov 2014 22:03:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1416204197; x=1416218597; bh=5hjFPw4ssNzTR3umGLcmLAspSLoVqzPKfXc68aTwBoY=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=ssA7asV9RJfSjqDxRuzuOaPQw4WiEAJhrUoaePYBldf48Tl7OxAxwuGYJeEODquv1 U3uPwkffI34zVM+Fzl/YyFmRf937TE8b2tm1EDy0QtFnkFYbfVvLP8M7vbQl4+ffSQ JXgl/LZ2uFjFBoAUaqI4QR2iTgqfljXOCPFPkqtY= Message-ID: <54698F93.2030700@delphij.net> Date: Sun, 16 Nov 2014 22:02:59 -0800 From: Xin Li User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Benjamin Kaduk , Xin LI Subject: Re: svn commit: r274583 - head/usr.sbin/watchdogd References: <201411160944.sAG9iUTJ084769@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 06:03:18 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 11/16/14 13:46, Benjamin Kaduk wrote: > On Sun, Nov 16, 2014 at 4:44 AM, Xin LI > wrote: > > Author: delphij Date: Sun Nov 16 09:44:30 2014 New Revision: > 274583 URL: https://svnweb.freebsd.org/changeset/base/274583 > > Log: Default to use 10 seconds as nap interval instead of 1. > > relnotes: yes? I'm not sure -- no objection but is this noteworthy? Cheers, -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJUaY+QAAoJEJW2GBstM+nsdsQP/18qHXBq9VwCy+in+0zF3aeO xz+O81ocujGv0+ne5efOdm/WtZk6ZKa9v7NASluwaoks7nxsRR9xIZi6foz3J7Zb Aa0uQSAx9Upq78/1GggVBr1hJKH+DkwUgKCKiSbUGvlL+gXgBWxL86hOdpPpixJj LMUrFmsEjs+yS6wxKDgAw4w89vzYyNGooiveK0Wlgvr/6RSx9zDW6fAgJKOItLDN jirmhVRfFn5EtZISaP/tpdQx+yXZNo6s41LPUauMXpPzYHTc3D+fW4bNhTzIDuFB s8dHKEwrFNOWWmxRYTSQ7pC0Nr9RvUJUHjGuwK71jLDkVbRvjj0Smz1ewRVJXCTn Nh81kdQqv2xbS3cONe7+geklXy5/diccDP7c+unZCYzHyHDG0yWjRgy/rB/4vugy QF8KBi8JExmOjWpB2vREIF3I9dGaJJ2+P5vLdNzDYUTdZeNobtexPiZd5YX3KLsz js42uOx64JXwEsR7rbnqizn79zbTBZ1I4Zi9gyYN1FvRn2vHWeAr64CRyLxvVYUc Cfdh5ONmW1x2Y+YMQovJgsdv0cSUGFjbLfG9ScH9QjQvUK/U5p2PeojaI2hixqH7 RpGSvBwoJFwTu+4sR0B05Z0ex9EDkJbFhHreDYr6y2QXCWjK0CCrdXro03PZj4jt 6KbV/k3XTsYQwuXDNZZ7 =A2Zm -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 09:19:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60EAC340; Mon, 17 Nov 2014 09:19:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFD9860; Mon, 17 Nov 2014 09:19:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAH9JBa5043266; Mon, 17 Nov 2014 09:19:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAH9JAEc043258; Mon, 17 Nov 2014 09:19:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411170919.sAH9JAEc043258@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 17 Nov 2014 09:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274618 - in head: etc/mtree lib/msun lib/msun/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 09:19:11 -0000 Author: ngie Date: Mon Nov 17 09:19:09 2014 New Revision: 274618 URL: https://svnweb.freebsd.org/changeset/base/274618 Log: Add reachover Makefiles for contrib/netbsd-tests/lib/librt A variant of this code has been tested on amd64/i386 for some time by EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the code will remain off until it's proven it works on virtual hardware or real hardware on other architectures Sponsored by: EMC / Isilon Storage Division Added: head/lib/msun/Makefile.amd64 (contents, props changed) head/lib/msun/Makefile.i386 (contents, props changed) head/lib/msun/tests/ head/lib/msun/tests/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/lib/msun/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Nov 17 07:38:23 2014 (r274617) +++ head/etc/mtree/BSD.tests.dist Mon Nov 17 09:19:09 2014 (r274618) @@ -157,6 +157,8 @@ .. libutil .. + msun + .. .. libexec atf Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon Nov 17 07:38:23 2014 (r274617) +++ head/lib/msun/Makefile Mon Nov 17 09:19:09 2014 (r274618) @@ -219,4 +219,8 @@ MLINKS+=tan.3 tanf.3 tan.3 tanl.3 MLINKS+=tanh.3 tanhf.3 tanh.3 tanhl.3 MLINKS+=trunc.3 truncf.3 trunc.3 truncl.3 +.include + +.include + .include Added: head/lib/msun/Makefile.amd64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/Makefile.amd64 Mon Nov 17 09:19:09 2014 (r274618) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Added: head/lib/msun/Makefile.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/Makefile.i386 Mon Nov 17 09:19:09 2014 (r274618) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Added: head/lib/msun/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/tests/Makefile Mon Nov 17 09:19:09 2014 (r274618) @@ -0,0 +1,63 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H} +SRCTOP= ${.CURDIR:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libm + +TESTSDIR= ${TESTSBASE}/lib/msun + +.if ${MACHINE} == "sparc" || ${MACHINE} == "i386" \ + || ${MACHINE} == "amd64" || ${MACHINE_CPU} == "arm" \ + || ${MACHINE} == "sparc64" +CFLAGS+= -DHAVE_FENV_H +.endif + +.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" +CFLAGS+= -D__HAVE_LONG_DOUBLE +.endif + +NETBSD_ATF_TESTS_C= acos_test +NETBSD_ATF_TESTS_C+= asin_test +NETBSD_ATF_TESTS_C+= atan_test +NETBSD_ATF_TESTS_C+= cbrt_test +NETBSD_ATF_TESTS_C+= ceil_test +NETBSD_ATF_TESTS_C+= cos_test +NETBSD_ATF_TESTS_C+= cosh_test +NETBSD_ATF_TESTS_C+= erf_test +NETBSD_ATF_TESTS_C+= exp_test +NETBSD_ATF_TESTS_C+= fmod_test +NETBSD_ATF_TESTS_C+= infinity_test +NETBSD_ATF_TESTS_C+= ldexp_test +NETBSD_ATF_TESTS_C+= log_test +NETBSD_ATF_TESTS_C+= pow_test +NETBSD_ATF_TESTS_C+= precision_test +NETBSD_ATF_TESTS_C+= round_test +NETBSD_ATF_TESTS_C+= scalbn_test +NETBSD_ATF_TESTS_C+= sin_test +NETBSD_ATF_TESTS_C+= sinh_test +NETBSD_ATF_TESTS_C+= sqrt_test +NETBSD_ATF_TESTS_C+= tan_test +NETBSD_ATF_TESTS_C+= tanh_test + +CSTD= c99 + +LDADD+= -lm +DPADD+= ${LIBM} +#COPTS+= -Wfloat-equal + +# Copied from lib/msun/Makefile +.if ${MACHINE_CPUARCH} == "i386" +ARCH_SUBDIR= i387 +.else +ARCH_SUBDIR= ${MACHINE_CPUARCH} +.endif + +.include "../${ARCH_SUBDIR}/Makefile.inc" + +# XXX: for some odd reason float.h doesn't tell the full story about what the +# precision is. +CFLAGS+= -DLDBL_PREC=${LDBL_PREC} + +.include + +.include From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 09:20:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3E60486; Mon, 17 Nov 2014 09:20:05 +0000 (UTC) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B1D086A; Mon, 17 Nov 2014 09:20:05 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id v10so20784692pde.36 for ; Mon, 17 Nov 2014 01:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=FBj4xnAheMQ8gHyNlztLTUCL4fDKCzIufDs+1QK6XLw=; b=lXuow+n8+4+lHJgudaz7Tc3BWbje4g3qE/YTy6X0qlqYqiHpfwKiZmKxFa1lr7F4Qr yIO5mNtnhCnu+8uoBku3tU4vlZvi12E6D+Tj4K4TY6wgqI8ekEyzBNJlwNNroZ58ZGyd YgzuPiO1i11Uw2lZOKHRQLnzhaigRB3Qxu0qwbcGA20GdCPZt/Ndr0SWeIL31QTlnI21 gWDMWdFXDqxTnvDl7GO2QKoaS0hEMNsN+nQVx6+KgchBms3UmxtYvw6i5OuHWz9gTSV+ vLUNSuay4+L21r5rjJR3ja3Gw0VbqjwGb+2J+hvbDW9c/PzyLxV6MXBuAtKH/SV5Vjas On1Q== X-Received: by 10.70.92.169 with SMTP id cn9mr8499068pdb.117.1416216005233; Mon, 17 Nov 2014 01:20:05 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:59da:de8a:308b:f2b? ([2601:8:ab80:7d6:59da:de8a:308b:f2b]) by mx.google.com with ESMTPSA id hy15sm8315564pad.11.2014.11.17.01.19.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 01:20:04 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_40396BBD-8ECF-4627-B008-A1064682398B"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274618 - in head: etc/mtree lib/msun lib/msun/tests From: Garrett Cooper In-Reply-To: <201411170919.sAH9JAEc043258@svn.freebsd.org> Date: Mon, 17 Nov 2014 01:19:56 -0800 Message-Id: <38F8B193-2F8C-42E7-809C-55A2970B0006@gmail.com> References: <201411170919.sAH9JAEc043258@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 09:20:06 -0000 --Apple-Mail=_40396BBD-8ECF-4627-B008-A1064682398B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 17, 2014, at 1:19, Garrett Cooper wrote: > Author: ngie > Date: Mon Nov 17 09:19:09 2014 > New Revision: 274618 > URL: https://svnweb.freebsd.org/changeset/base/274618 >=20 > Log: > Add reachover Makefiles for contrib/netbsd-tests/lib/librt >=20 > A variant of this code has been tested on amd64/i386 for some time by > EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, = but the > code will remain off until it's proven it works on virtual hardware = or real > hardware on other architectures >=20 > Sponsored by: EMC / Isilon Storage Division Sorry. Copy-pasted the wrong commit message. It should have read=85 =93=94" Add reachover Makefiles for contrib/netbsd-tests/lib/libm as = lib/msun/tests A variant of this code has been tested on amd64/i386 for some time by EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, = but the code will remain off until it's proven it works on virtual hardware or = real hardware on other architectures Sponsored by: EMC / Isilon Storage Division =93=94" --Apple-Mail=_40396BBD-8ECF-4627-B008-A1064682398B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUab28AAoJEMZr5QU6S73eW3oH/RkLxAd6ZQMv0iOeI7JynYft lv2yemFXikUYVxjKQKC+Cjj8TpmYfCu7TlkDulReOcyubYZhul/V/ioo5Ykx+Mzm uTY7WiPLV3qfvqE7dZWdGTtLi1BWOK/vPxzljyqhLSuVEtJkTAByrQKOEoZLXYm5 X/MGIvAKoiwopMWoNoJZ2KEvlSRh7V8lF5xZz/GP/LGKuo58a2g4i/+Zn0OXiDNp AzbJm1MfawQIwxE0w+BGFgaqN3cygicL1wlBhVhDLouN1j3P8ryaQtQmJSr1xixz nh0H9JD68uXUt1hn83KWbOwUx++1GQaAIYng6I+fAPkcsECyV8+XM9CmqbOn6/A= =Dnlc -----END PGP SIGNATURE----- --Apple-Mail=_40396BBD-8ECF-4627-B008-A1064682398B-- From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 11:32:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D310A1BB; Mon, 17 Nov 2014 11:32:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2ADC829; Mon, 17 Nov 2014 11:32:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHBWCnn006786; Mon, 17 Nov 2014 11:32:12 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHBWBMU006778; Mon, 17 Nov 2014 11:32:11 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201411171132.sAHBWBMU006778@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 17 Nov 2014 11:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274619 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 11:32:12 -0000 Author: smh Date: Mon Nov 17 11:32:10 2014 New Revision: 274619 URL: https://svnweb.freebsd.org/changeset/base/274619 Log: Disable TRIM on file backed ZFS vdevs and fix TRIM on init After r265152 TRIM requests are ZIO_TYPE_FREE instead of ZIO_TYPE_IOCTL this meant file backed vdevs to attempted to process the ZIO as a write causing a panic. We now disable TRIM on file backed vdevs and ASSERT the ZIO types supported by each vdev type to ensure we explicity support the ZIO type being processed. Also ensure that TRIM on init is not procesed for devices which declare they didn't support TRIM via vdev_notrim. PR: 195061, 194976, 191573 Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Mon Nov 17 09:19:09 2014 (r274618) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Mon Nov 17 11:32:10 2014 (r274619) @@ -146,10 +146,8 @@ trim_map_create(vdev_t *vd) { trim_map_t *tm; - ASSERT(vd->vdev_ops->vdev_op_leaf); - - if (!zfs_trim_enabled) - return; + ASSERT(zfs_trim_enabled && !vd->vdev_notrim && + vd->vdev_ops->vdev_op_leaf); tm = kmem_zalloc(sizeof (*tm), KM_SLEEP); mutex_init(&tm->tm_lock, NULL, MUTEX_DEFAULT, NULL); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Nov 17 09:19:09 2014 (r274618) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Nov 17 11:32:10 2014 (r274619) @@ -1223,6 +1223,7 @@ vdev_open(vdev_t *vd) vd->vdev_stat.vs_aux = VDEV_AUX_NONE; vd->vdev_cant_read = B_FALSE; vd->vdev_cant_write = B_FALSE; + vd->vdev_notrim = B_FALSE; vd->vdev_min_asize = vdev_get_min_asize(vd); /* @@ -1292,10 +1293,8 @@ vdev_open(vdev_t *vd) if (vd->vdev_ishole || vd->vdev_ops == &vdev_missing_ops) return (0); - if (vd->vdev_ops->vdev_op_leaf) { - vd->vdev_notrim = B_FALSE; + if (zfs_trim_enabled && !vd->vdev_notrim && vd->vdev_ops->vdev_op_leaf) trim_map_create(vd); - } for (int c = 0; c < vd->vdev_children; c++) { if (vd->vdev_child[c]->vdev_state != VDEV_STATE_HEALTHY) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Nov 17 09:19:09 2014 (r274618) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Nov 17 11:32:10 2014 (r274619) @@ -796,6 +796,8 @@ vdev_disk_io_start(zio_t *zio) return; } + ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE); + vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); vb->vb_io = zio; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Nov 17 09:19:09 2014 (r274618) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Nov 17 11:32:10 2014 (r274619) @@ -129,6 +129,8 @@ skip_open: return (error); } + vd->vdev_notrim = B_TRUE; + *max_psize = *psize = vattr.va_size; *logical_ashift = SPA_MINBLOCKSHIFT; *physical_ashift = SPA_MINBLOCKSHIFT; @@ -185,6 +187,8 @@ vdev_file_io_start(zio_t *zio) return; } + ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE); + zio->io_error = vn_rdwr(zio->io_type == ZIO_TYPE_READ ? UIO_READ : UIO_WRITE, vp, zio->io_data, zio->io_size, zio->io_offset, UIO_SYSSPACE, 0, RLIM64_INFINITY, kcred, &resid); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Nov 17 09:19:09 2014 (r274618) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Nov 17 11:32:10 2014 (r274619) @@ -832,6 +832,11 @@ vdev_geom_io_start(zio_t *zio) return; } sendreq: + ASSERT(zio->io_type == ZIO_TYPE_READ || + zio->io_type == ZIO_TYPE_WRITE || + zio->io_type == ZIO_TYPE_FREE || + zio->io_type == ZIO_TYPE_IOCTL); + cp = vd->vdev_tsd; if (cp == NULL) { zio->io_error = SET_ERROR(ENXIO); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Mon Nov 17 09:19:09 2014 (r274618) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Mon Nov 17 11:32:10 2014 (r274619) @@ -713,8 +713,9 @@ vdev_label_init(vdev_t *vd, uint64_t crt * Don't TRIM if removing so that we don't interfere with zpool * disaster recovery. */ - if (zfs_trim_enabled && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || - reason == VDEV_LABEL_SPARE || reason == VDEV_LABEL_L2CACHE)) + if (zfs_trim_enabled && vdev_trim_on_init && !vd->vdev_notrim && + (reason == VDEV_LABEL_CREATE || reason == VDEV_LABEL_SPARE || + reason == VDEV_LABEL_L2CACHE)) zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize)); /* From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 11:35:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD1EB3D2; Mon, 17 Nov 2014 11:35:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9AB584F; Mon, 17 Nov 2014 11:35:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHBZU3k007331; Mon, 17 Nov 2014 11:35:30 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHBZUKm007330; Mon, 17 Nov 2014 11:35:30 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201411171135.sAHBZUKm007330@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 17 Nov 2014 11:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274620 - head/tools/regression/zfs/zpool/add X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 11:35:30 -0000 Author: smh Date: Mon Nov 17 11:35:30 2014 New Revision: 274620 URL: https://svnweb.freebsd.org/changeset/base/274620 Log: Revert r273630 as the panic was fixed by r274619 The panic was caused by TRIM requests run against file based vdevs as write requests. PR: 191573 Sponsored by: Multiplay Modified: head/tools/regression/zfs/zpool/add/files.t Modified: head/tools/regression/zfs/zpool/add/files.t ============================================================================== --- head/tools/regression/zfs/zpool/add/files.t Mon Nov 17 11:32:10 2014 (r274619) +++ head/tools/regression/zfs/zpool/add/files.t Mon Nov 17 11:35:30 2014 (r274620) @@ -4,8 +4,6 @@ dir=`dirname $0` . ${dir}/../../misc.sh -[ "${os}" = "FreeBSD" ] && die "panics FreeBSD; see bug # 191573" - echo "1..54" files_create 8 From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 11:36:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FB22672; Mon, 17 Nov 2014 11:36:56 +0000 (UTC) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA986871; Mon, 17 Nov 2014 11:36:55 +0000 (UTC) Received: by mail-pa0-f52.google.com with SMTP id eu11so1261439pac.39 for ; Mon, 17 Nov 2014 03:36:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=G+mygvtjbRdFElv5paLVr7/itABhYQvzyUo5M9fKjho=; b=St5B9YyAZpAxcRQs1QgCKx1ldvG5oD1ZBvDVKB9bccFglEFTq2toMwzM/8DDOQNKer a9iwmAGSaqr+Vh7ffj9vqRSo+7RALJqd8VCd3aGcpHjFJ3bw9wV7bE1j2QPTsYZzrHKA LCKtjSH56gDyaBDc7oxkNJnooewREh692GfHSplm1u9birEos4uKLIKQt1L5e8EdQyNc PN5Ft7XkWl0uGGrDtsX/k01KO01b1ZrM1FHazMaKmvxdlLEWsxm589MFLy5AqlacPdKP yt7Du75t5I4IzApi1xlHeTC+b8av6JYtozxoUpEGtCzuPgT39OfRcTB/8CcRWEXjgq88 Gsrw== X-Received: by 10.70.54.161 with SMTP id k1mr28777574pdp.110.1416224215376; Mon, 17 Nov 2014 03:36:55 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:59da:de8a:308b:f2b? ([2601:8:ab80:7d6:59da:de8a:308b:f2b]) by mx.google.com with ESMTPSA id ug6sm34785751pbc.72.2014.11.17.03.36.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 03:36:54 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_968A4E83-EEA8-41E1-92A2-F8B5067A918B"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274620 - head/tools/regression/zfs/zpool/add From: Garrett Cooper In-Reply-To: <201411171135.sAHBZUKm007330@svn.freebsd.org> Date: Mon, 17 Nov 2014 03:36:53 -0800 Message-Id: <83D7C0F0-720B-41D0-B0B9-6D5C21DBA7B1@gmail.com> References: <201411171135.sAHBZUKm007330@svn.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 11:36:56 -0000 --Apple-Mail=_968A4E83-EEA8-41E1-92A2-F8B5067A918B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Nov 17, 2014, at 3:35, Steven Hartland wrote: > Author: smh > Date: Mon Nov 17 11:35:30 2014 > New Revision: 274620 > URL: https://svnweb.freebsd.org/changeset/base/274620 >=20 > Log: > Revert r273630 as the panic was fixed by r274619 >=20 > The panic was caused by TRIM requests run against file based vdevs as = write > requests. >=20 > PR: 191573 > Sponsored by: Multiplay Hi Steven, Do the other issues fall in line with the beforementioned = commit? Thanks! --Apple-Mail=_968A4E83-EEA8-41E1-92A2-F8B5067A918B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUad3VAAoJEMZr5QU6S73eoKoH/Ril5d+xgfNvo5QzumkXphUJ tOJYKuLND2zHM/LbrgxUfrAfwKkGhRyn+YN1AC+aBVWXetCJiKI7MzrpVJybQkde NELbw3z2J4zzVqR1fEL9ubn1wI0N93JwK06p/QD0oHeQpOB2mc58ihHpVBu/gP6o dd2Ldo9DNCRd09wMITtl/vwbwU0yuPsPxIb3A+0byv1e6vU8JbD6y6t8T44J+DQ5 rpN5cNy1UKBvLFcmrs1ZalGELh93qE7QZgV42j1fKmPBVYBg4xYty6TxYxkOd46u aE0o+aaW6vhQaVILSc2TVLMxL2GD1uJbLNdw+tlZJ7QIAJP0oSKDf830WD2RZH0= =U32U -----END PGP SIGNATURE----- --Apple-Mail=_968A4E83-EEA8-41E1-92A2-F8B5067A918B-- From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 12:03:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CFD7F32 for ; Mon, 17 Nov 2014 12:03:55 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9461B5C for ; Mon, 17 Nov 2014 12:03:54 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id 10so15580552lbg.21 for ; Mon, 17 Nov 2014 04:03:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc:content-type; bh=jSexI1M9oE7otYcqnYlVhwLNSKdR29CFmolXQoACsx4=; b=bIImTxUFcNKZrLlZgZe3c1hlGHGm4fwhb7D0BldXFq2cyn3nqBWNv6xuY5liDXc59i fCWeAuD0wHBQtnbyp86NYcXfV1BMsIy9pwq4ESDvwIbo3qY6jTvL7dd58pnreYyRyU9R IelyTLvLJ0O7WXWtaUducGHUjvzen+v51x3GemC5KxsF2Kb4+FWg7gcympLFAIUCyvIV 0v5bs4a5AqCPEJQvoKOx/FTDto505/szkyyhfJv1rp4lOrN6yt2DHovK+PDUyuOwcCYO 0Rii1wXhBFHya8QdGznuxQhdU2mJPxVdPrfjtymSjWKhS5TUHnZUTKNSDPb7CD97CYZo lyzw== X-Gm-Message-State: ALoCoQkEOmVmaqxQ9i9bZN5TkfXyf6nnRtm+GFq+0rO+CrFm7cK37v1swYaN7hkpMsawtss0KWnk X-Received: by 10.152.5.6 with SMTP id o6mt14238716lao.8.1416225832210; Mon, 17 Nov 2014 04:03:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.21.1 with HTTP; Mon, 17 Nov 2014 04:03:21 -0800 (PST) In-Reply-To: <201411171132.sAHBWBMU006778@svn.freebsd.org> References: <201411171132.sAHBWBMU006778@svn.freebsd.org> From: Steven Hartland Date: Mon, 17 Nov 2014 12:03:21 +0000 Message-ID: Subject: Re: svn commit: r274619 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 12:03:55 -0000 On 17 November 2014 11:32, Steven Hartland wrote: > Author: smh > Date: Mon Nov 17 11:32:10 2014 > New Revision: 274619 > URL: https://svnweb.freebsd.org/changeset/base/274619 > > Log: > Disable TRIM on file backed ZFS vdevs and fix TRIM on init > > After r265152 TRIM requests are ZIO_TYPE_FREE instead of ZIO_TYPE_IOCTL > this meant file backed vdevs to attempted to process the ZIO as a write > causing a panic. > > We now disable TRIM on file backed vdevs and ASSERT the ZIO types > supported > by each vdev type to ensure we explicity support the ZIO type being > processed. > > Also ensure that TRIM on init is not procesed for devices which declare > they > didn't support TRIM via vdev_notrim. > > PR: 195061, 194976, 191573 > Sponsored by: Multiplay > This should have listed MFC: 3 days From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 12:36:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F7648F5; Mon, 17 Nov 2014 12:36:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ADFDE10; Mon, 17 Nov 2014 12:36:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHCa2W1035111; Mon, 17 Nov 2014 12:36:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHCa2KN035110; Mon, 17 Nov 2014 12:36:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411171236.sAHCa2KN035110@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 17 Nov 2014 12:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274621 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 12:36:02 -0000 Author: trasz Date: Mon Nov 17 12:36:01 2014 New Revision: 274621 URL: https://svnweb.freebsd.org/changeset/base/274621 Log: The "intr" option is NFS-specific; fix examples in auto_master(5). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/auto_master.5 Modified: head/usr.sbin/autofs/auto_master.5 ============================================================================== --- head/usr.sbin/autofs/auto_master.5 Mon Nov 17 11:35:30 2014 (r274620) +++ head/usr.sbin/autofs/auto_master.5 Mon Nov 17 12:36:01 2014 (r274621) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 23, 2014 +.Dd November 17, 2014 .Dt AUTO_MASTER 5 .Os .Sh NAME @@ -170,7 +170,7 @@ mount options: .Pp Automatically mount the CD drive on access: .Bd -literal -offset indent -.Li cd -intr,fstype=cd9660 :/dev/cd0 +.Li cd -fstype=cd9660 :/dev/cd0 .Ed .Sh SPECIAL MAPS Special maps have names beginning with @@ -224,7 +224,7 @@ and this in map file: .Bd -literal -offset indent .Li /example/x -intr,nfsv4 192.168.1.1:/share/example/x -.Li /example/cd -intr,fstype=cd9660 :/dev/cd0 +.Li /example/cd -fstype=cd9660 :/dev/cd0 .Ed .Sh DIRECTORY SERVICES Both From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 13:39:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D629EF7E; Mon, 17 Nov 2014 13:39:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEE166A6; Mon, 17 Nov 2014 13:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHDdDP6064210; Mon, 17 Nov 2014 13:39:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHDd0h3064114; Mon, 17 Nov 2014 13:39:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411171339.sAHDd0h3064114@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 17 Nov 2014 13:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274626 - in head/contrib/netbsd-tests/lib: libc/gen libc/gen/posix_spawn libc/locale libc/net libc/regex libc/stdlib libc/string libc/sys libc/time libc/tls libc/tls/dso libc/tls_dso l... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 13:39:14 -0000 Author: ngie Date: Mon Nov 17 13:39:00 2014 New Revision: 274626 URL: https://svnweb.freebsd.org/changeset/base/274626 Log: Mechanically replace #if defined(__FreeBSD__) and #if defined(__NetBSD__) with their #ifdef equivalents for everything changed in contrib/netbsd-tests. There are some items from the vendor tree that use #if defined(__FreeBSD__) or #if defined(__NetBSD__) which are being left alone Requested by: bde, rpaulo Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c head/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c head/contrib/netbsd-tests/lib/libc/gen/t_glob.c head/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c head/contrib/netbsd-tests/lib/libc/gen/t_nice.c head/contrib/netbsd-tests/lib/libc/gen/t_raise.c head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c head/contrib/netbsd-tests/lib/libc/gen/t_time.c head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c head/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c head/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c head/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c head/contrib/netbsd-tests/lib/libc/regex/debug.c head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c head/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c head/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c head/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c head/contrib/netbsd-tests/lib/libc/string/t_strerror.c head/contrib/netbsd-tests/lib/libc/sys/t_access.c head/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c head/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c head/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c head/contrib/netbsd-tests/lib/libc/sys/t_kevent.c head/contrib/netbsd-tests/lib/libc/sys/t_listen.c head/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c head/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c head/contrib/netbsd-tests/lib/libc/sys/t_poll.c head/contrib/netbsd-tests/lib/libc/sys/t_revoke.c head/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c head/contrib/netbsd-tests/lib/libc/sys/t_stat.c head/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c head/contrib/netbsd-tests/lib/libc/sys/t_write.c head/contrib/netbsd-tests/lib/libc/time/t_strptime.c head/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c head/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c head/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c head/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c head/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c head/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c head/contrib/netbsd-tests/lib/libpthread/h_atexit.c head/contrib/netbsd-tests/lib/libpthread/t_detach.c Modified: head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c Mon Nov 17 13:39:00 2014 (r274626) @@ -31,7 +31,7 @@ */ -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif #include @@ -251,7 +251,7 @@ ATF_TC_BODY(t_spawn_open_nonexistent, tc posix_spawn_file_actions_destroy(&fa); } -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_TC(t_spawn_open_nonexistent_diag); ATF_TC_HEAD(t_spawn_open_nonexistent_diag, tc) @@ -381,7 +381,7 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, t_spawn_fileactions); ATF_TP_ADD_TC(tp, t_spawn_open_nonexistent); -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, t_spawn_open_nonexistent_diag); #endif ATF_TP_ADD_TC(tp, t_spawn_reopen); Modified: head/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c Mon Nov 17 13:39:00 2014 (r274626) @@ -56,7 +56,7 @@ ATF_TC_BODY(getcwd_err, tc) ATF_REQUIRE(getcwd(buf, 0) == NULL); ATF_REQUIRE(errno == EINVAL); -#if defined(__NetBSD__) +#ifdef __NetBSD__ errno = 0; ATF_REQUIRE(getcwd((void *)-1, sizeof(buf)) == NULL); Modified: head/contrib/netbsd-tests/lib/libc/gen/t_glob.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_glob.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/gen/t_glob.c Mon Nov 17 13:39:00 2014 (r274626) @@ -46,7 +46,7 @@ __RCSID("$NetBSD: t_glob.c,v 1.3 2013/01 #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include "h_macros.h" #define __gl_stat_t struct stat #define _S_IFDIR S_IFDIR @@ -138,7 +138,7 @@ gl_readdir(void *v) dir.d_ino = dd->pos; dir.d_type = f->dir ? DT_DIR : DT_REG; DPRINTF(("readdir %s %d\n", dir.d_name, dir.d_type)); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ dir.d_reclen = -1; /* Does not have _DIRENT_RECLEN */ #else dir.d_reclen = _DIRENT_RECLEN(&dir, dir.d_namlen); @@ -223,7 +223,7 @@ run(const char *p, int flags, const char } -#if !defined(__FreeBSD__) +#ifndef __FreeBSD__ ATF_TC(glob_star); ATF_TC_HEAD(glob_star, tc) { @@ -272,7 +272,7 @@ ATF_TC_BODY(glob_nocheck, tc) ATF_TP_ADD_TCS(tp) { -#if !defined(__FreeBSD__) +#ifndef __FreeBSD__ ATF_TP_ADD_TC(tp, glob_star); #endif ATF_TP_ADD_TC(tp, glob_star_not); Modified: head/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c Mon Nov 17 13:39:00 2014 (r274626) @@ -34,7 +34,7 @@ #include #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #else #include @@ -82,7 +82,7 @@ const struct hnopts { /* * Truncated output. Rev. 1.7 produces "1.0 K". */ -#if !defined(__FreeBSD__) +#ifndef __FreeBSD__ { 6, 1000, "A", HN_AUTOSCALE, HN_DECIMAL, -1, "" }, /* Modified: head/contrib/netbsd-tests/lib/libc/gen/t_nice.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_nice.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/gen/t_nice.c Mon Nov 17 13:39:00 2014 (r274626) @@ -72,7 +72,7 @@ ATF_TC_BODY(nice_err, tc) { int i; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_expect_fail("nice(incr) with incr < 0 fails with unprivileged " "users and sets errno == EPERM; see PR # 189821 for more details"); #endif @@ -98,7 +98,7 @@ ATF_TC_HEAD(nice_priority, tc) ATF_TC_BODY(nice_priority, tc) { -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ int i, pri, pri2, nic; #else int i, pri, nic; @@ -115,7 +115,7 @@ ATF_TC_BODY(nice_priority, tc) pri = getpriority(PRIO_PROCESS, 0); ATF_REQUIRE(errno == 0); -#if defined(__NetBSD__) +#ifdef __NetBSD__ if (nic != pri) atf_tc_fail("nice(3) and getpriority(2) conflict"); #endif @@ -130,14 +130,14 @@ ATF_TC_BODY(nice_priority, tc) if (pid == 0) { errno = 0; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ pri = getpriority(PRIO_PROCESS, 0); #else pri2 = getpriority(PRIO_PROCESS, 0); #endif ATF_REQUIRE(errno == 0); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ if (pri != pri2) #else if (nic != pri) @@ -180,7 +180,7 @@ ATF_TC_HEAD(nice_thread, tc) ATF_TC_BODY(nice_thread, tc) { pthread_t tid[5]; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ int pri, rv, val; #else int rv, val; @@ -196,7 +196,7 @@ ATF_TC_BODY(nice_thread, tc) val = nice(i); ATF_REQUIRE(val != -1); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ pri = getpriority(PRIO_PROCESS, 0); rv = pthread_create(&tid[i], NULL, threadfunc, &pri); #else Modified: head/contrib/netbsd-tests/lib/libc/gen/t_raise.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_raise.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/gen/t_raise.c Mon Nov 17 13:39:00 2014 (r274626) @@ -43,7 +43,7 @@ static int count; static void handler_err(int); static void handler_ret(int); static void handler_stress(int); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ static int sig[] = { SIGALRM, SIGIO, SIGUSR1, SIGUSR2 }; #else static int sig[] = { SIGALRM, SIGIO, SIGUSR1, SIGUSR2, SIGPWR }; Modified: head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Mon Nov 17 13:39:00 2014 (r274626) @@ -63,7 +63,7 @@ ATF_TC_BODY(setdomainname_basic, tc) (void)memset(name, 0, sizeof(name)); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ /* * Sanity checks to ensure that the wrong invariant isn't being * tested for per PR # 181127 @@ -101,7 +101,7 @@ ATF_TC_BODY(setdomainname_limit, tc) (void)memset(name, 0, sizeof(name)); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ ATF_REQUIRE(setdomainname(name, MAXHOSTNAMELEN - 1 ) == 0); ATF_REQUIRE(setdomainname(name, MAXHOSTNAMELEN) == -1); #endif Modified: head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c Mon Nov 17 13:39:00 2014 (r274626) @@ -28,7 +28,7 @@ #include -#if defined(__NetBSD__) +#ifdef __NetBSD__ #include #endif #include @@ -87,7 +87,7 @@ sig_debug(int signo, siginfo_t *info, uc printf("uc_stack %p %lu 0x%x\n", ctx->uc_stack.ss_sp, (unsigned long)ctx->uc_stack.ss_size, ctx->uc_stack.ss_flags); -#if defined(__NetBSD__) +#ifdef __NetBSD__ for (i = 0; i < __arraycount(ctx->uc_mcontext.__gregs); i++) printf("uc_mcontext.greg[%d] 0x%lx\n", i, (long)ctx->uc_mcontext.__gregs[i]); @@ -144,7 +144,7 @@ sigchild_action(int signo, siginfo_t *in printf("si_uid=%d\n", info->si_uid); printf("si_pid=%d\n", info->si_pid); printf("si_status=%d\n", info->si_status); -#if defined(__NetBSD__) +#ifdef __NetBSD__ printf("si_utime=%lu\n", (unsigned long int)info->si_utime); printf("si_stime=%lu\n", (unsigned long int)info->si_stime); #endif Modified: head/contrib/netbsd-tests/lib/libc/gen/t_time.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_time.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/gen/t_time.c Mon Nov 17 13:39:00 2014 (r274626) @@ -31,7 +31,7 @@ #include __RCSID("$NetBSD: t_time.c,v 1.2 2011/11/11 05:03:38 jruoho Exp $"); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif #include Modified: head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c Mon Nov 17 13:39:00 2014 (r274626) @@ -107,7 +107,7 @@ ATF_TC_BODY(ttyname_r_err, tc) ATF_REQUIRE(rv == ERANGE); } -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_expect_fail("FreeBSD returns ENOTTY instead of EBADF; see bin/191936"); #endif rv = ttyname_r(-1, buf, ttymax); Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c Mon Nov 17 13:39:00 2014 (r274626) @@ -132,7 +132,7 @@ h_ctype2(const struct test *t, bool use_ size_t n; ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C"); -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL); #else if (setlocale(LC_CTYPE, t->locale) == NULL) { @@ -245,7 +245,7 @@ ATF_TC_BODY(mbrtowc_internal, tc) { struct test *t; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_expect_fail("ja_* locale fails"); #endif for (t = &tests[0]; t->data != NULL; ++t) Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Mon Nov 17 13:39:00 2014 (r274626) @@ -150,7 +150,7 @@ ATF_TC_BODY(mbstowcs_basic, tc) int i; ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C"); -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL); #else if (setlocale(LC_CTYPE, t->locale) == NULL) { Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Mon Nov 17 13:39:00 2014 (r274626) @@ -76,7 +76,7 @@ h_mbtowc(const char *locale, const char char *str; ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C"); -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_REQUIRE(setlocale(LC_CTYPE, locale) != NULL); #else if (setlocale(LC_CTYPE, locale) == NULL) { @@ -137,13 +137,13 @@ ATF_TC_BODY(mbtowc, tc) h_mbtowc("ja_JP.ISO2022-JP", "\033$B", "\033$B$\"\033(B"); h_mbtowc("ja_JP.SJIS", "\202", "\202\240"); h_mbtowc("ja_JP.eucJP", "\244", "\244\242"); -#if !defined(__FreeBSD__) +#ifndef __FreeBSD__ /* Moved last as it fails */ h_mbtowc("zh_CN.GB18030", "\241", "\241\241"); #endif h_mbtowc("zh_TW.Big5", "\241", "\241@"); h_mbtowc("zh_TW.eucTW", "\241", "\241\241"); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_expect_fail("zh_CN.GB18030"); h_mbtowc("zh_CN.GB18030", "\241", "\241\241"); #endif Modified: head/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c Mon Nov 17 13:39:00 2014 (r274626) @@ -66,7 +66,7 @@ __RCSID("$NetBSD: t_wcstod.c,v 1.3 2011/ #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c Mon Nov 17 13:39:00 2014 (r274626) @@ -109,7 +109,7 @@ h_wctomb(const struct test *t, char tc) size_t sz, ret, i; ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C"); -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL); #else if (setlocale(LC_CTYPE, t->locale) == NULL) { Modified: head/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c Mon Nov 17 13:39:00 2014 (r274626) @@ -46,14 +46,14 @@ __RCSID("$NetBSD: t_ether_aton.c,v 1.1 2 #include #include -#if !defined(__NetBSD__) -#if defined(__linux__) +#ifndef __NetBSD__ +#ifdef __linux__ #include #endif #include #endif -#if defined(__NetBSD__) +#ifdef __NetBSD__ #define ETHER_ADDR_LEN 6 int ether_aton_r(u_char *dest, size_t len, const char *str); @@ -65,7 +65,7 @@ static const struct { int error; } tests[] = { { { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab }, "01:23:45:67:89:ab", 0 }, -#if defined(__NetBSD__) +#ifdef __NetBSD__ { { 0x00, 0x01, 0x22, 0x03, 0x14, 0x05 }, "0:1:22-3:14:05", 0 }, { { 0x00, 0x01, 0x22, 0x03, 0x14, 0x05 }, "000122031405", 0 }, { { 0x0a, 0x0B, 0xcc, 0xdD, 0xEE, 0x0f }, "0a0BccdDEE0f", 0 }, @@ -86,13 +86,13 @@ ATF_TC_HEAD(tc_ether_aton, tc) ATF_TC_BODY(tc_ether_aton, tc) { -#if defined(__NetBSD__) +#ifdef __NetBSD__ u_char dest[ETHER_ADDR_LEN]; #else struct ether_addr dest; #endif size_t t; -#if defined(__NetBSD__) +#ifdef __NetBSD__ int e, r; #else int e; @@ -103,7 +103,7 @@ ATF_TC_BODY(tc_ether_aton, tc) for (t = 0; tests[t].str; t++) { s = tests[t].str; if ((e = tests[t].error) == 0) { -#if defined(__NetBSD__) +#ifdef __NetBSD__ if (ether_aton_r(dest, sizeof(dest), s) != e) atf_tc_fail("failed on `%s'", s); if (memcmp(dest, tests[t].res, sizeof(dest)) != 0) @@ -115,7 +115,7 @@ ATF_TC_BODY(tc_ether_aton, tc) atf_tc_fail("unexpected result on `%s'", s); #endif } else { -#if defined(__NetBSD__) +#ifdef __NetBSD__ if ((r = ether_aton_r(dest, sizeof(dest), s)) != e) atf_tc_fail("unexpectedly succeeded on `%s' " "(%d != %d)", s, r, e); Modified: head/contrib/netbsd-tests/lib/libc/regex/debug.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/regex/debug.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/regex/debug.c Mon Nov 17 13:39:00 2014 (r274626) @@ -34,7 +34,7 @@ #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #include #endif @@ -54,7 +54,7 @@ static char *regchar(int); void regprint(regex_t *r, FILE *d) { -#if defined(__NetBSD__) +#ifdef __NetBSD__ struct re_guts *g = r->re_g; int c; int last; @@ -177,7 +177,7 @@ s_print(struct re_guts *g, FILE *d) break; case OANYOF: fprintf(d, "[(%ld)", (long)opnd); -#if defined(__NetBSD__) +#ifdef __NetBSD__ cs = &g->sets[opnd]; last = -1; for (size_t i = 0; i < g->csetsize+1; i++) /* +1 flushes */ @@ -250,7 +250,7 @@ s_print(struct re_guts *g, FILE *d) fprintf(d, ">"); break; default: -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ fprintf(d, "!%ld(%ld)!", OP(*s), opnd); #else fprintf(d, "!%d(%d)!", OP(*s), opnd); Modified: head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Mon Nov 17 13:39:00 2014 (r274626) @@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_exhaust.c,v 1.7 2011 #include #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif @@ -179,7 +179,7 @@ ATF_TC_HEAD(regcomp_too_big, tc) " crash, but return a proper error code"); // libtre needs it. atf_tc_set_md_var(tc, "timeout", "600"); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_set_md_var(tc, "require.memory", "64M"); #else atf_tc_set_md_var(tc, "require.memory", "120M"); @@ -189,12 +189,12 @@ ATF_TC_HEAD(regcomp_too_big, tc) ATF_TC_BODY(regcomp_too_big, tc) { regex_t re; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ struct rlimit limit; #endif int e; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ limit.rlim_cur = limit.rlim_max = 64 * 1024 * 1024; ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1); #endif Modified: head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Mon Nov 17 13:39:00 2014 (r274626) @@ -48,7 +48,7 @@ __RCSID("$NetBSD: t_regex_att.c,v 1.1 20 #include #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif @@ -377,7 +377,7 @@ checkmatches(const char *matches, size_t " cur=%d, max=%zu", res, l, len - off); off += l; } -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ ATF_CHECK_STREQ_MSG(res, matches, " at line %zu", lineno); #else ATF_REQUIRE_STREQ_MSG(res, matches, " at line %zu", lineno); @@ -580,7 +580,7 @@ ATF_TC_BODY(leftassoc, tc) * any explation. Mark as broken here, but I don't know why. */ atf_tc_expect_fail("Reason for breakage unknown"); #endif -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_expect_fail("The expected and matched groups are mismatched on FreeBSD"); #endif att_test(tc, "leftassoc"); Modified: head/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c Mon Nov 17 13:39:00 2014 (r274626) @@ -42,7 +42,7 @@ __RCSID("$NetBSD: h_atexit.c,v 1.1 2011/ extern int __cxa_atexit(void (*func)(void *), void *, void *); extern void __cxa_finalize(void *); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ /* * On shared object unload, in __cxa_finalize, call and clear all installed * atexit and __cxa_atexit handlers that are either installed by unloaded @@ -191,7 +191,7 @@ main(int argc, char *argv[]) ASSERT(0 == atexit(normal_handler_0)); ASSERT(0 == atexit(normal_handler_1)); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ ASSERT(0 == __cxa_atexit(cxa_handler_4, &arg_1, dso_handle_1)); ASSERT(0 == __cxa_atexit(cxa_handler_5, &arg_1, dso_handle_1)); ASSERT(0 == __cxa_atexit(cxa_handler_3, &arg_2, dso_handle_2)); Modified: head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c Mon Nov 17 13:39:00 2014 (r274626) @@ -34,7 +34,7 @@ #include #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c Mon Nov 17 13:39:00 2014 (r274626) @@ -36,7 +36,7 @@ #include #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c Mon Nov 17 13:39:00 2014 (r274626) @@ -40,7 +40,7 @@ __RCSID("$NetBSD: t_getenv.c,v 1.2 2011/ #include #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif @@ -155,7 +155,7 @@ ATF_TC_BODY(setenv_basic, tc) ATF_CHECK_ERRNO(EINVAL, setenv(NULL, "val", 1) == -1); ATF_CHECK_ERRNO(EINVAL, setenv("", "val", 1) == -1); ATF_CHECK_ERRNO(EINVAL, setenv("v=r", "val", 1) == -1); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ /* Both FreeBSD and OS/X does not validate the second argument to setenv(3) Modified: head/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c Mon Nov 17 13:39:00 2014 (r274626) @@ -75,7 +75,7 @@ __RCSID("$NetBSD: t_hsearch.c,v 1.4 2014 #define REQUIRE_ERRNO(x) ATF_REQUIRE_MSG(x, "%s", strerror(errno)) -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_TC(hsearch_basic); ATF_TC_HEAD(hsearch_basic, tc) { @@ -231,7 +231,7 @@ ATF_TC_BODY(hsearch_two, tc) hdestroy(); } -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_TC(hsearch_r_basic); ATF_TC_HEAD(hsearch_r_basic, tc) { @@ -389,14 +389,14 @@ ATF_TC_BODY(hsearch_r_two, tc) ATF_TP_ADD_TCS(tp) { -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, hsearch_basic); #endif ATF_TP_ADD_TC(tp, hsearch_duplicate); ATF_TP_ADD_TC(tp, hsearch_nonexistent); ATF_TP_ADD_TC(tp, hsearch_two); -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, hsearch_r_basic); #endif ATF_TP_ADD_TC(tp, hsearch_r_duplicate); Modified: head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Mon Nov 17 13:39:00 2014 (r274626) @@ -51,7 +51,7 @@ unsigned char *start[BLOCKTYPES] = { }; char result[100]; -#if defined(__NetBSD__) +#ifdef __NetBSD__ const char goodResult[] = "7b405d24bc03195474c70ddae9e1f8fb"; #else const char goodResult[] = "217b4fbe456916bf62a2f85df752e4ab"; @@ -93,7 +93,7 @@ ATF_TC_BODY(memcpy_basic, tc) start[2] = auto1; start[3] = auto2; -#if defined(__NetBSD__) +#ifdef __NetBSD__ srandom(0L); #else /* Modified: head/contrib/netbsd-tests/lib/libc/string/t_strerror.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/string/t_strerror.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/string/t_strerror.c Mon Nov 17 13:39:00 2014 (r274626) @@ -37,7 +37,7 @@ __RCSID("$NetBSD: t_strerror.c,v 1.3 201 #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/sys/t_access.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_access.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_access.c Mon Nov 17 13:39:00 2014 (r274626) @@ -40,7 +40,7 @@ __RCSID("$NetBSD: t_access.c,v 1.1 2011/ #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c Mon Nov 17 13:39:00 2014 (r274626) @@ -63,7 +63,7 @@ __RCSID("$NetBSD: t_clock_gettime.c,v 1. #include #include -#if defined(__NetBSD__) +#ifdef __NetBSD__ #include #endif @@ -75,7 +75,7 @@ __RCSID("$NetBSD: t_clock_gettime.c,v 1. #include #include -#if defined(__NetBSD__) +#ifdef __NetBSD__ #include "../../../h_macros.h" #else #include Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c Mon Nov 17 13:39:00 2014 (r274626) @@ -57,7 +57,7 @@ ATF_TC_BODY(getgroups_err, tc) errno = 0; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_expect_fail("Reported as kern/189941"); #endif ATF_REQUIRE(getgroups(-1, gidset) == -1); Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c Mon Nov 17 13:39:00 2014 (r274626) @@ -47,7 +47,7 @@ static void sighandler(int); static const size_t maxiter = 2000; static void -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ sighandler(int signo __unused) #else sighandler(int signo) Modified: head/contrib/netbsd-tests/lib/libc/sys/t_kevent.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_kevent.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_kevent.c Mon Nov 17 13:39:00 2014 (r274626) @@ -149,11 +149,11 @@ ATF_TC_BODY(kqueue_desc_passing, tc) printf("parent (pid %d): sending kq fd %d\n", getpid(), kq); if (sendmsg(s[0], &m, 0) == -1) { -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_REQUIRE_EQ_MSG(errno, EBADF, "errno is %d", errno); atf_tc_skip("PR kern/46523"); #endif -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ ATF_REQUIRE_EQ_MSG(errno, EOPNOTSUPP, "errno is %d", errno); close(s[0]); #endif Modified: head/contrib/netbsd-tests/lib/libc/sys/t_listen.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_listen.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_listen.c Mon Nov 17 13:39:00 2014 (r274626) @@ -36,7 +36,7 @@ #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c Mon Nov 17 13:39:00 2014 (r274626) @@ -47,7 +47,7 @@ __RCSID("$NetBSD: t_msgrcv.c,v 1.3 2013/ #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Mon Nov 17 13:39:00 2014 (r274626) @@ -47,7 +47,7 @@ __RCSID("$NetBSD: t_msgsnd.c,v 1.2 2011/ #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c Mon Nov 17 13:39:00 2014 (r274626) @@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_nanosleep.c,v 1.3 20 #include static void -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ handler(int signo __unused) #else handler(int signo) Modified: head/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c Mon Nov 17 13:39:00 2014 (r274626) @@ -53,7 +53,7 @@ run(int flags) while ((i = open("/", O_RDONLY)) < 3) ATF_REQUIRE(i != -1); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ closefrom(3); #else ATF_REQUIRE(fcntl(3, F_CLOSEM) != -1); @@ -80,7 +80,7 @@ run(int flags) ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) == 0); } -#if !defined(__FreeBSD__) +#ifndef __FreeBSD__ if (flags & O_NOSIGPIPE) { ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) != 0); ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) != 0); @@ -116,7 +116,7 @@ ATF_TC_BODY(pipe2_consume, tc) { struct rlimit rl; int err, filedes[2]; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ int old; closefrom(4); @@ -132,7 +132,7 @@ ATF_TC_BODY(pipe2_consume, tc) * file descriptor limit in the middle of a pipe2() call - i.e. * before the call only a single descriptor may be openend. */ -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ old = rl.rlim_cur; #endif rl.rlim_cur = 4; @@ -141,7 +141,7 @@ ATF_TC_BODY(pipe2_consume, tc) err = pipe2(filedes, O_CLOEXEC); ATF_REQUIRE(err == -1); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ rl.rlim_cur = old; err = setrlimit(RLIMIT_NOFILE, &rl); #endif @@ -169,7 +169,7 @@ ATF_TC_BODY(pipe2_cloexec, tc) run(O_CLOEXEC); } -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_TC(pipe2_nosigpipe); ATF_TC_HEAD(pipe2_nosigpipe, tc) { @@ -201,7 +201,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, pipe2_consume); ATF_TP_ADD_TC(tp, pipe2_nonblock); ATF_TP_ADD_TC(tp, pipe2_cloexec); -#if defined(__NetBSD__) +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, pipe2_nosigpipe); #endif ATF_TP_ADD_TC(tp, pipe2_einval); Modified: head/contrib/netbsd-tests/lib/libc/sys/t_poll.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_poll.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_poll.c Mon Nov 17 13:39:00 2014 (r274626) @@ -233,7 +233,7 @@ ATF_TC_BODY(poll_err, tc) ATF_REQUIRE_ERRNO(EINVAL, poll(&pfd, 1, -2) == -1); } -#if !defined(__FreeBSD__) +#ifndef __FreeBSD__ ATF_TC(pollts_basic); ATF_TC_HEAD(pollts_basic, tc) { @@ -386,7 +386,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, poll_3way); ATF_TP_ADD_TC(tp, poll_basic); ATF_TP_ADD_TC(tp, poll_err); -#if !defined(__FreeBSD__) +#ifndef __FreeBSD__ ATF_TP_ADD_TC(tp, pollts_basic); ATF_TP_ADD_TC(tp, pollts_err); ATF_TP_ADD_TC(tp, pollts_sigmask); Modified: head/contrib/netbsd-tests/lib/libc/sys/t_revoke.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_revoke.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_revoke.c Mon Nov 17 13:39:00 2014 (r274626) @@ -58,7 +58,7 @@ ATF_TC_BODY(revoke_basic, tc) size_t i, n; int *buf; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_skip("revoke(2) is only implemented for devfs(5)."); #endif (void)memset(&res, 0, sizeof(struct rlimit)); @@ -116,7 +116,7 @@ ATF_TC_BODY(revoke_err, tc) errno = 0; ATF_REQUIRE_ERRNO(ENAMETOOLONG, revoke(buf) == -1); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_skip("revoke(2) is only implemented for devfs(5)."); #endif errno = 0; @@ -139,7 +139,7 @@ ATF_TC_BODY(revoke_perm, tc) int fd, sta; pid_t pid; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_skip("revoke(2) is only implemented for devfs(5)."); #endif pw = getpwnam("nobody"); Modified: head/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c Mon Nov 17 13:39:00 2014 (r274626) @@ -46,7 +46,7 @@ static void handler(int, siginfo_t *, vo static int value; static void -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ handler(int signo __unused, siginfo_t *info __unused, void *data __unused) #else handler(int signo, siginfo_t *info, void *data) @@ -76,7 +76,7 @@ ATF_TC_BODY(sigqueue_basic, tc) sv.sival_int = VALUE; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ /* * From kern_sig.c: * Specification says sigqueue can only send signal to single process. Modified: head/contrib/netbsd-tests/lib/libc/sys/t_stat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_stat.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_stat.c Mon Nov 17 13:39:00 2014 (r274626) @@ -47,7 +47,7 @@ __RCSID("$NetBSD: t_stat.c,v 1.4 2012/03 #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c Mon Nov 17 13:39:00 2014 (r274626) @@ -38,7 +38,7 @@ static timer_t t; static bool fail = true; static void -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ timer_signal_handler(int signo, siginfo_t *si, void *osi __unused) #else timer_signal_handler(int signo, siginfo_t *si, void *osi) Modified: head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_unlink.c Mon Nov 17 13:39:00 2014 (r274626) @@ -85,7 +85,7 @@ ATF_TC_BODY(unlink_err, tc) (void)memset(buf, 'x', sizeof(buf)); errno = 0; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ ATF_REQUIRE_ERRNO(EISDIR, unlink("/") == -1); #else ATF_REQUIRE_ERRNO(EBUSY, unlink("/") == -1); Modified: head/contrib/netbsd-tests/lib/libc/sys/t_write.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_write.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/sys/t_write.c Mon Nov 17 13:39:00 2014 (r274626) @@ -32,7 +32,7 @@ __COPYRIGHT("@(#) Copyright (c) 2008\ __RCSID("$NetBSD: t_write.c,v 1.2 2011/10/19 16:19:30 jruoho Exp $"); #include -#if defined(__NetBSD__) +#ifdef __NetBSD__ #include #endif @@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_write.c,v 1.2 2011/1 #include #include -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ #include #endif @@ -55,7 +55,7 @@ static bool fail = false; static const char *path = "write"; static void -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ sighandler(int signo __unused) #else sighandler(int signo) Modified: head/contrib/netbsd-tests/lib/libc/time/t_strptime.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/time/t_strptime.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/time/t_strptime.c Mon Nov 17 13:39:00 2014 (r274626) @@ -49,7 +49,7 @@ h_pass(const char *buf, const char *fmt, exp = buf + len; ret = strptime(buf, fmt, &tm); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ ATF_CHECK_MSG(ret == exp, "strptime(\"%s\", \"%s\", tm): incorrect return code: " "expected: %p, got: %p", buf, fmt, exp, ret); @@ -88,7 +88,7 @@ h_fail(const char *buf, const char *fmt) { struct tm tm = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL }; -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ ATF_CHECK_MSG(strptime(buf, fmt, &tm) == NULL, "strptime(\"%s\", " "\"%s\", &tm) should fail, but it didn't", buf, fmt); #else @@ -108,7 +108,7 @@ ATF_TC_HEAD(common, tc) ATF_TC_BODY(common, tc) { -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_expect_fail("There are various issues with strptime on FreeBSD"); #endif @@ -189,13 +189,13 @@ ATF_TC_BODY(day, tc) h_pass("mon", "%a", 3, -1, -1, -1, -1, -1, -1, 1, -1); h_pass("tueSDay", "%A", 7, -1, -1, -1, -1, -1, -1, 2, -1); h_pass("sunday", "%A", 6, -1, -1, -1, -1, -1, -1, 0, -1); -#if defined(__NetBSD__) +#ifdef __NetBSD__ h_fail("sunday", "%EA"); #else h_pass("Sunday", "%EA", 6, -1, -1, -1, -1, -1, -1, 0, -1); #endif h_pass("SaturDay", "%A", 8, -1, -1, -1, -1, -1, -1, 6, -1); -#if defined(__NetBSD__) +#ifdef __NetBSD__ h_fail("SaturDay", "%OA"); #else h_pass("SaturDay", "%OA", 8, -1, -1, -1, -1, -1, -1, 6, -1); Modified: head/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c Mon Nov 17 13:39:00 2014 (r274626) @@ -36,7 +36,7 @@ __RCSID("$NetBSD: h_tls_dlopen.c,v 1.5 2 #include #include -#if defined(__NetBSD__) +#ifdef __NetBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c Mon Nov 17 13:39:00 2014 (r274626) @@ -39,7 +39,7 @@ __RCSID("$NetBSD: t_tls_dlopen.c,v 1.3 2 #include #include -#if defined(__NetBSD__) +#ifdef __NetBSD__ #include #endif Modified: head/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c Mon Nov 17 13:30:18 2014 (r274625) +++ head/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c Mon Nov 17 13:39:00 2014 (r274626) @@ -38,7 +38,7 @@ __RCSID("$NetBSD: t_tls_dynamic.c,v 1.3 #include #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 14:16:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4F31B20; Mon, 17 Nov 2014 14:16:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D11EAB5E; Mon, 17 Nov 2014 14:16:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHEG2Tc082723; Mon, 17 Nov 2014 14:16:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHEG2af082722; Mon, 17 Nov 2014 14:16:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201411171416.sAHEG2af082722@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 17 Nov 2014 14:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274627 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 14:16:03 -0000 Author: avg Date: Mon Nov 17 14:16:02 2014 New Revision: 274627 URL: https://svnweb.freebsd.org/changeset/base/274627 Log: Revert r269093 which introduced physical zio alignment transform Size of physical ZIOs must never be implicitly adjusted, it's a responsibility of a caller to make sure that such a ZIO has proper offset and size. Discussed with: delphij, gibbs MFC after: 2 weeks 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 Mon Nov 17 13:39:00 2014 (r274626) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Nov 17 14:16:02 2014 (r274627) @@ -2619,8 +2619,7 @@ zio_vdev_io_start(zio_t *zio) align = 1ULL << vd->vdev_top->vdev_ashift; - if ((!(zio->io_flags & ZIO_FLAG_PHYSICAL) || - (vd->vdev_top->vdev_physical_ashift > SPA_MINBLOCKSHIFT)) && + if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) && P2PHASE(zio->io_size, align) != 0) { /* Transform logical writes to be a full physical block size. */ uint64_t asize = P2ROUNDUP(zio->io_size, align); From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 14:45:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27EF56EF; Mon, 17 Nov 2014 14:45:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA1CBE79; Mon, 17 Nov 2014 14:45:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHEjgIg096938; Mon, 17 Nov 2014 14:45:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHEjgbE096937; Mon, 17 Nov 2014 14:45:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201411171445.sAHEjgbE096937@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 17 Nov 2014 14:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274628 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 14:45:43 -0000 Author: avg Date: Mon Nov 17 14:45:42 2014 New Revision: 274628 URL: https://svnweb.freebsd.org/changeset/base/274628 Log: l2arc: restore correct rounding up of asize of compressed data This rounding up was lost in a mismerge of illumos code. See r268075 MFV r267565. After that commit zio_compress_data() no longer performs any compressed size adjustment, so it needs to be done externally. On FreeBSD we round up the size using vdev_ashift rather than SPA_MINBLOCKSIZE so that 4KB devices are properly supported. Additionally, zero out the buffer tail only if compression succeeds. The compression is considered successful if the size of compressed data after rounding up to account for the vdev ashift is less than the original data size. It does not make sense to have the data compressed if all the savings are lost to rounding up. With the new zio_compress_data() it could have been possible that the rounded compressed size would be greater than the original size and thus we could zero beyond the allocated buffer if the zeroing code was kept at the original place. Discussed with: delphij, gibbs MFC after: 2 weeks X-MFC with: r274627 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 14:16:02 2014 (r274627) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 14:45:42 2014 (r274628) @@ -5326,12 +5326,6 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, cdata, l2hdr->b_asize); - rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE); - if (rounded > csize) { - bzero((char *)cdata + csize, rounded - csize); - csize = rounded; - } - if (csize == 0) { /* zero block, indicate that there's nothing to write */ zio_data_buf_free(cdata, len); @@ -5340,11 +5334,19 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd l2hdr->b_tmp_cdata = NULL; ARCSTAT_BUMP(arcstat_l2_compress_zeros); return (B_TRUE); - } else if (csize > 0 && csize < len) { + } + + rounded = P2ROUNDUP(csize, + (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); + if (rounded < len) { /* * Compression succeeded, we'll keep the cdata around for * writing and release it afterwards. */ + if (rounded > csize) { + bzero((char *)cdata + csize, rounded - csize); + csize = rounded; + } l2hdr->b_compress = ZIO_COMPRESS_LZ4; l2hdr->b_asize = csize; l2hdr->b_tmp_cdata = cdata; From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 14:56:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49422CC3; Mon, 17 Nov 2014 14:56:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 356BDFA7; Mon, 17 Nov 2014 14:56:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHEu3P6001749; Mon, 17 Nov 2014 14:56:03 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHEu3VB001748; Mon, 17 Nov 2014 14:56:03 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201411171456.sAHEu3VB001748@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Mon, 17 Nov 2014 14:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274629 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 14:56:03 -0000 Author: jch Date: Mon Nov 17 14:56:02 2014 New Revision: 274629 URL: https://svnweb.freebsd.org/changeset/base/274629 Log: Re-introduce padding fields removed with r264321 to keep struct tcptw ABI unchanged. Suggested by: jhb Approved by: jhb (mentor) MFC after: 1 day X-MFC-With: r264321 Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Nov 17 14:45:42 2014 (r274628) +++ head/sys/netinet/tcp_var.h Mon Nov 17 14:56:02 2014 (r274629) @@ -357,6 +357,8 @@ struct tcptw { u_int t_starttime; int tw_time; TAILQ_ENTRY(tcptw) tw_2msl; + void *tw_pspare; /* TCP_SIGNATURE */ + u_int *tw_spare; /* TCP_SIGNATURE */ }; #define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb) From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 15:06:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D3C818F for ; Mon, 17 Nov 2014 15:06:08 +0000 (UTC) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A143F11C for ; Mon, 17 Nov 2014 15:06:07 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id l15so9409819wiw.10 for ; Mon, 17 Nov 2014 07:06:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=GnDdf2rdIYTJfRloTzkXi8DOKW6+Rs9Dws66OIpSct8=; b=ibUJVjm9CP1INXblZUOYwf02CqFI5kSDsjegmpC5dxL+I6Sol7gxRo+71GYvVBrW9m ER4i3O4i/KJedM1Ykw3FoIOpA2UalmZisFAIK4gLRmP52NjbfsloqHCDoMbwmRbliWqA XzNbeQ81cvLa6pIt2aJbuC4mE0dJKOMkr/PHv6ZSGfZ1jYJnUZG2mz5fgyTmzzX4UT2k XtAhoONiCXR/xXZXI8UGgk8W/uNncJtqDEaTi9XP32hqsnKv3b3w/omU9/we9YkGasek 8WMxKv8KTMFhu7YtTrzTH5noEZ8176DzSLBFCs/IrXqN2T+WoAnCYQKe47itTDqpOjZM Y6Fg== X-Gm-Message-State: ALoCoQn8yFy3k2xNrzfvEzwH5k3s/PeX4CFYxiBs3Iab/10BmoywPpEvCwjS3jJDTtoxbieOOLEs X-Received: by 10.194.87.34 with SMTP id u2mr34942205wjz.42.1416236765132; Mon, 17 Nov 2014 07:06:05 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id s2sm15629437wia.3.2014.11.17.07.05.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Nov 2014 07:05:56 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <546A0ED8.6020104@freebsd.org> Date: Mon, 17 Nov 2014 15:06:00 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274628 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201411171445.sAHEjgbE096937@svn.freebsd.org> In-Reply-To: <201411171445.sAHEjgbE096937@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 15:06:08 -0000 Looks like this could have introduced random data corruption, have you seen this in practice? On 17/11/2014 14:45, Andriy Gapon wrote: > Author: avg > Date: Mon Nov 17 14:45:42 2014 > New Revision: 274628 > URL: https://svnweb.freebsd.org/changeset/base/274628 > > Log: > l2arc: restore correct rounding up of asize of compressed data > > This rounding up was lost in a mismerge of illumos code. > See r268075 MFV r267565. > After that commit zio_compress_data() no longer performs any compressed > size adjustment, so it needs to be done externally. On FreeBSD we round > up the size using vdev_ashift rather than SPA_MINBLOCKSIZE so that 4KB > devices are properly supported. > > Additionally, zero out the buffer tail only if compression succeeds. > The compression is considered successful if the size of compressed > data after rounding up to account for the vdev ashift is less than the > original data size. It does not make sense to have the data compressed > if all the savings are lost to rounding up. > With the new zio_compress_data() it could have been possible that the > rounded compressed size would be greater than the original size and thus > we could zero beyond the allocated buffer if the zeroing code was kept > at the original place. > > Discussed with: delphij, gibbs > MFC after: 2 weeks > X-MFC with: r274627 > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 14:16:02 2014 (r274627) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 14:45:42 2014 (r274628) > @@ -5326,12 +5326,6 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd > csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, > cdata, l2hdr->b_asize); > > - rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE); > - if (rounded > csize) { > - bzero((char *)cdata + csize, rounded - csize); > - csize = rounded; > - } > - > if (csize == 0) { > /* zero block, indicate that there's nothing to write */ > zio_data_buf_free(cdata, len); > @@ -5340,11 +5334,19 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd > l2hdr->b_tmp_cdata = NULL; > ARCSTAT_BUMP(arcstat_l2_compress_zeros); > return (B_TRUE); > - } else if (csize > 0 && csize < len) { > + } > + > + rounded = P2ROUNDUP(csize, > + (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); > + if (rounded < len) { > /* > * Compression succeeded, we'll keep the cdata around for > * writing and release it afterwards. > */ > + if (rounded > csize) { > + bzero((char *)cdata + csize, rounded - csize); > + csize = rounded; > + } > l2hdr->b_compress = ZIO_COMPRESS_LZ4; > l2hdr->b_asize = csize; > l2hdr->b_tmp_cdata = cdata; > From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 15:08:11 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 380742A9; Mon, 17 Nov 2014 15:08:11 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0724413A; Mon, 17 Nov 2014 15:08:09 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA10576; Mon, 17 Nov 2014 17:10:00 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XqNuQ-0001wZ-Nb; Mon, 17 Nov 2014 17:08:06 +0200 Message-ID: <546A0F1E.5050305@FreeBSD.org> Date: Mon, 17 Nov 2014 17:07:10 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Steven Hartland , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r274628 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201411171445.sAHEjgbE096937@svn.freebsd.org> <546A0ED8.6020104@freebsd.org> In-Reply-To: <546A0ED8.6020104@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 15:08:11 -0000 On 17/11/2014 17:06, Steven Hartland wrote: > Looks like this could have introduced random data corruption, have you seen this > in practice? Which part exactly? > On 17/11/2014 14:45, Andriy Gapon wrote: >> Author: avg >> Date: Mon Nov 17 14:45:42 2014 >> New Revision: 274628 >> URL: https://svnweb.freebsd.org/changeset/base/274628 >> >> Log: >> l2arc: restore correct rounding up of asize of compressed data >> This rounding up was lost in a mismerge of illumos code. >> See r268075 MFV r267565. >> After that commit zio_compress_data() no longer performs any compressed >> size adjustment, so it needs to be done externally. On FreeBSD we round >> up the size using vdev_ashift rather than SPA_MINBLOCKSIZE so that 4KB >> devices are properly supported. >> Additionally, zero out the buffer tail only if compression succeeds. >> The compression is considered successful if the size of compressed >> data after rounding up to account for the vdev ashift is less than the >> original data size. It does not make sense to have the data compressed >> if all the savings are lost to rounding up. >> With the new zio_compress_data() it could have been possible that the >> rounded compressed size would be greater than the original size and thus >> we could zero beyond the allocated buffer if the zeroing code was kept >> at the original place. >> Discussed with: delphij, gibbs >> MFC after: 2 weeks >> X-MFC with: r274627 >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 >> 14:16:02 2014 (r274627) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 >> 14:45:42 2014 (r274628) >> @@ -5326,12 +5326,6 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd >> csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, >> cdata, l2hdr->b_asize); >> - rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE); >> - if (rounded > csize) { >> - bzero((char *)cdata + csize, rounded - csize); >> - csize = rounded; >> - } >> - >> if (csize == 0) { >> /* zero block, indicate that there's nothing to write */ >> zio_data_buf_free(cdata, len); >> @@ -5340,11 +5334,19 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd >> l2hdr->b_tmp_cdata = NULL; >> ARCSTAT_BUMP(arcstat_l2_compress_zeros); >> return (B_TRUE); >> - } else if (csize > 0 && csize < len) { >> + } >> + >> + rounded = P2ROUNDUP(csize, >> + (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); >> + if (rounded < len) { >> /* >> * Compression succeeded, we'll keep the cdata around for >> * writing and release it afterwards. >> */ >> + if (rounded > csize) { >> + bzero((char *)cdata + csize, rounded - csize); >> + csize = rounded; >> + } >> l2hdr->b_compress = ZIO_COMPRESS_LZ4; >> l2hdr->b_asize = csize; >> l2hdr->b_tmp_cdata = cdata; >> > -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 15:12:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE9C84B5; Mon, 17 Nov 2014 15:12:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAFF1217; Mon, 17 Nov 2014 15:12:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHFClFb011003; Mon, 17 Nov 2014 15:12:47 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHFClg9011002; Mon, 17 Nov 2014 15:12:47 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201411171512.sAHFClg9011002@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Mon, 17 Nov 2014 15:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274630 - head/usr.sbin/freebsd-update X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 15:12:47 -0000 Author: feld (ports committer) Date: Mon Nov 17 15:12:46 2014 New Revision: 274630 URL: https://svnweb.freebsd.org/changeset/base/274630 Log: Add logic for detecting non-persistent filesystems being utilized by workdir which would break the upgrade process upon reboot. Currently we check for tmpfs and mdmfs. PR: 195006 Differential Revision: https://reviews.freebsd.org/D1163 Approved by: cperciva Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Nov 17 14:56:02 2014 (r274629) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Nov 17 15:12:46 2014 (r274630) @@ -580,6 +580,7 @@ fetchupgrade_check_params () { _KEYPRINT_z="Key must be given via -k option or configuration file." _KEYPRINT_bad="Invalid key fingerprint: " _WORKDIR_bad="Directory does not exist or is not writable: " + _WORKDIR_bad2="Directory is not on a persistent filesystem: " if [ -z "${SERVERNAME}" ]; then echo -n "`basename $0`: " @@ -603,6 +604,14 @@ fetchupgrade_check_params () { echo ${WORKDIR} exit 1 fi + for i in tmpfs mdmfs; do + if df -t ${i} ${WORKDIR} >/dev/null 2>1; then + echo -n "`basename $0`: " + echo -n "${_WORKDIR_bad2}" + echo ${WORKDIR} + exit 1 + fi + done chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 15:19:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 566E28D1; Mon, 17 Nov 2014 15:19:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4300F274; Mon, 17 Nov 2014 15:19:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHFJwCZ011912; Mon, 17 Nov 2014 15:19:58 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHFJwQx011911; Mon, 17 Nov 2014 15:19:58 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201411171519.sAHFJwQx011911@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Mon, 17 Nov 2014 15:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274631 - head/sbin/geom/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 15:19:58 -0000 Author: feld (ports committer) Date: Mon Nov 17 15:19:57 2014 New Revision: 274631 URL: https://svnweb.freebsd.org/changeset/base/274631 Log: Fix geom's "usage" generation to not fabricate usage/help output for any imaginary class we give it. Differential Revision: https://reviews.freebsd.org/D1150 Submitted by: homerj Approved by: pjd Modified: head/sbin/geom/core/geom.c Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Mon Nov 17 15:12:46 2014 (r274630) +++ head/sbin/geom/core/geom.c Mon Nov 17 15:19:57 2014 (r274631) @@ -640,6 +640,11 @@ get_class(int *argc, char ***argv) #endif /* !STATIC_GEOM_CLASSES */ set_class_name(); + + /* If we can't load or list, it's not a class. */ + if (!std_available("load") && !std_available("list")) + errx(EXIT_FAILURE, "Invalid class name."); + if (*argc < 1) usage(); } From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 15:27:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78678F72; Mon, 17 Nov 2014 15:27:50 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F22053BB; Mon, 17 Nov 2014 15:27:48 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sAHFReBC030154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Nov 2014 18:27:40 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sAHFReRV030153; Mon, 17 Nov 2014 18:27:40 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 17 Nov 2014 18:27:40 +0300 From: Gleb Smirnoff To: "Alexander V. Chernikov" Subject: Re: svn commit: r274585 - head/sys/net Message-ID: <20141117152740.GP1031@FreeBSD.org> References: <201411161456.sAGEuWVj029737@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411161456.sAGEuWVj029737@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 15:27:50 -0000 On Sun, Nov 16, 2014 at 02:56:32PM +0000, Alexander V. Chernikov wrote: A> Author: melifaro A> Date: Sun Nov 16 14:56:31 2014 A> New Revision: 274585 A> URL: https://svnweb.freebsd.org/changeset/base/274585 A> A> Log: A> Make witness happy: destroy rte lock before free. A> MFC after: 2 weeks A> Modified: A> head/sys/net/route.c A> A> Modified: head/sys/net/route.c A> ============================================================================== A> --- head/sys/net/route.c Sun Nov 16 13:57:53 2014 (r274584) A> +++ head/sys/net/route.c Sun Nov 16 14:56:31 2014 (r274585) A> @@ -517,6 +517,7 @@ rtfree(struct rtentry *rt) A> /* A> * and the rtentry itself of course A> */ A> + RT_LOCK_DESTROY(rt); A> uma_zfree(V_rtzone, rt); A> return; A> } This is not right fix. The lock will be destroyed second time by rtentry_zfini(). Can you please point me at revision that introduced the problem, you are trying to solve? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 15:28:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89BD5147; Mon, 17 Nov 2014 15:28:27 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2C23D1; Mon, 17 Nov 2014 15:28:26 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sAHFSOcJ030169 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Nov 2014 18:28:24 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sAHFSOvt030168; Mon, 17 Nov 2014 18:28:24 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 17 Nov 2014 18:28:24 +0300 From: Gleb Smirnoff To: "Alexander V. Chernikov" Subject: Re: svn commit: r274585 - head/sys/net Message-ID: <20141117152824.GQ1031@FreeBSD.org> References: <201411161456.sAGEuWVj029737@svn.freebsd.org> <20141117152740.GP1031@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141117152740.GP1031@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 15:28:27 -0000 On Mon, Nov 17, 2014 at 06:27:40PM +0300, Gleb Smirnoff wrote: T> On Sun, Nov 16, 2014 at 02:56:32PM +0000, Alexander V. Chernikov wrote: T> A> Author: melifaro T> A> Date: Sun Nov 16 14:56:31 2014 T> A> New Revision: 274585 T> A> URL: https://svnweb.freebsd.org/changeset/base/274585 T> A> T> A> Log: T> A> Make witness happy: destroy rte lock before free. T> A> MFC after: 2 weeks T> A> Modified: T> A> head/sys/net/route.c T> A> T> A> Modified: head/sys/net/route.c T> A> ============================================================================== T> A> --- head/sys/net/route.c Sun Nov 16 13:57:53 2014 (r274584) T> A> +++ head/sys/net/route.c Sun Nov 16 14:56:31 2014 (r274585) T> A> @@ -517,6 +517,7 @@ rtfree(struct rtentry *rt) T> A> /* T> A> * and the rtentry itself of course T> A> */ T> A> + RT_LOCK_DESTROY(rt); T> A> uma_zfree(V_rtzone, rt); T> A> return; T> A> } T> T> This is not right fix. The lock will be destroyed second time by rtentry_zfini(). T> T> Can you please point me at revision that introduced the problem, you are T> trying to solve? Please ignore me. :) A lag between our yesterday IRC discussion and email. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 15:28:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D7CE14A; Mon, 17 Nov 2014 15:28:29 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C7ED23D3; Mon, 17 Nov 2014 15:28:28 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 8B49525D3AA1; Mon, 17 Nov 2014 15:28:25 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id B42ECC77070; Mon, 17 Nov 2014 15:28:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id O_IdHv8FYch0; Mon, 17 Nov 2014 15:28:23 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 02DDBC77042; Mon, 17 Nov 2014 15:28:21 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274629 - head/sys/netinet From: "Bjoern A. Zeeb" In-Reply-To: <201411171456.sAHEu3VB001748@svn.freebsd.org> Date: Mon, 17 Nov 2014 15:28:20 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <7C2663DD-CCA3-4C76-977C-35EFD11838C6@FreeBSD.org> References: <201411171456.sAHEu3VB001748@svn.freebsd.org> To: Julien Charbon X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 15:28:29 -0000 On 17 Nov 2014, at 14:56 , Julien Charbon wrote: > Author: jch > Date: Mon Nov 17 14:56:02 2014 > New Revision: 274629 > URL: https://svnweb.freebsd.org/changeset/base/274629 >=20 > Log: > Re-introduce padding fields removed with r264321 to keep > struct tcptw ABI unchanged. >=20 > Suggested by: jhb > Approved by: jhb (mentor) > MFC after: 1 day make that 3 days and thanks for putting them back in; I have them in a local change = which makes use of them. > X-MFC-With: r264321 >=20 > Modified: > head/sys/netinet/tcp_var.h >=20 > Modified: head/sys/netinet/tcp_var.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/netinet/tcp_var.h Mon Nov 17 14:45:42 2014 = (r274628) > +++ head/sys/netinet/tcp_var.h Mon Nov 17 14:56:02 2014 = (r274629) > @@ -357,6 +357,8 @@ struct tcptw { > u_int t_starttime; > int tw_time; > TAILQ_ENTRY(tcptw) tw_2msl; > + void *tw_pspare; /* TCP_SIGNATURE */ > + u_int *tw_spare; /* TCP_SIGNATURE */ > }; >=20 > #define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb) >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 15:33:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 203506D6; Mon, 17 Nov 2014 15:33:15 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id D54C36A1; Mon, 17 Nov 2014 15:33:14 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id E4A58A94B; Mon, 17 Nov 2014 15:33:12 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 3B03F1B99; Mon, 17 Nov 2014 16:33:10 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Garrett Cooper Subject: Re: svn commit: r274618 - in head: etc/mtree lib/msun lib/msun/tests References: <201411170919.sAH9JAEc043258@svn.freebsd.org> <38F8B193-2F8C-42E7-809C-55A2970B0006@gmail.com> Date: Mon, 17 Nov 2014 16:33:10 +0100 In-Reply-To: <38F8B193-2F8C-42E7-809C-55A2970B0006@gmail.com> (Garrett Cooper's message of "Mon, 17 Nov 2014 01:19:56 -0800") Message-ID: <86ppcl6dvt.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 15:33:15 -0000 Garrett Cooper writes: > Sorry. Copy-pasted the wrong commit message. [...] You can do a forced commit: make a trivial modification to every file you want to include in the commit, and then revert it while svn commit is waiting for you to type your commit message. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 15:44:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4995E49E; Mon, 17 Nov 2014 15:44:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35CDBB64; Mon, 17 Nov 2014 15:44:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHFi1uM025008; Mon, 17 Nov 2014 15:44:01 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHFi0aR025006; Mon, 17 Nov 2014 15:44:00 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201411171544.sAHFi0aR025006@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Mon, 17 Nov 2014 15:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274632 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 15:44:01 -0000 Author: brd (doc committer) Date: Mon Nov 17 15:44:00 2014 New Revision: 274632 URL: https://svnweb.freebsd.org/changeset/base/274632 Log: Clean up some language Reviewed by: will Modified: head/usr.sbin/pw/tests/pw_delete.sh head/usr.sbin/pw/tests/pw_etcdir.sh Modified: head/usr.sbin/pw/tests/pw_delete.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_delete.sh Mon Nov 17 15:19:57 2014 (r274631) +++ head/usr.sbin/pw/tests/pw_delete.sh Mon Nov 17 15:44:00 2014 (r274632) @@ -15,33 +15,33 @@ rmuser_seperate_group_body() { pw -V ${HOME} useradd test || atf_fail "Creating test user" pw -V ${HOME} groupmod test -M 'test,root' || \ atf_fail "Modifying the group" - pw -V ${HOME} userdel test || atf_fail "delete the user" + pw -V ${HOME} userdel test || atf_fail "Delete the test user" } -atf_test_case group_do_not_delete_wheel_if_group_unkown -group_do_not_delete_wheel_if_group_unkown_head() { - atf_set "descr" "Make sure we do not consider as gid 0 an unknown group" +atf_test_case group_do_not_delete_wheel_if_group_unknown +group_do_not_delete_wheel_if_group_unknown_head() { + atf_set "descr" "Make sure we do not consider gid 0 an unknown group" } -group_do_not_delete_wheel_if_group_unkown_body() { +group_do_not_delete_wheel_if_group_unknown_body() { populate_etc_skel atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel atf_check -e inline:"pw: -g expects a number\n" -s exit:64 -x pw -V ${HOME} groupdel -g I_do_not_exist atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel } -atf_test_case user_do_not_try_to_delete_root_if_user_unkown -user_do_not_try_to_delete_root_if_user_unkown_head() { - atf_set "descr" "Make sure not to try to remove root if deleteing an unknown user" +atf_test_case user_do_not_try_to_delete_root_if_user_unknown +user_do_not_try_to_delete_root_if_user_unknown_head() { + atf_set "descr" "Make sure not to try to remove root if deleting an unknown user" } -user_do_not_try_to_delete_root_if_user_unkown_body() { +user_do_not_try_to_delete_root_if_user_unknown_body() { populate_etc_skel atf_check -e inline:"pw: -u expects a number\n" -s exit:64 -x pw -V ${HOME} userdel -u plop } atf_init_test_cases() { atf_add_test_case rmuser_seperate_group - atf_add_test_case group_do_not_delete_wheel_if_group_unkown - atf_add_test_case user_do_not_try_to_delete_root_if_user_unkown + atf_add_test_case group_do_not_delete_wheel_if_group_unknown + atf_add_test_case user_do_not_try_to_delete_root_if_user_unknown } Modified: head/usr.sbin/pw/tests/pw_etcdir.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_etcdir.sh Mon Nov 17 15:19:57 2014 (r274631) +++ head/usr.sbin/pw/tests/pw_etcdir.sh Mon Nov 17 15:44:00 2014 (r274632) @@ -1,18 +1,18 @@ # $FreeBSD$ -# When provide -V dir, dir must exists -atf_test_case etcdir_must_exists -etcdir_must_exists_head() { - atf_set "descr" "When provide -V dir, dir must exists" +# When the '-V directory' option is provided, the directory must exist +atf_test_case etcdir_must_exist +etcdir_must_exist_head() { + atf_set "descr" "When the '-V directory' option is provided, the directory must exist" } -etcdir_must_exists_body() { - local fakedir="/this_directory_does_not_exists" +etcdir_must_exist_body() { + local fakedir="/this_directory_does_not_exist" atf_check -e inline:"pw: no such directory \`$fakedir'\n" \ -s exit:72 -x pw -V ${fakedir} usershow root } atf_init_test_cases() { - atf_add_test_case etcdir_must_exists + atf_add_test_case etcdir_must_exist } From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 15:52:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E2D978E; Mon, 17 Nov 2014 15:52:49 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4107AC53; Mon, 17 Nov 2014 15:52:49 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XqObf-0009u9-Mb; Mon, 17 Nov 2014 15:52:47 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sAHFqkVx003845; Mon, 17 Nov 2014 08:52:46 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+Vkyz7MnFc5NsjbObVP4Xm X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r274630 - head/usr.sbin/freebsd-update From: Ian Lepore To: Mark Felder In-Reply-To: <201411171512.sAHFClg9011002@svn.freebsd.org> References: <201411171512.sAHFClg9011002@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 17 Nov 2014 08:52:46 -0700 Message-ID: <1416239566.1147.8.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 15:52:49 -0000 On Mon, 2014-11-17 at 15:12 +0000, Mark Felder wrote: > Author: feld (ports committer) > Date: Mon Nov 17 15:12:46 2014 > New Revision: 274630 > URL: https://svnweb.freebsd.org/changeset/base/274630 > > Log: > Add logic for detecting non-persistent filesystems being utilized by > workdir which would break the upgrade process upon reboot. > > Currently we check for tmpfs and mdmfs. > > PR: 195006 > Differential Revision: https://reviews.freebsd.org/D1163 > Approved by: cperciva > > Modified: > head/usr.sbin/freebsd-update/freebsd-update.sh > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Nov 17 14:56:02 2014 (r274629) > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Nov 17 15:12:46 2014 (r274630) > @@ -580,6 +580,7 @@ fetchupgrade_check_params () { > _KEYPRINT_z="Key must be given via -k option or configuration file." > _KEYPRINT_bad="Invalid key fingerprint: " > _WORKDIR_bad="Directory does not exist or is not writable: " > + _WORKDIR_bad2="Directory is not on a persistent filesystem: " > > if [ -z "${SERVERNAME}" ]; then > echo -n "`basename $0`: " > @@ -603,6 +604,14 @@ fetchupgrade_check_params () { > echo ${WORKDIR} > exit 1 > fi > + for i in tmpfs mdmfs; do > + if df -t ${i} ${WORKDIR} >/dev/null 2>1; then > + echo -n "`basename $0`: " > + echo -n "${_WORKDIR_bad2}" > + echo ${WORKDIR} > + exit 1 > + fi > + done > chmod 700 ${WORKDIR} > cd ${WORKDIR} || exit 1 > > This doesn't look quite right. There is no mdmfs filesystem, that's just the name of the tool that creates a UFS filesystem on an md(4) device. On one of my systems where /var is set up by /etc/rc.d/var and /tmp by an fstab entry of: "md /tmp mfs rw,noatime,-s128m 0 0" I see this from df: root@bb:~ # df -hT Filesystem Type Size Used Avail Capacity Mounted on 172.22.42.240:/bb nfs 504G 280G 184G 60% / devfs devfs 1.0K 1.0K 0B 100% /dev /dev/md0 ufs 124M 24K 114M 0% /tmp /dev/md1 ufs 31M 360K 28M 1% /var Something like this should work: case $(df -T ${WORKDIR}) in */dev/md[0-9]* | *tmpfs* ) echo error messages and stuff exit 1 ;; esac -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 16:14:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C418B8E for ; Mon, 17 Nov 2014 16:14:04 +0000 (UTC) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4814E6A for ; Mon, 17 Nov 2014 16:14:02 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id n3so2262407wiv.7 for ; Mon, 17 Nov 2014 08:14:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=B5szRIx2USh2sW74sGOlu7w/XvjW1ORHfKnnoXL6Z0s=; b=JjoMY9ZR7iVW7m571fmg3BYhQVIEMW397xKK3xgau/kNG/FPu/db4In0WyqQwkaySN 7olhOkHfwiGozuDQsAy+9mGRymyUD/WyA7lg3mgPkjzTtkvw5/agzXNuHBuiNvZ1Z8aa P9aJqUvTjD1xjtx1+/LzB3m+JTe7XvXwoJsg8AFZNFh+yxgQ6P2LitLdYXqOrzsf6tRl kzSGZioUOGfikxXx4ibiKUJALdGISTeseJGBiiF6OkFd0B2dvVH6D9ll1vSN6RWoWUmH Er3jioM+hL2j4CBhBNEIyhdAYedMqu+xDtTRv4rfoXQrOG0yueJah/IZozFrOiTOVtX+ aULQ== X-Gm-Message-State: ALoCoQnxSmk8JyFVDVyG8xH4CGan+fl1ikzoIVfuflQU4/fYkWARfuhk3s/kr3yLZfDUACzMZoob X-Received: by 10.180.10.231 with SMTP id l7mr32608170wib.1.1416240841201; Mon, 17 Nov 2014 08:14:01 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id p8sm19143187wia.1.2014.11.17.08.14.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Nov 2014 08:14:00 -0800 (PST) Message-ID: <546A1ECC.7000301@multiplay.co.uk> Date: Mon, 17 Nov 2014 16:14:04 +0000 From: Steven Hartland User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r274628 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201411171445.sAHEjgbE096937@svn.freebsd.org> <546A0ED8.6020104@freebsd.org> <546A0F1E.5050305@FreeBSD.org> In-Reply-To: <546A0F1E.5050305@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 16:14:04 -0000 On 17/11/2014 15:07, Andriy Gapon wrote: > On 17/11/2014 17:06, Steven Hartland wrote: >> Looks like this could have introduced random data corruption, have you seen this >> in practice? > Which part exactly? The part where it zeroed beyond the allocated buffer. >> On 17/11/2014 14:45, Andriy Gapon wrote: >>> Author: avg >>> Date: Mon Nov 17 14:45:42 2014 >>> New Revision: 274628 >>> URL: https://svnweb.freebsd.org/changeset/base/274628 >>> >>> Log: >>> l2arc: restore correct rounding up of asize of compressed data >>> This rounding up was lost in a mismerge of illumos code. >>> See r268075 MFV r267565. >>> After that commit zio_compress_data() no longer performs any compressed >>> size adjustment, so it needs to be done externally. On FreeBSD we round >>> up the size using vdev_ashift rather than SPA_MINBLOCKSIZE so that 4KB >>> devices are properly supported. >>> Additionally, zero out the buffer tail only if compression succeeds. >>> The compression is considered successful if the size of compressed >>> data after rounding up to account for the vdev ashift is less than the >>> original data size. It does not make sense to have the data compressed >>> if all the savings are lost to rounding up. >>> With the new zio_compress_data() it could have been possible that the >>> rounded compressed size would be greater than the original size and thus >>> we could zero beyond the allocated buffer if the zeroing code was kept >>> at the original place. >>> Discussed with: delphij, gibbs >>> MFC after: 2 weeks >>> X-MFC with: r274627 >>> >>> Modified: >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >>> >>> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >>> ============================================================================== >>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 >>> 14:16:02 2014 (r274627) >>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 >>> 14:45:42 2014 (r274628) >>> @@ -5326,12 +5326,6 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd >>> csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, >>> cdata, l2hdr->b_asize); >>> - rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE); >>> - if (rounded > csize) { >>> - bzero((char *)cdata + csize, rounded - csize); >>> - csize = rounded; >>> - } >>> - >>> if (csize == 0) { >>> /* zero block, indicate that there's nothing to write */ >>> zio_data_buf_free(cdata, len); >>> @@ -5340,11 +5334,19 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd >>> l2hdr->b_tmp_cdata = NULL; >>> ARCSTAT_BUMP(arcstat_l2_compress_zeros); >>> return (B_TRUE); >>> - } else if (csize > 0 && csize < len) { >>> + } >>> + >>> + rounded = P2ROUNDUP(csize, >>> + (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); >>> + if (rounded < len) { >>> /* >>> * Compression succeeded, we'll keep the cdata around for >>> * writing and release it afterwards. >>> */ >>> + if (rounded > csize) { >>> + bzero((char *)cdata + csize, rounded - csize); >>> + csize = rounded; >>> + } >>> l2hdr->b_compress = ZIO_COMPRESS_LZ4; >>> l2hdr->b_asize = csize; >>> l2hdr->b_tmp_cdata = cdata; >>> > From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 16:29:35 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E5941CA; Mon, 17 Nov 2014 16:29:35 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8D4E7FC1; Mon, 17 Nov 2014 16:29:34 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA11508; Mon, 17 Nov 2014 18:31:25 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XqPBE-00021m-DC; Mon, 17 Nov 2014 18:29:32 +0200 Message-ID: <546A2248.5000400@FreeBSD.org> Date: Mon, 17 Nov 2014 18:28:56 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Steven Hartland , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r274628 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201411171445.sAHEjgbE096937@svn.freebsd.org> <546A0ED8.6020104@freebsd.org> <546A0F1E.5050305@FreeBSD.org> <546A1ECC.7000301@multiplay.co.uk> In-Reply-To: <546A1ECC.7000301@multiplay.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 16:29:35 -0000 On 17/11/2014 18:14, Steven Hartland wrote: > > On 17/11/2014 15:07, Andriy Gapon wrote: >> On 17/11/2014 17:06, Steven Hartland wrote: >>> Looks like this could have introduced random data corruption, have you seen this >>> in practice? >> Which part exactly? > The part where it zeroed beyond the allocated buffer. Oh, maybe I worded the commit message badly, but I wanted to say was that *if* I replaced SPA_MINBLOCKSIZE with vdev_ashift, but left the zeroing code where it was before, then there would be zeroing beyond the buffer. There was no corruption with the previous code. >>> On 17/11/2014 14:45, Andriy Gapon wrote: >>>> Author: avg >>>> Date: Mon Nov 17 14:45:42 2014 >>>> New Revision: 274628 >>>> URL: https://svnweb.freebsd.org/changeset/base/274628 >>>> >>>> Log: >>>> l2arc: restore correct rounding up of asize of compressed data >>>> This rounding up was lost in a mismerge of illumos code. >>>> See r268075 MFV r267565. >>>> After that commit zio_compress_data() no longer performs any compressed >>>> size adjustment, so it needs to be done externally. On FreeBSD we round >>>> up the size using vdev_ashift rather than SPA_MINBLOCKSIZE so that 4KB >>>> devices are properly supported. >>>> Additionally, zero out the buffer tail only if compression succeeds. >>>> The compression is considered successful if the size of compressed >>>> data after rounding up to account for the vdev ashift is less than the >>>> original data size. It does not make sense to have the data compressed >>>> if all the savings are lost to rounding up. >>>> With the new zio_compress_data() it could have been possible that the >>>> rounded compressed size would be greater than the original size and thus >>>> we could zero beyond the allocated buffer if the zeroing code was kept >>>> at the original place. >>>> Discussed with: delphij, gibbs >>>> MFC after: 2 weeks >>>> X-MFC with: r274627 >>>> >>>> Modified: >>>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >>>> >>>> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >>>> ============================================================================== >>>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 >>>> 14:16:02 2014 (r274627) >>>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 >>>> 14:45:42 2014 (r274628) >>>> @@ -5326,12 +5326,6 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd >>>> csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, >>>> cdata, l2hdr->b_asize); >>>> - rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE); >>>> - if (rounded > csize) { >>>> - bzero((char *)cdata + csize, rounded - csize); >>>> - csize = rounded; >>>> - } >>>> - >>>> if (csize == 0) { >>>> /* zero block, indicate that there's nothing to write */ >>>> zio_data_buf_free(cdata, len); >>>> @@ -5340,11 +5334,19 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd >>>> l2hdr->b_tmp_cdata = NULL; >>>> ARCSTAT_BUMP(arcstat_l2_compress_zeros); >>>> return (B_TRUE); >>>> - } else if (csize > 0 && csize < len) { >>>> + } >>>> + >>>> + rounded = P2ROUNDUP(csize, >>>> + (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); >>>> + if (rounded < len) { >>>> /* >>>> * Compression succeeded, we'll keep the cdata around for >>>> * writing and release it afterwards. >>>> */ >>>> + if (rounded > csize) { >>>> + bzero((char *)cdata + csize, rounded - csize); >>>> + csize = rounded; >>>> + } >>>> l2hdr->b_compress = ZIO_COMPRESS_LZ4; >>>> l2hdr->b_asize = csize; >>>> l2hdr->b_tmp_cdata = cdata; >>>> >> > -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 16:30:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C7D932E; Mon, 17 Nov 2014 16:30:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64529B7; Mon, 17 Nov 2014 16:30:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHGUqWw045292; Mon, 17 Nov 2014 16:30:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHGUqXB045291; Mon, 17 Nov 2014 16:30:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411171630.sAHGUqXB045291@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 17 Nov 2014 16:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274633 - head/sys/dev/pccbb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 16:30:52 -0000 Author: imp Date: Mon Nov 17 16:30:51 2014 New Revision: 274633 URL: https://svnweb.freebsd.org/changeset/base/274633 Log: Remove stray empty comment. The code is adequately explained in the block comment above, so there's nothing to add here. Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Mon Nov 17 15:44:00 2014 (r274632) +++ head/sys/dev/pccbb/pccbb.c Mon Nov 17 16:30:51 2014 (r274633) @@ -992,8 +992,6 @@ cbb_cardbus_reset_power(device_t brdev, * a cardbus bus, so that's the only register we check here. */ if (on && CBB_CARD_PRESENT(cbb_get(sc, CBB_SOCKET_STATE))) { - /* - */ PCI_MASK_CONFIG(brdev, CBBR_BRIDGECTRL, &~CBBM_BRIDGECTRL_RESET, 2); b = pcib_get_bus(child); From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 18:09:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B6B587F; Mon, 17 Nov 2014 18:09:55 +0000 (UTC) Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu [18.9.25.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2B9CDD1; Mon, 17 Nov 2014 18:09:54 +0000 (UTC) X-AuditID: 1209190c-f795e6d000006c66-4d-546a39ebd82f Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 12.EF.27750.BE93A645; Mon, 17 Nov 2014 13:09:47 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id sAHI9jhg024048; Mon, 17 Nov 2014 13:09:46 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id sAHI9huX031529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 17 Nov 2014 13:09:44 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id sAHI9gBV006317; Mon, 17 Nov 2014 13:09:43 -0500 (EST) Date: Mon, 17 Nov 2014 13:09:42 -0500 (EST) From: Benjamin Kaduk X-X-Sender: kaduk@multics.mit.edu To: Xin Li Subject: Re: svn commit: r274583 - head/usr.sbin/watchdogd In-Reply-To: <54698F93.2030700@delphij.net> Message-ID: References: <201411160944.sAG9iUTJ084769@svn.freebsd.org> <54698F93.2030700@delphij.net> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBKsWRmVeSWpSXmKPExsUixG6nrvvaMivE4EyHgMWxh0fZLXbs3c5i 8ad9CpDYtJDVounLAiYHVo//s+4wecz4NJ/FY+esu+wBzFFcNimpOZllqUX6dglcGfOfChV8 Y6s42fqUtYFxH2sXIweHhICJxO13fF2MnECmmMSFe+vZuhi5OIQEZjNJPJ+4gB3C2cgo0XDo PiOEc4hJ4s2NWawQTgOjRMfVFUwgo1gEtCXev/UFGcUmoCbxeG8zK8RYRYnNpyYxg9giAgoS m3ZvYQLpZRZ4wSjRdHgeI0hCWMBKorP/DtgcTqA5x+dagIR5BRwl3r3dywSxay6jxLvGI2BD RQV0JFbvn8ICUSQocXLmEzCbWUBLYvn0bSwTGIVmIUnNQpJawMi0ilE2JbdKNzcxM6c4NVm3 ODkxLy+1SNdQLzezRC81pXQTIyjQOSV5djC+Oah0iFGAg1GJh3dHdmaIEGtiWXFl7iFGSQ4m JVHeNMOsECG+pPyUyozE4oz4otKc1OJDjBIczEoivFomQDnelMTKqtSifJiUNAeLkjjvph98 IUIC6YklqdmpqQWpRTBZGQ4OJQne+xZAjYJFqempFWmZOSUIaSYOTpDhPEDDP4HU8BYXJOYW Z6ZD5E8x6nK0NL3tZRJiycvPS5US52UAphghAZCijNI8uDmwBPWKURzoLWFeDpAqHmByg5v0 CmgJE9CSORsyQZaUJCKkpBoYPZbr3u2YdXXV2sqz6e9/mn+Z8uDWxQ8R197l+muwP9S6xqB+ WuhGjWVhWETO5NpjjSmfPt9Qs5NiV5o4U8LMLP3etPux1XcPOVs7BB89OPHZ3rLkTKfFDwIf PV9xaBlrzsPl6Sp5aZYW7BMmBtZ2L1ixOmJmBLdMEr928sYNS9fvtvvz4c31UiWW4oxEQy3m ouJEAKCijF8rAwAA Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 18:09:55 -0000 On Mon, 17 Nov 2014, Xin Li wrote: > On 11/16/14 13:46, Benjamin Kaduk wrote: > > On Sun, Nov 16, 2014 at 4:44 AM, Xin LI > > wrote: > > > > Author: delphij Date: Sun Nov 16 09:44:30 2014 New Revision: > > 274583 URL: https://svnweb.freebsd.org/changeset/base/274583 > > > > Log: Default to use 10 seconds as nap interval instead of 1. > > > > relnotes: yes? > > I'm not sure -- no objection but is this noteworthy? Well, I'm not sure, either. It seems borderline to me, but IIRC Glen had asked us to err on the side of using relnotes: yes too often instead of too little. It seems like this could fall under "a change of default configuration that would result in a noticeable behavior change" for some systems, but probably not a particularly large number. I don't have strong feelings either way. -Ben From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 18:43:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F07AB5AA; Mon, 17 Nov 2014 18:43:39 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CBE37241; Mon, 17 Nov 2014 18:43:39 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [12.229.62.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 99D0C22BED; Mon, 17 Nov 2014 10:43:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1416249818; x=1416264218; bh=M38WlMs+byjH198guWG0V7Y88dl+XQ9os9C0IuypWk0=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=AcPWMJU5uGqfpSsv2rh117GjpcXBiAyCN2tCdwwoyC2lAwW+xzZDXhuWYnB3Q7yKv V07QhodUl9BR8kwATMzkCBMHBxYLF0M5MvxRWxDkz75QQyDN9nTUH208jcrHn/+gSe 3ohzxzSxt8mvuNpJmy19iRsV0D+Lo3dA2DXHMF2s= Message-ID: <546A41DA.9020008@delphij.net> Date: Mon, 17 Nov 2014 10:43:38 -0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274619 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201411171132.sAHBWBMU006778@svn.freebsd.org> In-Reply-To: <201411171132.sAHBWBMU006778@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 18:43:40 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 11/17/14 03:32, Steven Hartland wrote: > Author: smh Date: Mon Nov 17 11:32:10 2014 New Revision: 274619 > URL: https://svnweb.freebsd.org/changeset/base/274619 > > Log: Disable TRIM on file backed ZFS vdevs and fix TRIM on init > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c > ============================================================================== > > - --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Nov 17 09:19:09 2014 (r274618) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c > Mon Nov 17 11:32:10 2014 (r274619) @@ -796,6 +796,8 @@ > vdev_disk_io_start(zio_t *zio) return; } > > + ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == > ZIO_TYPE_WRITE); + vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); > > vb->vb_io = zio; > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c > ============================================================================== > > - --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Nov 17 09:19:09 2014 (r274618) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c > Mon Nov 17 11:32:10 2014 (r274619) @@ -129,6 +129,8 @@ skip_open: > return (error); } > > + vd->vdev_notrim = B_TRUE; + *max_psize = *psize = vattr.va_size; > *logical_ashift = SPA_MINBLOCKSHIFT; *physical_ashift = > SPA_MINBLOCKSHIFT; @@ -185,6 +187,8 @@ vdev_file_io_start(zio_t > *zio) return; } > > + ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == > ZIO_TYPE_WRITE); + zio->io_error = vn_rdwr(zio->io_type == > ZIO_TYPE_READ ? UIO_READ : UIO_WRITE, vp, zio->io_data, > zio->io_size, zio->io_offset, UIO_SYSSPACE, 0, RLIM64_INFINITY, > kcred, &resid); > Please upstream both file's assertion changes. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJUakHZAAoJEJW2GBstM+nsBCsP/REPNGaorCxDk77Q18wu/lS6 tL5g9FrGeFJINKlgGSGgr3mStrWGNCTKPxErK6kbEitX2P47ynMuHxQu3M2UzmUr OANSiqHn0bJ0thv8FOE4ldbxO5i8uI9XfpfCX65yZS+TeDsOWMp8TuVUJqHkZdXD zPEV/isfewgUQ3UIC0ECy5v2BpnnzdsjziLsi0vmJ9Zcx5SD7Pkna9FlJiwWT53G 5NF2JYhTpbNlPacI+vMFPSYMmqaT4o32tx9JP0VJqjGU6RPkXSu9Id6m4CbFpVDD 5ak6iMLkdiCasGQ9g/+CMkOBLu3I/bomZvg/NVZEQ4rhKu8uZ3Mx67nL1f/KXq1R s66VI765yqmgWIhxHqYtOCWTZ73Fs9zwe7hluh3x9tQ6tphOD/LG05nxQiRt9XoI FC5eA6SrKNNfNM1P+HQ21fTJbHt3fvn8Y+WAS60bK5KjW7DI8zCirSlUmF0Euyn0 xXeh9xQtEtiX+trOSphrcg5445mXcGUenj2qmcwkufHfQ39stGkvSJ28yRiLqegc NMcxTkbup/1puH0dDaLGl2+k+RTfX7Z4PyaetqTSTJ1LX6bNAkICCVo/kM4gpKIT 1vxwOzHPTrEOzUOF7M+em5Uqh5sdBBbgxqI9HkpBgqbmYIDUg2SpH5XTGMDazdnO kHNe8ABOdFm2zf2uyG+O =Ffj/ -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 18:52:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D918956; Mon, 17 Nov 2014 18:52:37 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C99C370; Mon, 17 Nov 2014 18:52:37 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XqRPf-00031S-KB; Mon, 17 Nov 2014 18:52:35 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sAHIqQvR004256; Mon, 17 Nov 2014 11:52:26 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19Cv5V6wwt+24imr1eR1SkZ X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r274583 - head/usr.sbin/watchdogd From: Ian Lepore To: Benjamin Kaduk In-Reply-To: References: <201411160944.sAG9iUTJ084769@svn.freebsd.org> <54698F93.2030700@delphij.net> Content-Type: text/plain; charset="us-ascii" Date: Mon, 17 Nov 2014 11:52:21 -0700 Message-ID: <1416250341.1147.29.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin Li X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 18:52:37 -0000 On Mon, 2014-11-17 at 13:09 -0500, Benjamin Kaduk wrote: > On Mon, 17 Nov 2014, Xin Li wrote: > > > On 11/16/14 13:46, Benjamin Kaduk wrote: > > > On Sun, Nov 16, 2014 at 4:44 AM, Xin LI > > > wrote: > > > > > > Author: delphij Date: Sun Nov 16 09:44:30 2014 New Revision: > > > 274583 URL: https://svnweb.freebsd.org/changeset/base/274583 > > > > > > Log: Default to use 10 seconds as nap interval instead of 1. > > > > > > relnotes: yes? > > > > I'm not sure -- no objection but is this noteworthy? > > Well, I'm not sure, either. It seems borderline to me, but IIRC Glen had > asked us to err on the side of using relnotes: yes too often instead of > too little. It seems like this could fall under "a change of default > configuration that would result in a noticeable behavior change" for some > systems, but probably not a particularly large number. > > I don't have strong feelings either way. > > -Ben > I think the only way you would see a behavior change is if we had a system whose max timeout was under 10 seconds. The shortest I know of are some arm systems whose max is 16 seconds. -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 19:41:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9C89FC0 for ; Mon, 17 Nov 2014 19:41:40 +0000 (UTC) Received: from spring-chicken-bm.twitter.com (spring-chicken-bm.twitter.com [199.16.156.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DDDEB43 for ; Mon, 17 Nov 2014 19:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=twitter.com; s=dkim-201406; t=1416253288; bh=h55t1S+DxViQOZ+0snOP417fFqPXprWIhTJ3F2Lt/9g=; h=Date:From:To:Subject:MIME-Version:Content-Type:List-Unsubscribe: Feedback-ID:Message-ID; b=YLUbFob0Svh7g7YhbhkYaiFL+VYC0tctarRsWLJdmPEYMSy1yd67OYhmyWbdlMxNO GijUMFb4hxxDI/yQi1ilFymiksCMAp5wov0g/DL3J7zcXSKXTZUc4surFZXquLEosk h1wwYftkfaa5A0CfWp3aW4vxC5L4kCexVI2JgMr0OAhGNMGw3U7ls7ajNmxXxT3fX8 USKZwCSKvMQSU5a4vvzoT9eLmb+33XakRwMLHFRZwz5Y1igmob+WfJywn3QL2hZs7d ZF6myDnYT2m1sBAPBxeVuz4ntfpLVepmU5UA9NBJWVWkoxUpw4PX0SNRju2QRhRaMo I9FuveItYtRAA== X-MSFBL: c3ZuLXNyYy1oZWFkQGZyZWVic2Qub3JnQGF0bGEtYXFoLTM4LXNyMS1FdmVyeXRo aW5nLjE5OEBFdmVyeXRoaW5nQHN2bi1zcmMtaGVhZFxAZnJlZWJzZC5vcmdcQHVz YiMjMFxAMjQ0XEAwXEAwXEA5Mzk2ZDhiODk3NDhlZDExMTMxMzc2YzFkNmEzZjk4 ZjlhYWIyYTI4 Date: Mon, 17 Nov 2014 19:41:28 +0000 From: "ricky graham (via Twitter)" To: svn-src-head@freebsd.org Subject: ricky graham sent you an invitation MIME-Version: 1.0 Feedback-ID: 0040162518f58f41d1f0:1a4b0c2a33e3b540c2f9f813ac6366b7f1:none:twitterESP Message-ID: <6E.92.30033.86F4A645@twitter.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 19:41:40 -0000 ricky graham sent you an invitation Twitter helps you stay connected with what's happening right now and with the people and organizations you care about. Accept invitation https://twitter.com/i/2b6d2db9-2214-4571-b818-68cf9893d35a -- You can unsubscribe from receiving email notifications from Twitter at anytime. For general inquiries, please visit us at Twitter Support. Unsubscribe: https://twitter.com/i/o?t=1&cn=aW52aXRlX3NlbGZfc2VydmU%3D&iid=98b2e6e5375841268f8d7ea60701c3df&uid=0&c=zIOtETEn5e%2BLxOu8yW1rGmFii1ooOpHcwGsDlhYp9JA%3D&nid=244+26 Need help? https://support.twitter.com From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 20:25:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D76D9E4B; Mon, 17 Nov 2014 20:25:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C469DFCD; Mon, 17 Nov 2014 20:25:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHKPLfO055667; Mon, 17 Nov 2014 20:25:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHKPLMl055666; Mon, 17 Nov 2014 20:25:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411172025.sAHKPLMl055666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 17 Nov 2014 20:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274635 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 20:25:22 -0000 Author: dchagin Date: Mon Nov 17 20:25:21 2014 New Revision: 274635 URL: https://svnweb.freebsd.org/changeset/base/274635 Log: Use the correct device as the power_for_sleep() method always pass request up to parent bridge. Reviewed by: jhb MFC after: 1 week xMFC: r274386,r274397 Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Nov 17 17:17:10 2014 (r274634) +++ head/sys/dev/pci/pci.c Mon Nov 17 20:25:21 2014 (r274635) @@ -3637,7 +3637,6 @@ static void pci_set_power_child(device_t dev, device_t child, int state) { struct pci_devinfo *dinfo; - device_t pcib; int dstate; /* @@ -3647,11 +3646,10 @@ pci_set_power_child(device_t dev, device * device power. Skip children who aren't attached since they * are handled separately. */ - pcib = device_get_parent(dev); dinfo = device_get_ivars(child); dstate = state; if (device_is_attached(child) && - PCIB_POWER_FOR_SLEEP(pcib, child, &dstate) == 0) + PCIB_POWER_FOR_SLEEP(dev, child, &dstate) == 0) pci_set_powerstate(child, dstate); } From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 21:01:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04BFED9; Mon, 17 Nov 2014 21:01:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E606C665; Mon, 17 Nov 2014 21:01:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHL1ZDh074281; Mon, 17 Nov 2014 21:01:35 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHL1ZZ7074280; Mon, 17 Nov 2014 21:01:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411172101.sAHL1ZZ7074280@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Nov 2014 21:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274636 - head/sys/libkern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 21:01:36 -0000 Author: delphij Date: Mon Nov 17 21:01:35 2014 New Revision: 274636 URL: https://svnweb.freebsd.org/changeset/base/274636 Log: Sync with userland variant. MFC after: 2 weeks Modified: head/sys/libkern/strncmp.c Modified: head/sys/libkern/strncmp.c ============================================================================== --- head/sys/libkern/strncmp.c Mon Nov 17 20:25:21 2014 (r274635) +++ head/sys/libkern/strncmp.c Mon Nov 17 21:01:35 2014 (r274636) @@ -10,7 +10,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. * @@ -33,9 +33,7 @@ __FBSDID("$FreeBSD$"); #include int -strncmp(s1, s2, n) - register const char *s1, *s2; - register size_t n; +strncmp(const char *s1, const char *s2, size_t n) { if (n == 0) @@ -44,7 +42,7 @@ strncmp(s1, s2, n) if (*s1 != *s2++) return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); - if (*s1++ == 0) + if (*s1++ == '\0') break; } while (--n != 0); return (0); From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 22:22:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F143C0E; Mon, 17 Nov 2014 22:22:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AE2EF2F; Mon, 17 Nov 2014 22:22:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHMMHgR012920; Mon, 17 Nov 2014 22:22:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHMMHCs012916; Mon, 17 Nov 2014 22:22:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411172222.sAHMMHCs012916@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 17 Nov 2014 22:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274637 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 22:22:18 -0000 Author: markj Date: Mon Nov 17 22:22:16 2014 New Revision: 274637 URL: https://svnweb.freebsd.org/changeset/base/274637 Log: DTrace imposes a 128-byte limit on the length of the function component of a probe name. When dtrace -G builds up a DOF section for the specified provider(s), the probe function names are truncated to fit in this limit. The DOF is later used to build the symbol table for the generated object file, so the table can end up with truncated references, causing link errors. Instead of potentially truncating symbol table entries, write the full function name to the DOF string table and allow the kernel to enforce the 128-byte function name limit when a process attempts to load its DOF. PR: 194757 Differential Revision: https://reviews.freebsd.org/D1175 Reviewed by: rpaulo MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.h Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Mon Nov 17 21:01:35 2014 (r274636) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Mon Nov 17 22:22:16 2014 (r274637) @@ -469,7 +469,7 @@ dof_add_probe(dt_idhash_t *dhp, dt_ident * locally so an alternate symbol is added for the purpose * of this relocation. */ - if (pip->pi_rname[0] == '\0') + if (pip->pi_rname == NULL) dofr.dofr_name = dofpr.dofpr_func; else dofr.dofr_name = dof_add_string(ddo, pip->pi_rname); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c Mon Nov 17 21:01:35 2014 (r274636) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c Mon Nov 17 22:22:16 2014 (r274637) @@ -520,6 +520,8 @@ dt_probe_destroy(dt_probe_t *prp) for (pip = prp->pr_inst; pip != NULL; pip = pip_next) { pip_next = pip->pi_next; + dt_free(dtp, pip->pi_rname); + dt_free(dtp, pip->pi_fname); dt_free(dtp, pip->pi_offs); dt_free(dtp, pip->pi_enoffs); dt_free(dtp, pip); @@ -552,28 +554,18 @@ dt_probe_define(dt_provider_t *pvp, dt_p if ((pip = dt_zalloc(dtp, sizeof (*pip))) == NULL) return (-1); - if ((pip->pi_offs = dt_zalloc(dtp, - sizeof (uint32_t))) == NULL) { - dt_free(dtp, pip); - return (-1); - } + if ((pip->pi_offs = dt_zalloc(dtp, sizeof (uint32_t))) == NULL) + goto nomem; if ((pip->pi_enoffs = dt_zalloc(dtp, - sizeof (uint32_t))) == NULL) { - dt_free(dtp, pip->pi_offs); - dt_free(dtp, pip); - return (-1); - } + sizeof (uint32_t))) == NULL) + goto nomem; - (void) strlcpy(pip->pi_fname, fname, sizeof (pip->pi_fname)); - if (rname != NULL) { - if (strlen(rname) + 1 > sizeof (pip->pi_rname)) { - dt_free(dtp, pip->pi_offs); - dt_free(dtp, pip); - return (dt_set_errno(dtp, EDT_COMPILER)); - } - (void) strcpy(pip->pi_rname, rname); - } + if ((pip->pi_fname = strdup(fname)) == NULL) + goto nomem; + + if (rname != NULL && (pip->pi_rname = strdup(rname)) == NULL) + goto nomem; pip->pi_noffs = 0; pip->pi_maxoffs = 1; @@ -618,6 +610,13 @@ dt_probe_define(dt_provider_t *pvp, dt_p (*offs)[(*noffs)++] = offset; return (0); + +nomem: + dt_free(dtp, pip->pi_fname); + dt_free(dtp, pip->pi_enoffs); + dt_free(dtp, pip->pi_offs); + dt_free(dtp, pip); + return (dt_set_errno(dtp, EDT_NOMEM)); } /* Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.h Mon Nov 17 21:01:35 2014 (r274636) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.h Mon Nov 17 22:22:16 2014 (r274637) @@ -64,8 +64,8 @@ typedef struct dt_probe_iter { } dt_probe_iter_t; typedef struct dt_probe_instance { - char pi_fname[DTRACE_FUNCNAMELEN]; /* function name */ - char pi_rname[DTRACE_FUNCNAMELEN + 20]; /* mangled relocation name */ + char *pi_fname; /* function name */ + char *pi_rname; /* mangled relocation name */ uint32_t *pi_offs; /* offsets into the function */ uint32_t *pi_enoffs; /* is-enabled offsets */ uint_t pi_noffs; /* number of offsets */ From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 22:46:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B161530; Mon, 17 Nov 2014 22:46:05 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D89481D2; Mon, 17 Nov 2014 22:46:04 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0E379B939; Mon, 17 Nov 2014 17:46:03 -0500 (EST) From: John Baldwin To: Dmitry Chagin Subject: Re: svn commit: r274635 - head/sys/dev/pci Date: Mon, 17 Nov 2014 17:45:23 -0500 Message-ID: <2245618.H2SPKlpWdS@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-PRERELEASE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201411172025.sAHKPLMl055666@svn.freebsd.org> References: <201411172025.sAHKPLMl055666@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 17 Nov 2014 17:46:03 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 22:46:05 -0000 On Monday, November 17, 2014 08:25:21 PM Dmitry Chagin wrote: > Author: dchagin > Date: Mon Nov 17 20:25:21 2014 > New Revision: 274635 > URL: https://svnweb.freebsd.org/changeset/base/274635 > > Log: > Use the correct device as the power_for_sleep() method > always pass request up to parent bridge. > > Reviewed by: jhb > MFC after: 1 week > xMFC: r274386,r274397 Hmm, I had misread this diff as being another instance of what Adrian had found. I think this is actually not correct. The parent of a pci device ('dev' here) is a pciX device. pciX devices do not implement the PCIB_POWER_FOR_SLEEP method from pcib_if.m, so this probably just broke Adrian's Asus laptop as now it will always use D3 again and ignore _SxD. You said that this change fixed your laptop, yes? Did it work before Adrian's change in r274386 and break afterwards? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 23:17:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 311BAD76; Mon, 17 Nov 2014 23:17:27 +0000 (UTC) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5784767; Mon, 17 Nov 2014 23:17:26 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id k14so8088058wgh.37 for ; Mon, 17 Nov 2014 15:17:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=jVfaQfChIkHOdR+W823H2eMQJ7Q4YT65d0boOaOkbLM=; b=KIuvJ4j11ZGLCvwSaVHx2Estrgr1LlYGC4bf9g8xgscxmnvrtyiKpU2v9PzmEKkcz1 vLSyI5+DNvCDdQBXxTxIgGtaX70X3iamjF0HTZG7c13e1gHRT/bohdbOrIDUKdIDTl5B /oJL7f0WfohIsPTXDk8Iu7M1N9K9vC6Jm6TGAo66ZDHe03YgKHQEcMvrexlNUbuh1UTe 3M9DUqrzUuKfE2aD1r54yhUvo3nVGianDA3qkjr1T1vIDj/0AmvHcuDCVLUMwRWmJUru RfSy6w0xXNNMHCeKJD3bJl0bna4GiAGg/5dXucrlQ/txdhlUBpbdeD25azvoVQ/IHe69 6jDA== MIME-Version: 1.0 X-Received: by 10.180.188.102 with SMTP id fz6mr25847172wic.59.1416266245234; Mon, 17 Nov 2014 15:17:25 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Mon, 17 Nov 2014 15:17:25 -0800 (PST) In-Reply-To: <2245618.H2SPKlpWdS@ralph.baldwin.cx> References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> Date: Mon, 17 Nov 2014 15:17:25 -0800 X-Google-Sender-Auth: 0MRDlcMsQ_FtEP6s2CGIZ7O3mAM Message-ID: Subject: Re: svn commit: r274635 - head/sys/dev/pci From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Dmitry Chagin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 23:17:27 -0000 On 17 November 2014 14:45, John Baldwin wrote: > On Monday, November 17, 2014 08:25:21 PM Dmitry Chagin wrote: >> Author: dchagin >> Date: Mon Nov 17 20:25:21 2014 >> New Revision: 274635 >> URL: https://svnweb.freebsd.org/changeset/base/274635 >> >> Log: >> Use the correct device as the power_for_sleep() method >> always pass request up to parent bridge. >> >> Reviewed by: jhb >> MFC after: 1 week >> xMFC: r274386,r274397 > > Hmm, I had misread this diff as being another instance of what Adrian had > found. I think this is actually not correct. The parent of a pci device > ('dev' here) is a pciX device. pciX devices do not implement the > PCIB_POWER_FOR_SLEEP method from pcib_if.m, so this probably just broke > Adrian's Asus laptop as now it will always use D3 again and ignore _SxD. > > You said that this change fixed your laptop, yes? Did it work before Adrian's > change in r274386 and break afterwards? Hm, it doesn't cascade up to the parent of dev if it's called? -adrian From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 01:38:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4DBEE8D; Tue, 18 Nov 2014 01:38:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7488669; Tue, 18 Nov 2014 01:38:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAI1cemc003903; Tue, 18 Nov 2014 01:38:40 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAI1ceUv003900; Tue, 18 Nov 2014 01:38:40 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201411180138.sAI1ceUv003900@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 18 Nov 2014 01:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274638 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 01:38:40 -0000 Author: loos Date: Tue Nov 18 01:38:39 2014 New Revision: 274638 URL: https://svnweb.freebsd.org/changeset/base/274638 Log: Add basic interrupt management code to gpiobus and ofw_gpiobus. This is the general support to allow the use of GPIO pins as interrupt sources for direct gpiobus children. The use of GPIO pins as generic interrupt sources (for an ethernet driver for example) will only be possible when arm/intrng is complete. Then, most of this code will need to be rewritten, but it works for now, is better than what we have and will allow further developments. Tested on: ar71xx (RSPRO), am335x (BBB), bcm2835 (Raspberry pi) Differential Revision: https://reviews.freebsd.org/D999 Reviewed by: rpaulo Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Mon Nov 17 22:22:16 2014 (r274637) +++ head/sys/dev/gpio/gpiobus.c Tue Nov 18 01:38:39 2014 (r274638) @@ -38,6 +38,13 @@ __FBSDID("$FreeBSD$"); #include "gpiobus_if.h" +#undef GPIOBUS_DEBUG +#ifdef GPIOBUS_DEBUG +#define dprintf printf +#else +#define dprintf(x, arg...) +#endif + static int gpiobus_parse_pins(struct gpiobus_softc *, device_t, int); static int gpiobus_probe(device_t); static int gpiobus_attach(device_t); @@ -105,6 +112,11 @@ gpiobus_init_softc(device_t dev) sc = GPIOBUS_SOFTC(dev); sc->sc_busdev = dev; sc->sc_dev = device_get_parent(dev); + sc->sc_intr_rman.rm_type = RMAN_ARRAY; + sc->sc_intr_rman.rm_descr = "GPIO Interrupts"; + if (rman_init(&sc->sc_intr_rman) != 0 || + rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0) + panic("%s: failed to set up rman.", __func__); if (GPIO_PIN_MAX(sc->sc_dev, &sc->sc_npins) != 0) return (ENXIO); @@ -267,6 +279,7 @@ gpiobus_print_child(device_t dev, device retval += bus_print_child_header(dev, child); retval += printf(" at pin(s) "); gpiobus_print_pins(devi); + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); retval += bus_print_child_footer(dev, child); return (retval); @@ -304,7 +317,9 @@ gpiobus_add_child(device_t dev, u_int or device_delete_child(dev, child); return (0); } + resource_list_init(&devi->rl); device_set_ivars(child, devi); + return (child); } @@ -314,14 +329,103 @@ gpiobus_hinted_child(device_t bus, const struct gpiobus_softc *sc = GPIOBUS_SOFTC(bus); struct gpiobus_ivar *devi; device_t child; - int pins; - + int irq, pins; child = BUS_ADD_CHILD(bus, 0, dname, dunit); devi = GPIOBUS_IVAR(child); resource_int_value(dname, dunit, "pins", &pins); if (gpiobus_parse_pins(sc, child, pins)) device_delete_child(bus, child); + if (resource_int_value(dname, dunit, "irq", &irq) == 0) { + if (bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1) != 0) + device_printf(bus, + "warning: bus_set_resource() failed\n"); + } +} + +static int +gpiobus_set_resource(device_t dev, device_t child, int type, int rid, + u_long start, u_long count) +{ + struct gpiobus_ivar *devi; + struct resource_list_entry *rle; + + dprintf("%s: entry (%p, %p, %d, %d, %p, %ld)\n", + __func__, dev, child, type, rid, (void *)(intptr_t)start, count); + devi = GPIOBUS_IVAR(child); + rle = resource_list_add(&devi->rl, type, rid, start, + start + count - 1, count); + if (rle == NULL) + return (ENXIO); + + return (0); +} + +static struct resource * +gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct gpiobus_softc *sc; + struct resource *rv; + struct resource_list *rl; + struct resource_list_entry *rle; + int isdefault; + + if (type != SYS_RES_IRQ) + return (NULL); + isdefault = (start == 0UL && end == ~0UL && count == 1); + rle = NULL; + if (isdefault) { + rl = BUS_GET_RESOURCE_LIST(bus, child); + if (rl == NULL) + return (NULL); + rle = resource_list_find(rl, type, *rid); + if (rle == NULL) + return (NULL); + if (rle->res != NULL) + panic("%s: resource entry is busy", __func__); + start = rle->start; + count = rle->count; + end = rle->end; + } + sc = device_get_softc(bus); + rv = rman_reserve_resource(&sc->sc_intr_rman, start, end, count, flags, + child); + if (rv == NULL) + return (NULL); + rman_set_rid(rv, *rid); + if ((flags & RF_ACTIVE) != 0 && + bus_activate_resource(child, type, *rid, rv) != 0) { + rman_release_resource(rv); + return (NULL); + } + + return (rv); +} + +static int +gpiobus_release_resource(device_t bus __unused, device_t child, int type, + int rid, struct resource *r) +{ + int error; + + if (rman_get_flags(r) & RF_ACTIVE) { + error = bus_deactivate_resource(child, type, rid, r); + if (error) + return (error); + } + + return (rman_release_resource(r)); +} + +static struct resource_list * +gpiobus_get_resource_list(device_t bus __unused, device_t child) +{ + struct gpiobus_ivar *ivar; + + ivar = GPIOBUS_IVAR(child); + + return (&ivar->rl); } static int @@ -450,6 +554,15 @@ static device_method_t gpiobus_methods[] DEVMETHOD(device_resume, gpiobus_resume), /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_config_intr, bus_generic_config_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_set_resource, gpiobus_set_resource), + DEVMETHOD(bus_alloc_resource, gpiobus_alloc_resource), + DEVMETHOD(bus_release_resource, gpiobus_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_get_resource_list, gpiobus_get_resource_list), DEVMETHOD(bus_add_child, gpiobus_add_child), DEVMETHOD(bus_print_child, gpiobus_print_child), DEVMETHOD(bus_child_pnpinfo_str, gpiobus_child_pnpinfo_str), Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Mon Nov 17 22:22:16 2014 (r274637) +++ head/sys/dev/gpio/gpiobusvar.h Tue Nov 18 01:38:39 2014 (r274638) @@ -34,6 +34,7 @@ #include #include +#include #ifdef FDT #include @@ -62,6 +63,7 @@ struct gpiobus_softc { struct mtx sc_mtx; /* bus mutex */ + struct rman sc_intr_rman; /* isr resources */ device_t sc_busdev; /* bus device */ device_t sc_owner; /* bus owner */ device_t sc_dev; /* driver device */ @@ -71,6 +73,7 @@ struct gpiobus_softc struct gpiobus_ivar { + struct resource_list rl; /* isr resource list */ uint32_t npins; /* pins total */ uint32_t *flags; /* pins flags */ uint32_t *pins; /* pins map */ Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Mon Nov 17 22:22:16 2014 (r274637) +++ head/sys/dev/gpio/ofw_gpiobus.c Tue Nov 18 01:38:39 2014 (r274638) @@ -238,6 +238,13 @@ ofw_gpiobus_setup_devinfo(device_t dev, free(dinfo, M_DEVBUF); return (NULL); } + /* And now the interrupt resources. */ + resource_list_init(&dinfo->opd_dinfo.rl); + if (ofw_bus_intr_to_rl(dev, node, &dinfo->opd_dinfo.rl) != 0) { + ofw_bus_gen_destroy_devinfo(&dinfo->opd_obdinfo); + free(dinfo, M_DEVBUF); + return (NULL); + } return (dinfo); } @@ -246,6 +253,7 @@ static void ofw_gpiobus_destroy_devinfo(struct ofw_gpiobus_devinfo *dinfo) { + resource_list_free(&dinfo->opd_dinfo.rl); ofw_bus_gen_destroy_devinfo(&dinfo->opd_obdinfo); free(dinfo, M_DEVBUF); } @@ -326,6 +334,8 @@ ofw_gpiobus_print_child(device_t dev, de retval += bus_print_child_header(dev, child); retval += printf(" at pin(s) "); gpiobus_print_pins(&devi->opd_dinfo); + resource_list_print_type(&devi->opd_dinfo.rl, "irq", SYS_RES_IRQ, + "%ld"); retval += bus_print_child_footer(dev, child); return (retval); From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 01:39:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 257ED141; Tue, 18 Nov 2014 01:39:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0710D68B; Tue, 18 Nov 2014 01:39:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAI1dNNQ004092; Tue, 18 Nov 2014 01:39:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAI1dNqO004091; Tue, 18 Nov 2014 01:39:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411180139.sAI1dNqO004091@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 01:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274640 - head/sys/modules/if_gre X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 01:39:24 -0000 Author: imp Date: Tue Nov 18 01:39:23 2014 New Revision: 274640 URL: https://svnweb.freebsd.org/changeset/base/274640 Log: Use automated MK_INET*_SUPPORT code here as well. Modified: head/sys/modules/if_gre/Makefile Modified: head/sys/modules/if_gre/Makefile ============================================================================== --- head/sys/modules/if_gre/Makefile Tue Nov 18 01:39:21 2014 (r274639) +++ head/sys/modules/if_gre/Makefile Tue Nov 18 01:39:23 2014 (r274640) @@ -1,29 +1,16 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6 -.include "${.CURDIR}/../../conf/kern.opts.mk" +SYSDIR?=${.CURDIR}/../.. +.PATH: ${SYSDIR}/net ${SYSDIR}/netinet ${SYSDIR}/netinet6 +.include "${SYSDIR}/conf/kern.opts.mk" KMOD= if_gre SRCS= if_gre.c opt_inet.h opt_inet6.h -.if defined(KERNBUILDDIR) -OPT_INET!= cat ${KERNBUILDDIR}/opt_inet.h; echo -.if empty(OPT_INET) -MK_INET_SUPPORT=no -.endif -.endif - .if ${MK_INET_SUPPORT} != "no" SRCS+= ip_gre.c .endif -.if defined(KERNBUILDDIR) -OPT_INET6!= cat ${KERNBUILDDIR}/opt_inet6.h; echo -.if empty(OPT_INET6) -MK_INET6_SUPPORT=no -.endif -.endif - .if ${MK_INET6_SUPPORT} != "no" SRCS+= ip6_gre.c .endif From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 01:39:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FBD4FE4; Tue, 18 Nov 2014 01:39:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C232689; Tue, 18 Nov 2014 01:39:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAI1dL5O004048; Tue, 18 Nov 2014 01:39:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAI1dLAS004047; Tue, 18 Nov 2014 01:39:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411180139.sAI1dLAS004047@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 01:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274639 - head/sys/dev/pccbb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 01:39:22 -0000 Author: imp Date: Tue Nov 18 01:39:21 2014 New Revision: 274639 URL: https://svnweb.freebsd.org/changeset/base/274639 Log: Modernize comments about BIOSes being lame since in this detail they aren't lame, the rules changed along the way. Catch up to 1999 or so with the new rules. Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Tue Nov 18 01:38:39 2014 (r274638) +++ head/sys/dev/pccbb/pccbb.c Tue Nov 18 01:39:21 2014 (r274639) @@ -1584,13 +1584,17 @@ cbb_resume(device_t self) uint32_t tmp; /* - * Some BIOSes will not save the BARs for the pci chips, so we - * must do it ourselves. If the BAR is reset to 0 for an I/O - * device, it will read back as 0x1, so no explicit test for - * memory devices are needed. + * In the APM and early ACPI era, BIOSes saved the PCI config + * registers. As chips became more complicated, that functionality moved + * into the ACPI code / tables. We must therefore, restore the settings + * we made here to make sure the device come back. Transitions to Dx + * from D0 and back to D0 cause the bridge to lose its config space, so + * all the bus mappings and such are preserved. * - * Note: The PCI bus code should do this automatically for us on - * suspend/resume, but until it does, we have to cope. + * For most drivers, the PCI layer handles this saving. However, + * sicne there's much black magic and archane art hidden in these + * few lines of code that would be difficult to transition into + * the PCI layer. */ pci_write_config(self, CBBR_SOCKBASE, rman_get_start(sc->base_res), 4); DEVPRINTF((self, "PCI Memory allocated: %08lx\n", From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 01:54:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78712422; Tue, 18 Nov 2014 01:54:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6310A882; Tue, 18 Nov 2014 01:54:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAI1sXSs012800; Tue, 18 Nov 2014 01:54:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAI1sV7P012791; Tue, 18 Nov 2014 01:54:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411180154.sAI1sV7P012791@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 18 Nov 2014 01:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274641 - in head/sys: arm/freescale/imx arm/ti dev/iicbus dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 01:54:33 -0000 Author: ian Date: Tue Nov 18 01:54:31 2014 New Revision: 274641 URL: https://svnweb.freebsd.org/changeset/base/274641 Log: Allow i2c bus speed to be configured via hints, FDT data, and sysctl. The current support for controlling i2c bus speed is an inconsistant mess. There are 4 symbolic speed values defined, UNKNOWN, SLOW, FAST, FASTEST. It seems to be universally assumed that SLOW means the standard 100KHz rate from the original spec. Nothing ever calls iicbus_reset() with a speed of FAST, although some drivers would treat it as the 400KHz standard speed. Mostly iicbus_reset() is called with the speed set to UNKNOWN or FASTEST, and there's really no telling what any individual driver will do with those. The speed of an i2c bus is limited by the speed of the slowest device on the bus. This means that generally the bus speed needs to be configured based on the board/system and the components within it. Historically for i2c we've configured with device hints. Newer systems use FDT data and it documents a clock-frequency property for i2c busses. Hobbyists and developers are likely to want on the fly changes. These changes provide all 3 methods, but do not require any existing drivers to change to use the new facilities. This adds an iicbus method, iicbus_get_frequency(dev, speed) that gets the frequency for the requested symbolic speed. If the symbolic speed is SLOW or if there is no speed configured for the bus, the returned value is 100KHz, always. Otherwise, if bus speed is configured by hints, fdt, tunable, or sysctl, that speed is returned. It also adds a helper function, iicbus_init_frequency() that any bus driver subclassed from iicbus can initialize the frequency from some other source of info. Initial driver implementations are provided for Freescale and TI. Differential Revision: https://reviews.freebsd.org/D1174 PR: 195009 Modified: head/sys/arm/freescale/imx/imx_i2c.c head/sys/arm/ti/ti_i2c.c head/sys/dev/iicbus/iicbus.c head/sys/dev/iicbus/iicbus.h head/sys/dev/iicbus/iicbus_if.m head/sys/dev/ofw/ofw_iicbus.c Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Tue Nov 18 01:39:23 2014 (r274640) +++ head/sys/arm/freescale/imx/imx_i2c.c Tue Nov 18 01:54:31 2014 (r274641) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -45,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include "iicbus_if.h" @@ -79,6 +82,32 @@ __FBSDID("$FreeBSD$"); #define I2C_BAUD_RATE_DEF 0x3F #define I2C_DFSSR_DIV 0x10 +/* + * A table of available divisors and the associated coded values to put in the + * FDR register to achieve that divisor.. There is no algorithmic relationship I + * can see between divisors and the codes that go into the register. The table + * begins and ends with entries that handle insane configuration values. + */ +struct clkdiv { + u_int divisor; + u_int regcode; +}; +static struct clkdiv clkdiv_table[] = { + { 0, 0x20 }, { 22, 0x20 }, { 24, 0x21 }, { 26, 0x22 }, + { 28, 0x23 }, { 30, 0x00 }, { 32, 0x24 }, { 36, 0x25 }, + { 40, 0x26 }, { 42, 0x03 }, { 44, 0x27 }, { 48, 0x28 }, + { 52, 0x05 }, { 56, 0x29 }, { 60, 0x06 }, { 64, 0x2a }, + { 72, 0x2b }, { 80, 0x2c }, { 88, 0x09 }, { 96, 0x2d }, + { 104, 0x0a }, { 112, 0x2e }, { 128, 0x2f }, { 144, 0x0c }, + { 160, 0x30 }, { 192, 0x31 }, { 224, 0x32 }, { 240, 0x0f }, + { 256, 0x33 }, { 288, 0x10 }, { 320, 0x34 }, { 384, 0x35 }, + { 448, 0x36 }, { 480, 0x13 }, { 512, 0x37 }, { 576, 0x14 }, + { 640, 0x38 }, { 768, 0x39 }, { 896, 0x3a }, { 960, 0x17 }, + { 1024, 0x3b }, { 1152, 0x18 }, { 1280, 0x3c }, { 1536, 0x3d }, + { 1792, 0x3e }, { 1920, 0x1b }, { 2048, 0x3f }, { 2304, 0x1c }, + { 2560, 0x1d }, { 3072, 0x1e }, { 3840, 0x1f }, {UINT_MAX, 0x1f} +}; + #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) @@ -390,28 +419,29 @@ static int i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr) { struct i2c_softc *sc; - uint8_t baud_rate; + u_int busfreq, div, i, ipgfreq; sc = device_get_softc(dev); - switch (speed) { - case IIC_FAST: - baud_rate = I2C_BAUD_RATE_FAST; - break; - case IIC_SLOW: - case IIC_UNKNOWN: - case IIC_FASTEST: - default: - baud_rate = I2C_BAUD_RATE_DEF; - break; + /* + * Look up the divisor that gives the nearest speed that doesn't exceed + * the configured value for the bus. + */ + ipgfreq = imx_ccm_ipg_hz(); + busfreq = IICBUS_GET_FREQUENCY(sc->iicbus, speed); + div = (ipgfreq + busfreq - 1) / busfreq; + for (i = 0; i < nitems(clkdiv_table); i++) { + if (clkdiv_table[i].divisor >= div) + break; } + div = clkdiv_table[i].regcode; mtx_lock(&sc->mutex); i2c_write_reg(sc, I2C_CONTROL_REG, 0x0); i2c_write_reg(sc, I2C_STATUS_REG, 0x0); DELAY(1000); - i2c_write_reg(sc, I2C_FDR_REG, 20); + i2c_write_reg(sc, I2C_FDR_REG, (uint8_t)div); i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN); DELAY(1000); i2c_write_reg(sc, I2C_STATUS_REG, 0x0); Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Tue Nov 18 01:39:23 2014 (r274640) +++ head/sys/arm/ti/ti_i2c.c Tue Nov 18 01:54:31 2014 (r274641) @@ -102,8 +102,7 @@ struct ti_i2c_softc struct ti_i2c_clock_config { - int speed; - int bitrate; + u_int frequency; /* Bus frequency in Hz */ uint8_t psc; /* Fast/Standard mode prescale divider */ uint8_t scll; /* Fast/Standard mode SCL low time */ uint8_t sclh; /* Fast/Standard mode SCL high time */ @@ -113,12 +112,11 @@ struct ti_i2c_clock_config #if defined(SOC_OMAP4) static struct ti_i2c_clock_config ti_omap4_i2c_clock_configs[] = { - { IIC_UNKNOWN, 100000, 23, 13, 15, 0, 0}, - { IIC_SLOW, 100000, 23, 13, 15, 0, 0}, - { IIC_FAST, 400000, 9, 5, 7, 0, 0}, - { IIC_FASTEST, 1000000, 5, 3, 4, 0, 0}, - /* { IIC_FASTEST, 3200000, 1, 113, 115, 7, 10}, - HS mode */ - { -1, 0 } + { 100000, 23, 13, 15, 0, 0}, + { 400000, 9, 5, 7, 0, 0}, + { 1000000, 5, 3, 4, 0, 0}, +/* { 3200000, 1, 113, 115, 7, 10}, - HS mode */ + { 0 /* Table terminator */ } }; #endif @@ -128,11 +126,9 @@ static struct ti_i2c_clock_config ti_oma * clock to 12Mhz, for 400kHz I2C clock set the internal clock to 24Mhz. */ static struct ti_i2c_clock_config ti_am335x_i2c_clock_configs[] = { - { IIC_UNKNOWN, 100000, 7, 59, 61, 0, 0}, - { IIC_SLOW, 100000, 7, 59, 61, 0, 0}, - { IIC_FAST, 400000, 3, 23, 25, 0, 0}, - { IIC_FASTEST, 400000, 3, 23, 25, 0, 0}, - { -1, 0 } + { 100000, 7, 59, 61, 0, 0}, + { 400000, 3, 23, 25, 0, 0}, + { 0 /* Table terminator */ } }; #endif @@ -508,6 +504,7 @@ ti_i2c_reset(struct ti_i2c_softc *sc, u_ { int timeout; struct ti_i2c_clock_config *clkcfg; + u_int busfreq; uint16_t fifo_trsh, reg, scll, sclh; switch (ti_chip()) { @@ -524,13 +521,24 @@ ti_i2c_reset(struct ti_i2c_softc *sc, u_ default: panic("Unknown Ti SoC, unable to reset the i2c"); } - while (clkcfg->speed != -1) { - if (clkcfg->speed == speed) + + /* + * If we haven't attached the bus yet, just init at the default slow + * speed. This lets us get the hardware initialized enough to attach + * the bus which is where the real speed configuration is handled. After + * the bus is attached, get the configured speed from it. Search the + * configuration table for the best speed we can do that doesn't exceed + * the requested speed. + */ + if (sc->sc_iicbus == NULL) + busfreq = 100000; + else + busfreq = IICBUS_GET_FREQUENCY(sc->sc_iicbus, speed); + for (;;) { + if (clkcfg[1].frequency == 0 || clkcfg[1].frequency > busfreq) break; clkcfg++; } - if (clkcfg->speed == -1) - return (EINVAL); /* * 23.1.4.3 - HS I2C Software Reset Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Tue Nov 18 01:39:23 2014 (r274640) +++ head/sys/dev/iicbus/iicbus.c Tue Nov 18 01:54:31 2014 (r274641) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -96,6 +97,7 @@ iicbus_attach(device_t dev) sc->dev = dev; mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF); + iicbus_init_frequency(dev, 0); iicbus_reset(dev, IIC_FASTEST, 0, NULL); if (resource_int_value(device_get_name(dev), device_get_unit(dev), "strict", &strict) == 0) @@ -243,6 +245,51 @@ iicbus_null_repeated_start(device_t dev, return (IIC_ENOTSUPP); } +void +iicbus_init_frequency(device_t dev, u_int bus_freq) +{ + struct iicbus_softc *sc = IICBUS_SOFTC(dev); + + /* + * If a bus frequency value was passed in, use it. Otherwise initialize + * it first to the standard i2c 100KHz frequency, then override that + * from a hint if one exists. + */ + if (bus_freq > 0) + sc->bus_freq = bus_freq; + else { + sc->bus_freq = 100000; + resource_int_value(device_get_name(dev), device_get_unit(dev), + "frequency", (int *)&sc->bus_freq); + } + /* + * Set up the sysctl that allows the bus frequency to be changed. + * It is flagged as a tunable so that the user can set the value in + * loader(8), and that will override any other setting from any source. + * The sysctl tunable/value is the one most directly controlled by the + * user and thus the one that always takes precedence. + */ + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "frequency", CTLFLAG_RW | CTLFLAG_TUN, &sc->bus_freq, + sc->bus_freq, "Bus frequency in Hz"); +} + +static u_int +iicbus_get_frequency(device_t dev, u_char speed) +{ + struct iicbus_softc *sc = IICBUS_SOFTC(dev); + + /* + * If the frequency has not been configured for the bus, or the request + * is specifically for SLOW speed, use the standard 100KHz rate, else + * use the configured bus speed. + */ + if (sc->bus_freq == 0 || speed == IIC_SLOW) + return (100000); + return (sc->bus_freq); +} + static device_method_t iicbus_methods[] = { /* device interface */ DEVMETHOD(device_probe, iicbus_probe), @@ -260,6 +307,7 @@ static device_method_t iicbus_methods[] /* iicbus interface */ DEVMETHOD(iicbus_transfer, iicbus_transfer), + DEVMETHOD(iicbus_get_frequency, iicbus_get_frequency), DEVMETHOD_END }; Modified: head/sys/dev/iicbus/iicbus.h ============================================================================== --- head/sys/dev/iicbus/iicbus.h Tue Nov 18 01:39:23 2014 (r274640) +++ head/sys/dev/iicbus/iicbus.h Tue Nov 18 01:54:31 2014 (r274641) @@ -44,6 +44,7 @@ struct iicbus_softc u_char strict; /* deny operations that violate the * I2C protocol */ struct mtx lock; + u_int bus_freq; /* Configured bus Hz. */ }; struct iicbus_ivar @@ -67,7 +68,8 @@ IICBUS_ACCESSOR(nostop, NOSTOP, bool) #define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock) #define IICBUS_ASSERT_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED) -extern int iicbus_generic_intr(device_t dev, int event, char *buf); +int iicbus_generic_intr(device_t dev, int event, char *buf); +void iicbus_init_frequency(device_t dev, u_int bus_freq); extern driver_t iicbus_driver; extern devclass_t iicbus_devclass; Modified: head/sys/dev/iicbus/iicbus_if.m ============================================================================== --- head/sys/dev/iicbus/iicbus_if.m Tue Nov 18 01:39:23 2014 (r274640) +++ head/sys/dev/iicbus/iicbus_if.m Tue Nov 18 01:54:31 2014 (r274641) @@ -31,6 +31,15 @@ INTERFACE iicbus; +CODE { + static u_int + iicbus_default_frequency(device_t bus, u_char speed) + { + + return (100000); + } +}; + # # Interpret interrupt # @@ -115,3 +124,14 @@ METHOD int transfer { struct iic_msg *msgs; uint32_t nmsgs; }; + +# +# Return the frequency in Hz for the bus running at the given +# symbolic speed. Only the IIC_SLOW speed has meaning, it is always +# 100KHz. The UNKNOWN, FAST, and FASTEST rates all map to the +# configured bus frequency, or 100KHz when not otherwise configured. +# +METHOD u_int get_frequency { + device_t dev; + u_char speed; +} DEFAULT iicbus_default_frequency; Modified: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- head/sys/dev/ofw/ofw_iicbus.c Tue Nov 18 01:39:23 2014 (r274640) +++ head/sys/dev/ofw/ofw_iicbus.c Tue Nov 18 01:54:31 2014 (r274641) @@ -101,12 +101,24 @@ ofw_iicbus_attach(device_t dev) { struct iicbus_softc *sc = IICBUS_SOFTC(dev); struct ofw_iicbus_devinfo *dinfo; - phandle_t child; - pcell_t paddr; + phandle_t child, node; + pcell_t freq, paddr; device_t childdev; sc->dev = dev; mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF); + + /* + * If there is a clock-frequency property for the device node, use it as + * the starting value for the bus frequency. Then call the common + * routine that handles the tunable/sysctl which allows the FDT value to + * be overridden by the user. + */ + node = ofw_bus_get_node(dev); + freq = 0; + OF_getencprop(node, "clock-frequency", &freq, sizeof(freq)); + iicbus_init_frequency(dev, freq); + iicbus_reset(dev, IIC_FASTEST, 0, NULL); bus_generic_probe(dev); @@ -115,8 +127,7 @@ ofw_iicbus_attach(device_t dev) /* * Attach those children represented in the device tree. */ - for (child = OF_child(ofw_bus_get_node(dev)); child != 0; - child = OF_peer(child)) { + for (child = OF_child(node); child != 0; child = OF_peer(child)) { /* * Try to get the I2C address first from the i2c-address * property, then try the reg property. It moves around From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 02:11:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48F2D76F; Tue, 18 Nov 2014 02:11:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36190A3D; Tue, 18 Nov 2014 02:11:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAI2B8dE019517; Tue, 18 Nov 2014 02:11:08 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAI2B85F019516; Tue, 18 Nov 2014 02:11:08 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201411180211.sAI2B85F019516@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 18 Nov 2014 02:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274642 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 02:11:08 -0000 Author: loos Date: Tue Nov 18 02:11:07 2014 New Revision: 274642 URL: https://svnweb.freebsd.org/changeset/base/274642 Log: Remove unnecessary code. After r273566, the gpiobus version of bus_print_child() also works on FDT systems. Modified: head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Tue Nov 18 01:54:31 2014 (r274641) +++ head/sys/dev/gpio/ofw_gpiobus.c Tue Nov 18 02:11:07 2014 (r274642) @@ -324,23 +324,6 @@ ofw_gpiobus_add_child(device_t dev, u_in return (child); } -static int -ofw_gpiobus_print_child(device_t dev, device_t child) -{ - struct ofw_gpiobus_devinfo *devi; - int retval = 0; - - devi = device_get_ivars(child); - retval += bus_print_child_header(dev, child); - retval += printf(" at pin(s) "); - gpiobus_print_pins(&devi->opd_dinfo); - resource_list_print_type(&devi->opd_dinfo.rl, "irq", SYS_RES_IRQ, - "%ld"); - retval += bus_print_child_footer(dev, child); - - return (retval); -} - static const struct ofw_bus_devinfo * ofw_gpiobus_get_devinfo(device_t bus, device_t dev) { @@ -358,7 +341,6 @@ static device_method_t ofw_gpiobus_metho /* Bus interface */ DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), - DEVMETHOD(bus_print_child, ofw_gpiobus_print_child), DEVMETHOD(bus_add_child, ofw_gpiobus_add_child), /* ofw_bus interface */ From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 02:41:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CE3DB71; Tue, 18 Nov 2014 02:41:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A233CD6; Tue, 18 Nov 2014 02:41:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAI2famI035143; Tue, 18 Nov 2014 02:41:36 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAI2fZ35035140; Tue, 18 Nov 2014 02:41:35 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201411180241.sAI2fZ35035140@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 18 Nov 2014 02:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274643 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 02:41:36 -0000 Author: loos Date: Tue Nov 18 02:41:35 2014 New Revision: 274643 URL: https://svnweb.freebsd.org/changeset/base/274643 Log: Fix gpiobus_child_location_str() to return a real string with the mapped pins. Make gpiobus_print_pins() static again. Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Tue Nov 18 02:11:07 2014 (r274642) +++ head/sys/dev/gpio/gpiobus.c Tue Nov 18 02:41:35 2014 (r274643) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #define dprintf(x, arg...) #endif +static void gpiobus_print_pins(struct gpiobus_ivar *, char *, size_t); static int gpiobus_parse_pins(struct gpiobus_softc *, device_t, int); static int gpiobus_probe(device_t); static int gpiobus_attach(device_t); @@ -69,11 +70,11 @@ static int gpiobus_pin_set(device_t, dev static int gpiobus_pin_get(device_t, device_t, uint32_t, unsigned int*); static int gpiobus_pin_toggle(device_t, device_t, uint32_t); -void -gpiobus_print_pins(struct gpiobus_ivar *devi) +static void +gpiobus_print_pins(struct gpiobus_ivar *devi, char *buf, size_t buflen) { - int range_start, range_stop, need_coma; - int i; + char tmp[128]; + int i, range_start, range_stop, need_coma; if (devi->npins == 0) return; @@ -83,11 +84,15 @@ gpiobus_print_pins(struct gpiobus_ivar * for (i = 1; i < devi->npins; i++) { if (devi->pins[i] != (range_stop + 1)) { if (need_coma) - printf(","); + strlcat(buf, ",", buflen); + memset(tmp, 0, sizeof(tmp)); if (range_start != range_stop) - printf("%d-%d", range_start, range_stop); + snprintf(tmp, sizeof(tmp) - 1, "%d-%d", + range_start, range_stop); else - printf("%d", range_start); + snprintf(tmp, sizeof(tmp) - 1, "%d", + range_start); + strlcat(buf, tmp, buflen); range_start = range_stop = devi->pins[i]; need_coma = 1; @@ -97,11 +102,15 @@ gpiobus_print_pins(struct gpiobus_ivar * } if (need_coma) - printf(","); + strlcat(buf, ",", buflen); + memset(tmp, 0, sizeof(tmp)); if (range_start != range_stop) - printf("%d-%d", range_start, range_stop); + snprintf(tmp, sizeof(tmp) - 1, "%d-%d", + range_start, range_stop); else - printf("%d", range_start); + snprintf(tmp, sizeof(tmp) - 1, "%d", + range_start); + strlcat(buf, tmp, buflen); } int @@ -273,12 +282,16 @@ gpiobus_resume(device_t dev) static int gpiobus_print_child(device_t dev, device_t child) { - struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); + char pins[128]; int retval = 0; + struct gpiobus_ivar *devi; + devi = GPIOBUS_IVAR(child); + memset(pins, 0, sizeof(pins)); retval += bus_print_child_header(dev, child); retval += printf(" at pin(s) "); - gpiobus_print_pins(devi); + gpiobus_print_pins(devi, pins, sizeof(pins)); + retval += printf("%s", pins); resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); retval += bus_print_child_footer(dev, child); @@ -289,8 +302,12 @@ static int gpiobus_child_location_str(device_t bus, device_t child, char *buf, size_t buflen) { + struct gpiobus_ivar *devi; + + devi = GPIOBUS_IVAR(child); + strlcpy(buf, "pin(s)=", buflen); + gpiobus_print_pins(devi, buf, buflen); - snprintf(buf, buflen, "pins=?"); return (0); } Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Tue Nov 18 02:11:07 2014 (r274642) +++ head/sys/dev/gpio/gpiobusvar.h Tue Nov 18 02:41:35 2014 (r274643) @@ -94,7 +94,6 @@ gpio_map_gpios(device_t bus, phandle_t d device_t ofw_gpiobus_add_fdt_child(device_t, phandle_t); #endif -void gpiobus_print_pins(struct gpiobus_ivar *); int gpiobus_init_softc(device_t); extern driver_t gpiobus_driver; From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 03:26:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 039E7349; Tue, 18 Nov 2014 03:26:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB2D61CC; Tue, 18 Nov 2014 03:26:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAI3QqZD055657; Tue, 18 Nov 2014 03:26:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAI3Qq6h055656; Tue, 18 Nov 2014 03:26:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411180326.sAI3Qq6h055656@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 18 Nov 2014 03:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274644 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 03:26:53 -0000 Author: ian Date: Tue Nov 18 03:26:52 2014 New Revision: 274644 URL: https://svnweb.freebsd.org/changeset/base/274644 Log: Fix the i2c bus speed divisors for TI OMAP4 and AM335x. For OMAP4, the old values for 1MHz gave a bus frequency of about 890KHz. The new numbers hit 1MHz exactly. For AM335x the prescaler values are adjusted to give a 24MHz clock for all 3 standard speeds, as the manual recommends (as near as we can tell, there are errors and typos apparent in the document). Also, 1MHz speed is added, and has been tested successfully on a BeagleboneWhite board. PR: 195009 Modified: head/sys/arm/ti/ti_i2c.c Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Tue Nov 18 02:41:35 2014 (r274643) +++ head/sys/arm/ti/ti_i2c.c Tue Nov 18 03:26:52 2014 (r274644) @@ -111,10 +111,15 @@ struct ti_i2c_clock_config }; #if defined(SOC_OMAP4) +/* + * OMAP4 i2c bus clock is 96MHz / ((psc + 1) * (scll + 7 + sclh + 5)). + * The prescaler values for 100KHz and 400KHz modes come from the table in the + * OMAP4 TRM. The table doesn't list 1MHz; these values should give that speed. + */ static struct ti_i2c_clock_config ti_omap4_i2c_clock_configs[] = { { 100000, 23, 13, 15, 0, 0}, { 400000, 9, 5, 7, 0, 0}, - { 1000000, 5, 3, 4, 0, 0}, + { 1000000, 5, 1, 3, 0, 0}, /* { 3200000, 1, 113, 115, 7, 10}, - HS mode */ { 0 /* Table terminator */ } }; @@ -122,12 +127,13 @@ static struct ti_i2c_clock_config ti_oma #if defined(SOC_TI_AM335X) /* - * AM335X doesn't support HS mode. For 100kHz I2C clock set the internal - * clock to 12Mhz, for 400kHz I2C clock set the internal clock to 24Mhz. + * AM335x i2c bus clock is 48MHZ / ((psc + 1) * (scll + 7 + sclh + 5)) + * In all cases we prescale the clock to 24MHz as recommended in the manual. */ static struct ti_i2c_clock_config ti_am335x_i2c_clock_configs[] = { - { 100000, 7, 59, 61, 0, 0}, - { 400000, 3, 23, 25, 0, 0}, + { 100000, 1, 111, 117, 0, 0}, + { 400000, 1, 23, 25, 0, 0}, + { 1000000, 1, 5, 7, 0, 0}, { 0 /* Table terminator */ } }; #endif From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 06:46:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33A4BD59; Tue, 18 Nov 2014 06:46:32 +0000 (UTC) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru [78.107.232.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dchagin.static.corbina.net", Issuer "dchagin.static.corbina.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B45EB880; Tue, 18 Nov 2014 06:46:30 +0000 (UTC) Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.9/8.14.9) with ESMTP id sAI6kRNR000972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 18 Nov 2014 09:46:27 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.9/8.14.9/Submit) id sAI6kR9M000971; Tue, 18 Nov 2014 09:46:27 +0300 (MSK) (envelope-from dchagin) Date: Tue, 18 Nov 2014 09:46:26 +0300 From: Chagin Dmitry To: John Baldwin Subject: Re: svn commit: r274635 - head/sys/dev/pci Message-ID: <20141118064626.GA956@dchagin.static.corbina.net> References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline In-Reply-To: <2245618.H2SPKlpWdS@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 06:46:32 -0000 --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 17, 2014 at 05:45:23PM -0500, John Baldwin wrote: > On Monday, November 17, 2014 08:25:21 PM Dmitry Chagin wrote: > > Author: dchagin > > Date: Mon Nov 17 20:25:21 2014 > > New Revision: 274635 > > URL: https://svnweb.freebsd.org/changeset/base/274635 > >=20 > > Log: > > Use the correct device as the power_for_sleep() method > > always pass request up to parent bridge. > >=20 > > Reviewed by: jhb > > MFC after: 1 week > > xMFC: r274386,r274397 >=20 > Hmm, I had misread this diff as being another instance of what Adrian had= =20 > found. I think this is actually not correct. The parent of a pci device= =20 > ('dev' here) is a pciX device. pciX devices do not implement the=20 > PCIB_POWER_FOR_SLEEP method from pcib_if.m, so this probably just broke= =20 > Adrian's Asus laptop as now it will always use D3 again and ignore _SxD. ugh.. i understood, let me see more closely >=20 > You said that this change fixed your laptop, yes? Did it work before Adr= ian's=20 > change in r274386 and break afterwards? yes --=20 Have fun! chd --fUYQa+Pmc3FrFX/N Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlRq60IACgkQ0t2Tb3OO/O39JgCdHpPTc+4p2g2nm7LyggdTTNUv 8IAAoLP6nu/GLnfOBEFyenAJl293CZkz =xIpI -----END PGP SIGNATURE----- --fUYQa+Pmc3FrFX/N-- From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 13:38:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43D65A02; Tue, 18 Nov 2014 13:38:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30C776D5; Tue, 18 Nov 2014 13:38:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIDc8OJ051820; Tue, 18 Nov 2014 13:38:08 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIDc8uP051819; Tue, 18 Nov 2014 13:38:08 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411181338.sAIDc8uP051819@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 18 Nov 2014 13:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274652 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 13:38:08 -0000 Author: glebius Date: Tue Nov 18 13:38:07 2014 New Revision: 274652 URL: https://svnweb.freebsd.org/changeset/base/274652 Log: Collapse three contiguous comment blocks into one. Remove historical note about wrong assumptions 20 years ago. Use proper casing. Sponsored by: Nginx, Inc. Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Nov 18 13:05:24 2014 (r274651) +++ head/sys/vm/vnode_pager.c Tue Nov 18 13:38:07 2014 (r274652) @@ -727,17 +727,12 @@ vnode_pager_generic_getpages(struct vnod return VM_PAGER_BAD; bsize = vp->v_mount->mnt_stat.f_iosize; - - /* get the UNDERLYING device for the file with VOP_BMAP() */ - - /* - * originally, we did not check for an error return value -- assuming - * an fs always has a bmap entry point -- that assumption is wrong!!! - */ foff = IDX_TO_OFF(m[reqpage]->pindex); /* - * if we can't bmap, use old VOP code + * Get the underlying device blocks for the file with VOP_BMAP(). + * If the file system doesn't support VOP_BMAP, use old way of + * getting pages via VOP_READ. */ error = VOP_BMAP(vp, foff / bsize, &bo, &reqblock, NULL, NULL); if (error == EOPNOTSUPP) { From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 13:38:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33A5FAD5; Tue, 18 Nov 2014 13:38:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D4756D6; Tue, 18 Nov 2014 13:38:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIDc9ix051870; Tue, 18 Nov 2014 13:38:09 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIDc9U3051869; Tue, 18 Nov 2014 13:38:09 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201411181338.sAIDc9U3051869@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Tue, 18 Nov 2014 13:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274653 - head/usr.sbin/freebsd-update X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 13:38:10 -0000 Author: feld (ports committer) Date: Tue Nov 18 13:38:09 2014 New Revision: 274653 URL: https://svnweb.freebsd.org/changeset/base/274653 Log: Re-work non-persistent filesystem detection as it was not possible to detect /dev/md backed mfs filesystems that way. Differential Revision: https://reviews.freebsd.org/D1163 Approved by: ian Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Nov 18 13:38:07 2014 (r274652) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Nov 18 13:38:09 2014 (r274653) @@ -604,14 +604,13 @@ fetchupgrade_check_params () { echo ${WORKDIR} exit 1 fi - for i in tmpfs mdmfs; do - if df -t ${i} ${WORKDIR} >/dev/null 2>1; then - echo -n "`basename $0`: " - echo -n "${_WORKDIR_bad2}" - echo ${WORKDIR} - exit 1 - fi - done + case `df -T ${WORKDIR}` in */dev/md[0-9]* | *tmpfs*) + echo -n "`basename $0`: " + echo -n "${_WORKDIR_bad2}" + echo ${WORKDIR} + exit 1 + ;; + esac chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 14:11:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07FFF729; Tue, 18 Nov 2014 14:11:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7F54AF3; Tue, 18 Nov 2014 14:11:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIEBFw7069049; Tue, 18 Nov 2014 14:11:15 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIEBFlh069043; Tue, 18 Nov 2014 14:11:15 GMT (envelope-from br@FreeBSD.org) Message-Id: <201411181411.sAIEBFlh069043@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 18 Nov 2014 14:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274655 - in head/sys/dev/virtio: block mmio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 14:11:16 -0000 Author: br Date: Tue Nov 18 14:11:14 2014 New Revision: 274655 URL: https://svnweb.freebsd.org/changeset/base/274655 Log: Add Virtio MMIO bus driver. Sponsored by: DARPA, AFRL Added: head/sys/dev/virtio/mmio/ head/sys/dev/virtio/mmio/virtio_mmio.c (contents, props changed) head/sys/dev/virtio/mmio/virtio_mmio.h (contents, props changed) head/sys/dev/virtio/mmio/virtio_mmio_if.m (contents, props changed) Modified: head/sys/dev/virtio/block/virtio_blk.c Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Tue Nov 18 14:00:00 2014 (r274654) +++ head/sys/dev/virtio/block/virtio_blk.c Tue Nov 18 14:11:14 2014 (r274655) @@ -243,6 +243,8 @@ static driver_t vtblk_driver = { }; static devclass_t vtblk_devclass; +DRIVER_MODULE(virtio_blk, virtio_mmio, vtblk_driver, vtblk_devclass, + vtblk_modevent, 0); DRIVER_MODULE(virtio_blk, virtio_pci, vtblk_driver, vtblk_devclass, vtblk_modevent, 0); MODULE_VERSION(virtio_blk, 1); Added: head/sys/dev/virtio/mmio/virtio_mmio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/virtio/mmio/virtio_mmio.c Tue Nov 18 14:11:14 2014 (r274655) @@ -0,0 +1,800 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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. + */ + +/* + * VirtIO MMIO interface. + * This driver is heavily based on VirtIO PCI interface driver. + */ + +/* + * FDT example: + * virtio_block@1000 { + * compatible = "virtio,mmio"; + * reg = <0x1000 0x100>; + * interrupts = <63>; + * interrupt-parent = <&GIC>; + * }; + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "virtio_mmio_if.h" +#include "virtio_bus_if.h" +#include "virtio_if.h" + +#define PAGE_SHIFT 12 + +struct vtmmio_virtqueue { + struct virtqueue *vtv_vq; + int vtv_no_intr; +}; + +struct vtmmio_softc { + device_t dev; + device_t platform; + struct resource *res[2]; + + uint64_t vtmmio_features; + uint32_t vtmmio_flags; + + /* This "bus" will only ever have one child. */ + device_t vtmmio_child_dev; + struct virtio_feature_desc *vtmmio_child_feat_desc; + + int vtmmio_nvqs; + struct vtmmio_virtqueue *vtmmio_vqs; + void *ih; +}; + +static int vtmmio_probe(device_t); +static int vtmmio_attach(device_t); +static int vtmmio_detach(device_t); +static int vtmmio_suspend(device_t); +static int vtmmio_resume(device_t); +static int vtmmio_shutdown(device_t); +static void vtmmio_driver_added(device_t, driver_t *); +static void vtmmio_child_detached(device_t, device_t); +static int vtmmio_read_ivar(device_t, device_t, int, uintptr_t *); +static int vtmmio_write_ivar(device_t, device_t, int, uintptr_t); +static uint64_t vtmmio_negotiate_features(device_t, uint64_t); +static int vtmmio_with_feature(device_t, uint64_t); +static int vtmmio_alloc_virtqueues(device_t, int, int, + struct vq_alloc_info *); +static int vtmmio_setup_intr(device_t, enum intr_type); +static void vtmmio_stop(device_t); +static int vtmmio_reinit(device_t, uint64_t); +static void vtmmio_reinit_complete(device_t); +static void vtmmio_notify_virtqueue(device_t, uint16_t); +static uint8_t vtmmio_get_status(device_t); +static void vtmmio_set_status(device_t, uint8_t); +static void vtmmio_read_dev_config(device_t, bus_size_t, void *, int); +static void vtmmio_write_dev_config(device_t, bus_size_t, void *, int); +static void vtmmio_describe_features(struct vtmmio_softc *, const char *, + uint64_t); +static void vtmmio_probe_and_attach_child(struct vtmmio_softc *); +static int vtmmio_reinit_virtqueue(struct vtmmio_softc *, int); +static void vtmmio_free_interrupts(struct vtmmio_softc *); +static void vtmmio_free_virtqueues(struct vtmmio_softc *); +static void vtmmio_release_child_resources(struct vtmmio_softc *); +static void vtmmio_reset(struct vtmmio_softc *); +static void vtmmio_select_virtqueue(struct vtmmio_softc *, int); +static void vtmmio_vq_intr(void *); + +/* + * I/O port read/write wrappers. + */ +#define vtmmio_write_config_1(sc, o, v) \ + bus_write_1((sc)->res[0], (o), (v)); \ + VIRTIO_MMIO_NOTE(sc->platform, (o)) +#define vtmmio_write_config_2(sc, o, v) \ + bus_write_2((sc)->res[0], (o), (v)); \ + VIRTIO_MMIO_NOTE(sc->platform, (o)) +#define vtmmio_write_config_4(sc, o, v) \ + bus_write_4((sc)->res[0], (o), (v)); \ + VIRTIO_MMIO_NOTE(sc->platform, (o)) + +#define vtmmio_read_config_1(sc, o) \ + bus_read_1((sc)->res[0], (o)) +#define vtmmio_read_config_2(sc, o) \ + bus_read_2((sc)->res[0], (o)) +#define vtmmio_read_config_4(sc, o) \ + bus_read_4((sc)->res[0], (o)) + +static device_method_t vtmmio_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, vtmmio_probe), + DEVMETHOD(device_attach, vtmmio_attach), + DEVMETHOD(device_detach, vtmmio_detach), + DEVMETHOD(device_suspend, vtmmio_suspend), + DEVMETHOD(device_resume, vtmmio_resume), + DEVMETHOD(device_shutdown, vtmmio_shutdown), + + /* Bus interface. */ + DEVMETHOD(bus_driver_added, vtmmio_driver_added), + DEVMETHOD(bus_child_detached, vtmmio_child_detached), + DEVMETHOD(bus_read_ivar, vtmmio_read_ivar), + DEVMETHOD(bus_write_ivar, vtmmio_write_ivar), + + /* VirtIO bus interface. */ + DEVMETHOD(virtio_bus_negotiate_features, vtmmio_negotiate_features), + DEVMETHOD(virtio_bus_with_feature, vtmmio_with_feature), + DEVMETHOD(virtio_bus_alloc_virtqueues, vtmmio_alloc_virtqueues), + DEVMETHOD(virtio_bus_setup_intr, vtmmio_setup_intr), + DEVMETHOD(virtio_bus_stop, vtmmio_stop), + DEVMETHOD(virtio_bus_reinit, vtmmio_reinit), + DEVMETHOD(virtio_bus_reinit_complete, vtmmio_reinit_complete), + DEVMETHOD(virtio_bus_notify_vq, vtmmio_notify_virtqueue), + DEVMETHOD(virtio_bus_read_device_config, vtmmio_read_dev_config), + DEVMETHOD(virtio_bus_write_device_config, vtmmio_write_dev_config), + + DEVMETHOD_END +}; + +static driver_t vtmmio_driver = { + "virtio_mmio", + vtmmio_methods, + sizeof(struct vtmmio_softc) +}; + +devclass_t vtmmio_devclass; + +DRIVER_MODULE(virtio_mmio, simplebus, vtmmio_driver, vtmmio_devclass, 0, 0); +MODULE_VERSION(virtio_mmio, 1); +MODULE_DEPEND(virtio_mmio, simplebus, 1, 1, 1); +MODULE_DEPEND(virtio_mmio, virtio, 1, 1, 1); + +static int +vtmmio_setup_intr(device_t dev, enum intr_type type) +{ + struct vtmmio_softc *sc; + int rid; + int err; + + sc = device_get_softc(dev); + + err = VIRTIO_MMIO_SETUP_INTR(sc->platform, sc->dev, + vtmmio_vq_intr, sc); + if (err == 0) { + /* Okay we have backend-specific interrupts */ + return (0); + } + + rid = 0; + sc->res[1] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->res[1]) { + device_printf(dev, "Can't allocate interrupt\n"); + return (ENXIO); + } + + if (bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, vtmmio_vq_intr, sc, &sc->ih)) { + device_printf(dev, "Can't setup the interrupt\n"); + return (ENXIO); + } + + return (0); +} + +static int +vtmmio_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "virtio,mmio")) + return (ENXIO); + + device_set_desc(dev, "VirtIO MMIO adapter"); + return (BUS_PROBE_DEFAULT); +} + +static int +vtmmio_setup_platform(struct vtmmio_softc *sc) +{ + phandle_t platform_node; + struct fdt_ic *ic; + phandle_t xref; + phandle_t node; + + sc->platform = NULL; + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + if (OF_searchencprop(node, "platform", &xref, + sizeof(xref)) == -1) { + return (ENXIO); + } + + platform_node = OF_node_from_xref(xref); + + SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { + if (ic->iph == platform_node) { + sc->platform = ic->dev; + break; + } + } + + if (sc->platform == NULL) { + /* No platform-specific device. Ignore it. */ + } + + return (0); +} + +static int +vtmmio_attach(device_t dev) +{ + struct vtmmio_softc *sc; + device_t child; + int rid; + + sc = device_get_softc(dev); + sc->dev = dev; + + vtmmio_setup_platform(sc); + + rid = 0; + sc->res[0] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->res[0]) { + device_printf(dev, "Cannot allocate memory window.\n"); + return (ENXIO); + } + + vtmmio_reset(sc); + + /* Tell the host we've noticed this device. */ + vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_ACK); + + if ((child = device_add_child(dev, NULL, -1)) == NULL) { + device_printf(dev, "Cannot create child device.\n"); + vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_FAILED); + vtmmio_detach(dev); + return (ENOMEM); + } + + sc->vtmmio_child_dev = child; + vtmmio_probe_and_attach_child(sc); + + return (0); +} + +static int +vtmmio_detach(device_t dev) +{ + struct vtmmio_softc *sc; + device_t child; + int error; + + sc = device_get_softc(dev); + + if ((child = sc->vtmmio_child_dev) != NULL) { + error = device_delete_child(dev, child); + if (error) + return (error); + sc->vtmmio_child_dev = NULL; + } + + vtmmio_reset(sc); + + if (sc->res[0] != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, + sc->res[0]); + sc->res[0] = NULL; + } + + return (0); +} + +static int +vtmmio_suspend(device_t dev) +{ + + return (bus_generic_suspend(dev)); +} + +static int +vtmmio_resume(device_t dev) +{ + + return (bus_generic_resume(dev)); +} + +static int +vtmmio_shutdown(device_t dev) +{ + + (void) bus_generic_shutdown(dev); + + /* Forcibly stop the host device. */ + vtmmio_stop(dev); + + return (0); +} + +static void +vtmmio_driver_added(device_t dev, driver_t *driver) +{ + struct vtmmio_softc *sc; + + sc = device_get_softc(dev); + + vtmmio_probe_and_attach_child(sc); +} + +static void +vtmmio_child_detached(device_t dev, device_t child) +{ + struct vtmmio_softc *sc; + + sc = device_get_softc(dev); + + vtmmio_reset(sc); + vtmmio_release_child_resources(sc); +} + +static int +vtmmio_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) +{ + struct vtmmio_softc *sc; + + sc = device_get_softc(dev); + + if (sc->vtmmio_child_dev != child) + return (ENOENT); + + switch (index) { + case VIRTIO_IVAR_DEVTYPE: + case VIRTIO_IVAR_SUBDEVICE: + *result = vtmmio_read_config_4(sc, VIRTIO_MMIO_DEVICE_ID); + break; + case VIRTIO_IVAR_VENDOR: + *result = vtmmio_read_config_4(sc, VIRTIO_MMIO_VENDOR_ID); + break; + default: + return (ENOENT); + } + + return (0); +} + +static int +vtmmio_write_ivar(device_t dev, device_t child, int index, uintptr_t value) +{ + struct vtmmio_softc *sc; + + sc = device_get_softc(dev); + + if (sc->vtmmio_child_dev != child) + return (ENOENT); + + switch (index) { + case VIRTIO_IVAR_FEATURE_DESC: + sc->vtmmio_child_feat_desc = (void *) value; + break; + default: + return (ENOENT); + } + + return (0); +} + +static uint64_t +vtmmio_negotiate_features(device_t dev, uint64_t child_features) +{ + struct vtmmio_softc *sc; + uint64_t host_features, features; + + sc = device_get_softc(dev); + + host_features = vtmmio_read_config_4(sc, VIRTIO_MMIO_HOST_FEATURES); + vtmmio_describe_features(sc, "host", host_features); + + /* + * Limit negotiated features to what the driver, virtqueue, and + * host all support. + */ + features = host_features & child_features; + features = virtqueue_filter_features(features); + sc->vtmmio_features = features; + + vtmmio_describe_features(sc, "negotiated", features); + vtmmio_write_config_4(sc, VIRTIO_MMIO_GUEST_FEATURES, features); + + return (features); +} + +static int +vtmmio_with_feature(device_t dev, uint64_t feature) +{ + struct vtmmio_softc *sc; + + sc = device_get_softc(dev); + + return ((sc->vtmmio_features & feature) != 0); +} + +static int +vtmmio_alloc_virtqueues(device_t dev, int flags, int nvqs, + struct vq_alloc_info *vq_info) +{ + struct vtmmio_virtqueue *vqx; + struct vq_alloc_info *info; + struct vtmmio_softc *sc; + struct virtqueue *vq; + int idx, error; + uint16_t size; + + sc = device_get_softc(dev); + + if (sc->vtmmio_nvqs != 0) + return (EALREADY); + if (nvqs <= 0) + return (EINVAL); + + sc->vtmmio_vqs = malloc(nvqs * sizeof(struct vtmmio_virtqueue), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (sc->vtmmio_vqs == NULL) + return (ENOMEM); + + for (idx = 0; idx < nvqs; idx++) { + vqx = &sc->vtmmio_vqs[idx]; + info = &vq_info[idx]; + + vtmmio_select_virtqueue(sc, idx); + size = vtmmio_read_config_2(sc, VIRTIO_MMIO_QUEUE_NUM); + + error = virtqueue_alloc(dev, idx, size, + VIRTIO_MMIO_VRING_ALIGN, 0xFFFFFFFFUL, info, &vq); + if (error) { + device_printf(dev, + "cannot allocate virtqueue %d: %d\n", + idx, error); + break; + } +#if 0 + device_printf(dev, "virtqueue paddr 0x%08lx\n", + (uint64_t)virtqueue_paddr(vq)); +#endif + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_PFN, + virtqueue_paddr(vq) >> PAGE_SHIFT); + + vqx->vtv_vq = *info->vqai_vq = vq; + vqx->vtv_no_intr = info->vqai_intr == NULL; + + sc->vtmmio_nvqs++; + } + + if (error) + vtmmio_free_virtqueues(sc); + + return (error); +} + +static void +vtmmio_stop(device_t dev) +{ + + vtmmio_reset(device_get_softc(dev)); +} + +static int +vtmmio_reinit(device_t dev, uint64_t features) +{ + struct vtmmio_softc *sc; + int idx, error; + + sc = device_get_softc(dev); + + if (vtmmio_get_status(dev) != VIRTIO_CONFIG_STATUS_RESET) + vtmmio_stop(dev); + + /* + * Quickly drive the status through ACK and DRIVER. The device + * does not become usable again until vtmmio_reinit_complete(). + */ + vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_ACK); + vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_DRIVER); + + vtmmio_negotiate_features(dev, features); + + for (idx = 0; idx < sc->vtmmio_nvqs; idx++) { + error = vtmmio_reinit_virtqueue(sc, idx); + if (error) + return (error); + } + + return (0); +} + +static void +vtmmio_reinit_complete(device_t dev) +{ + + vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_DRIVER_OK); +} + +static void +vtmmio_notify_virtqueue(device_t dev, uint16_t queue) +{ + struct vtmmio_softc *sc; + + sc = device_get_softc(dev); + + vtmmio_write_config_2(sc, VIRTIO_MMIO_QUEUE_NOTIFY, queue); +} + +static uint8_t +vtmmio_get_status(device_t dev) +{ + struct vtmmio_softc *sc; + + sc = device_get_softc(dev); + + return (vtmmio_read_config_1(sc, VIRTIO_MMIO_STATUS)); +} + +static void +vtmmio_set_status(device_t dev, uint8_t status) +{ + struct vtmmio_softc *sc; + + sc = device_get_softc(dev); + + if (status != VIRTIO_CONFIG_STATUS_RESET) + status |= vtmmio_get_status(dev); + + vtmmio_write_config_1(sc, VIRTIO_MMIO_STATUS, status); +} + +static void +vtmmio_read_dev_config(device_t dev, bus_size_t offset, + void *dst, int length) +{ + struct vtmmio_softc *sc; + bus_size_t off; + uint8_t *d; + int size; + + sc = device_get_softc(dev); + off = VIRTIO_MMIO_CONFIG + offset; + + for (d = dst; length > 0; d += size, off += size, length -= size) { + if (length >= 4) { + size = 4; + *(uint32_t *)d = vtmmio_read_config_4(sc, off); + } else if (length >= 2) { + size = 2; + *(uint16_t *)d = vtmmio_read_config_2(sc, off); + } else { + size = 1; + *d = vtmmio_read_config_1(sc, off); + } + } +} + +static void +vtmmio_write_dev_config(device_t dev, bus_size_t offset, + void *src, int length) +{ + struct vtmmio_softc *sc; + bus_size_t off; + uint8_t *s; + int size; + + sc = device_get_softc(dev); + off = VIRTIO_MMIO_CONFIG + offset; + + for (s = src; length > 0; s += size, off += size, length -= size) { + if (length >= 4) { + size = 4; + vtmmio_write_config_4(sc, off, *(uint32_t *)s); + } else if (length >= 2) { + size = 2; + vtmmio_write_config_2(sc, off, *(uint16_t *)s); + } else { + size = 1; + vtmmio_write_config_1(sc, off, *s); + } + } +} + +static void +vtmmio_describe_features(struct vtmmio_softc *sc, const char *msg, + uint64_t features) +{ + device_t dev, child; + + dev = sc->dev; + child = sc->vtmmio_child_dev; + + if (device_is_attached(child) && bootverbose == 0) + return; + + virtio_describe(dev, msg, features, sc->vtmmio_child_feat_desc); +} + +static void +vtmmio_probe_and_attach_child(struct vtmmio_softc *sc) +{ + device_t dev, child; + + dev = sc->dev; + child = sc->vtmmio_child_dev; + + if (child == NULL) + return; + + if (device_get_state(child) != DS_NOTPRESENT) { + return; + } + + if (device_probe(child) != 0) { + return; + } + + vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_DRIVER); + if (device_attach(child) != 0) { + vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_FAILED); + vtmmio_reset(sc); + vtmmio_release_child_resources(sc); + /* Reset status for future attempt. */ + vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_ACK); + } else { + vtmmio_set_status(dev, VIRTIO_CONFIG_STATUS_DRIVER_OK); + VIRTIO_ATTACH_COMPLETED(child); + } +} + +static int +vtmmio_reinit_virtqueue(struct vtmmio_softc *sc, int idx) +{ + struct vtmmio_virtqueue *vqx; + struct virtqueue *vq; + int error; + uint16_t size; + + vqx = &sc->vtmmio_vqs[idx]; + vq = vqx->vtv_vq; + + KASSERT(vq != NULL, ("%s: vq %d not allocated", __func__, idx)); + + vtmmio_select_virtqueue(sc, idx); + size = vtmmio_read_config_2(sc, VIRTIO_MMIO_QUEUE_NUM); + + error = virtqueue_reinit(vq, size); + if (error) + return (error); + + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_PFN, + virtqueue_paddr(vq) >> PAGE_SHIFT); + + return (0); +} + +static void +vtmmio_free_interrupts(struct vtmmio_softc *sc) +{ + + if (sc->ih != NULL) + bus_teardown_intr(sc->dev, sc->res[1], sc->ih); + + if (sc->res[1] != NULL) + bus_release_resource(sc->dev, SYS_RES_IRQ, 0, sc->res[1]); +} + +static void +vtmmio_free_virtqueues(struct vtmmio_softc *sc) +{ + struct vtmmio_virtqueue *vqx; + int idx; + + for (idx = 0; idx < sc->vtmmio_nvqs; idx++) { + vqx = &sc->vtmmio_vqs[idx]; + + vtmmio_select_virtqueue(sc, idx); + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_PFN, 0); + + virtqueue_free(vqx->vtv_vq); + vqx->vtv_vq = NULL; + } + + free(sc->vtmmio_vqs, M_DEVBUF); + sc->vtmmio_vqs = NULL; + sc->vtmmio_nvqs = 0; +} + +static void +vtmmio_release_child_resources(struct vtmmio_softc *sc) +{ + + vtmmio_free_interrupts(sc); + vtmmio_free_virtqueues(sc); +} + +static void +vtmmio_reset(struct vtmmio_softc *sc) +{ + + /* + * Setting the status to RESET sets the host device to + * the original, uninitialized state. + */ + vtmmio_set_status(sc->dev, VIRTIO_CONFIG_STATUS_RESET); +} + +static void +vtmmio_select_virtqueue(struct vtmmio_softc *sc, int idx) +{ + + vtmmio_write_config_2(sc, VIRTIO_MMIO_QUEUE_SEL, idx); +} + +static void +vtmmio_vq_intr(void *arg) +{ + struct vtmmio_virtqueue *vqx; + struct vtmmio_softc *sc; + struct virtqueue *vq; + int idx; + + sc = arg; + + /* Notify all virtqueues. */ + for (idx = 0; idx < sc->vtmmio_nvqs; idx++) { + vqx = &sc->vtmmio_vqs[idx]; + vq = vqx->vtv_vq; + virtqueue_intr(vq); + }; +} Added: head/sys/dev/virtio/mmio/virtio_mmio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/virtio/mmio/virtio_mmio.h Tue Nov 18 14:11:14 2014 (r274655) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VIRTIO_MMIO_H +#define _VIRTIO_MMIO_H + +#define VIRTIO_MMIO_MAGIC_VALUE 0x000 +#define VIRTIO_MMIO_VERSION 0x004 +#define VIRTIO_MMIO_DEVICE_ID 0x008 + +#define VIRTIO_MMIO_MAGIC_VALUE 0x000 +#define VIRTIO_MMIO_VERSION 0x004 +#define VIRTIO_MMIO_DEVICE_ID 0x008 +#define VIRTIO_MMIO_VENDOR_ID 0x00c +#define VIRTIO_MMIO_HOST_FEATURES 0x010 +#define VIRTIO_MMIO_HOST_FEATURES_SEL 0x014 +#define VIRTIO_MMIO_GUEST_FEATURES 0x020 +#define VIRTIO_MMIO_GUEST_FEATURES_SEL 0x024 +#define VIRTIO_MMIO_GUEST_PAGE_SIZE 0x028 +#define VIRTIO_MMIO_QUEUE_SEL 0x030 +#define VIRTIO_MMIO_QUEUE_NUM_MAX 0x034 +#define VIRTIO_MMIO_QUEUE_NUM 0x038 +#define VIRTIO_MMIO_QUEUE_ALIGN 0x03c +#define VIRTIO_MMIO_QUEUE_PFN 0x040 +#define VIRTIO_MMIO_QUEUE_NOTIFY 0x050 +#define VIRTIO_MMIO_INTERRUPT_STATUS 0x060 +#define VIRTIO_MMIO_INTERRUPT_ACK 0x064 +#define VIRTIO_MMIO_STATUS 0x070 +#define VIRTIO_MMIO_CONFIG 0x100 +#define VIRTIO_MMIO_INT_VRING (1 << 0) +#define VIRTIO_MMIO_INT_CONFIG (1 << 1) +#define VIRTIO_MMIO_VRING_ALIGN 4096 + +#endif /* _VIRTIO_MMIO_H */ Added: head/sys/dev/virtio/mmio/virtio_mmio_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/virtio/mmio/virtio_mmio_if.m Tue Nov 18 14:11:14 2014 (r274655) @@ -0,0 +1,76 @@ +#- +# Copyright (c) 2014 Ruslan Bukin +# All rights reserved. +# +# This software was developed by SRI International and the University of +# Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +# ("CTSRD"), as part of the DARPA CRASH research programme. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#include + +# +# This is optional interface to virtio mmio backend. +# Useful when backend is implemented not by the hardware but software, e.g. +# by using another cpu core. +# + +INTERFACE virtio_mmio; + +CODE { + static int + virtio_mmio_write(device_t dev, size_t offset) + { + + return (1); + } + + static int + virtio_mmio_setup_intr(device_t dev, device_t mmio_dev, + void *handler, void *ih_user) + { + + return (1); + } +}; + +# +# Inform backend we have data wrotten to offset. +# +METHOD int note { + device_t dev; + size_t offset; +} DEFAULT virtio_mmio_write; + +# +# Setup backend-specific interrupts. +# +METHOD int setup_intr { + device_t dev; + device_t mmio_dev; + void *handler; + void *ih_user; +} DEFAULT virtio_mmio_setup_intr; From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 14:12:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 010F9874; Tue, 18 Nov 2014 14:12:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D701AB9C; Tue, 18 Nov 2014 14:12:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIECKVQ070287; Tue, 18 Nov 2014 14:12:20 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIECKuV070284; Tue, 18 Nov 2014 14:12:20 GMT (envelope-from br@FreeBSD.org) Message-Id: <201411181412.sAIECKuV070284@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 18 Nov 2014 14:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274656 - head/sys/dev/altera/pio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 14:12:21 -0000 Author: br Date: Tue Nov 18 14:12:19 2014 New Revision: 274656 URL: https://svnweb.freebsd.org/changeset/base/274656 Log: Add Altera Parallel IO (PIO) device driver. Sponsored by: DARPA, AFRL Added: head/sys/dev/altera/pio/ head/sys/dev/altera/pio/pio.c (contents, props changed) head/sys/dev/altera/pio/pio.h (contents, props changed) head/sys/dev/altera/pio/pio_if.m (contents, props changed) Added: head/sys/dev/altera/pio/pio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/pio/pio.c Tue Nov 18 14:12:19 2014 (r274656) @@ -0,0 +1,215 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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. + */ + +/* + * Altera PIO (Parallel IO) device driver + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include "pio_if.h" + +#define READ4(_sc, _reg) bus_read_4((_sc)->res[0], _reg) +#define READ2(_sc, _reg) bus_read_2((_sc)->res[0], _reg) +#define READ1(_sc, _reg) bus_read_1((_sc)->res[0], _reg) +#define WRITE4(_sc, _reg, _val) bus_write_4((_sc)->res[0], _reg, _val) +#define WRITE2(_sc, _reg, _val) bus_write_2((_sc)->res[0], _reg, _val) +#define WRITE1(_sc, _reg, _val) bus_write_1((_sc)->res[0], _reg, _val) + +struct pio_softc { + struct resource *res[2]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + device_t dev; + void *ih; +}; + +static struct resource_spec pio_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +pio_setup_irq(device_t dev, void *intr_handler, void *ih_user) +{ + struct pio_softc *sc; + + sc = device_get_softc(dev); + + /* Setup interrupt handlers */ + if (bus_setup_intr(sc->dev, sc->res[1], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, intr_handler, ih_user, &sc->ih)) { + device_printf(sc->dev, "Unable to setup intr\n"); + return (1); + } + + return (0); +} + +static int +pio_teardown_irq(device_t dev) +{ + struct pio_softc *sc; + + sc = device_get_softc(dev); + + bus_teardown_intr(sc->dev, sc->res[1], sc->ih); + + return (0); +} + +static int +pio_read(device_t dev) +{ + struct pio_softc *sc; + + sc = device_get_softc(dev); + + return (READ4(sc, PIO_DATA)); +} + +static int +pio_set(device_t dev, int bit, int enable) +{ + struct pio_softc *sc; + + sc = device_get_softc(dev); + + if (enable) + WRITE4(sc, PIO_OUTSET, bit); + else + WRITE4(sc, PIO_OUTCLR, bit); + + return (0); +} + +static int +pio_configure(device_t dev, int dir, int mask) +{ + struct pio_softc *sc; + + sc = device_get_softc(dev); + + WRITE4(sc, PIO_INT_MASK, mask); + WRITE4(sc, PIO_DIR, dir); + + return (0); +} + +static int +pio_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "altr,pio")) + return (ENXIO); + + device_set_desc(dev, "Altera PIO"); + return (BUS_PROBE_DEFAULT); +} + +static int +pio_attach(device_t dev) +{ + struct pio_softc *sc; + struct fdt_ic *fic; + phandle_t node; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, pio_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + WRITE4(sc, PIO_DATA, 0); + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + fic = malloc(sizeof(*fic), M_DEVBUF, M_WAITOK|M_ZERO); + fic->iph = node; + fic->dev = dev; + SLIST_INSERT_HEAD(&fdt_ic_list_head, fic, fdt_ics); + + return (0); +} + +static device_method_t pio_methods[] = { + DEVMETHOD(device_probe, pio_probe), + DEVMETHOD(device_attach, pio_attach), + + /* pio_if.m */ + DEVMETHOD(pio_read, pio_read), + DEVMETHOD(pio_configure, pio_configure), + DEVMETHOD(pio_set, pio_set), + DEVMETHOD(pio_setup_irq, pio_setup_irq), + DEVMETHOD(pio_teardown_irq, pio_teardown_irq), + DEVMETHOD_END +}; + +static driver_t pio_driver = { + "altera_pio", + pio_methods, + sizeof(struct pio_softc), +}; + +static devclass_t pio_devclass; + +DRIVER_MODULE(altera_pio, simplebus, pio_driver, pio_devclass, 0, 0); Added: head/sys/dev/altera/pio/pio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/pio/pio.h Tue Nov 18 14:12:19 2014 (r274656) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define PIO_DATA 0x00 +#define PIO_DIR 0x04 +#define PIO_OUT(n) (1 << n) +#define PIO_OUT_ALL 0xffffffff +#define PIO_INT_MASK 0x08 +#define PIO_UNMASK(n) (1 << n) +#define PIO_UNMASK_ALL 0xffffffff +#define PIO_EDGECAPT 0x0c +#define PIO_OUTSET 0x10 +#define PIO_OUTCLR 0x14 + Added: head/sys/dev/altera/pio/pio_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/pio/pio_if.m Tue Nov 18 14:12:19 2014 (r274656) @@ -0,0 +1,65 @@ +#- +# Copyright (c) 2014 Ruslan Bukin +# All rights reserved. +# +# This software was developed by SRI International and the University of +# Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +# ("CTSRD"), as part of the DARPA CRASH research programme. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#include + +INTERFACE pio; + +# +# PIO device methods +# + +METHOD int read { + device_t dev; +}; + +METHOD int setup_irq { + device_t dev; + void *handler; + void *ih_user; +}; + +METHOD int teardown_irq { + device_t dev; +}; + +METHOD int set { + device_t dev; + int bit; + int enable; +}; + +METHOD int configure { + device_t dev; + int dir; + int mask; +} From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 14:24:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40E83C30; Tue, 18 Nov 2014 14:24:56 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3FCCF7; Tue, 18 Nov 2014 14:24:55 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sAIEOn30038290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Nov 2014 16:24:49 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sAIEOn30038290 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sAIEOnRt038289; Tue, 18 Nov 2014 16:24:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 18 Nov 2014 16:24:49 +0200 From: Konstantin Belousov To: Mark Felder Subject: Re: svn commit: r274653 - head/usr.sbin/freebsd-update Message-ID: <20141118142449.GW17068@kib.kiev.ua> References: <201411181338.sAIDc9U3051869@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411181338.sAIDc9U3051869@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 14:24:56 -0000 On Tue, Nov 18, 2014 at 01:38:09PM +0000, Mark Felder wrote: > Author: feld (ports committer) > Date: Tue Nov 18 13:38:09 2014 > New Revision: 274653 > URL: https://svnweb.freebsd.org/changeset/base/274653 > > Log: > Re-work non-persistent filesystem detection as it was not possible to > detect /dev/md backed mfs filesystems that way. > > Differential Revision: https://reviews.freebsd.org/D1163 > Approved by: ian > > Modified: > head/usr.sbin/freebsd-update/freebsd-update.sh > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Nov 18 13:38:07 2014 (r274652) > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Nov 18 13:38:09 2014 (r274653) > @@ -604,14 +604,13 @@ fetchupgrade_check_params () { > echo ${WORKDIR} > exit 1 > fi > - for i in tmpfs mdmfs; do > - if df -t ${i} ${WORKDIR} >/dev/null 2>1; then > - echo -n "`basename $0`: " > - echo -n "${_WORKDIR_bad2}" > - echo ${WORKDIR} > - exit 1 > - fi > - done > + case `df -T ${WORKDIR}` in */dev/md[0-9]* | *tmpfs*) > + echo -n "`basename $0`: " > + echo -n "${_WORKDIR_bad2}" > + echo ${WORKDIR} > + exit 1 > + ;; > + esac > chmod 700 ${WORKDIR} > cd ${WORKDIR} || exit 1 > Why do you suppose that md-backed volumes are not persistent ? vnode-backed devices are stable. From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 14:44:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AECCA2A1 for ; Tue, 18 Nov 2014 14:44:00 +0000 (UTC) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EA48F15 for ; Tue, 18 Nov 2014 14:44:00 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8515020A08 for ; Tue, 18 Nov 2014 09:43:59 -0500 (EST) Received: from web3 ([10.202.2.213]) by compute4.internal (MEProxy); Tue, 18 Nov 2014 09:43:59 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:x-sasl-enc:from:to :mime-version:content-transfer-encoding:content-type:subject :date:in-reply-to:references; s=smtpout; bh=lq3iXhaA54zEW0mVYYq7 K0l147s=; b=jJYwf0QMLKyaixvkGkEa+KG1GpZuzttctSggOfnUPi9Nv8MThUjd deJ4NpvL4El5c3fXjz1/HHyxoTp6moO8Dy6L8dPgXle12Dt8N4+BvGy3Zeb7cS9k +5nQ+4IqAZ4UkguZhXw1mO4tWB9mH6r85op9cZlbWG4gxSn7dOXfnlg= Received: by web3.nyi.internal (Postfix, from userid 99) id 5784110C4AA; Tue, 18 Nov 2014 09:43:59 -0500 (EST) Message-Id: <1416321839.350194.192432157.42AB6F37@webmail.messagingengine.com> X-Sasl-Enc: /lH2plczP6GnX3iv8GvAc7DZsNqMlRDbsgi7xzmjdhNn 1416321839 From: Mark Felder To: svn-src-head@freebsd.org, Ian Lepore , kostikbel@gmail.com, cperciva@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-9183bd94 Subject: Re: svn commit: r274653 - head/usr.sbin/freebsd-update Date: Tue, 18 Nov 2014 08:43:59 -0600 In-Reply-To: <20141118142449.GW17068@kib.kiev.ua> References: <201411181338.sAIDc9U3051869@svn.freebsd.org> <20141118142449.GW17068@kib.kiev.ua> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 14:44:00 -0000 On Tue, Nov 18, 2014, at 08:24, Konstantin Belousov wrote: > Why do you suppose that md-backed volumes are not persistent ? > vnode-backed devices are stable. > You're right, a vnode-backed filesystem would definitely be persistent. Clearly I've done a poor job of researching this thoroughly. I've now read md(4) in its entirety and remember mounting disk images like Linux's "mount -o loop" in the past. I don't see a way to reliably detect an mfs filesystem because it uses md and masquerades as ufs in df's output. Do you have any suggestions on how to detect this reliably? On the other hand, anyone could write a filesystem we aren't blacklisting and fall into the same trap. I thought this was going to help a few people since Oliver reported it and seemed to have a valid use-case for a tmpfs mounted /var but still wanted to use freebsd-update. Instead I'm beginning to think we should just throw this away and add an entry into BUGS in the man page and call it a day. We can't keep everyone from shooting their feet off and we probably shouldn't waste our time trying. Thoughts? From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 15:05:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D62B5719; Tue, 18 Nov 2014 15:05:32 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9206195; Tue, 18 Nov 2014 15:05:32 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XqkLM-000FLN-L6; Tue, 18 Nov 2014 15:05:24 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sAIF5NhS006099; Tue, 18 Nov 2014 08:05:23 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18BCjbMHopxAizW2nuYe6zI X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r274653 - head/usr.sbin/freebsd-update From: Ian Lepore To: Konstantin Belousov In-Reply-To: <20141118142449.GW17068@kib.kiev.ua> References: <201411181338.sAIDc9U3051869@svn.freebsd.org> <20141118142449.GW17068@kib.kiev.ua> Content-Type: text/plain; charset="us-ascii" Date: Tue, 18 Nov 2014 08:05:22 -0700 Message-ID: <1416323122.1147.46.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mark Felder X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 15:05:33 -0000 On Tue, 2014-11-18 at 16:24 +0200, Konstantin Belousov wrote: > On Tue, Nov 18, 2014 at 01:38:09PM +0000, Mark Felder wrote: > > Author: feld (ports committer) > > Date: Tue Nov 18 13:38:09 2014 > > New Revision: 274653 > > URL: https://svnweb.freebsd.org/changeset/base/274653 > > > > Log: > > Re-work non-persistent filesystem detection as it was not possible to > > detect /dev/md backed mfs filesystems that way. > > > > Differential Revision: https://reviews.freebsd.org/D1163 > > Approved by: ian > > > > Modified: > > head/usr.sbin/freebsd-update/freebsd-update.sh > > > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > > ============================================================================== > > --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Nov 18 13:38:07 2014 (r274652) > > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Nov 18 13:38:09 2014 (r274653) > > @@ -604,14 +604,13 @@ fetchupgrade_check_params () { > > echo ${WORKDIR} > > exit 1 > > fi > > - for i in tmpfs mdmfs; do > > - if df -t ${i} ${WORKDIR} >/dev/null 2>1; then > > - echo -n "`basename $0`: " > > - echo -n "${_WORKDIR_bad2}" > > - echo ${WORKDIR} > > - exit 1 > > - fi > > - done > > + case `df -T ${WORKDIR}` in */dev/md[0-9]* | *tmpfs*) > > + echo -n "`basename $0`: " > > + echo -n "${_WORKDIR_bad2}" > > + echo ${WORKDIR} > > + exit 1 > > + ;; > > + esac > > chmod 700 ${WORKDIR} > > cd ${WORKDIR} || exit 1 > > > Why do you suppose that md-backed volumes are not persistent ? > vnode-backed devices are stable. > This is intended to guard against /var being an mfs due to diskless or readonly-root setup by rc.d/var during freebsd-update. I suppose it's possible for someone to configure /var in a persistant file-backed md on such a system. (Hmm, that's maybe even useful with nfs root, I may give that a try.) It looks like the information needed to figure out whether it's persistant or not is available in the kern.geom.conftxt sysctl, but parsing that with shell script is going to lead to some ugly hieroglyphics. Maybe a reasonable compromise would be instead of hard-fail, just warn the user that a memory-backed /var doesn't work and prompt them? (I'm not sure if the script is interactive at this point or not.) -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 15:19:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20648A75; Tue, 18 Nov 2014 15:19:31 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 867BB31D; Tue, 18 Nov 2014 15:19:30 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sAIFJPhr050607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Nov 2014 17:19:25 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sAIFJPhr050607 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sAIFJPYO050606; Tue, 18 Nov 2014 17:19:25 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 18 Nov 2014 17:19:25 +0200 From: Konstantin Belousov To: Mark Felder Subject: Re: svn commit: r274653 - head/usr.sbin/freebsd-update Message-ID: <20141118151925.GX17068@kib.kiev.ua> References: <201411181338.sAIDc9U3051869@svn.freebsd.org> <20141118142449.GW17068@kib.kiev.ua> <1416321839.350194.192432157.42AB6F37@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1416321839.350194.192432157.42AB6F37@webmail.messagingengine.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, cperciva@freebsd.org, Ian Lepore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 15:19:31 -0000 On Tue, Nov 18, 2014 at 08:43:59AM -0600, Mark Felder wrote: > On Tue, Nov 18, 2014, at 08:24, Konstantin Belousov wrote: > > Why do you suppose that md-backed volumes are not persistent ? > > vnode-backed devices are stable. > > > > You're right, a vnode-backed filesystem would definitely be persistent. > Clearly I've done a poor job of researching this thoroughly. I've now > read md(4) in its entirety and remember mounting disk images like > Linux's "mount -o loop" in the past. I don't see a way to reliably > detect an mfs filesystem because it uses md and masquerades as ufs in > df's output. Do you have any suggestions on how to detect this reliably? > > On the other hand, anyone could write a filesystem we aren't > blacklisting and fall into the same trap. I thought this was going to > help a few people since Oliver reported it and seemed to have a valid > use-case for a tmpfs mounted /var but still wanted to use > freebsd-update. Instead I'm beginning to think we should just throw this > away and add an entry into BUGS in the man page and call it a day. We > can't keep everyone from shooting their feet off and we probably > shouldn't waste our time trying. Up to you. You could somewhat improve this by parsing mdconfig -lv output and see if the device is swap/memory or vnode backed. In either case, if the code to detect transient /var is kept around, there should be a way to turn heuristic off and just do what user asked for. Some sort of the force flag. From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 15:47:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B50C120E; Tue, 18 Nov 2014 15:47:49 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 580FB8A2; Tue, 18 Nov 2014 15:47:49 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id l18so6554110wgh.30 for ; Tue, 18 Nov 2014 07:47:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=OE9pOtEN9HI6RT7rm/xM24kwnPH1I93xJNfeWlw0G+4=; b=m4X1XnrsqVYo0mM+JtrX0e0Jvtb/5iU5YcL6xiOwVD8D22cqM945BirHmjDaXKzT7R G52fGUyIYwyGPh7v8+iEPIjSHcUy4Kr5FNwAUEj4JFwR7Ur4ZF2sibgiSuiTtecO0iM0 +fnj7lcHgewUihiAqktpBwtiudc2OBNHCbAE/X+LlNcnbvT4qOZASNhP9qMqsfuPFzQ5 FpaWCUsw/RKPZs8WVYaN4LkBaMrmx+p4lee87iWPlWYMW2b1epKL9EE8Sl7DVNWwMqSH S/ihG1Trp45ioiFiHN86rQY2AKeOhdNT0CBPOeLAtyFqtL7jLjLMNU6K/QXOtme6khjF MMJQ== MIME-Version: 1.0 X-Received: by 10.180.83.98 with SMTP id p2mr4961175wiy.20.1416325666170; Tue, 18 Nov 2014 07:47:46 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Tue, 18 Nov 2014 07:47:46 -0800 (PST) In-Reply-To: <20141118064626.GA956@dchagin.static.corbina.net> References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> <20141118064626.GA956@dchagin.static.corbina.net> Date: Tue, 18 Nov 2014 07:47:46 -0800 X-Google-Sender-Auth: z8cdXYS35KESugQlHmxFrmdcF3I Message-ID: Subject: Re: svn commit: r274635 - head/sys/dev/pci From: Adrian Chadd To: Chagin Dmitry Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 15:47:49 -0000 Hi, Want to post a bootverbose suspend/resume pass with -HEAD without this patch in it, then with this patch in it? We should likely revert this commit (for correctness) and then dig deeper into what's going on. -adrian On 17 November 2014 22:46, Chagin Dmitry wrote: > On Mon, Nov 17, 2014 at 05:45:23PM -0500, John Baldwin wrote: >> On Monday, November 17, 2014 08:25:21 PM Dmitry Chagin wrote: >> > Author: dchagin >> > Date: Mon Nov 17 20:25:21 2014 >> > New Revision: 274635 >> > URL: https://svnweb.freebsd.org/changeset/base/274635 >> > >> > Log: >> > Use the correct device as the power_for_sleep() method >> > always pass request up to parent bridge. >> > >> > Reviewed by: jhb >> > MFC after: 1 week >> > xMFC: r274386,r274397 >> >> Hmm, I had misread this diff as being another instance of what Adrian had >> found. I think this is actually not correct. The parent of a pci device >> ('dev' here) is a pciX device. pciX devices do not implement the >> PCIB_POWER_FOR_SLEEP method from pcib_if.m, so this probably just broke >> Adrian's Asus laptop as now it will always use D3 again and ignore _SxD. > ugh.. i understood, let me see more closely >> >> You said that this change fixed your laptop, yes? Did it work before Adrian's >> change in r274386 and break afterwards? > yes > > -- > Have fun! > chd From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 16:31:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A54DA09; Tue, 18 Nov 2014 16:31:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E25BFC4; Tue, 18 Nov 2014 16:31:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIGV0u1033345; Tue, 18 Nov 2014 16:31:00 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIGV0Cj033343; Tue, 18 Nov 2014 16:31:00 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201411181631.sAIGV0Cj033343@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 18 Nov 2014 16:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274660 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 16:31:01 -0000 Author: jhibbits Date: Tue Nov 18 16:31:00 2014 New Revision: 274660 URL: https://svnweb.freebsd.org/changeset/base/274660 Log: Missed a terminating ';'. X-MFC-with: r273009 Modified: head/etc/devd/apple.conf Modified: head/etc/devd/apple.conf ============================================================================== --- head/etc/devd/apple.conf Tue Nov 18 15:38:40 2014 (r274659) +++ head/etc/devd/apple.conf Tue Nov 18 16:31:00 2014 (r274660) @@ -77,4 +77,4 @@ notify 10 { match "subsystem" "POWER"; match "type" "ACLINE"; action "/etc/rc.d/power_profile $notify"; -} +}; From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:06:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 314DEE3D; Tue, 18 Nov 2014 17:06:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C7C26A9; Tue, 18 Nov 2014 17:06:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIH6fTG051896; Tue, 18 Nov 2014 17:06:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIH6eS9051888; Tue, 18 Nov 2014 17:06:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411181706.sAIH6eS9051888@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 17:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:06:42 -0000 Author: imp Date: Tue Nov 18 17:06:40 2014 New Revision: 274661 URL: https://svnweb.freebsd.org/changeset/base/274661 Log: Implement the historic DIOCGDINFO ioctl for gpart on BSD partitions. Several utilities still use this interface and require additional information since gpart was activated than before. This allows fsck of a UFS partition without having to specify it is UFS, per historic behavior. Modified: head/sys/conf/files head/sys/geom/part/g_part.c head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_if.m head/sys/modules/geom/geom_part/geom_part_bsd/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Nov 18 16:31:00 2014 (r274660) +++ head/sys/conf/files Tue Nov 18 17:06:40 2014 (r274661) @@ -2773,7 +2773,7 @@ geom/eli/pkcs5v2.c optional geom_eli geom/gate/g_gate.c optional geom_gate geom/geom_aes.c optional geom_aes geom/geom_bsd.c optional geom_bsd -geom/geom_bsd_enc.c optional geom_bsd +geom/geom_bsd_enc.c optional geom_bsd | geom_part_bsd geom/geom_ccd.c optional ccd | geom_ccd geom/geom_ctl.c standard geom/geom_dev.c standard Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Nov 18 16:31:00 2014 (r274660) +++ head/sys/geom/part/g_part.c Tue Nov 18 17:06:40 2014 (r274661) @@ -143,6 +143,7 @@ static g_orphan_t g_part_orphan; static g_spoiled_t g_part_spoiled; static g_start_t g_part_start; static g_resize_t g_part_resize; +static g_ioctl_t g_part_ioctl; static struct g_class g_part_class = { .name = "PART", @@ -159,7 +160,8 @@ static struct g_class g_part_class = { .orphan = g_part_orphan, .spoiled = g_part_spoiled, .start = g_part_start, - .resize = g_part_resize + .resize = g_part_resize, + .ioctl = g_part_ioctl, }; DECLARE_GEOM_CLASS(g_part_class, g_part); @@ -2059,6 +2061,25 @@ g_part_dumpconf(struct sbuf *sb, const c } } +/*- + * This start routine is only called for non-trivial requests, all the + * trivial ones are handled autonomously by the slice code. + * For requests we handle here, we must call the g_io_deliver() on the + * bio, and return non-zero to indicate to the slice code that we did so. + * This code executes in the "DOWN" I/O path, this means: + * * No sleeping. + * * Don't grab the topology lock. + * * Don't call biowait, g_getattr(), g_setattr() or g_read_data() + */ +static int +g_part_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, struct thread *td) +{ + struct g_part_table *table; + + table = pp->geom->softc; + return G_PART_IOCTL(table, pp, cmd, data, fflag, td); +} + static void g_part_resize(struct g_consumer *cp) { Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Tue Nov 18 16:31:00 2014 (r274660) +++ head/sys/geom/part/g_part_bsd.c Tue Nov 18 17:06:40 2014 (r274661) @@ -83,6 +83,8 @@ static const char *g_part_bsd_type(struc static int g_part_bsd_write(struct g_part_table *, struct g_consumer *); static int g_part_bsd_resize(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); +static int g_part_bsd_ioctl(struct g_part_table *, struct g_provider *, + u_long cmd, void *data, int fflag, struct thread *td); static kobj_method_t g_part_bsd_methods[] = { KOBJMETHOD(g_part_add, g_part_bsd_add), @@ -98,6 +100,7 @@ static kobj_method_t g_part_bsd_methods[ KOBJMETHOD(g_part_read, g_part_bsd_read), KOBJMETHOD(g_part_type, g_part_bsd_type), KOBJMETHOD(g_part_write, g_part_bsd_write), + KOBJMETHOD(g_part_ioctl, g_part_bsd_ioctl), { 0, 0 } }; @@ -494,6 +497,38 @@ g_part_bsd_type(struct g_part_table *bas return (buf); } +/*- + * This start routine is only called for non-trivial requests, all the + * trivial ones are handled autonomously by the slice code. + * For requests we handle here, we must call the g_io_deliver() on the + * bio, and return non-zero to indicate to the slice code that we did so. + * This code executes in the "DOWN" I/O path, this means: + * * No sleeping. + * * Don't grab the topology lock. + * * Don't call biowait, g_getattr(), g_setattr() or g_read_data() + */ +static int +g_part_bsd_ioctl(struct g_part_table *basetable, struct g_provider *pp, + u_long cmd, void *data, int fflag, struct thread *td) +{ + + switch (cmd) + { + case DIOCGDINFO: + { + struct g_part_bsd_table *table; + u_char *p; + + table = (struct g_part_bsd_table *)basetable; + p = table->bbarea + pp->sectorsize; + return (bsd_disklabel_le_dec(p, data, MAXPARTITIONS)); + } + default: + return (ENOIOCTL); + + } +} + static int g_part_bsd_write(struct g_part_table *basetable, struct g_consumer *cp) { Modified: head/sys/geom/part/g_part_if.m ============================================================================== --- head/sys/geom/part/g_part_if.m Tue Nov 18 16:31:00 2014 (r274660) +++ head/sys/geom/part/g_part_if.m Tue Nov 18 17:06:40 2014 (r274661) @@ -71,6 +71,14 @@ CODE { { return (ENOSYS); } + + static int + default_ioctl(struct g_part_table *table __unused, struct g_provider *pp __unused, + u_long cmd __unused, void *data __unused, int fflag __unused, + struct thread *td __unused) + { + return (ENOIOCTL); + } }; # add() - scheme specific processing for the add verb. @@ -120,6 +128,16 @@ METHOD void fullname { const char *pfx; } DEFAULT default_fullname; +# ioctl() - implement historic ioctls, perhaps. +METHOD int ioctl { + struct g_part_table *table; + struct g_provider *pp; + u_long cmd; + void *data; + int fflag; + struct thread *td; +} DEFAULT default_ioctl; + # modify() - scheme specific processing for the modify verb. METHOD int modify { struct g_part_table *table; Modified: head/sys/modules/geom/geom_part/geom_part_bsd/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/geom_part_bsd/Makefile Tue Nov 18 16:31:00 2014 (r274660) +++ head/sys/modules/geom/geom_part/geom_part_bsd/Makefile Tue Nov 18 17:06:40 2014 (r274661) @@ -1,9 +1,9 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../../geom/part +.PATH: ${.CURDIR}/../../../../geom/part ${.CURDIR}/../../../../geom KMOD= geom_part_bsd -SRCS= g_part_bsd.c +SRCS= g_part_bsd.c geom_bsd_enc.c SRCS+= bus_if.h device_if.h g_part_if.h From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:06:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93A53F77; Tue, 18 Nov 2014 17:06:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80A0F6AC; Tue, 18 Nov 2014 17:06:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIH6lfQ051991; Tue, 18 Nov 2014 17:06:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIH6lUn051990; Tue, 18 Nov 2014 17:06:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411181706.sAIH6lUn051990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 17:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274663 - head/sys/dev/pccbb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:06:47 -0000 Author: imp Date: Tue Nov 18 17:06:46 2014 New Revision: 274663 URL: https://svnweb.freebsd.org/changeset/base/274663 Log: Fix typo pointed out by avg@ and Joerg Sonnenberger. Add a clarifying sentence too. Sponsored by: Netflix Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Tue Nov 18 17:06:44 2014 (r274662) +++ head/sys/dev/pccbb/pccbb.c Tue Nov 18 17:06:46 2014 (r274663) @@ -1591,10 +1591,10 @@ cbb_resume(device_t self) * from D0 and back to D0 cause the bridge to lose its config space, so * all the bus mappings and such are preserved. * - * For most drivers, the PCI layer handles this saving. However, - * sicne there's much black magic and archane art hidden in these - * few lines of code that would be difficult to transition into - * the PCI layer. + * For most drivers, the PCI layer handles this saving. However, since + * there's much black magic and arcane art hidden in these few lines of + * code that would be difficult to transition into the PCI + * layer. chipinit was several years of trial and error to write. */ pci_write_config(self, CBBR_SOCKBASE, rman_get_start(sc->base_res), 4); DEVPRINTF((self, "PCI Memory allocated: %08lx\n", From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:06:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEEBFF72; Tue, 18 Nov 2014 17:06:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2A436AB; Tue, 18 Nov 2014 17:06:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIH6jIp051947; Tue, 18 Nov 2014 17:06:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIH6iLX051943; Tue, 18 Nov 2014 17:06:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411181706.sAIH6iLX051943@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 17:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274662 - in head: share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:06:46 -0000 Author: imp Date: Tue Nov 18 17:06:44 2014 New Revision: 274662 URL: https://svnweb.freebsd.org/changeset/base/274662 Log: Acutally, replaces NO_INCS with WITHOUT_INCLUDES and make WITHOUT_TOOLCHAIN imply it instead. Sponsored by: Netflix Added: head/tools/build/options/WITHOUT_INCLUDES (contents, props changed) Modified: head/share/mk/bsd.incs.mk head/share/mk/bsd.opts.mk head/share/mk/src.opts.mk Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Tue Nov 18 17:06:40 2014 (r274661) +++ head/share/mk/bsd.incs.mk Tue Nov 18 17:06:44 2014 (r274662) @@ -4,7 +4,7 @@ .error bsd.incs.mk cannot be included directly. .endif -.if ${MK_TOOLCHAIN} != "no" +.if ${MK_INCLUDES} != "no" INCSGROUPS?= INCS Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Tue Nov 18 17:06:40 2014 (r274661) +++ head/share/mk/bsd.opts.mk Tue Nov 18 17:06:44 2014 (r274662) @@ -51,6 +51,7 @@ ____: __DEFAULT_YES_OPTIONS = \ ASSERT_DEBUG \ DOCCOMPRESS \ + INCLUDES \ INSTALLLIB \ KERBEROS \ MAN \ Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Nov 18 17:06:40 2014 (r274661) +++ head/share/mk/src.opts.mk Tue Nov 18 17:06:44 2014 (r274662) @@ -306,6 +306,7 @@ MK_BINUTILS:= no MK_CLANG:= no MK_GCC:= no MK_GDB:= no +MK_INCLUDES:= no .endif .if ${MK_CLANG} == "no" Added: head/tools/build/options/WITHOUT_INCLUDES ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_INCLUDES Tue Nov 18 17:06:44 2014 (r274662) @@ -0,0 +1,8 @@ +.\" $FreeBSD$ +Set to not install header files. +This option used to be spelled +.Va NO_INCS . +.Bf -symbolic +The option does not work for build targets. +.Ef + From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:06:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F6BEF9B; Tue, 18 Nov 2014 17:06:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C1A76B0; Tue, 18 Nov 2014 17:06:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIH6mRN052035; Tue, 18 Nov 2014 17:06:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIH6mb9052034; Tue, 18 Nov 2014 17:06:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411181706.sAIH6mb9052034@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 17:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274664 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:06:49 -0000 Author: imp Date: Tue Nov 18 17:06:48 2014 New Revision: 274664 URL: https://svnweb.freebsd.org/changeset/base/274664 Log: LIB32 is supported for powerpc64 too. Make the note more general about 64-bit processors. Sponsored by: Netflix Modified: head/tools/build/options/WITHOUT_LIB32 Modified: head/tools/build/options/WITHOUT_LIB32 ============================================================================== --- head/tools/build/options/WITHOUT_LIB32 Tue Nov 18 17:06:46 2014 (r274663) +++ head/tools/build/options/WITHOUT_LIB32 Tue Nov 18 17:06:48 2014 (r274664) @@ -1,4 +1,4 @@ .\" $FreeBSD$ -On amd64, set to not build 32-bit library set and a +On 64-bit platforms, set to not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:06:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B786C13A; Tue, 18 Nov 2014 17:06:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A495B6B1; Tue, 18 Nov 2014 17:06:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIH6poH052087; Tue, 18 Nov 2014 17:06:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIH6pcl052085; Tue, 18 Nov 2014 17:06:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411181706.sAIH6pcl052085@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 17:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274665 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:06:51 -0000 Author: imp Date: Tue Nov 18 17:06:50 2014 New Revision: 274665 URL: https://svnweb.freebsd.org/changeset/base/274665 Log: Document WITHOUT_USB_EXAMPLES and WITHOUT_TESTS_SUPPORT Sponsored by: Netflix Added: head/tools/build/options/WITHOUT_TESTS_SUPPORT (contents, props changed) head/tools/build/options/WITHOUT_USB_GADGET_EXAMPLES (contents, props changed) Added: head/tools/build/options/WITHOUT_TESTS_SUPPORT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_TESTS_SUPPORT Tue Nov 18 17:06:50 2014 (r274665) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to disables the build of all test-related dependencies, including ATF. Added: head/tools/build/options/WITHOUT_USB_GADGET_EXAMPLES ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_USB_GADGET_EXAMPLES Tue Nov 18 17:06:50 2014 (r274665) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build USB gadget kernel modules. From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:07:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA63D6F7; Tue, 18 Nov 2014 17:07:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACACE6C0; Tue, 18 Nov 2014 17:07:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIH713R052282; Tue, 18 Nov 2014 17:07:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIH6vtR052227; Tue, 18 Nov 2014 17:06:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411181706.sAIH6vtR052227@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 17:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274668 - in head/sys: arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/include arm/mv arm/ti arm/versatile arm/xilinx dev/xen/netback i386/xen kern mips/mips xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:07:01 -0000 Author: imp Date: Tue Nov 18 17:06:56 2014 New Revision: 274668 URL: https://svnweb.freebsd.org/changeset/base/274668 Log: opt_global.h is included automatically in the build. No need to explicitly include it in these places. Sponsored by: Netflix Modified: head/sys/arm/arm/stdatomic.c head/sys/arm/broadcom/bcm2835/bcm2835_common.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/freescale/imx/imx_common.c head/sys/arm/include/asmacros.h head/sys/arm/mv/mv_common.c head/sys/arm/ti/ti_common.c head/sys/arm/versatile/versatile_common.c head/sys/arm/versatile/versatile_machdep.c head/sys/arm/xilinx/uart_dev_cdnc.c head/sys/arm/xilinx/zy7_machdep.c head/sys/dev/xen/netback/netback.c head/sys/i386/xen/locore.s head/sys/kern/kern_mutex.c head/sys/mips/mips/stdatomic.c head/sys/mips/mips/trap.c head/sys/xen/gnttab.c Modified: head/sys/arm/arm/stdatomic.c ============================================================================== --- head/sys/arm/arm/stdatomic.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/arm/stdatomic.c Tue Nov 18 17:06:56 2014 (r274668) @@ -34,10 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef _KERNEL -#include "opt_global.h" -#endif - /* * Executing statements with interrupts disabled. */ Modified: head/sys/arm/broadcom/bcm2835/bcm2835_common.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_common.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/broadcom/bcm2835/bcm2835_common.c Tue Nov 18 17:06:56 2014 (r274668) @@ -29,8 +29,6 @@ * SUCH DAMAGE. */ -#include "opt_global.h" - #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Tue Nov 18 17:06:56 2014 (r274668) @@ -38,7 +38,6 @@ #include "opt_ddb.h" #include "opt_platform.h" -#include "opt_global.h" #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/freescale/imx/imx_common.c ============================================================================== --- head/sys/arm/freescale/imx/imx_common.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/freescale/imx/imx_common.c Tue Nov 18 17:06:56 2014 (r274668) @@ -33,8 +33,6 @@ * SUCH DAMAGE. */ -#include "opt_global.h" - #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/include/asmacros.h ============================================================================== --- head/sys/arm/include/asmacros.h Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/include/asmacros.h Tue Nov 18 17:06:56 2014 (r274668) @@ -34,7 +34,6 @@ #ifdef _KERNEL #ifdef LOCORE -#include "opt_global.h" #ifdef _ARM_ARCH_6 #define GET_CURTHREAD_PTR(tmp) \ Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/mv/mv_common.c Tue Nov 18 17:06:56 2014 (r274668) @@ -29,8 +29,6 @@ * SUCH DAMAGE. */ -#include "opt_global.h" - #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/ti/ti_common.c ============================================================================== --- head/sys/arm/ti/ti_common.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/ti/ti_common.c Tue Nov 18 17:06:56 2014 (r274668) @@ -29,8 +29,6 @@ * SUCH DAMAGE. */ -#include "opt_global.h" - #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/versatile/versatile_common.c ============================================================================== --- head/sys/arm/versatile/versatile_common.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/versatile/versatile_common.c Tue Nov 18 17:06:56 2014 (r274668) @@ -29,8 +29,6 @@ * SUCH DAMAGE. */ -#include "opt_global.h" - #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/versatile/versatile_machdep.c ============================================================================== --- head/sys/arm/versatile/versatile_machdep.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/versatile/versatile_machdep.c Tue Nov 18 17:06:56 2014 (r274668) @@ -35,7 +35,6 @@ #include "opt_ddb.h" #include "opt_platform.h" -#include "opt_global.h" #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/xilinx/uart_dev_cdnc.c ============================================================================== --- head/sys/arm/xilinx/uart_dev_cdnc.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/xilinx/uart_dev_cdnc.c Tue Nov 18 17:06:56 2014 (r274668) @@ -38,8 +38,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_global.h" - #include #include #include Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/arm/xilinx/zy7_machdep.c Tue Nov 18 17:06:56 2014 (r274668) @@ -33,8 +33,6 @@ * (v1.4) November 16, 2012. Xilinx doc UG585. */ -#include "opt_global.h" - #include __FBSDID("$FreeBSD$"); Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/dev/xen/netback/netback.c Tue Nov 18 17:06:56 2014 (r274668) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); */ #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_global.h" #include "opt_sctp.h" Modified: head/sys/i386/xen/locore.s ============================================================================== --- head/sys/i386/xen/locore.s Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/i386/xen/locore.s Tue Nov 18 17:06:56 2014 (r274668) @@ -42,7 +42,6 @@ #include "opt_bootp.h" #include "opt_compat.h" #include "opt_nfsroot.h" -#include "opt_global.h" #include "opt_pmap.h" #include Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/kern/kern_mutex.c Tue Nov 18 17:06:56 2014 (r274668) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include "opt_adaptive_mutexes.h" #include "opt_ddb.h" -#include "opt_global.h" #include "opt_hwpmc_hooks.h" #include "opt_sched.h" Modified: head/sys/mips/mips/stdatomic.c ============================================================================== --- head/sys/mips/mips/stdatomic.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/mips/mips/stdatomic.c Tue Nov 18 17:06:56 2014 (r274668) @@ -33,10 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef _KERNEL -#include "opt_global.h" -#endif - #if defined(__SYNC_ATOMICS) /* Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/mips/mips/trap.c Tue Nov 18 17:06:56 2014 (r274668) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" -#include "opt_global.h" #include "opt_ktrace.h" #include Modified: head/sys/xen/gnttab.c ============================================================================== --- head/sys/xen/gnttab.c Tue Nov 18 17:06:54 2014 (r274667) +++ head/sys/xen/gnttab.c Tue Nov 18 17:06:56 2014 (r274668) @@ -13,7 +13,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_global.h" #include "opt_pmap.h" #include From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:06:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8383122F; Tue, 18 Nov 2014 17:06:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70C306B6; Tue, 18 Nov 2014 17:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIH6r9v052134; Tue, 18 Nov 2014 17:06:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIH6rOB052133; Tue, 18 Nov 2014 17:06:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411181706.sAIH6rOB052133@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 17:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274666 - head/sys/modules/cxgb/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:06:53 -0000 Author: imp Date: Tue Nov 18 17:06:52 2014 New Revision: 274666 URL: https://svnweb.freebsd.org/changeset/base/274666 Log: opt_global.h is never needed in SRCS lists. Sponsored by: Netflix Modified: head/sys/modules/cxgb/tom/Makefile Modified: head/sys/modules/cxgb/tom/Makefile ============================================================================== --- head/sys/modules/cxgb/tom/Makefile Tue Nov 18 17:06:50 2014 (r274665) +++ head/sys/modules/cxgb/tom/Makefile Tue Nov 18 17:06:52 2014 (r274666) @@ -6,7 +6,7 @@ CXGB = ${.CURDIR}/../../../dev/cxgb KMOD= t3_tom SRCS= cxgb_tom.c cxgb_cpl_io.c cxgb_listen.c cxgb_l2t.c SRCS+= opt_compat.h opt_inet.h opt_inet6.h opt_ipsec.h -SRCS+= opt_tcpdebug.h opt_ddb.h opt_sched.h opt_global.h opt_ktr.h +SRCS+= opt_tcpdebug.h opt_ddb.h opt_sched.h opt_ktr.h SRCS+= device_if.h bus_if.h pci_if.h CFLAGS+= -g -I${CXGB} From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:06:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37BCF30C; Tue, 18 Nov 2014 17:06:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24FE46B7; Tue, 18 Nov 2014 17:06:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIH6tPx052181; Tue, 18 Nov 2014 17:06:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIH6tQM052179; Tue, 18 Nov 2014 17:06:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411181706.sAIH6tQM052179@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 17:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274667 - head/sys/modules/lmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:06:55 -0000 Author: imp Date: Tue Nov 18 17:06:54 2014 New Revision: 274667 URL: https://svnweb.freebsd.org/changeset/base/274667 Log: No need to list opt_global.h. No need to force ALTQ here, since that's not the normal default for the system and nothing else forces it on. Sponsored by: Netflix Modified: head/sys/modules/lmc/Makefile Modified: head/sys/modules/lmc/Makefile ============================================================================== --- head/sys/modules/lmc/Makefile Tue Nov 18 17:06:52 2014 (r274666) +++ head/sys/modules/lmc/Makefile Tue Nov 18 17:06:54 2014 (r274667) @@ -7,12 +7,9 @@ SRCS = if_lmc.c if_lmc.h SRCS += device_if.h bus_if.h pci_if.h SRCS += opt_inet.h opt_inet6.h SRCS += opt_netgraph.h -SRCS += opt_global.h SRCS += opt_bpf.h opt_netgraph.h: echo "#define NETGRAPH 1" > ${.TARGET} -opt_global.h: - echo "#define ALTQ 1" > ${.TARGET} .include From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:07:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D226B773; Tue, 18 Nov 2014 17:07:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FEDB6C8; Tue, 18 Nov 2014 17:07:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIH73ub052325; Tue, 18 Nov 2014 17:07:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIH73Dx052324; Tue, 18 Nov 2014 17:07:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411181707.sAIH73Dx052324@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 18 Nov 2014 17:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274669 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:07:04 -0000 Author: imp Date: Tue Nov 18 17:07:02 2014 New Revision: 274669 URL: https://svnweb.freebsd.org/changeset/base/274669 Log: These delays aren't needed. Elimate them. They should be on the order of a few cycles at most, not 10us. They make it impossible to implement half-duplex protocols that are faster than about 1KHz. Sponsored by: Netflix Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Nov 18 17:06:56 2014 (r274668) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Nov 18 17:07:02 2014 (r274669) @@ -238,9 +238,7 @@ bcm_gpio_set_pud(struct bcm_gpio_softc * offset = pin - 32 * bank; BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUD(0), state); - DELAY(10); BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), (1 << offset)); - DELAY(10); BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUD(0), 0); BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), 0); } From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:22:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2181C9A; Tue, 18 Nov 2014 17:22:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CADD5905; Tue, 18 Nov 2014 17:22:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIHMDCP061083; Tue, 18 Nov 2014 17:22:13 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIHM9w4061061; Tue, 18 Nov 2014 17:22:09 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201411181722.sAIHM9w4061061@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 18 Nov 2014 17:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274670 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/rockchip arm/samsung/exynos arm/ti arm/xscale/ixp425 dev/gpio mips/atheros mips/cavi... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:22:14 -0000 Author: loos Date: Tue Nov 18 17:22:08 2014 New Revision: 274670 URL: https://svnweb.freebsd.org/changeset/base/274670 Log: Moves all the duplicate code to a single function. Verify for invalid modes and unwanted flags before pass the new flags to driver. Modified: head/sys/arm/allwinner/a10_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/freescale/imx/imx_gpio.c head/sys/arm/freescale/vybrid/vf_gpio.c head/sys/arm/rockchip/rk30xx_gpio.c head/sys/arm/samsung/exynos/exynos5_pad.c head/sys/arm/ti/ti_gpio.c head/sys/arm/xscale/ixp425/avila_gpio.c head/sys/arm/xscale/ixp425/cambria_gpio.c head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/gpioc.c head/sys/mips/atheros/ar71xx_gpio.c head/sys/mips/cavium/octeon_gpio.c head/sys/mips/rt305x/rt305x_gpio.c head/sys/powerpc/wii/wii_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/arm/allwinner/a10_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -302,20 +302,6 @@ a10_gpio_pin_setflags(device_t dev, uint if (i >= sc->sc_gpio_npins) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->sc_gpio_pins[i].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together. */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - - /* Can't mix pull-up/pull-down together. */ - if ((flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) == - (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) - return (EINVAL); - a10_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags); return (0); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -397,20 +397,6 @@ bcm_gpio_pin_setflags(device_t dev, uint if (bcm_gpio_pin_is_ro(sc, pin)) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->sc_gpio_pins[i].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together. */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - - /* Can't mix pull-up/pull-down together. */ - if ((flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) == - (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) - return (EINVAL); - bcm_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags); return (0); Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/arm/freescale/imx/imx_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -268,18 +268,8 @@ imx51_gpio_pin_setflags(device_t dev, ui if (i >= sc->gpio_npins) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->gpio_pins[i].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - imx51_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); - return (0); } Modified: head/sys/arm/freescale/vybrid/vf_gpio.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/arm/freescale/vybrid/vf_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -312,15 +312,6 @@ vf_gpio_pin_setflags(device_t dev, uint3 if (i >= sc->gpio_npins) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->gpio_pins[i].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - vf_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); return (0); Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/arm/rockchip/rk30xx_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -318,20 +318,6 @@ rk30_gpio_pin_setflags(device_t dev, uin if (i >= sc->sc_gpio_npins) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->sc_gpio_pins[i].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together. */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - - /* Can't mix pull-up/pull-down together. */ - if ((flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) == - (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) - return (EINVAL); - rk30_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags); return (0); Modified: head/sys/arm/samsung/exynos/exynos5_pad.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_pad.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/arm/samsung/exynos/exynos5_pad.c Tue Nov 18 17:22:08 2014 (r274670) @@ -764,15 +764,6 @@ pad_pin_setflags(device_t dev, uint32_t if (i >= sc->gpio_npins) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->gpio_pins[i].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - pad_pin_configure(sc, &sc->gpio_pins[i], flags); return (0); Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/arm/ti/ti_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -462,16 +462,6 @@ ti_gpio_pin_setflags(device_t dev, uint3 uint32_t mask = (1UL << (pin % PINS_PER_BANK)); uint32_t reg_val; - /* Sanity check the flags supplied are valid, i.e. not input and output */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == 0x0000) - return (EINVAL); - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - if ((flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) == - (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) - return (EINVAL); - TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ Modified: head/sys/arm/xscale/ixp425/avila_gpio.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/arm/xscale/ixp425/avila_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -220,16 +220,8 @@ avila_gpio_pin_setflags(device_t dev, ui if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & mask)) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->sc_pins[pin].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - avila_gpio_pin_configure(sc, &sc->sc_pins[pin], flags); + return (0); } Modified: head/sys/arm/xscale/ixp425/cambria_gpio.c ============================================================================== --- head/sys/arm/xscale/ixp425/cambria_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/arm/xscale/ixp425/cambria_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -317,15 +317,6 @@ cambria_gpio_pin_setflags(device_t dev, if (pin >= GPIO_PINS) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->sc_pins[pin].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - GPIO_LOCK(sc); sc->sc_pins[pin].gp_flags = flags; Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/dev/gpio/gpiobus.c Tue Nov 18 17:22:08 2014 (r274670) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +71,23 @@ static int gpiobus_pin_set(device_t, dev static int gpiobus_pin_get(device_t, device_t, uint32_t, unsigned int*); static int gpiobus_pin_toggle(device_t, device_t, uint32_t); +int +gpio_check_flags(uint32_t caps, uint32_t flags) +{ + + /* Check for unwanted flags. */ + if ((flags & caps) == 0 || (flags & caps) != flags) + return (EINVAL); + /* Cannot mix input/output together. */ + if (flags & GPIO_PIN_INPUT && flags & GPIO_PIN_OUTPUT) + return (EINVAL); + /* Cannot mix pull-up/pull-down together. */ + if (flags & GPIO_PIN_PULLUP && flags & GPIO_PIN_PULLDOWN) + return (EINVAL); + + return (0); +} + static void gpiobus_print_pins(struct gpiobus_ivar *devi, char *buf, size_t buflen) { @@ -490,11 +508,16 @@ gpiobus_pin_setflags(device_t dev, devic { struct gpiobus_softc *sc = GPIOBUS_SOFTC(dev); struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); + uint32_t caps; if (pin >= devi->npins) return (EINVAL); + if (GPIO_PIN_GETCAPS(sc->sc_dev, devi->pins[pin], &caps) != 0) + return (EINVAL); + if (gpio_check_flags(caps, flags) != 0) + return (EINVAL); - return GPIO_PIN_SETFLAGS(sc->sc_dev, devi->pins[pin], flags); + return (GPIO_PIN_SETFLAGS(sc->sc_dev, devi->pins[pin], flags)); } static int Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/dev/gpio/gpiobusvar.h Tue Nov 18 17:22:08 2014 (r274670) @@ -94,6 +94,7 @@ gpio_map_gpios(device_t bus, phandle_t d device_t ofw_gpiobus_add_fdt_child(device_t, phandle_t); #endif +int gpio_check_flags(uint32_t, uint32_t); int gpiobus_init_softc(device_t); extern driver_t gpiobus_driver; Modified: head/sys/dev/gpio/gpioc.c ============================================================================== --- head/sys/dev/gpio/gpioc.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/dev/gpio/gpioc.c Tue Nov 18 17:22:08 2014 (r274670) @@ -29,19 +29,16 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include +#include #include #include #include #include -#include -#include -#include -#include +#include + #include "gpio_if.h" #undef GPIOC_DEBUG @@ -119,6 +116,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cm struct gpioc_softc *sc = cdev->si_drv1; struct gpio_pin pin; struct gpio_req req; + uint32_t caps; switch (cmd) { case GPIOMAXPIN: @@ -141,8 +139,12 @@ gpioc_ioctl(struct cdev *cdev, u_long cm case GPIOSETCONFIG: bcopy(arg, &pin, sizeof(pin)); dprintf("set config pin %d\n", pin.gp_pin); - res = GPIO_PIN_SETFLAGS(sc->sc_pdev, pin.gp_pin, - pin.gp_flags); + res = GPIO_PIN_GETCAPS(sc->sc_pdev, pin.gp_pin, &caps); + if (res == 0) + res = gpio_check_flags(caps, pin.gp_flags); + if (res == 0) + res = GPIO_PIN_SETFLAGS(sc->sc_pdev, pin.gp_pin, + pin.gp_flags); break; case GPIOGET: bcopy(arg, &req, sizeof(req)); Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/mips/atheros/ar71xx_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -241,16 +241,8 @@ ar71xx_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->gpio_pins[i].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - ar71xx_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); + return (0); } Modified: head/sys/mips/cavium/octeon_gpio.c ============================================================================== --- head/sys/mips/cavium/octeon_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/mips/cavium/octeon_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -219,16 +219,8 @@ octeon_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->gpio_pins[i].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - octeon_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); + return (0); } Modified: head/sys/mips/rt305x/rt305x_gpio.c ============================================================================== --- head/sys/mips/rt305x/rt305x_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/mips/rt305x/rt305x_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -242,18 +242,8 @@ rt305x_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Check for unwanted flags. */ - if ((flags & sc->gpio_pins[i].gp_caps) != flags) - return (EINVAL); - - /* Can't mix input/output together */ - if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == - (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) - return (EINVAL); - rt305x_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); - return (0); } Modified: head/sys/powerpc/wii/wii_gpio.c ============================================================================== --- head/sys/powerpc/wii/wii_gpio.c Tue Nov 18 17:07:02 2014 (r274669) +++ head/sys/powerpc/wii/wii_gpio.c Tue Nov 18 17:22:08 2014 (r274670) @@ -295,11 +295,6 @@ wiigpio_pin_setflags(device_t dev, uint3 if (pin >= WIIGPIO_NPINS) return (EINVAL); - if ((flags & ~(GPIO_PIN_OUTPUT|GPIO_PIN_INPUT)) != 0) - return (EINVAL); - if ((flags & (GPIO_PIN_OUTPUT|GPIO_PIN_INPUT)) == - (GPIO_PIN_OUTPUT|GPIO_PIN_INPUT)) - return (EINVAL); sc = device_get_softc(dev); pinbank = WIIGPIO_PINBANK(pin); pinmask = WIIGPIO_PINMASK(pin); From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 17:37:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3928833F; Tue, 18 Nov 2014 17:37:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 256D3A41; Tue, 18 Nov 2014 17:37:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIHbYsw066422; Tue, 18 Nov 2014 17:37:34 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIHbYKl066421; Tue, 18 Nov 2014 17:37:34 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201411181737.sAIHbYKl066421@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 18 Nov 2014 17:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274671 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 17:37:34 -0000 Author: loos Date: Tue Nov 18 17:37:33 2014 New Revision: 274671 URL: https://svnweb.freebsd.org/changeset/base/274671 Log: Make gpio_default_map_gpios() static. No functional changes. Modified: head/sys/dev/gpio/gpio_if.m Modified: head/sys/dev/gpio/gpio_if.m ============================================================================== --- head/sys/dev/gpio/gpio_if.m Tue Nov 18 17:22:08 2014 (r274670) +++ head/sys/dev/gpio/gpio_if.m Tue Nov 18 17:37:33 2014 (r274671) @@ -32,9 +32,7 @@ INTERFACE gpio; CODE { - static gpio_map_gpios_t gpio_default_map_gpios; - - int + static int gpio_default_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, pcell_t *gpios, uint32_t *pin, uint32_t *flags) From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 18:03:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B64FB26; Tue, 18 Nov 2014 18:03:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 566B8D52; Tue, 18 Nov 2014 18:03:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAII3gMU079802; Tue, 18 Nov 2014 18:03:42 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAII3fCg079794; Tue, 18 Nov 2014 18:03:41 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411181803.sAII3fCg079794@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Tue, 18 Nov 2014 18:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274672 - in head/contrib/libxo: . libxo xolint X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 18:03:42 -0000 Author: marcel Date: Tue Nov 18 18:03:40 2014 New Revision: 274672 URL: https://svnweb.freebsd.org/changeset/base/274672 Log: Upgrade libxo to 0.1.6. Summary of changes: 1. Coverity defect fixes Obtained from: https://github.com/Juniper/libxo/releases/tag/0.1.6 Modified: head/contrib/libxo/configure.ac head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xoconfig.h head/contrib/libxo/libxo/xoversion.h head/contrib/libxo/xolint/xolint.pl Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Tue Nov 18 17:37:33 2014 (r274671) +++ head/contrib/libxo/configure.ac Tue Nov 18 18:03:40 2014 (r274672) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.1.5], [phil@juniper.net]) +AC_INIT([libxo], [0.1.6], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/libxo/libxo.c ============================================================================== --- head/contrib/libxo/libxo/libxo.c Tue Nov 18 17:37:33 2014 (r274671) +++ head/contrib/libxo/libxo/libxo.c Tue Nov 18 18:03:40 2014 (r274672) @@ -317,7 +317,7 @@ xo_init_handle (xo_handle_t *xop) cp = getenv("LC_ALL"); if (cp == NULL) cp = "UTF-8"; /* Optimistic? */ - cp = setlocale(LC_CTYPE, cp); + (void) setlocale(LC_CTYPE, cp); } /* @@ -607,8 +607,10 @@ xo_vsnprintf (xo_handle_t *xop, xo_buffe rc = vsnprintf(xbp->xb_curp, left, fmt, va_local); if (rc > xbp->xb_size) { - if (!xo_buf_has_room(xbp, rc)) + if (!xo_buf_has_room(xbp, rc)) { + va_end(va_local); return -1; + } /* * After we call vsnprintf(), the stage of vap is not defined. @@ -648,8 +650,10 @@ xo_printf_v (xo_handle_t *xop, const cha rc = vsnprintf(xbp->xb_curp, left, fmt, va_local); if (rc > xbp->xb_size) { - if (!xo_buf_has_room(xbp, rc)) + if (!xo_buf_has_room(xbp, rc)) { + va_end(va_local); return -1; + } va_end(va_local); /* Reset vap to the start */ va_copy(va_local, vap); @@ -974,8 +978,10 @@ xo_warn_hcv (xo_handle_t *xop, int code, int left = xbp->xb_size - (xbp->xb_curp - xbp->xb_bufp); int rc = vsnprintf(xbp->xb_curp, left, newfmt, vap); if (rc > xbp->xb_size) { - if (!xo_buf_has_room(xbp, rc)) + if (!xo_buf_has_room(xbp, rc)) { + va_end(va_local); return; + } va_end(vap); /* Reset vap to the start */ va_copy(vap, va_local); @@ -1118,8 +1124,10 @@ xo_message_hcv (xo_handle_t *xop, int co int left = xbp->xb_size - (xbp->xb_curp - xbp->xb_bufp); rc = vsnprintf(xbp->xb_curp, left, fmt, vap); if (rc > xbp->xb_size) { - if (!xo_buf_has_room(xbp, rc)) + if (!xo_buf_has_room(xbp, rc)) { + va_end(va_local); return; + } va_end(vap); /* Reset vap to the start */ va_copy(vap, va_local); @@ -1154,14 +1162,15 @@ xo_message_hcv (xo_handle_t *xop, int co va_copy(va_local, vap); - rc = vsnprintf(buf, bufsiz, fmt, va_local); + rc = vsnprintf(bp, bufsiz, fmt, va_local); if (rc > bufsiz) { bufsiz = rc + BUFSIZ; bp = alloca(bufsiz); va_end(va_local); va_copy(va_local, vap); - rc = vsnprintf(buf, bufsiz, fmt, va_local); + rc = vsnprintf(bp, bufsiz, fmt, va_local); } + va_end(va_local); cp = bp + rc; if (need_nl) { @@ -1302,9 +1311,9 @@ xo_create_to_file (FILE *fp, xo_style_t * @xop XO handle to alter (or NULL for default handle) */ void -xo_destroy (xo_handle_t *xop) +xo_destroy (xo_handle_t *xop_arg) { - xop = xo_default(xop); + xo_handle_t *xop = xo_default(xop_arg); if (xop->xo_close && (xop->xo_flags & XOF_CLOSE_FP)) xop->xo_close(xop->xo_opaque); @@ -1315,7 +1324,7 @@ xo_destroy (xo_handle_t *xop) xo_buf_cleanup(&xop->xo_predicate); xo_buf_cleanup(&xop->xo_attrs); - if (xop == &xo_default_handle) { + if (xop_arg == NULL) { bzero(&xo_default_handle, sizeof(&xo_default_handle)); xo_default_inited = 0; } else @@ -1743,7 +1752,7 @@ xo_format_string_direct (xo_handle_t *xo int need_enc, int have_enc) { int cols = 0; - wchar_t wc; + wchar_t wc = 0; int ilen, olen, width; int attr = (flags & XFF_ATTR); const char *sp; Modified: head/contrib/libxo/libxo/xoconfig.h ============================================================================== --- head/contrib/libxo/libxo/xoconfig.h Tue Nov 18 17:37:33 2014 (r274671) +++ head/contrib/libxo/libxo/xoconfig.h Tue Nov 18 18:03:40 2014 (r274672) @@ -158,7 +158,7 @@ #define PACKAGE_NAME "libxo" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxo 0.1.5" +#define PACKAGE_STRING "libxo 0.1.6" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxo" @@ -167,7 +167,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.1.5" +#define PACKAGE_VERSION "0.1.6" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -181,7 +181,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "0.1.5" +#define VERSION "0.1.6" /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ Modified: head/contrib/libxo/libxo/xoversion.h ============================================================================== --- head/contrib/libxo/libxo/xoversion.h Tue Nov 18 17:37:33 2014 (r274671) +++ head/contrib/libxo/libxo/xoversion.h Tue Nov 18 18:03:40 2014 (r274672) @@ -18,17 +18,17 @@ /** * The version string */ -#define LIBXO_VERSION "0.1.5" +#define LIBXO_VERSION "0.1.6" /** * The version number */ -#define LIBXO_VERSION_NUMBER 1004 +#define LIBXO_VERSION_NUMBER 1006 /** * The version number as a string */ -#define LIBXO_VERSION_STRING "1004" +#define LIBXO_VERSION_STRING "1006" /** * The version number extra info as a string Modified: head/contrib/libxo/xolint/xolint.pl ============================================================================== --- head/contrib/libxo/xolint/xolint.pl Tue Nov 18 17:37:33 2014 (r274671) +++ head/contrib/libxo/xolint/xolint.pl Tue Nov 18 18:03:40 2014 (r274672) @@ -28,6 +28,19 @@ sub main { extract_samples() if /^-X/; } + if ($#ARGV < 0) { + print STDERR "xolint [options] files ...\n"; + print STDERR " -c invoke 'cpp' on input\n"; + print STDERR " -C flags Pass flags to cpp\n"; + print STDERR " -d Show debug output\n"; + print STDERR " -D Extract xolint documentation\n"; + print STDERR " -I Print xo_info_t data\n"; + print STDERR " -p Print input data on errors\n"; + print STDERR " -V Print vocabulary (list of tags)\n"; + print STDERR " -X Print examples of invalid use\n"; + exit(1); + } + for $file (@ARGV) { parse_file($file); } @@ -269,9 +282,9 @@ sub check_format { $last = $prev; next; } + $prev = $ch; } - $prev = $ch; $build[$phase] .= $ch; } @@ -346,18 +359,6 @@ sub check_field { info("potential missing slash after N, L, or T with format") if $field[1] =~ /%/; - #@ Format cannot be given when content is present (roles: DNLT) - #@ xo_emit("{T:Max/%6.6s}", "Max"); - #@ Fields with the D, N, L, or T roles can't have both - #@ static literal content ("{T:Title}") and a - #@ format ("{T:/%s}"). - #@ This error will also occur when the content has a backslash - #@ in it, like "{N:Type of I/O}"; backslashes should be escaped, - #@ like "{N:Type of I\\/O}". Note the double backslash, one for - #@ handling 'C' strings, and one for libxo. - error("format cannot be given when content is present") - if $field[1] && $field[2]; - #@ An encoding format cannot be given (roles: DNLT) #@ xo_emit("{T:Max//%s}", "Max"); #@ Fields with the D, N, L, and T roles are not emitted in @@ -367,6 +368,21 @@ sub check_field { if $field[3]; } + # Field is a decoration, label, or title + if ($field[0] =~ /DLN/) { + #@ Format cannot be given when content is present (roles: DLN) + #@ xo_emit("{N:Max/%6.6s}", "Max"); + #@ Fields with the D, L, or N roles can't have both + #@ static literal content ("{L:Label}") and a + #@ format ("{L:/%s}"). + #@ This error will also occur when the content has a backslash + #@ in it, like "{N:Type of I/O}"; backslashes should be escaped, + #@ like "{N:Type of I\\/O}". Note the double backslash, one for + #@ handling 'C' strings, and one for libxo. + error("format cannot be given when content is present") + if $field[1] && $field[2]; + } + # A value field if (length($field[0]) == 0 || $field[0] =~ /V/) { @@ -527,7 +543,7 @@ sub check_field_format { #@ for non-strings. This error may occur from a typo, #@ like "{:tag/%6..6d}" where only one period should be used. error("max width only valid for strings") - if $#chunks >= 2 && $fc =~ /[sS]/; + if $#chunks >= 2 && $fc !~ /[sS]/; } sub error { From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 18:40:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF709442; Tue, 18 Nov 2014 18:40:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAB73FC; Tue, 18 Nov 2014 18:40:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIIe23M094559; Tue, 18 Nov 2014 18:40:02 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIIe2C7094558; Tue, 18 Nov 2014 18:40:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411181840.sAIIe2C7094558@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 18 Nov 2014 18:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274673 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 18:40:02 -0000 Author: delphij Date: Tue Nov 18 18:40:01 2014 New Revision: 274673 URL: https://svnweb.freebsd.org/changeset/base/274673 Log: Allow tuning zfs_max_recordsize via loader tunable. Tuning is NOT recommended. Requested by: Slawa Olhovchenkov MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Nov 18 18:03:40 2014 (r274672) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Nov 18 18:40:01 2014 (r274673) @@ -51,6 +51,8 @@ #include #include +SYSCTL_DECL(_vfs_zfs); + /* * The SPA supports block sizes up to 16MB. However, very large blocks * can have an impact on i/o latency (e.g. tying up a spinning disk for @@ -61,6 +63,9 @@ * of this setting. */ int zfs_max_recordsize = 1 * 1024 * 1024; +SYSCTL_INT(_vfs_zfs, OID_AUTO, max_recordsize, CTLFLAG_RDTUN, + &zfs_max_recordsize, 0, + "Maximum block size. Expect dragons when tuning this."); #define SWITCH64(x, y) \ { \ From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 18:52:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F94A656; Tue, 18 Nov 2014 18:52:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B4D92A9; Tue, 18 Nov 2014 18:52:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIIqdHv002983; Tue, 18 Nov 2014 18:52:39 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIIqd7S002982; Tue, 18 Nov 2014 18:52:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411181852.sAIIqd7S002982@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 18 Nov 2014 18:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274674 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 18:52:39 -0000 Author: delphij Date: Tue Nov 18 18:52:38 2014 New Revision: 274674 URL: https://svnweb.freebsd.org/changeset/base/274674 Log: Add a tunable for spa_slop_shift which controls how much space we would reserve by default. Tuning is not recommended. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Nov 18 18:40:01 2014 (r274673) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Nov 18 18:52:38 2014 (r274674) @@ -401,6 +401,9 @@ zfs_deadman_init() * See also the comments in zfs_space_check_t. */ int spa_slop_shift = 5; +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_slop_shift, CTLFLAG_RWTUN, + &spa_slop_shift, 0, + "Shift value of reserved space (1/(2^spa_slop_shift))."); /* * ========================================================================== From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 19:30:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6767DB6; Tue, 18 Nov 2014 19:30:04 +0000 (UTC) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru [78.107.232.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dchagin.static.corbina.net", Issuer "dchagin.static.corbina.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2083086C; Tue, 18 Nov 2014 19:30:02 +0000 (UTC) Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.9/8.14.9) with ESMTP id sAIJTqX2000962 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 18 Nov 2014 22:29:53 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.9/8.14.9/Submit) id sAIJTqVg000961; Tue, 18 Nov 2014 22:29:52 +0300 (MSK) (envelope-from dchagin) Date: Tue, 18 Nov 2014 22:29:52 +0300 From: Chagin Dmitry To: Adrian Chadd Subject: Re: svn commit: r274635 - head/sys/dev/pci Message-ID: <20141118192952.GA945@dchagin.static.corbina.net> References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> <20141118064626.GA956@dchagin.static.corbina.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 19:30:04 -0000 --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 18, 2014 at 07:47:46AM -0800, Adrian Chadd wrote: > Hi, >=20 > Want to post a bootverbose suspend/resume pass with -HEAD without this > patch in it, then with this patch in it? >=20 it seems that at resume path METHOD set_powerstate() is not invoked. fro pr= oper pciX. ie, no "Transition from D3 to D0" prints. i'm trying to understand the reas= on=20 > We should likely revert this commit (for correctness) and then dig > deeper into what's going on. >=20 sure. >=20 >=20 > -adrian >=20 >=20 > On 17 November 2014 22:46, Chagin Dmitry wrote: > > On Mon, Nov 17, 2014 at 05:45:23PM -0500, John Baldwin wrote: > >> On Monday, November 17, 2014 08:25:21 PM Dmitry Chagin wrote: > >> > Author: dchagin > >> > Date: Mon Nov 17 20:25:21 2014 > >> > New Revision: 274635 > >> > URL: https://svnweb.freebsd.org/changeset/base/274635 > >> > > >> > Log: > >> > Use the correct device as the power_for_sleep() method > >> > always pass request up to parent bridge. > >> > > >> > Reviewed by: jhb > >> > MFC after: 1 week > >> > xMFC: r274386,r274397 > >> > >> Hmm, I had misread this diff as being another instance of what Adrian = had > >> found. I think this is actually not correct. The parent of a pci dev= ice > >> ('dev' here) is a pciX device. pciX devices do not implement the > >> PCIB_POWER_FOR_SLEEP method from pcib_if.m, so this probably just broke > >> Adrian's Asus laptop as now it will always use D3 again and ignore _Sx= D. > > ugh.. i understood, let me see more closely > >> > >> You said that this change fixed your laptop, yes? Did it work before = Adrian's > >> change in r274386 and break afterwards? > > yes > > > > -- > > Have fun! > > chd --=20 Have fun! chd --/9DWx/yDrRhgMJTb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlRrnjAACgkQ0t2Tb3OO/O1mHQCfTTUzutDz+3FA24Em5+Mu+gKZ wmYAnA9K/hfW+uMP+I3/XaqrLi3La0BG =kboy -----END PGP SIGNATURE----- --/9DWx/yDrRhgMJTb-- From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 21:03:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B13A5292; Tue, 18 Nov 2014 21:03:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 833CE268; Tue, 18 Nov 2014 21:03:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIL3lV8063429; Tue, 18 Nov 2014 21:03:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIL3leC063427; Tue, 18 Nov 2014 21:03:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411182103.sAIL3leC063427@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 18 Nov 2014 21:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274675 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 21:03:47 -0000 Author: jhb Date: Tue Nov 18 21:03:46 2014 New Revision: 274675 URL: https://svnweb.freebsd.org/changeset/base/274675 Log: Convert the refire_notify_ack timer from timeout(9) to callout(9). Tested by: no one Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Nov 18 18:52:38 2014 (r274674) +++ head/sys/dev/isp/isp_freebsd.c Tue Nov 18 21:03:46 2014 (r274675) @@ -2137,9 +2137,9 @@ isp_refire_putback_atio(void *arg) { union ccb *ccb = arg; ispsoftc_t *isp = XS_ISP(ccb); - ISP_LOCK(isp); + + ISP_ASSERT_LOCKED(isp); isp_target_putback_atio(ccb); - ISP_UNLOCK(isp); } static void @@ -2147,13 +2147,13 @@ isp_refire_notify_ack(void *arg) { isp_tna_t *tp = arg; ispsoftc_t *isp = tp->isp; - ISP_LOCK(isp); + + ISP_ASSERT_LOCKED(isp); if (isp_notify_ack(isp, tp->not)) { - (void) timeout(isp_refire_notify_ack, tp, 5); + callout_schedule(&tp->timer, 5); } else { free(tp, M_DEVBUF); } - ISP_UNLOCK(isp); } @@ -2170,7 +2170,8 @@ isp_target_putback_atio(union ccb *ccb) if (qe == NULL) { xpt_print(ccb->ccb_h.path, "%s: Request Queue Overflow\n", __func__); - (void) timeout(isp_refire_putback_atio, ccb, 10); + callout_reset(&PISP_PCMD(ccb)->wdog, 10, + isp_refire_putback_atio, ccb); return; } memset(qe, 0, QENTRY_LEN); @@ -5964,7 +5965,9 @@ isp_async(ispsoftc_t *isp, ispasync_t cm } else { tp->not = NULL; } - (void) timeout(isp_refire_notify_ack, tp, 5); + callout_init_mtx(&tp->timer, &isp->isp_lock, 0); + callout_reset(&tp->timer, 5, + isp_refire_notify_ack, tp); } else { isp_prt(isp, ISP_LOGERR, "you lose- cannot allocate a notify refire"); } Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Tue Nov 18 18:52:38 2014 (r274674) +++ head/sys/dev/isp/isp_freebsd.h Tue Nov 18 21:03:46 2014 (r274675) @@ -158,6 +158,7 @@ typedef struct isp_timed_notify_ack { void *isp; void *not; uint8_t data[64]; /* sb QENTRY_LEN, but order of definitions is wrong */ + struct callout timer; } isp_tna_t; TAILQ_HEAD(isp_ccbq, ccb_hdr); @@ -401,6 +402,7 @@ struct isposinfo { */ #define ISP_LOCK(isp) mtx_lock(&isp->isp_osinfo.lock) #define ISP_UNLOCK(isp) mtx_unlock(&isp->isp_osinfo.lock) +#define ISP_ASSERT_LOCKED(isp) mtx_assert(&isp->isp_osinfo.lock, MA_OWNED) /* * Required Macros/Defines From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 21:51:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AED18CB6; Tue, 18 Nov 2014 21:51:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ACE9913; Tue, 18 Nov 2014 21:51:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAILp2mG085945; Tue, 18 Nov 2014 21:51:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAILp2iP085942; Tue, 18 Nov 2014 21:51:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411182151.sAILp2iP085942@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 18 Nov 2014 21:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274676 - head/sys/dev/mcd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 21:51:02 -0000 Author: jhb Date: Tue Nov 18 21:51:01 2014 New Revision: 274676 URL: https://svnweb.freebsd.org/changeset/base/274676 Log: Add locking to mcd(4) and mark MPSAFE. - Actually use existing per-softc mutex. - Use mutex in cdev routines and remove D_NEEDGIANT. - Use callout(9) instead of timeout(9). - Don't check for impossible conditions (e.g. MCDINIT being clear). - Remove critical_enter/exit when sending a PIO command. - Use bus_*() instead of bus_space_*(). Tested by: no one Modified: head/sys/dev/mcd/mcd.c head/sys/dev/mcd/mcd_isa.c head/sys/dev/mcd/mcdvar.h Modified: head/sys/dev/mcd/mcd.c ============================================================================== --- head/sys/dev/mcd/mcd.c Tue Nov 18 21:03:46 2014 (r274675) +++ head/sys/dev/mcd/mcd.c Tue Nov 18 21:51:01 2014 (r274676) @@ -128,7 +128,7 @@ static void hsg2msf(int hsg, bcd_t *msf) static int msf2hsg(bcd_t *msf, int relative); static int mcd_volinfo(struct mcd_softc *); static int mcd_waitrdy(struct mcd_softc *,int dly); -static timeout_t mcd_timeout; +static void mcd_timeout(void *arg); static void mcd_doread(struct mcd_softc *, int state, struct mcd_mbx *mbxin); static void mcd_soft_reset(struct mcd_softc *); static int mcd_hard_reset(struct mcd_softc *); @@ -168,7 +168,7 @@ static struct cdevsw mcd_cdevsw = { .d_ioctl = mcdioctl, .d_strategy = mcdstrategy, .d_name = "mcd", - .d_flags = D_DISK | D_NEEDGIANT, + .d_flags = D_DISK, }; #define MCD_RETRYS 5 @@ -193,6 +193,7 @@ mcd_attach(struct mcd_softc *sc) unit = device_get_unit(sc->dev); + MCD_LOCK(sc); sc->data.flags |= MCDINIT; mcd_soft_reset(sc); bioq_init(&sc->data.head); @@ -201,11 +202,13 @@ mcd_attach(struct mcd_softc *sc) /* wire controller for interrupts and dma */ mcd_configure(sc); #endif + MCD_UNLOCK(sc); /* name filled in probe */ sc->mcd_dev_t = make_dev(&mcd_cdevsw, 8 * unit, UID_ROOT, GID_OPERATOR, 0640, "mcd%d", unit); sc->mcd_dev_t->si_drv1 = (void *)sc; + callout_init_mtx(&sc->timer, &sc->mtx, 0); return (0); } @@ -218,41 +221,49 @@ mcdopen(struct cdev *dev, int flags, int sc = (struct mcd_softc *)dev->si_drv1; - /* not initialized*/ - if (!(sc->data.flags & MCDINIT)) - return (ENXIO); - /* invalidated in the meantime? mark all open part's invalid */ - if (!(sc->data.flags & MCDVALID) && sc->data.openflags) + MCD_LOCK(sc); + if (!(sc->data.flags & MCDVALID) && sc->data.openflags) { + MCD_UNLOCK(sc); return (ENXIO); + } - if (mcd_getstat(sc, 1) == -1) + if (mcd_getstat(sc, 1) == -1) { + MCD_UNLOCK(sc); return (EIO); + } if ( (sc->data.status & (MCDDSKCHNG|MCDDOOROPEN)) || !(sc->data.status & MCDDSKIN)) for (retry = 0; retry < DISK_SENSE_SECS * WAIT_FRAC; retry++) { - (void) tsleep((caddr_t)sc, PSOCK | PCATCH, "mcdsn1", hz/WAIT_FRAC); - if ((r = mcd_getstat(sc, 1)) == -1) + (void) mtx_sleep(sc, &sc->mtx, PSOCK | PCATCH, + "mcdsn1", hz/WAIT_FRAC); + if ((r = mcd_getstat(sc, 1)) == -1) { + MCD_UNLOCK(sc); return (EIO); + } if (r != -2) break; } if (sc->data.status & MCDDOOROPEN) { + MCD_UNLOCK(sc); device_printf(sc->dev, "door is open\n"); return (ENXIO); } if (!(sc->data.status & MCDDSKIN)) { + MCD_UNLOCK(sc); device_printf(sc->dev, "no CD inside\n"); return (ENXIO); } if (sc->data.status & MCDDSKCHNG) { + MCD_UNLOCK(sc); device_printf(sc->dev, "CD not sensed\n"); return (ENXIO); } if (mcd_size(dev) < 0) { + MCD_UNLOCK(sc); device_printf(sc->dev, "failed to get disk size\n"); return (ENXIO); } @@ -262,10 +273,14 @@ mcdopen(struct cdev *dev, int flags, int sc->data.flags |= MCDVALID; (void) mcd_lock_door(sc, MCD_LK_LOCK); - if (!(sc->data.flags & MCDVALID)) + if (!(sc->data.flags & MCDVALID)) { + MCD_UNLOCK(sc); return (ENXIO); + } - return mcd_read_toc(sc); + r = mcd_read_toc(sc); + MCD_UNLOCK(sc); + return (r); } static int @@ -275,12 +290,13 @@ mcdclose(struct cdev *dev, int flags, in sc = (struct mcd_softc *)dev->si_drv1; - if (!(sc->data.flags & MCDINIT) || !sc->data.openflags) - return (ENXIO); + MCD_LOCK(sc); + KASSERT(sc->data.openflags, ("device not open")); (void) mcd_lock_door(sc, MCD_LK_UNLOCK); sc->data.openflags = 0; sc->data.partflags &= ~MCDREADRAW; + MCD_UNLOCK(sc); return (0); } @@ -293,6 +309,7 @@ mcdstrategy(struct bio *bp) sc = (struct mcd_softc *)bp->bio_dev->si_drv1; /* if device invalidated (e.g. media change, door open), error */ + MCD_LOCK(sc); if (!(sc->data.flags & MCDVALID)) { device_printf(sc->dev, "media changed\n"); bp->bio_error = EIO; @@ -321,11 +338,13 @@ mcdstrategy(struct bio *bp) /* now check whether we can perform processing */ mcd_start(sc); + MCD_UNLOCK(sc); return; bad: bp->bio_flags |= BIO_ERROR; done: + MCD_UNLOCK(sc); bp->bio_resid = bp->bio_bcount; biodone(bp); return; @@ -336,6 +355,7 @@ mcd_start(struct mcd_softc *sc) { struct bio *bp; + MCD_ASSERT_LOCKED(sc); if (sc->data.flags & MCDMBXBSY) { return; } @@ -365,8 +385,11 @@ mcdioctl(struct cdev *dev, u_long cmd, c sc = (struct mcd_softc *)dev->si_drv1; - if (mcd_getstat(sc, 1) == -1) /* detect disk change too */ + MCD_LOCK(sc); + if (mcd_getstat(sc, 1) == -1) { /* detect disk change too */ + MCD_UNLOCK(sc); return (EIO); + } MCD_TRACE("ioctl called 0x%lx\n", cmd); switch (cmd) { @@ -378,83 +401,114 @@ MCD_TRACE("ioctl called 0x%lx\n", cmd); case CDIOCSETMUTE: case CDIOCSETLEFT: case CDIOCSETRIGHT: + MCD_UNLOCK(sc); return (EINVAL); case CDIOCEJECT: - return mcd_eject(sc); + r = mcd_eject(sc); + MCD_UNLOCK(sc); + return (r); case CDIOCSETDEBUG: sc->data.debug = 1; + MCD_UNLOCK(sc); return (0); case CDIOCCLRDEBUG: sc->data.debug = 0; + MCD_UNLOCK(sc); return (0); case CDIOCRESET: - return mcd_hard_reset(sc); + r = mcd_hard_reset(sc); + MCD_UNLOCK(sc); + return (r); case CDIOCALLOW: - return mcd_lock_door(sc, MCD_LK_UNLOCK); + r = mcd_lock_door(sc, MCD_LK_UNLOCK); + MCD_UNLOCK(sc); + return (r); case CDIOCPREVENT: - return mcd_lock_door(sc, MCD_LK_LOCK); + r = mcd_lock_door(sc, MCD_LK_LOCK); + MCD_UNLOCK(sc); + return (r); case CDIOCCLOSE: - return mcd_inject(sc); + r = mcd_inject(sc); + MCD_UNLOCK(sc); + return (r); } if (!(sc->data.flags & MCDVALID)) { if ( (sc->data.status & (MCDDSKCHNG|MCDDOOROPEN)) || !(sc->data.status & MCDDSKIN)) for (retry = 0; retry < DISK_SENSE_SECS * WAIT_FRAC; retry++) { - (void) tsleep((caddr_t)sc, PSOCK | PCATCH, "mcdsn2", hz/WAIT_FRAC); - if ((r = mcd_getstat(sc, 1)) == -1) + (void) mtx_sleep(sc, &sc->mtx, PSOCK | PCATCH, + "mcdsn2", hz/WAIT_FRAC); + if ((r = mcd_getstat(sc, 1)) == -1) { + MCD_UNLOCK(sc); return (EIO); + } if (r != -2) break; } if ( (sc->data.status & (MCDDOOROPEN|MCDDSKCHNG)) || !(sc->data.status & MCDDSKIN) || mcd_size(dev) < 0 - ) + ) { + MCD_UNLOCK(sc); return (ENXIO); + } sc->data.flags |= MCDVALID; sc->data.partflags |= MCDREADRAW; (void) mcd_lock_door(sc, MCD_LK_LOCK); - if (!(sc->data.flags & MCDVALID)) + if (!(sc->data.flags & MCDVALID)) { + MCD_UNLOCK(sc); return (ENXIO); + } } switch (cmd) { case DIOCGMEDIASIZE: *(off_t *)addr = (off_t)sc->data.disksize * sc->data.blksize; - return (0); + r = 0; + break; case DIOCGSECTORSIZE: *(u_int *)addr = sc->data.blksize; - return (0); - + r = 0; + break; case CDIOCPLAYTRACKS: - return mcd_playtracks(sc, (struct ioc_play_track *) addr); + r = mcd_playtracks(sc, (struct ioc_play_track *) addr); + break; case CDIOCPLAYBLOCKS: - return mcd_playblocks(sc, (struct ioc_play_blocks *) addr); + r = mcd_playblocks(sc, (struct ioc_play_blocks *) addr); + break; case CDIOCPLAYMSF: - return mcd_playmsf(sc, (struct ioc_play_msf *) addr); + r = mcd_playmsf(sc, (struct ioc_play_msf *) addr); + break; case CDIOCREADSUBCHANNEL_SYSSPACE: return mcd_subchan(sc, (struct ioc_read_subchannel *) addr, 1); case CDIOCREADSUBCHANNEL: return mcd_subchan(sc, (struct ioc_read_subchannel *) addr, 0); case CDIOREADTOCHEADER: - return mcd_toc_header(sc, (struct ioc_toc_header *) addr); + r = mcd_toc_header(sc, (struct ioc_toc_header *) addr); + break; case CDIOREADTOCENTRYS: return mcd_toc_entrys(sc, (struct ioc_read_toc_entry *) addr); case CDIOCRESUME: - return mcd_resume(sc); + r = mcd_resume(sc); + break; case CDIOCPAUSE: - return mcd_pause(sc); + r = mcd_pause(sc); + break; case CDIOCSTART: if (mcd_setmode(sc, MCD_MD_COOKED) != 0) - return (EIO); - return (0); + r = EIO; + else + r = 0; + break; case CDIOCSTOP: - return mcd_stop(sc); + r = mcd_stop(sc); + break; default: - return (ENOTTY); + r = ENOTTY; } - /*NOTREACHED*/ + MCD_UNLOCK(sc); + return (r); } static int @@ -762,6 +816,7 @@ mcd_timeout(void *arg) sc = (struct mcd_softc *)arg; + MCD_ASSERT_LOCKED(sc); mcd_doread(sc, sc->ch_state, sc->ch_mbxsave); } @@ -775,6 +830,7 @@ mcd_doread(struct mcd_softc *sc, int sta int blknum; caddr_t addr; + MCD_ASSERT_LOCKED(sc); mbx = (state!=MCD_S_BEGIN) ? sc->ch_mbxsave : mbxin; bp = mbx->bp; @@ -789,15 +845,16 @@ retry_status: MCD_WRITE(sc, MCD_REG_COMMAND, MCD_CMDGETSTAT); mbx->count = RDELAY_WAITSTAT; sc->ch_state = MCD_S_WAITSTAT; - sc->ch = timeout(mcd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz/100, mcd_timeout, sc); /* XXX */ return; case MCD_S_WAITSTAT: sc->ch_state = MCD_S_WAITSTAT; - untimeout(mcd_timeout,(caddr_t)sc, sc->ch); + callout_stop(&sc->timer); if (mbx->count-- >= 0) { if (MCD_READ(sc, MCD_FLAGS) & MFL_STATUS_NOT_AVAIL) { sc->ch_state = MCD_S_WAITSTAT; - timeout(mcd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz/100, + mcd_timeout, sc); /* XXX */ return; } sc->data.status = MCD_READ(sc, MCD_REG_STATUS) & 0xFF; @@ -834,7 +891,7 @@ retry_mode: MCD_WRITE(sc, MCD_REG_COMMAND, rm); sc->ch_state = MCD_S_WAITMODE; - sc->ch = timeout(mcd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, mcd_timeout, sc); /* XXX */ return; } else { device_printf(sc->dev, "timeout getstatus\n"); @@ -843,14 +900,14 @@ retry_mode: case MCD_S_WAITMODE: sc->ch_state = MCD_S_WAITMODE; - untimeout(mcd_timeout, (caddr_t)sc, sc->ch); + callout_stop(&sc->timer); if (mbx->count-- < 0) { device_printf(sc->dev, "timeout set mode\n"); goto readerr; } if (MCD_READ(sc, MCD_FLAGS) & MFL_STATUS_NOT_AVAIL) { sc->ch_state = MCD_S_WAITMODE; - sc->ch = timeout(mcd_timeout, (caddr_t)sc, hz/100); + callout_reset(&sc->timer, hz / 100, mcd_timeout, sc); return; } sc->data.status = MCD_READ(sc, MCD_REG_STATUS) & 0xFF; @@ -878,7 +935,6 @@ nextblock: hsg2msf(blknum,rbuf.start_msf); retry_read: /* send the read command */ - critical_enter(); MCD_WRITE(sc, MCD_REG_COMMAND, sc->data.read_command); MCD_WRITE(sc, MCD_REG_COMMAND, rbuf.start_msf[0]); MCD_WRITE(sc, MCD_REG_COMMAND, rbuf.start_msf[1]); @@ -886,7 +942,6 @@ retry_read: MCD_WRITE(sc, MCD_REG_COMMAND, 0); MCD_WRITE(sc, MCD_REG_COMMAND, 0); MCD_WRITE(sc, MCD_REG_COMMAND, 1); - critical_exit(); /* Spin briefly (<= 2ms) to avoid missing next block */ for (i = 0; i < 20; i++) { @@ -898,11 +953,11 @@ retry_read: mbx->count = RDELAY_WAITREAD; sc->ch_state = MCD_S_WAITREAD; - sc->ch = timeout(mcd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, mcd_timeout, sc); /* XXX */ return; case MCD_S_WAITREAD: sc->ch_state = MCD_S_WAITREAD; - untimeout(mcd_timeout, (caddr_t)sc, sc->ch); + callout_stop(&sc->timer); if (mbx->count-- > 0) { k = MCD_READ(sc, MCD_FLAGS); if (!(k & MFL_DATA_NOT_AVAIL)) { /* XXX */ @@ -947,7 +1002,7 @@ retry_read: goto changed; } sc->ch_state = MCD_S_WAITREAD; - sc->ch = timeout(mcd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, mcd_timeout, sc); /* XXX */ return; } else { device_printf(sc->dev, "timeout read data\n"); @@ -1010,7 +1065,8 @@ mcd_close_tray(struct mcd_softc *sc) MCD_WRITE(sc, MCD_REG_COMMAND, MCD_CMDCLOSETRAY); for (retry = 0; retry < CLOSE_TRAY_SECS * WAIT_FRAC; retry++) { if (MCD_READ(sc, MCD_FLAGS) & MFL_STATUS_NOT_AVAIL) - (void) tsleep((caddr_t)sc, PSOCK | PCATCH, "mcdcls", hz/WAIT_FRAC); + (void) mtx_sleep(sc, &sc->mtx, PSOCK | PCATCH, + "mcdcls", hz/WAIT_FRAC); else { if ((r = mcd_getstat(sc, 0)) == -1) return (EIO); @@ -1303,6 +1359,7 @@ mcd_toc_entrys(struct mcd_softc *sc, str } /* copy the data back */ + MCD_UNLOCK(sc); return copyout(entries, te->data, n * sizeof(struct cd_toc_entry)); } @@ -1418,6 +1475,7 @@ mcd_subchan(struct mcd_softc *sc, struct break; } + MCD_UNLOCK(sc); if (nocopyout == 0) return copyout(&data, sch->data, min(sizeof(struct cd_sub_channel_info), sch->data_len)); bcopy(&data, sch->data, min(sizeof(struct cd_sub_channel_info), sch->data_len)); Modified: head/sys/dev/mcd/mcd_isa.c ============================================================================== --- head/sys/dev/mcd/mcd_isa.c Tue Nov 18 21:03:46 2014 (r274675) +++ head/sys/dev/mcd/mcd_isa.c Tue Nov 18 21:51:01 2014 (r274676) @@ -126,6 +126,7 @@ mcd_alloc_resources (device_t dev) sc = device_get_softc(dev); error = 0; + mtx_init(&sc->mtx, "mcd", NULL, MTX_DEF); if (sc->port_type) { sc->port = bus_alloc_resource_any(dev, sc->port_type, @@ -135,8 +136,6 @@ mcd_alloc_resources (device_t dev) error = ENOMEM; goto bad; } - sc->port_bst = rman_get_bustag(sc->port); - sc->port_bsh = rman_get_bushandle(sc->port); } if (sc->irq_type) { @@ -159,9 +158,6 @@ mcd_alloc_resources (device_t dev) } } - mtx_init(&sc->mtx, device_get_nameunit(dev), - "Interrupt lock", MTX_DEF | MTX_RECURSE); - bad: return (error); } @@ -175,18 +171,14 @@ mcd_release_resources (device_t dev) if (sc->irq_ih) bus_teardown_intr(dev, sc->irq, sc->irq_ih); - if (sc->port) { + if (sc->port) bus_release_resource(dev, sc->port_type, sc->port_rid, sc->port); - sc->port_bst = 0; - sc->port_bsh = 0; - } if (sc->irq) bus_release_resource(dev, sc->irq_type, sc->irq_rid, sc->irq); if (sc->drq) bus_release_resource(dev, sc->drq_type, sc->drq_rid, sc->drq); - if (mtx_initialized(&sc->mtx) != 0) - mtx_destroy(&sc->mtx); + mtx_destroy(&sc->mtx); return; } Modified: head/sys/dev/mcd/mcdvar.h ============================================================================== --- head/sys/dev/mcd/mcdvar.h Tue Nov 18 21:03:46 2014 (r274675) +++ head/sys/dev/mcd/mcdvar.h Tue Nov 18 21:51:01 2014 (r274676) @@ -41,8 +41,6 @@ struct mcd_softc { struct resource * port; int port_rid; int port_type; - bus_space_tag_t port_bst; - bus_space_handle_t port_bsh; struct resource * irq; int irq_rid; @@ -55,20 +53,19 @@ struct mcd_softc { struct mtx mtx; - struct callout_handle ch; + struct callout timer; int ch_state; struct mcd_mbx * ch_mbxsave; struct mcd_data data; }; -#define MCD_LOCK(_sc) splx(&(_sc)->mtx -#define MCD_UNLOCK(_sc) splx(&(_sc)->mtx +#define MCD_LOCK(_sc) mtx_lock(&_sc->mtx) +#define MCD_UNLOCK(_sc) mtx_unlock(&_sc->mtx) +#define MCD_ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED) -#define MCD_READ(_sc, _reg) \ - bus_space_read_1(_sc->port_bst, _sc->port_bsh, _reg) -#define MCD_WRITE(_sc, _reg, _val) \ - bus_space_write_1(_sc->port_bst, _sc->port_bsh, _reg, _val) +#define MCD_READ(_sc, _reg) bus_read_1(_sc->port, _reg) +#define MCD_WRITE(_sc, _reg, _val) bus_write_1(_sc->port, _reg, _val) int mcd_probe (struct mcd_softc *); int mcd_attach (struct mcd_softc *); From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 21:55:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2047E2E; Tue, 18 Nov 2014 21:55:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE07F9C4; Tue, 18 Nov 2014 21:55:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAILtpxT087178; Tue, 18 Nov 2014 21:55:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAILtp6l087176; Tue, 18 Nov 2014 21:55:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411182155.sAILtp6l087176@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 18 Nov 2014 21:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274677 - head/sys/dev/mly X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 21:55:52 -0000 Author: jhb Date: Tue Nov 18 21:55:50 2014 New Revision: 274677 URL: https://svnweb.freebsd.org/changeset/base/274677 Log: Add locking to mly(4) and mark MPSAFE. - Add a per-softc mutex. - Use mutex as CAM sim lock. - Use taskqueue_thread instead of taskqueue_swi_giant. - Use callout(9) instead of timeout(9). - Use bus_*() instead of bus_space_*(). Tested by: no one Modified: head/sys/dev/mly/mly.c head/sys/dev/mly/mlyvar.h Modified: head/sys/dev/mly/mly.c ============================================================================== --- head/sys/dev/mly/mly.c Tue Nov 18 21:51:01 2014 (r274676) +++ head/sys/dev/mly/mly.c Tue Nov 18 21:55:50 2014 (r274677) @@ -88,7 +88,8 @@ static void mly_periodic(void *data); static int mly_immediate_command(struct mly_command *mc); static int mly_start(struct mly_command *mc); static void mly_done(struct mly_softc *sc); -static void mly_complete(void *context, int pending); +static void mly_complete(struct mly_softc *sc); +static void mly_complete_handler(void *context, int pending); static int mly_alloc_command(struct mly_softc *sc, struct mly_command **mcp); static void mly_release_command(struct mly_command *mc); @@ -116,7 +117,7 @@ static void mly_printstate(struct mly_so static void mly_print_command(struct mly_command *mc); static void mly_print_packet(struct mly_command *mc); static void mly_panic(struct mly_softc *sc, char *reason); -static int mly_timeout(struct mly_softc *sc); +static void mly_timeout(void *arg); #endif void mly_print_controller(int controller); @@ -151,7 +152,6 @@ MODULE_DEPEND(mly, cam, 1, 1, 1); static struct cdevsw mly_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = mly_user_open, .d_close = mly_user_close, .d_ioctl = mly_user_ioctl, @@ -216,8 +216,11 @@ mly_attach(device_t dev) debug_called(1); sc->mly_dev = dev; + mtx_init(&sc->mly_lock, "mly", NULL, MTX_DEF); + callout_init_mtx(&sc->mly_periodic, &sc->mly_lock, 0); #ifdef MLY_DEBUG + callout_init_mtx(&sc->mly_timeout, &sc->mly_lock, 0); if (device_get_unit(sc->mly_dev) == 0) mly_softc0 = sc; #endif @@ -238,7 +241,7 @@ mly_attach(device_t dev) /* * Initialise command-completion task. */ - TASK_INIT(&sc->mly_task_complete, 0, mly_complete, sc); + TASK_INIT(&sc->mly_task_complete, 0, mly_complete_handler, sc); /* disable interrupts before we start talking to the controller */ MLY_MASK_INTERRUPTS(sc); @@ -260,7 +263,10 @@ mly_attach(device_t dev) /* * Obtain controller feature information */ - if ((error = mly_get_controllerinfo(sc))) + MLY_LOCK(sc); + error = mly_get_controllerinfo(sc); + MLY_UNLOCK(sc); + if (error) goto out; /* @@ -274,13 +280,16 @@ mly_attach(device_t dev) * Get the current event counter for health purposes, populate the initial * health status buffer. */ - if ((error = mly_get_eventstatus(sc))) - goto out; + MLY_LOCK(sc); + error = mly_get_eventstatus(sc); /* * Enable memory-mailbox mode. */ - if ((error = mly_enable_mmbox(sc))) + if (error == 0) + error = mly_enable_mmbox(sc); + MLY_UNLOCK(sc); + if (error) goto out; /* @@ -297,6 +306,7 @@ mly_attach(device_t dev) /* * Mark all attached devices for rescan. */ + MLY_LOCK(sc); mly_scan_devices(sc); /* @@ -305,6 +315,7 @@ mly_attach(device_t dev) * the SCSI subsystem gets to us, courtesy of the "SCSI settling delay". */ mly_periodic((void *)sc); + MLY_UNLOCK(sc); /* * Create the control device. @@ -317,7 +328,7 @@ mly_attach(device_t dev) MLY_UNMASK_INTERRUPTS(sc); #ifdef MLY_DEBUG - timeout((timeout_t *)mly_timeout, sc, MLY_CMD_TIMEOUT * hz); + callout_reset(&sc->mly_timeout, MLY_CMD_TIMEOUT * hz, mly_timeout, sc); #endif out: @@ -353,8 +364,6 @@ mly_pci_attach(struct mly_softc *sc) mly_printf(sc, "can't allocate register window\n"); goto fail; } - sc->mly_btag = rman_get_bustag(sc->mly_regs_resource); - sc->mly_bhandle = rman_get_bushandle(sc->mly_regs_resource); /* * Allocate and connect our interrupt. @@ -365,7 +374,7 @@ mly_pci_attach(struct mly_softc *sc) mly_printf(sc, "can't allocate interrupt\n"); goto fail; } - if (bus_setup_intr(sc->mly_dev, sc->mly_irq, INTR_TYPE_CAM | INTR_ENTROPY, NULL, mly_intr, sc, &sc->mly_intr)) { + if (bus_setup_intr(sc->mly_dev, sc->mly_irq, INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE, NULL, mly_intr, sc, &sc->mly_intr)) { mly_printf(sc, "can't set up interrupt\n"); goto fail; } @@ -405,7 +414,7 @@ mly_pci_attach(struct mly_softc *sc) BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ busdma_lock_mutex, /* lockfunc */ - &Giant, /* lockarg */ + &sc->mly_lock, /* lockarg */ &sc->mly_buffer_dmat)) { mly_printf(sc, "can't allocate buffer DMA tag\n"); goto fail; @@ -511,18 +520,25 @@ mly_shutdown(device_t dev) struct mly_softc *sc = device_get_softc(dev); debug_called(1); - - if (sc->mly_state & MLY_STATE_OPEN) + + MLY_LOCK(sc); + if (sc->mly_state & MLY_STATE_OPEN) { + MLY_UNLOCK(sc); return(EBUSY); + } /* kill the periodic event */ - untimeout(mly_periodic, sc, sc->mly_periodic); + callout_stop(&sc->mly_periodic); +#ifdef MLY_DEBUG + callout_stop(&sc->mly_timeout); +#endif /* flush controller */ mly_printf(sc, "flushing cache..."); printf("%s\n", mly_flush(sc) ? "failed" : "done"); MLY_MASK_INTERRUPTS(sc); + MLY_UNLOCK(sc); return(0); } @@ -538,7 +554,9 @@ mly_intr(void *arg) debug_called(2); + MLY_LOCK(sc); mly_done(sc); + MLY_UNLOCK(sc); }; /******************************************************************************** @@ -676,6 +694,13 @@ mly_free(struct mly_softc *sc) /* Remove the management device */ destroy_dev(sc->mly_dev_t); + if (sc->mly_intr) + bus_teardown_intr(sc->mly_dev, sc->mly_irq, sc->mly_intr); + callout_drain(&sc->mly_periodic); +#ifdef MLY_DEBUG + callout_drain(&sc->mly_timeout); +#endif + /* detach from CAM */ mly_cam_detach(sc); @@ -711,8 +736,6 @@ mly_free(struct mly_softc *sc) bus_dma_tag_destroy(sc->mly_mmbox_dmat); /* disconnect the interrupt handler */ - if (sc->mly_intr) - bus_teardown_intr(sc->mly_dev, sc->mly_irq, sc->mly_intr); if (sc->mly_irq != NULL) bus_release_resource(sc->mly_dev, SYS_RES_IRQ, sc->mly_irq_rid, sc->mly_irq); @@ -723,6 +746,8 @@ mly_free(struct mly_softc *sc) /* release the register window mapping */ if (sc->mly_regs_resource != NULL) bus_release_resource(sc->mly_dev, SYS_RES_MEMORY, sc->mly_regs_rid, sc->mly_regs_resource); + + mtx_destroy(&sc->mly_lock); } /******************************************************************************** @@ -1086,6 +1111,7 @@ mly_ioctl(struct mly_softc *sc, struct m int error; debug_called(1); + MLY_ASSERT_LOCKED(sc); mc = NULL; if (mly_alloc_command(sc, &mc)) { @@ -1375,6 +1401,7 @@ mly_periodic(void *data) int bus, target; debug_called(2); + MLY_ASSERT_LOCKED(sc); /* * Scan devices. @@ -1398,7 +1425,7 @@ mly_periodic(void *data) mly_check_event(sc); /* reschedule ourselves */ - sc->mly_periodic = timeout(mly_periodic, sc, MLY_PERIODIC_INTERVAL * hz); + callout_schedule(&sc->mly_periodic, MLY_PERIODIC_INTERVAL * hz); } /******************************************************************************** @@ -1415,21 +1442,19 @@ static int mly_immediate_command(struct mly_command *mc) { struct mly_softc *sc = mc->mc_sc; - int error, s; + int error; debug_called(1); - /* spinning at splcam is ugly, but we're only used during controller init */ - s = splcam(); + MLY_ASSERT_LOCKED(sc); if ((error = mly_start(mc))) { - splx(s); return(error); } if (sc->mly_state & MLY_STATE_INTERRUPTS_ON) { /* sleep on the command */ while(!(mc->mc_flags & MLY_CMD_COMPLETE)) { - tsleep(mc, PRIBIO, "mlywait", 0); + mtx_sleep(mc, &sc->mly_lock, PRIBIO, "mlywait", 0); } } else { /* spin and collect status while we do */ @@ -1437,7 +1462,6 @@ mly_immediate_command(struct mly_command mly_done(mc->mc_sc); } } - splx(s); return(0); } @@ -1453,9 +1477,9 @@ mly_start(struct mly_command *mc) { struct mly_softc *sc = mc->mc_sc; union mly_command_packet *pkt; - int s; debug_called(2); + MLY_ASSERT_LOCKED(sc); /* * Set the command up for delivery to the controller. @@ -1467,8 +1491,6 @@ mly_start(struct mly_command *mc) mc->mc_timestamp = time_second; #endif - s = splcam(); - /* * Do we have to use the hardware mailbox? */ @@ -1477,7 +1499,6 @@ mly_start(struct mly_command *mc) * Check to see if the controller is ready for us. */ if (MLY_IDBR_TRUE(sc, MLY_HM_CMDSENT)) { - splx(s); return(EBUSY); } mc->mc_flags |= MLY_CMD_BUSY; @@ -1494,7 +1515,6 @@ mly_start(struct mly_command *mc) /* check to see if the next index is free yet */ if (pkt->mmbox.flag != 0) { - splx(s); return(EBUSY); } mc->mc_flags |= MLY_CMD_BUSY; @@ -1502,13 +1522,11 @@ mly_start(struct mly_command *mc) /* copy in new command */ bcopy(mc->mc_packet->mmbox.data, pkt->mmbox.data, sizeof(pkt->mmbox.data)); /* barrier to ensure completion of previous write before we write the flag */ - bus_space_barrier(sc->mly_btag, sc->mly_bhandle, 0, 0, - BUS_SPACE_BARRIER_WRITE); + bus_barrier(sc->mly_regs_resource, 0, 0, BUS_SPACE_BARRIER_WRITE); /* copy flag last */ pkt->mmbox.flag = mc->mc_packet->mmbox.flag; /* barrier to ensure completion of previous write before we notify the controller */ - bus_space_barrier(sc->mly_btag, sc->mly_bhandle, 0, 0, - BUS_SPACE_BARRIER_WRITE); + bus_barrier(sc->mly_regs_resource, 0, 0, BUS_SPACE_BARRIER_WRITE); /* signal controller, update index */ MLY_SET_REG(sc, sc->mly_idbr, MLY_AM_CMDSENT); @@ -1516,7 +1534,6 @@ mly_start(struct mly_command *mc) } mly_enqueue_busy(mc); - splx(s); return(0); } @@ -1529,9 +1546,9 @@ mly_done(struct mly_softc *sc) struct mly_command *mc; union mly_status_packet *sp; u_int16_t slot; - int s, worked; + int worked; - s = splcam(); + MLY_ASSERT_LOCKED(sc); worked = 0; /* pick up hardware-mailbox commands */ @@ -1589,12 +1606,11 @@ mly_done(struct mly_softc *sc) MLY_SET_REG(sc, sc->mly_odbr, MLY_AM_STSREADY); } - splx(s); if (worked) { if (sc->mly_state & MLY_STATE_INTERRUPTS_ON) - taskqueue_enqueue(taskqueue_swi_giant, &sc->mly_task_complete); + taskqueue_enqueue(taskqueue_thread, &sc->mly_task_complete); else - mly_complete(sc, 0); + mly_complete(sc); } } @@ -1602,13 +1618,21 @@ mly_done(struct mly_softc *sc) * Process completed commands */ static void -mly_complete(void *context, int pending) +mly_complete_handler(void *context, int pending) { struct mly_softc *sc = (struct mly_softc *)context; + + MLY_LOCK(sc); + mly_complete(sc); + MLY_UNLOCK(sc); +} + +static void +mly_complete(struct mly_softc *sc) +{ struct mly_command *mc; void (* mc_complete)(struct mly_command *mc); - debug_called(2); /* @@ -1935,15 +1959,18 @@ mly_cam_attach(struct mly_softc *sc) if ((sc->mly_cam_sim[chn] = cam_sim_alloc(mly_cam_action, mly_cam_poll, "mly", sc, device_get_unit(sc->mly_dev), - &Giant, + &sc->mly_lock, sc->mly_controllerinfo->maximum_parallel_commands, 1, devq)) == NULL) { return(ENOMEM); } + MLY_LOCK(sc); if (xpt_bus_register(sc->mly_cam_sim[chn], sc->mly_dev, chn)) { + MLY_UNLOCK(sc); mly_printf(sc, "CAM XPT phsyical channel registration failed\n"); return(ENXIO); } + MLY_UNLOCK(sc); debug(1, "registered physical channel %d", chn); } } @@ -1955,15 +1982,18 @@ mly_cam_attach(struct mly_softc *sc) for (i = 0; i < sc->mly_controllerinfo->virtual_channels_present; i++, chn++) { if ((sc->mly_cam_sim[chn] = cam_sim_alloc(mly_cam_action, mly_cam_poll, "mly", sc, device_get_unit(sc->mly_dev), - &Giant, + &sc->mly_lock, sc->mly_controllerinfo->maximum_parallel_commands, 0, devq)) == NULL) { return(ENOMEM); } + MLY_LOCK(sc); if (xpt_bus_register(sc->mly_cam_sim[chn], sc->mly_dev, chn)) { + MLY_UNLOCK(sc); mly_printf(sc, "CAM XPT virtual channel registration failed\n"); return(ENXIO); } + MLY_UNLOCK(sc); debug(1, "registered virtual channel %d", chn); } @@ -1987,12 +2017,14 @@ mly_cam_detach(struct mly_softc *sc) debug_called(1); + MLY_LOCK(sc); for (i = 0; i < sc->mly_cam_channels; i++) { if (sc->mly_cam_sim[i] != NULL) { xpt_bus_deregister(cam_sim_path(sc->mly_cam_sim[i])); cam_sim_free(sc->mly_cam_sim[i], 0); } } + MLY_UNLOCK(sc); if (sc->mly_cam_devq != NULL) cam_simq_free(sc->mly_cam_devq); } @@ -2030,6 +2062,7 @@ mly_cam_action(struct cam_sim *sim, unio struct mly_softc *sc = cam_sim_softc(sim); debug_called(2); + MLY_ASSERT_LOCKED(sc); switch (ccb->ccb_h.func_code) { @@ -2173,7 +2206,6 @@ mly_cam_action_io(struct cam_sim *sim, s struct mly_command_scsi_small *ss; int bus, target; int error; - int s; bus = cam_sim_bus(sim); target = csio->ccb_h.target_id; @@ -2220,11 +2252,9 @@ mly_cam_action_io(struct cam_sim *sim, s * Get a command, or push the ccb back to CAM and freeze the queue. */ if ((error = mly_alloc_command(sc, &mc))) { - s = splcam(); xpt_freeze_simq(sim, 1); csio->ccb_h.status |= CAM_REQUEUE_REQ; sc->mly_qfrzn_cnt++; - splx(s); return(error); } @@ -2270,11 +2300,9 @@ mly_cam_action_io(struct cam_sim *sim, s /* give the command to the controller */ if ((error = mly_start(mc))) { - s = splcam(); xpt_freeze_simq(sim, 1); csio->ccb_h.status |= CAM_REQUEUE_REQ; sc->mly_qfrzn_cnt++; - splx(s); return(error); } @@ -2306,7 +2334,6 @@ mly_cam_complete(struct mly_command *mc) struct mly_btl *btl; u_int8_t cmd; int bus, target; - int s; debug_called(2); @@ -2359,12 +2386,10 @@ mly_cam_complete(struct mly_command *mc) break; } - s = splcam(); if (sc->mly_qfrzn_cnt) { csio->ccb_h.status |= CAM_RELEASE_SIMQ; sc->mly_qfrzn_cnt--; } - splx(s); xpt_done((union ccb *)csio); mly_release_command(mc); @@ -2805,7 +2830,9 @@ mly_user_open(struct cdev *dev, int flag { struct mly_softc *sc = dev->si_drv1; + MLY_LOCK(sc); sc->mly_state |= MLY_STATE_OPEN; + MLY_UNLOCK(sc); return(0); } @@ -2817,7 +2844,9 @@ mly_user_close(struct cdev *dev, int fla { struct mly_softc *sc = dev->si_drv1; + MLY_LOCK(sc); sc->mly_state &= ~MLY_STATE_OPEN; + MLY_UNLOCK(sc); return (0); } @@ -2855,13 +2884,16 @@ static int mly_user_command(struct mly_softc *sc, struct mly_user_command *uc) { struct mly_command *mc; - int error, s; + int error; /* allocate a command */ + MLY_LOCK(sc); if (mly_alloc_command(sc, &mc)) { + MLY_UNLOCK(sc); error = ENOMEM; goto out; /* XXX Linux version will wait for a command */ } + MLY_UNLOCK(sc); /* handle data size/direction */ mc->mc_length = (uc->DataTransferLength >= 0) ? uc->DataTransferLength : -uc->DataTransferLength; @@ -2888,12 +2920,14 @@ mly_user_command(struct mly_softc *sc, s mc->mc_complete = NULL; /* execute the command */ - if ((error = mly_start(mc)) != 0) + MLY_LOCK(sc); + if ((error = mly_start(mc)) != 0) { + MLY_UNLOCK(sc); goto out; - s = splcam(); + } while (!(mc->mc_flags & MLY_CMD_COMPLETE)) - tsleep(mc, PRIBIO, "mlyioctl", 0); - splx(s); + mtx_sleep(mc, &sc->mly_lock, PRIBIO, "mlyioctl", 0); + MLY_UNLOCK(sc); /* return the data to userspace */ if (uc->DataTransferLength > 0) @@ -2916,8 +2950,11 @@ mly_user_command(struct mly_softc *sc, s out: if (mc->mc_data != NULL) free(mc->mc_data, M_DEVBUF); - if (mc != NULL) + if (mc != NULL) { + MLY_LOCK(sc); mly_release_command(mc); + MLY_UNLOCK(sc); + } return(error); } @@ -2931,32 +2968,36 @@ static int mly_user_health(struct mly_softc *sc, struct mly_user_health *uh) { struct mly_health_status mh; - int error, s; + int error; /* fetch the current health status from userspace */ if ((error = copyin(uh->HealthStatusBuffer, &mh, sizeof(mh))) != 0) return(error); /* spin waiting for a status update */ - s = splcam(); + MLY_LOCK(sc); error = EWOULDBLOCK; while ((error != 0) && (sc->mly_event_change == mh.change_counter)) - error = tsleep(&sc->mly_event_change, PRIBIO | PCATCH, "mlyhealth", 0); - splx(s); + error = mtx_sleep(&sc->mly_event_change, &sc->mly_lock, PRIBIO | PCATCH, + "mlyhealth", 0); + mh = sc->mly_mmbox->mmm_health.status; + MLY_UNLOCK(sc); - /* copy the controller's health status buffer out (there is a race here if it changes again) */ - error = copyout(&sc->mly_mmbox->mmm_health.status, uh->HealthStatusBuffer, - sizeof(uh->HealthStatusBuffer)); + /* copy the controller's health status buffer out */ + error = copyout(&mh, uh->HealthStatusBuffer, sizeof(mh)); return(error); } #ifdef MLY_DEBUG -static int -mly_timeout(struct mly_softc *sc) +static void +mly_timeout(void *arg) { + struct mly_softc *sc; struct mly_command *mc; int deadline; + sc = arg; + MLY_ASSERT_LOCKED(sc); deadline = time_second - MLY_CMD_TIMEOUT; TAILQ_FOREACH(mc, &sc->mly_busy, mc_link) { if ((mc->mc_timestamp < deadline)) { @@ -2966,8 +3007,6 @@ mly_timeout(struct mly_softc *sc) } } - timeout((timeout_t *)mly_timeout, sc, MLY_CMD_TIMEOUT * hz); - - return (0); + callout_reset(&sc->mly_timeout, MLY_CMD_TIMEOUT * hz, mly_timeout, sc); } #endif Modified: head/sys/dev/mly/mlyvar.h ============================================================================== --- head/sys/dev/mly/mlyvar.h Tue Nov 18 21:51:01 2014 (r274676) +++ head/sys/dev/mly/mlyvar.h Tue Nov 18 21:55:50 2014 (r274677) @@ -59,10 +59,6 @@ # include -#ifndef INTR_ENTROPY -# define INTR_ENTROPY 0 -#endif - /******************************************************************************** ******************************************************************************** Driver Variable Definitions @@ -161,8 +157,6 @@ struct mly_softc { struct cdev *mly_dev_t; struct resource *mly_regs_resource; /* register interface window */ int mly_regs_rid; /* resource ID */ - bus_space_handle_t mly_bhandle; /* bus space handle */ - bus_space_tag_t mly_btag; /* bus space tag */ bus_dma_tag_t mly_parent_dmat; /* parent DMA tag */ bus_dma_tag_t mly_buffer_dmat; /* data buffer/command DMA tag */ struct resource *mly_irq; /* interrupt */ @@ -195,6 +189,7 @@ struct mly_softc { u_int32_t mly_mmbox_status_index; /* index we next expect status at */ /* controller features, limits and status */ + struct mtx mly_lock; int mly_state; #define MLY_STATE_OPEN (1<<1) #define MLY_STATE_INTERRUPTS_ON (1<<2) @@ -219,7 +214,7 @@ struct mly_softc { u_int32_t mly_event_change; /* event status change indicator */ u_int32_t mly_event_counter; /* next event for which we anticpiate status */ u_int32_t mly_event_waiting; /* next event the controller will post status for */ - struct callout_handle mly_periodic; /* periodic event handling */ + struct callout mly_periodic; /* periodic event handling */ /* CAM connection */ struct cam_devq *mly_cam_devq; /* CAM device queue */ @@ -230,29 +225,37 @@ struct mly_softc { /* command-completion task */ struct task mly_task_complete; /* deferred-completion task */ int mly_qfrzn_cnt; /* Track simq freezes */ + +#ifdef MLY_DEBUG + struct callout mly_timeout; +#endif }; +#define MLY_LOCK(sc) mtx_lock(&(sc)->mly_lock) +#define MLY_UNLOCK(sc) mtx_unlock(&(sc)->mly_lock) +#define MLY_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mly_lock, MA_OWNED) + /* * Register access helpers. */ -#define MLY_SET_REG(sc, reg, val) bus_space_write_1(sc->mly_btag, sc->mly_bhandle, reg, val) -#define MLY_GET_REG(sc, reg) bus_space_read_1 (sc->mly_btag, sc->mly_bhandle, reg) -#define MLY_GET_REG2(sc, reg) bus_space_read_2 (sc->mly_btag, sc->mly_bhandle, reg) -#define MLY_GET_REG4(sc, reg) bus_space_read_4 (sc->mly_btag, sc->mly_bhandle, reg) +#define MLY_SET_REG(sc, reg, val) bus_write_1(sc->mly_regs_resource, reg, val) +#define MLY_GET_REG(sc, reg) bus_read_1 (sc->mly_regs_resource, reg) +#define MLY_GET_REG2(sc, reg) bus_read_2 (sc->mly_regs_resource, reg) +#define MLY_GET_REG4(sc, reg) bus_read_4 (sc->mly_regs_resource, reg) #define MLY_SET_MBOX(sc, mbox, ptr) \ do { \ - bus_space_write_4(sc->mly_btag, sc->mly_bhandle, mbox, *((u_int32_t *)ptr)); \ - bus_space_write_4(sc->mly_btag, sc->mly_bhandle, mbox + 4, *((u_int32_t *)ptr + 1)); \ - bus_space_write_4(sc->mly_btag, sc->mly_bhandle, mbox + 8, *((u_int32_t *)ptr + 2)); \ - bus_space_write_4(sc->mly_btag, sc->mly_bhandle, mbox + 12, *((u_int32_t *)ptr + 3)); \ + bus_write_4(sc->mly_regs_resource, mbox, *((u_int32_t *)ptr)); \ + bus_write_4(sc->mly_regs_resource, mbox + 4, *((u_int32_t *)ptr + 1)); \ + bus_write_4(sc->mly_regs_resource, mbox + 8, *((u_int32_t *)ptr + 2)); \ + bus_write_4(sc->mly_regs_resource, mbox + 12, *((u_int32_t *)ptr + 3)); \ } while(0); #define MLY_GET_MBOX(sc, mbox, ptr) \ do { \ - *((u_int32_t *)ptr) = bus_space_read_4(sc->mly_btag, sc->mly_bhandle, mbox); \ - *((u_int32_t *)ptr + 1) = bus_space_read_4(sc->mly_btag, sc->mly_bhandle, mbox + 4); \ - *((u_int32_t *)ptr + 2) = bus_space_read_4(sc->mly_btag, sc->mly_bhandle, mbox + 8); \ - *((u_int32_t *)ptr + 3) = bus_space_read_4(sc->mly_btag, sc->mly_bhandle, mbox + 12); \ + *((u_int32_t *)ptr) = bus_read_4(sc->mly_regs_resource, mbox); \ + *((u_int32_t *)ptr + 1) = bus_read_4(sc->mly_regs_resource, mbox + 4); \ + *((u_int32_t *)ptr + 2) = bus_read_4(sc->mly_regs_resource, mbox + 8); \ + *((u_int32_t *)ptr + 3) = bus_read_4(sc->mly_regs_resource, mbox + 12); \ } while(0); #define MLY_IDBR_TRUE(sc, mask) \ @@ -315,46 +318,34 @@ mly_initq_ ## name (struct mly_softc *sc static __inline void \ mly_enqueue_ ## name (struct mly_command *mc) \ { \ - int s; \ \ - s = splcam(); \ TAILQ_INSERT_TAIL(&mc->mc_sc->mly_ ## name, mc, mc_link); \ MLYQ_ADD(mc->mc_sc, index); \ - splx(s); \ } \ static __inline void \ mly_requeue_ ## name (struct mly_command *mc) \ { \ - int s; \ \ - s = splcam(); \ TAILQ_INSERT_HEAD(&mc->mc_sc->mly_ ## name, mc, mc_link); \ MLYQ_ADD(mc->mc_sc, index); \ - splx(s); \ } \ static __inline struct mly_command * \ mly_dequeue_ ## name (struct mly_softc *sc) \ { \ struct mly_command *mc; \ - int s; \ \ - s = splcam(); \ if ((mc = TAILQ_FIRST(&sc->mly_ ## name)) != NULL) { \ TAILQ_REMOVE(&sc->mly_ ## name, mc, mc_link); \ MLYQ_REMOVE(sc, index); \ } \ - splx(s); \ return(mc); \ } \ static __inline void \ mly_remove_ ## name (struct mly_command *mc) \ { \ - int s; \ \ - s = splcam(); \ TAILQ_REMOVE(&mc->mc_sc->mly_ ## name, mc, mc_link); \ MLYQ_REMOVE(mc->mc_sc, index); \ - splx(s); \ } \ struct hack From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 21:58:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B24A7FB3; Tue, 18 Nov 2014 21:58:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F07C9E4; Tue, 18 Nov 2014 21:58:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAILww5G087566; Tue, 18 Nov 2014 21:58:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAILwwEc087564; Tue, 18 Nov 2014 21:58:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411182158.sAILwwEc087564@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 18 Nov 2014 21:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274678 - head/sys/dev/pst X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 21:58:58 -0000 Author: jhb Date: Tue Nov 18 21:58:57 2014 New Revision: 274678 URL: https://svnweb.freebsd.org/changeset/base/274678 Log: Cleanups to pst(4): - Use callout(9) instead of timeout(9). - Don't bother zero'ing the softc. - Destroy mutex on detach. Tested by: no one Modified: head/sys/dev/pst/pst-pci.c head/sys/dev/pst/pst-raid.c Modified: head/sys/dev/pst/pst-pci.c ============================================================================== --- head/sys/dev/pst/pst-pci.c Tue Nov 18 21:55:50 2014 (r274677) +++ head/sys/dev/pst/pst-pci.c Tue Nov 18 21:58:57 2014 (r274678) @@ -73,15 +73,13 @@ iop_pci_attach(device_t dev) struct iop_softc *sc = device_get_softc(dev); int rid; - bzero(sc, sizeof(struct iop_softc)); - /* get resources */ - rid = 0x10; + rid = PCIR_BAR(0); sc->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (!sc->r_mem) - return 0; + return ENXIO; rid = 0x00; sc->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -104,11 +102,16 @@ static int iop_pci_detach(device_t dev) { struct iop_softc *sc = device_get_softc(dev); + int error; + error = bus_generic_detach(dev); + if (error) + return (error); bus_teardown_intr(dev, sc->r_irq, sc->handle); bus_release_resource(dev, SYS_RES_IRQ, 0x00, sc->r_irq); - bus_release_resource(dev, SYS_RES_MEMORY, 0x10, sc->r_mem); - return bus_generic_detach(dev); + bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->r_mem); + mtx_destroy(&sc->mtx); + return (0); } Modified: head/sys/dev/pst/pst-raid.c ============================================================================== --- head/sys/dev/pst/pst-raid.c Tue Nov 18 21:55:50 2014 (r274677) +++ head/sys/dev/pst/pst-raid.c Tue Nov 18 21:58:57 2014 (r274678) @@ -63,7 +63,7 @@ struct pst_softc { struct pst_request { struct pst_softc *psc; /* pointer to softc */ u_int32_t mfa; /* frame addreess */ - struct callout_handle timeout_handle; /* handle for untimeout */ + struct callout timeout; /* timeout timer */ struct bio *bp; /* associated bio ptr */ }; @@ -75,7 +75,7 @@ static int pst_shutdown(device_t); static void pst_start(struct pst_softc *); static void pst_done(struct iop_softc *, u_int32_t, struct i2o_single_reply *); static int pst_rw(struct pst_request *); -static void pst_timeout(struct pst_request *); +static void pst_timeout(void *); static void bpack(int8_t *, int8_t *, int); /* local vars */ @@ -97,7 +97,7 @@ pst_add_raid(struct iop_softc *sc, struc psc->iop = sc; psc->lct = lct; device_set_softc(child, psc); - return bus_generic_attach(sc->dev); + return device_probe_and_attach(child); } static int @@ -224,6 +224,7 @@ pst_start(struct pst_softc *psc) iop_free_mfa(psc->iop, mfa); return; } + callout_init_mtx(&request->timeout, &psc->iop->mtx, 0); psc->iop->outstanding++; request->psc = psc; request->mfa = mfa; @@ -245,7 +246,7 @@ pst_done(struct iop_softc *sc, u_int32_t (struct pst_request *)reply->transaction_context; struct pst_softc *psc = request->psc; - untimeout((timeout_t *)pst_timeout, request, request->timeout_handle); + callout_stop(&request->timeout); request->bp->bio_resid = request->bp->bio_bcount - reply->donecount; biofinish(request->bp, NULL, reply->status ? EIO : 0); free(request, M_PSTRAID); @@ -297,26 +298,25 @@ pst_rw(struct pst_request *request) request->psc->iop->reg->iqueue = request->mfa; - if (dumping) - request->timeout_handle.callout = NULL; - else - request->timeout_handle = - timeout((timeout_t*)pst_timeout, request, 10 * hz); + if (!dumping) + callout_reset(&request->timeout, 10 * hz, pst_timeout, request); return 0; } static void -pst_timeout(struct pst_request *request) +pst_timeout(void *arg) { + struct pst_request *request; + + request = arg; printf("pst: timeout mfa=0x%08x cmd=0x%02x\n", request->mfa, request->bp->bio_cmd); - mtx_lock(&request->psc->iop->mtx); + mtx_assert(&request->psc->iop->mtx, MA_OWNED); iop_free_mfa(request->psc->iop, request->mfa); if ((request->mfa = iop_get_mfa(request->psc->iop)) == 0xffffffff) { printf("pst: timeout no mfa possible\n"); biofinish(request->bp, NULL, EIO); request->psc->iop->outstanding--; - mtx_unlock(&request->psc->iop->mtx); return; } if (pst_rw(request)) { @@ -324,7 +324,6 @@ pst_timeout(struct pst_request *request) biofinish(request->bp, NULL, EIO); request->psc->iop->outstanding--; } - mtx_unlock(&request->psc->iop->mtx); } static void From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 22:00:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79E9E193; Tue, 18 Nov 2014 22:00:34 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34402A83; Tue, 18 Nov 2014 22:00:34 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1Xqqp4-0008KB-Pv; Wed, 19 Nov 2014 02:00:30 +0400 Date: Wed, 19 Nov 2014 02:00:30 +0400 From: Slawa Olhovchenkov To: Xin LI Subject: Re: svn commit: r274673 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20141118220030.GA31347@zxy.spb.ru> References: <201411181840.sAIIe2C7094558@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411181840.sAIIe2C7094558@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 22:00:34 -0000 On Tue, Nov 18, 2014 at 06:40:02PM +0000, Xin LI wrote: > Author: delphij > Date: Tue Nov 18 18:40:01 2014 > New Revision: 274673 > URL: https://svnweb.freebsd.org/changeset/base/274673 > > Log: > Allow tuning zfs_max_recordsize via loader tunable. Tuning is NOT > recommended. This is not tuning, this is simple guard. And can be safe changed (incrased, at the least) in any time. For some workload optimal is maximum, i.e. 16MB. May be better comment: increasing this value required strong understaning after-effects of increasing memory consumption and bulk data transfers. (sorry for english) > Requested by: Slawa Olhovchenkov > MFC after: 2 weeks Thanks, can you allow RW? > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Nov 18 18:03:40 2014 (r274672) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Nov 18 18:40:01 2014 (r274673) > @@ -51,6 +51,8 @@ > #include > #include > > +SYSCTL_DECL(_vfs_zfs); > + > /* > * The SPA supports block sizes up to 16MB. However, very large blocks > * can have an impact on i/o latency (e.g. tying up a spinning disk for > @@ -61,6 +63,9 @@ > * of this setting. > */ > int zfs_max_recordsize = 1 * 1024 * 1024; > +SYSCTL_INT(_vfs_zfs, OID_AUTO, max_recordsize, CTLFLAG_RDTUN, > + &zfs_max_recordsize, 0, > + "Maximum block size. Expect dragons when tuning this."); > > #define SWITCH64(x, y) \ > { \ > _______________________________________________ > 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" From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 22:02:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E9B72F3; Tue, 18 Nov 2014 22:02:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A667A9E; Tue, 18 Nov 2014 22:02:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIM2dFl091597; Tue, 18 Nov 2014 22:02:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIM2cs4091594; Tue, 18 Nov 2014 22:02:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411182202.sAIM2cs4091594@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 18 Nov 2014 22:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274679 - head/sys/dev/scd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 22:02:39 -0000 Author: jhb Date: Tue Nov 18 22:02:37 2014 New Revision: 274679 URL: https://svnweb.freebsd.org/changeset/base/274679 Log: Add locking to scd(4) and mark MPSAFE. - Actually use existing per-softc mutex. - Use mutex in cdev routines and remove D_NEEDGIANT. - Use callout(9) instead of timeout(9). - Don't check for impossible conditions (e.g. SCDINIT being clear). - Use bus_*() instead of bus_space_*(). Tested by: no one Modified: head/sys/dev/scd/scd.c head/sys/dev/scd/scd_isa.c head/sys/dev/scd/scdvar.h Modified: head/sys/dev/scd/scd.c ============================================================================== --- head/sys/dev/scd/scd.c Tue Nov 18 21:58:57 2014 (r274678) +++ head/sys/dev/scd/scd.c Tue Nov 18 22:02:37 2014 (r274679) @@ -120,7 +120,7 @@ static int get_result(struct scd_softc * static void print_error(struct scd_softc *, int errcode); static void scd_start(struct scd_softc *); -static timeout_t scd_timeout; +static void scd_timeout(void *); static void scd_doread(struct scd_softc *, int state, struct scd_mbx *mbxin); static int scd_eject(struct scd_softc *); @@ -153,7 +153,7 @@ static struct cdevsw scd_cdevsw = { .d_ioctl = scdioctl, .d_strategy = scdstrategy, .d_name = "scd", - .d_flags = D_DISK | D_NEEDGIANT, + .d_flags = D_DISK, }; int @@ -163,11 +163,13 @@ scd_attach(struct scd_softc *sc) unit = device_get_unit(sc->dev); + SCD_LOCK(sc); init_drive(sc); sc->data.flags = SCDINIT; sc->data.audio_status = CD_AS_AUDIO_INVALID; bioq_init(&sc->data.head); + SCD_UNLOCK(sc); sc->scd_dev_t = make_dev(&scd_cdevsw, 8 * unit, UID_ROOT, GID_OPERATOR, 0640, "scd%d", unit); @@ -184,18 +186,18 @@ scdopen(struct cdev *dev, int flags, int sc = (struct scd_softc *)dev->si_drv1; - /* not initialized*/ - if (!(sc->data.flags & SCDINIT)) - return (ENXIO); - - /* invalidated in the meantime? mark all open part's invalid */ - if (sc->data.openflag) + /* mark all open part's invalid */ + SCD_LOCK(sc); + if (sc->data.openflag) { + SCD_UNLOCK(sc); return (ENXIO); + } XDEBUG(sc, 1, "DEBUG: status = 0x%x\n", SCD_READ(sc, IREG_STATUS)); if ((rc = spin_up(sc)) != 0) { print_error(sc, rc); + SCD_UNLOCK(sc); return (EIO); } if (!(sc->data.flags & SCDTOC)) { @@ -205,18 +207,21 @@ scdopen(struct cdev *dev, int flags, int if (rc == ERR_NOT_SPINNING) { rc = spin_up(sc); if (rc) { - print_error(sc, rc);\ + print_error(sc, rc); + SCD_UNLOCK(sc); return (EIO); } continue; } device_printf(sc->dev, "TOC read error 0x%x\n", rc); + SCD_UNLOCK(sc); return (EIO); } } sc->data.openflag = 1; sc->data.flags |= SCDVALID; + SCD_UNLOCK(sc); return (0); } @@ -228,17 +233,17 @@ scdclose(struct cdev *dev, int flags, in sc = (struct scd_softc *)dev->si_drv1; - if (!(sc->data.flags & SCDINIT) || !sc->data.openflag) - return (ENXIO); + SCD_LOCK(sc); + KASSERT(sc->data.openflag, ("device not open")); if (sc->data.audio_status != CD_AS_PLAY_IN_PROGRESS) { (void)send_cmd(sc, CMD_SPIN_DOWN, 0); sc->data.flags &= ~SCDSPINNING; } - /* close channel */ sc->data.openflag = 0; + SCD_UNLOCK(sc); return (0); } @@ -246,12 +251,12 @@ scdclose(struct cdev *dev, int flags, in static void scdstrategy(struct bio *bp) { - int s; struct scd_softc *sc; sc = (struct scd_softc *)bp->bio_dev->si_drv1; /* if device invalidated (e.g. media change, door open), error */ + SCD_LOCK(sc); if (!(sc->data.flags & SCDVALID)) { device_printf(sc->dev, "media changed\n"); bp->bio_error = EIO; @@ -276,17 +281,17 @@ scdstrategy(struct bio *bp) bp->bio_resid = 0; /* queue it */ - s = splbio(); bioq_disksort(&sc->data.head, bp); - splx(s); /* now check whether we can perform processing */ scd_start(sc); + SCD_UNLOCK(sc); return; bad: bp->bio_flags |= BIO_ERROR; done: + SCD_UNLOCK(sc); bp->bio_resid = bp->bio_bcount; biodone(bp); return; @@ -296,27 +301,22 @@ static void scd_start(struct scd_softc *sc) { struct bio *bp; - int s = splbio(); - if (sc->data.flags & SCDMBXBSY) { - splx(s); + SCD_ASSERT_LOCKED(sc); + if (sc->data.flags & SCDMBXBSY) return; - } bp = bioq_takefirst(&sc->data.head); if (bp != 0) { /* block found to process, dequeue */ sc->data.flags |= SCDMBXBSY; - splx(s); } else { /* nothing to do */ - splx(s); return; } sc->data.mbx.retry = 3; sc->data.mbx.bp = bp; - splx(s); scd_doread(sc, SCD_S_BEGIN, &(sc->data.mbx)); return; @@ -326,39 +326,47 @@ static int scdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { struct scd_softc *sc; + int error; sc = (struct scd_softc *)dev->si_drv1; XDEBUG(sc, 1, "ioctl: cmd=0x%lx\n", cmd); - if (!(sc->data.flags & SCDVALID)) + SCD_LOCK(sc); + if (!(sc->data.flags & SCDVALID)) { + SCD_UNLOCK(sc); return (EIO); + } + error = 0; switch (cmd) { case DIOCGMEDIASIZE: *(off_t *)addr = (off_t)sc->data.disksize * sc->data.blksize; - return (0); break; case DIOCGSECTORSIZE: *(u_int *)addr = sc->data.blksize; - return (0); break; case CDIOCPLAYTRACKS: - return scd_playtracks(sc, (struct ioc_play_track *) addr); + error = scd_playtracks(sc, (struct ioc_play_track *) addr); + break; case CDIOCPLAYBLOCKS: - return (EINVAL); + error = EINVAL; + break; case CDIOCPLAYMSF: - return scd_playmsf(sc, (struct ioc_play_msf *) addr); + error = scd_playmsf(sc, (struct ioc_play_msf *) addr); + break; case CDIOCREADSUBCHANNEL_SYSSPACE: return scd_subchan(sc, (struct ioc_read_subchannel *) addr, 1); case CDIOCREADSUBCHANNEL: return scd_subchan(sc, (struct ioc_read_subchannel *) addr, 0); case CDIOREADTOCHEADER: - return scd_toc_header (sc, (struct ioc_toc_header *) addr); + error = scd_toc_header (sc, (struct ioc_toc_header *) addr); + break; case CDIOREADTOCENTRYS: return scd_toc_entrys (sc, (struct ioc_read_toc_entry*) addr); case CDIOREADTOCENTRY: - return scd_toc_entry (sc, (struct ioc_read_toc_single_entry*) addr); + error = scd_toc_entry (sc, (struct ioc_read_toc_single_entry*) addr); + break; case CDIOCSETPATCH: case CDIOCGETVOL: case CDIOCSETVOL: @@ -367,34 +375,43 @@ scdioctl(struct cdev *dev, u_long cmd, c case CDIOCSETMUTE: case CDIOCSETLEFT: case CDIOCSETRIGHT: - return (EINVAL); + error = EINVAL; + break; case CDIOCRESUME: - return scd_resume(sc); + error = scd_resume(sc); + break; case CDIOCPAUSE: - return scd_pause(sc); + error = scd_pause(sc); + break; case CDIOCSTART: - return (EINVAL); + error = EINVAL; + break; case CDIOCSTOP: - return scd_stop(sc); + error = scd_stop(sc); + break; case CDIOCEJECT: - return scd_eject(sc); + error = scd_eject(sc); + break; case CDIOCALLOW: - return (0); + break; case CDIOCSETDEBUG: #ifdef SCD_DEBUG scd_debuglevel++; #endif - return (0); + break; case CDIOCCLRDEBUG: #ifdef SCD_DEBUG scd_debuglevel = 0; #endif - return (0); + break; default: device_printf(sc->dev, "unsupported ioctl (cmd=0x%lx)\n", cmd); - return (ENOTTY); + error = ENOTTY; + break; } + SCD_UNLOCK(sc); + return (error); } /*************************************************************** @@ -573,6 +590,7 @@ scd_subchan(struct scd_softc *sc, struct data.what.position.absaddr.msf.minute = bcd2bin(q.abs_msf[0]); data.what.position.absaddr.msf.second = bcd2bin(q.abs_msf[1]); data.what.position.absaddr.msf.frame = bcd2bin(q.abs_msf[2]); + SCD_UNLOCK(sc); if (nocopyout == 0) { if (copyout(&data, sch->data, min(sizeof(struct cd_sub_channel_info), sch->data_len))!=0) @@ -680,6 +698,7 @@ scd_timeout(void *arg) struct scd_softc *sc; sc = (struct scd_softc *)arg; + SCD_ASSERT_LOCKED(sc); scd_doread(sc, sc->ch_state, sc->ch_mbxsave); } @@ -693,6 +712,7 @@ scd_doread(struct scd_softc *sc, int sta caddr_t addr; static char sdata[3]; /* Must be preserved between calls to this function */ + SCD_ASSERT_LOCKED(sc); loop: switch (state) { case SCD_S_BEGIN: @@ -707,7 +727,7 @@ loop: case SCD_S_WAITSTAT: sc->ch_state = SCD_S_WAITSTAT; - untimeout(scd_timeout, (caddr_t)sc, sc->ch); + callout_stop(&sc->timer); if (mbx->count-- <= 0) { device_printf(sc->dev, "timeout. drive busy.\n"); goto harderr; @@ -716,7 +736,7 @@ loop: trystat: if (IS_BUSY(sc)) { sc->ch_state = SCD_S_WAITSTAT; - sc->ch = timeout(scd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, scd_timeout, sc); /* XXX */ return; } @@ -754,19 +774,19 @@ nextblock: mbx->count = 100; sc->ch_state = SCD_S_WAITFIFO; - sc->ch = timeout(scd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, scd_timeout, sc); /* XXX */ return; case SCD_S_WAITSPIN: sc->ch_state = SCD_S_WAITSPIN; - untimeout(scd_timeout,(caddr_t)sc, sc->ch); + callout_stop(&sc->timer); if (mbx->count-- <= 0) { device_printf(sc->dev, "timeout waiting for drive to spin up.\n"); goto harderr; } if (!STATUS_BIT(sc, SBIT_RESULT_READY)) { sc->ch_state = SCD_S_WAITSPIN; - sc->ch = timeout(scd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, scd_timeout, sc); /* XXX */ return; } SCD_WRITE(sc, OREG_CONTROL, CBIT_RESULT_READY_CLEAR); @@ -787,14 +807,14 @@ nextblock: case SCD_S_WAITFIFO: sc->ch_state = SCD_S_WAITFIFO; - untimeout(scd_timeout,(caddr_t)sc, sc->ch); + callout_stop(&sc->timer); if (mbx->count-- <= 0) { device_printf(sc->dev, "timeout. write param not ready.\n"); goto harderr; } if (!FSTATUS_BIT(sc, FBIT_WPARAM_READY)) { sc->ch_state = SCD_S_WAITFIFO; - sc->ch = timeout(scd_timeout, (caddr_t)sc,hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, scd_timeout, sc); /* XXX */ return; } XDEBUG(sc, 1, "mbx->count (writeparamwait) = %d(%d)\n", mbx->count, 100); @@ -807,12 +827,11 @@ writeparam: SCD_WRITE(sc, OREG_COMMAND, CMD_SPIN_UP); mbx->count = 300; sc->ch_state = SCD_S_WAITSPIN; - sc->ch = timeout(scd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, scd_timeout, sc); /* XXX */ return; } /* send the read command */ - critical_enter(); SCD_WRITE(sc, OREG_WPARAMS, sdata[0]); SCD_WRITE(sc, OREG_WPARAMS, sdata[1]); SCD_WRITE(sc, OREG_WPARAMS, sdata[2]); @@ -820,7 +839,6 @@ writeparam: SCD_WRITE(sc, OREG_WPARAMS, 0); SCD_WRITE(sc, OREG_WPARAMS, 1); SCD_WRITE(sc, OREG_COMMAND, CMD_READ); - critical_exit(); mbx->count = RDELAY_WAITREAD; for (i = 0; i < 50; i++) { @@ -830,12 +848,12 @@ writeparam: } sc->ch_state = SCD_S_WAITREAD; - sc->ch = timeout(scd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, scd_timeout, sc); /* XXX */ return; case SCD_S_WAITREAD: sc->ch_state = SCD_S_WAITREAD; - untimeout(scd_timeout,(caddr_t)sc, sc->ch); + callout_stop(&sc->timer); if (mbx->count-- <= 0) { if (STATUS_BIT(sc, SBIT_RESULT_READY)) goto got_param; @@ -847,7 +865,7 @@ writeparam: if (!(sc->data.flags & SCDVALID)) goto changed; sc->ch_state = SCD_S_WAITREAD; - sc->ch = timeout(scd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, scd_timeout, sc); /* XXX */ return; } XDEBUG(sc, 2, "mbx->count (after RDY_BIT) = %d(%d)\n", mbx->count, RDELAY_WAITREAD); @@ -868,7 +886,7 @@ got_data: case SCD_S_WAITPARAM: sc->ch_state = SCD_S_WAITPARAM; - untimeout(scd_timeout,(caddr_t)sc, sc->ch); + callout_stop(&sc->timer); if (mbx->count-- <= 0) { device_printf(sc->dev, "timeout waiting for params\n"); goto readerr; @@ -877,7 +895,7 @@ got_data: waitfor_param: if (!STATUS_BIT(sc, SBIT_RESULT_READY)) { sc->ch_state = SCD_S_WAITPARAM; - sc->ch = timeout(scd_timeout, (caddr_t)sc, hz/100); /* XXX */ + callout_reset(&sc->timer, hz / 100, scd_timeout, sc); /* XXX */ return; } #ifdef SCD_DEBUG @@ -1293,7 +1311,9 @@ waitfor_status_bits(struct scd_softc *sc { break; } + SCD_UNLOCK(sc); pause("waitfor", hz/10); + SCD_LOCK(sc); } } if ((c & bits_set) == bits_set && @@ -1363,6 +1383,7 @@ scd_toc_entrys (struct scd_softc *sc, st toc_entry.addr.msf.second = bcd2bin(sc->data.toc[i].start_msf[1]); toc_entry.addr.msf.frame = bcd2bin(sc->data.toc[i].start_msf[2]); } + SCD_UNLOCK(sc); /* copy the data back */ if (copyout(&toc_entry, te->data, sizeof(struct cd_toc_entry)) != 0) Modified: head/sys/dev/scd/scd_isa.c ============================================================================== --- head/sys/dev/scd/scd_isa.c Tue Nov 18 21:58:57 2014 (r274678) +++ head/sys/dev/scd/scd_isa.c Tue Nov 18 22:02:37 2014 (r274679) @@ -125,6 +125,7 @@ scd_alloc_resources (device_t dev) sc = device_get_softc(dev); error = 0; + mtx_init(&sc->mtx, "scd", NULL, MTX_DEF); if (sc->port_type) { sc->port = bus_alloc_resource_any(dev, sc->port_type, @@ -134,13 +135,8 @@ scd_alloc_resources (device_t dev) error = ENOMEM; goto bad; } - sc->port_bst = rman_get_bustag(sc->port); - sc->port_bsh = rman_get_bushandle(sc->port); } - mtx_init(&sc->mtx, device_get_nameunit(dev), - "Interrupt lock", MTX_DEF | MTX_RECURSE); - bad: return (error); } @@ -152,14 +148,10 @@ scd_release_resources (device_t dev) sc = device_get_softc(dev); - if (sc->port) { + if (sc->port) bus_release_resource(dev, sc->port_type, sc->port_rid, sc->port); - sc->port_bst = 0; - sc->port_bsh = 0; - } - if (mtx_initialized(&sc->mtx) != 0) - mtx_destroy(&sc->mtx); + mtx_destroy(&sc->mtx); return; } Modified: head/sys/dev/scd/scdvar.h ============================================================================== --- head/sys/dev/scd/scdvar.h Tue Nov 18 21:58:57 2014 (r274678) +++ head/sys/dev/scd/scdvar.h Tue Nov 18 22:02:37 2014 (r274679) @@ -40,27 +40,26 @@ struct scd_softc { struct resource * port; int port_rid; int port_type; - bus_space_tag_t port_bst; - bus_space_handle_t port_bsh; struct mtx mtx; - struct callout_handle ch; + struct callout timer; int ch_state; struct scd_mbx * ch_mbxsave; struct scd_data data; }; -#define SCD_LOCK(_sc) splx(&(_sc)->mtx -#define SCD_UNLOCK(_sc) splx(&(_sc)->mtx +#define SCD_LOCK(_sc) mtx_lock(&_sc->mtx) +#define SCD_UNLOCK(_sc) mtx_unlock(&_sc->mtx) +#define SCD_ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED) #define SCD_READ(_sc, _reg) \ - bus_space_read_1(_sc->port_bst, _sc->port_bsh, _reg) + bus_read_1(_sc->port, _reg) #define SCD_READ_MULTI(_sc, _reg, _addr, _count) \ - bus_space_read_multi_1(_sc->port_bst, _sc->port_bsh, _reg, _addr, _count) + bus_read_multi_1(_sc->port, _reg, _addr, _count) #define SCD_WRITE(_sc, _reg, _val) \ - bus_space_write_1(_sc->port_bst, _sc->port_bsh, _reg, _val) + bus_write_1(_sc->port, _reg, _val) int scd_probe (struct scd_softc *); int scd_attach (struct scd_softc *); From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 22:12:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EA286A9; Tue, 18 Nov 2014 22:12:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A8CBB9A; Tue, 18 Nov 2014 22:12:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIMCqk6096330; Tue, 18 Nov 2014 22:12:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIMCqfO096329; Tue, 18 Nov 2014 22:12:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411182212.sAIMCqfO096329@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 18 Nov 2014 22:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274680 - head/sys/dev/wds X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 22:12:52 -0000 Author: jhb Date: Tue Nov 18 22:12:51 2014 New Revision: 274680 URL: https://svnweb.freebsd.org/changeset/base/274680 Log: Add locking to wds(4) and mark MPSAFE. - Add per-softc mutex. - Use mutex for CAM SIM lock. - Use bus_*() instead of inb() and outb(). - Use bus_alloc_resource_any() when reasonable. Tested by: no one Modified: head/sys/dev/wds/wd7000.c Modified: head/sys/dev/wds/wd7000.c ============================================================================== --- head/sys/dev/wds/wd7000.c Tue Nov 18 22:02:37 2014 (r274679) +++ head/sys/dev/wds/wd7000.c Tue Nov 18 22:12:51 2014 (r274680) @@ -159,8 +159,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define WDSTOPHYS(wp, a) ( ((u_long)a) - ((u_long)wp->dx) + ((u_long)wp->dx_p) ) -#define WDSTOVIRT(wp, a) ( ((char *)a) - ((char*)wp->dx_p) + ((char *)wp->dx) ) +#define WDSTOPHYS(wp, a) ( ((uintptr_t)a) - ((uintptr_t)wp->dx) + (wp->dx_p) ) +#define WDSTOVIRT(wp, a) ( ((a) - (wp->dx_p)) + ((char *)wp->dx) ) /* 0x10000 (64k) should be enough. But just to be sure... */ #define BUFSIZ 0x12000 @@ -298,8 +298,8 @@ struct wdsdx { struct wds { device_t dev; + struct mtx lock; int unit; - int addr; int drq; struct cam_sim *sim; /* SIM descriptor for this card */ struct cam_path *path; /* wildcard path for this card */ @@ -307,7 +307,7 @@ struct wds { u_int32_t data_free; u_int32_t wdsr_free; struct wdsdx *dx; - struct wdsdx *dx_p; /* physical address */ + bus_addr_t dx_p; /* physical address */ struct resource *port_r; int port_rid; struct resource *drq_r; @@ -323,7 +323,8 @@ struct wds { static int wds_probe(device_t dev); static int wds_attach(device_t dev); -static void wds_intr(struct wds *wp); +static void wds_intr(void *arg); +static void wds_intr_locked(struct wds *wp); static void wds_action(struct cam_sim * sim, union ccb * ccb); static void wds_poll(struct cam_sim * sim); @@ -345,8 +346,8 @@ static void wds_done(struct wds *wp, static int wds_runsense(struct wds *wp, struct wds_req *r); static int wds_getvers(struct wds *wp); -static int wds_cmd(int base, u_int8_t * p, int l); -static void wds_wait(int reg, int mask, int val); +static int wds_cmd(struct wds *wp, u_int8_t * p, int l); +static void wds_wait(struct wds *wp, int reg, int mask, int val); static struct wds_req *cmdtovirt(struct wds *wp, u_int32_t phys); @@ -455,6 +456,7 @@ static int wds_probe(device_t dev) { struct wds *wp; + unsigned long addr; int error = 0; int irq; @@ -466,14 +468,13 @@ wds_probe(device_t dev) wp->unit = device_get_unit(dev); wp->dev = dev; - wp->addr = bus_get_resource_start(dev, SYS_RES_IOPORT, 0 /*rid*/); - if (wp->addr == 0 || wp->addr <0x300 - || wp->addr > 0x3f8 || wp->addr & 0x7) { - device_printf(dev, "invalid port address 0x%x\n", wp->addr); + addr = bus_get_resource_start(dev, SYS_RES_IOPORT, 0 /*rid*/); + if (addr == 0 || addr <0x300 || addr > 0x3f8 || addr & 0x7) { + device_printf(dev, "invalid port address 0x%lx\n", addr); return (ENXIO); } - if (bus_set_resource(dev, SYS_RES_IOPORT, 0, wp->addr, WDS_NPORTS) < 0) + if (bus_set_resource(dev, SYS_RES_IOPORT, 0, addr, WDS_NPORTS) < 0) return (ENXIO); /* get the DRQ */ @@ -491,9 +492,8 @@ wds_probe(device_t dev) } wp->port_rid = 0; - wp->port_r = bus_alloc_resource(dev, SYS_RES_IOPORT, &wp->port_rid, - /*start*/ 0, /*end*/ ~0, - /*count*/ 0, RF_ACTIVE); + wp->port_r = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &wp->port_rid, + RF_ACTIVE); if (wp->port_r == NULL) return (ENXIO); @@ -519,32 +519,29 @@ wds_attach(device_t dev) int error = 0; wp = (struct wds *)device_get_softc(dev); + mtx_init(&wp->lock, "wds", NULL, MTX_DEF); wp->port_rid = 0; - wp->port_r = bus_alloc_resource(dev, SYS_RES_IOPORT, &wp->port_rid, - /*start*/ 0, /*end*/ ~0, - /*count*/ 0, RF_ACTIVE); + wp->port_r = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &wp->port_rid, + RF_ACTIVE); if (wp->port_r == NULL) - return (ENXIO); + goto bad; /* We must now release resources on error. */ wp->drq_rid = 0; - wp->drq_r = bus_alloc_resource(dev, SYS_RES_DRQ, &wp->drq_rid, - /*start*/ 0, /*end*/ ~0, - /*count*/ 0, RF_ACTIVE); + wp->drq_r = bus_alloc_resource_any(dev, SYS_RES_DRQ, &wp->drq_rid, + RF_ACTIVE); if (wp->drq_r == NULL) goto bad; wp->intr_rid = 0; - wp->intr_r = bus_alloc_resource(dev, SYS_RES_IRQ, &wp->intr_rid, - /*start*/ 0, /*end*/ ~0, - /*count*/ 0, RF_ACTIVE); + wp->intr_r = bus_alloc_resource_any(dev, SYS_RES_IRQ, &wp->intr_rid, + RF_ACTIVE); if (wp->intr_r == NULL) goto bad; - error = bus_setup_intr(dev, wp->intr_r, INTR_TYPE_CAM | INTR_ENTROPY, - NULL, (driver_intr_t *)wds_intr, (void *)wp, - &wp->intr_cookie); + error = bus_setup_intr(dev, wp->intr_r, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, wds_intr, wp, &wp->intr_cookie); if (error) goto bad; @@ -557,8 +554,8 @@ wds_attach(device_t dev) /*maxsize*/ sizeof(* wp->dx), /*nsegments*/ 1, /*maxsegsz*/ sizeof(* wp->dx), /*flags*/ 0, - /*lockfunc*/busdma_lock_mutex, - /*lockarg*/&Giant, + /*lockfunc*/NULL, + /*lockarg*/NULL, &wp->bustag); if (error) goto bad; @@ -607,15 +604,17 @@ wds_attach(device_t dev) goto bad; sim = cam_sim_alloc(wds_action, wds_poll, "wds", (void *) wp, - wp->unit, &Giant, 1, 1, devq); + wp->unit, &wp->lock, 1, 1, devq); if (sim == NULL) { cam_simq_free(devq); goto bad; } wp->sim = sim; + mtx_lock(&wp->lock); if (xpt_bus_register(sim, dev, 0) != CAM_SUCCESS) { cam_sim_free(sim, /* free_devq */ TRUE); + mtx_unlock(&wp->lock); goto bad; } if (xpt_create_path(&pathp, /* periph */ NULL, @@ -623,14 +622,17 @@ wds_attach(device_t dev) CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(sim)); cam_sim_free(sim, /* free_devq */ TRUE); + mtx_unlock(&wp->lock); goto bad; } + mtx_unlock(&wp->lock); wp->path = pathp; return (0); bad: wds_free_resources(wp); + mtx_destroy(&wp->lock); if (error) return (error); else /* exact error is unknown */ @@ -759,19 +761,29 @@ wdsr_alloc(struct wds *wp) } static void -wds_intr(struct wds *wp) +wds_intr(void *arg) +{ + struct wds *wp; + + wp = arg; + mtx_lock(&wp->lock); + wds_intr_locked(wp); + mtx_unlock(&wp->lock); +} + +static void +wds_intr_locked(struct wds *wp) { struct wds_req *rp; struct wds_mb *in; u_int8_t stat; u_int8_t c; - int addr = wp->addr; DBG(DBX "wds%d: interrupt [\n", wp->unit); smallog('['); - if (inb(addr + WDS_STAT) & WDS_IRQ) { - c = inb(addr + WDS_IRQSTAT); + if (bus_read_1(wp->port_r, WDS_STAT) & WDS_IRQ) { + c = bus_read_1(wp->port_r, WDS_IRQSTAT); if ((c & WDSI_MASK) == WDSI_MSVC) { c = c & ~WDSI_MASK; in = &wp->dx->imbs[c]; @@ -790,7 +802,7 @@ wds_intr(struct wds *wp) } else device_printf(wp->dev, "weird interrupt, irqstat=0x%x\n", c); - outb(addr + WDS_IRQACK, 0); + bus_write_1(wp->port_r, WDS_IRQACK, 0); } else { smallog('?'); } @@ -934,12 +946,12 @@ wds_runsense(struct wds *wp, struct wds_ scsi_ulto3b(sizeof(struct scsi_sense_data), r->cmd.len); r->cmd.write = 0x80; - outb(wp->addr + WDS_HCR, WDSH_IRQEN | WDSH_DRQEN); + bus_write_1(wp->port_r, WDS_HCR, WDSH_IRQEN | WDSH_DRQEN); wp->dx->ombs[r->ombn].stat = 1; c = WDSC_MSTART(r->ombn); - if (wds_cmd(wp->addr, &c, sizeof c) != 0) { + if (wds_cmd(wp, &c, sizeof c) != 0) { device_printf(wp->dev, "unable to start outgoing sense mbox\n"); wp->dx->ombs[r->ombn].stat = 0; wdsr_ccb_done(wp, r, r->ccb, CAM_AUTOSENSE_FAIL); @@ -958,12 +970,9 @@ static int wds_getvers(struct wds *wp) { struct wds_req *r; - int base; u_int8_t c; int i; - base = wp->addr; - r = wdsr_alloc(wp); if (!r) { device_printf(wp->dev, "no request slot available!\n"); @@ -978,10 +987,10 @@ wds_getvers(struct wds *wp) bzero(&r->cmd, sizeof r->cmd); r->cmd.cmd = WDSX_GETFIRMREV; - outb(base + WDS_HCR, WDSH_DRQEN); + bus_write_1(wp->port_r, WDS_HCR, WDSH_DRQEN); c = WDSC_MSTART(r->ombn); - if (wds_cmd(base, (u_int8_t *) & c, sizeof c)) { + if (wds_cmd(wp, (u_int8_t *) & c, sizeof c)) { device_printf(wp->dev, "version request failed\n"); wp->wdsr_free |= (1 << r->id); wp->dx->ombs[r->ombn].stat = 0; @@ -989,14 +998,14 @@ wds_getvers(struct wds *wp) } while (1) { i = 0; - while ((inb(base + WDS_STAT) & WDS_IRQ) == 0) { + while ((bus_read_1(wp->port_r, WDS_STAT) & WDS_IRQ) == 0) { DELAY(9000); if (++i == 100) { device_printf(wp->dev, "getvers timeout\n"); return (-1); } } - wds_intr(wp); + wds_intr_locked(wp); if (r->flags & WR_DONE) { device_printf(wp->dev, "firmware version %d.%02d\n", r->cmd.targ, r->cmd.scb[0]); @@ -1016,9 +1025,8 @@ wdsr_ccb_done(struct wds *wp, struct wds /* To implement timeouts we would need to know how to abort the * command on controller, and this is a great mystery. * So for now we just pass the responsibility for timeouts - * to the controlles itself, it does that reasonably good. + * to the controller itself, it does that reasonably good. */ - /* untimeout(_timeout, (caddr_t) hcb, ccb->ccb_h.timeout_ch); */ /* we're about to free a hcb, so the shortage has ended */ frag_free(wp, r->mask); if (wp->want_wdsr && status != CAM_REQUEUE_REQ) { @@ -1040,7 +1048,6 @@ wds_scsi_io(struct cam_sim * sim, struct struct wds *wp; struct ccb_hdr *ccb_h; struct wds_req *r; - int base; u_int8_t c; int error; int n; @@ -1072,7 +1079,6 @@ wds_scsi_io(struct cam_sim * sim, struct xpt_done((union ccb *) csio); return; } - base = wp->addr; /* * this check is mostly for debugging purposes, @@ -1150,11 +1156,11 @@ wds_scsi_io(struct cam_sim * sim, struct scsi_ulto3b(0, r->cmd.next); - outb(base + WDS_HCR, WDSH_IRQEN | WDSH_DRQEN); + bus_write_1(wp->port_r, WDS_HCR, WDSH_IRQEN | WDSH_DRQEN); c = WDSC_MSTART(r->ombn); - if (wds_cmd(base, &c, sizeof c) != 0) { + if (wds_cmd(wp, &c, sizeof c) != 0) { device_printf(wp->dev, "unable to start outgoing mbox\n"); wp->dx->ombs[r->ombn].stat = 0; wdsr_ccb_done(wp, r, r->ccb, CAM_RESRC_UNAVAIL); @@ -1170,16 +1176,13 @@ static void wds_action(struct cam_sim * sim, union ccb * ccb) { int unit = cam_sim_unit(sim); - int s; DBG(DBX "wds%d: action 0x%x\n", unit, ccb->ccb_h.func_code); switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: - s = splcam(); DBG(DBX "wds%d: SCSI IO entered\n", unit); wds_scsi_io(sim, &ccb->csio); DBG(DBX "wds%d: SCSI IO returned\n", unit); - splx(s); break; case XPT_RESET_BUS: /* how to do it right ? */ @@ -1242,7 +1245,7 @@ wds_action(struct cam_sim * sim, union c static void wds_poll(struct cam_sim * sim) { - wds_intr((struct wds *)cam_sim_softc(sim)); + wds_intr_locked(cam_sim_softc(sim)); } /* part of initialization done in probe() */ @@ -1251,32 +1254,29 @@ wds_poll(struct cam_sim * sim) static int wds_preinit(struct wds *wp) { - int base; int i; - base = wp->addr; - /* * Sending a command causes the CMDRDY bit to clear. */ - outb(base + WDS_CMD, WDSC_NOOP); - if (inb(base + WDS_STAT) & WDS_RDY) + bus_write_1(wp->port_r, WDS_CMD, WDSC_NOOP); + if (bus_read_1(wp->port_r, WDS_STAT) & WDS_RDY) return (ENXIO); /* * the controller exists. reset and init. */ - outb(base + WDS_HCR, WDSH_ASCRESET | WDSH_SCSIRESET); + bus_write_1(wp->port_r, WDS_HCR, WDSH_ASCRESET | WDSH_SCSIRESET); DELAY(30); - outb(base + WDS_HCR, 0); + bus_write_1(wp->port_r, WDS_HCR, 0); - if ((inb(base + WDS_STAT) & (WDS_RDY)) != WDS_RDY) { + if ((bus_read_1(wp->port_r, WDS_STAT) & (WDS_RDY)) != WDS_RDY) { for (i = 0; i < 10; i++) { - if ((inb(base + WDS_STAT) & (WDS_RDY)) == WDS_RDY) + if ((bus_read_1(wp->port_r, WDS_STAT) & (WDS_RDY)) == WDS_RDY) break; DELAY(40000); } - if ((inb(base + WDS_STAT) & (WDS_RDY)) != WDS_RDY) + if ((bus_read_1(wp->port_r, WDS_STAT) & (WDS_RDY)) != WDS_RDY) /* probe timeout */ return (ENXIO); } @@ -1291,23 +1291,20 @@ static int wds_init(struct wds *wp) { struct wds_setup init; - int base; int i; struct wds_cmd wc; - base = wp->addr; - - outb(base + WDS_HCR, WDSH_DRQEN); + bus_write_1(wp->port_r, WDS_HCR, WDSH_DRQEN); isa_dmacascade(wp->drq); - if ((inb(base + WDS_STAT) & (WDS_RDY)) != WDS_RDY) { + if ((bus_read_1(wp->port_r, WDS_STAT) & (WDS_RDY)) != WDS_RDY) { for (i = 0; i < 10; i++) { - if ((inb(base + WDS_STAT) & (WDS_RDY)) == WDS_RDY) + if ((bus_read_1(wp->port_r, WDS_STAT) & (WDS_RDY)) == WDS_RDY) break; DELAY(40000); } - if ((inb(base + WDS_STAT) & (WDS_RDY)) != WDS_RDY) + if ((bus_read_1(wp->port_r, WDS_STAT) & (WDS_RDY)) != WDS_RDY) /* probe timeout */ return (1); } @@ -1321,18 +1318,18 @@ wds_init(struct wds *wp) init.nomb = WDS_NOMB; init.nimb = WDS_NIMB; - wds_wait(base + WDS_STAT, WDS_RDY, WDS_RDY); - if (wds_cmd(base, (u_int8_t *) & init, sizeof init) != 0) { + wds_wait(wp, WDS_STAT, WDS_RDY, WDS_RDY); + if (wds_cmd(wp, (u_int8_t *) & init, sizeof init) != 0) { device_printf(wp->dev, "wds_cmd init failed\n"); return (1); } - wds_wait(base + WDS_STAT, WDS_INIT, WDS_INIT); + wds_wait(wp, WDS_STAT, WDS_INIT, WDS_INIT); - wds_wait(base + WDS_STAT, WDS_RDY, WDS_RDY); + wds_wait(wp, WDS_STAT, WDS_RDY, WDS_RDY); bzero(&wc, sizeof wc); wc.cmd = WDSC_DISUNSOL; - if (wds_cmd(base, (char *) &wc, sizeof wc) != 0) { + if (wds_cmd(wp, (char *) &wc, sizeof wc) != 0) { device_printf(wp->dev, "wds_cmd init2 failed\n"); return (1); } @@ -1340,29 +1337,26 @@ wds_init(struct wds *wp) } static int -wds_cmd(int base, u_int8_t * p, int l) +wds_cmd(struct wds *wp, u_int8_t * p, int l) { - int s = splcam(); while (l--) { do { - outb(base + WDS_CMD, *p); - wds_wait(base + WDS_STAT, WDS_RDY, WDS_RDY); - } while (inb(base + WDS_STAT) & WDS_REJ); + bus_write_1(wp->port_r, WDS_CMD, *p); + wds_wait(wp, WDS_STAT, WDS_RDY, WDS_RDY); + } while (bus_read_1(wp->port_r, WDS_STAT) & WDS_REJ); p++; } - wds_wait(base + WDS_STAT, WDS_RDY, WDS_RDY); - - splx(s); + wds_wait(wp, WDS_STAT, WDS_RDY, WDS_RDY); return (0); } static void -wds_wait(int reg, int mask, int val) +wds_wait(struct wds *wp, int reg, int mask, int val) { - while ((inb(reg) & mask) != val) + while ((bus_read_1(wp->port_r, reg) & mask) != val) ; } @@ -1394,9 +1388,9 @@ wds_print(void) if (wp == NULL) continue; printf("wds%d: want_wdsr=0x%x stat=0x%x irq=%s irqstat=0x%x\n", - unit, wp->want_wdsr, inb(wp->addr + WDS_STAT) & 0xff, - (inb(wp->addr + WDS_STAT) & WDS_IRQ) ? "ready" : "no", - inb(wp->addr + WDS_IRQSTAT) & 0xff); + unit, wp->want_wdsr, bus_read_1(wp->port_r, WDS_STAT) & 0xff, + (bus_read_1(wp->port_r, WDS_STAT) & WDS_IRQ) ? "ready" : "no", + bus_read_1(wp->port_r, WDS_IRQSTAT) & 0xff); for (i = 0; i < MAXSIMUL; i++) { r = &wp->dx->req[i]; if( wp->wdsr_free & (1 << r->id) ) { From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 22:22:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A928B25; Tue, 18 Nov 2014 22:22:32 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 119A7C97; Tue, 18 Nov 2014 22:22:32 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EEB84B9C4; Tue, 18 Nov 2014 17:22:30 -0500 (EST) From: John Baldwin To: Adrian Chadd Subject: Re: svn commit: r274635 - head/sys/dev/pci Date: Tue, 18 Nov 2014 17:20:01 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201411181720.01235.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 18 Nov 2014 17:22:31 -0500 (EST) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Dmitry Chagin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 22:22:32 -0000 On Monday, November 17, 2014 6:17:25 pm Adrian Chadd wrote: > On 17 November 2014 14:45, John Baldwin wrote: > > On Monday, November 17, 2014 08:25:21 PM Dmitry Chagin wrote: > >> Author: dchagin > >> Date: Mon Nov 17 20:25:21 2014 > >> New Revision: 274635 > >> URL: https://svnweb.freebsd.org/changeset/base/274635 > >> > >> Log: > >> Use the correct device as the power_for_sleep() method > >> always pass request up to parent bridge. > >> > >> Reviewed by: jhb > >> MFC after: 1 week > >> xMFC: r274386,r274397 > > > > Hmm, I had misread this diff as being another instance of what Adrian had > > found. I think this is actually not correct. The parent of a pci device > > ('dev' here) is a pciX device. pciX devices do not implement the > > PCIB_POWER_FOR_SLEEP method from pcib_if.m, so this probably just broke > > Adrian's Asus laptop as now it will always use D3 again and ignore _SxD. > > > > You said that this change fixed your laptop, yes? Did it work before Adrian's > > change in r274386 and break afterwards? > > Hm, it doesn't cascade up to the parent of dev if it's called? No, not all kobj methods do this. In this case this is a pcib_if method, so it is an interface supported by PCI bridge devices only. PCI bus devices aren't bridges, so they don't implement it. Similarly, pcib devices don't implement pci_if.m methods either. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 22:35:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0251374; Tue, 18 Nov 2014 22:35:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACC04DB1; Tue, 18 Nov 2014 22:35:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAIMZKEd006387; Tue, 18 Nov 2014 22:35:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAIMZKj3006386; Tue, 18 Nov 2014 22:35:20 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411182235.sAIMZKj3006386@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 18 Nov 2014 22:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274681 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 22:35:20 -0000 Author: delphij Date: Tue Nov 18 22:35:19 2014 New Revision: 274681 URL: https://svnweb.freebsd.org/changeset/base/274681 Log: Make vfs.zfs.max_recordsize read-write at runtime. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Nov 18 22:12:51 2014 (r274680) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Nov 18 22:35:19 2014 (r274681) @@ -63,7 +63,7 @@ SYSCTL_DECL(_vfs_zfs); * of this setting. */ int zfs_max_recordsize = 1 * 1024 * 1024; -SYSCTL_INT(_vfs_zfs, OID_AUTO, max_recordsize, CTLFLAG_RDTUN, +SYSCTL_INT(_vfs_zfs, OID_AUTO, max_recordsize, CTLFLAG_RWTUN, &zfs_max_recordsize, 0, "Maximum block size. Expect dragons when tuning this."); From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 22:44:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FCA17CC; Tue, 18 Nov 2014 22:44:00 +0000 (UTC) Received: from mail-la0-x22c.google.com (mail-la0-x22c.google.com [IPv6:2a00:1450:4010:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFA07E94; Tue, 18 Nov 2014 22:43:59 +0000 (UTC) Received: by mail-la0-f44.google.com with SMTP id ge10so1065136lab.31 for ; Tue, 18 Nov 2014 14:43:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=6scIQWERWwSw7TNqc1ekEUsDYDbsarhcxMkVJqgnbzc=; b=g8Vu2TSZF9mD7e6VhZMvKlLy9Ea3mK8eg9qdXQFALQ1MfYiYy6ETLQNhH5glc2sogI jh1t8oe0mdROchvuipINWfawwSUjNVVI2joebxbbA/+Ojw5b7wy1+Ccpwlwsa8QS9HmW VHNdmNqBgx0G9YBiYLwmftSSjLjRWovRjv6JKVMEtfGLVziPhMB6HHF8SaRkeP2FYN04 P1lupyIQrohzutjwFLCn2sIu/g4kFcLVNF30ucp1BmKwUwC9eDrpMxZtoQUuSNBoN1e0 qm2i5APnI3OWH3E1HKCcCj5EzSoV+gR6z4UX9t58lx/aCllxuSjzrQ5yLl/1TKb3T998 DYag== MIME-Version: 1.0 X-Received: by 10.152.88.100 with SMTP id bf4mr1905001lab.74.1416350637781; Tue, 18 Nov 2014 14:43:57 -0800 (PST) Sender: mahrens@gmail.com Received: by 10.112.210.4 with HTTP; Tue, 18 Nov 2014 14:43:57 -0800 (PST) In-Reply-To: <20141118220030.GA31347@zxy.spb.ru> References: <201411181840.sAIIe2C7094558@svn.freebsd.org> <20141118220030.GA31347@zxy.spb.ru> Date: Tue, 18 Nov 2014 14:43:57 -0800 X-Google-Sender-Auth: zQlPeRCmxtIsvcojNBVBHYRpEqw Message-ID: Subject: Re: svn commit: r274673 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Matthew Ahrens To: Slawa Olhovchenkov Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "src-committers@freebsd.org" , Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 22:44:00 -0000 On Tue, Nov 18, 2014 at 2:00 PM, Slawa Olhovchenkov wrote: > On Tue, Nov 18, 2014 at 06:40:02PM +0000, Xin LI wrote: > > > Author: delphij > > Date: Tue Nov 18 18:40:01 2014 > > New Revision: 274673 > > URL: https://svnweb.freebsd.org/changeset/base/274673 > > > > Log: > > Allow tuning zfs_max_recordsize via loader tunable. Tuning is NOT > > recommended. > > This is not tuning, this is simple guard. > And can be safe changed (incrased, at the least) in any time. > For some workload optimal is maximum, i.e. 16MB. > May be better comment: increasing this value required strong > understaning after-effects of increasing memory consumption and > bulk data transfers. (sorry for english) > I agree -- setting recordsize to 16MB is an easy way to make performance suck if you don't know what you're doing. But it isn't dangerous from a correctness point of view. --matt > > > Requested by: Slawa Olhovchenkov > > MFC after: 2 weeks > > Thanks, can you allow RW? > > > Modified: > > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c > > > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c > > > ============================================================================== > > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c > Tue Nov 18 18:03:40 2014 (r274672) > > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c > Tue Nov 18 18:40:01 2014 (r274673) > > @@ -51,6 +51,8 @@ > > #include > > #include > > > > +SYSCTL_DECL(_vfs_zfs); > > + > > /* > > * The SPA supports block sizes up to 16MB. However, very large blocks > > * can have an impact on i/o latency (e.g. tying up a spinning disk for > > @@ -61,6 +63,9 @@ > > * of this setting. > > */ > > int zfs_max_recordsize = 1 * 1024 * 1024; > > +SYSCTL_INT(_vfs_zfs, OID_AUTO, max_recordsize, CTLFLAG_RDTUN, > > + &zfs_max_recordsize, 0, > > + "Maximum block size. Expect dragons when tuning this."); > > > > #define SWITCH64(x, y) \ > > { \ > > _______________________________________________ > > 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" > > From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 22:57:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07365A18; Tue, 18 Nov 2014 22:57:55 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DB689F8F; Tue, 18 Nov 2014 22:57:54 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [12.229.62.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 5B628221D5; Tue, 18 Nov 2014 14:57:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1416351474; x=1416365874; bh=sEEA2TvypbiI1Ye7Qg4RBhcKldfwXw5hCKXrdQe9Iy0=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=K+9FrWjA1o4qMZ8ygEe6NerSQxYOtmGEc2M39uFlIJoyu3KKUsZjKzpjTqfcRr5ZZ WftwMLMqYu7VqwEyNHUkw7q+roz0seS0h3tkvMNBJ5g7YmIl4NF8ST3GY6SSqibOPG W5YNA8kRpEU37L8PIWJNoBUrvdYI2rthHtQLnQuo= Message-ID: <546BCEF1.7080009@delphij.net> Date: Tue, 18 Nov 2014 14:57:53 -0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Slawa Olhovchenkov , Xin LI Subject: Re: svn commit: r274673 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201411181840.sAIIe2C7094558@svn.freebsd.org> <20141118220030.GA31347@zxy.spb.ru> In-Reply-To: <20141118220030.GA31347@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 22:57:55 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 11/18/14 14:00, Slawa Olhovchenkov wrote: > On Tue, Nov 18, 2014 at 06:40:02PM +0000, Xin LI wrote: > >> Author: delphij Date: Tue Nov 18 18:40:01 2014 New Revision: >> 274673 URL: https://svnweb.freebsd.org/changeset/base/274673 >> >> Log: Allow tuning zfs_max_recordsize via loader tunable. Tuning >> is NOT recommended. > > This is not tuning, this is simple guard. And can be safe changed > (incrased, at the least) in any time. FWIW: It can be safely decreased: the ability to read such pool is maintained. > For some workload optimal is maximum, i.e. 16MB. > > May be better comment: increasing this value required strong > understaning after-effects of increasing memory consumption and > bulk data transfers. (sorry for english) That's true, but not free. I don't think we have carefully evaluated the situation (and possible mitigation measures, like, do we need to make some improvements to the slab allocator? It's never exposed to workload like this before, etc.), and people tend to make uninformed changes all the times (a lot of FreeBSD tuning guide gives wrong instructions). >> Requested by: Slawa Olhovchenkov MFC after: 2 >> weeks > > Thanks, can you allow RW? Sure, done in 274681. I didn't do it at the beginning because I don't think it's a good idea to make it easy for users to fiddle with it, and power users who actually need to tweak do not change it often. But you are right there is no real technical reason not to allow read-write. >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c >> >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c >> ============================================================================== >> >> - --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Nov 18 18:03:40 2014 (r274672) >> +++ >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c >> Tue Nov 18 18:40:01 2014 (r274673) @@ -51,6 +51,8 @@ #include >> #include >> >> +SYSCTL_DECL(_vfs_zfs); + /* * The SPA supports block sizes up to >> 16MB. However, very large blocks * can have an impact on i/o >> latency (e.g. tying up a spinning disk for @@ -61,6 +63,9 @@ * of >> this setting. */ int zfs_max_recordsize = 1 * 1024 * 1024; >> +SYSCTL_INT(_vfs_zfs, OID_AUTO, max_recordsize, CTLFLAG_RDTUN, + >> &zfs_max_recordsize, 0, + "Maximum block size. Expect dragons >> when tuning this."); >> >> #define SWITCH64(x, y) \ { \ >> _______________________________________________ >> 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" - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJUa87xAAoJEJW2GBstM+nsPrgP/0o9O/AiiFJZhCezZc29oMQe Za4m5U3sWCPTb1x5fc3A5pKq1frT2GUvbUAjh21yuN5A8GfMt8A4v+nQ4i/asZ3C GkyU7Zkv0sW/14DR3nhRrLTNCum6p2Yk0XkxDBnUlBVzoJzbbbqin9PtTbe6i330 mav6E17V0AelCk8BoWpnhCcQbLObP9zvklzqknjlPHl5d81ERhfyp1p+BjPexdML ykOb3ZsjC0+8MfNmlKEyUga6Saz6vQXVqtXhkMuvqE8VNSfedXO+EpOweOID2SDU 7S4bwkFfu0GuBdqHSXTWsp3ncNiN/KfuX5fAUjb8Aoqp2RCHbft+DS2mnxSw/S7/ cUpOoC1ga+cUU4KLEgm3DG8y1LZH3KPyrzwFzXfY31lgOttCosQi9IeWgigGW975 3jhU7Oz+CX6oMPoAWhujAD3yGKVp2Qp2lePl12pl+F73jrwJ7UaTbKWZlNkofX0T o9/u/tqtna7NY3w9/z7WRDQFZvFEp2laARNAlr8QcakIuCXsDnG26LxFHbtLld0M R/88EYYJgWLPWD7TzapkrKhqbaf6sn6Z7m4M0Oo+MbFRNSII59/rTZsAbDI9PgiZ ScnaQldbnJdi0yMp8VyHrPDFqJtByhL/dQvmcTYf2QItnFEu1Hf3Os1nD+p3+8Z+ sdEBf8XuZdlMIcRIzFR2 =Gccl -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Nov 18 23:11:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61400E05; Tue, 18 Nov 2014 23:11:43 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B18B1A2; Tue, 18 Nov 2014 23:11:43 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1Xqrvv-0009P1-K5; Wed, 19 Nov 2014 03:11:39 +0400 Date: Wed, 19 Nov 2014 03:11:39 +0400 From: Slawa Olhovchenkov To: d@delphij.net Subject: Re: svn commit: r274673 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20141118231139.GO9763@zxy.spb.ru> References: <201411181840.sAIIe2C7094558@svn.freebsd.org> <20141118220030.GA31347@zxy.spb.ru> <546BCEF1.7080009@delphij.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <546BCEF1.7080009@delphij.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 23:11:43 -0000 On Tue, Nov 18, 2014 at 02:57:53PM -0800, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 11/18/14 14:00, Slawa Olhovchenkov wrote: > > On Tue, Nov 18, 2014 at 06:40:02PM +0000, Xin LI wrote: > > > >> Author: delphij Date: Tue Nov 18 18:40:01 2014 New Revision: > >> 274673 URL: https://svnweb.freebsd.org/changeset/base/274673 > >> > >> Log: Allow tuning zfs_max_recordsize via loader tunable. Tuning > >> is NOT recommended. > > > > This is not tuning, this is simple guard. And can be safe changed > > (incrased, at the least) in any time. > > FWIW: It can be safely decreased: the ability to read such pool is > maintained. > > > For some workload optimal is maximum, i.e. 16MB. > > > > May be better comment: increasing this value required strong > > understaning after-effects of increasing memory consumption and > > bulk data transfers. (sorry for english) > > That's true, but not free. I don't think we have carefully evaluated > the situation (and possible mitigation measures, like, do we need to > make some improvements to the slab allocator? It's never exposed to > workload like this before, etc.), and people tend to make uninformed > changes all the times (a lot of FreeBSD tuning guide gives wrong > instructions). Now I start production with raidz1 and recordsize 2MB. > >> Requested by: Slawa Olhovchenkov MFC after: 2 > >> weeks > > > > Thanks, can you allow RW? > > Sure, done in 274681. > > I didn't do it at the beginning because I don't think it's a good idea > to make it easy for users to fiddle with it, and power users who > actually need to tweak do not change it often. But you are right > there is no real technical reason not to allow read-write. Thanks, just bad if required reboot creating zfs set with >1MB recordsize. At this point site may be in prodation, for example. > >> Modified: > >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c > >> > >> > >> > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c > >> ============================================================================== > >> > >> > - --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c > Tue Nov 18 18:03:40 2014 (r274672) > >> +++ > >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c > >> Tue Nov 18 18:40:01 2014 (r274673) @@ -51,6 +51,8 @@ #include > >> #include > >> > >> +SYSCTL_DECL(_vfs_zfs); + /* * The SPA supports block sizes up to > >> 16MB. However, very large blocks * can have an impact on i/o > >> latency (e.g. tying up a spinning disk for @@ -61,6 +63,9 @@ * of > >> this setting. */ int zfs_max_recordsize = 1 * 1024 * 1024; > >> +SYSCTL_INT(_vfs_zfs, OID_AUTO, max_recordsize, CTLFLAG_RDTUN, + > >> &zfs_max_recordsize, 0, + "Maximum block size. Expect dragons > >> when tuning this."); > >> > >> #define SWITCH64(x, y) \ { \ > >> _______________________________________________ > >> 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" > > > - -- > Xin LI https://www.delphij.net/ > FreeBSD - The Power to Serve! Live free or die > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0 > > iQIcBAEBCgAGBQJUa87xAAoJEJW2GBstM+nsPrgP/0o9O/AiiFJZhCezZc29oMQe > Za4m5U3sWCPTb1x5fc3A5pKq1frT2GUvbUAjh21yuN5A8GfMt8A4v+nQ4i/asZ3C > GkyU7Zkv0sW/14DR3nhRrLTNCum6p2Yk0XkxDBnUlBVzoJzbbbqin9PtTbe6i330 > mav6E17V0AelCk8BoWpnhCcQbLObP9zvklzqknjlPHl5d81ERhfyp1p+BjPexdML > ykOb3ZsjC0+8MfNmlKEyUga6Saz6vQXVqtXhkMuvqE8VNSfedXO+EpOweOID2SDU > 7S4bwkFfu0GuBdqHSXTWsp3ncNiN/KfuX5fAUjb8Aoqp2RCHbft+DS2mnxSw/S7/ > cUpOoC1ga+cUU4KLEgm3DG8y1LZH3KPyrzwFzXfY31lgOttCosQi9IeWgigGW975 > 3jhU7Oz+CX6oMPoAWhujAD3yGKVp2Qp2lePl12pl+F73jrwJ7UaTbKWZlNkofX0T > o9/u/tqtna7NY3w9/z7WRDQFZvFEp2laARNAlr8QcakIuCXsDnG26LxFHbtLld0M > R/88EYYJgWLPWD7TzapkrKhqbaf6sn6Z7m4M0Oo+MbFRNSII59/rTZsAbDI9PgiZ > ScnaQldbnJdi0yMp8VyHrPDFqJtByhL/dQvmcTYf2QItnFEu1Hf3Os1nD+p3+8Z+ > sdEBf8XuZdlMIcRIzFR2 > =Gccl > -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 05:38:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0EFE7BB; Wed, 19 Nov 2014 05:38:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82E84D2D; Wed, 19 Nov 2014 05:38:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJ5ckpp005435; Wed, 19 Nov 2014 05:38:46 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJ5cjUY005432; Wed, 19 Nov 2014 05:38:45 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201411190538.sAJ5cjUY005432@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 19 Nov 2014 05:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274684 - in head: share/man/man4 sys/dev/usb sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 05:38:46 -0000 Author: kevlo Date: Wed Nov 19 05:38:45 2014 New Revision: 274684 URL: https://svnweb.freebsd.org/changeset/base/274684 Log: Add Trendnet TEW-646UBH. Submitted by: bolshakov_1 at yahoo dot com Modified: head/share/man/man4/rsu.4 head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_rsu.c Modified: head/share/man/man4/rsu.4 ============================================================================== --- head/share/man/man4/rsu.4 Wed Nov 19 01:07:58 2014 (r274683) +++ head/share/man/man4/rsu.4 Wed Nov 19 05:38:45 2014 (r274684) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd May 3, 2014 +.Dd November 19, 2014 .Dt RSU 4 .Os .Sh NAME @@ -119,6 +119,7 @@ wireless network adapters, including: .It Sitecom WL-349 v1 .It Sitecom WL-353 .It Sweex LW154 +.It TRENDnet TEW-646UBH .It TRENDnet TEW-648UB .It TRENDnet TEW-649UB .El Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Nov 19 01:07:58 2014 (r274683) +++ head/sys/dev/usb/usbdevs Wed Nov 19 05:38:45 2014 (r274684) @@ -4370,6 +4370,7 @@ product TREK THUMBDRIVE_8MB 0x9988 Thumb /* TRENDnet products */ product TRENDNET RTL8192CU 0x624d RTL8192CU +product TRENDNET TEW646UBH 0x646b TEW-646UBH product TRENDNET RTL8188CU 0x648b RTL8188CU /* Tripp-Lite products */ Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Wed Nov 19 01:07:58 2014 (r274683) +++ head/sys/dev/usb/wlan/if_rsu.c Wed Nov 19 05:38:45 2014 (r274684) @@ -121,6 +121,7 @@ static const STRUCT_USB_HOST_ID rsu_devs RSU_DEV_HT(SITECOMEU, WL349V1), RSU_DEV_HT(SITECOMEU, WL353), RSU_DEV_HT(SWEEX2, LW154), + RSU_DEV_HT(TRENDNET, TEW646UBH), #undef RSU_DEV_HT #undef RSU_DEV }; From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 06:04:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A44FFB4; Wed, 19 Nov 2014 06:04:47 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 76D14FBD; Wed, 19 Nov 2014 06:04:47 +0000 (UTC) Received: from [10.0.1.20] (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 25841341F83D; Tue, 18 Nov 2014 22:04:47 -0800 (PST) Subject: Re: svn commit: r274672 - in head/contrib/libxo: . libxo xolint Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Alfred Perlstein In-Reply-To: <201411181803.sAII3fCg079794@svn.freebsd.org> Date: Tue, 18 Nov 2014 22:04:46 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <18F6425B-A767-426D-8EEF-57B7CFF3D54B@mu.org> References: <201411181803.sAII3fCg079794@svn.freebsd.org> To: Marcel Moolenaar 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 06:04:47 -0000 Marcel, is there a way to get libxo programs to emit time series data? =20= Any examples of this in the tree right now? Example would be if "netstat -1" was libxo-ified, it would also emit a = timestamp. -Alfred On Nov 18, 2014, at 10:03 AM, Marcel Moolenaar wrote: > Author: marcel > Date: Tue Nov 18 18:03:40 2014 > New Revision: 274672 > URL: https://svnweb.freebsd.org/changeset/base/274672 >=20 > Log: > Upgrade libxo to 0.1.6. >=20 > Summary of changes: > 1. Coverity defect fixes >=20 > Obtained from: https://github.com/Juniper/libxo/releases/tag/0.1.6 >=20 > Modified: > head/contrib/libxo/configure.ac > head/contrib/libxo/libxo/libxo.c > head/contrib/libxo/libxo/xoconfig.h > head/contrib/libxo/libxo/xoversion.h > head/contrib/libxo/xolint/xolint.pl >=20 > Modified: head/contrib/libxo/configure.ac > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/contrib/libxo/configure.ac Tue Nov 18 17:37:33 2014 = (r274671) > +++ head/contrib/libxo/configure.ac Tue Nov 18 18:03:40 2014 = (r274672) > @@ -12,7 +12,7 @@ > # >=20 > AC_PREREQ(2.2) > -AC_INIT([libxo], [0.1.5], [phil@juniper.net]) > +AC_INIT([libxo], [0.1.6], [phil@juniper.net]) > AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) >=20 > # Support silent build rules. Requires at least automake-1.11. >=20 > Modified: head/contrib/libxo/libxo/libxo.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/contrib/libxo/libxo/libxo.c Tue Nov 18 17:37:33 2014 = (r274671) > +++ head/contrib/libxo/libxo/libxo.c Tue Nov 18 18:03:40 2014 = (r274672) > @@ -317,7 +317,7 @@ xo_init_handle (xo_handle_t *xop) > cp =3D getenv("LC_ALL"); > if (cp =3D=3D NULL) > cp =3D "UTF-8"; /* Optimistic? */ > - cp =3D setlocale(LC_CTYPE, cp); > + (void) setlocale(LC_CTYPE, cp); > } >=20 > /* > @@ -607,8 +607,10 @@ xo_vsnprintf (xo_handle_t *xop, xo_buffe > rc =3D vsnprintf(xbp->xb_curp, left, fmt, va_local); >=20 > if (rc > xbp->xb_size) { > - if (!xo_buf_has_room(xbp, rc)) > + if (!xo_buf_has_room(xbp, rc)) { > + va_end(va_local); > return -1; > + } >=20 > /* > * After we call vsnprintf(), the stage of vap is not defined. > @@ -648,8 +650,10 @@ xo_printf_v (xo_handle_t *xop, const cha > rc =3D vsnprintf(xbp->xb_curp, left, fmt, va_local); >=20 > if (rc > xbp->xb_size) { > - if (!xo_buf_has_room(xbp, rc)) > + if (!xo_buf_has_room(xbp, rc)) { > + va_end(va_local); > return -1; > + } >=20 > va_end(va_local); /* Reset vap to the start */ > va_copy(va_local, vap); > @@ -974,8 +978,10 @@ xo_warn_hcv (xo_handle_t *xop, int code, > int left =3D xbp->xb_size - (xbp->xb_curp - xbp->xb_bufp); > int rc =3D vsnprintf(xbp->xb_curp, left, newfmt, vap); > if (rc > xbp->xb_size) { > - if (!xo_buf_has_room(xbp, rc)) > + if (!xo_buf_has_room(xbp, rc)) { > + va_end(va_local); > return; > + } >=20 > va_end(vap); /* Reset vap to the start */ > va_copy(vap, va_local); > @@ -1118,8 +1124,10 @@ xo_message_hcv (xo_handle_t *xop, int co > int left =3D xbp->xb_size - (xbp->xb_curp - xbp->xb_bufp); > rc =3D vsnprintf(xbp->xb_curp, left, fmt, vap); > if (rc > xbp->xb_size) { > - if (!xo_buf_has_room(xbp, rc)) > + if (!xo_buf_has_room(xbp, rc)) { > + va_end(va_local); > return; > + } >=20 > va_end(vap); /* Reset vap to the start */ > va_copy(vap, va_local); > @@ -1154,14 +1162,15 @@ xo_message_hcv (xo_handle_t *xop, int co >=20 > va_copy(va_local, vap); >=20 > - rc =3D vsnprintf(buf, bufsiz, fmt, va_local); > + rc =3D vsnprintf(bp, bufsiz, fmt, va_local); > if (rc > bufsiz) { > bufsiz =3D rc + BUFSIZ; > bp =3D alloca(bufsiz); > va_end(va_local); > va_copy(va_local, vap); > - rc =3D vsnprintf(buf, bufsiz, fmt, va_local); > + rc =3D vsnprintf(bp, bufsiz, fmt, va_local); > } > + va_end(va_local); > cp =3D bp + rc; >=20 > if (need_nl) { > @@ -1302,9 +1311,9 @@ xo_create_to_file (FILE *fp, xo_style_t=20 > * @xop XO handle to alter (or NULL for default handle) > */ > void > -xo_destroy (xo_handle_t *xop) > +xo_destroy (xo_handle_t *xop_arg) > { > - xop =3D xo_default(xop); > + xo_handle_t *xop =3D xo_default(xop_arg); >=20 > if (xop->xo_close && (xop->xo_flags & XOF_CLOSE_FP)) > xop->xo_close(xop->xo_opaque); > @@ -1315,7 +1324,7 @@ xo_destroy (xo_handle_t *xop) > xo_buf_cleanup(&xop->xo_predicate); > xo_buf_cleanup(&xop->xo_attrs); >=20 > - if (xop =3D=3D &xo_default_handle) { > + if (xop_arg =3D=3D NULL) { > bzero(&xo_default_handle, sizeof(&xo_default_handle)); > xo_default_inited =3D 0; > } else > @@ -1743,7 +1752,7 @@ xo_format_string_direct (xo_handle_t *xo > int need_enc, int have_enc) > { > int cols =3D 0; > - wchar_t wc; > + wchar_t wc =3D 0; > int ilen, olen, width; > int attr =3D (flags & XFF_ATTR); > const char *sp; >=20 > Modified: head/contrib/libxo/libxo/xoconfig.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/contrib/libxo/libxo/xoconfig.h Tue Nov 18 17:37:33 2014 = (r274671) > +++ head/contrib/libxo/libxo/xoconfig.h Tue Nov 18 18:03:40 2014 = (r274672) > @@ -158,7 +158,7 @@ > #define PACKAGE_NAME "libxo" >=20 > /* Define to the full name and version of this package. */ > -#define PACKAGE_STRING "libxo 0.1.5" > +#define PACKAGE_STRING "libxo 0.1.6" >=20 > /* Define to the one symbol short name of this package. */ > #define PACKAGE_TARNAME "libxo" > @@ -167,7 +167,7 @@ > #define PACKAGE_URL "" >=20 > /* Define to the version of this package. */ > -#define PACKAGE_VERSION "0.1.5" > +#define PACKAGE_VERSION "0.1.6" >=20 > /* If using the C implementation of alloca, define if you know the > direction of stack growth for your system; otherwise it will be > @@ -181,7 +181,7 @@ > #define STDC_HEADERS 1 >=20 > /* Version number of package */ > -#define VERSION "0.1.5" > +#define VERSION "0.1.6" >=20 > /* Define to `__inline__' or `__inline' if that's what the C compiler > calls it, or to nothing if 'inline' is not supported under any = name. */ >=20 > Modified: head/contrib/libxo/libxo/xoversion.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/contrib/libxo/libxo/xoversion.h Tue Nov 18 17:37:33 2014 = (r274671) > +++ head/contrib/libxo/libxo/xoversion.h Tue Nov 18 18:03:40 2014 = (r274672) > @@ -18,17 +18,17 @@ > /** > * The version string > */ > -#define LIBXO_VERSION "0.1.5" > +#define LIBXO_VERSION "0.1.6" >=20 > /** > * The version number > */ > -#define LIBXO_VERSION_NUMBER 1004 > +#define LIBXO_VERSION_NUMBER 1006 >=20 > /** > * The version number as a string > */ > -#define LIBXO_VERSION_STRING "1004" > +#define LIBXO_VERSION_STRING "1006" >=20 > /** > * The version number extra info as a string >=20 > Modified: head/contrib/libxo/xolint/xolint.pl > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/contrib/libxo/xolint/xolint.pl Tue Nov 18 17:37:33 2014 = (r274671) > +++ head/contrib/libxo/xolint/xolint.pl Tue Nov 18 18:03:40 2014 = (r274672) > @@ -28,6 +28,19 @@ sub main { > extract_samples() if /^-X/; > } >=20 > + if ($#ARGV < 0) { > + print STDERR "xolint [options] files ...\n"; > + print STDERR " -c invoke 'cpp' on input\n"; > + print STDERR " -C flags Pass flags to cpp\n"; > + print STDERR " -d Show debug output\n"; > + print STDERR " -D Extract xolint documentation\n"; > + print STDERR " -I Print xo_info_t data\n"; > + print STDERR " -p Print input data on errors\n"; > + print STDERR " -V Print vocabulary (list of tags)\n"; > + print STDERR " -X Print examples of invalid use\n"; > + exit(1); > + } > + > for $file (@ARGV) { > parse_file($file); > } > @@ -269,9 +282,9 @@ sub check_format { > $last =3D $prev; > next; > } > + $prev =3D $ch; > } >=20 > - $prev =3D $ch; > $build[$phase] .=3D $ch; > } >=20 > @@ -346,18 +359,6 @@ sub check_field { > info("potential missing slash after N, L, or T with format") > if $field[1] =3D~ /%/; >=20 > - #@ Format cannot be given when content is present (roles: DNLT) > - #@ xo_emit("{T:Max/%6.6s}", "Max"); > - #@ Fields with the D, N, L, or T roles can't have both > - #@ static literal content ("{T:Title}") and a > - #@ format ("{T:/%s}"). > - #@ This error will also occur when the content has a backslash > - #@ in it, like "{N:Type of I/O}"; backslashes should be escaped, > - #@ like "{N:Type of I\\/O}". Note the double backslash, one for > - #@ handling 'C' strings, and one for libxo. > - error("format cannot be given when content is present") > - if $field[1] && $field[2]; > - > #@ An encoding format cannot be given (roles: DNLT) > #@ xo_emit("{T:Max//%s}", "Max"); > #@ Fields with the D, N, L, and T roles are not emitted in > @@ -367,6 +368,21 @@ sub check_field { > if $field[3]; > } >=20 > + # Field is a decoration, label, or title > + if ($field[0] =3D~ /DLN/) { > + #@ Format cannot be given when content is present (roles: DLN) > + #@ xo_emit("{N:Max/%6.6s}", "Max"); > + #@ Fields with the D, L, or N roles can't have both > + #@ static literal content ("{L:Label}") and a > + #@ format ("{L:/%s}"). > + #@ This error will also occur when the content has a backslash > + #@ in it, like "{N:Type of I/O}"; backslashes should be escaped, > + #@ like "{N:Type of I\\/O}". Note the double backslash, one for > + #@ handling 'C' strings, and one for libxo. > + error("format cannot be given when content is present") > + if $field[1] && $field[2]; > + } > + > # A value field > if (length($field[0]) =3D=3D 0 || $field[0] =3D~ /V/) { >=20 > @@ -527,7 +543,7 @@ sub check_field_format { > #@ for non-strings. This error may occur from a typo, > #@ like "{:tag/%6..6d}" where only one period should be used. > error("max width only valid for strings") > - if $#chunks >=3D 2 && $fc =3D~ /[sS]/; > + if $#chunks >=3D 2 && $fc !~ /[sS]/; > } >=20 > sub error { >=20 From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 07:44:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6F9BEEA; Wed, 19 Nov 2014 07:44:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93623C85; Wed, 19 Nov 2014 07:44:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJ7iMMW067140; Wed, 19 Nov 2014 07:44:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJ7iM12067139; Wed, 19 Nov 2014 07:44:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411190744.sAJ7iM12067139@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Nov 2014 07:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274697 - head/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 07:44:22 -0000 Author: dim Date: Wed Nov 19 07:44:21 2014 New Revision: 274697 URL: https://svnweb.freebsd.org/changeset/base/274697 Log: Fix the following -Werror warning from clang 3.5.0, while building cddl/lib/libctf: In file included from cddl/contrib/opensolaris/common/ctf/ctf_create.c:31: In file included from sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h:34: sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h:334:9: warning: '_ILP32' macro redefined [-Wmacro-redefined] #define _ILP32 ^ :26:9: note: previous definition is here #define _ILP32 1 ^ 1 warning generated. This is because clang 3.5.0 started predefining _ILP32 and __ILP32__ for the i386 arch. (Earlier versions already predefined _LP64 and __LP64__ for the x86_64 arch.) Reviewed by: emaste, avg, smh, delphij, markj Differential Revision: https://reviews.freebsd.org/D1187 Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Wed Nov 19 07:24:43 2014 (r274696) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Wed Nov 19 07:44:21 2014 (r274697) @@ -331,7 +331,9 @@ extern "C" { /* * Define the appropriate "implementation choices". */ +#if !defined(_ILP32) #define _ILP32 +#endif #if !defined(_I32LPx) && defined(_KERNEL) #define _I32LPx #endif From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 07:47:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EBF218F; Wed, 19 Nov 2014 07:47:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B4B8CB4; Wed, 19 Nov 2014 07:47:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJ7lbmE067634; Wed, 19 Nov 2014 07:47:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJ7lbwx067633; Wed, 19 Nov 2014 07:47:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411190747.sAJ7lbwx067633@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Nov 2014 07:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274698 - head/sys/contrib/ngatm/netnatm/saal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 07:47:38 -0000 Author: dim Date: Wed Nov 19 07:47:37 2014 New Revision: 274698 URL: https://svnweb.freebsd.org/changeset/base/274698 Log: Fix the following -Werror warning from clang 3.5.0, while building lib/libngatm: sys/contrib/ngatm/netnatm/saal/saal_sscop.c:4030:32: error: 'break' is bound to current loop, GCC binds it to the enclosing loop [-Werror,-Wgcc-compat] } while(sn < sscop->vr_h && !QFIND(&sscop->rbuf, sn)); ^ sys/contrib/ngatm/netnatm/saal/saal_sscop.c:173:4: note: expanded from macro 'QFIND' break; \ ^ 1 error generated. The idea is to remove any ambiguity by replacing the macro with an equivalent static inline function. Reviewed by: emaste, rpaulo See also: http://reviews.llvm.org/D2518 Differential Revision: https://reviews.freebsd.org/D1188 Modified: head/sys/contrib/ngatm/netnatm/saal/saal_sscop.c Modified: head/sys/contrib/ngatm/netnatm/saal/saal_sscop.c ============================================================================== --- head/sys/contrib/ngatm/netnatm/saal/saal_sscop.c Wed Nov 19 07:44:21 2014 (r274697) +++ head/sys/contrib/ngatm/netnatm/saal/saal_sscop.c Wed Nov 19 07:47:37 2014 (r274698) @@ -163,18 +163,17 @@ static void sscop_set_state(struct sscop } \ } while(0) - -#define QFIND(Q,RN) \ - ({ \ - struct sscop_msg *_msg = NULL, *_m; \ - MSGQ_FOREACH(_m, (Q)) { \ - if(_m->seqno == (RN)) { \ - _msg = _m; \ - break; \ - } \ - } \ - _msg; \ - }) +static inline struct sscop_msg *QFIND(sscop_msgq_head_t *q, u_int rn) +{ + struct sscop_msg *msg = NULL, *m; + MSGQ_FOREACH(m, q) { + if(m->seqno == rn) { + msg = m; + break; + } + } + return msg; +} #define QINSERT(Q,M) \ do { \ From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 08:59:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAA4248A; Wed, 19 Nov 2014 08:59:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C78A8627; Wed, 19 Nov 2014 08:59:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJ8xnGA000548; Wed, 19 Nov 2014 08:59:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJ8xn0Q000547; Wed, 19 Nov 2014 08:59:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411190859.sAJ8xn0Q000547@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 19 Nov 2014 08:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274703 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 08:59:50 -0000 Author: trasz Date: Wed Nov 19 08:59:49 2014 New Revision: 274703 URL: https://svnweb.freebsd.org/changeset/base/274703 Log: Fix typo. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Nov 19 08:56:38 2014 (r274702) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Nov 19 08:59:49 2014 (r274703) @@ -1982,7 +1982,7 @@ cfiscsi_ioctl_port_create(struct ctl_req if (ct->ct_state == CFISCSI_TARGET_STATE_ACTIVE) { req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), - "target \"%s\" already exist", target); + "target \"%s\" already exists", target); cfiscsi_target_release(ct); ctl_free_opts(&opts); return; From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 11:05:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6651D763; Wed, 19 Nov 2014 11:05:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53166627; Wed, 19 Nov 2014 11:05:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJB5kOS060273; Wed, 19 Nov 2014 11:05:46 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJB5kDw060272; Wed, 19 Nov 2014 11:05:46 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411191105.sAJB5kDw060272@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 19 Nov 2014 11:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274707 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 11:05:46 -0000 Author: dchagin Date: Wed Nov 19 11:05:45 2014 New Revision: 274707 URL: https://svnweb.freebsd.org/changeset/base/274707 Log: Revert r274635 as it's completely wrong. The parent of a pci dev device is a pciX device which do not implement the PCIB_POWER_FOR_SLEEP method from pcib_if.m. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Nov 19 10:25:08 2014 (r274706) +++ head/sys/dev/pci/pci.c Wed Nov 19 11:05:45 2014 (r274707) @@ -3637,6 +3637,7 @@ static void pci_set_power_child(device_t dev, device_t child, int state) { struct pci_devinfo *dinfo; + device_t pcib; int dstate; /* @@ -3646,10 +3647,11 @@ pci_set_power_child(device_t dev, device * device power. Skip children who aren't attached since they * are handled separately. */ + pcib = device_get_parent(dev); dinfo = device_get_ivars(child); dstate = state; if (device_is_attached(child) && - PCIB_POWER_FOR_SLEEP(dev, child, &dstate) == 0) + PCIB_POWER_FOR_SLEEP(pcib, child, &dstate) == 0) pci_set_powerstate(child, dstate); } From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 11:18:21 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C6B4B17; Wed, 19 Nov 2014 11:18:21 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 70BAE789; Wed, 19 Nov 2014 11:18:19 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA22048; Wed, 19 Nov 2014 13:20:10 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Xr3H7-0004dr-B2; Wed, 19 Nov 2014 13:18:17 +0200 Message-ID: <546C7C41.70407@FreeBSD.org> Date: Wed, 19 Nov 2014 13:17:21 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Chagin Dmitry , Adrian Chadd Subject: Re: svn commit: r274635 - head/sys/dev/pci References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> <20141118064626.GA956@dchagin.static.corbina.net> <20141118192952.GA945@dchagin.static.corbina.net> In-Reply-To: <20141118192952.GA945@dchagin.static.corbina.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 11:18:21 -0000 On 18/11/2014 21:29, Chagin Dmitry wrote: > it seems that at resume path METHOD set_powerstate() is not invoked. fro proper pciX. > ie, no "Transition from D3 to D0" prints. i'm trying to understand the reason Just a note that I see this as well. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 13:04:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B923D27; Wed, 19 Nov 2014 13:04:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68666308; Wed, 19 Nov 2014 13:04:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJD4Q5t079881; Wed, 19 Nov 2014 13:04:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJD4PrW079879; Wed, 19 Nov 2014 13:04:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411191304.sAJD4PrW079879@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 19 Nov 2014 13:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274708 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 13:04:26 -0000 Author: mav Date: Wed Nov 19 13:04:25 2014 New Revision: 274708 URL: https://svnweb.freebsd.org/changeset/base/274708 Log: Fix build without INVARIANTS, broken by r274675. Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Wed Nov 19 11:05:45 2014 (r274707) +++ head/sys/dev/isp/isp_freebsd.c Wed Nov 19 13:04:25 2014 (r274708) @@ -2136,9 +2136,8 @@ static void isp_refire_putback_atio(void *arg) { union ccb *ccb = arg; - ispsoftc_t *isp = XS_ISP(ccb); - ISP_ASSERT_LOCKED(isp); + ISP_ASSERT_LOCKED((ispsoftc_t *)XS_ISP(ccb)); isp_target_putback_atio(ccb); } Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Wed Nov 19 11:05:45 2014 (r274707) +++ head/sys/dev/isp/isp_freebsd.h Wed Nov 19 13:04:25 2014 (r274708) @@ -400,9 +400,9 @@ struct isposinfo { /* * Locking macros... */ -#define ISP_LOCK(isp) mtx_lock(&isp->isp_osinfo.lock) -#define ISP_UNLOCK(isp) mtx_unlock(&isp->isp_osinfo.lock) -#define ISP_ASSERT_LOCKED(isp) mtx_assert(&isp->isp_osinfo.lock, MA_OWNED) +#define ISP_LOCK(isp) mtx_lock(&(isp)->isp_osinfo.lock) +#define ISP_UNLOCK(isp) mtx_unlock(&(isp)->isp_osinfo.lock) +#define ISP_ASSERT_LOCKED(isp) mtx_assert(&(isp)->isp_osinfo.lock, MA_OWNED) /* * Required Macros/Defines From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 13:31:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75495593; Wed, 19 Nov 2014 13:31:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 623AB7B1; Wed, 19 Nov 2014 13:31:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJDV9oX092191; Wed, 19 Nov 2014 13:31:09 GMT (envelope-from eri@FreeBSD.org) Received: (from eri@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJDV9bH092190; Wed, 19 Nov 2014 13:31:09 GMT (envelope-from eri@FreeBSD.org) Message-Id: <201411191331.sAJDV9bH092190@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: eri set sender to eri@FreeBSD.org using -f From: Ermal Luçi Date: Wed, 19 Nov 2014 13:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274709 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 13:31:09 -0000 Author: eri Date: Wed Nov 19 13:31:08 2014 New Revision: 274709 URL: https://svnweb.freebsd.org/changeset/base/274709 Log: pf(4) needs to have a correct checksum during its processing. Calculate checksums for the IPv6 path when needed before delving into pf(4) code as required. PR: 172648, 179392 Reviewed by: glebius@ Approved by: gnn@ Obtained from: pfSense MFC after: 1 week Sponsored by: Netgate Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Wed Nov 19 13:04:25 2014 (r274708) +++ head/sys/netpfil/pf/pf_ioctl.c Wed Nov 19 13:31:08 2014 (r274709) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef INET6 @@ -3619,12 +3620,11 @@ pf_check6_out(void *arg, struct mbuf **m int chk; /* We need a proper CSUM before we start (s. OpenBSD ip_output) */ - if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { -#ifdef INET - /* XXX-BZ copy&paste error from r126261? */ - in_delayed_cksum(*m); -#endif - (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; + if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + in6_delayed_cksum(*m, + (*m)->m_pkthdr.len - sizeof(struct ip6_hdr), + sizeof(struct ip6_hdr)); + (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; } CURVNET_SET(ifp->if_vnet); chk = pf_test6(PF_OUT, ifp, m, inp); From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 13:57:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4723A92; Wed, 19 Nov 2014 13:57:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0E8EAA7; Wed, 19 Nov 2014 13:57:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJDveRd004237; Wed, 19 Nov 2014 13:57:40 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJDvexm004236; Wed, 19 Nov 2014 13:57:40 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201411191357.sAJDvexm004236@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Wed, 19 Nov 2014 13:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274710 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 13:57:40 -0000 Author: feld (ports committer) Date: Wed Nov 19 13:57:39 2014 New Revision: 274710 URL: https://svnweb.freebsd.org/changeset/base/274710 Log: Expose groups by default in ifconfig output. This was never hidden by OpenBSD; unsure why we chose to do so. As groups are a requirement for pf, exposing them by default will make our pf implementation less confusing. While here add a missing free() that OpenBSD fixed 7 years ago. PR: 194925 Differential Revision: https://reviews.freebsd.org/D1185 Approved by: des Obtained from: OpenBSD Modified: head/sbin/ifconfig/ifgroup.c Modified: head/sbin/ifconfig/ifgroup.c ============================================================================== --- head/sbin/ifconfig/ifgroup.c Wed Nov 19 13:31:08 2014 (r274709) +++ head/sbin/ifconfig/ifgroup.c Wed Nov 19 13:57:39 2014 (r274710) @@ -86,9 +86,6 @@ getifgroups(int s) struct ifgroupreq ifgr; struct ifg_req *ifg; - if (!verbose) - return; - memset(&ifgr, 0, sizeof(ifgr)); strlcpy(ifgr.ifgr_name, name, IFNAMSIZ); @@ -121,6 +118,8 @@ getifgroups(int s) } if (cnt) printf("\n"); + + free(ifgr.ifgr_groups); } static void From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 14:23:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DADF0569; Wed, 19 Nov 2014 14:23:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C796EDBD; Wed, 19 Nov 2014 14:23:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJENTpW017871; Wed, 19 Nov 2014 14:23:29 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJENTJ0017870; Wed, 19 Nov 2014 14:23:29 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201411191423.sAJENTJ0017870@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 19 Nov 2014 14:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274711 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 14:23:30 -0000 Author: zbb Date: Wed Nov 19 14:23:29 2014 New Revision: 274711 URL: https://svnweb.freebsd.org/changeset/base/274711 Log: Stop using early_putc immediately after configuring console with cninit() Early UART should be released right after system console initialization is completed. Otherwise, after cninit() both early and system console coexist what may lead to various issues (i.a. writing to unmapped early UART address). This cannot be done in cninit_finish() since it can be called late at the end of MI configuration. Obtained from: Semihalf Reviewed by: andrew Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_cons.c Modified: head/sys/kern/kern_cons.c ============================================================================== --- head/sys/kern/kern_cons.c Wed Nov 19 13:57:39 2014 (r274710) +++ head/sys/kern/kern_cons.c Wed Nov 19 14:23:29 2014 (r274711) @@ -156,6 +156,13 @@ cninit(void) * Make the best console the preferred console. */ cnselect(best_cn); + +#ifdef EARLY_PRINTF + /* + * Release early console. + */ + early_putc = NULL; +#endif } void From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 14:27:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 421A570A; Wed, 19 Nov 2014 14:27:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E9ADDF5; Wed, 19 Nov 2014 14:27:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJERdKf018425; Wed, 19 Nov 2014 14:27:39 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJERdmf018424; Wed, 19 Nov 2014 14:27:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411191427.sAJERdmf018424@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 19 Nov 2014 14:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274712 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 14:27:39 -0000 Author: glebius Date: Wed Nov 19 14:27:38 2014 New Revision: 274712 URL: https://svnweb.freebsd.org/changeset/base/274712 Log: Do not allocate zero-length mbuf in sosend_generic(). Found by: pho Sponsored by: Nginx, Inc. Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed Nov 19 14:23:29 2014 (r274711) +++ head/sys/kern/uipc_socket.c Wed Nov 19 14:27:38 2014 (r274712) @@ -1310,7 +1310,7 @@ restart: resid = 0; if (flags & MSG_EOR) top->m_flags |= M_EOR; - } else { + } else if (resid > 0) { /* * Copy the data from userland into a mbuf * chain. If no data is to be copied in, From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 14:49:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44B996EC; Wed, 19 Nov 2014 14:49:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25608A2; Wed, 19 Nov 2014 14:49:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJEnU40028695; Wed, 19 Nov 2014 14:49:30 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJEnTj7028693; Wed, 19 Nov 2014 14:49:29 GMT (envelope-from br@FreeBSD.org) Message-Id: <201411191449.sAJEnTj7028693@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 19 Nov 2014 14:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274714 - head/sys/dev/beri/virtio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 14:49:30 -0000 Author: br Date: Wed Nov 19 14:49:29 2014 New Revision: 274714 URL: https://svnweb.freebsd.org/changeset/base/274714 Log: Add BERI-specific virtio mmio "platform" device. This device provides a connector to Altera PIO allowing us to interrupt software-implemented virtio mmio backend. Sponsored by: DARPA, AFRL Added: head/sys/dev/beri/virtio/ head/sys/dev/beri/virtio/virtio_mmio_platform.c (contents, props changed) head/sys/dev/beri/virtio/virtio_mmio_platform.h (contents, props changed) Added: head/sys/dev/beri/virtio/virtio_mmio_platform.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/beri/virtio/virtio_mmio_platform.c Wed Nov 19 14:49:29 2014 (r274714) @@ -0,0 +1,227 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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. + */ + +/* + * BERI interface for Virtio MMIO bus. + * + * This driver provides interrupt-engine for software-implemented + * Virtio MMIO backend. + */ + +#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 "virtio_mmio_if.h" +#include "pio_if.h" + +static void platform_intr(void *arg); + +struct virtio_mmio_platform_softc { + struct resource *res[1]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + device_t dev; + void (*intr_handler)(void *); + void *ih_user; + device_t pio_recv; + device_t pio_send; +}; + +static int +setup_pio(struct virtio_mmio_platform_softc *sc, char *name, device_t *dev) +{ + phandle_t pio_node; + struct fdt_ic *ic; + phandle_t xref; + phandle_t node; + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + if (OF_searchencprop(node, name, &xref, + sizeof(xref)) == -1) { + return (ENXIO); + } + + pio_node = OF_node_from_xref(xref); + SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { + if (ic->iph == pio_node) { + *dev = ic->dev; + PIO_CONFIGURE(*dev, PIO_OUT_ALL, + PIO_UNMASK_ALL); + return (0); + } + } + + return (ENXIO); +} + +static int +virtio_mmio_platform_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "beri,virtio_mmio_platform")) + return (ENXIO); + + device_set_desc(dev, "Virtio MMIO platform"); + return (BUS_PROBE_DEFAULT); +} + +static int +virtio_mmio_platform_attach(device_t dev) +{ + struct virtio_mmio_platform_softc *sc; + struct fdt_ic *fic; + phandle_t node; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (setup_pio(sc, "pio-send", &sc->pio_send) != 0) + return (ENXIO); + if (setup_pio(sc, "pio-recv", &sc->pio_recv) != 0) + return (ENXIO); + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + fic = malloc(sizeof(*fic), M_DEVBUF, M_WAITOK|M_ZERO); + fic->iph = node; + fic->dev = dev; + SLIST_INSERT_HEAD(&fdt_ic_list_head, fic, fdt_ics); + + return (0); +} + +static int +platform_note(device_t dev, size_t offset) +{ + struct virtio_mmio_platform_softc *sc; + + sc = device_get_softc(dev); + + if (offset == VIRTIO_MMIO_QUEUE_NOTIFY) { + mips_dcache_wbinv_all(); + PIO_SET(sc->pio_send, Q_NOTIFY, 1); + } + + if (offset == VIRTIO_MMIO_QUEUE_PFN) { + mips_dcache_wbinv_all(); + PIO_SET(sc->pio_send, Q_PFN, 1); + } + + return (0); +} + +static void +platform_intr(void *arg) +{ + struct virtio_mmio_platform_softc *sc; + int reg; + + sc = arg; + + /* Read pending */ + reg = PIO_READ(sc->pio_recv); + + /* Ack */ + PIO_SET(sc->pio_recv, reg, 0); + + /* Writeback, invalidate cache */ + mips_dcache_wbinv_all(); + + if (sc->intr_handler != NULL) + sc->intr_handler(sc->ih_user); +} + +static int +platform_setup_intr(device_t dev, device_t mmio_dev, + void *intr_handler, void *ih_user) +{ + struct virtio_mmio_platform_softc *sc; + + sc = device_get_softc(dev); + + sc->intr_handler = intr_handler; + sc->ih_user = ih_user; + + PIO_SETUP_IRQ(sc->pio_recv, platform_intr, sc); + + return (0); +} + +static device_method_t virtio_mmio_platform_methods[] = { + DEVMETHOD(device_probe, virtio_mmio_platform_probe), + DEVMETHOD(device_attach, virtio_mmio_platform_attach), + + /* virtio_mmio_if.h */ + DEVMETHOD(virtio_mmio_note, platform_note), + DEVMETHOD(virtio_mmio_setup_intr, platform_setup_intr), + DEVMETHOD_END +}; + +static driver_t virtio_mmio_platform_driver = { + "virtio_mmio_platform", + virtio_mmio_platform_methods, + sizeof(struct virtio_mmio_platform_softc), +}; + +static devclass_t virtio_mmio_platform_devclass; + +DRIVER_MODULE(virtio_mmio_platform, simplebus, virtio_mmio_platform_driver, + virtio_mmio_platform_devclass, 0, 0); Added: head/sys/dev/beri/virtio/virtio_mmio_platform.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/beri/virtio/virtio_mmio_platform.h Wed Nov 19 14:49:29 2014 (r274714) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define Q_NOTIFY 0x1 +#define Q_PFN 0x2 +#define Q_INTR 0x4 From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 15:17:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DA11666; Wed, 19 Nov 2014 15:17:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A0845E2; Wed, 19 Nov 2014 15:17:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJFHKoL043519; Wed, 19 Nov 2014 15:17:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJFHKoB043518; Wed, 19 Nov 2014 15:17:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411191517.sAJFHKoB043518@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 19 Nov 2014 15:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274715 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 15:17:20 -0000 Author: glebius Date: Wed Nov 19 15:17:19 2014 New Revision: 274715 URL: https://svnweb.freebsd.org/changeset/base/274715 Log: In vnode_pager_generic_getpages() vp->v_mount is dereferenced in the beginning, thus can't be NULL. Sponsored by: Nginx, Inc. Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Wed Nov 19 14:49:29 2014 (r274714) +++ head/sys/vm/vnode_pager.c Wed Nov 19 15:17:19 2014 (r274715) @@ -714,7 +714,6 @@ vnode_pager_generic_getpages(struct vnod int runpg; int runend; struct buf *bp; - struct mount *mp; int count; int error; @@ -906,8 +905,7 @@ vnode_pager_generic_getpages(struct vnod * and map the pages to be read into the kva, if the filesystem * requires mapped buffers. */ - mp = vp->v_mount; - if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMAPPED_BUFS) != 0 && + if ((vp->v_mount->mnt_kern_flag & MNTK_UNMAPPED_BUFS) != 0 && unmapped_buf_allowed) { bp->b_data = unmapped_buf; bp->b_kvabase = unmapped_buf; @@ -955,7 +953,7 @@ vnode_pager_generic_getpages(struct vnod } if ((bp->b_flags & B_UNMAPPED) == 0) pmap_qremove(kva, count); - if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMAPPED_BUFS) != 0) { + if ((vp->v_mount->mnt_kern_flag & MNTK_UNMAPPED_BUFS) != 0) { bp->b_data = (caddr_t)kva; bp->b_kvabase = (caddr_t)kva; bp->b_flags &= ~B_UNMAPPED; From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 16:07:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDD888A5; Wed, 19 Nov 2014 16:07:46 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C48F8C31; Wed, 19 Nov 2014 16:07:46 +0000 (UTC) Received: from mbergt-sslvpn-nc.jnpr.net ([66.129.239.14]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id sAJG7cBe019992 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Nov 2014 08:07:39 -0800 (PST) (envelope-from marcel@xcllnt.net) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r274672 - in head/contrib/libxo: . libxo xolint From: Marcel Moolenaar In-Reply-To: <18F6425B-A767-426D-8EEF-57B7CFF3D54B@mu.org> Date: Wed, 19 Nov 2014 08:07:32 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <6491A081-35EB-4837-B025-2E4F92BD6623@xcllnt.net> References: <201411181803.sAII3fCg079794@svn.freebsd.org> <18F6425B-A767-426D-8EEF-57B7CFF3D54B@mu.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 16:07:47 -0000 > On Nov 18, 2014, at 10:04 PM, Alfred Perlstein wrote: >=20 > Marcel, is there a way to get libxo programs to emit time series data? = =20 >=20 > Any examples of this in the tree right now? >=20 > Example would be if "netstat -1" was libxo-ified, it would also emit a = timestamp. Patches for netstat can be found here: https://github.com/Juniper/libxo/blob/master/patches/netstat.patch Let me know if it contains the answer to your question. I should be able to commit netstat shortly. I want to make sure libxo is clean and the trivial programs like w and wc, which I already committed, have paved the way for more and more complex utilities. FYI, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 16:15:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EFDCDA9; Wed, 19 Nov 2014 16:15:14 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F185AD42; Wed, 19 Nov 2014 16:15:13 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id r20so9420024wiv.0 for ; Wed, 19 Nov 2014 08:15:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=pUoYl4Ho06IfU2sJ5olbDpxbeUarmcOpXpKYYe+e3Bo=; b=tyki2MTrO9IXdO8yY89nfNWLSlYphnOW0x3lKduDyqZdIeHsCtH809CeRPlvcZ8w/d jEQ/W1B1Qud/2cW8/WGtdWqMq2AhXgQutXoOE0qNLnghkDr00j3oItJ8aANckbD7keE4 qkMItvVmc3YNfq/5MxVis2+A4gO0R1O29QDT+TVlGRLa9krFKM0R3ixJhDG6otmL4sq+ waLdxcsmLzPf38kzyKYYvFifpBflZcQX54DTUARI/36hfV/AH5Au98U/nLSPbwcfuXWg ZAHI8/iccOBqycYfkY2HBPVEEWQaJ7I6MMcBHFTs4HaX+mLyrBdc5F/BDoG3A5oWwRjN qxug== MIME-Version: 1.0 X-Received: by 10.194.47.226 with SMTP id g2mr58648057wjn.68.1416413704055; Wed, 19 Nov 2014 08:15:04 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Wed, 19 Nov 2014 08:15:03 -0800 (PST) In-Reply-To: <546C7C41.70407@FreeBSD.org> References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> <20141118064626.GA956@dchagin.static.corbina.net> <20141118192952.GA945@dchagin.static.corbina.net> <546C7C41.70407@FreeBSD.org> Date: Wed, 19 Nov 2014 08:15:03 -0800 X-Google-Sender-Auth: ESR2b8r4EW9TfqKBzaZDKj1YRzA Message-ID: Subject: Re: svn commit: r274635 - head/sys/dev/pci From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin , Chagin Dmitry X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 16:15:14 -0000 On 19 November 2014 03:17, Andriy Gapon wrote: > On 18/11/2014 21:29, Chagin Dmitry wrote: >> it seems that at resume path METHOD set_powerstate() is not invoked. fro proper pciX. >> ie, no "Transition from D3 to D0" prints. i'm trying to understand the reason > > Just a note that I see this as well. Before or after Dmitry's patch? -adrian From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 16:16:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A77C3F39; Wed, 19 Nov 2014 16:16:45 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 7A61219B6; Wed, 19 Nov 2014 16:16:44 +0000 (UTC) Message-ID: <546CC245.3070700@FreeBSD.org> Date: Wed, 19 Nov 2014 19:16:05 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd References: <201411181706.sAIH6eS9051888@svn.freebsd.org> In-Reply-To: <201411181706.sAIH6eS9051888@svn.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mJD2FBaJ7rG4QxWIVCVbO9iknWmB85XSn" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 16:16:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mJD2FBaJ7rG4QxWIVCVbO9iknWmB85XSn Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 18.11.2014 20:06, Warner Losh wrote: > Author: imp > Date: Tue Nov 18 17:06:40 2014 > New Revision: 274661 > URL: https://svnweb.freebsd.org/changeset/base/274661 >=20 > Log: > Implement the historic DIOCGDINFO ioctl for gpart on BSD > partitions. Several utilities still use this interface and require > additional information since gpart was activated than before. This > allows fsck of a UFS partition without having to specify it is UFS, > per historic behavior. > + */ > +static int > +g_part_bsd_ioctl(struct g_part_table *basetable, struct g_provider *pp= , > + u_long cmd, void *data, int fflag, struct thread *td) > +{ > + > + switch (cmd) > + { > + case DIOCGDINFO: > + { > + struct g_part_bsd_table *table; > + u_char *p; > + > + table =3D (struct g_part_bsd_table *)basetable; > + p =3D table->bbarea + pp->sectorsize; > + return (bsd_disklabel_le_dec(p, data, MAXPARTITIONS)); Probably you need to use basetable->gpt_entries here instead of MAXPARTITIONS. --=20 WBR, Andrey V. Elsukov --mJD2FBaJ7rG4QxWIVCVbO9iknWmB85XSn 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJUbMJMAAoJEAHF6gQQyKF6bsQH/1FFOt+OU1co7aLKZjmpuSun x/mP9SBWw6aCooxn50txoFUKi7KqczgwjB/7+stmkm7LPRfzLYY9nQvrAWjwpp/l 4gcSW+KscQZTliruiH9PeBdy2OZONX82emoXqAM8fiYqPWJG4bfPn4txFDwvMUD1 MC5lZtaUd5lDaKtwY8qher151Z10WDmLwNOGB7/oelv37k9UuwSWGnKecetirjw7 uRDEzMjbBDLaMgDAMnrfWmrkun3x99DPlF8T+pwqeb2kNLPE4tD2l7lRLBDL6a5j VtcGmeng45EHtMwGSu0BemU7zmTkvh++Vov9lkHZR0YK8fruWWyWAJLBgg+uexc= =HGO7 -----END PGP SIGNATURE----- --mJD2FBaJ7rG4QxWIVCVbO9iknWmB85XSn-- From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 16:20:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F03283AF for ; Wed, 19 Nov 2014 16:20:29 +0000 (UTC) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB00ADA7 for ; Wed, 19 Nov 2014 16:20:29 +0000 (UTC) Received: by mail-pa0-f41.google.com with SMTP id rd3so551780pab.0 for ; Wed, 19 Nov 2014 08:20:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=h5IpmmFAc+yGJAbWOnlwdwRLNn5o/hjmkGFiLpFCoIQ=; b=BRZubbdAY/ofMsuD+msU4ZFNVKEePmz3qT4R3p/KZkdnHYXzIUOyuqIgm8yXFZHvVE LCFu1L00dQuwO+isFmwSbdYo0g4qcQft19S8ue5ogFCLO0Qp1aS6q6giqytuYeNO2aMU vmoLUyBe5y4lVFHYPFEIh+Jrq2i/yAUPBeKXc/aEyN4pLgKcGy7p3WtB6dnqK2P4v7it yV5JwgYVoPnRSX+zoBf26Jc5FgwNPbL1OLxHDymIFs1x6btYnQKLPQrYxoAwFQ1rhRhg GjakWQ0EmtvpBvzRQN2TyH6HAcfunFJC2HbvOI6vuHEh3dPgS493uf0Ayc8gL9CclJJu 3k7Q== X-Gm-Message-State: ALoCoQlMPOkN+uMk1ukVjmycnjkpWTXUOnaSHeM1u2UYgztZVp0DboVzCI5/wz1YGip0m/E3PNM/ X-Received: by 10.68.98.196 with SMTP id ek4mr21982933pbb.150.1416414028674; Wed, 19 Nov 2014 08:20:28 -0800 (PST) Received: from [10.64.24.117] ([69.53.236.236]) by mx.google.com with ESMTPSA id q1sm2194905pdq.67.2014.11.19.08.20.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 08:20:28 -0800 (PST) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_5C7C2E36-A9DA-4759-B579-0E76A4E000EF"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd From: Warner Losh In-Reply-To: <546CC245.3070700@FreeBSD.org> Date: Wed, 19 Nov 2014 09:20:24 -0700 Message-Id: References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 16:20:30 -0000 --Apple-Mail=_5C7C2E36-A9DA-4759-B579-0E76A4E000EF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 19, 2014, at 9:16 AM, Andrey V. Elsukov wrote: > On 18.11.2014 20:06, Warner Losh wrote: >> Author: imp >> Date: Tue Nov 18 17:06:40 2014 >> New Revision: 274661 >> URL: https://svnweb.freebsd.org/changeset/base/274661 >>=20 >> Log: >> Implement the historic DIOCGDINFO ioctl for gpart on BSD >> partitions. Several utilities still use this interface and require >> additional information since gpart was activated than before. This >> allows fsck of a UFS partition without having to specify it is UFS, >> per historic behavior. >=20 >> + */ >> +static int >> +g_part_bsd_ioctl(struct g_part_table *basetable, struct g_provider = *pp, >> + u_long cmd, void *data, int fflag, struct thread *td) >> +{ >> + >> + switch (cmd) >> + { >> + case DIOCGDINFO: >> + { >> + struct g_part_bsd_table *table; >> + u_char *p; >> + >> + table =3D (struct g_part_bsd_table *)basetable; >> + p =3D table->bbarea + pp->sectorsize; >> + return (bsd_disklabel_le_dec(p, data, MAXPARTITIONS)); >=20 > Probably you need to use basetable->gpt_entries here instead of > MAXPARTITIONS. I=92m having trouble connecting the dots between GPT and BSDlabels. Why = would this field be relevant? Is it just poorly named? MAXPARTITIONS is = the number of partitions we support. It=92s always a constant. While = there are other BSD label formats that have differing numbers, I don=92t = think gpart supports those. But as always, I=92m always on the lookout = for code improvements. Warner --Apple-Mail=_5C7C2E36-A9DA-4759-B579-0E76A4E000EF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUbMNIAAoJEGwc0Sh9sBEAw+oP/2h9WDBUPHiDd4GL8RrgXFkk 9elPy5nHAiYzsHe/56pzUGCMTBpCLKkgZn5ilgmhGeGs5jNPCbhCZjir1vJ6Wtmi 189+DqrUUFTqLcxW9KoL5guGZsXwEc5xl9WkG7TyPf7pkXg7LVVcVHsBcXiWM5RO upwHnAaOj+I72NhP0OFifSTxXObqpMDHK7OY8ddYRiYCEOwAdE8Kzk72rif7sADy 3Z64V4yweoouVkAZTGNlI9Zh/KE88H2aUB6xy/rzAJPuEVs0sA+Soh+SjVhRrOC3 TpievCULrQ3fyv5PutIqOFMgdiH8TMCDCnTZ4smxn1X32covzRXZCPNBYOQBfPcK U+exl6kVe7bKIg4Jla1HkcOcmFXHN0hYsPxtcR6OX4tQTlZ9F9m8Y5VAKYZ5Z4UE F8Vt7UIAzW6QCzWvQZT1yfvNzLPYhI2NRaSc6Ln/CS1YHo2HpSEmHWB/nLrQvWwD tgWQ4fS4LrtZYY05C9KPvnJkxPTYyjv/VF8ER5vtGzILbOmZSuAjefLIV1dbdF53 vUeQVdc0jI65ZhhBO7dfTh8IPqJT7U9VMt9EW8fCZH+IeZvFHfOf/ZQ0RuB0NyEQ cPfJwwfsrgQyK+qPxS+3wjQVlsgujTxCEwwTA5NiiY//4Xdl7WvyAi8kYVtTI/Eg adiIs5Bc+2WtYT67GIxQ =nVij -----END PGP SIGNATURE----- --Apple-Mail=_5C7C2E36-A9DA-4759-B579-0E76A4E000EF-- From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 16:23:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6AAFC59E; Wed, 19 Nov 2014 16:23:26 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 03CF321EC; Wed, 19 Nov 2014 16:23:24 +0000 (UTC) Message-ID: <546CC3D7.9010500@FreeBSD.org> Date: Wed, 19 Nov 2014 19:22:47 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BwRpQjkjEfgrDvTrebGur2A72qoHhR3Sh" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 16:23:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BwRpQjkjEfgrDvTrebGur2A72qoHhR3Sh Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 19.11.2014 19:20, Warner Losh wrote: >> Probably you need to use basetable->gpt_entries here instead of=20 >> MAXPARTITIONS. >=20 > I=92m having trouble connecting the dots between GPT and BSDlabels. Why= > would this field be relevant? Is it just poorly named? MAXPARTITIONS > is the number of partitions we support. It=92s always a constant. While= > there are other BSD label formats that have differing numbers, I > don=92t think gpart supports those. But as always, I=92m always on the > lookout for code improvements. BSD label supports up to 20 partitons. You can specify different number with `gpart create -n 20 -s bsd`. For such labels your code will return EINVAL. --=20 WBR, Andrey V. Elsukov --BwRpQjkjEfgrDvTrebGur2A72qoHhR3Sh 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJUbMPdAAoJEAHF6gQQyKF6uhgH/13V/kRtZ84NhK0+F/lL+WAj FlxmDOEtJuRwLLeOgM1NmtJ/UPl4F/8CdGGqQj/G2R9oUF/z/hNV0AqAkKlK3O+c Mt9/ITWSYbompBS1KgE51dQDGIqKmFCVDsI2I0GoxeGQvkcHHAChHfW1Fg9DG5pg EgXlh44EPuzZ65R6HdpfB2TyK37JKQSfjMwJqRNyzYxULLzcyvelr2v49SHSbI8q mqUfjHwInHueLpj5vdQin7wJR+xFbkqanKxdebUYx85aZ5m+qAJQR4cOTQvYvcxQ SwzGJ4krV3CLbwRWv16vyiS7rcA3oJSLHCBjlQCxlV+OXayXWxzJaKiq1G4Fr9o= =fsM9 -----END PGP SIGNATURE----- --BwRpQjkjEfgrDvTrebGur2A72qoHhR3Sh-- From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 16:29:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1293846; Wed, 19 Nov 2014 16:29:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD843EA7; Wed, 19 Nov 2014 16:29:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJGTdIe076961; Wed, 19 Nov 2014 16:29:39 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJGTdF5076960; Wed, 19 Nov 2014 16:29:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411191629.sAJGTdF5076960@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 19 Nov 2014 16:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274718 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 16:29:40 -0000 Author: glebius Date: Wed Nov 19 16:29:39 2014 New Revision: 274718 URL: https://svnweb.freebsd.org/changeset/base/274718 Log: Use __func__ in KASSERTs, since the code is about to be moved to other place. Sponsored by: Nginx, Inc. Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Wed Nov 19 16:23:57 2014 (r274717) +++ head/sys/vm/vnode_pager.c Wed Nov 19 16:29:39 2014 (r274718) @@ -981,11 +981,9 @@ vnode_pager_generic_getpages(struct vnod */ mt->valid = VM_PAGE_BITS_ALL; KASSERT(mt->dirty == 0, - ("vnode_pager_generic_getpages: page %p is dirty", - mt)); + ("%s: page %p is dirty", __func__, mt)); KASSERT(!pmap_page_is_mapped(mt), - ("vnode_pager_generic_getpages: page %p is mapped", - mt)); + ("%s: page %p is mapped", __func__, mt)); } else { /* * Read did not fill up entire page. @@ -998,8 +996,7 @@ vnode_pager_generic_getpages(struct vnod object->un_pager.vnp.vnp_size - tfoff); KASSERT((mt->dirty & vm_page_bits(0, object->un_pager.vnp.vnp_size - tfoff)) == 0, - ("vnode_pager_generic_getpages: page %p is dirty", - mt)); + ("%s: page %p is dirty", __func__, mt)); } if (i != reqpage) From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 16:54:47 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8810FD6; Wed, 19 Nov 2014 16:54:47 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0961C207; Wed, 19 Nov 2014 16:54:45 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA27953; Wed, 19 Nov 2014 18:56:36 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Xr8Wh-0004xh-2t; Wed, 19 Nov 2014 18:54:43 +0200 Message-ID: <546CCB1A.6060709@FreeBSD.org> Date: Wed, 19 Nov 2014 18:53:46 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r274635 - head/sys/dev/pci References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> <20141118064626.GA956@dchagin.static.corbina.net> <20141118192952.GA945@dchagin.static.corbina.net> <546C7C41.70407@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin , Chagin Dmitry X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 16:54:47 -0000 On 19/11/2014 18:15, Adrian Chadd wrote: > On 19 November 2014 03:17, Andriy Gapon wrote: >> On 18/11/2014 21:29, Chagin Dmitry wrote: >>> it seems that at resume path METHOD set_powerstate() is not invoked. fro proper pciX. >>> ie, no "Transition from D3 to D0" prints. i'm trying to understand the reason >> >> Just a note that I see this as well. > > Before or after Dmitry's patch? Before. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 17:46:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 316CCF8F; Wed, 19 Nov 2014 17:46:12 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C686BA04; Wed, 19 Nov 2014 17:46:11 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id b13so1427760wgh.32 for ; Wed, 19 Nov 2014 09:46:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Duosi85SQ00EzxR5t8bd4kLRnl35bAnDDPTX37zApRI=; b=dpiHwuML6fHCGuxR8G/8c0/02LGkKXAJ2X6SUBTEeuWDjLTGyxQzOWM7GmRtLBJc5g hK6L71uHKIefLYo7l2pqofpXAIlFlIFnGqHcAtXFMVr9urQIrVT5bUZ/1NZwpPIsAAWo t1Oz+3d1kbvQkI1prIAHZ08m84KucGAWWd16j8HIULgLskT5RBIEcKumnx3RoYYOf/nL 91AKR6BUjARItSTdG8DcJV8zfBnya7ppamBwm+rqq0P7IqR39yoHicTvb61HFsr164pw cm5mRgZdUb4nnb3M4vNO60Z5xAQgNUvYkqGRdGE/mlEuVbUgLt9TCnj64qzgA/gf69eg NMPg== MIME-Version: 1.0 X-Received: by 10.181.8.72 with SMTP id di8mr39965197wid.1.1416419170105; Wed, 19 Nov 2014 09:46:10 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Wed, 19 Nov 2014 09:46:10 -0800 (PST) In-Reply-To: <546CCB1A.6060709@FreeBSD.org> References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> <20141118064626.GA956@dchagin.static.corbina.net> <20141118192952.GA945@dchagin.static.corbina.net> <546C7C41.70407@FreeBSD.org> <546CCB1A.6060709@FreeBSD.org> Date: Wed, 19 Nov 2014 09:46:10 -0800 X-Google-Sender-Auth: fQuiMpfhUHzHcegfGvPo3OWc4SM Message-ID: Subject: Re: svn commit: r274635 - head/sys/dev/pci From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin , Chagin Dmitry X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 17:46:12 -0000 On 19 November 2014 08:53, Andriy Gapon wrote: > On 19/11/2014 18:15, Adrian Chadd wrote: >> On 19 November 2014 03:17, Andriy Gapon wrote: >>> On 18/11/2014 21:29, Chagin Dmitry wrote: >>>> it seems that at resume path METHOD set_powerstate() is not invoked. fro proper pciX. >>>> ie, no "Transition from D3 to D0" prints. i'm trying to understand the reason >>> >>> Just a note that I see this as well. >> >> Before or after Dmitry's patch? > > Before. Ok. I'll revert his patch today and then we can dig into why the resume device list isn't matching the suspend device list. Thanks for helping me dig into all of this ! -adrian From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 18:01:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8531E5FF; Wed, 19 Nov 2014 18:01:07 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 1267B2EA6; Wed, 19 Nov 2014 18:01:05 +0000 (UTC) Message-ID: <546CDABC.9020103@FreeBSD.org> Date: Wed, 19 Nov 2014 21:00:28 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2MRhxSTs6fuE0J71uTBCFThaoiDkfcwwH" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 18:01:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2MRhxSTs6fuE0J71uTBCFThaoiDkfcwwH Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 19.11.2014 19:20, Warner Losh wrote: >> Probably you need to use basetable->gpt_entries here instead of=20 >> MAXPARTITIONS. >=20 > I=92m having trouble connecting the dots between GPT and BSDlabels. Why= > would this field be relevant? Is it just poorly named? MAXPARTITIONS gpt_entries isn't related to GPT, it is `geom partition table's` number of partitions entries. Each instance of partition table (i.e. geom) can have own number of partitions. MBR always has 4, but GPT or BSD can have different numbers. --=20 WBR, Andrey V. Elsukov --2MRhxSTs6fuE0J71uTBCFThaoiDkfcwwH 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJUbNrCAAoJEAHF6gQQyKF6d4kH+wdqNndXCBn8e75YMBCjawcF XOmzEQAdnQz+P6jPOwV9Yjq4BQb8LVeLvW7qtqBTUo/T+eRfTFBTsHs2msXpu2n7 On+B0mhct0I3ZNn1qYPqC5tNy+Fu5WuPIy3sAqz4QWbFOGXYG85/9Dcu1qRBrdlc BC7NOpHEtslXyeRFszDe6n0OQEvLPyGt/mITk5Wvn1F+XYJ2T21YsvuRDOBGP7tj +NP7Or3ZFivOuXe7bSIItlYLhrhUDExNygRpr5JKdQGBWUPxwgXWTKNfoLVqGjD4 tsBvll1EZ0nFCHLooimC6WmGhPCmfK79luEEMGbYdqIpLpv+i07+DP7Wn5Xd4wQ= =df1b -----END PGP SIGNATURE----- --2MRhxSTs6fuE0J71uTBCFThaoiDkfcwwH-- From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 18:18:35 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 167DEE69; Wed, 19 Nov 2014 18:18:35 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6A69BD68; Wed, 19 Nov 2014 18:18:33 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA29045; Wed, 19 Nov 2014 20:20:24 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Xr9pn-00052U-Fs; Wed, 19 Nov 2014 20:18:31 +0200 Message-ID: <546CDEBE.1010608@FreeBSD.org> Date: Wed, 19 Nov 2014 20:17:34 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r274635 - head/sys/dev/pci References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> <20141118064626.GA956@dchagin.static.corbina.net> <20141118192952.GA945@dchagin.static.corbina.net> <546C7C41.70407@FreeBSD.org> <546CCB1A.6060709@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin , Chagin Dmitry X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 18:18:35 -0000 On 19/11/2014 19:46, Adrian Chadd wrote: > On 19 November 2014 08:53, Andriy Gapon wrote: >> On 19/11/2014 18:15, Adrian Chadd wrote: >>> On 19 November 2014 03:17, Andriy Gapon wrote: >>>> On 18/11/2014 21:29, Chagin Dmitry wrote: >>>>> it seems that at resume path METHOD set_powerstate() is not invoked. fro proper pciX. >>>>> ie, no "Transition from D3 to D0" prints. i'm trying to understand the reason >>>> >>>> Just a note that I see this as well. >>> >>> Before or after Dmitry's patch? >> >> Before. > > Ok. > > I'll revert his patch today and then we can dig into why the resume > device list isn't matching the suspend device list. > > Thanks for helping me dig into all of this ! Hasn't it already been reverted? r274707 -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 18:19:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 012ABFB2; Wed, 19 Nov 2014 18:19:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E18D6D71; Wed, 19 Nov 2014 18:19:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJIJMK6029187; Wed, 19 Nov 2014 18:19:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJIJMcn029184; Wed, 19 Nov 2014 18:19:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411191819.sAJIJMcn029184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 19 Nov 2014 18:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274720 - in head: usr.bin/man usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 18:19:23 -0000 Author: trasz Date: Wed Nov 19 18:19:21 2014 New Revision: 274720 URL: https://svnweb.freebsd.org/changeset/base/274720 Log: Fix improper .Fx macro usage. Differential Revision: https://reviews.freebsd.org/D1158 Reviewed by: wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/man/man.1 head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Wed Nov 19 16:33:07 2014 (r274719) +++ head/usr.bin/man/man.1 Wed Nov 19 18:19:21 2014 (r274720) @@ -61,23 +61,32 @@ restricts the search to the specific sec The sections of the manual are: .Bl -enum -offset indent -compact .It -.Fx General Commands Manual +.Fx +General Commands Manual .It -.Fx System Calls Manual +.Fx +System Calls Manual .It -.Fx Library Functions Manual +.Fx +Library Functions Manual .It -.Fx Kernel Interfaces Manual +.Fx +Kernel Interfaces Manual .It -.Fx File Formats Manual +.Fx +File Formats Manual .It -.Fx Games Manual +.Fx +Games Manual .It -.Fx Miscellaneous Information Manual +.Fx +Miscellaneous Information Manual .It -.Fx System Manager's Manual +.Fx +System Manager's Manual .It -.Fx Kernel Developer's Manual +.Fx +Kernel Developer's Manual .El .Pp Options that Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Wed Nov 19 16:33:07 2014 (r274719) +++ head/usr.sbin/bhyve/bhyve.8 Wed Nov 19 18:19:21 2014 (r274720) @@ -70,7 +70,8 @@ Required for guests. .It Fl b Enable a low-level console device supported by -.Fx kernels compiled with +.Fx +kernels compiled with .Cd "device bvmconsole" . This option will be deprecated in a future version. .It Fl c Ar numcpus From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 18:19:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D83EC171; Wed, 19 Nov 2014 18:19:27 +0000 (UTC) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE46BD72; Wed, 19 Nov 2014 18:19:26 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id r20so2858436wiv.8 for ; Wed, 19 Nov 2014 10:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=rnm+oNXxHvIJh9ATLBxECOcx9PPKeVq1Whf7LA12X80=; b=rDu6cHvjEWzPCSYN+YE5f8EZVn4BLIVzcRSpZ5VNXW2mmYzVLPbrton/1hxS2t83qN undED+kv4UOd83Yf/qQ3KBGamQCqyWB6JVa0t3kUaFT+8QWn3BtanZhQJqe/AYVcLCL7 iZ1L5TOLzoU20069n7zGKd1U00u11UB+Jzw3ZPcS+CUHig4cdUKs9LFFtIMxECCbjajI +mJ1p9A9NpLCHZqwvyMHAMrGZhYW9296oRek36pVBet4779V7WK+F7qGpCdVzxQXZMm9 r3D6TkMHBbr8Lofrq2JQ+C6B+vFaAMJAo+ug7eLyQvjFFIRk+Z2WEEMWDyLctxVIHKAS 9etA== MIME-Version: 1.0 X-Received: by 10.180.80.133 with SMTP id r5mr8040861wix.20.1416421164787; Wed, 19 Nov 2014 10:19:24 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Wed, 19 Nov 2014 10:19:24 -0800 (PST) In-Reply-To: <546CDEBE.1010608@FreeBSD.org> References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> <20141118064626.GA956@dchagin.static.corbina.net> <20141118192952.GA945@dchagin.static.corbina.net> <546C7C41.70407@FreeBSD.org> <546CCB1A.6060709@FreeBSD.org> <546CDEBE.1010608@FreeBSD.org> Date: Wed, 19 Nov 2014 10:19:24 -0800 X-Google-Sender-Auth: 1NiPTSa3ofJDfG06lLBRuSS9R7M Message-ID: Subject: Re: svn commit: r274635 - head/sys/dev/pci From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin , Chagin Dmitry X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 18:19:28 -0000 On 19 November 2014 10:17, Andriy Gapon wrote: > On 19/11/2014 19:46, Adrian Chadd wrote: >> On 19 November 2014 08:53, Andriy Gapon wrote: >>> On 19/11/2014 18:15, Adrian Chadd wrote: >>>> On 19 November 2014 03:17, Andriy Gapon wrote: >>>>> On 18/11/2014 21:29, Chagin Dmitry wrote: >>>>>> it seems that at resume path METHOD set_powerstate() is not invoked. fro proper pciX. >>>>>> ie, no "Transition from D3 to D0" prints. i'm trying to understand the reason >>>>> >>>>> Just a note that I see this as well. >>>> >>>> Before or after Dmitry's patch? >>> >>> Before. >> >> Ok. >> >> I'll revert his patch today and then we can dig into why the resume >> device list isn't matching the suspend device list. >> >> Thanks for helping me dig into all of this ! > > Hasn't it already been reverted? r274707 Yup, I only just caught up on the email. I'll update my devices today and then dig into it some more. -adrian > > > -- > Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 18:49:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A28D89C6 for ; Wed, 19 Nov 2014 18:49:51 +0000 (UTC) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68DC0C7 for ; Wed, 19 Nov 2014 18:49:51 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id kx10so808090pab.2 for ; Wed, 19 Nov 2014 10:49:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=CJ27ZZgjPI8Kay1KeezM0dSZiIxdPxK1a0RRb9OGD3A=; b=PA2FPSDGPFKL/kvNnOPPW+fjKNGBvIwl2wxeJETkbA1oO3BJCpAne5O0RVd1iCfLS9 5OQBrKzsSX6nykv9lBpkUYBTd6D4SsFfSirALksqIeBfzPe+3vygHiB9b70cs6hV2Uqs h+dFzzlaL2j1RC92q9tve8IK4LU6CX1EfNuVIi7k3zqPr+VAAJhXyF90FZ6K+i46OET4 K+tNb/PqWUk3Prq7x+kiGJeiCaM4Z0eHSBhpW/9FoCsRFMA8zvVrYwnM9wlKgCkXEVYw V4oif6sgWECLCZZJQB7pSLD2bjMYkcoa+r5vL1m0zlnZvy96Wr1lsnSHdMzYZvuPfLFR 29Pw== X-Gm-Message-State: ALoCoQl2cwNWrpyvsIQAk8NMy7R9dmMW+3j2LEWLq7MlIeEj4P8JwTeFNLHtzeOknkQ+VsnkSlX2 X-Received: by 10.70.137.68 with SMTP id qg4mr8957021pdb.150.1416422985649; Wed, 19 Nov 2014 10:49:45 -0800 (PST) Received: from [10.64.24.117] ([69.53.236.236]) by mx.google.com with ESMTPSA id pz6sm2503920pbb.77.2014.11.19.10.49.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 10:49:45 -0800 (PST) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_BD9BCADD-2506-4EA3-8C17-3B312C06C92E"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd From: Warner Losh In-Reply-To: <546CDABC.9020103@FreeBSD.org> Date: Wed, 19 Nov 2014 11:49:38 -0700 Message-Id: References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> <546CDABC.9020103@FreeBSD.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 18:49:51 -0000 --Apple-Mail=_BD9BCADD-2506-4EA3-8C17-3B312C06C92E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 19, 2014, at 11:00 AM, Andrey V. Elsukov wrote: > On 19.11.2014 19:20, Warner Losh wrote: >>> Probably you need to use basetable->gpt_entries here instead of=20 >>> MAXPARTITIONS. >>=20 >> I=92m having trouble connecting the dots between GPT and BSDlabels. = Why >> would this field be relevant? Is it just poorly named? MAXPARTITIONS >=20 > gpt_entries isn't related to GPT, it is `geom partition table's` = number > of partitions entries. Each instance of partition table (i.e. geom) = can > have own number of partitions. MBR always has 4, but GPT or BSD can = have > different numbers. Ah, OK. Thanks for the explanation. I understand. I=92ll work up a = patch. Warner --Apple-Mail=_BD9BCADD-2506-4EA3-8C17-3B312C06C92E Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUbOZCAAoJEGwc0Sh9sBEAnIsP/ivfpGG8512DK3kBczFjGI+z dezeLy0VD3kd3M0xKE4VCg70dkvblJVR21WdCVGHcBdxoR6zXOkTvRjDX4D8vuQm 90boY/XcGRhV0HRdBykIsj+I6y6XhW9ZWKlyqvl5mba0bpix4a5eeq0mESikmPcJ Q0kNYeBKSgFdNSpy65sUJx4GSf0WICR97aziZ7+1qa8/tiKsprmx+YWKN+sRGub+ ElkVjeb3oOHRQDbt8TMVYQUrW85NxiJP5gGv/uJrhrARy+UxgdLzM/5qpZDDsnc7 pFaFW91Iw/G3mSoJjBaE337dAbixUflfY32k38UW8PGypuitPJ0CJzr/A6yxuz3P F00JS7vS9j35TBJeoSbePXo+HDBOOJ0CSgU5oYjCp7Ghga1P/OIuJnBECznEQ8hB qdaYfb1p9V07sbAW54yINky+Vn5i+otZR4r9Fi95yzsiaKjtXTddVSMqzuvuh9ZX T4pQWVvVgfyIN4xE6RxwAMfQe9uPWXb6HXACYMyMXnJS8TScZfAEKVOkYryOxfFR eDf/4kx+iJtIwO6cc2bMCwTUjP8HkfK9MknF/f5oOkJRajsn4nyZUTtVHGY51Sui yUVnRUtktHY2D43w8sgmlx7ynbv7X7/8hQDMmhkDeuOxWvUMESaLU2SaV01azpt3 VLrITHYsRE1sqHKVkX7e =LSTw -----END PGP SIGNATURE----- --Apple-Mail=_BD9BCADD-2506-4EA3-8C17-3B312C06C92E-- From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 18:55:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83CF9D0A; Wed, 19 Nov 2014 18:55:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70C4C1B2; Wed, 19 Nov 2014 18:55:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJItSwQ048382; Wed, 19 Nov 2014 18:55:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJItShA048381; Wed, 19 Nov 2014 18:55:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411191855.sAJItShA048381@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Nov 2014 18:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274721 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 18:55:28 -0000 Author: imp Date: Wed Nov 19 18:55:27 2014 New Revision: 274721 URL: https://svnweb.freebsd.org/changeset/base/274721 Log: The number of BSD partitions is variable. Return the proper number (which is in basetable->gpt_entries). Submitted by: ae@ Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Wed Nov 19 18:19:21 2014 (r274720) +++ head/sys/geom/part/g_part_bsd.c Wed Nov 19 18:55:27 2014 (r274721) @@ -521,7 +521,7 @@ g_part_bsd_ioctl(struct g_part_table *ba table = (struct g_part_bsd_table *)basetable; p = table->bbarea + pp->sectorsize; - return (bsd_disklabel_le_dec(p, data, MAXPARTITIONS)); + return (bsd_disklabel_le_dec(p, data, basetable->gpt_entries)); } default: return (ENOIOCTL); From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 19:00:27 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75034281; Wed, 19 Nov 2014 19:00:27 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BCAFD206; Wed, 19 Nov 2014 19:00:24 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA29605; Wed, 19 Nov 2014 21:02:16 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XrAUJ-000559-BS; Wed, 19 Nov 2014 21:00:23 +0200 Message-ID: <546CE891.7010000@FreeBSD.org> Date: Wed, 19 Nov 2014 20:59:29 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r274635 - head/sys/dev/pci References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <2245618.H2SPKlpWdS@ralph.baldwin.cx> <20141118064626.GA956@dchagin.static.corbina.net> <20141118192952.GA945@dchagin.static.corbina.net> <546C7C41.70407@FreeBSD.org> <546CCB1A.6060709@FreeBSD.org> <546CDEBE.1010608@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin , Chagin Dmitry X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 19:00:27 -0000 On 19/11/2014 20:19, Adrian Chadd wrote: > On 19 November 2014 10:17, Andriy Gapon wrote: >> On 19/11/2014 19:46, Adrian Chadd wrote: >>> On 19 November 2014 08:53, Andriy Gapon wrote: >>>> On 19/11/2014 18:15, Adrian Chadd wrote: >>>>> On 19 November 2014 03:17, Andriy Gapon wrote: >>>>>> On 18/11/2014 21:29, Chagin Dmitry wrote: >>>>>>> it seems that at resume path METHOD set_powerstate() is not invoked. fro proper pciX. >>>>>>> ie, no "Transition from D3 to D0" prints. i'm trying to understand the reason >>>>>> >>>>>> Just a note that I see this as well. >>>>> >>>>> Before or after Dmitry's patch? >>>> >>>> Before. >>> >>> Ok. >>> >>> I'll revert his patch today and then we can dig into why the resume >>> device list isn't matching the suspend device list. >>> >>> Thanks for helping me dig into all of this ! >> >> Hasn't it already been reverted? r274707 > > Yup, I only just caught up on the email. > > I'll update my devices today and then dig into it some more. Okay, please disregard this sub-thread from. I based my observations on behavior of a particular device driver and it seems that that driver was by-passed by a specific issue. I do not see any general problem. Sorry for the noise. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 19:21:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A76BE36; Wed, 19 Nov 2014 19:21:18 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61743781; Wed, 19 Nov 2014 19:21:18 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 57B69B939; Wed, 19 Nov 2014 14:21:17 -0500 (EST) From: John Baldwin To: Chagin Dmitry Subject: Re: svn commit: r274635 - head/sys/dev/pci Date: Wed, 19 Nov 2014 13:56:12 -0500 Message-ID: <3820382.Yu3gof679I@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-PRERELEASE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20141118192952.GA945@dchagin.static.corbina.net> References: <201411172025.sAHKPLMl055666@svn.freebsd.org> <20141118192952.GA945@dchagin.static.corbina.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 19 Nov 2014 14:21:17 -0500 (EST) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 19:21:18 -0000 On Tuesday, November 18, 2014 10:29:52 PM Chagin Dmitry wrote: > On Tue, Nov 18, 2014 at 07:47:46AM -0800, Adrian Chadd wrote: > > Hi, > > > > Want to post a bootverbose suspend/resume pass with -HEAD without this > > patch in it, then with this patch in it? > > it seems that at resume path METHOD set_powerstate() is not invoked. fro > proper pciX. ie, no "Transition from D3 to D0" prints. i'm trying to > understand the reason Can you verify that when acpi_device_pwr_for_sleep() is called acpi_sstate is S0? Maybe add something to just print out the device name, sstate, *dstate, and the return value for each call to acpi_device_pwr_for_sleep()? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 19:43:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0130D591; Wed, 19 Nov 2014 19:43:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C78C7A3B; Wed, 19 Nov 2014 19:43:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJJhdGo072156; Wed, 19 Nov 2014 19:43:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJJhdr6072155; Wed, 19 Nov 2014 19:43:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411191943.sAJJhdr6072155@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 19 Nov 2014 19:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274722 - head/lib/libc/posix1e X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 19:43:40 -0000 Author: trasz Date: Wed Nov 19 19:43:39 2014 New Revision: 274722 URL: https://svnweb.freebsd.org/changeset/base/274722 Log: Remove acl_size.c; apparently it was never used. PR: 194398 Submitted by: ngie@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Deleted: head/lib/libc/posix1e/acl_size.c From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 19:46:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0887811; Wed, 19 Nov 2014 19:46:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 730ABA66; Wed, 19 Nov 2014 19:46:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJJkxTI072859; Wed, 19 Nov 2014 19:46:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJJkxTm072858; Wed, 19 Nov 2014 19:46:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411191946.sAJJkxTm072858@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 19 Nov 2014 19:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274723 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 19:46:59 -0000 Author: trasz Date: Wed Nov 19 19:46:58 2014 New Revision: 274723 URL: https://svnweb.freebsd.org/changeset/base/274723 Log: Make the auto_master(5) man page clearer on how auto_master and map files work together, and add example for smbfs. Differential Revision: https://reviews.freebsd.org/D1184 Reviewed by: wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/auto_master.5 Modified: head/usr.sbin/autofs/auto_master.5 ============================================================================== --- head/usr.sbin/autofs/auto_master.5 Wed Nov 19 19:43:39 2014 (r274722) +++ head/usr.sbin/autofs/auto_master.5 Wed Nov 19 19:46:58 2014 (r274723) @@ -27,13 +27,17 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2014 +.Dd November 19, 2014 .Dt AUTO_MASTER 5 .Os .Sh NAME .Nm auto_master .Nd auto_master and map file format .Sh DESCRIPTION +The automounter configuration consists of the +.Nm +configuration file, which assigns filesystem paths to map names, +and maps, which contain actual mount information. The .Nm configuration file is used by the @@ -132,8 +136,12 @@ The special option .Li fstype is used to specify filesystem type. It is not passed to the mount program as an option. -Instead, it is passed as argument to +Instead, it is passed as an argument to .Cm "mount -t". +The default +.Li fstype +is +.Ql nfs . The special option .Li nobrowse is used to disable creation of top-level directories for special @@ -153,9 +161,11 @@ prefix it with colon. For example, .Li :/dev/cd0 . .Pp -This example, when used with the +This example, when put into +.Pa /etc/auto_example , +and with .Nm -example above, specifies that the NFS share +referring to the map as described above, specifies that the NFS share .Li 192.168.1.1:/share/example/x will be mounted on .Pa /example/x/ @@ -163,11 +173,18 @@ when any process attempts to access that .Li intr and .Li nfsv4 -mount options: +mount options, described in +.Xr mount_nfs 8 : .Bd -literal -offset indent .Li x -intr,nfsv4 192.168.1.1:/share/example/x .Ed .Pp +Automatically mount an SMB share on access, as a guest user, +without prompting for a password: +.Bd -literal -offset indent +.Li share -fstype=smbfs,-N ://@server/share +.Ed +.Pp Automatically mount the CD drive on access: .Bd -literal -offset indent .Li cd -fstype=cd9660 :/dev/cd0 @@ -224,6 +241,7 @@ and this in map file: .Bd -literal -offset indent .Li /example/x -intr,nfsv4 192.168.1.1:/share/example/x +.Li /example/share -fstype=smbfs,-N ://@server/share .Li /example/cd -fstype=cd9660 :/dev/cd0 .Ed .Sh DIRECTORY SERVICES From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 20:16:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74B9F1000; Wed, 19 Nov 2014 20:16:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61940D97; Wed, 19 Nov 2014 20:16:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJKGvmu087038; Wed, 19 Nov 2014 20:16:57 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJKGuQd087036; Wed, 19 Nov 2014 20:16:56 GMT (envelope-from np@FreeBSD.org) Message-Id: <201411192016.sAJKGuQd087036@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 19 Nov 2014 20:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274724 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 20:16:57 -0000 Author: np Date: Wed Nov 19 20:16:56 2014 New Revision: 274724 URL: https://svnweb.freebsd.org/changeset/base/274724 Log: cxgbe(4): figure out the max payload size and save it for later. MFC after: 1 week Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Wed Nov 19 19:46:58 2014 (r274723) +++ head/sys/dev/cxgbe/common/common.h Wed Nov 19 20:16:56 2014 (r274724) @@ -238,6 +238,7 @@ struct vpd_params { struct pci_params { unsigned int vpd_cap_addr; + unsigned int mps; unsigned short speed; unsigned short width; }; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Nov 19 19:46:58 2014 (r274723) +++ head/sys/dev/cxgbe/t4_main.c Wed Nov 19 20:16:56 2014 (r274724) @@ -594,6 +594,8 @@ t4_attach(device_t dev) v = pci_read_config(dev, i + PCIER_DEVICE_CTL, 2); v |= PCIEM_CTL_RELAXED_ORD_ENABLE; pci_write_config(dev, i + PCIER_DEVICE_CTL, v, 2); + + sc->params.pci.mps = 128 << ((v & PCIEM_CTL_MAX_PAYLOAD) >> 5); } sc->traceq = -1; From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 23:07:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A71FB48C; Wed, 19 Nov 2014 23:07:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 882053A1; Wed, 19 Nov 2014 23:07:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJN7muu068427; Wed, 19 Nov 2014 23:07:48 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJN7lxQ068421; Wed, 19 Nov 2014 23:07:47 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201411192307.sAJN7lxQ068421@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Wed, 19 Nov 2014 23:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274727 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 23:07:48 -0000 Author: brd (doc committer) Date: Wed Nov 19 23:07:46 2014 New Revision: 274727 URL: https://svnweb.freebsd.org/changeset/base/274727 Log: Replace the pw(1) calls with a variable, to make it easier to to change across all the tests as needed. Reviewed by: will Modified: head/usr.sbin/pw/tests/helper_functions.shin head/usr.sbin/pw/tests/pw_delete.sh head/usr.sbin/pw/tests/pw_lock.sh head/usr.sbin/pw/tests/pw_modify.sh Modified: head/usr.sbin/pw/tests/helper_functions.shin ============================================================================== --- head/usr.sbin/pw/tests/helper_functions.shin Wed Nov 19 22:17:22 2014 (r274726) +++ head/usr.sbin/pw/tests/helper_functions.shin Wed Nov 19 23:07:46 2014 (r274727) @@ -1,5 +1,8 @@ # $FreeBSD$ +# The pw command +PW="pw -V ${HOME}" + # Workdir to run tests in TESTDIR=$(atf_get_srcdir) Modified: head/usr.sbin/pw/tests/pw_delete.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_delete.sh Wed Nov 19 22:17:22 2014 (r274726) +++ head/usr.sbin/pw/tests/pw_delete.sh Wed Nov 19 23:07:46 2014 (r274727) @@ -12,10 +12,10 @@ rmuser_seperate_group_head() { } rmuser_seperate_group_body() { populate_etc_skel - pw -V ${HOME} useradd test || atf_fail "Creating test user" - pw -V ${HOME} groupmod test -M 'test,root' || \ + ${PW} useradd test || atf_fail "Creating test user" + ${PW} groupmod test -M 'test,root' || \ atf_fail "Modifying the group" - pw -V ${HOME} userdel test || atf_fail "Delete the test user" + ${PW} userdel test || atf_fail "Delete the test user" } atf_test_case group_do_not_delete_wheel_if_group_unknown @@ -25,9 +25,9 @@ group_do_not_delete_wheel_if_group_unkno group_do_not_delete_wheel_if_group_unknown_body() { populate_etc_skel - atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel - atf_check -e inline:"pw: -g expects a number\n" -s exit:64 -x pw -V ${HOME} groupdel -g I_do_not_exist - atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel + atf_check -e inline:"pw: -g expects a number\n" -s exit:64 -x ${PW} groupdel -g I_do_not_exist + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel } atf_test_case user_do_not_try_to_delete_root_if_user_unknown @@ -37,7 +37,7 @@ user_do_not_try_to_delete_root_if_user_u user_do_not_try_to_delete_root_if_user_unknown_body() { populate_etc_skel - atf_check -e inline:"pw: -u expects a number\n" -s exit:64 -x pw -V ${HOME} userdel -u plop + atf_check -e inline:"pw: -u expects a number\n" -s exit:64 -x ${PW} userdel -u plop } atf_init_test_cases() { Modified: head/usr.sbin/pw/tests/pw_lock.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_lock.sh Wed Nov 19 22:17:22 2014 (r274726) +++ head/usr.sbin/pw/tests/pw_lock.sh Wed Nov 19 23:07:46 2014 (r274727) @@ -7,11 +7,11 @@ atf_test_case user_locking cleanup user_locking_body() { populate_etc_skel - pw -V ${HOME} useradd test || atf_fail "Creating test user" - pw -V ${HOME} lock test || atf_fail "Locking the user" + ${PW} useradd test || atf_fail "Creating test user" + ${PW} lock test || atf_fail "Locking the user" atf_check -s exit:0 -o match:"^test:\*LOCKED\*\*:1001:" \ grep "^test:\*LOCKED\*\*:1001:" $HOME/master.passwd - pw -V ${HOME} unlock test || atf_fail "Locking the user" + ${PW} unlock test || atf_fail "Locking the user" atf_check -s exit:0 -o match:"^test:\*:1001:" \ grep "^test:\*:1001:" $HOME/master.passwd } Modified: head/usr.sbin/pw/tests/pw_modify.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_modify.sh Wed Nov 19 22:17:22 2014 (r274726) +++ head/usr.sbin/pw/tests/pw_modify.sh Wed Nov 19 23:07:46 2014 (r274727) @@ -8,11 +8,11 @@ atf_test_case groupmod_user groupmod_user_body() { populate_etc_skel - atf_check -s exit:0 pw -V ${HOME} addgroup test - atf_check -s exit:0 pw -V ${HOME} groupmod test -m root + atf_check -s exit:0 ${PW} addgroup test + atf_check -s exit:0 ${PW} groupmod test -m root atf_check -s exit:0 -o match:"^test:\*:1001:root$" \ grep "^test:\*:.*:root$" $HOME/group - atf_check -s exit:0 pw -V ${HOME} groupmod test -d root + atf_check -s exit:0 ${PW} groupmod test -d root atf_check -s exit:0 -o match:"^test:\*:1001:$" \ grep "^test:\*:.*:$" $HOME/group } @@ -22,9 +22,9 @@ groupmod_user_body() { atf_test_case groupmod_invalid_user groupmod_invalid_user_body() { populate_etc_skel - atf_check -s exit:0 pw -V ${HOME} addgroup test - atf_check -s exit:67 -e match:"does not exist" pw -V ${HOME} groupmod test -m foo - atf_check -s exit:0 pw -V ${HOME} groupmod test -d foo + atf_check -s exit:0 ${PW} addgroup test + atf_check -s exit:67 -e match:"does not exist" ${PW} groupmod test -m foo + atf_check -s exit:0 ${PW} groupmod test -d foo } atf_test_case groupmod_bug_193704 @@ -33,9 +33,9 @@ groupmod_bug_193704_head() { } groupmod_bug_193704_body() { populate_etc_skel - atf_check -s exit:0 -x pw -V ${HOME} groupadd test - atf_check -s exit:0 -x pw -V ${HOME} groupmod test -l newgroupname - atf_check -s exit:65 -e match:"^pw: unknown group" -x pw -V ${HOME} groupshow test + atf_check -s exit:0 -x ${PW} groupadd test + atf_check -s exit:0 -x ${PW} groupmod test -l newgroupname + atf_check -s exit:65 -e match:"^pw: unknown group" -x ${PW} groupshow test } atf_test_case usermod_bug_185666 @@ -45,17 +45,17 @@ usermod_bug_185666_head() { usermod_bug_185666_body() { populate_etc_skel - atf_check -s exit:0 -x pw -V ${HOME} useradd testuser - atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup - atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup2 - atf_check -s exit:0 -x pw -V ${HOME} usermod testuser -G testgroup - atf_check -o inline:"testuser:*:1001:\n" -x pw -V${HOME} groupshow testuser - atf_check -o inline:"testgroup:*:1002:testuser\n" -x pw -V ${HOME} groupshow testgroup - atf_check -o inline:"testgroup2:*:1003:\n" -x pw -V${HOME} groupshow testgroup2 - atf_check -s exit:0 -x pw -V ${HOME} usermod testuser -G testgroup2 - atf_check -o inline:"testuser:*:1001:\n" -x pw -V ${HOME} groupshow testuser - atf_check -o inline:"testgroup:*:1002:\n" -x pw -V ${HOME} groupshow testgroup - atf_check -o inline:"testgroup2:*:1003:testuser\n" -x pw -V ${HOME} groupshow testgroup2 + atf_check -s exit:0 -x ${PW} useradd testuser + atf_check -s exit:0 -x ${PW} groupadd testgroup + atf_check -s exit:0 -x ${PW} groupadd testgroup2 + atf_check -s exit:0 -x ${PW} usermod testuser -G testgroup + atf_check -o inline:"testuser:*:1001:\n" -x ${PW} groupshow testuser + atf_check -o inline:"testgroup:*:1002:testuser\n" -x ${PW} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:\n" -x ${PW} groupshow testgroup2 + atf_check -s exit:0 -x ${PW} usermod testuser -G testgroup2 + atf_check -o inline:"testuser:*:1001:\n" -x ${PW} groupshow testuser + atf_check -o inline:"testgroup:*:1002:\n" -x ${PW} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:testuser\n" -x ${PW} groupshow testgroup2 } atf_test_case do_not_duplicate_group_on_gid_change @@ -65,8 +65,8 @@ do_not_duplicate_group_on_gid_change_hea do_not_duplicate_group_on_gid_change_body() { populate_etc_skel - atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup - atf_check -s exit:0 -x pw -V ${HOME} groupmod testgroup -g 12345 + atf_check -s exit:0 -x ${PW} groupadd testgroup + atf_check -s exit:0 -x ${PW} groupmod testgroup -g 12345 # use grep to see if the entry has not be duplicated atf_check -o inline:"testgroup:*:12345:\n" -s exit:0 -x grep "^testgroup" ${HOME}/group } From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 03:23:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08893AB5; Thu, 20 Nov 2014 03:23:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E907A16C; Thu, 20 Nov 2014 03:23:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK3NY3p092535; Thu, 20 Nov 2014 03:23:34 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK3NYR6092533; Thu, 20 Nov 2014 03:23:34 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201411200323.sAK3NYR6092533@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 20 Nov 2014 03:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274733 - head/sys/powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 03:23:35 -0000 Author: jhibbits Date: Thu Nov 20 03:23:33 2014 New Revision: 274733 URL: https://svnweb.freebsd.org/changeset/base/274733 Log: Add support for Power Button PMU events on non-ADB macs, such as aluminum PowerBooks. MFC after: 2 weeks Relnotes: yes Modified: head/sys/powerpc/powermac/pmu.c head/sys/powerpc/powermac/pmuvar.h Modified: head/sys/powerpc/powermac/pmu.c ============================================================================== --- head/sys/powerpc/powermac/pmu.c Thu Nov 20 01:55:12 2014 (r274732) +++ head/sys/powerpc/powermac/pmu.c Thu Nov 20 03:23:33 2014 (r274733) @@ -734,15 +734,15 @@ pmu_intr(void *arg) /* if the lid was just closed, notify devd. */ if ((resp[2] & PMU_ENV_LID_CLOSED) && (!sc->lid_closed)) { sc->lid_closed = 1; - if (devctl_process_running()) - devctl_notify("PMU", "lid", "close", NULL); + devctl_notify("PMU", "lid", "close", NULL); } else if (!(resp[2] & PMU_ENV_LID_CLOSED) && (sc->lid_closed)) { /* if the lid was just opened, notify devd. */ - if (devctl_process_running()) - devctl_notify("PMU", "lid", "open", NULL); sc->lid_closed = 0; + devctl_notify("PMU", "lid", "open", NULL); } + if (resp[2] & PMU_ENV_POWER) + devctl_notify("PMU", "Button", "pressed", NULL); } } Modified: head/sys/powerpc/powermac/pmuvar.h ============================================================================== --- head/sys/powerpc/powermac/pmuvar.h Thu Nov 20 01:55:12 2014 (r274732) +++ head/sys/powerpc/powermac/pmuvar.h Thu Nov 20 03:23:33 2014 (r274733) @@ -99,6 +99,7 @@ /* Bits from PMU_GET_LID_STATE or PMU_INT_ENVIRONMENT on core99 */ #define PMU_ENV_LID_CLOSED 0x01 /* The lid is closed */ +#define PMU_ENV_POWER 0x08 /* Power Button pressed */ /* PMU PMU_POWER_EVENTS commands */ enum { From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 03:47:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 493A1FCC; Thu, 20 Nov 2014 03:47:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CDF0358; Thu, 20 Nov 2014 03:47:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK3l4L2002479; Thu, 20 Nov 2014 03:47:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK3l4d8002478; Thu, 20 Nov 2014 03:47:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201411200347.sAK3l4d8002478@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 20 Nov 2014 03:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274735 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 03:47:05 -0000 Author: jhibbits Date: Thu Nov 20 03:47:04 2014 New Revision: 274735 URL: https://svnweb.freebsd.org/changeset/base/274735 Log: Use db_printsym() instead of our own in backtraces Summary: Currently if there are problems finding a symbol, backtrace ends up printing something like: 0xdeadbeef: at +0x12345 Which is pretty useless. This on its own should be fixed (retrieving symbols), but aside from that, using db_printsym() is a better solution anyway. If it can't find a valid symbol it prints the actual address, and it has the added benefit that if it can find the symbol, it might be able to print the file and line as well. Test Plan: Tested on my G4 PowerBook Reviewers: #powerpc, nwhitehorn Reviewed By: nwhitehorn Differential Revision: https://reviews.freebsd.org/D1173 MFC after: 3 weeks Modified: head/sys/powerpc/powerpc/db_trace.c Modified: head/sys/powerpc/powerpc/db_trace.c ============================================================================== --- head/sys/powerpc/powerpc/db_trace.c Thu Nov 20 03:46:35 2014 (r274734) +++ head/sys/powerpc/powerpc/db_trace.c Thu Nov 20 03:47:04 2014 (r274735) @@ -135,9 +135,6 @@ static int db_backtrace(struct thread *td, db_addr_t fp, int count) { db_addr_t stackframe, lr, *args; - db_expr_t diff; - c_db_sym_t sym; - const char *symname; boolean_t kernel_only = TRUE; boolean_t full = FALSE; @@ -265,16 +262,8 @@ db_backtrace(struct thread *td, db_addr_ print_trap: lr = (db_addr_t) tf->srr0; - diff = 0; - symname = NULL; - sym = db_search_symbol(lr, DB_STGY_ANY, &diff); - db_symbol_values(sym, &symname, 0); - if (symname == NULL || !strcmp(symname, "end")) { - db_printf("%#zx: srr1=%#zx\n", lr, tf->srr1); - } else { - db_printf("%s+%#zx: srr1=%#zx\n", symname, diff, - tf->srr1); - } + db_printsym(lr, DB_STGY_ANY); + db_printf(": srr1=%#x\n", tf->srr1); db_printf("%-10s r1=%#zx cr=%#x xer=%#x ctr=%#zx", "", tf->fixreg[1], (uint32_t)tf->cr, (uint32_t)tf->xer, tf->ctr); @@ -288,14 +277,8 @@ db_backtrace(struct thread *td, db_addr_ goto next_frame; } - diff = 0; - symname = NULL; - sym = db_search_symbol(lr, DB_STGY_ANY, &diff); - db_symbol_values(sym, &symname, 0); - if (symname == NULL || !strcmp(symname, "end")) - db_printf("at %zx", lr); - else - db_printf("at %s+%#zx", symname, diff); + db_printf("at "); + db_printsym(lr, DB_STGY_PROC); if (full) /* Print all the args stored in that stackframe. */ db_printf("(%zx, %zx, %zx, %zx, %zx, %zx, %zx, %zx)", From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 04:15:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 632EC535; Thu, 20 Nov 2014 04:15:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FD90830; Thu, 20 Nov 2014 04:15:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK4FxtA016298; Thu, 20 Nov 2014 04:15:59 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK4FxHA016297; Thu, 20 Nov 2014 04:15:59 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201411200415.sAK4FxHA016297@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 20 Nov 2014 04:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274736 - head/libexec/fingerd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 04:15:59 -0000 Author: jmg Date: Thu Nov 20 04:15:58 2014 New Revision: 274736 URL: https://svnweb.freebsd.org/changeset/base/274736 Log: I agree w/ tedu that this isn't a Bug.. it's like complaining that you can't use an ssh client to fetch a web page... Submitted by: tedu (via -tech) Modified: head/libexec/fingerd/fingerd.8 Modified: head/libexec/fingerd/fingerd.8 ============================================================================== --- head/libexec/fingerd/fingerd.8 Thu Nov 20 03:47:04 2014 (r274735) +++ head/libexec/fingerd/fingerd.8 Thu Nov 20 04:15:58 2014 (r274736) @@ -28,7 +28,7 @@ .\" @(#)fingerd.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 1, 2010 +.Dd November 19, 2014 .Dt FINGERD 8 .Os .Sh NAME @@ -86,7 +86,7 @@ returns a report that lists all people logged into the system at that moment. .Pp -If a user name is specified (e.g.\& +If a user name is specified (e.g.,\& .Pf eric Aq Tn CRLF ) then the response lists more extended information for only that particular user, @@ -159,19 +159,3 @@ The .Nm utility appeared in .Bx 4.3 . -.Sh BUGS -Connecting directly to the server from a -.Tn TIP -or an equally narrow-minded -.Tn TELNET Ns \-protocol -user program can result -in meaningless attempts at option negotiation being sent to the -server, which will foul up the command line interpretation. -The -.Nm -utility should be taught to filter out -.Tn IAC Ns \'s -and perhaps even respond -negatively -.Pq Tn IAC WON'T -to all option commands received. From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 05:06:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E134C54; Thu, 20 Nov 2014 05:06:21 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id D5DA7C25; Thu, 20 Nov 2014 05:06:20 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 07CF81A1FB1; Thu, 20 Nov 2014 15:38:38 +1100 (AEDT) Date: Thu, 20 Nov 2014 15:38:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r274721 - head/sys/geom/part In-Reply-To: <201411191855.sAJItShA048381@svn.freebsd.org> Message-ID: <20141120150210.P976@besplex.bde.org> References: <201411191855.sAJItShA048381@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=Y1h1eLOWUWDwmyq3NvkA:9 a=NyhIRQUL_XerPQeh:21 a=Un_jFPcKyi9qFG51:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 05:06:21 -0000 On Wed, 19 Nov 2014, Warner Losh wrote: > Log: > The number of BSD partitions is variable. Return the proper number > (which is in basetable->gpt_entries). > > Submitted by: ae@ > > Modified: > head/sys/geom/part/g_part_bsd.c > > Modified: head/sys/geom/part/g_part_bsd.c > ============================================================================== > --- head/sys/geom/part/g_part_bsd.c Wed Nov 19 18:19:21 2014 (r274720) > +++ head/sys/geom/part/g_part_bsd.c Wed Nov 19 18:55:27 2014 (r274721) > @@ -521,7 +521,7 @@ g_part_bsd_ioctl(struct g_part_table *ba > > table = (struct g_part_bsd_table *)basetable; > p = table->bbarea + pp->sectorsize; > - return (bsd_disklabel_le_dec(p, data, MAXPARTITIONS)); > + return (bsd_disklabel_le_dec(p, data, basetable->gpt_entries)); > } > default: > return (ENOIOCTL); How can this work? I think you are implementing DIOCGDINFO. This returns a struct disklabel, which is limited by binary compatibility to the historical number of partitions (8). So this ioctl just cannot support more than 8 partitions. The best that could happen is for bsd_disklabel_le_dec() to return an error in this case. But it actually does essentially the reverse -- you pass it the maximum supported by the ioctl, and it returns an error if the actual number is larger. So MAXPARTITIONS was correct if this is to implement DIOCGDINFO. I thought that binary compatibility was already broken by expanding MAXPARTITIONS, but actually it is still 8 (modulo garbage ifdefs and comments), but actually there is a new struct disklabel64 with MAXPARTITIONS64 = 16 to expand by a bit. I don't understand the plumbing for this. There don't seem to be any related ioctls. I think all it could be used for is to start with a disk with 16 partitions and translate to another format which can handle that many, and use only ioctls for the other format. The reverse translation to formats that can't handle that many is impossible. still contains the following garbage related to this. The garbage hasn't changed since at least FreeBSD-1; it was presumably in Net/2: % #ifndef MAXPARTITIONS % #define MAXPARTITIONS 8 % #endif Actually changing this would break binary compatibility. MAXPARTITIONS isn't even a bogus option (in /sys/conf/options), so this is not easy to change. Editing the file and recompiling the world is the only safe way to change it. % struct disklabel { % ... % u_int16_t d_npartitions; /* number of partitions in following */ % u_int32_t d_bbsize; /* size of boot area at sn0, bytes */ % u_int32_t d_sbsize; /* max size of fs superblock, bytes */ % struct partition { /* the partition table */ % u_int32_t p_size; /* number of sectors in partition */ % u_int32_t p_offset; /* starting sector */ % u_int32_t p_fsize; /* filesystem basic fragment size */ % u_int8_t p_fstype; /* filesystem type, see below */ % u_int8_t p_frag; /* filesystem fragments per block */ % u_int16_t p_cpg; /* filesystem cylinders per group */ % } d_partitions[MAXPARTITIONS]; /* actually may be more */ Actually, it MUST not be more. It may be more on disk (d_npartitions gives the number), but then none of the ioctls can support it. % }; Bruce From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 05:25:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 825A0F78; Thu, 20 Nov 2014 05:25:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EF0EDD8; Thu, 20 Nov 2014 05:25:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK5Prro049278; Thu, 20 Nov 2014 05:25:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK5PrdQ049277; Thu, 20 Nov 2014 05:25:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411200525.sAK5PrdQ049277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 20 Nov 2014 05:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274737 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 05:25:53 -0000 Author: trasz Date: Thu Nov 20 05:25:52 2014 New Revision: 274737 URL: https://svnweb.freebsd.org/changeset/base/274737 Log: Use proper ordering in EXAMPLES section in growfs(8). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/growfs/growfs.8 Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Thu Nov 20 04:15:58 2014 (r274736) +++ head/sbin/growfs/growfs.8 Thu Nov 20 05:25:52 2014 (r274737) @@ -37,7 +37,7 @@ .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" $FreeBSD$ .\" -.Dd November 26, 2013 +.Dd November 20, 2014 .Dt GROWFS 8 .Os .Sh NAME @@ -96,12 +96,11 @@ This value defaults to the size of the r will enlarge the file system to the size of the entire partition). .El .Sh EXAMPLES -.Dl growfs -s 2G /dev/ada0p1 -.Pp -will enlarge +Enlarge .Pa /dev/ada0p1 up to 2GB if there is enough space in -.Pa /dev/ada0p1 . +.Pa /dev/ada0p1 : +.Dl growfs -s 2G /dev/ada0p1 .Sh SEE ALSO .Xr dumpfs 8 , .Xr ffsinfo 8 , From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 05:31:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86472188; Thu, 20 Nov 2014 05:31:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7314FE05; Thu, 20 Nov 2014 05:31:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK5VgGk053427; Thu, 20 Nov 2014 05:31:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK5Vg9N053426; Thu, 20 Nov 2014 05:31:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411200531.sAK5Vg9N053426@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 20 Nov 2014 05:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274738 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 05:31:42 -0000 Author: trasz Date: Thu Nov 20 05:31:41 2014 New Revision: 274738 URL: https://svnweb.freebsd.org/changeset/base/274738 Log: Document growfs(8) feature apparently nobody knows about. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/growfs/growfs.8 Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Thu Nov 20 05:25:52 2014 (r274737) +++ head/sbin/growfs/growfs.8 Thu Nov 20 05:31:41 2014 (r274738) @@ -101,6 +101,9 @@ Enlarge up to 2GB if there is enough space in .Pa /dev/ada0p1 : .Dl growfs -s 2G /dev/ada0p1 +.Pp +Enlarge root filesystem to fill up available space: +.Dl growfs / .Sh SEE ALSO .Xr dumpfs 8 , .Xr ffsinfo 8 , From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 05:52:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F2785A2; Thu, 20 Nov 2014 05:52:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 423257F; Thu, 20 Nov 2014 05:52:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK5qniL063074; Thu, 20 Nov 2014 05:52:49 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK5qnXP063073; Thu, 20 Nov 2014 05:52:49 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201411200552.sAK5qnXP063073@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 20 Nov 2014 05:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274739 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 05:52:49 -0000 Author: adrian Date: Thu Nov 20 05:52:48 2014 New Revision: 274739 URL: https://svnweb.freebsd.org/changeset/base/274739 Log: Include a random device. Modified: head/sys/mips/conf/MALTA Modified: head/sys/mips/conf/MALTA ============================================================================== --- head/sys/mips/conf/MALTA Thu Nov 20 05:31:41 2014 (r274738) +++ head/sys/mips/conf/MALTA Thu Nov 20 05:52:48 2014 (r274739) @@ -68,3 +68,4 @@ device miibus device bpf device md device uart +device random From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 05:54:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52F526EB; Thu, 20 Nov 2014 05:54:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FB248C; Thu, 20 Nov 2014 05:54:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK5sUv3063323; Thu, 20 Nov 2014 05:54:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK5sUsQ063322; Thu, 20 Nov 2014 05:54:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201411200554.sAK5sUsQ063322@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 20 Nov 2014 05:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274740 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 05:54:30 -0000 Author: adrian Date: Thu Nov 20 05:54:29 2014 New Revision: 274740 URL: https://svnweb.freebsd.org/changeset/base/274740 Log: * Add a random device * Use the same rootdev path as MALTA, so the same emulator setups can be used with minimal fuss. Modified: head/sys/mips/conf/MALTA64 Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Thu Nov 20 05:52:48 2014 (r274739) +++ head/sys/mips/conf/MALTA64 Thu Nov 20 05:54:29 2014 (r274740) @@ -53,7 +53,7 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -options ROOTDEVNAME=\"ufs:ada0s1a\" +options ROOTDEVNAME=\"ufs:ada0\" # Debugging for use in -current @@ -70,3 +70,4 @@ device miibus device md device bpf device uart +device random From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 06:12:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C143C76; Thu, 20 Nov 2014 06:12:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58945257; Thu, 20 Nov 2014 06:12:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK6CCto072759; Thu, 20 Nov 2014 06:12:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK6CCw1072758; Thu, 20 Nov 2014 06:12:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411200612.sAK6CCw1072758@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 20 Nov 2014 06:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274741 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 06:12:12 -0000 Author: trasz Date: Thu Nov 20 06:12:11 2014 New Revision: 274741 URL: https://svnweb.freebsd.org/changeset/base/274741 Log: Add example on how to use gpart before growfs. While here, reorder examples so that the simplest one comes first. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/growfs/growfs.8 Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Thu Nov 20 05:54:29 2014 (r274740) +++ head/sbin/growfs/growfs.8 Thu Nov 20 06:12:11 2014 (r274741) @@ -96,14 +96,14 @@ This value defaults to the size of the r will enlarge the file system to the size of the entire partition). .El .Sh EXAMPLES -Enlarge +Expand root filesystem to fill up available space: +.Dl growfs / +.Pp +Resize .Pa /dev/ada0p1 -up to 2GB if there is enough space in -.Pa /dev/ada0p1 : +partition to 2GB and expand the filesystem: +.Dl gpart resize -i 1 -s 2G ada0 .Dl growfs -s 2G /dev/ada0p1 -.Pp -Enlarge root filesystem to fill up available space: -.Dl growfs / .Sh SEE ALSO .Xr dumpfs 8 , .Xr ffsinfo 8 , From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 06:14:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 722F2F89; Thu, 20 Nov 2014 06:14:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EA0F26A; Thu, 20 Nov 2014 06:14:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK6Efle073361; Thu, 20 Nov 2014 06:14:41 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK6Ef8U073360; Thu, 20 Nov 2014 06:14:41 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411200614.sAK6Ef8U073360@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 20 Nov 2014 06:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274742 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 06:14:41 -0000 Author: trasz Date: Thu Nov 20 06:14:40 2014 New Revision: 274742 URL: https://svnweb.freebsd.org/changeset/base/274742 Log: Uniformly refer to a file system as "file system". MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/growfs/growfs.8 Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Thu Nov 20 06:12:11 2014 (r274741) +++ head/sbin/growfs/growfs.8 Thu Nov 20 06:14:40 2014 (r274742) @@ -96,12 +96,12 @@ This value defaults to the size of the r will enlarge the file system to the size of the entire partition). .El .Sh EXAMPLES -Expand root filesystem to fill up available space: +Expand root file system to fill up available space: .Dl growfs / .Pp Resize .Pa /dev/ada0p1 -partition to 2GB and expand the filesystem: +partition to 2GB and expand the file system: .Dl gpart resize -i 1 -s 2G ada0 .Dl growfs -s 2G /dev/ada0p1 .Sh SEE ALSO @@ -117,7 +117,7 @@ The .Nm utility first appeared in .Fx 4.4 . -The ability to resize mounted filesystems was added in +The ability to resize mounted file systems was added in .Fx 10.0 . .Sh AUTHORS .An Christoph Herrmann Aq Mt chm@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 06:32:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CD3943F; Thu, 20 Nov 2014 06:32:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6975162A; Thu, 20 Nov 2014 06:32:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK6WmSn082633; Thu, 20 Nov 2014 06:32:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK6Wl5c082631; Thu, 20 Nov 2014 06:32:47 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201411200632.sAK6Wl5c082631@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 20 Nov 2014 06:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274743 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 06:32:48 -0000 Author: jhibbits Date: Thu Nov 20 06:32:47 2014 New Revision: 274743 URL: https://svnweb.freebsd.org/changeset/base/274743 Log: cpudep_ap_early_bootstrap() takes no arguments, so no need to give it one. MFC after: 3 weeks Modified: head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Thu Nov 20 06:14:40 2014 (r274742) +++ head/sys/powerpc/aim/trap_subr32.S Thu Nov 20 06:32:47 2014 (r274743) @@ -313,7 +313,6 @@ cpu_reset: mflr %r1 addi %r1,%r1,(124-16)@l - lis %r3,1@l bla CNAME(cpudep_ap_early_bootstrap) lis %r3,1@l bla CNAME(pmap_cpu_bootstrap) Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Thu Nov 20 06:14:40 2014 (r274742) +++ head/sys/powerpc/aim/trap_subr64.S Thu Nov 20 06:32:47 2014 (r274743) @@ -312,7 +312,6 @@ cpu_reset: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) - lis %r3,1@l bl CNAME(cpudep_ap_early_bootstrap) /* Set PCPU */ nop lis %r3,1@l From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 08:11:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A82A6E9; Thu, 20 Nov 2014 08:11:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BA438D; Thu, 20 Nov 2014 08:11:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK8Btrb035978; Thu, 20 Nov 2014 08:11:55 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK8Bt7Q035977; Thu, 20 Nov 2014 08:11:55 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201411200811.sAK8Bt7Q035977@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Thu, 20 Nov 2014 08:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274744 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 08:11:55 -0000 Author: rodrigc Date: Thu Nov 20 08:11:54 2014 New Revision: 274744 URL: https://svnweb.freebsd.org/changeset/base/274744 Log: Set the current vnet inside the ioctl handler for ipfilter. Without this fix, the vnet was NULL and would crash. This fix is similar to what was done inside the ioctl handler for PF. Tested by: (1) Boot a kernel with "options VIMAGE" enabled (2) Type: echo "map lo0 from 10.0.0.0/24 to ! 10.0.0.0/24 -> 127.0.0.1/32" > /etc/ipnat.rules ; service ipnat onerestart PR: 176992 Differential Revision: https://reviews.freebsd.org/D1191 Reviewed by: cy Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Nov 20 06:32:47 2014 (r274743) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Nov 20 08:11:54 2014 (r274744) @@ -33,6 +33,9 @@ static const char rcsid[] = "@(#)$Id$"; #include #include # include +#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) +#include +#endif # include # include #if !defined(__hpux) @@ -52,6 +55,12 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include +#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) +#include +#else +#define CURVNET_SET(arg) +#define CURVNET_RESTORE() +#endif #if defined(__osf__) # include #endif @@ -323,7 +332,9 @@ ipfioctl(dev, cmd, data, mode SPL_NET(s); + CURVNET_SET(TD_TO_VNET(p)); error = ipf_ioctlswitch(&ipfmain, unit, data, cmd, mode, p->p_uid, p); + CURVNET_RESTORE(); if (error != -1) { SPL_X(s); return error; From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 09:56:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16364998; Thu, 20 Nov 2014 09:56:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00AC9DBC; Thu, 20 Nov 2014 09:56:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAK9uYh6085518; Thu, 20 Nov 2014 09:56:34 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAK9uYiZ085513; Thu, 20 Nov 2014 09:56:34 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201411200956.sAK9uYiZ085513@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Thu, 20 Nov 2014 09:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274745 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 09:56:35 -0000 Author: rodrigc Date: Thu Nov 20 09:56:34 2014 New Revision: 274745 URL: https://svnweb.freebsd.org/changeset/base/274745 Log: MFp4: @179066 Add page which describes VNET network stack virtualization infrastructure. Submitted by: bz Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH Added: head/share/man/man9/vnet.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Nov 20 08:11:54 2014 (r274744) +++ head/share/man/man9/Makefile Thu Nov 20 09:56:34 2014 (r274745) @@ -345,6 +345,7 @@ MAN= accept_filter.9 \ vmem.9 \ vn_fullpath.9 \ vn_isdisk.9 \ + vnet.9 \ vnode.9 \ VOP_ACCESS.9 \ VOP_ACLCHECK.9 \ Added: head/share/man/man9/vnet.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/vnet.9 Thu Nov 20 09:56:34 2014 (r274745) @@ -0,0 +1,502 @@ +.\"- +.\" Copyright (c) 2010 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written by CK Software GmbH under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 20, 2014 +.Dt VNET 9 +.Os +.Sh NAME +.Nm VNET +.Nd "network subsystem virtualization infrastructure" +.Sh SYNOPSIS +.Cd "options VIMAGE" +.Cd "options VNET_DEBUG" +.Pp +.In sys/vnet.h +.Pp +.\"------------------------------------------------------------ +.Ss "Constants and Global Variables" +.\" +.Dv VNET_SETNAME +.\" "set_vnet" +.Dv VNET_SYMPREFIX +.\" "vnet_entry_" +.Vt extern struct vnet *vnet0; +.\"------------------------------------------------------------ +.Ss "Variable Declaration" +.Fo VNET +.Fa "name" +.Fc +.\" +.Fo VNET_NAME +.Fa "name" +.Fc +.\" +.Fo VNET_DECLARE +.Fa "type" "name" +.Fc +.\" +.Fo VNET_DEFINE +.Fa "type" "name" +.Fc +.\" +.Bd -literal +#define V_name VNET(name) +.Ed +.\" ------------------------------------------------------------ +.Ss "Virtual Instance Selection" +.\" +.Fo CRED_TO_VNET +.Fa "struct ucred *" +.Fc +.\" +.Fo TD_TO_VNET +.Fa "struct thread *" +.Fc +.\" +.Fo P_TO_VNET +.Fa "struct proc *" +.Fc +.\" +.Fo IS_DEFAULT_VNET +.Fa "struct vnet *" +.Fc +.\" +.Fo VNET_ASSERT +.Fa exp msg +.Fc +.\" +.Fo CURVNET_SET +.Fa "struct vnet *" +.Fc +.\" +.Fo CURVNET_SET_QUIET +.Fa "struct vnet *" +.Fc +.\" +.Fo CURVNET_RESTORE +.Fc +.\" +.Fo VNET_ITERATOR_DECL +.Fa "struct vnet *" +.Fc +.\" +.Fo VNET_FOREACH +.Fa "struct vnet *" +.Fc +.\" ------------------------------------------------------------ +.Ss "Locking" +.\" +.Fo VNET_LIST_RLOCK +.Fc +.Fo VNET_LIST_RUNLOCK +.Fc +.Fo VNET_LIST_RLOCK_NOSLEEP +.Fc +.Fo VNET_LIST_RUNLOCK_NOSLEEP +.Fc +.\" ------------------------------------------------------------ +.Ss "Startup and Teardown Functions" +.\" +.Ft "struct vnet *" +.Fo vnet_alloc +.Fa void +.Fc +.\" +.Ft void +.Fo vnet_destroy +.Fa "struct vnet *" +.Fc +.\" +.Fo VNET_SYSINIT +.Fa ident +.Fa "enum sysinit_sub_id subsystem" +.Fa "enum sysinit_elem_order order" +.Fa "sysinit_cfunc_t func" +.Fa "const void *arg" +.Fc +.\" +.Fo VNET_SYSUNINIT +.Fa ident +.Fa "enum sysinit_sub_id subsystem" +.Fa "enum sysinit_elem_order order" +.Fa "sysinit_cfunc_t func" +.Fa "const void *arg" +.Fc +.\" ------------------------------------------------------------ +.Ss "Eventhandlers" +.\" +.Fo VNET_GLOBAL_EVENTHANDLER_REGISTER +.Fa "const char *name" +.Fa "void *func" +.Fa "void *arg" +.Fa "int priority" +.Fc +.\" +.Fo VNET_GLOBAL_EVENTHANDLER_REGISTER_TAG +.Fa "eventhandler_tag tag" +.Fa "const char *name" +.Fa "void *func" +.Fa "void *arg" +.Fa "int priority" +.Fc +.\" ------------------------------------------------------------ +.Ss "Sysctl Handling" +.Fo SYSCTL_VNET_INT +.Fa parent nbr name access ptr val descr +.Fc +.Fo SYSCTL_VNET_PROC +.Fa parent nbr name access ptr arg handler fmt descr +.Fc +.Fo SYSCTL_VNET_STRING +.Fa parent nbr name access arg len descr +.Fc +.Fo SYSCTL_VNET_STRUCT +.Fa parent nbr name access ptr type descr +.Fc +.Fo SYSCTL_VNET_UINT +.Fa parent nbr name access ptr val descr +.Fc +.Fo VNET_SYSCTL_ARG +.Fa req arg1 +.Fc +.\" ------------------------------------------------------------ +.Sh DESCRIPTION +.Nm +is the name of a technique to virtualize the network stack. +The basic idea is to change global resources most notably variables into +per network stack resources and have functions, sysctls, eventhandlers, +etc. access and handle them in the context of the correct instance. +Each (virtual) network stack is attached to a +.Em prison , +with +.Vt vnet0 +being the unrestricted default network stack of the base system. +.Pp +The global defines for +.Dv VNET_SETNAME +and +.Dv VNET_SYMPREFIX +are shared with +.Xr kvm 3 +to access internals for debugging reasons. +.\" ------------------------------------------------------------ +.Ss "Variable Declaration" +.\" +Variables are virtualized by using the +.Fn VNET_DEFINE +macro rather than writing them out as +.Em type name . +One can still use static initialization or storage class specifiers, e.g., +.Pp +.Dl Li static VNET_DEFINE(int, foo) = 1; +or +.Dl Li static VNET_DEFINE(SLIST_HEAD(, bar), bars); +.Pp +Static initialization is not possible when the virtualized variable +would need to be referenced, e.g., with +.Dq TAILQ_HEAD_INITIALIZER() . +In that case a +.Fn VNET_SYSINIT +based initialization function must be used. +.Pp +External variables have to be declared using the +.Fn VNET_DECLARE +macro. +In either case the convention is to define another macro, +that is then used throughout the implementation to access that variable. +The variable name is usually prefixed by +.Em V_ +to express that it is virtualized. +The +.Fn VNET +macro will then translate accesses to that variable to the copy of the +currently selected instance (see the +.Sx "Virtual instance selection" +section): +.Pp +.Dl Li #define V_name VNET(name) +.Pp +.Em NOTE: +Do not confuse this with the convention used by +.Xr VFS 9 . +.Pp +The +.Fn VNET_NAME +macro returns the offset within the memory region of the virtual network +stack instance. +It is usually only used with +.Fn SYSCTL_VNET_* +macros. +.\" ------------------------------------------------------------ +.Ss "Virtual Instance Selection" +.\" +There are three different places where the current virtual +network stack pointer is stored and can be taken from: +.Bl -enum -offset indent +.It +a +.Em prison : +.Dl "(struct prison *)->pr_vnet" +.Pp +For convenience the following macros are provided: +.Bd -literal -compact -offset indent +.Fn CRED_TO_VNET "struct ucred *" +.Fn TD_TO_VNET "struct thread *" +.Fn P_TO_VNET "struct proc *" +.Ed +.It +a +.Em socket : +.Dl "(struct socket *)->so_vnet" +.It +an +.Em interface : +.Dl "(struct ifnet *)->if_vnet" +.El +.Pp +.\" +In addition the currently active instance is cached in +.Dq "curthread->td_vnet" +which is usually only accessed through the +.Dv curvnet +macro. +.Pp +.\" +To set the correct context of the current virtual network instance, use the +.Fn CURVNET_SET +or +.Fn CURVNET_SET_QUIET +macros. +The +.Fn CURVNET_SET_QUIET +version will not record vnet recursions in case the kernel was compiled +with +.Cd "options VNET_DEBUG" +and should thus only be used in well known cases, where recursion is +unavoidable. +Both macros will save the previous state on the stack and it must be restored +with the +.Fn CURVNET_RESTORE +macro. +.Pp +.Em NOTE: +As the previous state is saved on the stack, you cannot have multiple +.Fn CURVNET_SET +calls in the same block. +.Pp +.Em NOTE: +As the previous state is saved on the stack, a +.Fn CURVNET_RESTORE +call has to be in the same block as the +.Fn CURVNET_SET +call or in a subblock with the same idea of the saved instances as the +outer block. +.Pp +.Em NOTE: +As each macro is a set of operations and, as previously explained, cannot +be put into its own block when defined, one cannot conditionally set +the current vnet context. +The following will +.Em not +work: +.Bd -literal -offset indent +if (condition) + CURVNET_SET(vnet); +.Ed +.Pp +nor would this work: +.Bd -literal -offset indent +if (condition) { + CURVNET_SET(vnet); +} +CURVNET_RESTORE(); +.Ed +.Pp +.\" +Sometimes one needs to loop over all virtual instances, for example to update +virtual from global state, to run a function from a +.Xr callout 9 +for each instance, etc. +For those cases the +.Fn VNET_ITERATOR_DECL +and +.Fn VNET_FOREACH +macros are provided. +The former macro defines the variable that iterates over the loop, +and the latter loops over all of the virtual network stack instances. +See +.Sx "Locking" +for how to savely traverse the list of all virtual instances. +.Pp +.\" +The +.Fn IS_DEFAULT_VNET +macro provides a safe way to check whether the currently active instance is the +unrestricted default network stack of the base system +.Pq Vt vnet0 . +.Pp +.\" +The +.Fn VNET_ASSERT +macro provides a way to conditionally add assertions that are only active with +.Cd "options VIMAGE" +compiled in and either +.Cd "options VNET_DEBUG" +or +.Cd "options INVARIANTS" +enabled as well. +It uses the same semantics as +.Xr KASSERT 9 . +.\" ------------------------------------------------------------ +.Ss "Locking" +.\" +For public access to the list of virtual network stack instances +e.g., by the +.Fn VNET_FOREACH +macro, read locks are provided. +Macros are used to abstract from the actual type of the locks. +If a caller may sleep while traversing the list, it must use the +.Fn VNET_LIST_RLOCK +and +.Fn VNET_LIST_RUNLOCK +macros. +Otherwise, the caller can use +.Fn VNET_LIST_RLOCK_NOSLEEP +and +.Fn VNET_LIST_RUNLOCK_NOSLEEP . +.\" ------------------------------------------------------------ +.Ss "Startup and Teardown Functions" +.\" +To start or tear down a virtual network stack instance the internal +functions +.Fn vnet_alloc +and +.Fn vnet_destroy +are provided and called from the jail framework. +They run the publicly provided methods to handle network stack +startup and teardown. +.Pp +For public control, the system startup interface has been enhanced +to not only handle a system boot but to also handle a virtual +network stack startup and teardown. +To the base system the +.Fn VNET_SYSINIT +and +.Fn VNET_SYSUNINIT +macros look exactly as if there were no virtual network stack. +In fact, if +.Cd "options VIMAGE" +is not compiled in they are compiled to the standard +.Fn SYSINIT +macros. +In addition to that they are run for each virtual network stack +when starting or, in reverse order, when shutting down. +.\" ------------------------------------------------------------ +.Ss "Eventhandlers" +.\" +Eventhandlers can be handled in two ways: +.Pp +.Bl -enum -offset indent -compact +.It +save the +.Em tags +returned in each virtual instance and properly free the eventhandlers +on teardown using those, or +.It +use one eventhandler that will iterate over all virtual network +stack instances. +.El +.Pp +For the first case one can just use the normal +.Xr EVENTHANDLER 9 +functions, while for the second case the +.Fn VNET_GLOBAL_EVENTHANDLER_REGISTER +and +.Fn VNET_GLOBAL_EVENTHANDLER_REGISTER_TAG +macros are provided. +These differ in that +.Fn VNET_GLOBAL_EVENTHANDLER_REGISTER_TAG +takes an extra first argument that will carry the +.Fa "tag" +upon return. +Eventhandlers registered with either of these will not run +.Fa func +directly but +.Fa func +will be called from an internal iterator function for each vnet. +Both macros can only be used for eventhandlers that do not take +additional arguments, as the variadic arguments from an +.Xr EVENTHANDLER_INVOKE 9 +call will be ignored. +.\" ------------------------------------------------------------ +.Ss "Sysctl Handling" +.\" +A +.Xr sysctl 9 +can be virtualized by using one of the +.Fn SYSCTL_VNET_* +macros. +.Pp +They take the same arguments as the standard +.Xr sysctl 9 +functions, with the only difference, that the +.Fa ptr +argument has to be passed as +.Ql &VNET_NAME(foo) +instead of +.Ql &foo +so that the variable can be selected from the correct memory +region of the virtual network stack instance of the caller. +.Pp +For the very rare case a sysctl handler function would want to +handle +.Fa arg1 +itself the +.Fn VNET_SYSCTL_ARG req arg1 +is provided that will translate the +.Fa arg1 +argument to the correct memory address in the virtual network stack +context of the caller. +.\" ------------------------------------------------------------ +.Sh SEE ALSO +.Xr jail 2 , +.Xr kvm 3 , +.Xr EVENTHANDLER 9 , +.\" .Xr pcpu 9 , +.Xr KASSERT 9 , +.Xr sysctl 9 +.\" .Xr SYSINIT 9 +.Sh HISTORY +The virtual network stack implementation first appeared in +.Fx 8.0 . +.Sh AUTHORS +This manual page was written by +.An Bjoern A. Zeeb, CK Software GmbH, +under sponsorship from the FreeBSD Foundation. From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 12:00:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07057E1F; Thu, 20 Nov 2014 12:00:33 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id ECC9A2639; Thu, 20 Nov 2014 12:00:29 +0000 (UTC) Message-ID: <546DD7BB.90004@FreeBSD.org> Date: Thu, 20 Nov 2014 14:59:55 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Bruce Evans , Warner Losh Subject: Re: svn commit: r274721 - head/sys/geom/part References: <201411191855.sAJItShA048381@svn.freebsd.org> <20141120150210.P976@besplex.bde.org> In-Reply-To: <20141120150210.P976@besplex.bde.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 12:00:33 -0000 On 20.11.2014 07:38, Bruce Evans wrote: > On Wed, 19 Nov 2014, Warner Losh wrote: > >> Log: >> The number of BSD partitions is variable. Return the proper number >> (which is in basetable->gpt_entries). >> >> Submitted by: ae@ >> >> Modified: >> head/sys/geom/part/g_part_bsd.c >> >> Modified: head/sys/geom/part/g_part_bsd.c >> ============================================================================== >> >> --- head/sys/geom/part/g_part_bsd.c Wed Nov 19 18:19:21 2014 >> (r274720) >> +++ head/sys/geom/part/g_part_bsd.c Wed Nov 19 18:55:27 2014 >> (r274721) >> @@ -521,7 +521,7 @@ g_part_bsd_ioctl(struct g_part_table *ba >> >> table = (struct g_part_bsd_table *)basetable; >> p = table->bbarea + pp->sectorsize; >> - return (bsd_disklabel_le_dec(p, data, MAXPARTITIONS)); >> + return (bsd_disklabel_le_dec(p, data, basetable->gpt_entries)); >> } >> default: >> return (ENOIOCTL); > > How can this work? I think you are implementing DIOCGDINFO. This returns > a struct disklabel, which is limited by binary compatibility to the > historical number of partitions (8). So this ioctl just cannot support > more than 8 partitions. The best that could happen is for > bsd_disklabel_le_dec() to return an error in this case. But it actually > does essentially the reverse -- you pass it the maximum supported by the > ioctl, and it returns an error if the actual number is larger. So > MAXPARTITIONS was correct if this is to implement DIOCGDINFO. Yes, you are right. The size is hardcoded in the DIOCGDINFO and this can lead to out of the bound access in the application that uses it. Sorry for wrong suggestion. -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 14:18:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65230DB0; Thu, 20 Nov 2014 14:18:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51710F09; Thu, 20 Nov 2014 14:18:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKEI89V099111; Thu, 20 Nov 2014 14:18:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKEI8Bu099107; Thu, 20 Nov 2014 14:18:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201411201418.sAKEI8Bu099107@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Nov 2014 14:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274749 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 14:18:08 -0000 Author: emaste Date: Thu Nov 20 14:18:07 2014 New Revision: 274749 URL: https://svnweb.freebsd.org/changeset/base/274749 Log: Spell out "Windows" - no need to censor it in a man page Modified: head/share/man/man4/splash.4 Modified: head/share/man/man4/splash.4 ============================================================================== --- head/share/man/man4/splash.4 Thu Nov 20 11:33:38 2014 (r274748) +++ head/share/man/man4/splash.4 Thu Nov 20 14:18:07 2014 (r274749) @@ -66,7 +66,7 @@ Currently the following decoder modules .Pp .Bl -tag -width splash_decoder -compact .It Pa splash_bmp.ko -W*ndows BMP file decoder. +Windows BMP file decoder. While the BMP file format allows images of various color depths, this decoder currently only handles 256 color bitmaps. Bitmaps of other color depths will not be displayed. From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 15:29:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19122B4C; Thu, 20 Nov 2014 15:29:48 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 677CF2556; Thu, 20 Nov 2014 15:29:46 +0000 (UTC) Message-ID: <546E08BA.1020707@FreeBSD.org> Date: Thu, 20 Nov 2014 18:28:58 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> <546CDABC.9020103@FreeBSD.org> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H8gBs3C9UWoR1IVOFkPWK6UlvE9a0tTbU" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 15:29:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --H8gBs3C9UWoR1IVOFkPWK6UlvE9a0tTbU Content-Type: multipart/mixed; boundary="------------090804010600000704080804" This is a multi-part message in MIME format. --------------090804010600000704080804 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 19.11.2014 21:49, Warner Losh wrote: >=20 > On Nov 19, 2014, at 11:00 AM, Andrey V. Elsukov wrote:= >=20 >> On 19.11.2014 19:20, Warner Losh wrote: >>>> Probably you need to use basetable->gpt_entries here instead of=20 >>>> MAXPARTITIONS. >>> >>> I=92m having trouble connecting the dots between GPT and BSDlabels. W= hy >>> would this field be relevant? Is it just poorly named? MAXPARTITIONS >> >> gpt_entries isn't related to GPT, it is `geom partition table's` numbe= r >> of partitions entries. Each instance of partition table (i.e. geom) ca= n >> have own number of partitions. MBR always has 4, but GPT or BSD can ha= ve >> different numbers. >=20 > Ah, OK. Thanks for the explanation. I understand. I=92ll work up a patc= h. Hi, Warner since there are some reports about strange behavior of old utilities after this commit, maybe we won't repair them by this way? What you think about this path? --=20 WBR, Andrey V. Elsukov --------------090804010600000704080804 Content-Type: text/x-patch; name="fsck.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="fsck.diff" Index: head/sbin/fsck/fsck.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head/sbin/fsck/fsck.c (revision 274736) +++ head/sbin/fsck/fsck.c (working copy) @@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define FSTYPENAMES -#include +#include #include =20 #include @@ -85,6 +84,17 @@ static const char *getfslab(const char *); static void usage(void) __dead2; static int isok(struct fstab *); =20 +static struct { + const char *ptype; + const char *name; +} ptype_map[] =3D { + { "ufs", "ffs" }, + { "ffs", "ffs" }, + { "fat", "msdosfs" }, + { "efi", "msdosfs" }, + { NULL, NULL }, +}; + int main(int argc, char *argv[]) { @@ -535,41 +545,27 @@ mangle(char *opts, int *argcp, const char ** volat *maxargcp =3D maxargc; } =20 - static const char * getfslab(const char *str) { - struct disklabel dl; - int fd; - char p; - const char *vfstype; - u_char t; + struct diocgattr_arg attr; + int fd, i; =20 - /* deduce the file system type from the disk label */ if ((fd =3D open(str, O_RDONLY)) =3D=3D -1) err(1, "cannot open `%s'", str); =20 - if (ioctl(fd, DIOCGDINFO, &dl) =3D=3D -1) { + strncpy(attr.name, "PART::type", sizeof(attr.name)); + memset(&attr.value, 0, sizeof(attr.value)); + attr.len =3D sizeof(attr.value); + if (ioctl(fd, DIOCGATTR, &attr) =3D=3D -1) { (void) close(fd); return(NULL); } - (void) close(fd); - - p =3D str[strlen(str) - 1]; - - if ((p - 'a') >=3D dl.d_npartitions) - errx(1, "partition `%s' is not defined on disk", str); - - if ((t =3D dl.d_partitions[p - 'a'].p_fstype) >=3D FSMAXTYPES)=20 - errx(1, "partition `%s' is not of a legal vfstype", - str); - - if ((vfstype =3D fstypenames[t]) =3D=3D NULL) - errx(1, "vfstype `%s' on partition `%s' is not supported", - fstypenames[t], str); - - return vfstype; + for (i =3D 0; ptype_map[i].ptype !=3D NULL; i++) + if (strstr(attr.value.str, ptype_map[i].ptype) !=3D NULL) + return (ptype_map[i].name); + return (NULL); } =20 =20 --------------090804010600000704080804-- --H8gBs3C9UWoR1IVOFkPWK6UlvE9a0tTbU 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJUbgjHAAoJEAHF6gQQyKF6QYAIAISA/Oj5atqC6MS/2N7+SceK 4QpQB78Pd638a04T3F+3enAm1tB5DYEPwqaa0Lfj5wN7Fwl38+M70VvPvkZBtcpt krgTIysyJLB3y6iNRJ80Hfo/Dp+RCyTlYA6MND7ih5IcxTTOEMfsXZjOoCj7rCQJ 5gF/BkVxxvVH56bew78nzJ/zYKigKyPtUN7LIM/cBKlVtK9fbaSLeZLYYpdBZ4au nUHA8L9hImvl6UDUAS5p7cbyhts1HYyGhO7APe9FiZIxCHPTmwR1g7g5XxeaF2td iyEoMVJHrdcdbDUV410KzebQy71QVH9T4XlH1GALY5mX3gqiTpJQDUioi0UQ8Sg= =ecw7 -----END PGP SIGNATURE----- --H8gBs3C9UWoR1IVOFkPWK6UlvE9a0tTbU-- From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 16:31:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2D49B05; Thu, 20 Nov 2014 16:31:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 840491CA; Thu, 20 Nov 2014 16:31:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKGVWE7015912; Thu, 20 Nov 2014 16:31:32 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKGVWTh015911; Thu, 20 Nov 2014 16:31:32 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411201631.sAKGVWTh015911@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 20 Nov 2014 16:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274750 - head/sbin/fsck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 16:31:32 -0000 Author: ae Date: Thu Nov 20 16:31:31 2014 New Revision: 274750 URL: https://svnweb.freebsd.org/changeset/base/274750 Log: Use geom attribute "PART::type" to determine partition type and choose relevant fsck_xxx utility. MFC after: 1 week Modified: head/sbin/fsck/fsck.c Modified: head/sbin/fsck/fsck.c ============================================================================== --- head/sbin/fsck/fsck.c Thu Nov 20 14:18:07 2014 (r274749) +++ head/sbin/fsck/fsck.c Thu Nov 20 16:31:31 2014 (r274750) @@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define FSTYPENAMES -#include +#include #include #include @@ -81,10 +80,21 @@ static void addentry(struct fstypelist * static void maketypelist(char *); static void catopt(char **, const char *); static void mangle(char *, int *, const char ** volatile *, int *); -static const char *getfslab(const char *); +static const char *getfstype(const char *); static void usage(void) __dead2; static int isok(struct fstab *); +static struct { + const char *ptype; + const char *name; +} ptype_map[] = { + { "ufs", "ffs" }, + { "ffs", "ffs" }, + { "fat", "msdosfs" }, + { "efi", "msdosfs" }, + { NULL, NULL }, +}; + int main(int argc, char *argv[]) { @@ -203,7 +213,7 @@ main(int argc, char *argv[]) if ((fs = getfsfile(spec)) == NULL && (fs = getfsspec(spec)) == NULL) { if (vfstype == NULL) - vfstype = getfslab(spec); + vfstype = getfstype(spec); if (vfstype == NULL) errx(1, "Could not determine filesystem type"); type = vfstype; @@ -535,41 +545,27 @@ mangle(char *opts, int *argcp, const cha *maxargcp = maxargc; } - static const char * -getfslab(const char *str) +getfstype(const char *str) { - struct disklabel dl; - int fd; - char p; - const char *vfstype; - u_char t; + struct diocgattr_arg attr; + int fd, i; - /* deduce the file system type from the disk label */ if ((fd = open(str, O_RDONLY)) == -1) err(1, "cannot open `%s'", str); - if (ioctl(fd, DIOCGDINFO, &dl) == -1) { + strncpy(attr.name, "PART::type", sizeof(attr.name)); + memset(&attr.value, 0, sizeof(attr.value)); + attr.len = sizeof(attr.value); + if (ioctl(fd, DIOCGATTR, &attr) == -1) { (void) close(fd); return(NULL); } - (void) close(fd); - - p = str[strlen(str) - 1]; - - if ((p - 'a') >= dl.d_npartitions) - errx(1, "partition `%s' is not defined on disk", str); - - if ((t = dl.d_partitions[p - 'a'].p_fstype) >= FSMAXTYPES) - errx(1, "partition `%s' is not of a legal vfstype", - str); - - if ((vfstype = fstypenames[t]) == NULL) - errx(1, "vfstype `%s' on partition `%s' is not supported", - fstypenames[t], str); - - return vfstype; + for (i = 0; ptype_map[i].ptype != NULL; i++) + if (strstr(attr.value.str, ptype_map[i].ptype) != NULL) + return (ptype_map[i].name); + return (NULL); } From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 17:03:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A9BC425; Thu, 20 Nov 2014 17:03:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47858834; Thu, 20 Nov 2014 17:03:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKH3fLe032206; Thu, 20 Nov 2014 17:03:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKH3fmH032205; Thu, 20 Nov 2014 17:03:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201411201703.sAKH3fmH032205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 20 Nov 2014 17:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274751 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 17:03:41 -0000 Author: andrew Date: Thu Nov 20 17:03:40 2014 New Revision: 274751 URL: https://svnweb.freebsd.org/changeset/base/274751 Log: The ranges parent bus address may just be a tag to the entry in the parent node. Take this in to account by searching until we find the range for the root node. Differential Revision: https://reviews.freebsd.org/D1160 Reviewed by: ian Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Thu Nov 20 16:31:31 2014 (r274750) +++ head/sys/dev/fdt/fdt_common.c Thu Nov 20 17:03:40 2014 (r274751) @@ -1,7 +1,9 @@ /*- - * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2009-2014 The FreeBSD Foundation * All rights reserved. * + * This software was developed by Andrew Turner under sponsorship from + * the FreeBSD Foundation. * This software was developed by Semihalf under sponsorship from * the FreeBSD Foundation. * @@ -64,12 +66,84 @@ vm_offset_t fdt_immr_size; struct fdt_ic_list fdt_ic_list_head = SLIST_HEAD_INITIALIZER(fdt_ic_list_head); +static int +fdt_get_range_by_busaddr(phandle_t node, u_long addr, u_long *base, + u_long *size) +{ + pcell_t ranges[32], *rangesptr; + pcell_t addr_cells, size_cells, par_addr_cells; + u_long bus_addr, par_bus_addr, pbase, psize; + int err, i, len, tuple_size, tuples; + + if ((fdt_addrsize_cells(node, &addr_cells, &size_cells)) != 0) + return (ENXIO); + /* + * Process 'ranges' property. + */ + par_addr_cells = fdt_parent_addr_cells(node); + if (par_addr_cells > 2) { + return (ERANGE); + } + + len = OF_getproplen(node, "ranges"); + if (len < 0) + return (-1); + if (len > sizeof(ranges)) + return (ENOMEM); + if (len == 0) { + *base = 0; + *size = ULONG_MAX; + return (0); + } + + if (OF_getprop(node, "ranges", ranges, sizeof(ranges)) <= 0) + return (EINVAL); + + tuple_size = addr_cells + par_addr_cells + size_cells; + tuples = len / (tuple_size * sizeof(cell_t)); + + if (fdt_ranges_verify(ranges, tuples, par_addr_cells, + addr_cells, size_cells)) { + return (ERANGE); + } + *base = 0; + *size = 0; + + for (i = 0; i < tuples; i++) { + rangesptr = &ranges[i * tuple_size]; + + bus_addr = fdt_data_get((void *)rangesptr, addr_cells); + if (bus_addr != addr) + continue; + rangesptr += addr_cells; + + par_bus_addr = fdt_data_get((void *)rangesptr, par_addr_cells); + rangesptr += par_addr_cells; + + err = fdt_get_range_by_busaddr(OF_parent(node), par_bus_addr, + &pbase, &psize); + if (err > 0) + return (err); + if (err == 0) + *base = pbase; + else + *base = par_bus_addr; + + *size = fdt_data_get((void *)rangesptr, size_cells); + + return (0); + } + + return (EINVAL); +} + int fdt_get_range(phandle_t node, int range_id, u_long *base, u_long *size) { pcell_t ranges[6], *rangesptr; pcell_t addr_cells, size_cells, par_addr_cells; - int len, tuple_size, tuples; + u_long par_bus_addr, pbase, psize; + int err, len, tuple_size, tuples; if ((fdt_addrsize_cells(node, &addr_cells, &size_cells)) != 0) return (ENXIO); @@ -109,8 +183,17 @@ fdt_get_range(phandle_t node, int range_ *base = fdt_data_get((void *)rangesptr, addr_cells); rangesptr += addr_cells; - *base += fdt_data_get((void *)rangesptr, par_addr_cells); + + par_bus_addr = fdt_data_get((void *)rangesptr, par_addr_cells); rangesptr += par_addr_cells; + + err = fdt_get_range_by_busaddr(OF_parent(node), par_bus_addr, + &pbase, &psize); + if (err == 0) + *base += pbase; + else + *base += par_bus_addr; + *size = fdt_data_get((void *)rangesptr, size_cells); return (0); } @@ -292,7 +375,7 @@ fdt_parent_addr_cells(phandle_t node) /* Find out #address-cells of the superior bus. */ if (OF_searchprop(OF_parent(node), "#address-cells", &addr_cells, sizeof(addr_cells)) <= 0) - addr_cells = 2; + return (2); return ((int)fdt32_to_cpu(addr_cells)); } From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 17:06:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 653C0905; Thu, 20 Nov 2014 17:06:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51C588B4; Thu, 20 Nov 2014 17:06:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKH6ho3032628; Thu, 20 Nov 2014 17:06:43 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKH6fVP032621; Thu, 20 Nov 2014 17:06:41 GMT (envelope-from br@FreeBSD.org) Message-Id: <201411201706.sAKH6fVP032621@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 20 Nov 2014 17:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274752 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 17:06:43 -0000 Author: br Date: Thu Nov 20 17:06:41 2014 New Revision: 274752 URL: https://svnweb.freebsd.org/changeset/base/274752 Log: Add L2-cache writeback/flush operations. Supported 32,128-byte line-size, else ignored. Cavium Networks also ignored as it has non-standard config registers. Obtained from: NetBSD Sponsored by: DARPA, AFRL Modified: head/sys/mips/include/cache_mipsNN.h head/sys/mips/include/cpuinfo.h head/sys/mips/include/cpuregs.h head/sys/mips/mips/cache.c head/sys/mips/mips/cache_mipsNN.c head/sys/mips/mips/cpu.c Modified: head/sys/mips/include/cache_mipsNN.h ============================================================================== --- head/sys/mips/include/cache_mipsNN.h Thu Nov 20 17:03:40 2014 (r274751) +++ head/sys/mips/include/cache_mipsNN.h Thu Nov 20 17:06:41 2014 (r274752) @@ -67,5 +67,15 @@ void mipsNN_pdcache_wbinv_range_index_12 void mipsNN_pdcache_inv_range_128(vm_offset_t, vm_size_t); void mipsNN_pdcache_wb_range_128(vm_offset_t, vm_size_t); #endif +void mipsNN_sdcache_wbinv_all_32(void); +void mipsNN_sdcache_wbinv_range_32(vm_paddr_t, vm_size_t); +void mipsNN_sdcache_wbinv_range_index_32(vm_paddr_t, vm_size_t); +void mipsNN_sdcache_inv_range_32(vm_paddr_t, vm_size_t); +void mipsNN_sdcache_wb_range_32(vm_paddr_t, vm_size_t); +void mipsNN_sdcache_wbinv_all_128(void); +void mipsNN_sdcache_wbinv_range_128(vm_paddr_t, vm_size_t); +void mipsNN_sdcache_wbinv_range_index_128(vm_paddr_t, vm_size_t); +void mipsNN_sdcache_inv_range_128(vm_paddr_t, vm_size_t); +void mipsNN_sdcache_wb_range_128(vm_paddr_t, vm_size_t); #endif /* _MACHINE_CACHE_MIPSNN_H_ */ Modified: head/sys/mips/include/cpuinfo.h ============================================================================== --- head/sys/mips/include/cpuinfo.h Thu Nov 20 17:03:40 2014 (r274751) +++ head/sys/mips/include/cpuinfo.h Thu Nov 20 17:06:41 2014 (r274752) @@ -67,6 +67,12 @@ struct mips_cpuinfo { u_int8_t dc_nways; u_int16_t dc_nsets; } l1; + struct { + u_int32_t dc_size; + u_int8_t dc_linesize; + u_int8_t dc_nways; + u_int16_t dc_nsets; + } l2; }; extern struct mips_cpuinfo cpuinfo; Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Thu Nov 20 17:03:40 2014 (r274751) +++ head/sys/mips/include/cpuregs.h Thu Nov 20 17:06:41 2014 (r274752) @@ -550,6 +550,13 @@ #define MIPS_CONFIG1_EP 0x00000002 /* EJTAG implemented */ #define MIPS_CONFIG1_FP 0x00000001 /* FPU implemented */ +#define MIPS_CONFIG2_SA_SHIFT 0 /* Secondary cache associativity */ +#define MIPS_CONFIG2_SA_MASK 0xf +#define MIPS_CONFIG2_SL_SHIFT 4 /* Secondary cache line size */ +#define MIPS_CONFIG2_SL_MASK 0xf +#define MIPS_CONFIG2_SS_SHIFT 8 /* Secondary cache sets per way */ +#define MIPS_CONFIG2_SS_MASK 0xf + #define MIPS_CONFIG4_MMUSIZEEXT 0x000000FF /* bits 7.. 0 MMU Size Extension */ #define MIPS_CONFIG4_MMUEXTDEF 0x0000C000 /* bits 15.14 MMU Extension Definition */ #define MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT 0x00004000 /* This values denotes CONFIG4 bits */ Modified: head/sys/mips/mips/cache.c ============================================================================== --- head/sys/mips/mips/cache.c Thu Nov 20 17:03:40 2014 (r274751) +++ head/sys/mips/mips/cache.c Thu Nov 20 17:06:41 2014 (r274752) @@ -260,19 +260,42 @@ mips_config_cache(struct mips_cpuinfo * panic("no pdcache_wb_range"); } - /* XXXMIPS: No secondary cache handlers yet */ -#ifdef notyet - if (mips_sdcache_size) { - if (!mips_cache_ops.mco_sdcache_wbinv_all) - panic("no sdcache_wbinv_all"); - if (!mips_cache_ops.mco_sdcache_wbinv_range) - panic("no sdcache_wbinv_range"); - if (!mips_cache_ops.mco_sdcache_wbinv_range_index) - panic("no sdcache_wbinv_range_index"); - if (!mips_cache_ops.mco_sdcache_inv_range) - panic("no sdcache_inv_range"); - if (!mips_cache_ops.mco_sdcache_wb_range) - panic("no sdcache_wb_range"); + /* L2 data cache */ + if (!cpuinfo->l2.dc_size) { + /* No L2 found, ignore */ + return; } + + switch (cpuinfo->l2.dc_linesize) { + case 32: + mips_cache_ops.mco_sdcache_wbinv_all = + mipsNN_sdcache_wbinv_all_32; + mips_cache_ops.mco_sdcache_wbinv_range = + mipsNN_sdcache_wbinv_range_32; + mips_cache_ops.mco_sdcache_wbinv_range_index = + mipsNN_sdcache_wbinv_range_index_32; + mips_cache_ops.mco_sdcache_inv_range = + mipsNN_sdcache_inv_range_32; + mips_cache_ops.mco_sdcache_wb_range = + mipsNN_sdcache_wb_range_32; + break; + case 128: + mips_cache_ops.mco_sdcache_wbinv_all = + mipsNN_sdcache_wbinv_all_128; + mips_cache_ops.mco_sdcache_wbinv_range = + mipsNN_sdcache_wbinv_range_128; + mips_cache_ops.mco_sdcache_wbinv_range_index = + mipsNN_sdcache_wbinv_range_index_128; + mips_cache_ops.mco_sdcache_inv_range = + mipsNN_sdcache_inv_range_128; + mips_cache_ops.mco_sdcache_wb_range = + mipsNN_sdcache_wb_range_128; + break; + default: +#ifdef CACHE_DEBUG + printf(" no sdcache ops for %d byte lines", + cpuinfo->l2.dc_linesize); #endif + break; + } } Modified: head/sys/mips/mips/cache_mipsNN.c ============================================================================== --- head/sys/mips/mips/cache_mipsNN.c Thu Nov 20 17:03:40 2014 (r274751) +++ head/sys/mips/mips/cache_mipsNN.c Thu Nov 20 17:06:41 2014 (r274752) @@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$"); #define round_line32(x) (((x) + 31) & ~31) #define trunc_line32(x) ((x) & ~31) +#define round_line128(x) (((x) + 127) & ~127) +#define trunc_line128(x) ((x) & ~127) + #if defined(CPU_NLM) static __inline void xlp_sync(void) @@ -100,6 +103,10 @@ static int pdcache_size; static int pdcache_stride; static int pdcache_loopcount; static int pdcache_way_mask; +static int sdcache_size; +static int sdcache_stride; +static int sdcache_loopcount; +static int sdcache_way_mask; void mipsNN_cache_init(struct mips_cpuinfo * cpuinfo) @@ -142,6 +149,11 @@ mipsNN_cache_init(struct mips_cpuinfo * pdcache_size = cpuinfo->l1.dc_size; pdcache_way_mask = cpuinfo->l1.dc_nways - 1; + sdcache_stride = cpuinfo->l2.dc_nsets * cpuinfo->l2.dc_linesize; + sdcache_loopcount = cpuinfo->l2.dc_nways; + sdcache_size = cpuinfo->l2.dc_size; + sdcache_way_mask = cpuinfo->l2.dc_nways - 1; + #define CACHE_DEBUG #ifdef CACHE_DEBUG printf("Cache info:\n"); @@ -636,3 +648,195 @@ mipsNN_pdcache_wb_range_128(vm_offset_t } #endif + +void +mipsNN_sdcache_wbinv_all_32(void) +{ + vm_offset_t va = MIPS_PHYS_TO_KSEG0(0); + vm_offset_t eva = va + sdcache_size; + + while (va < eva) { + cache_r4k_op_32lines_32(va, + CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); + va += (32 * 32); + } +} + +void +mipsNN_sdcache_wbinv_range_32(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva = round_line32(va + size); + + va = trunc_line32(va); + + while ((eva - va) >= (32 * 32)) { + cache_r4k_op_32lines_32(va, + CACHE_R4K_SD|CACHEOP_R4K_HIT_WB_INV); + va += (32 * 32); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB_INV); + va += 32; + } +} + +void +mipsNN_sdcache_wbinv_range_index_32(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + /* + * Since we're doing Index ops, we expect to not be able + * to access the address we've been given. So, get the + * bits that determine the cache index, and make a KSEG0 + * address out of them. + */ + va = MIPS_PHYS_TO_KSEG0(va & (sdcache_size - 1)); + + eva = round_line32(va + size); + va = trunc_line32(va); + + while ((eva - va) >= (32 * 32)) { + cache_r4k_op_32lines_32(va, + CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); + va += (32 * 32); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); + va += 32; + } +} + +void +mipsNN_sdcache_inv_range_32(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva = round_line32(va + size); + + va = trunc_line32(va); + + while ((eva - va) >= (32 * 32)) { + cache_r4k_op_32lines_32(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_INV); + va += (32 * 32); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_INV); + va += 32; + } +} + +void +mipsNN_sdcache_wb_range_32(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva = round_line32(va + size); + + va = trunc_line32(va); + + while ((eva - va) >= (32 * 32)) { + cache_r4k_op_32lines_32(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB); + va += (32 * 32); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB); + va += 32; + } +} + +void +mipsNN_sdcache_wbinv_all_128(void) +{ + vm_offset_t va = MIPS_PHYS_TO_KSEG0(0); + vm_offset_t eva = va + sdcache_size; + + while (va < eva) { + cache_r4k_op_32lines_128(va, + CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); + va += (32 * 128); + } +} + +void +mipsNN_sdcache_wbinv_range_128(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva = round_line128(va + size); + + va = trunc_line128(va); + + while ((eva - va) >= (32 * 128)) { + cache_r4k_op_32lines_128(va, + CACHE_R4K_SD|CACHEOP_R4K_HIT_WB_INV); + va += (32 * 128); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB_INV); + va += 128; + } +} + +void +mipsNN_sdcache_wbinv_range_index_128(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva; + + /* + * Since we're doing Index ops, we expect to not be able + * to access the address we've been given. So, get the + * bits that determine the cache index, and make a KSEG0 + * address out of them. + */ + va = MIPS_PHYS_TO_KSEG0(va & (sdcache_size - 1)); + + eva = round_line128(va + size); + va = trunc_line128(va); + + while ((eva - va) >= (32 * 128)) { + cache_r4k_op_32lines_128(va, + CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); + va += (32 * 128); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); + va += 128; + } +} + +void +mipsNN_sdcache_inv_range_128(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva = round_line128(va + size); + + va = trunc_line128(va); + + while ((eva - va) >= (32 * 128)) { + cache_r4k_op_32lines_128(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_INV); + va += (32 * 128); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_INV); + va += 128; + } +} + +void +mipsNN_sdcache_wb_range_128(vm_offset_t va, vm_size_t size) +{ + vm_offset_t eva = round_line128(va + size); + + va = trunc_line128(va); + + while ((eva - va) >= (32 * 128)) { + cache_r4k_op_32lines_128(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB); + va += (32 * 128); + } + + while (va < eva) { + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB); + va += 128; + } +} Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Thu Nov 20 17:03:40 2014 (r274751) +++ head/sys/mips/mips/cpu.c Thu Nov 20 17:06:41 2014 (r274752) @@ -73,6 +73,7 @@ mips_get_identity(struct mips_cpuinfo *c u_int32_t prid; u_int32_t cfg0; u_int32_t cfg1; + u_int32_t cfg2; #if defined(CPU_CNMIPS) u_int32_t cfg4; #endif @@ -186,6 +187,31 @@ mips_get_identity(struct mips_cpuinfo *c * cpuinfo->l1.ic_nsets * cpuinfo->l1.ic_nways; cpuinfo->l1.dc_size = cpuinfo->l1.dc_linesize * cpuinfo->l1.dc_nsets * cpuinfo->l1.dc_nways; + +#ifndef CPU_CNMIPS + /* L2 cache */ + if (!(cfg1 & MIPS_CONFIG_CM)) { + /* We don't have valid cfg2 register */ + return; + } + + cfg2 = mips_rd_config2(); + + tmp = (cfg2 >> MIPS_CONFIG2_SL_SHIFT) & MIPS_CONFIG2_SL_MASK; + if (0 < tmp && tmp <= 7) + cpuinfo->l2.dc_linesize = 2 << tmp; + + tmp = (cfg2 >> MIPS_CONFIG2_SS_SHIFT) & MIPS_CONFIG2_SS_MASK; + if (0 <= tmp && tmp <= 7) + cpuinfo->l2.dc_nsets = 64 << tmp; + + tmp = (cfg2 >> MIPS_CONFIG2_SA_SHIFT) & MIPS_CONFIG2_SA_MASK; + if (0 <= tmp && tmp <= 7) + cpuinfo->l2.dc_nways = tmp + 1; + + cpuinfo->l2.dc_size = cpuinfo->l2.dc_linesize + * cpuinfo->l2.dc_nsets * cpuinfo->l2.dc_nways; +#endif } void @@ -355,6 +381,7 @@ static driver_t cpu_driver = { static int cpu_probe(device_t dev) { + return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 17:08:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD633AF2; Thu, 20 Nov 2014 17:08:36 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E96C8FF; Thu, 20 Nov 2014 17:08:36 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id ex7so9400830wid.9 for ; Thu, 20 Nov 2014 09:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=e0n/YDzP/XuM0Y8slpNuCEJBWX5PdSpV6o96uK8gZaE=; b=JgfNe+Ps9JJ7cRFLV3t7blpvBVrsfr0g9bSNNBXTgv65SEtT+zms3R3J81uBD+CuiY /coMsaKYXxG4ca/8mDT6y0ALidQau2qZYXeiduSg+069xxOjQAkWogigNS/G7QHMAcuQ +kyZFPdW6uI+HSRfzFnca46B2OPg73mbbLnZNg4WviCnYDVwCM6xp+1AIxBqnko0sg6m 5wr5vMCWs0NOeir3+utCvikH6PYmyZfEa+lTMETkh6qHFQupLAAd7J6Xi9EWxvj/v30u QBh71VTFEVnMBQWvfQfl7sq/q6KEqZaRm67DDTXwrLIViU7tWr4DOvKv3dhYMlICPDg6 isww== MIME-Version: 1.0 X-Received: by 10.180.108.35 with SMTP id hh3mr24591337wib.59.1416503314390; Thu, 20 Nov 2014 09:08:34 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Thu, 20 Nov 2014 09:08:34 -0800 (PST) In-Reply-To: <201411201706.sAKH6fVP032621@svn.freebsd.org> References: <201411201706.sAKH6fVP032621@svn.freebsd.org> Date: Thu, 20 Nov 2014 09:08:34 -0800 X-Google-Sender-Auth: Ki-54xTZJJboCFczV0KdCSG1vWs Message-ID: Subject: Re: svn commit: r274752 - in head/sys/mips: include mips From: Adrian Chadd To: Ruslan Bukin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 17:08:36 -0000 Woooooooo! -adrian On 20 November 2014 09:06, Ruslan Bukin wrote: > Author: br > Date: Thu Nov 20 17:06:41 2014 > New Revision: 274752 > URL: https://svnweb.freebsd.org/changeset/base/274752 > > Log: > Add L2-cache writeback/flush operations. Supported 32,128-byte line-size, > else ignored. Cavium Networks also ignored as it has non-standard config > registers. > > Obtained from: NetBSD > Sponsored by: DARPA, AFRL > > Modified: > head/sys/mips/include/cache_mipsNN.h > head/sys/mips/include/cpuinfo.h > head/sys/mips/include/cpuregs.h > head/sys/mips/mips/cache.c > head/sys/mips/mips/cache_mipsNN.c > head/sys/mips/mips/cpu.c > > Modified: head/sys/mips/include/cache_mipsNN.h > ============================================================================== > --- head/sys/mips/include/cache_mipsNN.h Thu Nov 20 17:03:40 2014 (r274751) > +++ head/sys/mips/include/cache_mipsNN.h Thu Nov 20 17:06:41 2014 (r274752) > @@ -67,5 +67,15 @@ void mipsNN_pdcache_wbinv_range_index_12 > void mipsNN_pdcache_inv_range_128(vm_offset_t, vm_size_t); > void mipsNN_pdcache_wb_range_128(vm_offset_t, vm_size_t); > #endif > +void mipsNN_sdcache_wbinv_all_32(void); > +void mipsNN_sdcache_wbinv_range_32(vm_paddr_t, vm_size_t); > +void mipsNN_sdcache_wbinv_range_index_32(vm_paddr_t, vm_size_t); > +void mipsNN_sdcache_inv_range_32(vm_paddr_t, vm_size_t); > +void mipsNN_sdcache_wb_range_32(vm_paddr_t, vm_size_t); > +void mipsNN_sdcache_wbinv_all_128(void); > +void mipsNN_sdcache_wbinv_range_128(vm_paddr_t, vm_size_t); > +void mipsNN_sdcache_wbinv_range_index_128(vm_paddr_t, vm_size_t); > +void mipsNN_sdcache_inv_range_128(vm_paddr_t, vm_size_t); > +void mipsNN_sdcache_wb_range_128(vm_paddr_t, vm_size_t); > > #endif /* _MACHINE_CACHE_MIPSNN_H_ */ > > Modified: head/sys/mips/include/cpuinfo.h > ============================================================================== > --- head/sys/mips/include/cpuinfo.h Thu Nov 20 17:03:40 2014 (r274751) > +++ head/sys/mips/include/cpuinfo.h Thu Nov 20 17:06:41 2014 (r274752) > @@ -67,6 +67,12 @@ struct mips_cpuinfo { > u_int8_t dc_nways; > u_int16_t dc_nsets; > } l1; > + struct { > + u_int32_t dc_size; > + u_int8_t dc_linesize; > + u_int8_t dc_nways; > + u_int16_t dc_nsets; > + } l2; > }; > > extern struct mips_cpuinfo cpuinfo; > > Modified: head/sys/mips/include/cpuregs.h > ============================================================================== > --- head/sys/mips/include/cpuregs.h Thu Nov 20 17:03:40 2014 (r274751) > +++ head/sys/mips/include/cpuregs.h Thu Nov 20 17:06:41 2014 (r274752) > @@ -550,6 +550,13 @@ > #define MIPS_CONFIG1_EP 0x00000002 /* EJTAG implemented */ > #define MIPS_CONFIG1_FP 0x00000001 /* FPU implemented */ > > +#define MIPS_CONFIG2_SA_SHIFT 0 /* Secondary cache associativity */ > +#define MIPS_CONFIG2_SA_MASK 0xf > +#define MIPS_CONFIG2_SL_SHIFT 4 /* Secondary cache line size */ > +#define MIPS_CONFIG2_SL_MASK 0xf > +#define MIPS_CONFIG2_SS_SHIFT 8 /* Secondary cache sets per way */ > +#define MIPS_CONFIG2_SS_MASK 0xf > + > #define MIPS_CONFIG4_MMUSIZEEXT 0x000000FF /* bits 7.. 0 MMU Size Extension */ > #define MIPS_CONFIG4_MMUEXTDEF 0x0000C000 /* bits 15.14 MMU Extension Definition */ > #define MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT 0x00004000 /* This values denotes CONFIG4 bits */ > > Modified: head/sys/mips/mips/cache.c > ============================================================================== > --- head/sys/mips/mips/cache.c Thu Nov 20 17:03:40 2014 (r274751) > +++ head/sys/mips/mips/cache.c Thu Nov 20 17:06:41 2014 (r274752) > @@ -260,19 +260,42 @@ mips_config_cache(struct mips_cpuinfo * > panic("no pdcache_wb_range"); > } > > - /* XXXMIPS: No secondary cache handlers yet */ > -#ifdef notyet > - if (mips_sdcache_size) { > - if (!mips_cache_ops.mco_sdcache_wbinv_all) > - panic("no sdcache_wbinv_all"); > - if (!mips_cache_ops.mco_sdcache_wbinv_range) > - panic("no sdcache_wbinv_range"); > - if (!mips_cache_ops.mco_sdcache_wbinv_range_index) > - panic("no sdcache_wbinv_range_index"); > - if (!mips_cache_ops.mco_sdcache_inv_range) > - panic("no sdcache_inv_range"); > - if (!mips_cache_ops.mco_sdcache_wb_range) > - panic("no sdcache_wb_range"); > + /* L2 data cache */ > + if (!cpuinfo->l2.dc_size) { > + /* No L2 found, ignore */ > + return; > } > + > + switch (cpuinfo->l2.dc_linesize) { > + case 32: > + mips_cache_ops.mco_sdcache_wbinv_all = > + mipsNN_sdcache_wbinv_all_32; > + mips_cache_ops.mco_sdcache_wbinv_range = > + mipsNN_sdcache_wbinv_range_32; > + mips_cache_ops.mco_sdcache_wbinv_range_index = > + mipsNN_sdcache_wbinv_range_index_32; > + mips_cache_ops.mco_sdcache_inv_range = > + mipsNN_sdcache_inv_range_32; > + mips_cache_ops.mco_sdcache_wb_range = > + mipsNN_sdcache_wb_range_32; > + break; > + case 128: > + mips_cache_ops.mco_sdcache_wbinv_all = > + mipsNN_sdcache_wbinv_all_128; > + mips_cache_ops.mco_sdcache_wbinv_range = > + mipsNN_sdcache_wbinv_range_128; > + mips_cache_ops.mco_sdcache_wbinv_range_index = > + mipsNN_sdcache_wbinv_range_index_128; > + mips_cache_ops.mco_sdcache_inv_range = > + mipsNN_sdcache_inv_range_128; > + mips_cache_ops.mco_sdcache_wb_range = > + mipsNN_sdcache_wb_range_128; > + break; > + default: > +#ifdef CACHE_DEBUG > + printf(" no sdcache ops for %d byte lines", > + cpuinfo->l2.dc_linesize); > #endif > + break; > + } > } > > Modified: head/sys/mips/mips/cache_mipsNN.c > ============================================================================== > --- head/sys/mips/mips/cache_mipsNN.c Thu Nov 20 17:03:40 2014 (r274751) > +++ head/sys/mips/mips/cache_mipsNN.c Thu Nov 20 17:06:41 2014 (r274752) > @@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$"); > #define round_line32(x) (((x) + 31) & ~31) > #define trunc_line32(x) ((x) & ~31) > > +#define round_line128(x) (((x) + 127) & ~127) > +#define trunc_line128(x) ((x) & ~127) > + > #if defined(CPU_NLM) > static __inline void > xlp_sync(void) > @@ -100,6 +103,10 @@ static int pdcache_size; > static int pdcache_stride; > static int pdcache_loopcount; > static int pdcache_way_mask; > +static int sdcache_size; > +static int sdcache_stride; > +static int sdcache_loopcount; > +static int sdcache_way_mask; > > void > mipsNN_cache_init(struct mips_cpuinfo * cpuinfo) > @@ -142,6 +149,11 @@ mipsNN_cache_init(struct mips_cpuinfo * > pdcache_size = cpuinfo->l1.dc_size; > pdcache_way_mask = cpuinfo->l1.dc_nways - 1; > > + sdcache_stride = cpuinfo->l2.dc_nsets * cpuinfo->l2.dc_linesize; > + sdcache_loopcount = cpuinfo->l2.dc_nways; > + sdcache_size = cpuinfo->l2.dc_size; > + sdcache_way_mask = cpuinfo->l2.dc_nways - 1; > + > #define CACHE_DEBUG > #ifdef CACHE_DEBUG > printf("Cache info:\n"); > @@ -636,3 +648,195 @@ mipsNN_pdcache_wb_range_128(vm_offset_t > } > > #endif > + > +void > +mipsNN_sdcache_wbinv_all_32(void) > +{ > + vm_offset_t va = MIPS_PHYS_TO_KSEG0(0); > + vm_offset_t eva = va + sdcache_size; > + > + while (va < eva) { > + cache_r4k_op_32lines_32(va, > + CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); > + va += (32 * 32); > + } > +} > + > +void > +mipsNN_sdcache_wbinv_range_32(vm_offset_t va, vm_size_t size) > +{ > + vm_offset_t eva = round_line32(va + size); > + > + va = trunc_line32(va); > + > + while ((eva - va) >= (32 * 32)) { > + cache_r4k_op_32lines_32(va, > + CACHE_R4K_SD|CACHEOP_R4K_HIT_WB_INV); > + va += (32 * 32); > + } > + > + while (va < eva) { > + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB_INV); > + va += 32; > + } > +} > + > +void > +mipsNN_sdcache_wbinv_range_index_32(vm_offset_t va, vm_size_t size) > +{ > + vm_offset_t eva; > + > + /* > + * Since we're doing Index ops, we expect to not be able > + * to access the address we've been given. So, get the > + * bits that determine the cache index, and make a KSEG0 > + * address out of them. > + */ > + va = MIPS_PHYS_TO_KSEG0(va & (sdcache_size - 1)); > + > + eva = round_line32(va + size); > + va = trunc_line32(va); > + > + while ((eva - va) >= (32 * 32)) { > + cache_r4k_op_32lines_32(va, > + CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); > + va += (32 * 32); > + } > + > + while (va < eva) { > + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); > + va += 32; > + } > +} > + > +void > +mipsNN_sdcache_inv_range_32(vm_offset_t va, vm_size_t size) > +{ > + vm_offset_t eva = round_line32(va + size); > + > + va = trunc_line32(va); > + > + while ((eva - va) >= (32 * 32)) { > + cache_r4k_op_32lines_32(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_INV); > + va += (32 * 32); > + } > + > + while (va < eva) { > + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_INV); > + va += 32; > + } > +} > + > +void > +mipsNN_sdcache_wb_range_32(vm_offset_t va, vm_size_t size) > +{ > + vm_offset_t eva = round_line32(va + size); > + > + va = trunc_line32(va); > + > + while ((eva - va) >= (32 * 32)) { > + cache_r4k_op_32lines_32(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB); > + va += (32 * 32); > + } > + > + while (va < eva) { > + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB); > + va += 32; > + } > +} > + > +void > +mipsNN_sdcache_wbinv_all_128(void) > +{ > + vm_offset_t va = MIPS_PHYS_TO_KSEG0(0); > + vm_offset_t eva = va + sdcache_size; > + > + while (va < eva) { > + cache_r4k_op_32lines_128(va, > + CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); > + va += (32 * 128); > + } > +} > + > +void > +mipsNN_sdcache_wbinv_range_128(vm_offset_t va, vm_size_t size) > +{ > + vm_offset_t eva = round_line128(va + size); > + > + va = trunc_line128(va); > + > + while ((eva - va) >= (32 * 128)) { > + cache_r4k_op_32lines_128(va, > + CACHE_R4K_SD|CACHEOP_R4K_HIT_WB_INV); > + va += (32 * 128); > + } > + > + while (va < eva) { > + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB_INV); > + va += 128; > + } > +} > + > +void > +mipsNN_sdcache_wbinv_range_index_128(vm_offset_t va, vm_size_t size) > +{ > + vm_offset_t eva; > + > + /* > + * Since we're doing Index ops, we expect to not be able > + * to access the address we've been given. So, get the > + * bits that determine the cache index, and make a KSEG0 > + * address out of them. > + */ > + va = MIPS_PHYS_TO_KSEG0(va & (sdcache_size - 1)); > + > + eva = round_line128(va + size); > + va = trunc_line128(va); > + > + while ((eva - va) >= (32 * 128)) { > + cache_r4k_op_32lines_128(va, > + CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); > + va += (32 * 128); > + } > + > + while (va < eva) { > + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_INDEX_WB_INV); > + va += 128; > + } > +} > + > +void > +mipsNN_sdcache_inv_range_128(vm_offset_t va, vm_size_t size) > +{ > + vm_offset_t eva = round_line128(va + size); > + > + va = trunc_line128(va); > + > + while ((eva - va) >= (32 * 128)) { > + cache_r4k_op_32lines_128(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_INV); > + va += (32 * 128); > + } > + > + while (va < eva) { > + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_INV); > + va += 128; > + } > +} > + > +void > +mipsNN_sdcache_wb_range_128(vm_offset_t va, vm_size_t size) > +{ > + vm_offset_t eva = round_line128(va + size); > + > + va = trunc_line128(va); > + > + while ((eva - va) >= (32 * 128)) { > + cache_r4k_op_32lines_128(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB); > + va += (32 * 128); > + } > + > + while (va < eva) { > + cache_op_r4k_line(va, CACHE_R4K_SD|CACHEOP_R4K_HIT_WB); > + va += 128; > + } > +} > > Modified: head/sys/mips/mips/cpu.c > ============================================================================== > --- head/sys/mips/mips/cpu.c Thu Nov 20 17:03:40 2014 (r274751) > +++ head/sys/mips/mips/cpu.c Thu Nov 20 17:06:41 2014 (r274752) > @@ -73,6 +73,7 @@ mips_get_identity(struct mips_cpuinfo *c > u_int32_t prid; > u_int32_t cfg0; > u_int32_t cfg1; > + u_int32_t cfg2; > #if defined(CPU_CNMIPS) > u_int32_t cfg4; > #endif > @@ -186,6 +187,31 @@ mips_get_identity(struct mips_cpuinfo *c > * cpuinfo->l1.ic_nsets * cpuinfo->l1.ic_nways; > cpuinfo->l1.dc_size = cpuinfo->l1.dc_linesize > * cpuinfo->l1.dc_nsets * cpuinfo->l1.dc_nways; > + > +#ifndef CPU_CNMIPS > + /* L2 cache */ > + if (!(cfg1 & MIPS_CONFIG_CM)) { > + /* We don't have valid cfg2 register */ > + return; > + } > + > + cfg2 = mips_rd_config2(); > + > + tmp = (cfg2 >> MIPS_CONFIG2_SL_SHIFT) & MIPS_CONFIG2_SL_MASK; > + if (0 < tmp && tmp <= 7) > + cpuinfo->l2.dc_linesize = 2 << tmp; > + > + tmp = (cfg2 >> MIPS_CONFIG2_SS_SHIFT) & MIPS_CONFIG2_SS_MASK; > + if (0 <= tmp && tmp <= 7) > + cpuinfo->l2.dc_nsets = 64 << tmp; > + > + tmp = (cfg2 >> MIPS_CONFIG2_SA_SHIFT) & MIPS_CONFIG2_SA_MASK; > + if (0 <= tmp && tmp <= 7) > + cpuinfo->l2.dc_nways = tmp + 1; > + > + cpuinfo->l2.dc_size = cpuinfo->l2.dc_linesize > + * cpuinfo->l2.dc_nsets * cpuinfo->l2.dc_nways; > +#endif > } > > void > @@ -355,6 +381,7 @@ static driver_t cpu_driver = { > static int > cpu_probe(device_t dev) > { > + > return (0); > } > > From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 17:23:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8B45F5 for ; Thu, 20 Nov 2014 17:23:51 +0000 (UTC) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5452B40 for ; Thu, 20 Nov 2014 17:23:51 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id bj1so2927470pad.23 for ; Thu, 20 Nov 2014 09:23:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=BXZ1LleO5ORKQ4RSwkn70JDPxB/SUWiQm591Y95pEXA=; b=YlIeS/M8pA6d1taTm80RipH7J3d9tD3QUFOz3HlZTWP/BQ13QIO/R0mxXyfSMo0J4f 7usUUKSbUkJxiUOhTQXgpg7AzMgPFuOyXW4y77f1IW9Z0sIACN/t57+XCD2sDxQ7A5VH 58TetW6tjC8Z1M8MK4INjrKJPa35YW7rmZny0K3n++U1HRRw6OMlOzSUN9nBZzOaZZuG Y+3q1Q03Yq+XSDPRavqiv1QohSoHldaRhL6vbCg04NjgX6LJH8Lkv5zplIsOwjSPVT7M gzdT2ICz0CoapHJiY/qXj1lB/BO+Ep3yhxOuTZNP7WaRpB47WVIcah6BhnNILMDPEL6X UG8A== X-Gm-Message-State: ALoCoQnVsQZD4IDaBQLaRUXDW8F0XQ0rM65KPJg1YXeu2BFRovdsDbWTSshQOKrHWw7bD39tOuZ5 X-Received: by 10.66.218.42 with SMTP id pd10mr24292027pac.151.1416504222683; Thu, 20 Nov 2014 09:23:42 -0800 (PST) Received: from [10.64.27.119] ([69.53.236.236]) by mx.google.com with ESMTPSA id mp5sm2575664pbc.33.2014.11.20.09.23.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Nov 2014 09:23:41 -0800 (PST) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_07A06FE2-EABC-4DB7-BD19-9D7B67C4EE56"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd From: Warner Losh In-Reply-To: <546E08BA.1020707@FreeBSD.org> Date: Thu, 20 Nov 2014 10:23:38 -0700 Message-Id: <6A0453EA-0DAC-4901-AF29-F75E2787B76A@bsdimp.com> References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> <546CDABC.9020103@FreeBSD.org> <546E08BA.1020707@FreeBSD.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 17:23:52 -0000 --Apple-Mail=_07A06FE2-EABC-4DB7-BD19-9D7B67C4EE56 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 20, 2014, at 8:28 AM, Andrey V. Elsukov wrote: > On 19.11.2014 21:49, Warner Losh wrote: >>=20 >> On Nov 19, 2014, at 11:00 AM, Andrey V. Elsukov = wrote: >>=20 >>> On 19.11.2014 19:20, Warner Losh wrote: >>>>> Probably you need to use basetable->gpt_entries here instead of=20 >>>>> MAXPARTITIONS. >>>>=20 >>>> I=92m having trouble connecting the dots between GPT and BSDlabels. = Why >>>> would this field be relevant? Is it just poorly named? = MAXPARTITIONS >>>=20 >>> gpt_entries isn't related to GPT, it is `geom partition table's` = number >>> of partitions entries. Each instance of partition table (i.e. geom) = can >>> have own number of partitions. MBR always has 4, but GPT or BSD can = have >>> different numbers. >>=20 >> Ah, OK. Thanks for the explanation. I understand. I=92ll work up a = patch. >=20 > Hi, Warner >=20 > since there are some reports about strange behavior of old utilities > after this commit, maybe we won't repair them by this way? > What you think about this path? It doesn=92t thrill me. What=92s it trying to do? And localizing it to = fsck is useless. And where are these reports? Warner --Apple-Mail=_07A06FE2-EABC-4DB7-BD19-9D7B67C4EE56 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUbiOaAAoJEGwc0Sh9sBEAo0IP/Ajsfkf5WK3202Ob/awWVdhT nqRN31xOgItgwdcTHSNsHQaGKn3GmxEGWO8EROGhtD5FzxyHADMZU+lJ/xgxN4lo ICfWEUnWvWm06J45qlZLQPUlPpjR/Q2Pr6pIy0JtDHNEBWLtoNsyAhPZZGKzA/IL hPakHQh4DCLnfwoAwL0UHQsdNi95LpDHdRT8GuTpF30Z8kCE4sN4Xffz5YIO0Cmk jWYbmz+L7FzDzgjubRmEL0y533WMr5Q/GYR2MX2dwk9Gpcloaui/Z/ZZc+Z4KLe7 9NVq/VkqYTFjAj75xu9Ykfi51vLUFvThhL3GRZsSFyTiYRqKa6osXHd7WMfk79Sa yiFSD3FLSGcLV0I75AC+vUoNqzctj4z2ituGM27EnZS6XZ4ap/PvC0rLhjkZR7uy jnGov1kRtWZhcD4AN1UfyhLhUZykQv+WI0FDRVgdgIhpkpLzAVi0xLY3vGY+nJJY 3A4+T9RP9nbPYQRe5xvfkbmQ617AlhR7G4F4YngVuH3odpFm9LKcyik72k/b6lag HYrmNdIeU5joDNJCeByNtahx6tgm6ivpfy4Kcm8ZDGsiBNb5tRylgX/RCvH4aQR6 J8uHVtHIhwGb1An+IisgLzjgizR0ynUqhVg3MJifJly2ZXQHavCpG1y7+ICXE+OZ 10Ga1XKHfjJrqodxNK6a =/TOi -----END PGP SIGNATURE----- --Apple-Mail=_07A06FE2-EABC-4DB7-BD19-9D7B67C4EE56-- From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 17:31:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2616849B; Thu, 20 Nov 2014 17:31:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12F22BE5; Thu, 20 Nov 2014 17:31:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKHVPeB034285; Thu, 20 Nov 2014 17:31:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKHVPne034282; Thu, 20 Nov 2014 17:31:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411201731.sAKHVPne034282@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 20 Nov 2014 17:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274753 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 17:31:26 -0000 Author: imp Date: Thu Nov 20 17:31:25 2014 New Revision: 274753 URL: https://svnweb.freebsd.org/changeset/base/274753 Log: Actually, that was a bad idea. Go back to MAXPARTITIONS. Submitted by: bruce Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Thu Nov 20 17:06:41 2014 (r274752) +++ head/sys/geom/part/g_part_bsd.c Thu Nov 20 17:31:25 2014 (r274753) @@ -521,7 +521,7 @@ g_part_bsd_ioctl(struct g_part_table *ba table = (struct g_part_bsd_table *)basetable; p = table->bbarea + pp->sectorsize; - return (bsd_disklabel_le_dec(p, data, basetable->gpt_entries)); + return (bsd_disklabel_le_dec(p, data, MAXPARTITIONS)); } default: return (ENOIOCTL); From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 17:43:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA7A0D42; Thu, 20 Nov 2014 17:43:38 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 776EC1016; Thu, 20 Nov 2014 17:43:37 +0000 (UTC) Message-ID: <546E2826.5080606@FreeBSD.org> Date: Thu, 20 Nov 2014 20:43:02 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> <546CDABC.9020103@FreeBSD.org> <546E08BA.1020707@FreeBSD.org> <6A0453EA-0DAC-4901-AF29-F75E2787B76A@bsdimp.com> In-Reply-To: <6A0453EA-0DAC-4901-AF29-F75E2787B76A@bsdimp.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 17:43:39 -0000 On 20.11.2014 20:23, Warner Losh wrote: >> since there are some reports about strange behavior of old utilities >> after this commit, maybe we won't repair them by this way? >> What you think about this path? > > It doesn’t thrill me. What’s it trying to do? And localizing it to fsck is useless. And where > are these reports? I already committed it in r274750. GEOM_PART class can return partition type via "PART::type" attribute. Now fsck uses it and runs fsck_ffs or fsck_msdosfs depending from the partition type. -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 19:28:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EE35F64; Thu, 20 Nov 2014 19:28:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFE13F9F; Thu, 20 Nov 2014 19:28:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKJSg5f099181; Thu, 20 Nov 2014 19:28:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKJSgF2099180; Thu, 20 Nov 2014 19:28:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411201928.sAKJSgF2099180@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 20 Nov 2014 19:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274756 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 19:28:43 -0000 Author: mav Date: Thu Nov 20 19:28:42 2014 New Revision: 274756 URL: https://svnweb.freebsd.org/changeset/base/274756 Log: Remove residual xpt_release_device() call left after r272406 cleanup. Excessive release here could trigger use-after-free condition and kernel panic on LUN 0 disconnect. MFC after: 1 week Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Nov 20 18:49:11 2014 (r274755) +++ head/sys/cam/scsi/scsi_xpt.c Thu Nov 20 19:28:42 2014 (r274756) @@ -2032,23 +2032,7 @@ scsi_scan_bus(struct cam_periph *periph, scan_info->lunindex[target_id]++; } else { mtx_unlock(&target->luns_mtx); - /* - * We're done with scanning all luns. - * - * Nuke the bogus device for lun 0 if lun 0 - * wasn't on the list. - */ - if (first != 0) { - TAILQ_FOREACH(device, - &target->ed_entries, links) { - if (device->lun_id == 0) { - break; - } - } - if (device) { - xpt_release_device(device); - } - } + /* We're done with scanning all luns. */ } } else { mtx_unlock(&target->luns_mtx); From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 20:09:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AB79982; Thu, 20 Nov 2014 20:09:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66CEA3F6; Thu, 20 Nov 2014 20:09:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKK9J7k068530; Thu, 20 Nov 2014 20:09:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKK9J05068527; Thu, 20 Nov 2014 20:09:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411202009.sAKK9J05068527@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 20 Nov 2014 20:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274758 - head/sys/dev/wl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 20:09:19 -0000 Author: jhb Date: Thu Nov 20 20:09:18 2014 New Revision: 274758 URL: https://svnweb.freebsd.org/changeset/base/274758 Log: Various fixes for wl(4): - Don't recurse driver mutex. - Don't hold driver mutex across fubyte/subyte. - Replace fubyte/subyte loops with copyin/copyout calls. - Use relatively sane locking in wl_ioctl(). - Use bus space accessors instead of in*()/out*(). - Use callout(9) instead of timeout(9). - Stop watchdog timer in detach and don't hold mutex across bus_teardown_intr(). - Use device_printf() and if_printf(). - De-spl(). Tested by: no one Modified: head/sys/dev/wl/if_wl.c head/sys/dev/wl/if_wl.h Modified: head/sys/dev/wl/if_wl.c ============================================================================== --- head/sys/dev/wl/if_wl.c Thu Nov 20 19:35:29 2014 (r274757) +++ head/sys/dev/wl/if_wl.c Thu Nov 20 20:09:18 2014 (r274758) @@ -232,12 +232,11 @@ __FBSDID("$FreeBSD$"); static char t_packet[ETHERMTU + sizeof(struct ether_header) + sizeof(long)]; -struct wl_softc{ +struct wl_softc { + device_t dev; struct ifnet *ifp; u_char psa[0x40]; u_char nwid[2]; /* current radio modem nwid */ - short base; - short unit; int flags; int tbusy; /* flag to determine if xmit is busy */ u_short begin_fd; @@ -252,10 +251,8 @@ struct wl_softc{ struct resource *res_ioport; struct resource *res_irq; void *intr_cookie; - bus_space_tag_t bt; - bus_space_handle_t bh; struct mtx wl_mtx; - struct callout_handle watchdog_ch; + struct callout watchdog_timer; #ifdef WLCACHE int w_sigitems; /* number of cached entries */ /* array of cache entries */ @@ -328,9 +325,11 @@ SYSCTL_INT(_machdep, OID_AUTO, wl_gather static int wl_allocate_resources(device_t device); static int wl_deallocate_resources(device_t device); static void wlstart(struct ifnet *ifp); +static void wlstart_locked(struct ifnet *ifp); static void wlinit(void *xsc); +static void wlinit_locked(struct wl_softc *sc); static int wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data); -static timeout_t wlwatchdog; +static void wlwatchdog(void *arg); static void wlintr(void *arg); static void wlxmt(struct wl_softc *sc, struct mbuf *m); static int wldiag(struct wl_softc *sc); @@ -338,7 +337,7 @@ static int wlconfig(struct wl_softc *sc) static int wlcmd(struct wl_softc *sc, char *str); static void wlmmcstat(struct wl_softc *sc); static u_short wlbldru(struct wl_softc *sc); -static u_short wlmmcread(u_int base, u_short reg); +static u_short wlmmcread(struct wl_softc *sc, u_short reg); static void wlinitmmc(struct wl_softc *sc); static int wlhwrst(struct wl_softc *sc); static void wlrustrt(struct wl_softc *sc); @@ -353,12 +352,12 @@ static void wlhdwsleaze(u_short *countp, #ifdef WLDEBUG static void wltbd(struct wl_softc *sc); #endif -static void wlgetpsa(int base, u_char *buf); +static void wlgetpsa(struct wl_softc *sc, u_char *buf); static void wlsetpsa(struct wl_softc *sc); static u_short wlpsacrc(u_char *buf); static void wldump(struct wl_softc *sc); #ifdef WLCACHE -static void wl_cache_store(struct wl_softc *, int, struct ether_header *, struct mbuf *); +static void wl_cache_store(struct wl_softc *, struct ether_header *, struct mbuf *); static void wl_cache_zero(struct wl_softc *sc); #endif @@ -387,10 +386,9 @@ static int wlprobe(device_t device) { struct wl_softc *sc; - short base; char *str = "wl%d: board out of range [0..%d]\n"; u_char inbuf[100]; - unsigned long junk, oldpri, sirq; + unsigned long junk, sirq; int error, irq; error = ISA_PNP_PROBE(device_get_parent(device), device, wl_ids); @@ -402,28 +400,24 @@ wlprobe(device_t device) if (error) goto errexit; - base = rman_get_start(sc->res_ioport); - /* TBD. not true. * regular CMD() will not work, since no softc yet */ -#define PCMD(base, hacr) outw((base), (hacr)) +#define PCMD(sc, hacr) WL_WRITE_2((sc), HACR, (hacr)) - oldpri = splimp(); - PCMD(base, HACR_RESET); /* reset the board */ + PCMD(sc, HACR_RESET); /* reset the board */ DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */ - PCMD(base, HACR_RESET); /* reset the board */ + PCMD(sc, HACR_RESET); /* reset the board */ DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */ - splx(oldpri); /* clear reset command and set PIO#1 in autoincrement mode */ - PCMD(base, HACR_DEFAULT); - PCMD(base, HACR_DEFAULT); - outw(PIOR1(base), 0); /* go to beginning of RAM */ - outsw(PIOP1(base), str, strlen(str)/2+1); /* write string */ + PCMD(sc, HACR_DEFAULT); + PCMD(sc, HACR_DEFAULT); + WL_WRITE_2(sc, PIOR1, 0); /* go to beginning of RAM */ + WL_WRITE_MULTI_2(sc, PIOP1, str, strlen(str)/2+1); /* write string */ - outw(PIOR1(base), 0); /* rewind */ - insw(PIOP1(base), inbuf, strlen(str)/2+1); /* read result */ + WL_WRITE_2(sc, PIOR1, 0); /* rewind */ + WL_READ_MULTI_2(sc, PIOP1, inbuf, strlen(str)/2+1); /* read result */ if (bcmp(str, inbuf, strlen(str))) { error = ENXIO; @@ -434,15 +428,14 @@ wlprobe(device_t device) sc->freq24 = 0; /* 2.4 Gz: frequency */ /* read the PSA from the board into temporary storage */ - wlgetpsa(base, inbuf); + wlgetpsa(sc, inbuf); /* We read the IRQ value from the PSA on the board. */ for (irq = 15; irq >= 0; irq--) if (irqvals[irq] == inbuf[WLPSA_IRQNO]) break; if ((irq == 0) || (irqvals[irq] == 0)){ - printf("wl%d: PSA corrupt (invalid IRQ value)\n", - device_get_unit(device)); + device_printf(device, "PSA corrupt (invalid IRQ value)\n"); } else { /* * If the IRQ requested by the PSA is already claimed by another @@ -452,8 +445,8 @@ wlprobe(device_t device) if (bus_get_resource(device, SYS_RES_IRQ, 0, &sirq, &junk)) goto errexit; if (irq != (int)sirq) - printf("wl%d: board is configured for interrupt %d\n", - device_get_unit(device), irq); + device_printf(device, "board is configured for interrupt %d\n", + irq); } wl_deallocate_resources(device); return (0); @@ -479,13 +472,12 @@ static int wlattach(device_t device) { struct wl_softc *sc; - short base; int error, i, j; - int unit; struct ifnet *ifp; u_char eaddr[6]; sc = device_get_softc(device); + sc->dev = device; ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(device, "can not if_alloc()\n"); @@ -493,7 +485,8 @@ wlattach(device_t device) } mtx_init(&sc->wl_mtx, device_get_nameunit(device), MTX_NETWORK_LOCK, - MTX_DEF | MTX_RECURSE); + MTX_DEF); + callout_init_mtx(&sc->watchdog_timer, &sc->wl_mtx, 0); error = wl_allocate_resources(device); if (error) { @@ -501,19 +494,14 @@ wlattach(device_t device) return (ENXIO); } - base = rman_get_start(sc->res_ioport); - unit = device_get_unit(device); - #ifdef WLDEBUG - printf("wlattach: base %x, unit %d\n", base, unit); + printf("wlattach: base %lx, unit %d\n", rman_get_start(sc->res_ioport), + device_get_unit(device)); #endif - sc->base = base; - sc->unit = unit; sc->flags = 0; sc->mode = 0; sc->hacr = HACR_RESET; - callout_handle_init(&sc->watchdog_ch); CMD(sc); /* reset the board */ DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */ @@ -522,7 +510,7 @@ wlattach(device_t device) CMD(sc); /* Read the PSA from the board for our later reference */ - wlgetpsa(base, sc->psa); + wlgetpsa(sc, sc->psa); /* fetch NWID */ sc->nwid[0] = sc->psa[WLPSA_NWID]; @@ -541,11 +529,11 @@ wlattach(device_t device) CMD(sc); wlinitmmc(sc); - outw(PIOR1(base), OFFSET_SCB + 8); /* address of scb_crcerrs */ - outw(PIOP1(base), 0); /* clear scb_crcerrs */ - outw(PIOP1(base), 0); /* clear scb_alnerrs */ - outw(PIOP1(base), 0); /* clear scb_rscerrs */ - outw(PIOP1(base), 0); /* clear scb_ovrnerrs */ + WL_WRITE_2(sc, PIOR1, OFFSET_SCB + 8); /* address of scb_crcerrs */ + WL_WRITE_2(sc, PIOP1, 0); /* clear scb_crcerrs */ + WL_WRITE_2(sc, PIOP1, 0); /* clear scb_alnerrs */ + WL_WRITE_2(sc, PIOP1, 0); /* clear scb_rscerrs */ + WL_WRITE_2(sc, PIOP1, 0); /* clear scb_ovrnerrs */ ifp->if_softc = sc; ifp->if_mtu = WAVELAN_MTU; @@ -583,7 +571,6 @@ static int wldetach(device_t device) { struct wl_softc *sc = device_get_softc(device); - device_t parent = device_get_parent(device); struct ifnet *ifp; ifp = sc->ifp; @@ -596,15 +583,16 @@ wldetach(device_t device) CMD(sc); sc->hacr = HACR_DEFAULT; CMD(sc); + callout_stop(&sc->watchdog_timer); + WL_UNLOCK(sc); + callout_drain(&sc->watchdog_timer); if (sc->intr_cookie != NULL) { - BUS_TEARDOWN_INTR(parent, device, sc->res_irq, sc->intr_cookie); + bus_teardown_intr(device, sc->res_irq, sc->intr_cookie); sc->intr_cookie = NULL; } - bus_generic_detach(device); wl_deallocate_resources(device); - WL_UNLOCK(sc); if_free(ifp); mtx_destroy(&sc->wl_mtx); return (0); @@ -656,27 +644,26 @@ wl_deallocate_resources(device_t device) static void wldump(struct wl_softc *sc) { - int base = sc->base; int i; - printf("hasr %04x\n", inw(HASR(base))); + printf("hasr %04x\n", WL_READ_2(sc, HASR)); printf("scb at %04x:\n ", OFFSET_SCB); - outw(PIOR1(base), OFFSET_SCB); + WL_WRITE_2(sc, PIOR1, OFFSET_SCB); for (i = 0; i < 8; i++) - printf("%04x ", inw(PIOP1(base))); + printf("%04x ", WL_READ_2(sc, PIOP1)); printf("\n"); printf("cu at %04x:\n ", OFFSET_CU); - outw(PIOR1(base), OFFSET_CU); + WL_WRITE_2(sc, PIOR1, OFFSET_CU); for (i = 0; i < 8; i++) - printf("%04x ", inw(PIOP1(base))); + printf("%04x ", WL_READ_2(sc, PIOP1)); printf("\n"); printf("tbd at %04x:\n ", OFFSET_TBD); - outw(PIOR1(base), OFFSET_TBD); + WL_WRITE_2(sc, PIOR1, OFFSET_TBD); for (i = 0; i < 4; i++) - printf("%04x ", inw(PIOP1(base))); + printf("%04x ", WL_READ_2(sc, PIOP1)); printf("\n"); } @@ -684,7 +671,6 @@ wldump(struct wl_softc *sc) static void wlinitmmc(struct wl_softc *sc) { - int base = sc->base; int configured; int mode = sc->mode; int i; /* 2.4 Gz */ @@ -747,7 +733,7 @@ wlinitmmc(struct wl_softc *sc) MMC_EECTRL_EEOP_READ); /* 2.4 Gz: Read EEPROM */ for (i=0; i<1000; ++i) { /* 2.4 Gz: wait for download */ DELAY(40); /* 2.4 Gz */ - if ((wlmmcread(base,MMC_EECTRLstat) /* 2.4 Gz: check DWLD and */ + if ((wlmmcread(sc, MMC_EECTRLstat) /* 2.4 Gz: check DWLD and */ &(MMC_EECTRLstat_DWLD /* 2.4 Gz: EEBUSY */ +MMC_EECTRLstat_EEBUSY))==0) /* 2.4 Gz: */ break; /* 2.4 Gz: download finished */ @@ -758,7 +744,7 @@ wlinitmmc(struct wl_softc *sc) MMC_EECTRL_EEOP_READ); /* 2.4 Gz: Read EEPROM */ for (i=0; i<1000; ++i) { /* 2.4 Gz: wait for download */ DELAY(40); /* 2.4 Gz */ - if ((wlmmcread(base,MMC_EECTRLstat) /* 2.4 Gz: check DWLD and */ + if ((wlmmcread(sc, MMC_EECTRLstat) /* 2.4 Gz: check DWLD and */ &(MMC_EECTRLstat_DWLD /* 2.4 Gz: EEBUSY */ +MMC_EECTRLstat_EEBUSY))==0) /* 2.4 Gz: */ break; /* 2.4 Gz: download finished */ @@ -772,8 +758,8 @@ wlinitmmc(struct wl_softc *sc) MMC_WRITE(MMC_EECTRL, /* 2.4 Gz: EEPROM read */ MMC_EECTRL_EEOP_READ); /* 2.4 Gz: */ DELAY(40); /* 2.4 Gz */ - i = wlmmcread(base,MMC_EEDATALrv) /* 2.4 Gz: freq val */ - + (wlmmcread(base,MMC_EEDATAHrv)<<8); /* 2.4 Gz */ + i = wlmmcread(sc, MMC_EEDATALrv) /* 2.4 Gz: freq val */ + + (wlmmcread(sc, MMC_EEDATAHrv)<<8); /* 2.4 Gz */ sc->freq24 = (i>>6)+2400; /* 2.4 Gz: save real freq */ } } @@ -793,16 +779,23 @@ static void wlinit(void *xsc) { struct wl_softc *sc = xsc; + + WL_LOCK(sc); + wlinit_locked(sc); + WL_UNLOCK(sc); +} + +static void +wlinit_locked(struct wl_softc *sc) +{ struct ifnet *ifp = sc->ifp; int stat; - u_long oldpri; #ifdef WLDEBUG if (sc->ifp->if_flags & IFF_DEBUG) - printf("wl%d: entered wlinit()\n",sc->unit); + if_printf(ifp, "entered wlinit()\n"); #endif - WL_LOCK(sc); - oldpri = splimp(); + WL_LOCK_ASSERT(sc); if ((stat = wlhwrst(sc)) == TRUE) { sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; /* same as DSF_RUNNING */ /* @@ -813,14 +806,12 @@ wlinit(void *xsc) sc->flags |= DSF_RUNNING; sc->tbusy = 0; - untimeout(wlwatchdog, sc, sc->watchdog_ch); + callout_stop(&sc->watchdog_timer); - wlstart(ifp); + wlstart_locked(ifp); } else { - printf("wl%d init(): trouble resetting board.\n", sc->unit); + if_printf(ifp, "init(): trouble resetting board.\n"); } - splx(oldpri); - WL_UNLOCK(sc); } /* @@ -839,7 +830,7 @@ wlhwrst(struct wl_softc *sc) #ifdef WLDEBUG if (sc->ifp->if_flags & IFF_DEBUG) - printf("wl%d: entered wlhwrst()\n", sc->unit); + if_printf(sc->ifp, "entered wlhwrst()\n"); #endif sc->hacr = HACR_RESET; CMD(sc); /* reset the board */ @@ -881,7 +872,6 @@ wlhwrst(struct wl_softc *sc) static void wlbldcu(struct wl_softc *sc) { - short base = sc->base; scp_t scp; iscp_t iscp; scb_t scb; @@ -893,16 +883,16 @@ wlbldcu(struct wl_softc *sc) scp.scp_sysbus = 0; scp.scp_iscp = OFFSET_ISCP; scp.scp_iscp_base = 0; - outw(PIOR1(base), OFFSET_SCP); - outsw(PIOP1(base), &scp, sizeof(scp_t)/2); + WL_WRITE_2(sc, PIOR1, OFFSET_SCP); + WL_WRITE_MULTI_2(sc, PIOP1, &scp, sizeof(scp_t)/2); bzero(&iscp, sizeof(iscp)); iscp.iscp_busy = 1; iscp.iscp_scb_offset = OFFSET_SCB; iscp.iscp_scb = 0; iscp.iscp_scb_base = 0; - outw(PIOR1(base), OFFSET_ISCP); - outsw(PIOP1(base), &iscp, sizeof(iscp_t)/2); + WL_WRITE_2(sc, PIOR1, OFFSET_ISCP); + WL_WRITE_MULTI_2(sc, PIOP1, &iscp, sizeof(iscp_t)/2); scb.scb_status = 0; scb.scb_command = SCB_RESET; @@ -912,37 +902,37 @@ wlbldcu(struct wl_softc *sc) scb.scb_alnerrs = 0; scb.scb_rscerrs = 0; scb.scb_ovrnerrs = 0; - outw(PIOR1(base), OFFSET_SCB); - outsw(PIOP1(base), &scb, sizeof(scb_t)/2); + WL_WRITE_2(sc, PIOR1, OFFSET_SCB); + WL_WRITE_MULTI_2(sc, PIOP1, &scb, sizeof(scb_t)/2); SET_CHAN_ATTN(sc); - outw(PIOR0(base), OFFSET_ISCP + 0); /* address of iscp_busy */ - for (i = 1000000; inw(PIOP0(base)) && (i-- > 0); ) + WL_WRITE_2(sc, PIOR0, OFFSET_ISCP + 0); /* address of iscp_busy */ + for (i = 1000000; WL_READ_2(sc, PIOP0) && (i-- > 0); ) continue; if (i <= 0) - printf("wl%d bldcu(): iscp_busy timeout.\n", sc->unit); - outw(PIOR0(base), OFFSET_SCB + 0); /* address of scb_status */ + device_printf(sc->dev, "bldcu(): iscp_busy timeout.\n"); + WL_WRITE_2(sc, PIOR0, OFFSET_SCB + 0); /* address of scb_status */ for (i = STATUS_TRIES; i-- > 0; ) { - if (inw(PIOP0(base)) == (SCB_SW_CX|SCB_SW_CNA)) + if (WL_READ_2(sc, PIOP0) == (SCB_SW_CX|SCB_SW_CNA)) break; } if (i <= 0) - printf("wl%d bldcu(): not ready after reset.\n", sc->unit); + device_printf(sc->dev, "bldcu(): not ready after reset.\n"); wlack(sc); cb.ac_status = 0; cb.ac_command = AC_CW_EL; /* NOP */ cb.ac_link_offset = OFFSET_CU; - outw(PIOR1(base), OFFSET_CU); - outsw(PIOP1(base), &cb, 6/2); + WL_WRITE_2(sc, PIOR1, OFFSET_CU); + WL_WRITE_MULTI_2(sc, PIOP1, &cb, 6/2); tbd.act_count = 0; tbd.next_tbd_offset = I82586NULL; tbd.buffer_addr = 0; tbd.buffer_base = 0; - outw(PIOR1(base), OFFSET_TBD); - outsw(PIOP1(base), &tbd, sizeof(tbd_t)/2); + WL_WRITE_2(sc, PIOR1, OFFSET_TBD); + WL_WRITE_MULTI_2(sc, PIOP1, &tbd, sizeof(tbd_t)/2); } /* @@ -957,23 +947,32 @@ wlbldcu(struct wl_softc *sc) static void wlstart(struct ifnet *ifp) { + struct wl_softc *sc = ifp->if_softc; + + WL_LOCK(sc); + wlstart_locked(ifp); + WL_UNLOCK(sc); +} + +static void +wlstart_locked(struct ifnet *ifp) +{ struct mbuf *m; struct wl_softc *sc = ifp->if_softc; - short base = sc->base; int scb_status, cu_status, scb_command; - WL_LOCK(sc); + WL_LOCK_ASSERT(sc); #ifdef WLDEBUG if (sc->ifp->if_flags & IFF_DEBUG) - printf("%s: entered wlstart()\n", ifp->if_xname); + if_printf(ifp, "entered wlstart()\n"); #endif - outw(PIOR1(base), OFFSET_CU); - cu_status = inw(PIOP1(base)); - outw(PIOR0(base),OFFSET_SCB + 0); /* scb_status */ - scb_status = inw(PIOP0(base)); - outw(PIOR0(base), OFFSET_SCB + 2); - scb_command = inw(PIOP0(base)); + WL_WRITE_2(sc, PIOR1, OFFSET_CU); + cu_status = WL_READ_2(sc, PIOP1); + WL_WRITE_2(sc, PIOR0,OFFSET_SCB + 0); /* scb_status */ + scb_status = WL_READ_2(sc, PIOP0); + WL_WRITE_2(sc, PIOR0, OFFSET_SCB + 2); + scb_command = WL_READ_2(sc, PIOP0); /* * don't need OACTIVE check as tbusy here checks to see @@ -983,51 +982,48 @@ wlstart(struct ifnet *ifp) if ((scb_status & 0x0700) == SCB_CUS_IDLE && (cu_status & AC_SW_B) == 0){ sc->tbusy = 0; - untimeout(wlwatchdog, sc, sc->watchdog_ch); + callout_stop(&sc->watchdog_timer); sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * This is probably just a race. The xmt'r is just * became idle but WE have masked interrupts so ... */ #ifdef WLDEBUG - printf("%s: CU idle, scb %04x %04x cu %04x\n", - ifp->if_xname, scb_status, scb_command, cu_status); + if_printf(ifp, "CU idle, scb %04x %04x cu %04x\n", + scb_status, scb_command, cu_status); #endif if (xmt_watch) printf("!!"); } else { - WL_UNLOCK(sc); return; /* genuinely still busy */ } } else if ((scb_status & 0x0700) == SCB_CUS_ACTV || (cu_status & AC_SW_B)){ #ifdef WLDEBUG - printf("%s: CU unexpectedly busy; scb %04x cu %04x\n", - ifp->if_xname, scb_status, cu_status); + if_printf(ifp, "CU unexpectedly busy; scb %04x cu %04x\n", + scb_status, cu_status); #endif - if (xmt_watch) printf("%s: busy?!",ifp->if_xname); - WL_UNLOCK(sc); + if (xmt_watch) + if_printf(ifp, "busy?!\n"); return; /* hey, why are we busy? */ } /* get ourselves some data */ - ifp = sc->ifp; IF_DEQUEUE(&ifp->if_snd, m); - if (m != (struct mbuf *)0) { + if (m != NULL) { /* let BPF see it before we commit it */ BPF_MTAP(ifp, m); sc->tbusy++; /* set the watchdog timer so that if the board * fails to interrupt we will restart */ - /* try 10 ticks, not very long */ - sc->watchdog_ch = timeout(wlwatchdog, sc, 10); + /* try 10 ms, not very long */ + callout_reset(&sc->watchdog_timer, hz / 100, wlwatchdog, sc); sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1); wlxmt(sc, m); } else { sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } - WL_UNLOCK(sc); return; } @@ -1053,7 +1049,6 @@ static int wlread(struct wl_softc *sc, u_short fd_p) { struct ifnet *ifp = sc->ifp; - short base = sc->base; fd_t fd; struct ether_header *eh; struct mbuf *m; @@ -1066,10 +1061,10 @@ wlread(struct wl_softc *sc, u_short fd_p #ifdef WLDEBUG if (sc->ifp->if_flags & IFF_DEBUG) - printf("wl%d: entered wlread()\n", sc->unit); + if_printf(ifp, "entered wlread()\n"); #endif if (!((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING))) { - printf("%s read(): board is not running.\n", ifp->if_xname); + if_printf(ifp, "read(): board is not running.\n"); sc->hacr &= ~HACR_INTRON; CMD(sc); /* turn off interrupts */ } @@ -1077,19 +1072,19 @@ wlread(struct wl_softc *sc, u_short fd_p /* * Collect message size. */ - outw(PIOR1(base), fd_p); - insw(PIOP1(base), &fd, sizeof(fd_t)/2); + WL_WRITE_2(sc, PIOR1, fd_p); + WL_READ_MULTI_2(sc, PIOP1, &fd, sizeof(fd_t)/2); if (fd.rbd_offset == I82586NULL) { if (wlhwrst(sc) != TRUE) { sc->hacr &= ~HACR_INTRON; CMD(sc); /* turn off interrupts */ - printf("wl%d read(): hwrst trouble.\n", sc->unit); + if_printf(ifp, "read(): hwrst trouble.\n"); } return 0; } - outw(PIOR1(base), fd.rbd_offset); - insw(PIOP1(base), &rbd, sizeof(rbd_t)/2); + WL_WRITE_2(sc, PIOR1, fd.rbd_offset); + WL_READ_MULTI_2(sc, PIOP1, &rbd, sizeof(rbd_t)/2); bytes_in_msg = rbd.status & RBD_SW_COUNT; /* @@ -1100,7 +1095,7 @@ wlread(struct wl_softc *sc, u_short fd_p if (wlhwrst(sc) != TRUE) { sc->hacr &= ~HACR_INTRON; CMD(sc); /* turn off interrupts */ - printf("wl%d read(): hwrst trouble.\n", sc->unit); + if_printf(ifp, "read(): hwrst trouble.\n"); } return 0; } @@ -1127,19 +1122,19 @@ wlread(struct wl_softc *sc, u_short fd_p } else { len = bytes; } - outw(PIOR1(base), rbd.buffer_addr); - insw(PIOP1(base), mb_p, len/2); + WL_WRITE_2(sc, PIOR1, rbd.buffer_addr); + WL_READ_MULTI_2(sc, PIOP1, mb_p, len/2); mlen += bytes; if (bytes > bytes_in_mbuf) { /* XXX something wrong, a packet should fit in 1 cluster */ m_freem(m); - printf("wl%d read(): packet too large (%u > %u)\n", - sc->unit, bytes, bytes_in_mbuf); + if_printf(ifp, "read(): packet too large (%u > %u)\n", + bytes, bytes_in_mbuf); if (wlhwrst(sc) != TRUE) { sc->hacr &= ~HACR_INTRON; CMD(sc); /* turn off interrupts */ - printf("wl%d read(): hwrst trouble.\n", sc->unit); + if_printf(ifp, "read(): hwrst trouble.\n"); } return 0; } @@ -1150,8 +1145,8 @@ wlread(struct wl_softc *sc, u_short fd_p if (rbd.status & RBD_SW_EOF || rbd.next_rbd_offset == I82586NULL) { break; } - outw(PIOR1(base), rbd.next_rbd_offset); - insw(PIOP1(base), &rbd, sizeof(rbd_t)/2); + WL_WRITE_2(sc, PIOR1, rbd.next_rbd_offset); + WL_READ_MULTI_2(sc, PIOP1, &rbd, sizeof(rbd_t)/2); bytes_in_msg = rbd.status & RBD_SW_COUNT; } else { rbd.buffer_addr += bytes; @@ -1195,11 +1190,11 @@ wlread(struct wl_softc *sc, u_short fd_p #ifdef WLDEBUG if (sc->ifp->if_flags & IFF_DEBUG) - printf("wl%d: wlrecv %u bytes\n", sc->unit, mlen); + if_printf(ifp, "wlrecv %u bytes\n", mlen); #endif #ifdef WLCACHE - wl_cache_store(sc, base, eh, m); + wl_cache_store(sc, eh, m); #endif /* @@ -1229,25 +1224,24 @@ wlioctl(struct ifnet *ifp, u_long cmd, c { struct ifreq *ifr = (struct ifreq *)data; struct wl_softc *sc = ifp->if_softc; - short base = sc->base; short mode = 0; - int opri, error = 0; + int error = 0; struct thread *td = curthread; /* XXX */ int irq, irqval, i, isroot; - caddr_t up; + char psa_buf[0x40]; + char eeprom_buf[0x80]; #ifdef WLCACHE - int size; + size_t size; char * cpt; #endif - WL_LOCK(sc); #ifdef WLDEBUG if (sc->ifp->if_flags & IFF_DEBUG) - printf("%s: entered wlioctl()\n", ifp->if_xname); + if_printf(ifp, "entered wlioctl()\n"); #endif - opri = splimp(); switch (cmd) { case SIOCSIFFLAGS: + WL_LOCK(sc); if (ifp->if_flags & IFF_ALLMULTI) { mode |= MOD_ENAL; } @@ -1267,14 +1261,14 @@ wlioctl(struct ifnet *ifp, u_long cmd, c sc->mode = mode; if (sc->flags & DSF_RUNNING) { sc->flags &= ~DSF_RUNNING; - wlinit(sc); + wlinit_locked(sc); } } /* if interface is marked DOWN and still running then * stop it. */ if ((ifp->if_flags & IFF_UP) == 0 && sc->flags & DSF_RUNNING) { - printf("%s ioctl(): board is not running\n", ifp->if_xname); + if_printf(ifp, "ioctl(): board is not running\n"); sc->flags &= ~DSF_RUNNING; sc->hacr &= ~HACR_INTRON; CMD(sc); /* turn off interrupts */ @@ -1282,13 +1276,14 @@ wlioctl(struct ifnet *ifp, u_long cmd, c /* else if interface is UP and RUNNING, start it */ else if (ifp->if_flags & IFF_UP && (sc->flags & DSF_RUNNING) == 0) { - wlinit(sc); + wlinit_locked(sc); } /* if WLDEBUG set on interface, then printf rf-modem regs */ if (ifp->if_flags & IFF_DEBUG) wlmmcstat(sc); + WL_UNLOCK(sc); break; #if MULTICAST case SIOCADDMULTI: @@ -1303,20 +1298,20 @@ wlioctl(struct ifnet *ifp, u_long cmd, c /* copy the PSA out to the caller */ case SIOCGWLPSA: - /* pointer to buffer in user space */ - up = (void *)ifr->ifr_data; /* work out if they're root */ isroot = (priv_check(td, PRIV_NET80211_GETKEY) == 0); - + + bzero(psa_buf, sizeof(psa_buf)); + WL_LOCK(sc); for (i = 0; i < 0x40; i++) { /* don't hand the DES key out to non-root users */ if ((i > WLPSA_DESKEY) && (i < (WLPSA_DESKEY + 8)) && !isroot) continue; - if (subyte((up + i), sc->psa[i])) { - WL_UNLOCK(sc); - return(EFAULT); - } + psa_buf[i] = sc->psa[i]; } + WL_UNLOCK(sc); + + error = copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); break; @@ -1325,46 +1320,43 @@ wlioctl(struct ifnet *ifp, u_long cmd, c /* root only */ if ((error = priv_check(td, PRIV_DRIVER))) break; - error = EINVAL; /* assume the worst */ - /* pointer to buffer in user space containing data */ - up = (void *)ifr->ifr_data; - - /* check validity of input range */ - for (i = 0; i < 0x40; i++) - if (fubyte(up + i) < 0) { - WL_UNLOCK(sc); - return(EFAULT); - } + error = copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); + if (error) + break; + /* check IRQ value */ - irqval = fubyte(up+WLPSA_IRQNO); + irqval = psa_buf[WLPSA_IRQNO]; for (irq = 15; irq >= 0; irq--) if (irqvals[irq] == irqval) break; if (irq == 0) /* oops */ break; + WL_LOCK(sc); /* new IRQ */ sc->psa[WLPSA_IRQNO] = irqval; /* local MAC */ for (i = 0; i < 6; i++) - sc->psa[WLPSA_LOCALMAC+i] = fubyte(up+WLPSA_LOCALMAC+i); + sc->psa[WLPSA_LOCALMAC + i] = psa_buf[WLPSA_LOCALMAC + i]; /* MAC select */ - sc->psa[WLPSA_MACSEL] = fubyte(up+WLPSA_MACSEL); + sc->psa[WLPSA_MACSEL] = psa_buf[WLPSA_MACSEL]; /* default nwid */ - sc->psa[WLPSA_NWID] = fubyte(up+WLPSA_NWID); - sc->psa[WLPSA_NWID+1] = fubyte(up+WLPSA_NWID+1); + sc->psa[WLPSA_NWID] = psa_buf[WLPSA_NWID]; + sc->psa[WLPSA_NWID + 1] = psa_buf[WLPSA_NWID + 1]; - error = 0; wlsetpsa(sc); /* update the PSA */ + WL_UNLOCK(sc); break; /* get the current NWID out of the sc since we stored it there */ case SIOCGWLCNWID: + WL_LOCK(sc); ifr->ifr_data = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); + WL_UNLOCK(sc); break; @@ -1381,6 +1373,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, c /* root only */ if ((error = priv_check(td, PRIV_DRIVER))) break; + WL_LOCK(sc); if (!(ifp->if_flags & IFF_UP)) { error = EIO; /* only allowed while up */ } else { @@ -1392,6 +1385,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, c MMC_WRITE(MMC_NETW_ID_L,sc->nwid[1]); MMC_WRITE(MMC_NETW_ID_H,sc->nwid[0]); } + WL_UNLOCK(sc); break; /* copy the EEPROM in 2.4 Gz WaveMODEM out to the caller */ @@ -1399,25 +1393,21 @@ wlioctl(struct ifnet *ifp, u_long cmd, c /* root only */ if ((error = priv_check(td, PRIV_DRIVER))) break; - /* pointer to buffer in user space */ - up = (void *)ifr->ifr_data; - + + bzero(eeprom_buf, sizeof(eeprom_buf)); + WL_LOCK(sc); for (i=0x00; i<0x80; ++i) { /* 2.4 Gz: size of EEPROM */ MMC_WRITE(MMC_EEADDR,i); /* 2.4 Gz: get frequency */ MMC_WRITE(MMC_EECTRL, /* 2.4 Gz: EEPROM read */ MMC_EECTRL_EEOP_READ); /* 2.4 Gz: */ DELAY(40); /* 2.4 Gz */ - if (subyte(up + 2*i, /* 2.4 Gz: pass low byte of */ - wlmmcread(base,MMC_EEDATALrv))) {/* 2.4 Gz: EEPROM word */ - WL_UNLOCK(sc); - return(EFAULT); /* 2.4 Gz: */ - } - if (subyte(up + 2*i+1, /* 2.4 Gz: pass hi byte of */ - wlmmcread(base,MMC_EEDATALrv))) {/* 2.4 Gz: EEPROM word */ - WL_UNLOCK(sc); - return(EFAULT); /* 2.4 Gz: */ - } + eeprom_buf[2 * i] = /* 2.4 Gz: pass low byte of */ + wlmmcread(sc, MMC_EEDATALrv); /* 2.4 Gz: EEPROM word */ + eeprom_buf[2 * i + 1] = /* 2.4 Gz: pass hi byte of */ + wlmmcread(sc, MMC_EEDATALrv); /* 2.4 Gz: EEPROM word */ } + WL_UNLOCK(sc); + error = copyout(ifr->ifr_data, eeprom_buf, sizeof(eeprom_buf)); break; #ifdef WLCACHE @@ -1426,27 +1416,33 @@ wlioctl(struct ifnet *ifp, u_long cmd, c /* root only */ if ((error = priv_check(td, PRIV_DRIVER))) break; + WL_LOCK(sc); wl_cache_zero(sc); + WL_UNLOCK(sc); break; /* read out the number of used cache elements */ case SIOCGWLCITEM: + WL_LOCK(sc); ifr->ifr_data = (caddr_t) sc->w_sigitems; + WL_UNLOCK(sc); break; /* read out the wl cache */ case SIOCGWLCACHE: - /* pointer to buffer in user space */ - up = (void *)ifr->ifr_data; - cpt = (char *) &sc->w_sigcache[0]; + WL_LOCK(sc); size = sc->w_sigitems * sizeof(struct w_sigcache); - - for (i = 0; i < size; i++) { - if (subyte((up + i), *cpt++)) { - WL_UNLOCK(sc); - return(EFAULT); - } + cpt = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); + if (cpt == NULL) { + WL_UNLOCK(sc); + return (ENOMEM); } + + bcopy(sc->w_sigcache, cpt, size); + WL_UNLOCK(sc); + + error = copyout(cpt, ifr->ifr_data, size); + free(cpt, M_DEVBUF); break; #endif @@ -1454,8 +1450,6 @@ wlioctl(struct ifnet *ifp, u_long cmd, c error = ether_ioctl(ifp, cmd, data); break; } - splx(opri); - WL_UNLOCK(sc); return (error); } @@ -1474,13 +1468,10 @@ static void wlwatchdog(void *vsc) { struct wl_softc *sc = vsc; - int unit = sc->unit; - log(LOG_ERR, "wl%d: wavelan device timeout on xmit\n", unit); - WL_LOCK(sc); + log(LOG_ERR, "%s: wavelan device timeout on xmit\n", sc->ifp->if_xname); if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); - wlinit(sc); - WL_UNLOCK(sc); + wlinit_locked(sc); } /* @@ -1499,26 +1490,25 @@ static void wlintr(void *arg) { struct wl_softc *sc = (struct wl_softc *)arg; - short base = sc->base; int ac_status; u_short int_type, int_type1; WL_LOCK(sc); #ifdef WLDEBUG if (sc->ifp->if_flags & IFF_DEBUG) - printf("wl%d: wlintr() called\n", sc->unit); + if_printf(sc->ifp, "wlintr() called\n"); #endif - if ((int_type = inw(HASR(base))) & HASR_MMC_INTR) { + if ((int_type = WL_READ_2(sc, HASR)) & HASR_MMC_INTR) { /* handle interrupt from the modem management controler */ /* This will clear the interrupt condition */ - (void) wlmmcread(base,MMC_DCE_STATUS); /* ignored for now */ + (void) wlmmcread(sc, MMC_DCE_STATUS); /* ignored for now */ } if (!(int_type & HASR_INTR)){ /* return if no interrupt from 82586 */ /* commented out. jrb. it happens when reinit occurs printf("wlintr: int_type %x, dump follows\n", int_type); - wldump(unit); + wldump(sc); */ WL_UNLOCK(sc); return; @@ -1527,8 +1517,8 @@ wlintr(void *arg) if (gathersnr) getsnr(sc); for (;;) { - outw(PIOR0(base), OFFSET_SCB + 0); /* get scb status */ - int_type = (inw(PIOP0(base)) & SCB_SW_INT); + WL_WRITE_2(sc, PIOR0, OFFSET_SCB + 0); /* get scb status */ + int_type = (WL_READ_2(sc, PIOP0) & SCB_SW_INT); if (int_type == 0) /* no interrupts left */ break; @@ -1552,8 +1542,8 @@ wlintr(void *arg) if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); #ifdef WLDEBUG if (sc->ifp->if_flags & IFF_DEBUG) - printf("wl%d intr(): receiver overrun! begin_fd = %x\n", - sc->unit, sc->begin_fd); + if_printf(sc->ifp, "intr(): receiver overrun! begin_fd = %x\n", + sc->begin_fd); #endif wlrustrt(sc); } @@ -1571,40 +1561,40 @@ wlintr(void *arg) * At present, we only request Interrupt for * XMT. */ - outw(PIOR1(base), OFFSET_CU); /* get command status */ - ac_status = inw(PIOP1(base)); + WL_WRITE_2(sc, PIOR1, OFFSET_CU); /* get command status */ + ac_status = WL_READ_2(sc, PIOP1); if (xmt_watch) { /* report some anomalies */ if (sc->tbusy == 0) { - printf("wl%d: xmt intr but not busy, CU %04x\n", - sc->unit, ac_status); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 20:24:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E6021D1; Thu, 20 Nov 2014 20:24:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E3DA828; Thu, 20 Nov 2014 20:24:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKKOVCa094930; Thu, 20 Nov 2014 20:24:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKKOVgn094929; Thu, 20 Nov 2014 20:24:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411202024.sAKKOVgn094929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 20 Nov 2014 20:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274759 - head/sys/i386/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 20:24:31 -0000 Author: jhb Date: Thu Nov 20 20:24:30 2014 New Revision: 274759 URL: https://svnweb.freebsd.org/changeset/base/274759 Log: Lock spic(4) and mark it MPSAFE: - Add a per-softc mutex as a driver lock. - Use callout(9) instead of timeout(9). - Set softc pointer in si_drv1 of cdev instead of looking softc up via devclass in cdev methods. Tested by: no one Modified: head/sys/i386/isa/spic.c Modified: head/sys/i386/isa/spic.c ============================================================================== --- head/sys/i386/isa/spic.c Thu Nov 20 20:09:18 2014 (r274758) +++ head/sys/i386/isa/spic.c Thu Nov 20 20:24:30 2014 (r274759) @@ -87,7 +87,6 @@ static d_poll_t spicpoll; static struct cdevsw spic_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = spicopen, .d_close = spicclose, .d_read = spicread, @@ -106,8 +105,10 @@ struct spic_softc { int sc_opened; int sc_sleeping; int sc_buttonlast; - struct callout_handle sc_timeout_ch; + struct callout sc_timeout; + struct mtx sc_lock; device_t sc_dev; + struct cdev *sc_cdev; struct selinfo sc_rsel; u_char sc_buf[SCBUFLEN]; int sc_count; @@ -337,6 +338,8 @@ spic_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; + mtx_init(&sc->sc_lock, "spic", NULL, MTX_DEF); + callout_init_mtx(&sc->sc_timeout, &sc->sc_lock, 0); spic_pollrate = (hz/50); /* Every 50th of a second */ @@ -345,7 +348,8 @@ spic_attach(device_t dev) spic_call1(sc, 0x92); /* There can be only one */ - make_dev(&spic_cdevsw, 0, 0, 0, 0600, "jogdial"); + sc->sc_cdev = make_dev(&spic_cdevsw, 0, 0, 0, 0600, "jogdial"); + sc->sc_cdev->si_drv1 = sc; return 0; } @@ -357,6 +361,7 @@ spictimeout(void *arg) u_char b, event, param; int j; + mtx_assert(&sc->sc_lock, MA_OWNED); if (!sc->sc_opened) { device_printf(sc->sc_dev, "timeout called while closed!\n"); return; @@ -426,7 +431,7 @@ spictimeout(void *arg) } else { /* No event. Wait some more */ - sc->sc_timeout_ch = timeout(spictimeout, sc, spic_pollrate); + callout_reset(&sc->sc_timeout, spic_pollrate, spictimeout, sc); return; } @@ -439,7 +444,7 @@ spictimeout(void *arg) } spic_call2(sc, 0x81, 0xff); /* Clear event */ - sc->sc_timeout_ch = timeout(spictimeout, sc, spic_pollrate); + callout_reset(&sc->sc_timeout, spic_pollrate, spictimeout, sc); } static int @@ -447,17 +452,21 @@ spicopen(struct cdev *dev, int flag, int { struct spic_softc *sc; - sc = devclass_get_softc(spic_devclass, 0); + sc = dev->si_drv1; - if (sc->sc_opened) - return EBUSY; + mtx_lock(&sc->sc_lock); + if (sc->sc_opened) { + mtx_unlock(&sc->sc_lock); + return (EBUSY); + } sc->sc_opened++; sc->sc_count=0; /* Start the polling */ - timeout(spictimeout, sc, spic_pollrate); - return 0; + callout_reset(&sc->sc_timeout, spic_pollrate, spictimeout, sc); + mtx_unlock(&sc->sc_lock); + return (0); } static int @@ -465,11 +474,13 @@ spicclose(struct cdev *dev, int flag, in { struct spic_softc *sc; - sc = devclass_get_softc(spic_devclass, 0); + sc = dev->si_drv1; + mtx_lock(&sc->sc_lock); /* Stop polling */ - untimeout(spictimeout, sc, sc->sc_timeout_ch); + callout_stop(&sc->sc_timeout); sc->sc_opened = 0; + mtx_unlock(&sc->sc_lock); return 0; } @@ -477,34 +488,31 @@ static int spicread(struct cdev *dev, struct uio *uio, int flag) { struct spic_softc *sc; - int l, s, error; + int l, error; u_char buf[SCBUFLEN]; - sc = devclass_get_softc(spic_devclass, 0); + sc = dev->si_drv1; if (uio->uio_resid <= 0) /* What kind of a read is this?! */ - return 0; + return (0); - s = spltty(); + mtx_lock(&sc->sc_lock); while (!(sc->sc_count)) { sc->sc_sleeping=1; - error = tsleep( sc, PZERO | PCATCH, "jogrea", 0); + error = mtx_sleep(sc, &sc->sc_lock, PZERO | PCATCH, "jogrea", 0); sc->sc_sleeping=0; if (error) { - splx(s); - return error; + mtx_unlock(&sc->sc_lock); + return (error); } } - splx(s); - s = spltty(); l = min(uio->uio_resid, sc->sc_count); bcopy(sc->sc_buf, buf, l); sc->sc_count -= l; bcopy(sc->sc_buf + l, sc->sc_buf, l); - splx(s); - return uiomove(buf, l, uio); - + mtx_unlock(&sc->sc_lock); + return (uiomove(buf, l, uio)); } static int @@ -512,28 +520,28 @@ spicioctl(struct cdev *dev, u_long cmd, { struct spic_softc *sc; - sc = devclass_get_softc(spic_devclass, 0); + sc = dev->si_drv1; - return EIO; + return (EIO); } static int spicpoll(struct cdev *dev, int events, struct thread *td) { struct spic_softc *sc; - int revents = 0, s; + int revents = 0; - sc = devclass_get_softc(spic_devclass, 0); - s = spltty(); + sc = dev->si_drv1; + mtx_lock(&sc->sc_lock); if (events & (POLLIN | POLLRDNORM)) { if (sc->sc_count) revents |= events & (POLLIN | POLLRDNORM); else selrecord(td, &sc->sc_rsel); /* Who shall we wake? */ } - splx(s); + mtx_unlock(&sc->sc_lock); - return revents; + return (revents); } From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 20:50:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A67279F; Thu, 20 Nov 2014 20:50:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45D27A5E; Thu, 20 Nov 2014 20:50:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKKo8Eq034002; Thu, 20 Nov 2014 20:50:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKKo6fv033738; Thu, 20 Nov 2014 20:50:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411202050.sAKKo6fv033738@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 20 Nov 2014 20:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274760 - in head/sys: cam/scsi dev/ct dev/ncv dev/nsp dev/stg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 20:50:08 -0000 Author: jhb Date: Thu Nov 20 20:50:05 2014 New Revision: 274760 URL: https://svnweb.freebsd.org/changeset/base/274760 Log: Lock the scsi_low code and the drivers which use it along with other related cleanups: - Require each driver to initalize a mutex in the scsi_low_softc that is shared with the scsi_low code. This mutex is used for CAM SIMs, timers, and interrupt handlers. - Replace the osdep function switch with direct calls to the relevant CAM functions and direct manipulation of timers via callout(9). - Collapse the CAM-specific scsi_low_osdep_interface substructure directly into scsi_low_softc. - Use bus_*() instead of bus_space_*(). - Return BUS_PROBE_DEFAULT from probe routines instead of 0. - No need to zero softcs. - Pass 0ul and ~0ul instead of 0 and ~0 to bus_alloc_resource(). - Spell "dettach" as "detach". - Remove unused 'dvname' variables. - De-spl(). Tested by: no one Modified: head/sys/cam/scsi/scsi_low.c head/sys/cam/scsi/scsi_low.h head/sys/dev/ct/bshw_machdep.c head/sys/dev/ct/ct.c head/sys/dev/ct/ct_isa.c head/sys/dev/ct/ct_machdep.h head/sys/dev/ct/ctvar.h head/sys/dev/ncv/ncr53c500.c head/sys/dev/ncv/ncr53c500_pccard.c head/sys/dev/ncv/ncr53c500var.h head/sys/dev/nsp/nsp.c head/sys/dev/nsp/nsp_pccard.c head/sys/dev/nsp/nspvar.h head/sys/dev/stg/tmc18c30.c head/sys/dev/stg/tmc18c30_isa.c head/sys/dev/stg/tmc18c30_pccard.c head/sys/dev/stg/tmc18c30_pci.c head/sys/dev/stg/tmc18c30_subr.c head/sys/dev/stg/tmc18c30var.h Modified: head/sys/cam/scsi/scsi_low.c ============================================================================== --- head/sys/cam/scsi/scsi_low.c Thu Nov 20 20:24:30 2014 (r274759) +++ head/sys/cam/scsi/scsi_low.c Thu Nov 20 20:50:05 2014 (r274760) @@ -150,6 +150,8 @@ int scsi_low_version_major = 2; int scsi_low_version_minor = 17; static struct scsi_low_softc_tab sl_tab = LIST_HEAD_INITIALIZER(sl_tab); +static struct mtx sl_tab_lock; +MTX_SYSINIT(sl_tab_lock, &sl_tab_lock, "scsi low table", MTX_DEF); /************************************************************** * Debug, Run test and Statics @@ -365,21 +367,10 @@ static void scsi_low_poll_cam(struct cam void scsi_low_scsi_action_cam(struct cam_sim *, union ccb *); static int scsi_low_attach_cam(struct scsi_low_softc *); -static int scsi_low_world_start_cam(struct scsi_low_softc *); -static int scsi_low_dettach_cam(struct scsi_low_softc *); +static int scsi_low_detach_cam(struct scsi_low_softc *); static int scsi_low_ccb_setup_cam(struct scsi_low_softc *, struct slccb *); static int scsi_low_done_cam(struct scsi_low_softc *, struct slccb *); -static void scsi_low_timeout_cam(struct scsi_low_softc *, int, int); -struct scsi_low_osdep_funcs scsi_low_osdep_funcs_cam = { - scsi_low_attach_cam, - scsi_low_world_start_cam, - scsi_low_dettach_cam, - scsi_low_ccb_setup_cam, - scsi_low_done_cam, - scsi_low_timeout_cam -}; - struct scsi_low_error_code scsi_low_error_code_cam[] = { {0, CAM_REQ_CMP}, {SENSEIO, CAM_AUTOSNS_VALID | CAM_REQ_CMP_ERR}, @@ -409,12 +400,13 @@ scsi_low_poll_cam(sim) { struct scsi_low_softc *slp = SIM2SLP(sim); + SCSI_LOW_ASSERT_LOCKED(slp); (*slp->sl_funcs->scsi_low_poll) (slp); - if (slp->sl_si.si_poll_count ++ >= + if (slp->sl_poll_count ++ >= SCSI_LOW_CAM_POLL_HZ / SCSI_LOW_TIMEOUT_HZ) { - slp->sl_si.si_poll_count = 0; + slp->sl_poll_count = 0; scsi_low_timeout_check(slp); } } @@ -429,8 +421,9 @@ scsi_low_scsi_action_cam(sim, ccb) struct lun_info *li; struct slccb *cb; u_int lun, flags, msg, target; - int s, rv; + int rv; + SCSI_LOW_ASSERT_LOCKED(slp); target = (u_int) (ccb->ccb_h.target_id); lun = (u_int) ccb->ccb_h.target_lun; @@ -469,7 +462,6 @@ scsi_low_scsi_action_cam(sim, ccb) else flags = CCB_SCSIIO; - s = splcam(); li = scsi_low_alloc_li(ti, lun, 1); if (ti->ti_setup_msg != 0) @@ -485,7 +477,6 @@ scsi_low_scsi_action_cam(sim, ccb) scsi_low_test_abort(slp, ti, li); } #endif /* SCSI_LOW_DEBUG */ - splx(s); break; case XPT_EN_LUN: /* Enable LUN as a target */ @@ -508,10 +499,8 @@ scsi_low_scsi_action_cam(sim, ccb) } #endif /* SCSI_LOW_DIAGNOSTIC */ - s = splcam(); cb = scsi_low_find_ccb(slp, target, lun, ccb->cab.abort_ccb); rv = scsi_low_abort_ccb(slp, cb); - splx(s); if (rv == 0) ccb->ccb_h.status = CAM_REQ_CMP; @@ -540,7 +529,6 @@ scsi_low_scsi_action_cam(sim, ccb) if (lun == CAM_LUN_WILDCARD) lun = 0; - s = splcam(); scsi = &cts->proto_specific.scsi; spi = &cts->xport_specific.spi; if ((spi->valid & (CTS_SPI_VALID_BUS_WIDTH | @@ -587,7 +575,6 @@ scsi_low_scsi_action_cam(sim, ccb) if ((slp->sl_show_result & SHOW_CALCF_RES) != 0) scsi_low_calcf_show(li); } - splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); @@ -612,7 +599,6 @@ scsi_low_scsi_action_cam(sim, ccb) if (lun == CAM_LUN_WILDCARD) lun = 0; - s = splcam(); li = scsi_low_alloc_li(ti, lun, 1); if (li != NULL && cts->type == CTS_TYPE_CURRENT_SETTINGS) { struct ccb_trans_settings_scsi *scsi = @@ -658,7 +644,6 @@ scsi_low_scsi_action_cam(sim, ccb) } else ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; settings_out: - splx(s); xpt_done(ccb); break; } @@ -670,9 +655,7 @@ settings_out: } case XPT_RESET_BUS: /* Reset the specified SCSI bus */ - s = splcam(); scsi_low_restart(slp, SCSI_LOW_RESTART_HARD, NULL); - splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -711,10 +694,8 @@ settings_out: else flags = CCB_NORETRY | CCB_URGENT; - s = splcam(); li = scsi_low_alloc_li(ti, lun, 1); scsi_low_enqueue(slp, ti, li, cb, flags, msg); - splx(s); break; case XPT_PATH_INQ: { /* Path routing inquiry */ @@ -774,51 +755,47 @@ scsi_low_attach_cam(slp) * ask the adapter what subunits are present */ tagged_openings = min(slp->sl_openings, SCSI_LOW_MAXNEXUS); - slp->sl_si.sim = cam_sim_alloc(scsi_low_scsi_action_cam, + slp->sl_sim = cam_sim_alloc(scsi_low_scsi_action_cam, scsi_low_poll_cam, device_get_name(slp->sl_dev), slp, - device_get_unit(slp->sl_dev), &Giant, + device_get_unit(slp->sl_dev), &slp->sl_lock, slp->sl_openings, tagged_openings, devq); - if (slp->sl_si.sim == NULL) { + if (slp->sl_sim == NULL) { cam_simq_free(devq); return ENODEV; } - if (xpt_bus_register(slp->sl_si.sim, NULL, 0) != CAM_SUCCESS) { - free(slp->sl_si.sim, M_SCSILOW); + SCSI_LOW_LOCK(slp); + if (xpt_bus_register(slp->sl_sim, slp->sl_dev, 0) != CAM_SUCCESS) { + cam_sim_free(slp->sl_sim, TRUE); + SCSI_LOW_UNLOCK(slp); return ENODEV; } - if (xpt_create_path(&slp->sl_si.path, /*periph*/NULL, - cam_sim_path(slp->sl_si.sim), CAM_TARGET_WILDCARD, + if (xpt_create_path(&slp->sl_path, /*periph*/NULL, + cam_sim_path(slp->sl_sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - xpt_bus_deregister(cam_sim_path(slp->sl_si.sim)); - cam_sim_free(slp->sl_si.sim, /*free_simq*/TRUE); + xpt_bus_deregister(cam_sim_path(slp->sl_sim)); + cam_sim_free(slp->sl_sim, /*free_simq*/TRUE); + SCSI_LOW_UNLOCK(slp); return ENODEV; } slp->sl_show_result = SHOW_CALCF_RES; /* OK ? */ + SCSI_LOW_UNLOCK(slp); return 0; } static int -scsi_low_world_start_cam(slp) - struct scsi_low_softc *slp; -{ - - return 0; -} - -static int -scsi_low_dettach_cam(slp) +scsi_low_detach_cam(slp) struct scsi_low_softc *slp; { - xpt_async(AC_LOST_DEVICE, slp->sl_si.path, NULL); - xpt_free_path(slp->sl_si.path); - xpt_bus_deregister(cam_sim_path(slp->sl_si.sim)); - cam_sim_free(slp->sl_si.sim, /* free_devq */ TRUE); + xpt_async(AC_LOST_DEVICE, slp->sl_path, NULL); + xpt_free_path(slp->sl_path); + xpt_bus_deregister(cam_sim_path(slp->sl_sim)); + cam_sim_free(slp->sl_sim, /* free_devq */ TRUE); return 0; } @@ -906,48 +883,6 @@ scsi_low_done_cam(slp, cb) return 0; } -static void -scsi_low_timeout_cam(slp, ch, action) - struct scsi_low_softc *slp; - int ch; - int action; -{ - - switch (ch) - { - case SCSI_LOW_TIMEOUT_CH_IO: - switch (action) - { - case SCSI_LOW_TIMEOUT_START: - slp->sl_si.timeout_ch = timeout(scsi_low_timeout, slp, - hz / SCSI_LOW_TIMEOUT_HZ); - break; - case SCSI_LOW_TIMEOUT_STOP: - untimeout(scsi_low_timeout, slp, slp->sl_si.timeout_ch); - break; - } - break; - - case SCSI_LOW_TIMEOUT_CH_ENGAGE: - switch (action) - { - case SCSI_LOW_TIMEOUT_START: - slp->sl_si.engage_ch = timeout(scsi_low_engage, slp, 1); - break; - case SCSI_LOW_TIMEOUT_STOP: - untimeout(scsi_low_engage, slp, slp->sl_si.engage_ch); - break; - } - break; - case SCSI_LOW_TIMEOUT_CH_RECOVER: - break; - } -} - -/*============================================================= - * END OF OS switch (All OS depend fucntions should be above) - =============================================================*/ - /************************************************************** * scsi low deactivate and activate **************************************************************/ @@ -965,15 +900,10 @@ int scsi_low_deactivate(slp) struct scsi_low_softc *slp; { - int s; - s = splcam(); slp->sl_flags |= HW_INACTIVE; - (*slp->sl_osdep_fp->scsi_low_osdep_timeout) - (slp, SCSI_LOW_TIMEOUT_CH_IO, SCSI_LOW_TIMEOUT_STOP); - (*slp->sl_osdep_fp->scsi_low_osdep_timeout) - (slp, SCSI_LOW_TIMEOUT_CH_ENGAGE, SCSI_LOW_TIMEOUT_STOP); - splx(s); + callout_stop(&slp->sl_timeout_timer); + callout_stop(&slp->sl_engage_timer); return 0; } @@ -981,21 +911,18 @@ int scsi_low_activate(slp) struct scsi_low_softc *slp; { - int error, s; + int error; - s = splcam(); slp->sl_flags &= ~HW_INACTIVE; if ((error = scsi_low_restart(slp, SCSI_LOW_RESTART_HARD, NULL)) != 0) { slp->sl_flags |= HW_INACTIVE; - splx(s); return error; } slp->sl_timeout_count = 0; - (*slp->sl_osdep_fp->scsi_low_osdep_timeout) - (slp, SCSI_LOW_TIMEOUT_CH_IO, SCSI_LOW_TIMEOUT_START); - splx(s); + callout_reset(&slp->sl_timeout_timer, hz / SCSI_LOW_TIMEOUT_HZ, + scsi_low_timeout, slp); return 0; } @@ -1063,15 +990,15 @@ scsi_low_engage(arg) void *arg; { struct scsi_low_softc *slp = arg; - int s = splcam(); + SCSI_LOW_ASSERT_LOCKED(slp); switch (slp->sl_rstep) { case 0: slp->sl_rstep ++; (*slp->sl_funcs->scsi_low_power) (slp, SCSI_LOW_ENGAGE); - (*slp->sl_osdep_fp->scsi_low_osdep_timeout) (slp, - SCSI_LOW_TIMEOUT_CH_ENGAGE, SCSI_LOW_TIMEOUT_START); + callout_reset(&slp->sl_engage_timer, hz / 1000, + scsi_low_engage, slp); break; case 1: @@ -1083,7 +1010,6 @@ scsi_low_engage(arg) case 2: break; } - splx(s); } static int @@ -1098,8 +1024,7 @@ scsi_low_init(slp, flags) /* clear power control timeout */ if ((slp->sl_flags & HW_POWERCTRL) != 0) { - (*slp->sl_osdep_fp->scsi_low_osdep_timeout) (slp, - SCSI_LOW_TIMEOUT_CH_ENGAGE, SCSI_LOW_TIMEOUT_STOP); + callout_stop(&slp->sl_engage_timer); slp->sl_flags &= ~(HW_POWDOWN | HW_RESUME); slp->sl_active = 1; slp->sl_powc = SCSI_LOW_POWDOWN_TC; @@ -1273,13 +1198,10 @@ scsi_low_timeout(arg) void *arg; { struct scsi_low_softc *slp = arg; - int s; - s = splcam(); + SCSI_LOW_ASSERT_LOCKED(slp); (void) scsi_low_timeout_check(slp); - (*slp->sl_osdep_fp->scsi_low_osdep_timeout) - (slp, SCSI_LOW_TIMEOUT_CH_IO, SCSI_LOW_TIMEOUT_START); - splx(s); + callout_schedule(&slp->sl_timeout_timer, hz / SCSI_LOW_TIMEOUT_HZ); } static int @@ -1459,12 +1381,7 @@ scsi_low_attach(slp, openings, ntargs, n { struct targ_info *ti; struct lun_info *li; - int s, i, nccb, rv; - - slp->sl_osdep_fp = &scsi_low_osdep_funcs_cam; - - if (slp->sl_osdep_fp == NULL) - panic("scsi_low: interface not spcified"); + int i, nccb, rv; if (ntargs > SCSI_LOW_NTARGETS) { @@ -1503,31 +1420,32 @@ scsi_low_attach(slp, openings, ntargs, n TAILQ_INIT(&slp->sl_start); /* call os depend attach */ - s = splcam(); - rv = (*slp->sl_osdep_fp->scsi_low_osdep_attach) (slp); + rv = scsi_low_attach_cam(slp); if (rv != 0) { - splx(s); device_printf(slp->sl_dev, "scsi_low_attach: osdep attach failed\n"); - return EINVAL; + return (rv); } /* check hardware */ DELAY(1000); /* wait for 1ms */ + SCSI_LOW_LOCK(slp); if (scsi_low_init(slp, SCSI_LOW_RESTART_HARD) != 0) { - splx(s); device_printf(slp->sl_dev, "scsi_low_attach: initialization failed\n"); + SCSI_LOW_UNLOCK(slp); return EINVAL; } /* start watch dog */ slp->sl_timeout_count = 0; - (*slp->sl_osdep_fp->scsi_low_osdep_timeout) - (slp, SCSI_LOW_TIMEOUT_CH_IO, SCSI_LOW_TIMEOUT_START); + callout_reset(&slp->sl_timeout_timer, hz / SCSI_LOW_TIMEOUT_HZ, + scsi_low_timeout, slp); + mtx_lock(&sl_tab_lock); LIST_INSERT_HEAD(&sl_tab, slp, sl_chain); + mtx_unlock(&sl_tab_lock); /* fake call */ scsi_low_abort_ccb(slp, scsi_low_find_ccb(slp, 0, 0, NULL)); @@ -1536,38 +1454,40 @@ scsi_low_attach(slp, openings, ntargs, n /* probing devices */ scsi_low_start_up(slp); #endif /* SCSI_LOW_START_UP_CHECK */ + SCSI_LOW_UNLOCK(slp); - /* call os depend attach done*/ - (*slp->sl_osdep_fp->scsi_low_osdep_world_start) (slp); - splx(s); return 0; } int -scsi_low_dettach(slp) +scsi_low_detach(slp) struct scsi_low_softc *slp; { - int s, rv; + int rv; - s = splcam(); + SCSI_LOW_LOCK(slp); if (scsi_low_is_busy(slp) != 0) { - splx(s); + SCSI_LOW_UNLOCK(slp); return EBUSY; } scsi_low_deactivate(slp); - rv = (*slp->sl_osdep_fp->scsi_low_osdep_dettach) (slp); + rv = scsi_low_detach_cam(slp); if (rv != 0) { - splx(s); + SCSI_LOW_UNLOCK(slp); return EBUSY; } scsi_low_free_ti(slp); + SCSI_LOW_UNLOCK(slp); + callout_drain(&slp->sl_timeout_timer); + callout_drain(&slp->sl_engage_timer); + mtx_lock(&sl_tab_lock); LIST_REMOVE(slp, sl_chain); - splx(s); + mtx_unlock(&sl_tab_lock); return 0; } @@ -1753,9 +1673,8 @@ scsi_low_resume(slp) slp->sl_flags |= HW_RESUME; slp->sl_rstep = 0; (*slp->sl_funcs->scsi_low_power) (slp, SCSI_LOW_ENGAGE); - (*slp->sl_osdep_fp->scsi_low_osdep_timeout) - (slp, SCSI_LOW_TIMEOUT_CH_ENGAGE, - SCSI_LOW_TIMEOUT_START); + callout_reset(&slp->sl_engage_timer, hz / 1000, + scsi_low_engage, slp); return EJUSTRETURN; } return 0; @@ -1839,7 +1758,7 @@ scsi_low_cmd_start: else if (li->li_state >= SCSI_LOW_LUN_OK) { cb->ccb_flags &= ~CCB_INTERNAL; - rv = (*slp->sl_osdep_fp->scsi_low_osdep_ccb_setup) (slp, cb); + rv = scsi_low_ccb_setup_cam(slp, cb); if (cb->ccb_msgoutflag != 0) { scsi_low_ccb_message_exec(slp, cb); @@ -2199,7 +2118,7 @@ scsi_low_done(slp, cb) /* call OS depend done */ if (cb->osdep != NULL) { - rv = (*slp->sl_osdep_fp->scsi_low_osdep_done) (slp, cb); + rv = scsi_low_done_cam(slp, cb); if (rv == EJUSTRETURN) goto retry; } @@ -3140,7 +3059,7 @@ cmd_link_start: scsi_low_init_msgsys(slp, ti); - (*slp->sl_osdep_fp->scsi_low_osdep_ccb_setup) (slp, ncb); + scsi_low_ccb_setup_cam(slp, ncb); if (ncb->ccb_tcmax < SCSI_LOW_MIN_TOUT) ncb->ccb_tcmax = SCSI_LOW_MIN_TOUT; Modified: head/sys/cam/scsi/scsi_low.h ============================================================================== --- head/sys/cam/scsi/scsi_low.h Thu Nov 20 20:24:30 2014 (r274759) +++ head/sys/cam/scsi/scsi_low.h Thu Nov 20 20:50:05 2014 (r274760) @@ -44,10 +44,6 @@ #ifndef _SCSI_LOW_H_ #define _SCSI_LOW_H_ -/*================================================ - * Scsi low OSDEP - * (All os depend structures should be here!) - ================================================*/ /******** includes *******************************/ #include @@ -65,51 +61,8 @@ #undef MSG_IDENTIFY -/******** os depend interface structures **********/ -typedef struct scsi_sense_data scsi_low_osdep_sense_data_t; - -struct scsi_low_osdep_interface { - device_t si_dev; - - struct cam_sim *sim; - struct cam_path *path; - - int si_poll_count; - - struct callout_handle engage_ch; - struct callout_handle timeout_ch; -#ifdef SCSI_LOW_POWFUNC - struct callout_handle recover_ch; -#endif -}; - -/******** os depend interface functions *************/ -struct slccb; -struct scsi_low_softc; -#define SCSI_LOW_TIMEOUT_STOP 0 -#define SCSI_LOW_TIMEOUT_START 1 -#define SCSI_LOW_TIMEOUT_CH_IO 0 -#define SCSI_LOW_TIMEOUT_CH_ENGAGE 1 -#define SCSI_LOW_TIMEOUT_CH_RECOVER 2 - -struct scsi_low_osdep_funcs { - int (*scsi_low_osdep_attach) \ - (struct scsi_low_softc *); - int (*scsi_low_osdep_world_start) \ - (struct scsi_low_softc *); - int (*scsi_low_osdep_dettach) \ - (struct scsi_low_softc *); - int (*scsi_low_osdep_ccb_setup) \ - (struct scsi_low_softc *, struct slccb *); - int (*scsi_low_osdep_done) \ - (struct scsi_low_softc *, struct slccb *); - void (*scsi_low_osdep_timeout) \ - (struct scsi_low_softc *, int, int); -}; - /*================================================ * Generic Scsi Low header file - * (All os depend structures should be above!) ================================================*/ /************************************************* * Scsi low definitions @@ -229,7 +182,7 @@ struct slccb { * Sense data buffer *****************************************/ u_int8_t ccb_scsi_cmd[12]; - scsi_low_osdep_sense_data_t ccb_sense; + struct scsi_sense_data ccb_sense; }; /************************************************* @@ -486,10 +439,19 @@ struct scsi_low_funcs { }; struct scsi_low_softc { - /* os depend structure */ - struct scsi_low_osdep_interface sl_si; -#define sl_dev sl_si.si_dev - struct scsi_low_osdep_funcs *sl_osdep_fp; + device_t sl_dev; + + struct cam_sim *sl_sim; + struct cam_path *sl_path; + + int sl_poll_count; + + struct mtx sl_lock; + struct callout sl_engage_timer; + struct callout sl_timeout_timer; +#ifdef SCSI_LOW_POWFUNC + struct callout sl_recover_timer; +#endif /* our chain */ LIST_ENTRY(scsi_low_softc) sl_chain; @@ -596,6 +558,10 @@ struct scsi_low_softc { int sl_targsize; }; +#define SCSI_LOW_LOCK(sl) mtx_lock(&(sl)->sl_lock) +#define SCSI_LOW_UNLOCK(sl) mtx_unlock(&(sl)->sl_lock) +#define SCSI_LOW_ASSERT_LOCKED(sl) mtx_assert(&(sl)->sl_lock, MA_OWNED) + /************************************************* * SCSI LOW service functions *************************************************/ @@ -603,7 +569,7 @@ struct scsi_low_softc { * Scsi low attachment function. */ int scsi_low_attach(struct scsi_low_softc *, int, int, int, int, int); -int scsi_low_dettach(struct scsi_low_softc *); +int scsi_low_detach(struct scsi_low_softc *); /* * Scsi low interface activate or deactivate functions Modified: head/sys/dev/ct/bshw_machdep.c ============================================================================== --- head/sys/dev/ct/bshw_machdep.c Thu Nov 20 20:24:30 2014 (r274759) +++ head/sys/dev/ct/bshw_machdep.c Thu Nov 20 20:50:05 2014 (r274760) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -328,7 +329,7 @@ bshw_smit_xfer_start(struct ct_softc *ct break; count = (datalen > LC_FSZ ? LC_FSZ : datalen); - bus_space_read_region_4(chp->ch_memt, chp->ch_memh, + bus_read_region_4(chp->ch_mem, LC_SMIT_OFFSET, (u_int32_t *) data, count >> 2); data += count; datalen -= count; @@ -354,7 +355,7 @@ bshw_smit_xfer_start(struct ct_softc *ct } count = (datalen > LC_SFSZ ? LC_SFSZ : datalen); - bus_space_write_region_4(chp->ch_memt, chp->ch_memh, + bus_write_region_4(chp->ch_mem, LC_SMIT_OFFSET, (u_int32_t *) data, count >> 2); data += count; datalen -= count; @@ -363,7 +364,7 @@ bshw_smit_xfer_start(struct ct_softc *ct break; count = (datalen > LC_REST ? LC_REST : datalen); - bus_space_write_region_4(chp->ch_memt, chp->ch_memh, + bus_write_region_4(chp->ch_mem, LC_SMIT_OFFSET + LC_SFSZ, (u_int32_t *) data, count >> 2); data += count; Modified: head/sys/dev/ct/ct.c ============================================================================== --- head/sys/dev/ct/ct.c Thu Nov 20 20:24:30 2014 (r274759) +++ head/sys/dev/ct/ct.c Thu Nov 20 20:50:05 2014 (r274760) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -140,6 +141,7 @@ static int ct_unbusy(struct ct_softc *); static void ct_attention(struct ct_softc *); static struct ct_synch_data *ct_make_synch_table(struct ct_softc *); static int ct_catch_intr(struct ct_softc *); +static int ct_poll(void *); struct scsi_low_funcs ct_funcs = { SC_LOW_INIT_T ct_world_start, @@ -155,7 +157,7 @@ struct scsi_low_funcs ct_funcs = { SC_LOW_MSG_T ct_msg, SC_LOW_TIMEOUT_T NULL, - SC_LOW_POLL_T ctintr, + SC_LOW_POLL_T ct_poll, NULL, /* SC_LOW_POWER_T cthw_power, */ }; @@ -876,11 +878,22 @@ ct_catch_intr(struct ct_softc *ct) return EJUSTRETURN; } -int +void ctintr(void *arg) { struct ct_softc *ct = arg; struct scsi_low_softc *slp = &ct->sc_sclow; + + SCSI_LOW_LOCK(slp); + ct_poll(ct); + SCSI_LOW_UNLOCK(slp); +} + +static int +ct_poll(void *arg) +{ + struct ct_softc *ct = arg; + struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; struct targ_info *ti; struct buf *bp; Modified: head/sys/dev/ct/ct_isa.c ============================================================================== --- head/sys/dev/ct/ct_isa.c Thu Nov 20 20:24:30 2014 (r274759) +++ head/sys/dev/ct/ct_isa.c Thu Nov 20 20:50:05 2014 (r274760) @@ -137,8 +137,7 @@ ct_isa_match(device_t dev) return ENXIO; bzero(&ch, sizeof(ch)); - ch.ch_iot = rman_get_bustag(port_res); - ch.ch_ioh = rman_get_bushandle(port_res), + ch.ch_io = port_res; ch.ch_bus_weight = ct_isa_bus_access_weight; rv = ctprobesubr(&ch, 0, BSHW_DEFAULT_HOSTID, @@ -159,7 +158,7 @@ ct_isa_match(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, mem_res); if (rv != 0) - return 0; + return (BUS_PROBE_DEFAULT); return ENXIO; } @@ -175,7 +174,6 @@ ct_isa_attach(device_t dev) int irq_rid, drq_rid, chiprev; u_int8_t *vaddr; bus_addr_t addr; - intrmask_t s; hw = ct_find_hw(dev); if (ct_space_map(dev, hw, &ct->port_res, &ct->mem_res) != 0) { @@ -183,13 +181,8 @@ ct_isa_attach(device_t dev) return ENXIO; } - bzero(chp, sizeof(*chp)); - chp->ch_iot = rman_get_bustag(ct->port_res); - chp->ch_ioh = rman_get_bushandle(ct->port_res); - if (ct->mem_res) { - chp->ch_memt = rman_get_bustag(ct->mem_res); - chp->ch_memh = rman_get_bushandle(ct->mem_res); - } + chp->ch_io = ct->port_res; + chp->ch_mem = ct->mem_res; chp->ch_bus_weight = ct_isa_bus_access_weight; irq_rid = 0; @@ -254,7 +247,7 @@ ct_isa_attach(device_t dev) ct->ct_synch_setup = bshw_synch_setup; ct->sc_xmode = CT_XMODE_DMA; - if (chp->ch_memh != NULL) + if (chp->ch_mem != NULL) ct->sc_xmode |= CT_XMODE_PIO; ct->sc_chiprev = chiprev; @@ -297,13 +290,12 @@ ct_isa_attach(device_t dev) slp->sl_dev = dev; slp->sl_hostid = bs->sc_hostid; slp->sl_cfgflags = device_get_flags(dev); + mtx_init(&slp->sl_lock, "ct", NULL, MTX_DEF); - s = splcam(); ctattachsubr(ct); - splx(s); - if (bus_setup_intr(dev, ct->irq_res, INTR_TYPE_CAM, - NULL, (driver_intr_t *)ctintr, ct, &ct->sc_ih)) { + if (bus_setup_intr(dev, ct->irq_res, INTR_TYPE_CAM | INTR_MPSAFE, + NULL, ctintr, ct, &ct->sc_ih)) { ct_space_unmap(dev, ct); return ENXIO; } @@ -326,7 +318,7 @@ ct_space_map(device_t dev, struct bshw * *memhp = NULL; port_rid = 0; - *iohp = bus_alloc_resource(dev, SYS_RES_IOPORT, &port_rid, 0, ~0, + *iohp = bus_alloc_resource(dev, SYS_RES_IOPORT, &port_rid, 0ul, ~0ul, BSHW_IOSZ, RF_ACTIVE); if (*iohp == NULL) return ENXIO; @@ -335,7 +327,7 @@ ct_space_map(device_t dev, struct bshw * return 0; mem_rid = 0; - *memhp = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid, 0, ~0, + *memhp = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid, 0ul, ~0ul, BSHW_MEMSZ, RF_ACTIVE); if (*memhp == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, port_rid, *iohp); Modified: head/sys/dev/ct/ct_machdep.h ============================================================================== --- head/sys/dev/ct/ct_machdep.h Thu Nov 20 20:24:30 2014 (r274759) +++ head/sys/dev/ct/ct_machdep.h Thu Nov 20 20:50:05 2014 (r274760) @@ -94,7 +94,7 @@ ct_stat_read_1(struct ct_bus_access_hand { u_int8_t regv; - regv = bus_space_read_1(chp->ch_iot, chp->ch_ioh, stat_port); + regv = bus_read_1(chp->ch_io, stat_port); CT_BUS_WEIGHT(chp) return regv; } @@ -102,33 +102,29 @@ ct_stat_read_1(struct ct_bus_access_hand static __inline void cthw_set_count(struct ct_bus_access_handle *chp, u_int count) { - bus_space_tag_t bst = chp->ch_iot; - bus_space_handle_t bsh = chp->ch_ioh; - bus_space_write_1(bst, bsh, addr_port, wd3s_cnt); + bus_write_1(chp->ch_io, addr_port, wd3s_cnt); CT_BUS_WEIGHT(chp) - bus_space_write_1(bst, bsh, ctrl_port, count >> 16); + bus_write_1(chp->ch_io, ctrl_port, count >> 16); CT_BUS_WEIGHT(chp) - bus_space_write_1(bst, bsh, ctrl_port, count >> 8); + bus_write_1(chp->ch_io, ctrl_port, count >> 8); CT_BUS_WEIGHT(chp) - bus_space_write_1(bst, bsh, ctrl_port, count); + bus_write_1(chp->ch_io, ctrl_port, count); CT_BUS_WEIGHT(chp) } static __inline u_int cthw_get_count(struct ct_bus_access_handle *chp) { - bus_space_tag_t bst = chp->ch_iot; - bus_space_handle_t bsh = chp->ch_ioh; u_int count; - bus_space_write_1(bst, bsh, addr_port, wd3s_cnt); + bus_write_1(chp->ch_io, addr_port, wd3s_cnt); CT_BUS_WEIGHT(chp) - count = (((u_int) bus_space_read_1(bst, bsh, ctrl_port)) << 16); + count = (((u_int) bus_read_1(chp->ch_io, ctrl_port)) << 16); CT_BUS_WEIGHT(chp) - count += (((u_int) bus_space_read_1(bst, bsh, ctrl_port)) << 8); + count += (((u_int) bus_read_1(chp->ch_io, ctrl_port)) << 8); CT_BUS_WEIGHT(chp) - count += ((u_int) bus_space_read_1(bst, bsh, ctrl_port)); + count += ((u_int) bus_read_1(chp->ch_io, ctrl_port)); CT_BUS_WEIGHT(chp) return count; } @@ -136,15 +132,13 @@ cthw_get_count(struct ct_bus_access_hand static __inline void ct_write_cmds(struct ct_bus_access_handle *chp, u_int8_t *cmd, int len) { - bus_space_tag_t bst = chp->ch_iot; - bus_space_handle_t bsh = chp->ch_ioh; int i; - bus_space_write_1(bst, bsh, addr_port, wd3s_cdb); + bus_write_1(chp->ch_io, addr_port, wd3s_cdb); CT_BUS_WEIGHT(chp) for (i = 0; i < len; i ++) { - bus_space_write_1(bst, bsh, ctrl_port, cmd[i]); + bus_write_1(chp->ch_io, ctrl_port, cmd[i]); CT_BUS_WEIGHT(chp) } } @@ -152,13 +146,11 @@ ct_write_cmds(struct ct_bus_access_handl static __inline u_int8_t ct_cr_read_1(struct ct_bus_access_handle *chp, bus_addr_t offs) { - bus_space_tag_t bst = chp->ch_iot; - bus_space_handle_t bsh = chp->ch_ioh; u_int8_t regv; - bus_space_write_1(bst, bsh, addr_port, offs); + bus_write_1(chp->ch_io, addr_port, offs); CT_BUS_WEIGHT(chp) - regv = bus_space_read_1(bst, bsh, ctrl_port); + regv = bus_read_1(chp->ch_io, ctrl_port); CT_BUS_WEIGHT(chp) return regv; } @@ -166,12 +158,10 @@ ct_cr_read_1(struct ct_bus_access_handle static __inline void ct_cr_write_1(struct ct_bus_access_handle *chp, bus_addr_t offs, u_int8_t val) { - bus_space_tag_t bst = chp->ch_iot; - bus_space_handle_t bsh = chp->ch_ioh; - bus_space_write_1(bst, bsh, addr_port, offs); + bus_write_1(chp->ch_io, addr_port, offs); CT_BUS_WEIGHT(chp) - bus_space_write_1(bst, bsh, ctrl_port, val); + bus_write_1(chp->ch_io, ctrl_port, val); CT_BUS_WEIGHT(chp) } @@ -180,7 +170,7 @@ ct_cmdp_read_1(struct ct_bus_access_hand { u_int8_t regv; - regv = bus_space_read_1(chp->ch_iot, chp->ch_ioh, cmd_port); + regv = bus_read_1(chp->ch_io, cmd_port); CT_BUS_WEIGHT(chp) return regv; } @@ -189,7 +179,7 @@ static __inline void ct_cmdp_write_1(struct ct_bus_access_handle *chp, u_int8_t val) { - bus_space_write_1(chp->ch_iot, chp->ch_ioh, cmd_port, val); + bus_write_1(chp->ch_io, cmd_port, val); CT_BUS_WEIGHT(chp) } Modified: head/sys/dev/ct/ctvar.h ============================================================================== --- head/sys/dev/ct/ctvar.h Thu Nov 20 20:24:30 2014 (r274759) +++ head/sys/dev/ct/ctvar.h Thu Nov 20 20:50:05 2014 (r274760) @@ -44,15 +44,8 @@ * Host adapter structure *****************************************************************/ struct ct_bus_access_handle { - bus_space_tag_t ch_iot; /* core chip ctrl port tag */ - bus_space_tag_t ch_delayt; /* delay port tag */ - bus_space_tag_t ch_datat; /* data port tag (pio) */ - bus_space_tag_t ch_memt; /* data port tag (shm) */ - - bus_space_handle_t ch_ioh; - bus_space_handle_t ch_delaybah; - bus_space_handle_t ch_datah; - bus_space_handle_t ch_memh; + struct resource *ch_io; /* core chip ctrl port */ + struct resource *ch_mem; /* data port (shm) */ void (*ch_bus_weight)(struct ct_bus_access_handle *); @@ -132,5 +125,5 @@ struct ct_targ_info { *****************************************************************/ int ctprobesubr(struct ct_bus_access_handle *, u_int, int, u_int, int *); void ctattachsubr(struct ct_softc *); -int ctintr(void *); +void ctintr(void *); #endif /* !_CTVAR_H_ */ Modified: head/sys/dev/ncv/ncr53c500.c ============================================================================== --- head/sys/dev/ncv/ncr53c500.c Thu Nov 20 20:24:30 2014 (r274759) +++ head/sys/dev/ncv/ncr53c500.c Thu Nov 20 20:50:05 2014 (r274760) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -107,18 +108,18 @@ static int ncv_msg(struct ncv_softc *, s static int ncv_reselected(struct ncv_softc *); static int ncv_disconnected(struct ncv_softc *, struct targ_info *); -static __inline void ncvhw_set_count(bus_space_tag_t, bus_space_handle_t, int); -static __inline u_int ncvhw_get_count(bus_space_tag_t, bus_space_handle_t); -static __inline void ncvhw_select_register_0(bus_space_tag_t, bus_space_handle_t, struct ncv_hw *); -static __inline void ncvhw_select_register_1(bus_space_tag_t, bus_space_handle_t, struct ncv_hw *); -static __inline void ncvhw_fpush(bus_space_tag_t, bus_space_handle_t, u_int8_t *, int); +static __inline void ncvhw_set_count(struct resource *, int); +static __inline u_int ncvhw_get_count(struct resource *); +static __inline void ncvhw_select_register_0(struct resource *, struct ncv_hw *); +static __inline void ncvhw_select_register_1(struct resource *, struct ncv_hw *); +static __inline void ncvhw_fpush(struct resource *, u_int8_t *, int); static void ncv_pdma_end(struct ncv_softc *sc, struct targ_info *); static int ncv_world_start(struct ncv_softc *, int); static void ncvhw_bus_reset(struct ncv_softc *); -static void ncvhw_reset(bus_space_tag_t, bus_space_handle_t, struct ncv_hw *); -static int ncvhw_check(bus_space_tag_t, bus_space_handle_t, struct ncv_hw *); -static void ncvhw_init(bus_space_tag_t, bus_space_handle_t, struct ncv_hw *); +static void ncvhw_reset(struct resource *, struct ncv_hw *); +static int ncvhw_check(struct resource *, struct ncv_hw *); +static void ncvhw_init(struct resource *, struct ncv_hw *); static int ncvhw_start_selection(struct ncv_softc *sc, struct slccb *); static void ncvhw_attention(struct ncv_softc *); static int ncv_ccb_nexus_establish(struct ncv_softc *); @@ -154,74 +155,56 @@ struct scsi_low_funcs ncv_funcs = { * hwfuncs **************************************************************/ static __inline void -ncvhw_select_register_0(iot, ioh, hw) - bus_space_tag_t iot; - bus_space_handle_t ioh; - struct ncv_hw *hw; +ncvhw_select_register_0(struct resource *res, struct ncv_hw *hw) { - bus_space_write_1(iot, ioh, cr0_cfg4, hw->hw_cfg4); + bus_write_1(res, cr0_cfg4, hw->hw_cfg4); } static __inline void -ncvhw_select_register_1(iot, ioh, hw) - bus_space_tag_t iot; - bus_space_handle_t ioh; - struct ncv_hw *hw; +ncvhw_select_register_1(struct resource *res, struct ncv_hw *hw) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 21:10:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 582A349B; Thu, 20 Nov 2014 21:10:07 +0000 (UTC) Received: from mail-lb0-x234.google.com (mail-lb0-x234.google.com [IPv6:2a00:1450:4010:c04::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E70C1CAA; Thu, 20 Nov 2014 21:10:06 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id z11so2916349lbi.39 for ; Thu, 20 Nov 2014 13:10:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ze4XmL83FWc5KxynpGsAqrRc8MnE2l7/qKLkQpC6l8I=; b=KOAaXp1QX5YYgntRVWyiKSmuVo2o0XiErXiocILYg0TB/1ODITel2fQbqeZMIGC8pE RVnlTZjZNHU6li56e+G+B0nNmtW4L1x+K6AT53izID6OUlCSWYXWIr7T7A3emdDIPxAd cH5pJYIiPxxkp5u7zwW1c6rObvWVgnSXPn8Gx2++S2pbf5mgzVv+Z610FEr9l6CRxUzZ rw2YPsSaeFeMNj3Vj6t7nzvRnUey0KiTyT+g8wSuijAEzteDdSJqRCIMNVKIXTPEMP1p 02MTwGUSGPymaZp/w1Mm8Uk0q5tFuP9LYs2UMvvBMDlYryfmYj832SeTGCL9td3s1FQr 57dQ== MIME-Version: 1.0 X-Received: by 10.112.133.138 with SMTP id pc10mr451944lbb.48.1416517805072; Thu, 20 Nov 2014 13:10:05 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.130.168 with HTTP; Thu, 20 Nov 2014 13:10:04 -0800 (PST) In-Reply-To: <6491A081-35EB-4837-B025-2E4F92BD6623@xcllnt.net> References: <201411181803.sAII3fCg079794@svn.freebsd.org> <18F6425B-A767-426D-8EEF-57B7CFF3D54B@mu.org> <6491A081-35EB-4837-B025-2E4F92BD6623@xcllnt.net> Date: Thu, 20 Nov 2014 13:10:04 -0800 X-Google-Sender-Auth: jrHUe7zxJmRzFhXc7E25H13v-L0 Message-ID: Subject: Re: svn commit: r274672 - in head/contrib/libxo: . libxo xolint From: Craig Rodrigues To: Marcel Moolenaar Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 21:10:07 -0000 On Wed, Nov 19, 2014 at 8:07 AM, Marcel Moolenaar wrote: > > Patches for netstat can be found here: > https://github.com/Juniper/libxo/blob/master/patches/netstat.patch > > Let me know if it contains the answer to your question. > > I should be able to commit netstat shortly. > Will you be committing the patches for vmstat at about the same time? Last year at BayLisa, Alfred gave a presentation ( https://www.youtube.com/watch?v=xBuyvEddI7U ) mentioning work he did to modify certain utilities in FreeBSD so that they could output information in a format that could be parsed by higher level tools ( https://github.com/splbio/eagleeye ). Converting these (and other) utilities to use libxo will make it a lot easier to write analysis tools like eagleeye. -- Craig From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 21:15:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3F4577C for ; Thu, 20 Nov 2014 21:15:01 +0000 (UTC) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDCDDD6E for ; Thu, 20 Nov 2014 21:15:01 +0000 (UTC) Received: by mail-pd0-f176.google.com with SMTP id y10so3777689pdj.35 for ; Thu, 20 Nov 2014 13:14:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=+1AMOlkDlUdN45CuA0ZZOODFlR27RWG4JrcTNEt7e98=; b=g3dSwLZAtJPOWdZqtaMYjZGe05ka/maBEVoMapAFONXJwd/7zoPIc6yaA+S+SHLM0C Gu7EcRbZSGNXCH3aqJvrRX9i6I6HMS+aY9LKKO1H52PSwvzMdYhOV6M9M9PhlanTQUWR mhd0Jlh/6JZuoeDzdgDWAH7AsxlsSCzV2XvUMKuVe8vcaSM9P1wVzVi2caKxkCWrqzec DuzsN4ljFIAvn8g94h0NY+8v+nX3YY7APlXD0zVt99QhVowR2PyB74TAMo/of4QXi3qQ mMFIErJdb6r09tFSyGJsbrC8cYptPx2/n29+pv6RQY47e4TuGb3QgsD+6QXfKG5oG3o+ uNcA== X-Gm-Message-State: ALoCoQkO3IHnwxN1HYrft2oolJj1dSD52qEntY/FeG0bJXzy8RgRhc2K1Q9M5cxBxDGlLC7+K+zu X-Received: by 10.66.248.36 with SMTP id yj4mr574036pac.51.1416518095695; Thu, 20 Nov 2014 13:14:55 -0800 (PST) Received: from [10.64.27.119] ([69.53.236.236]) by mx.google.com with ESMTPSA id f12sm2875565pat.46.2014.11.20.13.14.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Nov 2014 13:14:54 -0800 (PST) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_E79BC2AD-FE8A-4F51-B8F9-4C662ED26B55"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd From: Warner Losh In-Reply-To: <546E2826.5080606@FreeBSD.org> Date: Thu, 20 Nov 2014 14:14:51 -0700 Message-Id: <9C548298-57D8-47FF-9C66-438F1B6606FE@bsdimp.com> References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> <546CDABC.9020103@FreeBSD.org> <546E08BA.1020707@FreeBSD.org> <6A0453EA-0DAC-4901-AF29-F75E2787B76A@bsdimp.com> <546E2826.5080606@FreeBSD.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 21:15:02 -0000 --Apple-Mail=_E79BC2AD-FE8A-4F51-B8F9-4C662ED26B55 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 20, 2014, at 10:43 AM, Andrey V. Elsukov wrote: > On 20.11.2014 20:23, Warner Losh wrote: >>> since there are some reports about strange behavior of old utilities >>> after this commit, maybe we won't repair them by this way? >>> What you think about this path? >>=20 >> It doesn=92t thrill me. What=92s it trying to do? And localizing it = to fsck is useless. And where >> are these reports? >=20 > I already committed it in r274750. > GEOM_PART class can return partition type via "PART::type" attribute. > Now fsck uses it and runs fsck_ffs or fsck_msdosfs depending from the > partition type. Why did you even ask me and then commit? Grump. Warner --Apple-Mail=_E79BC2AD-FE8A-4F51-B8F9-4C662ED26B55 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUblnLAAoJEGwc0Sh9sBEAsHYQALgaAgXeZ+RFogJc16Slowex uWSfxi1up3I20zT79ADgIPlu2DGrxh+TXOXEvZER0b4bvgKXgXMlYIgl8yCP/brc aX+q2XJ8Nr2asDlEYngKdcFtsYeAJ+eYtWWtj9nOtolV3IDWpy+gsRIPJZCBaleO aTARJV17uHzytJ4tLisBmFXhT5U2ktCd20Mslbs2DFwUqYHvg2Eug9V2rrdpIkNC 8RDtA2tdS2EwiBEVfZvkb15FaoQV/lpTCC9TBLG/u3uVLxYXUSANilsnTMBqL5wq bW1YJewbCX+iR06hwJZNjMitMMETPPcMlusc691Sk+00YnR3xvOdu++Kx/7ZKNDH KhnRm01//fcdM1Il7PNu18MFISeXJaDTA+OWYj7tck3f/2i/yCd5BQqpvzIEfw8t 4gIRzwYQbw2mzSTZ6PQVkx/Z8357MeSSkGE4+L+NABBLF9RQW/TGqHgtXbjFZL2j kix8azO2Ccu8jaBVDFI8bJY3xk9u3kXFcPkkwiKd/JdAM/lrhYEWRF6YsV/wVK+D ov+5OqBwHcl9848Vt3GimVlypsGQaJNQT9yLHuqTsSyQ+fL1qBSerGXU4Tx+CQnf MVyjHlbTJTcG3QuZxwNLFgSd3mSmZn8uyX7WmgyEfaGMjQIxp5t45aF52a+aw6R5 41lJ8sJdpupJ1M2tliuN =E3D/ -----END PGP SIGNATURE----- --Apple-Mail=_E79BC2AD-FE8A-4F51-B8F9-4C662ED26B55-- From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 21:16:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99FEA926 for ; Thu, 20 Nov 2014 21:16:46 +0000 (UTC) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46F40D98 for ; Thu, 20 Nov 2014 21:16:45 +0000 (UTC) Received: by mail-pd0-f176.google.com with SMTP id y10so3804682pdj.7 for ; Thu, 20 Nov 2014 13:16:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=8KwwP1qz4d+hKSo49Gy+bFZR7S/k5xXEdBD8yK727pE=; b=HU6NgiVSmXQq8OPAEITIZvzhNELW9FwZBV12yMTEHzqRa0LhrAp8417Zgp9hbxJCwu E6/0ES3XIakFlPEHIu8d433PMTKyOXoC4gAJp1+yeHNLUcgsfYa+dCMKdkb8vBoZIUJr gLiyjA/4kBwKoh65bbjHVjFMUA9q6SaByXFtbQoiKnCXg6XrAYqh9UcBR4P5G+82VoZ4 qtyfeKRPsXV6N7fFSBV7uouh0CfTE7LT5Zg0fBOLCpsgXXcUqqDR/TRa/5LCwWjsM31t QoFW+n4EEZsp6c8VJwaraHCen+Jl+gqpGNfsgSxtJlmmlZQbE3W+jgZ5/Hc+Vi91UZr8 tubA== X-Gm-Message-State: ALoCoQmhKprziG9KB3UgkV4w+GPQpXVkNqr1uf50+SEuYprgkDzygnj2N0QpiAd52oRLDZd+YIGV X-Received: by 10.66.228.72 with SMTP id sg8mr413434pac.139.1416518205531; Thu, 20 Nov 2014 13:16:45 -0800 (PST) Received: from [10.64.27.119] ([69.53.236.236]) by mx.google.com with ESMTPSA id kc15sm2886197pbb.3.2014.11.20.13.16.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Nov 2014 13:16:44 -0800 (PST) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_ABDEF4E9-59FA-4221-A02E-8CAEECC3D6EB"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd From: Warner Losh In-Reply-To: <9C548298-57D8-47FF-9C66-438F1B6606FE@bsdimp.com> Date: Thu, 20 Nov 2014 14:16:41 -0700 Message-Id: References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> <546CDABC.9020103@FreeBSD.org> <546E08BA.1020707@FreeBSD.org> <6A0453EA-0DAC-4901-AF29-F75E2787B76A@bsdimp.com> <546E2826.5080606@FreeBSD.org> <9C548298-57D8-47FF-9C66-438F1B6606FE@bsdimp.com> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 21:16:46 -0000 --Apple-Mail=_ABDEF4E9-59FA-4221-A02E-8CAEECC3D6EB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 20, 2014, at 2:14 PM, Warner Losh wrote: >=20 > On Nov 20, 2014, at 10:43 AM, Andrey V. Elsukov = wrote: >=20 >> On 20.11.2014 20:23, Warner Losh wrote: >>>> since there are some reports about strange behavior of old = utilities >>>> after this commit, maybe we won't repair them by this way? >>>> What you think about this path? >>>=20 >>> It doesn=92t thrill me. What=92s it trying to do? And localizing it = to fsck is useless. And where >>> are these reports? >>=20 >> I already committed it in r274750. >> GEOM_PART class can return partition type via "PART::type" attribute. >> Now fsck uses it and runs fsck_ffs or fsck_msdosfs depending from the >> partition type. >=20 > Why did you even ask me and then commit? >=20 > >=20 > Grump. And seeing that it was verbatim, I am likely going to back it. Why did = you jump into fix a problem I was fixing in such a bogus way. Warner --Apple-Mail=_ABDEF4E9-59FA-4221-A02E-8CAEECC3D6EB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUblo5AAoJEGwc0Sh9sBEAFZIQANjRi8qW6Q3QdKCnT/kxKktY aJ8VoRKaPCMfyJ6yNQ5+DUR/+jMyJ7TkijWuUK3FSiGl6LGA5KD7dbsZFn/kY4ra YU8QpjwpQsGCNSFJHytha7VwskhIynRhxXfkvcqoN2vjJR/j1V0fZu5VQxOyC5uS GuCSU4Fn2dpkap8trvz5gZnCN6o4azfFpPJ3S2h47vlnXKvOPX1LfbVJ5or6cQuP pJPsORjZm3BlG+IQvXTSI9w0diIBXoLvyEqhFV8LXwMe/y7Br4ytzszClSCyefs7 qmB8clDIxZ9GDglYNTxSelAB60fW9HoNI0b4O7BTG+4xd31jZi0hchqxg2W9CfCu SP5JsbQsaHLwA+t0MaklZyxhyzR2upNfh2alDTGAzjHjSlwnFpid+03JKCjULeit 2Xi+oYS7FdPdfpOwS18wdQG3aTqGcT1GcmWDncvDXDrEJgdmV9e8o6N4CkoaDXE4 rUcdkgwhUHui02IvdeMQ1EnHRkDEQyoL/2RooY3r0IBFs2q0jzqHiIZCrZeBijUS WD5sg3ERFIk5+4s4Y7ungKlLVdThCAoZ8Uh44NjrXQOLWtK6ReRETV51mBSXfxVn F+WcFXjJdngDZak1fkeHm+dSEC5Y87CmMmWCv/2zcuYRC3H674EvQQYplZu0R1LN e+ws1wWE/pQxHVS3+tYZ =TPg4 -----END PGP SIGNATURE----- --Apple-Mail=_ABDEF4E9-59FA-4221-A02E-8CAEECC3D6EB-- From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 21:18:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F6DCA71; Thu, 20 Nov 2014 21:18:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80C84DA4; Thu, 20 Nov 2014 21:18:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKLIKOL077288; Thu, 20 Nov 2014 21:18:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKLIKcn077286; Thu, 20 Nov 2014 21:18:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411202118.sAKLIKcn077286@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 20 Nov 2014 21:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274761 - head/sbin/fsck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 21:18:20 -0000 Author: imp Date: Thu Nov 20 21:18:19 2014 New Revision: 274761 URL: https://svnweb.freebsd.org/changeset/base/274761 Log: Back our r274750 until discussions on proper fix are over. Modified: head/sbin/fsck/fsck.c Modified: head/sbin/fsck/fsck.c ============================================================================== --- head/sbin/fsck/fsck.c Thu Nov 20 20:50:05 2014 (r274760) +++ head/sbin/fsck/fsck.c Thu Nov 20 21:18:19 2014 (r274761) @@ -41,7 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#define FSTYPENAMES +#include #include #include @@ -80,21 +81,10 @@ static void addentry(struct fstypelist * static void maketypelist(char *); static void catopt(char **, const char *); static void mangle(char *, int *, const char ** volatile *, int *); -static const char *getfstype(const char *); +static const char *getfslab(const char *); static void usage(void) __dead2; static int isok(struct fstab *); -static struct { - const char *ptype; - const char *name; -} ptype_map[] = { - { "ufs", "ffs" }, - { "ffs", "ffs" }, - { "fat", "msdosfs" }, - { "efi", "msdosfs" }, - { NULL, NULL }, -}; - int main(int argc, char *argv[]) { @@ -213,7 +203,7 @@ main(int argc, char *argv[]) if ((fs = getfsfile(spec)) == NULL && (fs = getfsspec(spec)) == NULL) { if (vfstype == NULL) - vfstype = getfstype(spec); + vfstype = getfslab(spec); if (vfstype == NULL) errx(1, "Could not determine filesystem type"); type = vfstype; @@ -545,27 +535,41 @@ mangle(char *opts, int *argcp, const cha *maxargcp = maxargc; } + static const char * -getfstype(const char *str) +getfslab(const char *str) { - struct diocgattr_arg attr; - int fd, i; + struct disklabel dl; + int fd; + char p; + const char *vfstype; + u_char t; + /* deduce the file system type from the disk label */ if ((fd = open(str, O_RDONLY)) == -1) err(1, "cannot open `%s'", str); - strncpy(attr.name, "PART::type", sizeof(attr.name)); - memset(&attr.value, 0, sizeof(attr.value)); - attr.len = sizeof(attr.value); - if (ioctl(fd, DIOCGATTR, &attr) == -1) { + if (ioctl(fd, DIOCGDINFO, &dl) == -1) { (void) close(fd); return(NULL); } + (void) close(fd); - for (i = 0; ptype_map[i].ptype != NULL; i++) - if (strstr(attr.value.str, ptype_map[i].ptype) != NULL) - return (ptype_map[i].name); - return (NULL); + + p = str[strlen(str) - 1]; + + if ((p - 'a') >= dl.d_npartitions) + errx(1, "partition `%s' is not defined on disk", str); + + if ((t = dl.d_partitions[p - 'a'].p_fstype) >= FSMAXTYPES) + errx(1, "partition `%s' is not of a legal vfstype", + str); + + if ((vfstype = fstypenames[t]) == NULL) + errx(1, "vfstype `%s' on partition `%s' is not supported", + fstypenames[t], str); + + return vfstype; } From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 21:41:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6663A671; Thu, 20 Nov 2014 21:41:18 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41A4D108; Thu, 20 Nov 2014 21:41:17 +0000 (UTC) Received: from abrahami-sslvpn-nc.jnpr.net ([66.129.239.12]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id sAKLfAbh039989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 Nov 2014 13:41:11 -0800 (PST) (envelope-from marcel@xcllnt.net) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r274672 - in head/contrib/libxo: . libxo xolint From: Marcel Moolenaar In-Reply-To: Date: Thu, 20 Nov 2014 13:41:05 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411181803.sAII3fCg079794@svn.freebsd.org> <18F6425B-A767-426D-8EEF-57B7CFF3D54B@mu.org> <6491A081-35EB-4837-B025-2E4F92BD6623@xcllnt.net> To: Craig Rodrigues X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 21:41:18 -0000 > On Nov 20, 2014, at 1:10 PM, Craig Rodrigues = wrote: >=20 >=20 >=20 > On Wed, Nov 19, 2014 at 8:07 AM, Marcel Moolenaar = wrote: >=20 > Patches for netstat can be found here: > https://github.com/Juniper/libxo/blob/master/patches/netstat.patch >=20 > Let me know if it contains the answer to your question. >=20 > I should be able to commit netstat shortly. >=20 > Will you be committing the patches for vmstat at about the same time? I'll work on vmstat as well, yes. Feel free to help out if you want it done ASAP. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 22:04:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1C38FCF; Thu, 20 Nov 2014 22:04:50 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 8A6771781; Thu, 20 Nov 2014 22:04:49 +0000 (UTC) Message-ID: <546E6557.8000409@FreeBSD.org> Date: Fri, 21 Nov 2014 01:04:07 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> <546CDABC.9020103@FreeBSD.org> <546E08BA.1020707@FreeBSD.org> <6A0453EA-0DAC-4901-AF29-F75E2787B76A@bsdimp.com> <546E2826.5080606@FreeBSD.org> <9C548298-57D8-47FF-9C66-438F1B6606FE@bsdimp.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="g4fWb9jedv88aMOvOlsj4UBw5AdSpln6b" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 22:04:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --g4fWb9jedv88aMOvOlsj4UBw5AdSpln6b Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 21.11.2014 00:16, Warner Losh wrote: >>> I already committed it in r274750. GEOM_PART class can return >>> partition type via "PART::type" attribute. Now fsck uses it and >>> runs fsck_ffs or fsck_msdosfs depending from the partition type. >>=20 >> Why did you even ask me and then commit? >>=20 >> > it> I did the tests and it works for ufs and msdosfs. > And seeing that it was verbatim, I am likely going to back it. Why > did you jump into fix a problem I was fixing in such a bogus way. Your fix isn't complete. It works only for bsdlabels with 8 partitions. --=20 WBR, Andrey V. Elsukov --g4fWb9jedv88aMOvOlsj4UBw5AdSpln6b 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJUbmVeAAoJEAHF6gQQyKF6MKgH/2xIq6kzGC8AoekZ5CpXH8rj ktuCgCG0uTEvsJ1t9Zi1gAiXMN5X9k/43sMDNOsxIqy91rJMvAo30EHTU2xl+PaA ngXvS0jaLPXz824gYKIqyQ6kMr1dY6dTlbHIgaImYqKMp5DfA1TYvkhRpFn7R1rL NGKhV2o7LDJWJNGiRMJipw9KQ2UR4KpsK47XsxGd3QqyeozaRSECCmuanqrp6AJx uJBKbcy1WIMjyNmxKyUbpFaGy8niPviji0+7gSnlndgNb3M1P4wIUU8MCblMrCUl fx1ONO0uwtKpDkT3XOem9o2aRQi2eN+lPWQqpz3GZ0ffowb6mGQdZbltmqnKIo8= =jbyz -----END PGP SIGNATURE----- --g4fWb9jedv88aMOvOlsj4UBw5AdSpln6b-- From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 23:09:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03E14369; Thu, 20 Nov 2014 23:09:04 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 78CE2C4C; Thu, 20 Nov 2014 23:09:01 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sAKN8q9B057370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 21 Nov 2014 02:08:52 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sAKN8qXq057369; Fri, 21 Nov 2014 02:08:52 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 21 Nov 2014 02:08:52 +0300 From: Gleb Smirnoff To: Craig Rodrigues Subject: Re: svn commit: r274745 - head/share/man/man9 Message-ID: <20141120230852.GM47144@FreeBSD.org> References: <201411200956.sAK9uYiZ085513@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411200956.sAK9uYiZ085513@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 23:09:04 -0000 On Thu, Nov 20, 2014 at 09:56:34AM +0000, Craig Rodrigues wrote: C> Author: rodrigc C> Date: Thu Nov 20 09:56:34 2014 C> New Revision: 274745 C> URL: https://svnweb.freebsd.org/changeset/base/274745 C> C> Log: C> MFp4: @179066 C> C> Add page which describes VNET network stack virtualization infrastructure. C> C> Submitted by: bz C> Sponsored by: The FreeBSD Foundation C> Sponsored by: CK Software GmbH C> C> Added: C> head/share/man/man9/vnet.9 (contents, props changed) C> Modified: C> head/share/man/man9/Makefile Thanks a lot for that, Craig and Bjoern! May be it is worth adding MILNKS for vimage.9, what do you think? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Nov 20 23:16:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8950A752; Thu, 20 Nov 2014 23:16:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75E90D42; Thu, 20 Nov 2014 23:16:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKNGK86041834; Thu, 20 Nov 2014 23:16:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKNGKUu041832; Thu, 20 Nov 2014 23:16:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201411202316.sAKNGKUu041832@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Nov 2014 23:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274766 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 23:16:20 -0000 Author: emaste Date: Thu Nov 20 23:16:19 2014 New Revision: 274766 URL: https://svnweb.freebsd.org/changeset/base/274766 Log: Clamp too-large hwpmc callchaindepth to the maximum If the depth requested by the user is too large, it's better to provide the maximum than the smaller default. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 20 23:00:17 2014 (r274765) +++ head/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 20 23:16:19 2014 (r274766) @@ -4749,8 +4749,9 @@ pmc_initialize(void) if (pmc_callchaindepth <= 0 || pmc_callchaindepth > PMC_CALLCHAIN_DEPTH_MAX) { (void) printf("hwpmc: tunable \"callchaindepth\"=%d out of " - "range.\n", pmc_callchaindepth); - pmc_callchaindepth = PMC_CALLCHAIN_DEPTH; + "range - using %d.\n", pmc_callchaindepth, + PMC_CALLCHAIN_DEPTH_MAX); + pmc_callchaindepth = PMC_CALLCHAIN_DEPTH_MAX; } md = pmc_md_initialize(); From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 01:43:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F55D7D0; Fri, 21 Nov 2014 01:43:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31E08DC1; Fri, 21 Nov 2014 01:43:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAL1huAR026217; Fri, 21 Nov 2014 01:43:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAL1huYo026216; Fri, 21 Nov 2014 01:43:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411210143.sAL1huYo026216@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 21 Nov 2014 01:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274770 - head/sbin/fsck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 01:43:56 -0000 Author: imp Date: Fri Nov 21 01:43:55 2014 New Revision: 274770 URL: https://svnweb.freebsd.org/changeset/base/274770 Log: Recommit r274750. Modified: head/sbin/fsck/fsck.c Modified: head/sbin/fsck/fsck.c ============================================================================== --- head/sbin/fsck/fsck.c Fri Nov 21 01:27:27 2014 (r274769) +++ head/sbin/fsck/fsck.c Fri Nov 21 01:43:55 2014 (r274770) @@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define FSTYPENAMES -#include +#include #include #include @@ -81,10 +80,21 @@ static void addentry(struct fstypelist * static void maketypelist(char *); static void catopt(char **, const char *); static void mangle(char *, int *, const char ** volatile *, int *); -static const char *getfslab(const char *); +static const char *getfstype(const char *); static void usage(void) __dead2; static int isok(struct fstab *); +static struct { + const char *ptype; + const char *name; +} ptype_map[] = { + { "ufs", "ffs" }, + { "ffs", "ffs" }, + { "fat", "msdosfs" }, + { "efi", "msdosfs" }, + { NULL, NULL }, +}; + int main(int argc, char *argv[]) { @@ -203,7 +213,7 @@ main(int argc, char *argv[]) if ((fs = getfsfile(spec)) == NULL && (fs = getfsspec(spec)) == NULL) { if (vfstype == NULL) - vfstype = getfslab(spec); + vfstype = getfstype(spec); if (vfstype == NULL) errx(1, "Could not determine filesystem type"); type = vfstype; @@ -535,41 +545,27 @@ mangle(char *opts, int *argcp, const cha *maxargcp = maxargc; } - static const char * -getfslab(const char *str) +getfstype(const char *str) { - struct disklabel dl; - int fd; - char p; - const char *vfstype; - u_char t; + struct diocgattr_arg attr; + int fd, i; - /* deduce the file system type from the disk label */ if ((fd = open(str, O_RDONLY)) == -1) err(1, "cannot open `%s'", str); - if (ioctl(fd, DIOCGDINFO, &dl) == -1) { + strncpy(attr.name, "PART::type", sizeof(attr.name)); + memset(&attr.value, 0, sizeof(attr.value)); + attr.len = sizeof(attr.value); + if (ioctl(fd, DIOCGATTR, &attr) == -1) { (void) close(fd); return(NULL); } - (void) close(fd); - - p = str[strlen(str) - 1]; - - if ((p - 'a') >= dl.d_npartitions) - errx(1, "partition `%s' is not defined on disk", str); - - if ((t = dl.d_partitions[p - 'a'].p_fstype) >= FSMAXTYPES) - errx(1, "partition `%s' is not of a legal vfstype", - str); - - if ((vfstype = fstypenames[t]) == NULL) - errx(1, "vfstype `%s' on partition `%s' is not supported", - fstypenames[t], str); - - return vfstype; + for (i = 0; ptype_map[i].ptype != NULL; i++) + if (strstr(attr.value.str, ptype_map[i].ptype) != NULL) + return (ptype_map[i].name); + return (NULL); } From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 02:05:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8506DE1; Fri, 21 Nov 2014 02:05:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1A14FB1; Fri, 21 Nov 2014 02:05:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAL25sQ4050997; Fri, 21 Nov 2014 02:05:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAL25nGB050901; Fri, 21 Nov 2014 02:05:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201411210205.sAL25nGB050901@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 21 Nov 2014 02:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274772 - in head: lib/libc/gen lib/libc/include lib/libc/sys lib/libkiconv lib/libmd lib/libthr/thread lib/msun/src libexec/rtld-elf sys/amd64/include sys/arm/include sys/i386/include ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 02:05:55 -0000 Author: emaste Date: Fri Nov 21 02:05:48 2014 New Revision: 274772 URL: https://svnweb.freebsd.org/changeset/base/274772 Log: Use canonical __PIC__ flag It is automatically set when -fPIC is passed to the compiler. Reviewed by: dim, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1179 Modified: head/lib/libc/gen/errlst.c head/lib/libc/gen/isnan.c head/lib/libc/gen/tls.c head/lib/libc/include/errlst.h head/lib/libc/sys/stack_protector.c head/lib/libc/sys/stack_protector_compat.c head/lib/libkiconv/quirks.c head/lib/libkiconv/xlat16_iconv.c head/lib/libkiconv/xlat16_sysctl.c head/lib/libmd/rmd160c.c head/lib/libmd/sha1c.c head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_private.h head/lib/msun/src/s_isnan.c head/libexec/rtld-elf/rtld.c head/sys/amd64/include/asm.h head/sys/arm/include/asm.h head/sys/i386/include/asm.h head/sys/powerpc/include/asm.h head/sys/powerpc/include/profile.h head/sys/sparc64/include/asm.h Modified: head/lib/libc/gen/errlst.c ============================================================================== --- head/lib/libc/gen/errlst.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/gen/errlst.c Fri Nov 21 02:05:48 2014 (r274772) @@ -158,7 +158,7 @@ const char *const sys_errlist[] = { }; const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); -#ifdef PIC +#ifdef __PIC__ __strong_reference(sys_errlist, __hidden_sys_errlist); __strong_reference(sys_nerr, __hidden_sys_nerr); #endif Modified: head/lib/libc/gen/isnan.c ============================================================================== --- head/lib/libc/gen/isnan.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/gen/isnan.c Fri Nov 21 02:05:48 2014 (r274772) @@ -40,7 +40,7 @@ * time, when calling both functions. */ -#ifdef PIC +#ifdef __PIC__ __weak_reference(__isnan, isnan); __weak_reference(__isnanf, isnanf); @@ -61,4 +61,4 @@ __isnanf(float f) u.f = f; return (u.bits.exp == 255 && u.bits.man != 0); } -#endif /* PIC */ +#endif /* __PIC__ */ Modified: head/lib/libc/gen/tls.c ============================================================================== --- head/lib/libc/gen/tls.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/gen/tls.c Fri Nov 21 02:05:48 2014 (r274772) @@ -78,7 +78,7 @@ void __libc_free_tls(void *tls, size_t t #define TLS_VARIANT_II #endif -#ifndef PIC +#ifndef __PIC__ #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) @@ -107,7 +107,7 @@ __libc_tls_get_addr(void *ti __unused) return (0); } -#ifndef PIC +#ifndef __PIC__ #ifdef TLS_VARIANT_I @@ -264,14 +264,14 @@ __libc_free_tls(void *tcb __unused, size { } -#endif /* PIC */ +#endif /* __PIC__ */ extern char **environ; void _init_tls() { -#ifndef PIC +#ifndef __PIC__ Elf_Addr *sp; Elf_Auxinfo *aux, *auxp; Elf_Phdr *phdr; Modified: head/lib/libc/include/errlst.h ============================================================================== --- head/lib/libc/include/errlst.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/include/errlst.h Fri Nov 21 02:05:48 2014 (r274772) @@ -31,7 +31,7 @@ #include -#ifdef PIC +#ifdef __PIC__ /* If the main executable imports these, do not use its copy from libc.so. */ extern const char *const __hidden_sys_errlist[] __hidden; extern const int __hidden_sys_nerr __hidden; Modified: head/lib/libc/sys/stack_protector.c ============================================================================== --- head/lib/libc/sys/stack_protector.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/sys/stack_protector.c Fri Nov 21 02:05:48 2014 (r274772) @@ -115,6 +115,6 @@ __chk_fail(void) __fail("buffer overflow detected; terminated"); } -#ifndef PIC +#ifndef __PIC__ __weak_reference(__stack_chk_fail, __stack_chk_fail_local); #endif Modified: head/lib/libc/sys/stack_protector_compat.c ============================================================================== --- head/lib/libc/sys/stack_protector_compat.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/sys/stack_protector_compat.c Fri Nov 21 02:05:48 2014 (r274772) @@ -8,7 +8,7 @@ __FBSDID("$FreeBSD$"); void __stack_chk_fail(void); -#ifdef PIC +#ifdef __PIC__ void __stack_chk_fail_local_hidden(void) { Modified: head/lib/libkiconv/quirks.c ============================================================================== --- head/lib/libkiconv/quirks.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libkiconv/quirks.c Fri Nov 21 02:05:48 2014 (r274772) @@ -31,7 +31,7 @@ * when statically linked. */ -#ifdef PIC +#ifdef __PIC__ /* * Why do we need quirks? @@ -193,4 +193,4 @@ kiconv_quirkcs(const char* base __unused return (base); } -#endif /* PIC */ +#endif /* __PIC__ */ Modified: head/lib/libkiconv/xlat16_iconv.c ============================================================================== --- head/lib/libkiconv/xlat16_iconv.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libkiconv/xlat16_iconv.c Fri Nov 21 02:05:48 2014 (r274772) @@ -31,7 +31,7 @@ * when statically linked. */ -#ifdef PIC +#ifdef __PIC__ #include #include @@ -462,4 +462,4 @@ kiconv_add_xlat16_cspairs(const char *to return (-1); } -#endif /* PIC */ +#endif /* __PIC__ */ Modified: head/lib/libkiconv/xlat16_sysctl.c ============================================================================== --- head/lib/libkiconv/xlat16_sysctl.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libkiconv/xlat16_sysctl.c Fri Nov 21 02:05:48 2014 (r274772) @@ -37,7 +37,7 @@ * when statically linked. */ -#ifdef PIC +#ifdef __PIC__ #include #include @@ -82,4 +82,4 @@ kiconv_add_xlat16_table(const char *to _ return (EINVAL); } -#endif /* PIC */ +#endif /* __PIC__ */ Modified: head/lib/libmd/rmd160c.c ============================================================================== --- head/lib/libmd/rmd160c.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libmd/rmd160c.c Fri Nov 21 02:05:48 2014 (r274772) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); * The assembly-language code is not position-independent, so don't * try to use it in a shared library. */ -#ifdef PIC +#ifdef __PIC__ #undef RMD160_ASM #endif Modified: head/lib/libmd/sha1c.c ============================================================================== --- head/lib/libmd/sha1c.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libmd/sha1c.c Fri Nov 21 02:05:48 2014 (r274772) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); * The assembly-language code is not position-independent, so don't * try to use it in a shared library. */ -#ifdef PIC +#ifdef __PIC__ #undef SHA1_ASM #endif Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libthr/thread/thr_exit.c Fri Nov 21 02:05:48 2014 (r274772) @@ -54,7 +54,7 @@ __weak_reference(_pthread_exit, pthread_ static int message_printed; static void thread_unwind(void) __dead2; -#ifdef PIC +#ifdef __PIC__ static void thread_uw_init(void); static _Unwind_Reason_Code thread_unwind_stop(int version, _Unwind_Action actions, @@ -114,7 +114,7 @@ _Unwind_GetCFA(struct _Unwind_Context *c #else #pragma weak _Unwind_GetCFA #pragma weak _Unwind_ForcedUnwind -#endif /* PIC */ +#endif /* __PIC__ */ static void thread_unwind_cleanup(_Unwind_Reason_Code code, struct _Unwind_Exception *e) @@ -222,11 +222,11 @@ _pthread_exit_mask(void *status, sigset_ curthread->ret = status; #ifdef _PTHREAD_FORCED_UNWIND -#ifdef PIC +#ifdef __PIC__ thread_uw_init(); -#endif /* PIC */ +#endif /* __PIC__ */ -#ifdef PIC +#ifdef __PIC__ if (uwl_forcedunwind != NULL) { #else if (_Unwind_ForcedUnwind != NULL) { Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libthr/thread/thr_private.h Fri Nov 21 02:05:48 2014 (r274772) @@ -100,7 +100,7 @@ TAILQ_HEAD(mutex_queue, pthread_mutex); #define THR_ASSERT(cond, msg) #endif -#ifdef PIC +#ifdef __PIC__ # define STATIC_LIB_REQUIRE(name) #else # define STATIC_LIB_REQUIRE(name) __asm (".globl " #name) Modified: head/lib/msun/src/s_isnan.c ============================================================================== --- head/lib/msun/src/s_isnan.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/msun/src/s_isnan.c Fri Nov 21 02:05:48 2014 (r274772) @@ -31,7 +31,7 @@ #include "fpmath.h" /* Provided by libc.so */ -#ifndef PIC +#ifndef __PIC__ #undef isnan int isnan(double d) @@ -41,7 +41,7 @@ isnan(double d) u.d = d; return (u.bits.exp == 2047 && (u.bits.manl != 0 || u.bits.manh != 0)); } -#endif /* !PIC */ +#endif /* !__PIC__ */ int __isnanf(float f) Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/libexec/rtld-elf/rtld.c Fri Nov 21 02:05:48 2014 (r274772) @@ -1817,7 +1817,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * objtmp.path = NULL; objtmp.rtld = true; objtmp.mapbase = mapbase; -#ifdef PIC +#ifdef __PIC__ objtmp.relocbase = mapbase; #endif if (RTLD_IS_DYNAMIC()) { Modified: head/sys/amd64/include/asm.h ============================================================================== --- head/sys/amd64/include/asm.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/amd64/include/asm.h Fri Nov 21 02:05:48 2014 (r274772) @@ -38,7 +38,7 @@ #include -#ifdef PIC +#ifdef __PIC__ #define PIC_PLT(x) x@PLT #define PIC_GOT(x) x@GOTPCREL(%rip) #else Modified: head/sys/arm/include/asm.h ============================================================================== --- head/sys/arm/include/asm.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/arm/include/asm.h Fri Nov 21 02:05:48 2014 (r274772) @@ -104,7 +104,7 @@ #define ASMSTR .asciz -#if defined(PIC) +#if defined(__PIC__) #define PLT_SYM(x) PIC_SYM(x, PLT) #define GOT_SYM(x) PIC_SYM(x, GOT) #define GOT_GET(x,got,sym) \ @@ -131,7 +131,7 @@ #define GOT_INIT(got,gotsym,pclabel) #define GOT_INITSYM(gotsym,pclabel) #define PIC_SYM(x,y) x -#endif /* PIC */ +#endif /* __PIC__ */ #undef __FBSDID #if !defined(lint) && !defined(STRIP_FBSDID) Modified: head/sys/i386/include/asm.h ============================================================================== --- head/sys/i386/include/asm.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/i386/include/asm.h Fri Nov 21 02:05:48 2014 (r274772) @@ -38,7 +38,7 @@ #include -#ifdef PIC +#ifdef __PIC__ #define PIC_PROLOGUE \ pushl %ebx; \ call 1f; \ Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/powerpc/include/asm.h Fri Nov 21 02:05:48 2014 (r274772) @@ -37,7 +37,7 @@ #include -#if defined(PIC) && !defined(__powerpc64__) +#if defined(__PIC__) && !defined(__powerpc64__) #define PIC_PROLOGUE XXX #define PIC_EPILOGUE XXX #define PIC_PLT(x) x@plt Modified: head/sys/powerpc/include/profile.h ============================================================================== --- head/sys/powerpc/include/profile.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/powerpc/include/profile.h Fri Nov 21 02:05:48 2014 (r274772) @@ -119,7 +119,7 @@ __asm( " .text \n" \ " blr \n"); #else -#ifdef PIC +#ifdef __PIC__ #define _PLT "@plt" #else #define _PLT Modified: head/sys/sparc64/include/asm.h ============================================================================== --- head/sys/sparc64/include/asm.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/sparc64/include/asm.h Fri Nov 21 02:05:48 2014 (r274772) @@ -41,7 +41,7 @@ #include -#ifdef PIC +#ifdef __PIC__ #define PIC_PROLOGUE(r1, r2) \ sethi %hi(_GLOBAL_OFFSET_TABLE_-4), r1 ; \ rd %pc, r2 ; \ From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 02:45:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2825C7F1; Fri, 21 Nov 2014 02:45:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 149343D3; Fri, 21 Nov 2014 02:45:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAL2jdXi096709; Fri, 21 Nov 2014 02:45:39 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAL2jdGF096708; Fri, 21 Nov 2014 02:45:39 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201411210245.sAL2jdGF096708@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 21 Nov 2014 02:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274776 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 02:45:40 -0000 Author: jhibbits Date: Fri Nov 21 02:45:39 2014 New Revision: 274776 URL: https://svnweb.freebsd.org/changeset/base/274776 Log: Fix the powerpc64 build. Pointy-hat to: me X-MFC-with: r274735 Modified: head/sys/powerpc/powerpc/db_trace.c Modified: head/sys/powerpc/powerpc/db_trace.c ============================================================================== --- head/sys/powerpc/powerpc/db_trace.c Fri Nov 21 02:30:37 2014 (r274775) +++ head/sys/powerpc/powerpc/db_trace.c Fri Nov 21 02:45:39 2014 (r274776) @@ -263,7 +263,7 @@ db_backtrace(struct thread *td, db_addr_ print_trap: lr = (db_addr_t) tf->srr0; db_printsym(lr, DB_STGY_ANY); - db_printf(": srr1=%#x\n", tf->srr1); + db_printf(": srr1=%#zx\n", tf->srr1); db_printf("%-10s r1=%#zx cr=%#x xer=%#x ctr=%#zx", "", tf->fixreg[1], (uint32_t)tf->cr, (uint32_t)tf->xer, tf->ctr); From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 05:25:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86F77245; Fri, 21 Nov 2014 05:25:02 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtp002.mac.com [17.172.220.237]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E55C26EA; Fri, 21 Nov 2014 05:25:01 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTPSA id <0NFD00LELJ11HJ80@st11p02mm-asmtp002.mac.com>; Fri, 21 Nov 2014 05:24:39 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.28,0.0.0000 definitions=2014-11-21_03:2014-11-20,2014-11-21,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=20 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1411210047 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r274167 - in head/sys: kern sys From: Rui Paulo In-reply-to: <201411060812.sA68CZ2w007383@svn.freebsd.org> Date: Thu, 20 Nov 2014 21:24:37 -0800 Content-transfer-encoding: quoted-printable Message-id: References: <201411060812.sA68CZ2w007383@svn.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 05:25:02 -0000 On Nov 6, 2014, at 00:12, Mateusz Guzik wrote: >=20 > Author: mjg > Date: Thu Nov 6 08:12:34 2014 > New Revision: 274167 > URL: https://svnweb.freebsd.org/changeset/base/274167 >=20 > Log: > Add sysctl kern.proc.cwd >=20 > It returns only current working directory of given process which = saves a lot of > overhead over kern.proc.filedesc if given proc has a lot of open fds. >=20 > Submitted by: Tiwei Bie (slightly = modified) > X-Additional: JuniorJobs project >=20 > Modified: > head/sys/kern/kern_descrip.c > head/sys/sys/sysctl.h > head/sys/sys/user.h >=20 > Modified: head/sys/kern/kern_descrip.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/kern_descrip.c Thu Nov 6 07:44:10 2014 = (r274166) > +++ head/sys/kern/kern_descrip.c Thu Nov 6 08:12:34 2014 = (r274167) > @@ -3406,6 +3406,73 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC > CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_filedesc, > "Process filedesc entries"); >=20 > +/* > + * Store a process current working directory information to sbuf. > + * > + * Takes a locked proc as argument, and returns with the proc = unlocked. I never really liked this approach because it makes it harder to see the = locking pattern. Why not call fdhold(p) in the sysctl handler, unlock the process, call = kern_proc_cwd_out() with an additional fdp argument, and then call = fddrop()? -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 05:51:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 049C161E; Fri, 21 Nov 2014 05:51:05 +0000 (UTC) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87AC6914; Fri, 21 Nov 2014 05:51:04 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id k14so5590062wgh.9 for ; Thu, 20 Nov 2014 21:51:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=WvhZp56qGFIJrkpm4YJlM26Qco9ccH/f1OTU36Qp/GE=; b=GLSmP+l8FwuLzeKeKXYfW8lXU9qe5PDGP/vNF66smZ8EkFJBOxAuHajsoPR5i6vHoR r+4L2ZchVavIEJq3d6cfZ49PmeeVvT9+VBYeEKb76eIYZDHvx1e82GMDBYZL9Q+PfxNp 33g6vYWHkgGPzd/4yNrcrTQVvY6smib80+lNUPbZz8pd+gy/2unLZ8d12fMTuBILhLoy U6aghHh1ivNJESkQl8kTkj06G+cQYgbXw16eTzJ6MvzRPQjGzIkM6MNAksKiuRfwKhWN qDzwCkrpTdfXD8V6VTOsRYPYBQDlcZoVVDpAzy5vqY+bpfp6j5pRPAgACeoLsC2zZCAS Fo/A== X-Received: by 10.181.8.70 with SMTP id di6mr22493216wid.9.1416549063026; Thu, 20 Nov 2014 21:51:03 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id e7sm6496793wjx.31.2014.11.20.21.51.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 20 Nov 2014 21:51:02 -0800 (PST) Date: Fri, 21 Nov 2014 06:50:59 +0100 From: Mateusz Guzik To: Rui Paulo Subject: Re: svn commit: r274167 - in head/sys: kern sys Message-ID: <20141121055059.GB22273@dft-labs.eu> References: <201411060812.sA68CZ2w007383@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 05:51:05 -0000 On Thu, Nov 20, 2014 at 09:24:37PM -0800, Rui Paulo wrote: > On Nov 6, 2014, at 00:12, Mateusz Guzik wrote: > > > > Author: mjg > > Date: Thu Nov 6 08:12:34 2014 > > New Revision: 274167 > > URL: https://svnweb.freebsd.org/changeset/base/274167 > > > > Log: > > Add sysctl kern.proc.cwd > > > > It returns only current working directory of given process which saves a lot of > > overhead over kern.proc.filedesc if given proc has a lot of open fds. > > > > Submitted by: Tiwei Bie (slightly modified) > > X-Additional: JuniorJobs project > > > > Modified: > > head/sys/kern/kern_descrip.c > > head/sys/sys/sysctl.h > > head/sys/sys/user.h > > > > Modified: head/sys/kern/kern_descrip.c > > ============================================================================== > > --- head/sys/kern/kern_descrip.c Thu Nov 6 07:44:10 2014 (r274166) > > +++ head/sys/kern/kern_descrip.c Thu Nov 6 08:12:34 2014 (r274167) > > @@ -3406,6 +3406,73 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC > > CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_filedesc, > > "Process filedesc entries"); > > > > +/* > > + * Store a process current working directory information to sbuf. > > + * > > + * Takes a locked proc as argument, and returns with the proc unlocked. > > I never really liked this approach because it makes it harder to see the locking pattern. > > Why not call fdhold(p) in the sysctl handler, unlock the process, call kern_proc_cwd_out() with an additional fdp argument, and then call fddrop()? > This code just mimics what was done with kern_proc_filedesc_out, which happens to have semi-valid usecase when fdhold returns NULL. In general I agree and this scheme is going away. I have a patch in my backlog which "pins" the process (i.e. prevents exec and exit) for the duration of kern_proc_filedesc_out/whatever, so it will effectively mean such functions will no longer play with fdhold/fddrop. Interestingly enough this requires some changes in devfs and I didn't have the time to ensure they work properly. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 06:21:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59249B11; Fri, 21 Nov 2014 06:21:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45EA2BEA; Fri, 21 Nov 2014 06:21:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAL6LeTp030301; Fri, 21 Nov 2014 06:21:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAL6LeZL030300; Fri, 21 Nov 2014 06:21:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411210621.sAL6LeZL030300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 21 Nov 2014 06:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274784 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 06:21:40 -0000 Author: trasz Date: Fri Nov 21 06:21:39 2014 New Revision: 274784 URL: https://svnweb.freebsd.org/changeset/base/274784 Log: Fix smbfs to not zero out statfs f_flags field. Previously, this made getmntinfo() return empty flags for smbfs filesystems when called with MNT_WAIT. It's not visible with mount(8), since it uses MNT_NOWAIT, but broke autounmount(8) operation. PR: 195161 Differential Revision: https://reviews.freebsd.org/D1194 Reviewed by: kib@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/smbfs/smbfs_vfsops.c Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Fri Nov 21 03:22:22 2014 (r274783) +++ head/sys/fs/smbfs/smbfs_vfsops.c Fri Nov 21 06:21:39 2014 (r274784) @@ -401,8 +401,6 @@ smbfs_statfs(struct mount *mp, struct st scred = smbfs_malloc_scred(); smb_makescred(scred, td, td->td_ucred); error = smbfs_smb_statfs(ssp, sbp, scred); - if (error == 0) - sbp->f_flags = 0; /* copy of mount exported flags */ smbfs_free_scred(scred); return (error); } From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 06:27:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 313D6DC0; Fri, 21 Nov 2014 06:27:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D8A3CC5; Fri, 21 Nov 2014 06:27:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAL6RfqO035412; Fri, 21 Nov 2014 06:27:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAL6RcIl035372; Fri, 21 Nov 2014 06:27:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411210627.sAL6RcIl035372@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Nov 2014 06:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274785 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 06:27:41 -0000 Author: mav Date: Fri Nov 21 06:27:37 2014 New Revision: 274785 URL: https://svnweb.freebsd.org/changeset/base/274785 Log: Partially reconstruct Active/Standby clusting. In this mode one head is in Active state, supporting all commands, while another is in Standby state, supporting only minimal LUN discovery subset. It is still incomplete since Standby state requires reservation support, which is impossible to do right without having interlink between heads. But it allows to run some basic experiments. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/ctl/ctl_frontend.c head/sys/cam/ctl/ctl_frontend.h head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_internal.c head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_ha.h head/sys/cam/ctl/ctl_private.h head/sys/cam/ctl/ctl_tpc_local.c head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/ctl.c Fri Nov 21 06:27:37 2014 (r274785) @@ -357,7 +357,6 @@ static struct ctl_logical_block_provisio static int rcv_sync_msg; static int persis_offset; static uint8_t ctl_pause_rtr; -static int ctl_is_single = 1; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); static int worker_threads = -1; @@ -970,12 +969,42 @@ ctl_copy_sense_data(union ctl_ha_msg *sr } static int +ctl_ha_state_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct ctl_softc *softc = (struct ctl_softc *)arg1; + struct ctl_lun *lun; + int error, value, i; + + if (softc->flags & CTL_FLAG_ACTIVE_SHELF) + value = 0; + else + value = 1; + + error = sysctl_handle_int(oidp, &value, 0, req); + if ((error != 0) || (req->newptr == NULL)) + return (error); + + mtx_lock(&softc->ctl_lock); + if (value == 0) + softc->flags |= CTL_FLAG_ACTIVE_SHELF; + else + softc->flags &= ~CTL_FLAG_ACTIVE_SHELF; + STAILQ_FOREACH(lun, &softc->lun_list, links) { + mtx_lock(&lun->lun_lock); + for (i = 0; i < CTL_MAX_INITIATORS; i++) + lun->pending_ua[i] |= CTL_UA_ASYM_ACC_CHANGE; + mtx_unlock(&lun->lun_lock); + } + mtx_unlock(&softc->ctl_lock); + return (0); +} + +static int ctl_init(void) { struct ctl_softc *softc; struct ctl_io_pool *internal_pool, *emergency_pool, *other_pool; struct ctl_port *port; - uint8_t sc_id =0; int i, error, retval; //int isc_retval; @@ -1033,16 +1062,17 @@ ctl_init(void) * In Copan's HA scheme, the "master" and "slave" roles are * figured out through the slot the controller is in. Although it * is an active/active system, someone has to be in charge. - */ -#ifdef NEEDTOPORT - scmicro_rw(SCMICRO_GET_SHELF_ID, &sc_id); -#endif - - if (sc_id == 0) { - softc->flags |= CTL_FLAG_MASTER_SHELF; - persis_offset = 0; + */ + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "ha_id", CTLFLAG_RDTUN, &softc->ha_id, 0, + "HA head ID (0 - no HA)"); + if (softc->ha_id == 0) { + softc->flags |= CTL_FLAG_ACTIVE_SHELF; + softc->is_single = 1; + softc->port_offset = 0; } else - persis_offset = CTL_MAX_INITIATORS; + softc->port_offset = (softc->ha_id - 1) * CTL_MAX_PORTS; + persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; /* * XXX KDM need to figure out where we want to get our target ID @@ -1155,12 +1185,15 @@ ctl_init(void) port->max_targets = 15; port->max_target_id = 15; - if (ctl_port_register(&softc->ioctl_info.port, - (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) { + if (ctl_port_register(&softc->ioctl_info.port) != 0) { printf("ctl: ioctl front end registration failed, will " "continue anyway\n"); } + SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "ha_state", CTLTYPE_INT | CTLFLAG_RWTUN, + softc, 0, ctl_ha_state_sysctl, "I", "HA state for this head"); + #ifdef CTL_IO_DELAY if (sizeof(struct callout) > CTL_TIMER_BYTES) { printf("sizeof(struct callout) %zd > CTL_TIMER_BYTES %zd\n", @@ -1262,10 +1295,10 @@ ctl_close(struct cdev *dev, int flags, i int ctl_port_enable(ctl_port_type port_type) { - struct ctl_softc *softc; + struct ctl_softc *softc = control_softc; struct ctl_port *port; - if (ctl_is_single == 0) { + if (softc->is_single == 0) { union ctl_ha_msg msg_info; int isc_retval; @@ -1290,8 +1323,6 @@ ctl_port_enable(ctl_port_type port_type) #endif } - softc = control_softc; - STAILQ_FOREACH(port, &softc->port_list, links) { if (port_type & port->port_type) { @@ -7440,8 +7471,8 @@ ctl_report_tagret_port_groups(struct ctl { struct scsi_maintenance_in *cdb; int retval; - int alloc_len, ext, total_len = 0, g, p, pc, pg; - int num_target_port_groups, num_target_ports, single; + int alloc_len, ext, total_len = 0, g, p, pc, pg, gs, os; + int num_target_port_groups, num_target_ports; struct ctl_lun *lun; struct ctl_softc *softc; struct ctl_port *port; @@ -7475,8 +7506,7 @@ ctl_report_tagret_port_groups(struct ctl return(retval); } - single = ctl_is_single; - if (single) + if (softc->is_single) num_target_port_groups = 1; else num_target_port_groups = NUM_TARGET_PORT_GROUPS; @@ -7532,18 +7562,26 @@ ctl_report_tagret_port_groups(struct ctl tpg_desc = &rtg_ptr->groups[0]; } - pg = ctsio->io_hdr.nexus.targ_port / CTL_MAX_PORTS; mtx_lock(&softc->ctl_lock); + pg = softc->port_offset / CTL_MAX_PORTS; + if (softc->flags & CTL_FLAG_ACTIVE_SHELF) { + if (softc->ha_mode == CTL_HA_MODE_ACT_STBY) { + gs = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + os = TPG_ASYMMETRIC_ACCESS_STANDBY; + } else if (lun->flags & CTL_LUN_PRIMARY_SC) { + gs = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + os = TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; + } else { + gs = TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; + os = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + } + } else { + gs = TPG_ASYMMETRIC_ACCESS_STANDBY; + os = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + } for (g = 0; g < num_target_port_groups; g++) { - if (g == pg) - tpg_desc->pref_state = TPG_PRIMARY | - TPG_ASYMMETRIC_ACCESS_OPTIMIZED; - else - tpg_desc->pref_state = - TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; - tpg_desc->support = TPG_AO_SUP; - if (!single) - tpg_desc->support |= TPG_AN_SUP; + tpg_desc->pref_state = (g == pg) ? gs : os; + tpg_desc->support = TPG_AO_SUP | TPG_AN_SUP | TPG_S_SUP; scsi_ulto2b(g + 1, tpg_desc->target_port_group); tpg_desc->status = TPG_IMPLICIT; pc = 0; @@ -10192,12 +10230,11 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s struct ctl_lun *lun; struct ctl_port *port; int data_len, num_target_ports, iid_len, id_len, g, pg, p; - int num_target_port_groups, single; + int num_target_port_groups; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - single = ctl_is_single; - if (single) + if (softc->is_single) num_target_port_groups = 1; else num_target_port_groups = NUM_TARGET_PORT_GROUPS; @@ -10257,10 +10294,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s pd = &sp->design[0]; mtx_lock(&softc->ctl_lock); - if (softc->flags & CTL_FLAG_MASTER_SHELF) - pg = 0; - else - pg = 1; + pg = softc->port_offset / CTL_MAX_PORTS; for (g = 0; g < num_target_port_groups; g++) { STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) @@ -11342,15 +11376,12 @@ ctl_scsiio_lun_check(struct ctl_softc *c * If this shelf is a secondary shelf controller, we have to reject * any media access commands. */ -#if 0 - /* No longer needed for HA */ - if (((ctl_softc->flags & CTL_FLAG_MASTER_SHELF) == 0) - && ((entry->flags & CTL_CMD_FLAG_OK_ON_SECONDARY) == 0)) { + if ((ctl_softc->flags & CTL_FLAG_ACTIVE_SHELF) == 0 && + (entry->flags & CTL_CMD_FLAG_OK_ON_SECONDARY) == 0) { ctl_set_lun_standby(ctsio); retval = 1; goto bailout; } -#endif if (entry->pattern & CTL_LUN_PAT_WRITE) { if (lun->flags & CTL_LUN_READONLY) { @@ -14405,7 +14436,7 @@ ctl_isc_start(struct ctl_ha_component *c // UNKNOWN->HA or UNKNOWN->SINGLE (bootstrap) if (c->state == CTL_HA_STATE_UNKNOWN ) { - ctl_is_single = 0; + control_softc->is_single = 0; if (ctl_ha_msg_create(CTL_HA_CHAN_CTL, ctl_isc_event_handler) != CTL_HA_STATUS_SUCCESS) { printf("ctl_isc_start: ctl_ha_msg_create failed.\n"); @@ -14415,14 +14446,14 @@ ctl_isc_start(struct ctl_ha_component *c && CTL_HA_STATE_IS_SINGLE(state)){ // HA->SINGLE transition ctl_failover(); - ctl_is_single = 1; + control_softc->is_single = 1; } else { printf("ctl_isc_start:Invalid state transition %X->%X\n", c->state, state); ret = CTL_HA_COMP_STATUS_ERROR; } if (CTL_HA_STATE_IS_SINGLE(state)) - ctl_is_single = 1; + control_softc->is_single = 1; c->state = state; c->status = ret; Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/ctl_cmd_table.c Fri Nov 21 06:27:37 2014 (r274785) @@ -800,12 +800,18 @@ const struct ctl_cmd_entry ctl_cmd_table /* 3B WRITE BUFFER */ {ctl_write_buffer, CTL_SERIDX_MD_SEL, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_FLAG_DATA_OUT, CTL_LUN_PAT_NONE, 10, {0x1f, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 3C READ BUFFER */ {ctl_read_buffer, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_FLAG_DATA_IN | CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, Modified: head/sys/cam/ctl/ctl_frontend.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend.c Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/ctl_frontend.c Fri Nov 21 06:27:37 2014 (r274785) @@ -136,7 +136,7 @@ ctl_frontend_find(char *frontend_name) } int -ctl_port_register(struct ctl_port *port, int master_shelf) +ctl_port_register(struct ctl_port *port) { struct ctl_io_pool *pool; int port_num; @@ -193,7 +193,7 @@ error: STAILQ_INIT(&port->options); mtx_lock(&control_softc->ctl_lock); - port->targ_port = port_num + (master_shelf != 0 ? 0 : CTL_MAX_PORTS); + port->targ_port = port_num + control_softc->port_offset; STAILQ_INSERT_TAIL(&port->frontend->port_list, port, fe_links); STAILQ_INSERT_TAIL(&control_softc->port_list, port, links); control_softc->ctl_ports[port_num] = port; Modified: head/sys/cam/ctl/ctl_frontend.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend.h Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/ctl_frontend.h Fri Nov 21 06:27:37 2014 (r274785) @@ -278,7 +278,7 @@ struct ctl_frontend * ctl_frontend_find( * This may block until resources are allocated. Called at FETD module load * time. Returns 0 for success, non-zero for failure. */ -int ctl_port_register(struct ctl_port *port, int master_SC); +int ctl_port_register(struct ctl_port *port); /* * Called at FETD module unload time. Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Nov 21 06:27:37 2014 (r274785) @@ -164,7 +164,7 @@ cfcs_init(void) port->max_targets = 1; port->max_target_id = 15; - retval = ctl_port_register(port, /*master_SC*/ 1); + retval = ctl_port_register(port); if (retval != 0) { printf("%s: ctl_port_register() failed with error %d!\n", __func__, retval); Modified: head/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_internal.c Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/ctl_frontend_internal.c Fri Nov 21 06:27:37 2014 (r274785) @@ -244,8 +244,6 @@ cfi_init(void) memset(softc, 0, sizeof(*softc)); mtx_init(&softc->lock, "CTL frontend mutex", NULL, MTX_DEF); - softc->flags |= CTL_FLAG_MASTER_SHELF; - STAILQ_INIT(&softc->lun_list); STAILQ_INIT(&softc->metatask_list); sprintf(softc->fe_name, "kernel"); @@ -264,7 +262,7 @@ cfi_init(void) port->max_targets = 15; port->max_target_id = 15; - if (ctl_port_register(port, (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) + if (ctl_port_register(port) != 0) { printf("%s: internal frontend registration failed\n", __func__); return (0); Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 21 06:27:37 2014 (r274785) @@ -2046,7 +2046,7 @@ cfiscsi_ioctl_port_create(struct ctl_req desc->length = idlen; strlcpy(desc->identifier, target, idlen); - retval = ctl_port_register(port, /*master_SC*/ 1); + retval = ctl_port_register(port); if (retval != 0) { ctl_free_opts(&port->options); cfiscsi_target_release(ct); Modified: head/sys/cam/ctl/ctl_ha.h ============================================================================== --- head/sys/cam/ctl/ctl_ha.h Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/ctl_ha.h Fri Nov 21 06:27:37 2014 (r274785) @@ -38,6 +38,8 @@ /* * CTL High Availability Modes: * + * CTL_HA_MODE_ACT_STBY: One side is in Active state and processing commands, + * the other side is in Standby state, returning errors. * CTL_HA_MODE_SER_ONLY: Commands are serialized to the other side. Write * mirroring and read re-direction are assumed to * happen in the back end. @@ -46,6 +48,7 @@ */ typedef enum { + CTL_HA_MODE_ACT_STBY, CTL_HA_MODE_SER_ONLY, CTL_HA_MODE_XFER } ctl_ha_mode; Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/ctl_private.h Fri Nov 21 06:27:37 2014 (r274785) @@ -442,7 +442,7 @@ struct ctl_lun { typedef enum { CTL_FLAG_REAL_SYNC = 0x02, - CTL_FLAG_MASTER_SHELF = 0x04 + CTL_FLAG_ACTIVE_SHELF = 0x04 } ctl_gen_flags; #define CTL_MAX_THREADS 16 @@ -467,6 +467,10 @@ struct ctl_softc { int num_luns; ctl_gen_flags flags; ctl_ha_mode ha_mode; + int ha_id; + int ha_state; + int is_single; + int port_offset; int inquiry_pq_no_lun; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; Modified: head/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc_local.c Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/ctl_tpc_local.c Fri Nov 21 06:27:37 2014 (r274785) @@ -87,7 +87,6 @@ CTL_FRONTEND_DECLARE(ctltpc, tpcl_fronte static int tpcl_init(void) { - struct ctl_softc *softc = control_softc; struct tpcl_softc *tsoftc = &tpcl_softc; struct ctl_port *port; struct scsi_transportid_spi *tid; @@ -112,7 +111,7 @@ tpcl_init(void) port->max_target_id = 0; port->max_initiators = 1; - if (ctl_port_register(port, (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) + if (ctl_port_register(port) != 0) { printf("%s: tpc frontend registration failed\n", __func__); return (0); Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Fri Nov 21 06:21:39 2014 (r274784) +++ head/sys/cam/ctl/scsi_ctl.c Fri Nov 21 06:27:37 2014 (r274785) @@ -425,7 +425,7 @@ ctlfeasync(void *callback_arg, uint32_t printf("%s: calling ctl_port_register() for %s%d\n", __func__, cpi->dev_name, cpi->unit_number); #endif - retval = ctl_port_register(port, /*master_SC*/ 1); + retval = ctl_port_register(port); if (retval != 0) { printf("%s: ctl_port_register() failed with " "error %d!\n", __func__, retval); From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 06:34:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D78B31D2; Fri, 21 Nov 2014 06:34:04 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACB47DA2; Fri, 21 Nov 2014 06:34:04 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTPSA id <0NFD00LE5M8GN520@st11p02mm-asmtp001.mac.com>; Fri, 21 Nov 2014 06:33:54 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.28,0.0.0000 definitions=2014-11-21_03:2014-11-20,2014-11-21,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1411210058 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r274489 - in head/sys/amd64: amd64 include From: Rui Paulo In-reply-to: <201411132211.sADMBjP3009246@svn.freebsd.org> Date: Thu, 20 Nov 2014 22:33:51 -0800 Content-transfer-encoding: quoted-printable Message-id: <35E5EAD8-99C1-43C0-8D01-B3B5B86ECA25@me.com> References: <201411132211.sADMBjP3009246@svn.freebsd.org> To: Scott Long X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 06:34:05 -0000 On Nov 13, 2014, at 14:11, Scott Long wrote: >=20 > Author: scottl > Date: Thu Nov 13 22:11:44 2014 > New Revision: 274489 > URL: https://svnweb.freebsd.org/changeset/base/274489 >=20 > Log: > Extend earlier addition of stack frames to most of support.S. This = makes > stack traces in KDB, HWPMC, and DTrace much more reliable and useful. No performance differences? The kernel enables/disables the compiler = option to omit the frame pointer based on the kernel config file. If = DDB, DTrace, or HWPMC is enabled, the frame pointer is always saved in C = functions.=20 Some of these functions are in the hot path, so if you didn't see any = performance problem, I wonder if we should disable -fomit-frame-pointer = always. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 08:24:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34BA1DC0; Fri, 21 Nov 2014 08:24:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21A6EB8B; Fri, 21 Nov 2014 08:24:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAL8OcOH055294; Fri, 21 Nov 2014 08:24:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAL8ObYU055293; Fri, 21 Nov 2014 08:24:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411210824.sAL8ObYU055293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Nov 2014 08:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274786 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 08:24:38 -0000 Author: mav Date: Fri Nov 21 08:24:37 2014 New Revision: 274786 URL: https://svnweb.freebsd.org/changeset/base/274786 Log: Log errors for absent LUNs too. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Nov 21 06:27:37 2014 (r274785) +++ head/sys/cam/ctl/ctl.c Fri Nov 21 08:24:37 2014 (r274786) @@ -13710,7 +13710,7 @@ static int ctl_process_done(union ctl_io *io) { struct ctl_lun *lun; - struct ctl_softc *ctl_softc; + struct ctl_softc *ctl_softc = control_softc; void (*fe_done)(union ctl_io *io); uint32_t targ_port = ctl_port_idx(io->io_hdr.nexus.targ_port); @@ -13776,10 +13776,8 @@ ctl_process_done(union ctl_io *io) if (lun == NULL) { CTL_DEBUG_PRINT(("NULL LUN for lun %d\n", io->io_hdr.nexus.targ_mapped_lun)); - fe_done(io); goto bailout; } - ctl_softc = lun->ctl_softc; mtx_lock(&lun->lun_lock); @@ -13851,6 +13849,8 @@ ctl_process_done(union ctl_io *io) } else mtx_unlock(&lun->lun_lock); +bailout: + /* * If this command has been aborted, make sure we set the status * properly. The FETD is responsible for freeing the I/O and doing @@ -13933,8 +13933,6 @@ ctl_process_done(union ctl_io *io) } else fe_done(io); -bailout: - return (CTL_RETVAL_COMPLETE); } From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 10:12:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94DC9EB6; Fri, 21 Nov 2014 10:12:33 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 784CE981; Fri, 21 Nov 2014 10:12:33 +0000 (UTC) Received: from bender.lan (97e078e7.skybroadband.com [151.224.120.231]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 143977328F; Fri, 21 Nov 2014 10:12:30 +0000 (UTC) Date: Fri, 21 Nov 2014 10:12:18 +0000 From: Andrew Turner To: Ruslan Bukin Subject: Re: svn commit: r274655 - in head/sys/dev/virtio: block mmio Message-ID: <20141121101218.32f338c6@bender.lan> In-Reply-To: <201411181411.sAIEBFlh069043@svn.freebsd.org> References: <201411181411.sAIEBFlh069043@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 10:12:33 -0000 On Tue, 18 Nov 2014 14:11:15 +0000 (UTC) Ruslan Bukin wrote: > Author: br > Date: Tue Nov 18 14:11:14 2014 > New Revision: 274655 > URL: https://svnweb.freebsd.org/changeset/base/274655 > > Log: > Add Virtio MMIO bus driver. This is missing a config option to allow it to be built. I would like to test it on the arm64 simulator as it has a virtio option. > > Sponsored by: DARPA, AFRL > > Added: > head/sys/dev/virtio/mmio/ > head/sys/dev/virtio/mmio/virtio_mmio.c (contents, props changed) > head/sys/dev/virtio/mmio/virtio_mmio.h (contents, props changed) > head/sys/dev/virtio/mmio/virtio_mmio_if.m (contents, props > changed) Modified: > head/sys/dev/virtio/block/virtio_blk.c > ... > + > +static int > +vtmmio_probe(device_t dev) > +{ > + > + if (!ofw_bus_status_okay(dev)) > + return (ENXIO); > + > + if (!ofw_bus_is_compatible(dev, "virtio,mmio")) > + return (ENXIO); This should be split out to an fdt specific file at some stage as virtio-mmio is not fdt specefic. > + > + device_set_desc(dev, "VirtIO MMIO adapter"); > + return (BUS_PROBE_DEFAULT); > +} ... > + > +static int > +vtmmio_suspend(device_t dev) > +{ > + > + return (bus_generic_suspend(dev)); > +} > + > +static int > +vtmmio_resume(device_t dev) > +{ > + > + return (bus_generic_resume(dev)); > +} Why does vtmmio_suspend and vtmmio_resume exist? I would think they could be replaced with bus_generic_suspend and bus_generic_resume respectively in the device methods. Andrew From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 10:47:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5F48719; Fri, 21 Nov 2014 10:47:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C29C1C84; Fri, 21 Nov 2014 10:47:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALAlU91091444; Fri, 21 Nov 2014 10:47:30 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALAlUVd091443; Fri, 21 Nov 2014 10:47:30 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201411211047.sALAlUVd091443@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 21 Nov 2014 10:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274788 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 10:47:30 -0000 Author: bz Date: Fri Nov 21 10:47:29 2014 New Revision: 274788 URL: https://svnweb.freebsd.org/changeset/base/274788 Log: Fix build for certain MIPS kernels hiding an unused variable under #ifndef. Modified: head/sys/mips/mips/cpu.c Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Fri Nov 21 10:22:54 2014 (r274787) +++ head/sys/mips/mips/cpu.c Fri Nov 21 10:47:29 2014 (r274788) @@ -73,7 +73,9 @@ mips_get_identity(struct mips_cpuinfo *c u_int32_t prid; u_int32_t cfg0; u_int32_t cfg1; +#ifndef CPU_CNMIPS u_int32_t cfg2; +#endif #if defined(CPU_CNMIPS) u_int32_t cfg4; #endif From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 10:56:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E127C79; Fri, 21 Nov 2014 10:56:15 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id EEE67D89; Fri, 21 Nov 2014 10:56:14 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 360F6ADEB; Fri, 21 Nov 2014 10:56:13 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id C56F71E5C; Fri, 21 Nov 2014 11:56:12 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ian Lepore Subject: Re: svn commit: r274653 - head/usr.sbin/freebsd-update References: <201411181338.sAIDc9U3051869@svn.freebsd.org> <20141118142449.GW17068@kib.kiev.ua> <1416323122.1147.46.camel@revolution.hippie.lan> Date: Fri, 21 Nov 2014 11:56:12 +0100 In-Reply-To: <1416323122.1147.46.camel@revolution.hippie.lan> (Ian Lepore's message of "Tue, 18 Nov 2014 08:05:22 -0700") Message-ID: <86h9xsstyr.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mark Felder X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 10:56:15 -0000 Ian Lepore writes: > This is intended to guard against /var being an mfs due to diskless or > readonly-root setup by rc.d/var during freebsd-update. I suppose it's > possible for someone to configure /var in a persistant file-backed md on > such a system. (Hmm, that's maybe even useful with nfs root, I may give > that a try.) I think that would be a terrible idea. I use freebsd-update on my soekris, but with an NFS-mounted /var/db/freebsd-update, which is far simpler and less likely to blow up in your face. IMHO, it is safe for freebsd-update to assume that mfs is a no-no. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 11:20:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C04E6B2; Fri, 21 Nov 2014 11:20:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49364FAB; Fri, 21 Nov 2014 11:20:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALBKPGf023861; Fri, 21 Nov 2014 11:20:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALBKPpC023860; Fri, 21 Nov 2014 11:20:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411211120.sALBKPpC023860@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Nov 2014 11:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274789 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 11:20:25 -0000 Author: mav Date: Fri Nov 21 11:20:24 2014 New Revision: 274789 URL: https://svnweb.freebsd.org/changeset/base/274789 Log: Reduce race between LUN destruction and request arrival. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Nov 21 10:47:29 2014 (r274788) +++ head/sys/cam/ctl/ctl.c Fri Nov 21 11:20:24 2014 (r274789) @@ -11746,15 +11746,18 @@ ctl_scsiio_precheck(struct ctl_softc *ct targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; if ((targ_lun < CTL_MAX_LUNS) - && (ctl_softc->ctl_luns[targ_lun] != NULL)) { - lun = ctl_softc->ctl_luns[targ_lun]; + && ((lun = ctl_softc->ctl_luns[targ_lun]) != NULL)) { /* * If the LUN is invalid, pretend that it doesn't exist. * It will go away as soon as all pending I/O has been * completed. */ + mtx_lock(&lun->lun_lock); if (lun->flags & CTL_LUN_DISABLED) { + mtx_unlock(&lun->lun_lock); lun = NULL; + ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL; + ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL; } else { ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun; ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = @@ -11767,7 +11770,6 @@ ctl_scsiio_precheck(struct ctl_softc *ct * Every I/O goes into the OOA queue for a * particular LUN, and stays there until completion. */ - mtx_lock(&lun->lun_lock); TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links); } From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 11:21:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9152480E; Fri, 21 Nov 2014 11:21:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65880A1; Fri, 21 Nov 2014 11:21:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALBLeSL025087; Fri, 21 Nov 2014 11:21:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALBLeVb025086; Fri, 21 Nov 2014 11:21:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411211121.sALBLeVb025086@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Nov 2014 11:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274790 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 11:21:40 -0000 Author: mav Date: Fri Nov 21 11:21:39 2014 New Revision: 274790 URL: https://svnweb.freebsd.org/changeset/base/274790 Log: Remove bunch of unused lun variables. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Nov 21 11:20:24 2014 (r274789) +++ head/sys/cam/ctl/ctl.c Fri Nov 21 11:21:39 2014 (r274790) @@ -7407,14 +7407,11 @@ ctl_read_defect(struct ctl_scsiio *ctsio struct scsi_read_defect_data_12 *ccb12; struct scsi_read_defect_data_hdr_10 *data10; struct scsi_read_defect_data_hdr_12 *data12; - struct ctl_lun *lun; uint32_t alloc_len, data_len; uint8_t format; CTL_DEBUG_PRINT(("ctl_read_defect\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - if (ctsio->cdb[0] == READ_DEFECT_DATA_10) { ccb10 = (struct scsi_read_defect_data_10 *)&ctsio->cdb; format = ccb10->format; @@ -7784,7 +7781,6 @@ fill_one: int ctl_report_supported_tmf(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; struct scsi_report_supported_tmf *cdb; struct scsi_report_supported_tmf_data *data; int retval; @@ -7793,7 +7789,6 @@ ctl_report_supported_tmf(struct ctl_scsi CTL_DEBUG_PRINT(("ctl_report_supported_tmf\n")); cdb = (struct scsi_report_supported_tmf *)ctsio->cdb; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; retval = CTL_RETVAL_COMPLETE; @@ -7830,7 +7825,6 @@ ctl_report_supported_tmf(struct ctl_scsi int ctl_report_timestamp(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; struct scsi_report_timestamp *cdb; struct scsi_report_timestamp_data *data; struct timeval tv; @@ -7841,7 +7835,6 @@ ctl_report_timestamp(struct ctl_scsiio * CTL_DEBUG_PRINT(("ctl_report_timestamp\n")); cdb = (struct scsi_report_timestamp *)ctsio->cdb; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; retval = CTL_RETVAL_COMPLETE; @@ -9845,15 +9838,9 @@ no_sense: int ctl_tur(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; - - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; CTL_DEBUG_PRINT(("ctl_tur\n")); - if (lun == NULL) - return (EINVAL); - ctsio->scsi_status = SCSI_STATUS_OK; ctsio->io_hdr.status = CTL_SUCCESS; @@ -10522,10 +10509,8 @@ static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio) { struct scsi_inquiry *cdb; - struct ctl_lun *lun; int alloc_len, retval; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_inquiry *)ctsio->cdb; retval = CTL_RETVAL_COMPLETE; From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 12:35:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 034D9E3F; Fri, 21 Nov 2014 12:35:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E43C9A80; Fri, 21 Nov 2014 12:35:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALCZIB5091559; Fri, 21 Nov 2014 12:35:18 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALCZIL0091557; Fri, 21 Nov 2014 12:35:18 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411211235.sALCZIL0091557@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 21 Nov 2014 12:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274791 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 12:35:19 -0000 Author: trasz Date: Fri Nov 21 12:35:18 2014 New Revision: 274791 URL: https://svnweb.freebsd.org/changeset/base/274791 Log: Add missing error checking for kernel_port_{add,remove}(). Both can fail for reasons yet unknown; don't make it increment cumulated_error as a kind of temporary workaround. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Fri Nov 21 11:21:39 2014 (r274790) +++ head/usr.sbin/ctld/ctld.c Fri Nov 21 12:35:18 2014 (r274791) @@ -1678,7 +1678,16 @@ conf_apply(struct conf *oldconf, struct cumulated_error++; } } - kernel_port_remove(oldtarg); + error = kernel_port_remove(oldtarg); + if (error != 0) { + log_warnx("failed to remove target %s", + oldtarg->t_name); + /* + * XXX: Uncomment after fixing the root cause. + * + * cumulated_error++; + */ + } continue; } @@ -1812,8 +1821,18 @@ conf_apply(struct conf *oldconf, struct cumulated_error++; } } - if (oldtarg == NULL) - kernel_port_add(newtarg); + if (oldtarg == NULL) { + error = kernel_port_add(newtarg); + if (error != 0) { + log_warnx("failed to add target %s", + oldtarg->t_name); + /* + * XXX: Uncomment after fixing the root cause. + * + * cumulated_error++; + */ + } + } } /* From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 14:53:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF43D10E; Fri, 21 Nov 2014 14:53:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBDA0B15; Fri, 21 Nov 2014 14:53:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALErhmh018220; Fri, 21 Nov 2014 14:53:43 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALErhx0018219; Fri, 21 Nov 2014 14:53:43 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201411211453.sALErhx0018219@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Fri, 21 Nov 2014 14:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274792 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 14:53:43 -0000 Author: n_hibma Date: Fri Nov 21 14:53:42 2014 New Revision: 274792 URL: https://svnweb.freebsd.org/changeset/base/274792 Log: Simply remove the tmp dir before creating the symlink. We are doing chroots all over the place, so there is bound to be a stale file lying around in there (in my case samba lock files from creating accounts). If we don't do that, the symlink later will fail. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Nov 21 12:35:18 2014 (r274791) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Nov 21 14:53:42 2014 (r274792) @@ -421,7 +421,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) - test -d tmp && rmdir tmp || nano_rm -f tmp + nano_rm -rf tmp ln -s var/tmp tmp ) > ${NANO_OBJ}/_.dl 2>&1 From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 15:19:35 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50DD4A2F; Fri, 21 Nov 2014 15:19:35 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 00F2AD8F; Fri, 21 Nov 2014 15:19:33 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA06271; Fri, 21 Nov 2014 17:21:24 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Xrpze-0007a1-U1; Fri, 21 Nov 2014 17:19:30 +0200 Message-ID: <546F57B1.2020602@FreeBSD.org> Date: Fri, 21 Nov 2014 17:18:09 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r273060 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201410132039.s9DKdpmh055573@svn.freebsd.org> In-Reply-To: <201410132039.s9DKdpmh055573@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 15:19:35 -0000 On 13/10/2014 23:39, Xin LI wrote: > Author: delphij > Date: Mon Oct 13 20:39:51 2014 > New Revision: 273060 > URL: https://svnweb.freebsd.org/changeset/base/273060 > > Log: > Use write_psize instead of write_asize when doing vdev_space_update. > Without this change the accounting of L2ARC usage would be wrong and > give 16EB free space because the number became negative and overflows. > > Obtained from: FreeNAS (issue #6239) First, a link to the issue would be more convenient for reviewers. Here it is https://bugs.freenas.org/issues/6239 Then, I would like to see a technical explanation for this change. I could not find any explanation here or in the FreeNAS issue or in the FreeNAS commit. As far as I can see, all calls to vdev_space_update() in the ARC code are passed l2hdr->b_asize or a sum of b_asize fields of multiple buffers. Thus, I am really surprised with this change and would like to see reasoning behind it. > MFC after: 2 weeks > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Oct 13 19:05:18 2014 (r273059) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Oct 13 20:39:51 2014 (r273060) > @@ -5232,7 +5232,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de > ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize); > ARCSTAT_INCR(arcstat_l2_size, write_sz); > ARCSTAT_INCR(arcstat_l2_asize, write_asize); > - vdev_space_update(dev->l2ad_vdev, write_asize, 0, 0); > + vdev_space_update(dev->l2ad_vdev, write_psize, 0, 0); > > /* > * Bump device hand to the device start if it is approaching the end. > -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 15:38:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 314EB2B5; Fri, 21 Nov 2014 15:38:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04241FB4; Fri, 21 Nov 2014 15:38:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALFcVem056683; Fri, 21 Nov 2014 15:38:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALFcV2D056682; Fri, 21 Nov 2014 15:38:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411211538.sALFcV2D056682@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Nov 2014 15:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274795 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 15:38:32 -0000 Author: mav Date: Fri Nov 21 15:38:31 2014 New Revision: 274795 URL: https://svnweb.freebsd.org/changeset/base/274795 Log: Close race between cfiscsi_offline() and new connection arrival. Incoming connection should be either rejected or accepted and terminated. Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 21 15:21:39 2014 (r274794) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 21 15:38:31 2014 (r274795) @@ -1060,6 +1060,8 @@ cfiscsi_session_terminate_tasks(struct c union ctl_io *io; int error, last; + if (cs->cs_target == NULL) + return; /* No target yet, so nothing to do. */ io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); if (io == NULL) { CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); @@ -1239,11 +1241,7 @@ cfiscsi_session_new(struct cfiscsi_softc } mtx_lock(&softc->lock); - cs->cs_id = softc->last_session_id + 1; - softc->last_session_id++; - mtx_unlock(&softc->lock); - - mtx_lock(&softc->lock); + cs->cs_id = ++softc->last_session_id; TAILQ_INSERT_TAIL(&softc->sessions, cs, cs_next); mtx_unlock(&softc->lock); @@ -1421,14 +1419,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * return; } - if (ct->ct_online == 0) { - ci->status = CTL_ISCSI_ERROR; - snprintf(ci->error_str, sizeof(ci->error_str), - "%s: port offline", __func__); - cfiscsi_target_release(ct); - return; - } - #ifdef ICL_KERNEL_PROXY if (cihp->socket > 0 && cihp->connection_id > 0) { snprintf(ci->error_str, sizeof(ci->error_str), @@ -1440,7 +1430,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * if (cihp->socket == 0) { mtx_lock(&cfiscsi_softc.lock); TAILQ_FOREACH(cs, &cfiscsi_softc.sessions, cs_next) { - if (cs->cs_id == cihp->socket) + if (cs->cs_id == cihp->connection_id) break; } if (cs == NULL) { @@ -1465,7 +1455,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * #ifdef ICL_KERNEL_PROXY } #endif - cs->cs_target = ct; /* * First PDU of Full Feature phase has the same CmdSN as the last @@ -1497,6 +1486,19 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cihp->initiator_isid[2], cihp->initiator_isid[3], cihp->initiator_isid[4], cihp->initiator_isid[5]); + mtx_lock(&softc->lock); + if (ct->ct_online == 0) { + mtx_unlock(&softc->lock); + cfiscsi_session_terminate(cs); + cfiscsi_target_release(ct); + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "%s: port offline", __func__); + return; + } + cs->cs_target = ct; + mtx_unlock(&softc->lock); + refcount_acquire(&cs->cs_outstanding_ctl_pdus); restart: if (!cs->cs_terminating) { From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 15:49:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45C9B7E1; Fri, 21 Nov 2014 15:49:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32B2E104; Fri, 21 Nov 2014 15:49:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALFngY2066253; Fri, 21 Nov 2014 15:49:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALFngdd066252; Fri, 21 Nov 2014 15:49:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411211549.sALFngdd066252@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 21 Nov 2014 15:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274796 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 15:49:42 -0000 Author: trasz Date: Fri Nov 21 15:49:41 2014 New Revision: 274796 URL: https://svnweb.freebsd.org/changeset/base/274796 Log: Document use of wildcards (*) and ampersands (&) in autofs map files. Differential Revision: https://reviews.freebsd.org/D1199 Reviewed by: wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/auto_master.5 Modified: head/usr.sbin/autofs/auto_master.5 ============================================================================== --- head/usr.sbin/autofs/auto_master.5 Fri Nov 21 15:38:31 2014 (r274795) +++ head/usr.sbin/autofs/auto_master.5 Fri Nov 21 15:49:41 2014 (r274796) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 19, 2014 +.Dd November 21, 2014 .Dt AUTO_MASTER 5 .Os .Sh NAME @@ -124,6 +124,12 @@ is the path component used by .Xr automountd 8 to find the right map entry to use. It is also used to form the final mountpoint. +A wildcard +.Pq Ql * +can be used for the key. +It matches every directory that does not match other keys. +Those directories will not be visible to the user +until accessed. .Pp The .Ar options @@ -155,9 +161,20 @@ for a single key. The .Ar location field specifies the filesystem to be mounted. -To pass location that begins with +Ampersands +.Pq Ql & +in the +.Ar location +field are replaced with the value of +.Ar key . +This is typically used with wildcards, like: +.Bd -literal -offset indent +.Li * 192.168.1.1:/share/& +.Ed +.Pp +To pass a location that begins with .Li / , -prefix it with colon. +prefix it with a colon. For example, .Li :/dev/cd0 . .Pp From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 16:14:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8A27295; Fri, 21 Nov 2014 16:14:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5219617; Fri, 21 Nov 2014 16:14:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALGEXZf089167; Fri, 21 Nov 2014 16:14:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALGEXUb089166; Fri, 21 Nov 2014 16:14:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411211614.sALGEXUb089166@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 21 Nov 2014 16:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274797 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 16:14:33 -0000 Author: trasz Date: Fri Nov 21 16:14:32 2014 New Revision: 274797 URL: https://svnweb.freebsd.org/changeset/base/274797 Log: Fix error handling. MFC after: 1 month Coverity CID: 1249768 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/isns.c Modified: head/usr.sbin/ctld/isns.c ============================================================================== --- head/usr.sbin/ctld/isns.c Fri Nov 21 15:49:41 2014 (r274796) +++ head/usr.sbin/ctld/isns.c Fri Nov 21 16:14:32 2014 (r274797) @@ -63,7 +63,7 @@ isns_req_alloc(void) req->ir_buflen = sizeof(struct isns_hdr); req->ir_usedlen = 0; req->ir_buf = calloc(req->ir_buflen, 1); - if (req == NULL) { + if (req->ir_buf == NULL) { free(req); log_err(1, "calloc"); return (NULL); From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 17:55:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F204F4D; Fri, 21 Nov 2014 17:55:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B97024A; Fri, 21 Nov 2014 17:55:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALHtdVB077489; Fri, 21 Nov 2014 17:55:39 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALHtdkb077488; Fri, 21 Nov 2014 17:55:39 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201411211755.sALHtdkb077488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Fri, 21 Nov 2014 17:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274802 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 17:55:39 -0000 Author: rodrigc Date: Fri Nov 21 17:55:38 2014 New Revision: 274802 URL: https://svnweb.freebsd.org/changeset/base/274802 Log: Make MLINKS text match text in bsd.man.mk added by wosch@ in 1996. Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Fri Nov 21 17:23:15 2014 (r274801) +++ head/share/mk/bsd.README Fri Nov 21 17:55:38 2014 (r274802) @@ -146,7 +146,7 @@ MAN The manual pages to be installed (u MLINKS List of manual page links (using a .1 - .9 suffix). The linked-to file must come first, the linked file second, - and there may be multiple pairs. The files are soft-linked. + and there may be multiple pairs. The files are hard-linked. The include file includes a file named "../Makefile.inc" if it exists. From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 17:57:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 654F12D5; Fri, 21 Nov 2014 17:57:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51B06262; Fri, 21 Nov 2014 17:57:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALHvc83078605; Fri, 21 Nov 2014 17:57:38 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALHvcGQ078604; Fri, 21 Nov 2014 17:57:38 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201411211757.sALHvcGQ078604@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Fri, 21 Nov 2014 17:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274803 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 17:57:38 -0000 Author: rodrigc Date: Fri Nov 21 17:57:37 2014 New Revision: 274803 URL: https://svnweb.freebsd.org/changeset/base/274803 Log: Create a vimage.9 link to vnet.9 Requested by: glebius Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Nov 21 17:55:38 2014 (r274802) +++ head/share/man/man9/Makefile Fri Nov 21 17:57:37 2014 (r274803) @@ -1733,6 +1733,7 @@ MLINKS+=VOP_OPENCLOSE.9 VOP_CLOSE.9 \ MLINKS+=VOP_RDWR.9 VOP_READ.9 \ VOP_RDWR.9 VOP_WRITE.9 MLINKS+=VOP_REMOVE.9 VOP_RMDIR.9 +MLINKS+=vnet.9 vimage.9 MLINKS+=vref.9 VREF.9 MLINKS+=vrele.9 vput.9 \ vrele.9 vunref.9 From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 18:00:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CE2642F; Fri, 21 Nov 2014 18:00:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09759272; Fri, 21 Nov 2014 18:00:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALI00tm079863; Fri, 21 Nov 2014 18:00:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALI00Ql079862; Fri, 21 Nov 2014 18:00:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411211800.sALI00Ql079862@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Nov 2014 18:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274804 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 18:00:01 -0000 Author: mav Date: Fri Nov 21 18:00:00 2014 New Revision: 274804 URL: https://svnweb.freebsd.org/changeset/base/274804 Log: In conf_apply() remove iSCSI ports from kernel before removing LUNs. Previous order confused initiators with messages about "removed" LUNs during simple ctld restart without any real config change. After this commit initiators only reestablish lost connection, receive "Power on occurred" UNIT ATTENTION status and continue normal operation. MFC after: 1 month Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Fri Nov 21 17:57:37 2014 (r274803) +++ head/usr.sbin/ctld/ctld.c Fri Nov 21 18:00:00 2014 (r274804) @@ -1662,6 +1662,16 @@ conf_apply(struct conf *oldconf, struct */ newtarg = target_find(newconf, oldtarg->t_name); if (newtarg == NULL) { + error = kernel_port_remove(oldtarg); + if (error != 0) { + log_warnx("failed to remove target %s", + oldtarg->t_name); + /* + * XXX: Uncomment after fixing the root cause. + * + * cumulated_error++; + */ + } TAILQ_FOREACH_SAFE(oldlun, &oldtarg->t_luns, l_next, tmplun) { log_debugx("target %s not found in new " @@ -1678,16 +1688,6 @@ conf_apply(struct conf *oldconf, struct cumulated_error++; } } - error = kernel_port_remove(oldtarg); - if (error != 0) { - log_warnx("failed to remove target %s", - oldtarg->t_name); - /* - * XXX: Uncomment after fixing the root cause. - * - * cumulated_error++; - */ - } continue; } From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 18:05:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3654932; Fri, 21 Nov 2014 18:05:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A669C36F; Fri, 21 Nov 2014 18:05:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALI53XZ086034; Fri, 21 Nov 2014 18:05:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALI53e8086025; Fri, 21 Nov 2014 18:05:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411211805.sALI53e8086025@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Nov 2014 18:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274805 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 18:05:03 -0000 Author: mav Date: Fri Nov 21 18:05:02 2014 New Revision: 274805 URL: https://svnweb.freebsd.org/changeset/base/274805 Log: Make cfiscsi_offline() synchronous, waiting for connections termination before return. This should make ctld restart more clean and predictable. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_frontend_iscsi.h Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 21 18:00:00 2014 (r274804) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 21 18:05:02 2014 (r274805) @@ -1274,6 +1274,7 @@ cfiscsi_session_delete(struct cfiscsi_se mtx_lock(&softc->lock); TAILQ_REMOVE(&softc->sessions, cs, cs_next); + cv_signal(&softc->sessions_cv); mtx_unlock(&softc->lock); free(cs, M_CFISCSI); @@ -1290,6 +1291,7 @@ cfiscsi_init(void) bzero(softc, sizeof(*softc)); mtx_init(&softc->lock, "cfiscsi", NULL, MTX_DEF); + cv_init(&softc->sessions_cv, "cfiscsi_sessions"); #ifdef ICL_KERNEL_PROXY cv_init(&softc->accept_cv, "cfiscsi_accept"); #endif @@ -1374,6 +1376,14 @@ cfiscsi_offline(void *arg) if (cs->cs_target == ct) cfiscsi_session_terminate(cs); } + do { + TAILQ_FOREACH(cs, &softc->sessions, cs_next) { + if (cs->cs_target == ct) + break; + } + if (cs != NULL) + cv_wait(&softc->sessions_cv, &softc->lock); + } while (cs != NULL && ct->ct_online == 0); mtx_unlock(&softc->lock); if (online > 0) return; Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.h Fri Nov 21 18:00:00 2014 (r274804) +++ head/sys/cam/ctl/ctl_frontend_iscsi.h Fri Nov 21 18:05:02 2014 (r274805) @@ -115,6 +115,7 @@ struct cfiscsi_softc { unsigned int last_session_id; TAILQ_HEAD(, cfiscsi_target) targets; TAILQ_HEAD(, cfiscsi_session) sessions; + struct cv sessions_cv; #ifdef ICL_KERNEL_PROXY struct icl_listen *listener; struct cv accept_cv; From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 18:18:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A5C514F; Fri, 21 Nov 2014 18:18:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2709A6C1; Fri, 21 Nov 2014 18:18:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALIIcKP096705; Fri, 21 Nov 2014 18:18:38 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALIIc5m096704; Fri, 21 Nov 2014 18:18:38 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201411211818.sALIIc5m096704@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 21 Nov 2014 18:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274806 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 18:18:38 -0000 Author: brooks Date: Fri Nov 21 18:18:37 2014 New Revision: 274806 URL: https://svnweb.freebsd.org/changeset/base/274806 Log: Add a guard against attempting to invoke the buildenv target with -j# as that silently exits rather than doing something useful. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 21 18:05:02 2014 (r274805) +++ head/Makefile.inc1 Fri Nov 21 18:18:37 2014 (r274806) @@ -691,6 +691,11 @@ buildworld_epilogue: buildenvvars: @echo ${WMAKEENV:Q} +.if ${.TARGETS:Mbuildenv} +.if ${.MAKEFLAGS:M-j} +.error The buildenv target is incompatible with -j +.endif +.endif buildenv: @echo Entering world for ${TARGET_ARCH}:${TARGET} @cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 18:35:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CAD2B0F; Fri, 21 Nov 2014 18:35:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 599AF906; Fri, 21 Nov 2014 18:35:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALIZnFv012726; Fri, 21 Nov 2014 18:35:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALIZn7n012725; Fri, 21 Nov 2014 18:35:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201411211835.sALIZn7n012725@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 21 Nov 2014 18:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274807 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 18:35:49 -0000 Author: brooks Date: Fri Nov 21 18:35:48 2014 New Revision: 274807 URL: https://svnweb.freebsd.org/changeset/base/274807 Log: Slightly alter the handling of LOCAL_LIB_DIRS to skip addition of directories in LOCAL_LIB_DIRS if they are subdirectories of directories listed in LOCAL_DIRS. This allows a hierarchy like: foo foo/lib foo/usr.bin foo/usr.sbin to be supported with LOCAL_DIRS=foo LOCAL_DIRS=foo/lib. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 21 18:18:37 2014 (r274806) +++ head/Makefile.inc1 Fri Nov 21 18:35:48 2014 (r274807) @@ -97,11 +97,22 @@ SUBDIR+=contrib/ofed # SUBDIR+=etc -# These are last, since it is nice to at least get the base system -# rebuilt before you do them. -.for _DIR in ${LOCAL_LIB_DIRS} ${LOCAL_DIRS} +# Local directories are last, since it is nice to at least get the base +# system rebuilt before you do them. +.for _DIR in ${LOCAL_DIRS} .if exists(${.CURDIR}/${_DIR}/Makefile) -SUBDIR+= ${_DIR} +SUBDIR+= ${_DIR} +.endif +.endfor +# Add LOCAL_LIB_DIRS, but only if they will not be picked up as a SUBDIR +# of a LOCAL_DIRS directory. This allows LOCAL_DIRS=foo and +# LOCAL_LIB_DIRS=foo/lib to behave as expected. +.for _DIR in ${LOCAL_DIRS:M*/} ${LOCAL_DIRS:N*/:S|$|/|} +_REDUNDENT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*} +.endfor +.for _DIR in ${LOCAL_LIB_DIRS} +.if empty(_REDUNDENT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile) +SUBDIR+= ${_DIR} .endif .endfor .endif From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 20:02:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D630C86F; Fri, 21 Nov 2014 20:02:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0CEB29C; Fri, 21 Nov 2014 20:02:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALK27w3087678; Fri, 21 Nov 2014 20:02:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALK27s7087666; Fri, 21 Nov 2014 20:02:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201411212002.sALK27s7087666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 21 Nov 2014 20:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274816 - in head: lib/libc/mips/gen 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 20:02:08 -0000 Author: brooks Date: Fri Nov 21 20:02:06 2014 New Revision: 274816 URL: https://svnweb.freebsd.org/changeset/base/274816 Log: Add FPU support for MIPS setjmp(3)/longjmp(3). This change saves/restores the callee-saved MIPS floating point registers as documented by the o32/n32/n64 spec ("MIPSpro N32 ABI Handbook", Table 2-1) for the _setjmp(3), _longjmp(3), setjmp(3) and longjmp(3) C library functions. This is only included when the C library is built with hardware floating point support (or when "SOFTFLOAT" is not defined). Submitted by: sson MFC after: 1 month Sponsored by: DARPA, AFRL Modified: head/lib/libc/mips/gen/_setjmp.S head/lib/libc/mips/gen/setjmp.S head/sys/mips/include/asm.h Modified: head/lib/libc/mips/gen/_setjmp.S ============================================================================== --- head/lib/libc/mips/gen/_setjmp.S Fri Nov 21 19:56:27 2014 (r274815) +++ head/lib/libc/mips/gen/_setjmp.S Fri Nov 21 20:02:06 2014 (r274816) @@ -61,9 +61,16 @@ __FBSDID("$FreeBSD$"); LEAF(_setjmp) REG_PROLOGUE - REG_LI v0, _JB_MAGIC__SETJMP + REG_LI v0, _JB_MAGIC__SETJMP # sigcontext magic number REG_S v0, (_JB_MAGIC * SZREG)(a0) REG_S ra, (_JB_REG_RA * SZREG)(a0) + /* + * From "MIPSpro N32 ABI Handbook", Table 2-1: + * Registers s0..s7 are callee-saved. + * The sp register is callee-saved. + * The fp (or s8) register is callee-saved. + * The gp register is callee-saved (for n32/n64). + */ REG_S s0, (_JB_REG_S0 * SZREG)(a0) REG_S s1, (_JB_REG_S1 * SZREG)(a0) REG_S s2, (_JB_REG_S2 * SZREG)(a0) @@ -72,11 +79,41 @@ LEAF(_setjmp) REG_S s5, (_JB_REG_S5 * SZREG)(a0) REG_S s6, (_JB_REG_S6 * SZREG)(a0) REG_S s7, (_JB_REG_S7 * SZREG)(a0) + REG_S sp, (_JB_REG_SP * SZREG)(a0) REG_S s8, (_JB_REG_S8 * SZREG)(a0) #if defined(__mips_n32) || defined(__mips_n64) REG_S gp, (_JB_REG_GP * SZREG)(a0) # newabi gp is callee-saved #endif - REG_S sp, (_JB_REG_SP * SZREG)(a0) + /* + * From "MIPSpro N32 ABI Handbook", Table 2-1: + * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved. + * In N64, FP registers F24 .. F31 are callee-saved. + * In O32, FP registers F20 .. F23 are callee-saved. + */ +#ifndef SOFTFLOAT + cfc1 v0, $31 # too bad can't check if FP used +#if defined(__mips_n64) || defined(__mips_n32) + FP_S $f30, (_JB_FPREG_F30 * SZREG)(a0) + FP_S $f28, (_JB_FPREG_F28 * SZREG)(a0) + FP_S $f26, (_JB_FPREG_F26 * SZREG)(a0) + FP_S $f24, (_JB_FPREG_F24 * SZREG)(a0) +#endif +#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64) + FP_S $f22, (_JB_FPREG_F22 * SZREG)(a0) + FP_S $f20, (_JB_FPREG_F20 * SZREG)(a0) +#endif +#if defined(__mips_o32) || defined(__mips_o64) + FP_S $f21, (_JB_FPREG_F21 * SZREG)(a0) + FP_S $f23, (_JB_FPREG_F23 * SZREG)(a0) +#endif +#if defined(__mips_n64) + FP_S $f25, (_JB_FPREG_F25 * SZREG)(a0) + FP_S $f27, (_JB_FPREG_F27 * SZREG)(a0) + FP_S $f29, (_JB_FPREG_F29 * SZREG)(a0) + FP_S $f31, (_JB_FPREG_F31 * SZREG)(a0) +#endif + INT_S v0, (_JB_FPREG_FCSR * SZREG)(a0) +#endif /* ! SOFTFLOAT */ REG_EPILOGUE j ra @@ -94,6 +131,13 @@ LEAF(_longjmp) REG_LI t0, _JB_MAGIC__SETJMP bne v0, t0, botch # jump if error PTR_ADDU sp, sp, CALLFRAME_SIZ # does not matter, sanity + /* + * From "MIPSpro N32 ABI Handbook", Table 2-1: + * Registers s0..s7 are callee-saved. + * The sp register is callee-saved. + * The fp (or s8) register is callee-saved. + * The gp register is callee-saved (for n32/n64). + */ REG_L s0, (_JB_REG_S0 * SZREG)(a0) REG_L s1, (_JB_REG_S1 * SZREG)(a0) REG_L s2, (_JB_REG_S2 * SZREG)(a0) @@ -102,11 +146,42 @@ LEAF(_longjmp) REG_L s5, (_JB_REG_S5 * SZREG)(a0) REG_L s6, (_JB_REG_S6 * SZREG)(a0) REG_L s7, (_JB_REG_S7 * SZREG)(a0) + REG_L sp, (_JB_REG_SP * SZREG)(a0) + REG_L s8, (_JB_REG_S8 * SZREG)(a0) #if defined(__mips_n32) || defined(__mips_n64) REG_L gp, (_JB_REG_GP * SZREG)(a0) #endif - REG_L sp, (_JB_REG_SP * SZREG)(a0) - REG_L s8, (_JB_REG_S8 * SZREG)(a0) +#ifndef SOFTFLOAT + # get fpu status + INT_L v0, (_JB_FPREG_FCSR * SZREG)(a0) + ctc1 v0, $31 + /* + * From "MIPSpro N32 ABI Handbook", Table 2-1: + * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved. + * In N64, FP registers F24 .. F31 are callee-saved. + * In O32, FP registers F20 .. F23 are callee-saved. + */ +#if defined(__mips_n64) || defined(__mips_n32) + FP_L $f30, (_JB_FPREG_F30 * SZREG)(a0) + FP_L $f28, (_JB_FPREG_F28 * SZREG)(a0) + FP_L $f26, (_JB_FPREG_F26 * SZREG)(a0) + FP_L $f24, (_JB_FPREG_F24 * SZREG)(a0) +#endif +#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64) + FP_L $f22, (_JB_FPREG_F22 * SZREG)(a0) + FP_L $f20, (_JB_FPREG_F20 * SZREG)(a0) +#endif +#if defined(__mips_o32) || defined(__mips_o64) + FP_L $f21, (_JB_FPREG_F21 * SZREG)(a0) + FP_L $f23, (_JB_FPREG_F23 * SZREG)(a0) +#endif +#if defined(__mips_n64) + FP_L $f25, (_JB_FPREG_F25 * SZREG)(a0) + FP_L $f27, (_JB_FPREG_F27 * SZREG)(a0) + FP_L $f29, (_JB_FPREG_F29 * SZREG)(a0) + FP_L $f31, (_JB_FPREG_F31 * SZREG)(a0) +#endif +#endif /* ! SOFTFLOAT */ REG_EPILOGUE move v0, a1 # get return value in 1st arg Modified: head/lib/libc/mips/gen/setjmp.S ============================================================================== --- head/lib/libc/mips/gen/setjmp.S Fri Nov 21 19:56:27 2014 (r274815) +++ head/lib/libc/mips/gen/setjmp.S Fri Nov 21 20:02:06 2014 (r274816) @@ -86,6 +86,13 @@ NESTED(setjmp, SETJMP_FRAME_SIZE, ra) REG_LI v0, _JB_MAGIC_SETJMP REG_S v0, (_JB_MAGIC * SZREG)(a0) REG_S ra, (_JB_REG_RA * SZREG)(a0) + /* + * From "MIPSpro N32 ABI Handbook", Table 2-1: + * Registers s0..s7 are callee-saved. + * The sp register is callee-saved. + * The fp (or s8) register is callee-saved. + * The gp register is callee-saved (for n32/n64). + */ REG_S s0, (_JB_REG_S0 * SZREG)(a0) REG_S s1, (_JB_REG_S1 * SZREG)(a0) REG_S s2, (_JB_REG_S2 * SZREG)(a0) @@ -99,6 +106,36 @@ NESTED(setjmp, SETJMP_FRAME_SIZE, ra) #if defined(__mips_n32) || defined(__mips_n64) REG_S gp, (_JB_REG_GP * SZREG)(a0) #endif +#ifndef SOFTFLOAT + /* + * From "MIPSpro N32 ABI Handbook", Table 2-1: + * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved. + * In N64, FP registers F24 .. F31 are callee-saved. + * In O32, FP registers F20 .. F23 are callee-saved. + */ + cfc1 v0, $31 + INT_S v0, (_JB_FPREG_FCSR * SZREG)(a0) +#if defined(__mips_o32) || defined(__mips_o64) || defined(__mips_n32) + FP_S $f20, (_JB_FPREG_F20 * SZREG)(a0) + FP_S $f22, (_JB_FPREG_F22 * SZREG)(a0) +#endif +#if defined(__mips_o32) || defined(__mips_o64) + FP_S $f21, (_JB_FPREG_F21 * SZREG)(a0) + FP_S $f23, (_JB_FPREG_F23 * SZREG)(a0) +#endif +#if defined(__mips_n32) || defined(__mips_n64) + FP_S $f24, (_JB_FPREG_F24 * SZREG)(a0) + FP_S $f26, (_JB_FPREG_F26 * SZREG)(a0) + FP_S $f28, (_JB_FPREG_F28 * SZREG)(a0) + FP_S $f30, (_JB_FPREG_F30 * SZREG)(a0) +#endif +#if defined(__mips_n64) + FP_S $f25, (_JB_FPREG_F25 * SZREG)(a0) + FP_S $f27, (_JB_FPREG_F27 * SZREG)(a0) + FP_S $f29, (_JB_FPREG_F29 * SZREG)(a0) + FP_S $f31, (_JB_FPREG_F31 * SZREG)(a0) +#endif +#endif /* ! SOFTFLOAT */ move v0, zero jr ra @@ -133,6 +170,13 @@ NESTED(longjmp, LONGJMP_FRAME_SIZE, ra) REG_L a1, (CALLFRAME_SIZ + SZREG)(sp) # restore return value REG_L ra, (_JB_REG_RA * SZREG)(a0) + /* + * From "MIPSpro N32 ABI Handbook", Table 2-1: + * Registers s0..s7 are callee-saved. + * The sp register is callee-saved. + * The fp (or s8) register is callee-saved. + * The gp register is callee-saved (for n32/n64). + */ REG_L s0, (_JB_REG_S0 * SZREG)(a0) REG_L s1, (_JB_REG_S1 * SZREG)(a0) REG_L s2, (_JB_REG_S2 * SZREG)(a0) @@ -146,6 +190,36 @@ NESTED(longjmp, LONGJMP_FRAME_SIZE, ra) #if defined(__mips_n32) || defined(__mips_n64) REG_L gp, (_JB_REG_GP * SZREG)(a0) #endif +#ifndef SOFTFLOAT + /* + * From "MIPSpro N32 ABI Handbook", Table 2-1: + * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved. + * In N64, FP registers F23 .. F31 are callee-saved. + * In O32, FP registers F20 .. F23 are callee-saved. + */ + INT_L v0, (_JB_FPREG_FCSR * SZREG)(a0) + ctc1 v0, $31 +#if defined(__mips_n64) || defined(__mips_n32) + FP_L $f30, (_JB_FPREG_F30 * SZREG)(a0) + FP_L $f28, (_JB_FPREG_F28 * SZREG)(a0) + FP_L $f26, (_JB_FPREG_F26 * SZREG)(a0) + FP_L $f24, (_JB_FPREG_F24 * SZREG)(a0) +#endif +#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64) + FP_L $f22, (_JB_FPREG_F22 * SZREG)(a0) + FP_L $f20, (_JB_FPREG_F20 * SZREG)(a0) +#endif +#if defined(__mips_o32) || defined(__mips_o64) + FP_L $f21, (_JB_FPREG_F21 * SZREG)(a0) + FP_L $f23, (_JB_FPREG_F23 * SZREG)(a0) +#endif +#if defined(__mips_n64) + FP_L $f25, (_JB_FPREG_F25 * SZREG)(a0) + FP_L $f27, (_JB_FPREG_F27 * SZREG)(a0) + FP_L $f29, (_JB_FPREG_F29 * SZREG)(a0) + FP_L $f31, (_JB_FPREG_F31 * SZREG)(a0) +#endif +#endif /* ! SOFTFLOAT */ move v0, a1 j ra Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Fri Nov 21 19:56:27 2014 (r274815) +++ head/sys/mips/include/asm.h Fri Nov 21 20:02:06 2014 (r274816) @@ -667,6 +667,20 @@ _C_LABEL(x): #define _JB_SIGMASK 13 +#define _JB_FPREG_F20 14 +#define _JB_FPREG_F21 15 +#define _JB_FPREG_F22 16 +#define _JB_FPREG_F23 17 +#define _JB_FPREG_F24 18 +#define _JB_FPREG_F25 19 +#define _JB_FPREG_F26 20 +#define _JB_FPREG_F27 21 +#define _JB_FPREG_F28 22 +#define _JB_FPREG_F29 23 +#define _JB_FPREG_F30 24 +#define _JB_FPREG_F31 25 +#define _JB_FPREG_FCSR 26 + /* * Various macros for dealing with TLB hazards * (a) why so many? From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 20:25:41 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05BB2FFC; Fri, 21 Nov 2014 20:25:41 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DE6F6785; Fri, 21 Nov 2014 20:25:40 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [12.229.62.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 67007FEF0; Fri, 21 Nov 2014 12:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1416601540; x=1416615940; bh=YgtbqNa7DESHNsZ5ALukFYOYzlZTAKIsglTGyyGLAdw=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=CC3lXxzvYdm5T1FuDEojyCkjMlXHTPxcssuZAxwZA74nKNM3+U0XTJ9jJ+mPXnE1B MHqu09gqAWLi4KO5xvYdOV0SFw+pE5hOZ0B7u/pjir9xs/Z71WLga/66etCtDZQvJZ 8ZkdHXBXa36EEKwKA+lJDW6WFEN3b5pOOn59gpE0= Message-ID: <546F9FC3.10402@delphij.net> Date: Fri, 21 Nov 2014 12:25:39 -0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Andriy Gapon , Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r273060 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201410132039.s9DKdpmh055573@svn.freebsd.org> <546F57B1.2020602@FreeBSD.org> In-Reply-To: <546F57B1.2020602@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 20:25:41 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 11/21/14 07:18, Andriy Gapon wrote: > On 13/10/2014 23:39, Xin LI wrote: >> Author: delphij Date: Mon Oct 13 20:39:51 2014 New Revision: >> 273060 URL: https://svnweb.freebsd.org/changeset/base/273060 >> >> Log: Use write_psize instead of write_asize when doing >> vdev_space_update. Without this change the accounting of L2ARC >> usage would be wrong and give 16EB free space because the number >> became negative and overflows. >> >> Obtained from: FreeNAS (issue #6239) > > First, a link to the issue would be more convenient for reviewers. > Here it is https://bugs.freenas.org/issues/6239 > > Then, I would like to see a technical explanation for this change. > I could not find any explanation here or in the FreeNAS issue or in > the FreeNAS commit. > > As far as I can see, all calls to vdev_space_update() in the ARC > code are passed l2hdr->b_asize or a sum of b_asize fields of > multiple buffers. Thus, I am really surprised with this change and > would like to see reasoning behind it. Hmm I think you are right that my change doesn't make sense but I can't remember the details either and suggests there is some other issues that was covered up by this. It looks like that I was confused because the L2ARC clock hand advances by buf_p_sz (unrelated but it should really be called buf_a_size) and the way we calculate allocated L2ARC free. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJUb5/DAAoJEJW2GBstM+nsJ9QQAI1r3y0dcQNegsfF997C5Kx/ kbS8qG9gmlwHwYlt7Q4RWH8z+kpo4poSrTz3i/0JaLBM5GN3NYq4LqVDIvX0MF4N wY8y1Fv8u6HVoor7gM0YbCXsAG7KJXHP+vj8MlczFiHdyK6Rl0HAiifMPUM1ie2I LHhmzSCzYsp8SJ2w+ggnwZQjTfJH+nwbcEHc9+2ke7u7cgb/pRuRMX8CfP6B6zfM +kOszv4UIp0xa8wA4ER/Ic8NlD9f8f7767vDxa1sfvCJaIeIoTjGplqDhkMuGaCc EcGy1rDH5iSvrRi9JbwZCtasYupwNINfIuKRcBTMUtSZDPu9D/cQfC1/b3DOhX97 uJt8GLEbQL/EeSOuqQ5aSAVzC08B6sJyTxnZ2/hIM96WEGhHvUPyng5AQ9umvRV4 Es10kly/KBRcCq8MfqJkA9e4a2sEIhSZyPPs+kcnFiBfQmyXlrkQgHrgCufHUO9B V4m5wsa+snv3sJQfg3HyOavYFY51/Yi9fWAeVUKt/NAsQQaOGNrvNIb8OEZamUS8 3rujexBEaDEW9wHFt3mZiN9zzh7+ZslwvSMh+B/qsp6nnoDJ9I7QzkFNUxHzlWZg Cc7d1ezbQF3t36S8ixpUER8w2bXGfAgnURvJWf86vNXwrFEo9BHUh42mauw9kMbZ 01SCBCFFDqpIUry9GFDW =uPh8 -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 20:53:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E768F6A; Fri, 21 Nov 2014 20:53:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67FBEA87; Fri, 21 Nov 2014 20:53:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALKrMws030760; Fri, 21 Nov 2014 20:53:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALKrI34030713; Fri, 21 Nov 2014 20:53:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411212053.sALKrI34030713@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 21 Nov 2014 20:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274817 - in head: contrib/binutils/binutils contrib/binutils/include/elf sys/amd64/amd64 sys/compat/ia32 sys/i386/i386 sys/i386/isa sys/kern sys/sys sys/x86/include usr.bin/gcore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 20:53:22 -0000 Author: jhb Date: Fri Nov 21 20:53:17 2014 New Revision: 274817 URL: https://svnweb.freebsd.org/changeset/base/274817 Log: Improve support for XSAVE with debuggers. - Dump an NT_X86_XSTATE note if XSAVE is in use. This note is designed to match what Linux does in that 1) it dumps the entire XSAVE area including the fxsave state, and 2) it stashes a copy of the current xsave mask in the unused padding between the fxsave state and the xstate header at the same location used by Linux. - Teach readelf() to recognize NT_X86_XSTATE notes. - Change PT_GET/SETXSTATE to take the entire XSAVE state instead of only the extra portion. This avoids having to always make two ptrace() calls to get or set the full XSAVE state. - Add a PT_GET_XSTATE_INFO which returns the length of the current XSTATE save area (so the size of the buffer needed for PT_GETXSTATE) and the current XSAVE mask (%xcr0). Differential Revision: https://reviews.freebsd.org/D1193 Reviewed by: kib MFC after: 2 weeks Modified: head/contrib/binutils/binutils/readelf.c head/contrib/binutils/include/elf/common.h head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/amd64/fpu.c head/sys/amd64/amd64/ptrace_machdep.c head/sys/compat/ia32/ia32_sysvec.c head/sys/i386/i386/elf_machdep.c head/sys/i386/i386/ptrace_machdep.c head/sys/i386/isa/npx.c head/sys/kern/imgact_elf.c head/sys/sys/elf_common.h head/sys/sys/imgact_elf.h head/sys/x86/include/fpu.h head/sys/x86/include/ptrace.h head/usr.bin/gcore/elfcore.c Modified: head/contrib/binutils/binutils/readelf.c ============================================================================== --- head/contrib/binutils/binutils/readelf.c Fri Nov 21 20:02:06 2014 (r274816) +++ head/contrib/binutils/binutils/readelf.c Fri Nov 21 20:53:17 2014 (r274817) @@ -9159,6 +9159,8 @@ get_freebsd_note_type (unsigned e_type) return _("NT_PROCSTAT_PSSTRINGS (ps_strings data)"); case NT_PROCSTAT_AUXV: return _("NT_PROCSTAT_AUXV (auxv data)"); + case NT_X86_XSTATE: + return _("NT_X86_XSTATE (x86 XSAVE extended state)"); default: return get_note_type(e_type); } Modified: head/contrib/binutils/include/elf/common.h ============================================================================== --- head/contrib/binutils/include/elf/common.h Fri Nov 21 20:02:06 2014 (r274816) +++ head/contrib/binutils/include/elf/common.h Fri Nov 21 20:53:17 2014 (r274817) @@ -414,6 +414,7 @@ #define NT_PROCSTAT_OSREL 14 #define NT_PROCSTAT_PSSTRINGS 15 #define NT_PROCSTAT_AUXV 16 +#define NT_X86_XSTATE 0x202 /* Note segments for core files on NetBSD systems. Note name Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/amd64/amd64/elf_machdep.c Fri Nov 21 20:53:17 2014 (r274817) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include struct sysentvec elf64_freebsd_sysvec = { @@ -133,11 +134,26 @@ SYSINIT(kelf64, SI_SUB_EXEC, SI_ORDER_AN &kfreebsd_brand_info); void -elf64_dump_thread(struct thread *td __unused, void *dst __unused, - size_t *off __unused) +elf64_dump_thread(struct thread *td, void *dst, size_t *off) { -} + void *buf; + size_t len; + len = 0; + if (use_xsave) { + if (dst != NULL) { + fpugetregs(td); + len += elf64_populate_note(NT_X86_XSTATE, + get_pcb_user_save_td(td), dst, + cpu_max_ext_state_size, &buf); + *(uint64_t *)((char *)buf + X86_XSTATE_XCR0_OFFSET) = + xsave_mask; + } else + len += elf64_populate_note(NT_X86_XSTATE, NULL, NULL, + cpu_max_ext_state_size, NULL); + } + *off = len; +} /* Process one elf relocation with addend. */ static int Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/amd64/amd64/fpu.c Fri Nov 21 20:53:17 2014 (r274817) @@ -127,6 +127,13 @@ CTASSERT(sizeof(struct savefpu_ymm) == 8 */ CTASSERT(sizeof(struct pcb) % XSAVE_AREA_ALIGN == 0); +/* + * Ensure the copy of XCR0 saved in a core is contained in the padding + * area. + */ +CTASSERT(X86_XSTATE_XCR0_OFFSET >= offsetof(struct savefpu, sv_pad) && + X86_XSTATE_XCR0_OFFSET + sizeof(uint64_t) <= sizeof(struct savefpu)); + static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, Modified: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- head/sys/amd64/amd64/ptrace_machdep.c Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/amd64/amd64/ptrace_machdep.c Fri Nov 21 20:53:17 2014 (r274817) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); static int cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data) { + struct ptrace_xstate_info info; char *savefpu; int error; @@ -49,14 +50,14 @@ cpu_ptrace_xstate(struct thread *td, int return (EOPNOTSUPP); switch (req) { - case PT_GETXSTATE: + case PT_GETXSTATE_OLD: fpugetregs(td); savefpu = (char *)(get_pcb_user_save_td(td) + 1); error = copyout(savefpu, addr, cpu_max_ext_state_size - sizeof(struct savefpu)); break; - case PT_SETXSTATE: + case PT_SETXSTATE_OLD: if (data > cpu_max_ext_state_size - sizeof(struct savefpu)) { error = EINVAL; break; @@ -70,6 +71,36 @@ cpu_ptrace_xstate(struct thread *td, int free(savefpu, M_TEMP); break; + case PT_GETXSTATE_INFO: + if (data != sizeof(info)) { + error = EINVAL; + break; + } + info.xsave_len = cpu_max_ext_state_size; + info.xsave_mask = xsave_mask; + error = copyout(&info, addr, data); + break; + + case PT_GETXSTATE: + fpugetregs(td); + savefpu = (char *)(get_pcb_user_save_td(td)); + error = copyout(savefpu, addr, cpu_max_ext_state_size); + break; + + case PT_SETXSTATE: + if (data > cpu_max_ext_state_size) { + error = EINVAL; + break; + } + savefpu = malloc(data, M_TEMP, M_WAITOK); + error = copyin(addr, savefpu, data); + if (error == 0) + error = fpusetregs(td, (struct savefpu *)savefpu, + savefpu + sizeof(struct savefpu), data - + sizeof(struct savefpu)); + free(savefpu, M_TEMP); + break; + default: error = EINVAL; break; @@ -81,8 +112,6 @@ cpu_ptrace_xstate(struct thread *td, int #ifdef COMPAT_FREEBSD32 #define PT_I386_GETXMMREGS (PT_FIRSTMACH + 0) #define PT_I386_SETXMMREGS (PT_FIRSTMACH + 1) -#define PT_I386_GETXSTATE (PT_FIRSTMACH + 2) -#define PT_I386_SETXSTATE (PT_FIRSTMACH + 3) static int cpu32_ptrace(struct thread *td, int req, void *addr, int data) @@ -104,12 +133,12 @@ cpu32_ptrace(struct thread *td, int req, fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; break; - case PT_I386_GETXSTATE: - error = cpu_ptrace_xstate(td, PT_GETXSTATE, addr, data); - break; - - case PT_I386_SETXSTATE: - error = cpu_ptrace_xstate(td, PT_SETXSTATE, addr, data); + case PT_GETXSTATE_OLD: + case PT_SETXSTATE_OLD: + case PT_GETXSTATE_INFO: + case PT_GETXSTATE: + case PT_SETXSTATE: + error = cpu_ptrace_xstate(td, req, addr, data); break; default: @@ -131,13 +160,16 @@ cpu_ptrace(struct thread *td, int req, v return (cpu32_ptrace(td, req, addr, data)); #endif - /* Support old values of PT_GETXSTATE and PT_SETXSTATE. */ + /* Support old values of PT_GETXSTATE_OLD and PT_SETXSTATE_OLD. */ if (req == PT_FIRSTMACH + 0) - req = PT_GETXSTATE; + req = PT_GETXSTATE_OLD; if (req == PT_FIRSTMACH + 1) - req = PT_SETXSTATE; + req = PT_SETXSTATE_OLD; switch (req) { + case PT_GETXSTATE_OLD: + case PT_SETXSTATE_OLD: + case PT_GETXSTATE_INFO: case PT_GETXSTATE: case PT_SETXSTATE: error = cpu_ptrace_xstate(td, req, addr, data); Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/compat/ia32/ia32_sysvec.c Fri Nov 21 20:53:17 2014 (r274817) @@ -187,9 +187,25 @@ SYSINIT(kia32, SI_SUB_EXEC, SI_ORDER_ANY &kia32_brand_info); void -elf32_dump_thread(struct thread *td __unused, void *dst __unused, - size_t *off __unused) +elf32_dump_thread(struct thread *td, void *dst, size_t *off) { + void *buf; + size_t len; + + len = 0; + if (use_xsave) { + if (dst != NULL) { + fpugetregs(td); + len += elf32_populate_note(NT_X86_XSTATE, + get_pcb_user_save_td(td), dst, + cpu_max_ext_state_size, &buf); + *(uint64_t *)((char *)buf + X86_XSTATE_XCR0_OFFSET) = + xsave_mask; + } else + len += elf32_populate_note(NT_X86_XSTATE, NULL, NULL, + cpu_max_ext_state_size, NULL); + } + *off = len; } void Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/i386/i386/elf_machdep.c Fri Nov 21 20:53:17 2014 (r274817) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, @@ -134,11 +135,26 @@ SYSINIT(kelf32, SI_SUB_EXEC, SI_ORDER_AN void -elf32_dump_thread(struct thread *td __unused, void *dst __unused, - size_t *off __unused) +elf32_dump_thread(struct thread *td, void *dst, size_t *off) { -} + void *buf; + size_t len; + len = 0; + if (use_xsave) { + if (dst != NULL) { + npxgetregs(td); + len += elf32_populate_note(NT_X86_XSTATE, + get_pcb_user_save_td(td), dst, + cpu_max_ext_state_size, &buf); + *(uint64_t *)((char *)buf + X86_XSTATE_XCR0_OFFSET) = + xsave_mask; + } else + len += elf32_populate_note(NT_X86_XSTATE, NULL, NULL, + cpu_max_ext_state_size, NULL); + } + *off = len; +} /* Process one elf relocation with addend. */ static int Modified: head/sys/i386/i386/ptrace_machdep.c ============================================================================== --- head/sys/i386/i386/ptrace_machdep.c Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/i386/i386/ptrace_machdep.c Fri Nov 21 20:53:17 2014 (r274817) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); static int cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data) { + struct ptrace_xstate_info info; char *savefpu; int error; @@ -53,14 +54,14 @@ cpu_ptrace_xstate(struct thread *td, int return (EOPNOTSUPP); switch (req) { - case PT_GETXSTATE: + case PT_GETXSTATE_OLD: npxgetregs(td); savefpu = (char *)(get_pcb_user_save_td(td) + 1); error = copyout(savefpu, addr, cpu_max_ext_state_size - sizeof(union savefpu)); break; - case PT_SETXSTATE: + case PT_SETXSTATE_OLD: if (data > cpu_max_ext_state_size - sizeof(union savefpu)) { error = EINVAL; break; @@ -74,6 +75,36 @@ cpu_ptrace_xstate(struct thread *td, int free(savefpu, M_TEMP); break; + case PT_GETXSTATE_INFO: + if (data != sizeof(info)) { + error = EINVAL; + break; + } + info.xsave_len = cpu_max_ext_state_size; + info.xsave_mask = xsave_mask; + error = copyout(&info, addr, data); + break; + + case PT_GETXSTATE: + npxgetregs(td); + savefpu = (char *)(get_pcb_user_save_td(td)); + error = copyout(savefpu, addr, cpu_max_ext_state_size); + break; + + case PT_SETXSTATE: + if (data > cpu_max_ext_state_size) { + error = EINVAL; + break; + } + savefpu = malloc(data, M_TEMP, M_WAITOK); + error = copyin(addr, savefpu, data); + if (error == 0) + error = npxsetregs(td, (union savefpu *)savefpu, + savefpu + sizeof(union savefpu), data - + sizeof(union savefpu)); + free(savefpu, M_TEMP); + break; + default: error = EINVAL; break; @@ -106,6 +137,9 @@ cpu_ptrace(struct thread *td, int req, v fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; break; + case PT_GETXSTATE_OLD: + case PT_SETXSTATE_OLD: + case PT_GETXSTATE_INFO: case PT_GETXSTATE: case PT_SETXSTATE: error = cpu_ptrace_xstate(td, req, addr, data); Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/i386/isa/npx.c Fri Nov 21 20:53:17 2014 (r274817) @@ -201,6 +201,13 @@ CTASSERT(sizeof(struct savefpu_ymm) == 8 */ CTASSERT(sizeof(struct pcb) % XSAVE_AREA_ALIGN == 0); +/* + * Ensure the copy of XCR0 saved in a core is contained in the padding + * area. + */ +CTASSERT(X86_XSTATE_XCR0_OFFSET >= offsetof(struct savexmm, sv_pad) && + X86_XSTATE_XCR0_OFFSET + sizeof(uint64_t) <= sizeof(struct savexmm)); + static void fpu_clean_state(void); #endif Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/kern/imgact_elf.c Fri Nov 21 20:53:17 2014 (r274817) @@ -1587,7 +1587,50 @@ register_note(struct note_info_list *lis return (size); notesize = sizeof(Elf_Note) + /* note header */ - roundup2(8, ELF_NOTE_ROUNDSIZE) + /* note name ("FreeBSD") */ + roundup2(sizeof(FREEBSD_ABI_VENDOR), ELF_NOTE_ROUNDSIZE) + + /* note name */ + roundup2(size, ELF_NOTE_ROUNDSIZE); /* note description */ + + return (notesize); +} + +static size_t +append_note_data(const void *src, void *dst, size_t len) +{ + size_t padded_len; + + padded_len = roundup2(len, ELF_NOTE_ROUNDSIZE); + if (dst != NULL) { + bcopy(src, dst, len); + bzero((char *)dst + len, padded_len - len); + } + return (padded_len); +} + +size_t +__elfN(populate_note)(int type, void *src, void *dst, size_t size, void **descp) +{ + Elf_Note *note; + char *buf; + size_t notesize; + + buf = dst; + if (buf != NULL) { + note = (Elf_Note *)buf; + note->n_namesz = sizeof(FREEBSD_ABI_VENDOR); + note->n_descsz = size; + note->n_type = type; + buf += sizeof(*note); + buf += append_note_data(FREEBSD_ABI_VENDOR, buf, + sizeof(FREEBSD_ABI_VENDOR)); + append_note_data(src, buf, size); + if (descp != NULL) + *descp = buf; + } + + notesize = sizeof(Elf_Note) + /* note header */ + roundup2(sizeof(FREEBSD_ABI_VENDOR), ELF_NOTE_ROUNDSIZE) + + /* note name */ roundup2(size, ELF_NOTE_ROUNDSIZE); /* note description */ return (notesize); @@ -1604,13 +1647,13 @@ __elfN(putnote)(struct note_info *ninfo, return; } - note.n_namesz = 8; /* strlen("FreeBSD") + 1 */ + note.n_namesz = sizeof(FREEBSD_ABI_VENDOR); note.n_descsz = ninfo->outsize; note.n_type = ninfo->type; sbuf_bcat(sb, ¬e, sizeof(note)); sbuf_start_section(sb, &old_len); - sbuf_bcat(sb, "FreeBSD", note.n_namesz); + sbuf_bcat(sb, FREEBSD_ABI_VENDOR, sizeof(FREEBSD_ABI_VENDOR)); sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); if (note.n_descsz == 0) return; Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/sys/elf_common.h Fri Nov 21 20:53:17 2014 (r274817) @@ -508,6 +508,7 @@ typedef struct { #define NT_PROCSTAT_OSREL 14 /* Procstat osreldate data. */ #define NT_PROCSTAT_PSSTRINGS 15 /* Procstat ps_strings data. */ #define NT_PROCSTAT_AUXV 16 /* Procstat auxv data. */ +#define NT_X86_XSTATE 0x202 /* x86 XSAVE extended state. */ /* Symbol Binding - ELFNN_ST_BIND - st_info */ #define STB_LOCAL 0 /* Local symbol */ Modified: head/sys/sys/imgact_elf.h ============================================================================== --- head/sys/sys/imgact_elf.h Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/sys/imgact_elf.h Fri Nov 21 20:53:17 2014 (r274817) @@ -90,6 +90,7 @@ int __elfN(insert_brand_entry)(Elf_Brand int __elfN(remove_brand_entry)(Elf_Brandinfo *entry); int __elfN(freebsd_fixup)(register_t **, struct image_params *); int __elfN(coredump)(struct thread *, struct vnode *, off_t, int); +size_t __elfN(populate_note)(int, void *, void *, size_t, void **); /* Machine specific function to dump per-thread information. */ void __elfN(dump_thread)(struct thread *, void *, size_t *); Modified: head/sys/x86/include/fpu.h ============================================================================== --- head/sys/x86/include/fpu.h Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/x86/include/fpu.h Fri Nov 21 20:53:17 2014 (r274817) @@ -63,15 +63,7 @@ struct save87 { struct env87 sv_env; /* floating point control/status */ struct fpacc87 sv_ac[8]; /* accumulator contents, 0-7 */ uint8_t sv_pad0[4]; /* saved status word (now unused) */ - /* - * Bogus padding for emulators. Emulators should use their own - * struct and arrange to store into this struct (ending here) - * before it is inspected for ptracing or for core dumps. Some - * emulators overwrite the whole struct. We have no good way of - * knowing how much padding to leave. Leave just enough for the - * GPL emulator's i387_union (176 bytes total). - */ - uint8_t sv_pad[64]; /* padding; used by emulators */ + uint8_t sv_pad[64]; }; /* Contents of each SSE extended accumulator. */ @@ -215,4 +207,11 @@ struct savefpu_ymm { #define __INITIAL_MXCSR__ 0x1F80 #define __INITIAL_MXCSR_MASK__ 0xFFBF +/* + * The current value of %xcr0 is saved in the sv_pad[] field of the FPU + * state in the NT_X86_XSTATE note in core dumps. This offset is chosen + * to match the offset used by NT_X86_XSTATE in other systems. + */ +#define X86_XSTATE_XCR0_OFFSET 464 + #endif /* !_X86_FPU_H_ */ Modified: head/sys/x86/include/ptrace.h ============================================================================== --- head/sys/x86/include/ptrace.h Fri Nov 21 20:02:06 2014 (r274816) +++ head/sys/x86/include/ptrace.h Fri Nov 21 20:53:17 2014 (r274817) @@ -37,14 +37,25 @@ /* * On amd64 (PT_FIRSTMACH + 0) and (PT_FIRSTMACH + 1) are old values for - * PT_GETXSTATE and PT_SETXSTATE. They should not be (re)used. + * PT_GETXSTATE_OLD and PT_SETXSTATE_OLD. They should not be (re)used. */ #ifdef __i386__ #define PT_GETXMMREGS (PT_FIRSTMACH + 0) #define PT_SETXMMREGS (PT_FIRSTMACH + 1) #endif -#define PT_GETXSTATE (PT_FIRSTMACH + 2) -#define PT_SETXSTATE (PT_FIRSTMACH + 3) +#ifdef _KERNEL +#define PT_GETXSTATE_OLD (PT_FIRSTMACH + 2) +#define PT_SETXSTATE_OLD (PT_FIRSTMACH + 3) +#endif +#define PT_GETXSTATE_INFO (PT_FIRSTMACH + 4) +#define PT_GETXSTATE (PT_FIRSTMACH + 5) +#define PT_SETXSTATE (PT_FIRSTMACH + 6) + +/* Argument structure for PT_GETXSTATE_INFO. */ +struct ptrace_xstate_info { + uint64_t xsave_mask; + uint32_t xsave_len; +}; #endif Modified: head/usr.bin/gcore/elfcore.c ============================================================================== --- head/usr.bin/gcore/elfcore.c Fri Nov 21 20:02:06 2014 (r274816) +++ head/usr.bin/gcore/elfcore.c Fri Nov 21 20:53:17 2014 (r274817) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -101,6 +102,9 @@ static void *elf_note_fpregset(void *, s static void *elf_note_prpsinfo(void *, size_t *); static void *elf_note_prstatus(void *, size_t *); static void *elf_note_thrmisc(void *, size_t *); +#if defined(__i386__) || defined(__amd64__) +static void *elf_note_x86_xstate(void *, size_t *); +#endif static void *elf_note_procstat_auxv(void *, size_t *); static void *elf_note_procstat_files(void *, size_t *); static void *elf_note_procstat_groups(void *, size_t *); @@ -341,6 +345,9 @@ elf_putnotes(pid_t pid, struct sbuf *sb, elf_putnote(NT_PRSTATUS, elf_note_prstatus, tids + i, sb); elf_putnote(NT_FPREGSET, elf_note_fpregset, tids + i, sb); elf_putnote(NT_THRMISC, elf_note_thrmisc, tids + i, sb); +#if defined(__i386__) || defined(__amd64__) + elf_putnote(NT_X86_XSTATE, elf_note_x86_xstate, tids + i, sb); +#endif } #ifndef ELFCORE_COMPAT_32 @@ -615,6 +622,34 @@ elf_note_thrmisc(void *arg, size_t *size return (thrmisc); } +#if defined(__i386__) || defined(__amd64__) +static void * +elf_note_x86_xstate(void *arg, size_t *sizep) +{ + lwpid_t tid; + char *xstate; + static bool xsave_checked = false; + static struct ptrace_xstate_info info; + + tid = *(lwpid_t *)arg; + if (!xsave_checked) { + if (ptrace(PT_GETXSTATE_INFO, tid, (void *)&info, + sizeof(info)) != 0) + info.xsave_len = 0; + xsave_checked = true; + } + if (info.xsave_len == 0) { + *sizep = 0; + return (NULL); + } + xstate = calloc(1, info.xsave_len); + ptrace(PT_GETXSTATE, tid, xstate, 0); + *(uint64_t *)(xstate + X86_XSTATE_XCR0_OFFSET) = info.xsave_mask; + *sizep = info.xsave_len; + return (xstate); +} +#endif + static void * procstat_sysctl(void *arg, int what, size_t structsz, size_t *sizep) { From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 20:54:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 597A52CE; Fri, 21 Nov 2014 20:54:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C9C4A94; Fri, 21 Nov 2014 20:54:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALKsDcX031305; Fri, 21 Nov 2014 20:54:13 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALKsCd4031300; Fri, 21 Nov 2014 20:54:12 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201411212054.sALKsCd4031300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 21 Nov 2014 20:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274818 - head/sys/boot/fdt/dts/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 20:54:13 -0000 Author: brooks Date: Fri Nov 21 20:54:12 2014 New Revision: 274818 URL: https://svnweb.freebsd.org/changeset/base/274818 Log: Merge from CheriBSD (3422ebe71b6c06fe78b1be73623b240c219e08e3): Rename beripic to beripic0. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/boot/fdt/dts/mips/beri-sim.dts head/sys/boot/fdt/dts/mips/beripad-de4.dts Modified: head/sys/boot/fdt/dts/mips/beri-sim.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-sim.dts Fri Nov 21 20:53:17 2014 (r274817) +++ head/sys/boot/fdt/dts/mips/beri-sim.dts Fri Nov 21 20:54:12 2014 (r274818) @@ -97,7 +97,7 @@ reg = <0x0 0x4000000>; // 64M at 0x0 }; - beripic: beripic@7f804000 { + beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; interrupt-controller; #address-cells = <0>; @@ -115,7 +115,7 @@ compatible = "altera,jtag_uart-11_0"; reg = <0x7f000000 0x40>; interrupts = <0>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; serial@7f001000 { Modified: head/sys/boot/fdt/dts/mips/beripad-de4.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beripad-de4.dts Fri Nov 21 20:53:17 2014 (r274817) +++ head/sys/boot/fdt/dts/mips/beripad-de4.dts Fri Nov 21 20:54:12 2014 (r274818) @@ -97,7 +97,7 @@ reg = <0x0 0x40000000>; // 1G at 0x0 }; - beripic: beripic@7f804000 { + beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; interrupt-controller; #address-cells = <0>; @@ -117,14 +117,14 @@ reg-shift = <2>; clock-frequency = <50000000>; interrupts = <6>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; serial@7f000000 { compatible = "altera,jtag_uart-11_0"; reg = <0x7f000000 0x40>; interrupts = <0>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; serial@7f001000 { @@ -198,7 +198,7 @@ 0x7f007420 0x20>; // RX, TX interrupts = <1 2>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; ethernet@7f005000 { @@ -211,7 +211,7 @@ 0x7f005420 0x20>; // RX, TX interrupts = <11 12>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; touchscreen@70400000 { @@ -227,7 +227,7 @@ 0x7f140000 0x4>; // IRQ 4 is DC, IRQ 5 is HC. interrupts = <4 5>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; avgen@0x7f009000 { From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 21:01:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6483070F; Fri, 21 Nov 2014 21:01:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D04EBA7; Fri, 21 Nov 2014 21:01:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALL1YUN036161; Fri, 21 Nov 2014 21:01:34 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALL1P6b035930; Fri, 21 Nov 2014 21:01:25 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201411212101.sALL1P6b035930@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 21 Nov 2014 21:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274819 - in head/sys: cam dev/advansys dev/aha dev/ahb dev/ahci dev/aic dev/arcmsr dev/asr dev/buslogic dev/ciss dev/dpt dev/firewire dev/glxiic dev/hpt27xx dev/hptnr dev/hptrr dev/hyp... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 21:01:34 -0000 Author: smh Date: Fri Nov 21 21:01:24 2014 New Revision: 274819 URL: https://svnweb.freebsd.org/changeset/base/274819 Log: Prevent overflow issues in timeout processing Previously, any timeout value for which (timeout * hz) will overflow the signed integer, will give weird results, since callout(9) routines will convert negative values of ticks to '1'. For unsigned integer overflow we will get sufficiently smaller timeout values than expected. Switch from callout_reset, which requires conversion to int based ticks to callout_reset_sbt to avoid this. Also correct isci to correctly resolve ccb timeout. This was based on the original work done by Eygene Ryabinkin back in 5 Aug 2011 which used a macro to help avoid the overlow. Differential Revision: https://reviews.freebsd.org/D1157 Reviewed by: mav, davide MFC after: 1 month Sponsored by: Multiplay Modified: head/sys/cam/cam_xpt.c head/sys/dev/advansys/advansys.c head/sys/dev/advansys/adwcam.c head/sys/dev/aha/aha.c head/sys/dev/ahb/ahb.c head/sys/dev/ahci/ahci.c head/sys/dev/aic/aic.c head/sys/dev/arcmsr/arcmsr.c head/sys/dev/asr/asr.c head/sys/dev/buslogic/bt.c head/sys/dev/ciss/ciss.c head/sys/dev/dpt/dpt_scsi.c head/sys/dev/firewire/sbp.c head/sys/dev/glxiic/glxiic.c head/sys/dev/hpt27xx/hpt27xx_os_bsd.c head/sys/dev/hptnr/hptnr_os_bsd.c head/sys/dev/hptrr/hptrr_os_bsd.c head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/iir/iir.c head/sys/dev/isci/isci_io_request.c head/sys/dev/isci/isci_timer.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mps/mps_sas.c head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_cam.c head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mvs/mvs.c head/sys/dev/siis/siis.c head/sys/dev/sym/sym_hipd.c head/sys/dev/trm/trm.c head/sys/dev/tws/tws_cam.c head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/cam/cam_xpt.c Fri Nov 21 21:01:24 2014 (r274819) @@ -2893,9 +2893,9 @@ call_sim: start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; } - callout_reset(&dev->callout, - (crs->release_timeout * hz) / 1000, - xpt_release_devq_timeout, dev); + callout_reset_sbt(&dev->callout, + SBT_1MS * crs->release_timeout, 0, + xpt_release_devq_timeout, dev, 0); dev->flags |= CAM_DEV_REL_TIMEOUT_PENDING; @@ -4944,8 +4944,8 @@ xpt_config(void *arg) periphdriver_init(1); xpt_hold_boot(); callout_init(&xsoftc.boot_callout, 1); - callout_reset(&xsoftc.boot_callout, hz * xsoftc.boot_delay / 1000, - xpt_boot_delay, NULL); + callout_reset_sbt(&xsoftc.boot_callout, SBT_1MS * xsoftc.boot_delay, 0, + xpt_boot_delay, NULL, 0); /* Fire up rescan thread. */ if (kproc_kthread_add(xpt_scanner_thread, NULL, &cam_proc, NULL, 0, 0, "cam", "scanner")) { Modified: head/sys/dev/advansys/advansys.c ============================================================================== --- head/sys/dev/advansys/advansys.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/advansys/advansys.c Fri Nov 21 21:01:24 2014 (r274819) @@ -168,9 +168,9 @@ adv_clear_state_really(struct adv_softc ccb_h = LIST_FIRST(&adv->pending_ccbs); while (ccb_h != NULL) { cinfo = ccb_h->ccb_cinfo_ptr; - callout_reset(&cinfo->timer, - ccb_h->timeout * hz / 1000, adv_timeout, - ccb_h); + callout_reset_sbt(&cinfo->timer, + SBT_1MS * ccb_h->timeout, 0, + adv_timeout, ccb_h, 0); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } adv->state &= ~ADV_IN_TIMEOUT; @@ -569,8 +569,8 @@ adv_execute_ccb(void *arg, bus_dma_segme ccb_h->status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&adv->pending_ccbs, ccb_h, sim_links.le); /* Schedule our timeout */ - callout_reset(&cinfo->timer, ccb_h->timeout * hz /1000, adv_timeout, - csio); + callout_reset_sbt(&cinfo->timer, SBT_1MS * ccb_h->timeout, 0, + adv_timeout, csio, 0); } static struct adv_ccb_info * Modified: head/sys/dev/advansys/adwcam.c ============================================================================== --- head/sys/dev/advansys/adwcam.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/advansys/adwcam.c Fri Nov 21 21:01:24 2014 (r274819) @@ -322,8 +322,8 @@ adwexecuteacb(void *arg, bus_dma_segment acb->state |= ACB_ACTIVE; ccb->ccb_h.status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&adw->pending_ccbs, &ccb->ccb_h, sim_links.le); - callout_reset(&acb->timer, (ccb->ccb_h.timeout * hz) / 1000, - adwtimeout, acb); + callout_reset_sbt(&acb->timer, SBT_1MS * ccb->ccb_h.timeout, 0, + adwtimeout, acb, 0); adw_send_acb(adw, acb, acbvtob(adw, acb)); } Modified: head/sys/dev/aha/aha.c ============================================================================== --- head/sys/dev/aha/aha.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/aha/aha.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1047,8 +1047,8 @@ ahaexecuteccb(void *arg, bus_dma_segment ccb->ccb_h.status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&aha->pending_ccbs, &ccb->ccb_h, sim_links.le); - callout_reset(&accb->timer, (ccb->ccb_h.timeout * hz) / 1000, - ahatimeout, accb); + callout_reset_sbt(&accb->timer, SBT_1MS * ccb->ccb_h.timeout, 0, + ahatimeout, accb, 0); /* Tell the adapter about this command */ if (aha->cur_outbox->action_code != AMBO_FREE) { @@ -1181,9 +1181,9 @@ ahadone(struct aha_softc *aha, struct ah ccb_h = LIST_NEXT(ccb_h, sim_links.le); ahadone(aha, pending_accb, AMBI_ERROR); } else { - callout_reset(&pending_accb->timer, - (ccb_h->timeout * hz) / 1000, - ahatimeout, pending_accb); + callout_reset_sbt(&pending_accb->timer, + SBT_1MS * ccb_h->timeout, 0, ahatimeout, + pending_accb, 0); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } } Modified: head/sys/dev/ahb/ahb.c ============================================================================== --- head/sys/dev/ahb/ahb.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/ahb/ahb.c Fri Nov 21 21:01:24 2014 (r274819) @@ -616,9 +616,9 @@ ahbhandleimmed(struct ahb_softc *ahb, u_ xpt_done(ccb); } else if (ahb->immed_ecb != NULL) { /* Re-instate timeout */ - callout_reset(&pending_ecb->timer, - (ccb->ccb_h.timeout * hz) / 1000, - ahbtimeout, pending_ecb); + callout_reset_sbt(&pending_ecb->timer, + SBT_1MS * ccb->ccb_h.timeout, 0, ahbtimeout, + pending_ecb, 0); } } @@ -985,8 +985,8 @@ ahbexecuteecb(void *arg, bus_dma_segment /* Tell the adapter about this command */ ahbqueuembox(ahb, ecb_paddr, ATTN_STARTECB|ccb->ccb_h.target_id); - callout_reset(&ecb->timer, (ccb->ccb_h.timeout * hz) / 1000, ahbtimeout, - ecb); + callout_reset_sbt(&ecb->timer, SBT_1MS * ccb->ccb_h.timeout, 0, + ahbtimeout, ecb, 0); } static void Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/ahci/ahci.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1582,8 +1582,8 @@ ahci_execute_transaction(struct ahci_slo return; } /* Start command execution timeout */ - callout_reset(&slot->timeout, (int)ccb->ccb_h.timeout * hz / 2000, - (timeout_t*)ahci_timeout, slot); + callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout / 2, + 0, (timeout_t*)ahci_timeout, slot, 0); return; } @@ -1618,9 +1618,9 @@ ahci_rearm_timeout(struct ahci_channel * continue; if ((ch->toslots & (1 << i)) == 0) continue; - callout_reset(&slot->timeout, - (int)slot->ccb->ccb_h.timeout * hz / 2000, - (timeout_t*)ahci_timeout, slot); + callout_reset_sbt(&slot->timeout, + SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0, + (timeout_t*)ahci_timeout, slot, 0); } } @@ -1652,9 +1652,9 @@ ahci_timeout(struct ahci_slot *slot) slot->state = AHCI_SLOT_EXECUTING; } - callout_reset(&slot->timeout, - (int)slot->ccb->ccb_h.timeout * hz / 2000, - (timeout_t*)ahci_timeout, slot); + callout_reset_sbt(&slot->timeout, + SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0, + (timeout_t*)ahci_timeout, slot, 0); return; } Modified: head/sys/dev/aic/aic.c ============================================================================== --- head/sys/dev/aic/aic.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/aic/aic.c Fri Nov 21 21:01:24 2014 (r274819) @@ -319,8 +319,8 @@ aic_execute_scb(void *arg, bus_dma_segme ccb->ccb_h.status |= CAM_SIM_QUEUED; TAILQ_INSERT_TAIL(&aic->pending_ccbs, &ccb->ccb_h, sim_links.tqe); - callout_reset(&scb->timer, (ccb->ccb_h.timeout * hz) / 1000, - aic_timeout, scb); + callout_reset_sbt(&scb->timer, SBT_1MS * ccb->ccb_h.timeout, 0, + aic_timeout, scb, 0); aic_start(aic); } @@ -1075,9 +1075,9 @@ aic_done(struct aic_softc *aic, struct a &pending_scb->ccb->ccb_h, sim_links.tqe); aic_done(aic, pending_scb); } else { - callout_reset(&pending_scb->timer, - (ccb_h->timeout * hz) / 1000, aic_timeout, - pending_scb); + callout_reset_sbt(&pending_scb->timer, + SBT_1MS * ccb_h->timeout, 0, aic_timeout, + pending_scb, 0); ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); } } @@ -1094,9 +1094,9 @@ aic_done(struct aic_softc *aic, struct a &nexus_scb->ccb->ccb_h, sim_links.tqe); aic_done(aic, nexus_scb); } else { - callout_reset(&nexus_scb->timer, - (ccb_h->timeout * hz) / 1000, aic_timeout, - nexus_scb); + callout_reset_sbt(&nexus_scb->timer, + SBT_1MS * ccb_h->timeout, 0, aic_timeout, + nexus_scb, 0); ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); } } Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/arcmsr/arcmsr.c Fri Nov 21 21:01:24 2014 (r274819) @@ -2705,7 +2705,9 @@ static void arcmsr_execute_srb(void *arg if (pccb->ccb_h.timeout != CAM_TIME_INFINITY) { arcmsr_callout_init(&srb->ccb_callout); - callout_reset(&srb->ccb_callout, ((pccb->ccb_h.timeout + (ARCMSR_TIMEOUT_DELAY * 1000)) * hz) / 1000, arcmsr_srb_timeout, srb); + callout_reset_sbt(&srb->ccb_callout, SBT_1MS * + (pccb->ccb_h.timeout + (ARCMSR_TIMEOUT_DELAY * 1000)), 0, + arcmsr_srb_timeout, srb, 0); srb->srb_flags |= SRB_FLAG_TIMER_START; } } Modified: head/sys/dev/asr/asr.c ============================================================================== --- head/sys/dev/asr/asr.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/asr/asr.c Fri Nov 21 21:01:24 2014 (r274819) @@ -386,8 +386,12 @@ static STAILQ_HEAD(, Asr_softc) Asr_soft STAILQ_HEAD_INITIALIZER(Asr_softc_list); static __inline void -set_ccb_timeout_ch(union asr_ccb *ccb, struct callout_handle ch) +set_ccb_timeout_ch(union asr_ccb *ccb) { + struct callout_handle ch; + + ch = timeout(asr_timeout, (caddr_t)ccb, + (int)((u_int64_t)(ccb->ccb_h.timeout) * (u_int32_t)hz / 1000)); ccb->ccb_h.sim_priv.entries[0].ptr = ch.callout; } @@ -812,8 +816,7 @@ ASR_ccbAdd(Asr_softc_t *sc, union asr_cc */ ccb->ccb_h.timeout = 6 * 60 * 1000; } - set_ccb_timeout_ch(ccb, timeout(asr_timeout, (caddr_t)ccb, - (ccb->ccb_h.timeout * hz) / 1000)); + set_ccb_timeout_ch(ccb); } splx(s); } /* ASR_ccbAdd */ @@ -1337,9 +1340,7 @@ asr_timeout(void *arg) cam_sim_unit(xpt_path_sim(ccb->ccb_h.path)), s); if (ASR_reset (sc) == ENXIO) { /* Try again later */ - set_ccb_timeout_ch(ccb, timeout(asr_timeout, - (caddr_t)ccb, - (ccb->ccb_h.timeout * hz) / 1000)); + set_ccb_timeout_ch(ccb); } return; } @@ -1353,9 +1354,7 @@ asr_timeout(void *arg) if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_CMD_TIMEOUT) { debug_asr_printf (" AGAIN\nreinitializing adapter\n"); if (ASR_reset (sc) == ENXIO) { - set_ccb_timeout_ch(ccb, timeout(asr_timeout, - (caddr_t)ccb, - (ccb->ccb_h.timeout * hz) / 1000)); + set_ccb_timeout_ch(ccb); } splx(s); return; @@ -1364,8 +1363,7 @@ asr_timeout(void *arg) /* If the BUS reset does not take, then an adapter reset is next! */ ccb->ccb_h.status &= ~CAM_STATUS_MASK; ccb->ccb_h.status |= CAM_CMD_TIMEOUT; - set_ccb_timeout_ch(ccb, timeout(asr_timeout, (caddr_t)ccb, - (ccb->ccb_h.timeout * hz) / 1000)); + set_ccb_timeout_ch(ccb); ASR_resetBus (sc, cam_sim_bus(xpt_path_sim(ccb->ccb_h.path))); xpt_async (AC_BUS_RESET, ccb->ccb_h.path, NULL); splx(s); Modified: head/sys/dev/buslogic/bt.c ============================================================================== --- head/sys/dev/buslogic/bt.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/buslogic/bt.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1465,8 +1465,8 @@ btexecuteccb(void *arg, bus_dma_segment_ ccb->ccb_h.status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&bt->pending_ccbs, &ccb->ccb_h, sim_links.le); - callout_reset(&bccb->timer, (ccb->ccb_h.timeout * hz) / 1000, - bttimeout, bccb); + callout_reset_sbt(&bccb->timer, SBT_1MS * ccb->ccb_h.timeout, 0, + bttimeout, bccb, 0); /* Tell the adapter about this command */ bt->cur_outbox->ccb_addr = btccbvtop(bt, bccb); @@ -1600,9 +1600,9 @@ btdone(struct bt_softc *bt, struct bt_cc ccb_h = LIST_NEXT(ccb_h, sim_links.le); btdone(bt, pending_bccb, BMBI_ERROR); } else { - callout_reset(&pending_bccb->timer, - (ccb_h->timeout * hz) / 1000, - bttimeout, pending_bccb); + callout_reset_sbt(&pending_bccb->timer, + SBT_1MS * ccb_h->timeout, 0, bttimeout, + pending_bccb, 0); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } } Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/ciss/ciss.c Fri Nov 21 21:01:24 2014 (r274819) @@ -2414,7 +2414,8 @@ ciss_wait_request(struct ciss_request *c return(error); while ((cr->cr_flags & CISS_REQ_SLEEP) && (error != EWOULDBLOCK)) { - error = msleep(cr, &cr->cr_sc->ciss_mtx, PRIBIO, "cissREQ", (timeout * hz) / 1000); + error = msleep_sbt(cr, &cr->cr_sc->ciss_mtx, PRIBIO, "cissREQ", + SBT_1MS * timeout, 0, 0); } return(error); } Modified: head/sys/dev/dpt/dpt_scsi.c ============================================================================== --- head/sys/dev/dpt/dpt_scsi.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/dpt/dpt_scsi.c Fri Nov 21 21:01:24 2014 (r274819) @@ -793,8 +793,8 @@ dptexecuteccb(void *arg, bus_dma_segment dccb->state |= DCCB_ACTIVE; ccb->ccb_h.status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&dpt->pending_ccb_list, &ccb->ccb_h, sim_links.le); - callout_reset(&dccb->timer, (ccb->ccb_h.timeout * hz) / 1000, - dpttimeout, dccb); + callout_reset_sbt(&dccb->timer, SBT_1MS * ccb->ccb_h.timeout, 0, + dpttimeout, dccb, 0); if (dpt_send_eata_command(dpt, &dccb->eata_ccb, dccb->eata_ccb.cp_busaddr, EATA_CMD_DMA_SEND_CP, 0, 0, 0, 0) != 0) { Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/firewire/sbp.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1028,8 +1028,8 @@ static __inline void sbp_scan_dev(struct sbp_dev *sdev) { sdev->status = SBP_DEV_PROBE; - callout_reset(&sdev->target->scan_callout, scan_delay * hz / 1000, - sbp_cam_scan_target, (void *)sdev->target); + callout_reset_sbt(&sdev->target->scan_callout, SBT_1MS * scan_delay, 0, + sbp_cam_scan_target, (void *)sdev->target, 0); } static void @@ -1397,7 +1397,7 @@ END_DEBUG start: target->mgm_ocb_cur = ocb; - callout_reset(&target->mgm_ocb_timeout, 5*hz, + callout_reset(&target->mgm_ocb_timeout, 5 * hz, sbp_mgm_timeout, (caddr_t)ocb); xfer = sbp_write_cmd(sdev, FWTCODE_WREQB, 0); if (xfer == NULL) { @@ -2699,9 +2699,11 @@ END_DEBUG prev2 = prev = STAILQ_LAST(&sdev->ocbs, sbp_ocb, ocb); STAILQ_INSERT_TAIL(&sdev->ocbs, ocb, ocb); - if (ocb->ccb != NULL) - callout_reset(&ocb->timer, (ocb->ccb->ccb_h.timeout * hz) / 1000, - sbp_timeout, ocb); + if (ocb->ccb != NULL) { + callout_reset_sbt(&ocb->timer, + SBT_1MS * ocb->ccb->ccb_h.timeout, 0, sbp_timeout, + ocb, 0); + } if (use_doorbell && prev == NULL) prev2 = sdev->last_ocb; Modified: head/sys/dev/glxiic/glxiic.c ============================================================================== --- head/sys/dev/glxiic/glxiic.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/glxiic/glxiic.c Fri Nov 21 21:01:24 2014 (r274819) @@ -559,8 +559,8 @@ glxiic_start_timeout_locked(struct glxii GLXIIC_ASSERT_LOCKED(sc); - callout_reset(&sc->callout, sc->timeout * 1000 / hz, glxiic_timeout, - sc); + callout_reset_sbt(&sc->callout, SBT_1MS * sc->timeout, 0, + glxiic_timeout, sc, 0); } static void Modified: head/sys/dev/hpt27xx/hpt27xx_os_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Fri Nov 21 21:01:24 2014 (r274819) @@ -240,8 +240,8 @@ void os_request_timer(void * osext, HPT HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS); - callout_reset(&vbus_ext->timer, interval * hz / 1000000, - os_timer_for_ldm, vbus_ext); + callout_reset_sbt(&vbus_ext->timer, SBT_1US * interval, 0, + os_timer_for_ldm, vbus_ext, 0); } HPT_TIME os_query_time(void) Modified: head/sys/dev/hptnr/hptnr_os_bsd.c ============================================================================== --- head/sys/dev/hptnr/hptnr_os_bsd.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/hptnr/hptnr_os_bsd.c Fri Nov 21 21:01:24 2014 (r274819) @@ -235,8 +235,8 @@ void os_request_timer(void * osext, HPT HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS); - callout_reset(&vbus_ext->timer, interval * hz / 1000000, - os_timer_for_ldm, vbus_ext); + callout_reset_sbt(&vbus_ext->timer, SBT_1US * interval, 0, + os_timer_for_ldm, vbus_ext, 0); } HPT_TIME os_query_time(void) Modified: head/sys/dev/hptrr/hptrr_os_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_os_bsd.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/hptrr/hptrr_os_bsd.c Fri Nov 21 21:01:24 2014 (r274819) @@ -221,8 +221,8 @@ void os_request_timer(void * osext, HPT HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS); - callout_reset(&vbus_ext->timer, interval * hz / 1000000, - os_timer_for_ldm, vbus_ext); + callout_reset_sbt(&vbus_ext->timer, SBT_1US * interval, 0, + os_timer_for_ldm, vbus_ext, 0); } HPT_TIME os_query_time(void) Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Nov 21 21:01:24 2014 (r274819) @@ -983,9 +983,8 @@ storvsc_timeout(void *arg) mtx_unlock(&sc->hs_lock); reqp->retries++; - callout_reset(&reqp->callout, - (ccb->ccb_h.timeout * hz) / 1000, - storvsc_timeout, reqp); + callout_reset_sbt(&reqp->callout, SBT_1MS * ccb->ccb_h.timeout, + 0, storvsc_timeout, reqp, 0); #if HVS_TIMEOUT_TEST storvsc_timeout_test(reqp, SEND_DIAGNOSTIC, 0); #endif @@ -1158,9 +1157,9 @@ storvsc_action(struct cam_sim *sim, unio if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { callout_init(&reqp->callout, CALLOUT_MPSAFE); - callout_reset(&reqp->callout, - (ccb->ccb_h.timeout * hz) / 1000, - storvsc_timeout, reqp); + callout_reset_sbt(&reqp->callout, + SBT_1MS * ccb->ccb_h.timeout, 0, + storvsc_timeout, reqp, 0); #if HVS_TIMEOUT_TEST cv_init(&reqp->event.cv, "storvsc timeout cv"); mtx_init(&reqp->event.mtx, "storvsc timeout mutex", Modified: head/sys/dev/iir/iir.c ============================================================================== --- head/sys/dev/iir/iir.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/iir/iir.c Fri Nov 21 21:01:24 2014 (r274819) @@ -267,7 +267,7 @@ iir_init(struct gdt_softc *gdt) &gccb->gc_dmamap) != 0) return(1); gccb->gc_map_flag = TRUE; - gccb->gc_scratch = &gdt->sc_gcscratch[GDT_SCRATCH_SZ * i]; + gccb->gc_scratch = &gdt->sc_gcscratch[GDT_SCRATCH_SZ * i]; gccb->gc_scratch_busbase = gdt->sc_gcscratch_busbase + GDT_SCRATCH_SZ * i; callout_init_mtx(&gccb->gc_timeout, &gdt->sc_lock, 0); SLIST_INSERT_HEAD(&gdt->sc_free_gccb, gccb, sle); @@ -1234,8 +1234,8 @@ gdtexecuteccb(void *arg, bus_dma_segment ccb->ccb_h.status |= CAM_SIM_QUEUED; /* timeout handling */ - callout_reset(&gccb->gc_timeout, (ccb->ccb_h.timeout * hz) / 1000, - iir_timeout, gccb); + callout_reset_sbt(&gccb->gc_timeout, SBT_1MS * ccb->ccb_h.timeout, 0, + iir_timeout, (caddr_t)gccb, 0); gdt->sc_copy_cmd(gdt, gccb); } Modified: head/sys/dev/isci/isci_io_request.c ============================================================================== --- head/sys/dev/isci/isci_io_request.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/isci/isci_io_request.c Fri Nov 21 21:01:24 2014 (r274819) @@ -731,8 +731,9 @@ isci_io_request_construct(void *arg, bus } if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) - callout_reset(&io_request->parent.timer, ccb->ccb_h.timeout, - isci_io_request_timeout, io_request); + callout_reset_sbt(&io_request->parent.timer, + SBT_1MS * ccb->ccb_h.timeout, 0, isci_io_request_timeout, + io_request, 0); } void @@ -983,7 +984,8 @@ isci_io_request_execute_smp_io(union ccb } if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) - callout_reset(&io_request->parent.timer, ccb->ccb_h.timeout, - isci_io_request_timeout, request); + callout_reset_sbt(&io_request->parent.timer, + SBT_1MS * ccb->ccb_h.timeout, 0, isci_io_request_timeout, + request, 0); } #endif Modified: head/sys/dev/isci/isci_timer.c ============================================================================== --- head/sys/dev/isci/isci_timer.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/isci/isci_timer.c Fri Nov 21 21:01:24 2014 (r274819) @@ -79,8 +79,8 @@ scif_cb_timer_start(SCI_CONTROLLER_HANDL isci_timer->is_started = TRUE; isci_log_message(3, "TIMER", "start %p %d\n", timer, milliseconds); - callout_reset(&isci_timer->callout, (milliseconds * hz)/1000, - isci_timer_timeout, timer); + callout_reset_sbt(&isci_timer->callout, SBT_1MS * milliseconds, 0, + isci_timer_timeout, timer, 0); } /** Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/mpr/mpr_sas.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1903,8 +1903,8 @@ mprsas_action_scsiio(struct mprsas_softc cm->cm_desc.SCSIIO.DevHandle = htole16(targ->handle); } - callout_reset(&cm->cm_callout, (ccb->ccb_h.timeout * hz) / 1000, - mprsas_scsiio_timeout, cm); + callout_reset_sbt(&cm->cm_callout, SBT_1MS * ccb->ccb_h.timeout, 0, + mprsas_scsiio_timeout, cm, 0); targ->issued++; targ->outstanding++; Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/mps/mps_sas.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1839,8 +1839,8 @@ mpssas_action_scsiio(struct mpssas_softc } } - callout_reset(&cm->cm_callout, (ccb->ccb_h.timeout * hz) / 1000, - mpssas_scsiio_timeout, cm); + callout_reset_sbt(&cm->cm_callout, SBT_1MS * ccb->ccb_h.timeout, 0, + mpssas_scsiio_timeout, cm, 0); targ->issued++; targ->outstanding++; Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/mpt/mpt.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1320,17 +1320,19 @@ mpt_wait_req(struct mpt_softc *mpt, requ mpt_req_state_t state, mpt_req_state_t mask, int sleep_ok, int time_ms) { - int error; int timeout; u_int saved_cnt; + sbintime_t sbt; /* - * timeout is in ms. 0 indicates infinite wait. - * Convert to ticks or 500us units depending on + * time_ms is in ms, 0 indicates infinite wait. + * Convert to sbintime_t or 500us units depending on * our sleep mode. */ if (sleep_ok != 0) { - timeout = (time_ms * hz) / 1000; + sbt = SBT_1MS * time_ms; + /* Set timeout as well so final timeout check works. */ + timeout = time_ms; } else { timeout = time_ms * 2; } @@ -1339,8 +1341,8 @@ mpt_wait_req(struct mpt_softc *mpt, requ saved_cnt = mpt->reset_cnt; while ((req->state & mask) != state && mpt->reset_cnt == saved_cnt) { if (sleep_ok != 0) { - error = mpt_sleep(mpt, req, PUSER, "mptreq", timeout); - if (error == EWOULDBLOCK) { + if (mpt_sleep(mpt, req, PUSER, "mptreq", sbt) == + EWOULDBLOCK) { timeout = 0; break; } Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/mpt/mpt.h Fri Nov 21 21:01:24 2014 (r274819) @@ -771,10 +771,10 @@ mpt_assign_serno(struct mpt_softc *mpt, #define MPT_UNLOCK(mpt) mtx_unlock(&(mpt)->mpt_lock) #define MPT_OWNED(mpt) mtx_owned(&(mpt)->mpt_lock) #define MPT_LOCK_ASSERT(mpt) mtx_assert(&(mpt)->mpt_lock, MA_OWNED) -#define mpt_sleep(mpt, ident, priority, wmesg, timo) \ - msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) -#define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)) +#define mpt_sleep(mpt, ident, priority, wmesg, sbt) \ + msleep_sbt(ident, &(mpt)->mpt_lock, priority, wmesg, sbt, 0, 0) +#define mpt_req_timeout(req, sbt, func, arg) \ + callout_reset_sbt(&(req)->callout, (sbt), 0, (func), (arg), 0) #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) #define mpt_callout_init(mpt, c) \ Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/mpt/mpt_cam.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1630,7 +1630,7 @@ out: ccb->ccb_h.status |= CAM_SIM_QUEUED; if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { - mpt_req_timeout(req, (ccb->ccb_h.timeout * hz) / 1000, + mpt_req_timeout(req, SBT_1MS * ccb->ccb_h.timeout, mpt_timeout, ccb); } if (mpt->verbose > MPT_PRT_DEBUG) { @@ -2016,7 +2016,7 @@ out: ccb->ccb_h.status |= CAM_SIM_QUEUED; if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { - mpt_req_timeout(req, (ccb->ccb_h.timeout * hz) / 1000, + mpt_req_timeout(req, SBT_1MS * ccb->ccb_h.timeout, mpt_timeout, ccb); } if (mpt->verbose > MPT_PRT_DEBUG) { @@ -4752,7 +4752,7 @@ mpt_scsi_tgt_status(struct mpt_softc *mp req->serno, tgt->resid); if (ccb) { ccb->ccb_h.status = CAM_SIM_QUEUED | CAM_REQ_INPROG; - mpt_req_timeout(req, 60 * hz, mpt_timeout, ccb); + mpt_req_timeout(req, SBT_1S * 60, mpt_timeout, ccb); } mpt_send_cmd(mpt, req); } Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/mrsas/mrsas_cam.c Fri Nov 21 21:01:24 2014 (r274819) @@ -378,8 +378,8 @@ mrsas_scsiio_timeout(void *data) * on OCR enable/disable property of Controller from ocr_thread * context. */ - callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, - mrsas_scsiio_timeout, cmd); + callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, + mrsas_scsiio_timeout, cmd, 0); sc->do_timedout_reset = 1; if (sc->ocr_thread_active) wakeup(&sc->ocr_chan); @@ -530,8 +530,8 @@ mrsas_startio(struct mrsas_softc *sc, st /* * Start timer for IO timeout. Default timeout value is 90 second. */ - callout_reset(&cmd->cm_callout, (sc->mrsas_io_timeout * hz) / 1000, - mrsas_scsiio_timeout, cmd); + callout_reset_sbt(&cmd->cm_callout, SBT_1MS * sc->mrsas_io_timeout, 0, + mrsas_scsiio_timeout, cmd, 0); mrsas_atomic_inc(&sc->fw_outstanding); if (mrsas_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater) Modified: head/sys/dev/mvs/mvs.c ============================================================================== --- head/sys/dev/mvs/mvs.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/mvs/mvs.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1415,8 +1415,8 @@ mvs_legacy_execute_transaction(struct mv } } /* Start command execution timeout */ - callout_reset(&slot->timeout, (int)ccb->ccb_h.timeout * hz / 1000, - (timeout_t*)mvs_timeout, slot); + callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0, + (timeout_t*)mvs_timeout, slot, 0); } /* Must be called with channel locked. */ @@ -1529,8 +1529,8 @@ mvs_execute_transaction(struct mvs_slot ATA_OUTL(ch->r_mem, EDMA_REQQIP, ch->dma.workrq_bus + MVS_CRQB_OFFSET + (MVS_CRQB_SIZE * ch->out_idx)); /* Start command execution timeout */ - callout_reset(&slot->timeout, (int)ccb->ccb_h.timeout * hz / 1000, - (timeout_t*)mvs_timeout, slot); + callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0, + (timeout_t*)mvs_timeout, slot, 0); return; } @@ -1567,9 +1567,9 @@ mvs_rearm_timeout(device_t dev) continue; if ((ch->toslots & (1 << i)) == 0) continue; - callout_reset(&slot->timeout, - (int)slot->ccb->ccb_h.timeout * hz / 2000, - (timeout_t*)mvs_timeout, slot); + callout_reset_sbt(&slot->timeout, + SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0, + (timeout_t*)mvs_timeout, slot, 0); } } Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/siis/siis.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1120,8 +1120,8 @@ siis_execute_transaction(struct siis_slo ATA_OUTL(ch->r_mem, SIIS_P_CACTL(slot->slot), prb_bus); ATA_OUTL(ch->r_mem, SIIS_P_CACTH(slot->slot), prb_bus >> 32); /* Start command execution timeout */ - callout_reset(&slot->timeout, (int)ccb->ccb_h.timeout * hz / 1000, - (timeout_t*)siis_timeout, slot); + callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0, + (timeout_t*)siis_timeout, slot, 0); return; } @@ -1162,9 +1162,9 @@ siis_rearm_timeout(device_t dev) continue; if ((ch->toslots & (1 << i)) == 0) continue; - callout_reset(&slot->timeout, - (int)slot->ccb->ccb_h.timeout * hz / 1000, - (timeout_t*)siis_timeout, slot); + callout_reset_sbt(&slot->timeout, + SBT_1MS * slot->ccb->ccb_h.timeout, 0, + (timeout_t*)siis_timeout, slot, 0); } } Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/sym/sym_hipd.c Fri Nov 21 21:01:24 2014 (r274819) @@ -2329,8 +2329,8 @@ static void sym_enqueue_cam_ccb(ccb_p cp assert(!(ccb->ccb_h.status & CAM_SIM_QUEUED)); ccb->ccb_h.status = CAM_REQ_INPROG; - callout_reset(&cp->ch, ccb->ccb_h.timeout * hz / 1000, sym_callout, - (caddr_t) ccb); + callout_reset_sbt(&cp->ch, SBT_1MS * ccb->ccb_h.timeout, 0, sym_callout, + (caddr_t)ccb, 0); ccb->ccb_h.status |= CAM_SIM_QUEUED; ccb->ccb_h.sym_hcb_ptr = np; Modified: head/sys/dev/trm/trm.c ============================================================================== --- head/sys/dev/trm/trm.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/trm/trm.c Fri Nov 21 21:01:24 2014 (r274819) @@ -473,10 +473,6 @@ trm_ExecuteSRB(void *arg, bus_dma_segmen return; } ccb->ccb_h.status |= CAM_SIM_QUEUED; -#if 0 - /* XXX Need a timeout handler */ - ccb->ccb_h.timeout_ch = timeout(trmtimeout, (caddr_t)srb, (ccb->ccb_h.timeout * hz) / 1000); -#endif trm_SendSRB(pACB, pSRB); splx(flags); return; Modified: head/sys/dev/tws/tws_cam.c ============================================================================== --- head/sys/dev/tws/tws_cam.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/tws/tws_cam.c Fri Nov 21 21:01:24 2014 (r274819) @@ -747,7 +747,8 @@ tws_execute_scsi(struct tws_softc *sc, u * and submit the I/O. */ sc->stats.scsi_ios++; - callout_reset(&req->timeout, (ccb_h->timeout * hz) / 1000, tws_timeout, req); + callout_reset_sbt(&req->timeout, SBT_1MS * ccb->ccb_h.timeout, 0, + tws_timeout, req, 0); error = tws_map_request(sc, req); return(error); } Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Fri Nov 21 20:54:12 2014 (r274818) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Fri Nov 21 21:01:24 2014 (r274819) @@ -1087,8 +1087,8 @@ vtscsi_execute_scsi_cmd(struct vtscsi_so if (ccbh->timeout != CAM_TIME_INFINITY) { req->vsr_flags |= VTSCSI_REQ_FLAG_TIMEOUT_SET; - callout_reset(&req->vsr_callout, ccbh->timeout * hz / 1000, - vtscsi_timedout_scsi_cmd, req); + callout_reset_sbt(&req->vsr_callout, SBT_1MS * ccbh->timeout, + 0, vtscsi_timedout_scsi_cmd, req, 0); } vtscsi_dprintf_req(req, VTSCSI_TRACE, "enqueued req=%p ccb=%p\n", From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 21:09:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B88DFADC; Fri, 21 Nov 2014 21:09:04 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50514C0F; Fri, 21 Nov 2014 21:09:04 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 48D3BB93B; Fri, 21 Nov 2014 16:09:03 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r274817 - in head: contrib/binutils/binutils contrib/binutils/include/elf sys/amd64/amd64 sys/compat/ia32 sys/i386/i386 sys/i386/isa sys/kern sys/sys sys/x86/include usr.bin/gcore Date: Fri, 21 Nov 2014 15:58:16 -0500 Message-ID: <1545185.alPDtast85@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-PRERELEASE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201411212053.sALKrI34030713@svn.freebsd.org> References: <201411212053.sALKrI34030713@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 21 Nov 2014 16:09:03 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 21:09:05 -0000 On Friday, November 21, 2014 08:53:18 PM John Baldwin wrote: > Author: jhb > Date: Fri Nov 21 20:53:17 2014 > New Revision: 274817 > URL: https://svnweb.freebsd.org/changeset/base/274817 > > Log: > Improve support for XSAVE with debuggers. > - Dump an NT_X86_XSTATE note if XSAVE is in use. This note is designed > to match what Linux does in that 1) it dumps the entire XSAVE area > including the fxsave state, and 2) it stashes a copy of the current > xsave mask in the unused padding between the fxsave state and the > xstate header at the same location used by Linux. > - Teach readelf() to recognize NT_X86_XSTATE notes. > - Change PT_GET/SETXSTATE to take the entire XSAVE state instead of > only the extra portion. This avoids having to always make two > ptrace() calls to get or set the full XSAVE state. > - Add a PT_GET_XSTATE_INFO which returns the length of the current > XSTATE save area (so the size of the buffer needed for PT_GETXSTATE) > and the current XSAVE mask (%xcr0). > > Differential Revision: https://reviews.freebsd.org/D1193 > Reviewed by: kib > MFC after: 2 weeks I have modified GDB 7 to handle XSAVE (including AVX) for both amd64 and i386. I hope to get it upstreamed into the port (and hopefully to gdb itself at some point). You can find the changes at github/bsdjhb/gdb/freebsd-7.8-xsave if you are curious. I don't plan on merging this to the in-tree gdb at all as it doesn't have any notion of XSAVE at all (whereas for gdb7 I only had to add FreeBSD-specific bits). One other note is that the AVX gdb branch above does not work with threads. I have some other changes to simplify some of the thread code in gdb7 that needs to go in first before the AVX patches at which point AVX debugging should work with threads. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 21:10:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8DDED90; Fri, 21 Nov 2014 21:10:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 950E6C21; Fri, 21 Nov 2014 21:10:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALLA39b043275; Fri, 21 Nov 2014 21:10:03 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALLA3Cr043274; Fri, 21 Nov 2014 21:10:03 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201411212110.sALLA3Cr043274@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 21 Nov 2014 21:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274820 - head/sys/dev/altera/avgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 21:10:03 -0000 Author: brooks Date: Fri Nov 21 21:10:02 2014 New Revision: 274820 URL: https://svnweb.freebsd.org/changeset/base/274820 Log: Merge from CheriBSD (2e28d2a3090239b30481f35dc452ad95a5c57389) Remove initalized, but unused devname variable MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/dev/altera/avgen/altera_avgen.c Modified: head/sys/dev/altera/avgen/altera_avgen.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen.c Fri Nov 21 21:01:24 2014 (r274819) +++ head/sys/dev/altera/avgen/altera_avgen.c Fri Nov 21 21:10:02 2014 (r274820) @@ -321,7 +321,6 @@ altera_avgen_attach(struct altera_avgen_ const char *str_mmapio, const char *str_devname, int devunit) { device_t dev = sc->avg_dev; - char devname[SPECNAMELEN + 1]; int error; error = altera_avgen_process_options(sc, str_fileio, str_mmapio, @@ -329,18 +328,6 @@ altera_avgen_attach(struct altera_avgen_ if (error) return (error); - /* Select a device name. */ - if (str_devname != NULL) { - if (devunit != -1) - (void)snprintf(devname, sizeof(devname), "%s%d", - str_devname, devunit); - else - (void)snprintf(devname, sizeof(devname), "%s", - str_devname); - } else - snprintf(devname, sizeof(devname), "%s%d", "avgen", - sc->avg_unit); - if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { device_printf(dev, From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 21:14:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10254F11; Fri, 21 Nov 2014 21:14:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0988CCD; Fri, 21 Nov 2014 21:14:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALLE6PA048815; Fri, 21 Nov 2014 21:14:06 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALLE60G048808; Fri, 21 Nov 2014 21:14:06 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201411212114.sALLE60G048808@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 21 Nov 2014 21:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274821 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 21:14:07 -0000 Author: brooks Date: Fri Nov 21 21:14:05 2014 New Revision: 274821 URL: https://svnweb.freebsd.org/changeset/base/274821 Log: Merge from CheriBSD: commit d0c7d235c09fc65dbdb278e7016a96f79c6a49cc Make the Altera JTAG UART device driver slightly more forgiving of the foibles of a sub-par hrdware interface by increasing the timeout for spotting JTAG polling from one to two seconds. commit 19ed45a18832560dab967c179d83b71081c3a220 Update comment. commit 8edfe803f033cc8e33229f99894c2b7496a44d5f Add a comment about a device-driver race condition that could cause the BERI pipeline to wedge awaiting JTAG in the event that both the low-level console and the tty layer decide to write to the JTAG FIFO just before JTAG is disconnected. Resolving this race is a bit tricky as it looks like there isn't a way to 'give the character back' to the tty layer when we discover the race. The easy fix is to drop the character, which we don't yet do, but perhaps should as that is a better outcome than wedging the pipeline. commit 2ea26cf579c9defcf31e413e7c9b0fbc159237fc Add a comment about an inherent race with hardware in the Altera JTAG UART's low-level console code. Submitted by: rwatson MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c head/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c ============================================================================== --- head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c Fri Nov 21 21:10:02 2014 (r274820) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c Fri Nov 21 21:14:05 2014 (r274821) @@ -221,6 +221,9 @@ aju_cons_write(char ch) * disconnection. * * XXXRW: The polling delay may require tuning. + * + * XXXRW: Notice the inherent race with hardware: in clearing the + * bit, we may race with hardware setting the same bit. */ v = aju_cons_control_read(); if (v & ALTERA_JTAG_UART_CONTROL_AC) { Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c ============================================================================== --- head/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Fri Nov 21 21:10:02 2014 (r274820) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Fri Nov 21 21:14:05 2014 (r274821) @@ -65,9 +65,9 @@ static struct ttydevsw aju_ttydevsw = { /* * When polling for the AC bit, the number of times we have to not see it - * before assuming JTAG has disappeared on us. By default, one second. + * before assuming JTAG has disappeared on us. By default, two seconds. */ -#define AJU_JTAG_MAXMISS 5 +#define AJU_JTAG_MAXMISS 10 /* * Polling intervals for input/output and JTAG connection events. @@ -255,6 +255,22 @@ aju_handle_output(struct altera_jtag_uar if (ttydisc_getc(tp, &ch, sizeof(ch)) != sizeof(ch)) panic("%s: ttydisc_getc", __func__); AJU_LOCK(sc); + + /* + * XXXRW: There is a slight race here in which we test + * for writability, drop the lock, get the character + * from the tty layer, re-acquire the lock, and then + * write. It's possible for other code -- + * specifically, the low-level console -- to have + * written in the mean time, which might mean that + * there is no longer space. The BERI memory bus will + * cause this write to block, wedging the processor + * until space is available -- which could be a while + * if JTAG is not attached! + * + * The 'easy' fix is to drop the character if WSPACE + * has become unset. Not sure what the 'hard' fix is. + */ aju_data_write(sc, ch); } else { /* From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 21:16:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54E03106; Fri, 21 Nov 2014 21:16:12 +0000 (UTC) Received: from vlakno.cz (mail.vlakno.cz [91.217.96.224]) by mx1.freebsd.org (Postfix) with ESMTP id 16E74CEE; Fri, 21 Nov 2014 21:16:11 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 9F4A71D7ED7C; Fri, 21 Nov 2014 22:16:01 +0100 (CET) Date: Fri, 21 Nov 2014 22:16:01 +0100 From: Roman Divacky To: Bruce Evans Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde Message-ID: <20141121211601.GA47019@vlakno.cz> References: <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> <86sihq5a2v.fsf@nine.des.no> <20141111223756.F3519@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20141111223756.F3519@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Dag-Erling Sm??rgrav , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 21:16:12 -0000 On Tue, Nov 11, 2014 at 10:48:36PM +1100, Bruce Evans wrote: > On Tue, 11 Nov 2014, [utf-8] Dag-Erling Smørgrav wrote: > > > "Bjoern A. Zeeb" writes: > >> This fails to compile on all gcc platforms. > >> > >> cc1: warnings being treated as errors > >> /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndael/rijndael-api-fst.c: > >> In function 'rijndael_padEncrypt': > >> /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndael/rijndael-api-fst.c:236: > >> warning: cast discards qualifiers from pointer target type > >> [...] > > > > The code is quite clearly wrong. Why doesn't clang complain? > > -Wcast-qual is broken (has no effect) with clang. This is incompatible > with gcc and defeats the reason of existence of -Wcast-qual. I implemented -Wcast-qual in clang. We might want to backport it to our 3.4 (3.5 when it's imported), to prevent breakages like this in future. http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141117/118946.html Roman From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 21:30:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68BE2352; Fri, 21 Nov 2014 21:30:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B70CE0B; Fri, 21 Nov 2014 21:30:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALLU9QF059850; Fri, 21 Nov 2014 21:30:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALLU9bJ059849; Fri, 21 Nov 2014 21:30:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411212130.sALLU9bJ059849@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 21 Nov 2014 21:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274822 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 21:30:09 -0000 Author: ian Date: Fri Nov 21 21:30:08 2014 New Revision: 274822 URL: https://svnweb.freebsd.org/changeset/base/274822 Log: Document the recent enhancements for configuring bus speed in iicbus(4). Differential Revision: https://reviews.freebsd.org/D1182 PR: 195009 Modified: head/share/man/man4/iicbus.4 Modified: head/share/man/man4/iicbus.4 ============================================================================== --- head/share/man/man4/iicbus.4 Fri Nov 21 21:14:05 2014 (r274821) +++ head/share/man/man4/iicbus.4 Fri Nov 21 21:30:08 2014 (r274822) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 24, 2014 +.Dd November 17, 2014 .Dt IICBUS 4 .Os .Sh NAME @@ -103,12 +103,59 @@ Some I2C interfaces are available: .It Sy lpbb Ta "parallel port specific bit-banging interface" .It Sy bktr Ta "Brooktree848 video chipset, hardware and software master-only interface" .El +.Sh BUS FREQUENCY CONFIGURATION +The operating frequency of an I2C bus may be fixed or configurable. +The bus may be used as part of some larger standard interface, and that +interface specification may require a fixed frequency. +The driver for that hardware would not honor an attempt to configure a +different speed. +A general purpose I2C bus, such as those found in many embedded systems, +will often support multiple bus frequencies. +.Pp +When a system supports multiple I2C busses, a different frequency can +be configured for each bus by number, represented by the +.Va %d +in the variable names below. +Busses can be configured using any combination of device hints, +Flattened Device Tree (FDT) data, tunables set via +.Xr loader 8 , +or at runtime using +.Xr sysctl 8 . +When configuration is supplied using more than one method, FDT and +hint data will be overridden by a tunable, which can be overriden by +.Xr sysctl 8 . +.Ss Device Hints +Set +.Va hint.iicbus.%d.frequency +to the frequency in Hz, on systems that use device hints to configure +I2C devices. +The hint is also honored by systems that use FDT data if +no frequency is configured using FDT. +.Ss Flattened Device Tree Data +Configure the I2C bus speed using the FDT standard +.Va clock-frequency +property of the node describing the I2C controller hardware. +.Ss Sysctl and Tunable +Set +.Va dev.iicbus.%d.frequency +in +.Xr loader.conf 5 . +The same variable can be changed at any time with +.Xr sysctl 8 . +Reset the bus using +.Xr i2c 8 +or the +.Xr iic 4 +.Va I2CRSTCARD +ioctl to make the change take effect. .Sh SEE ALSO .Xr bktr 4 , +.Xr fdt 4 , .Xr iic 4 , .Xr iicbb 4 , .Xr lpbb 4 , -.Xr pcf 4 +.Xr pcf 4 , +.Xr i2c 8 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 21:34:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DFA4737; Fri, 21 Nov 2014 21:34:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECC3AEDC; Fri, 21 Nov 2014 21:34:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALLYMvQ065139; Fri, 21 Nov 2014 21:34:22 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALLYKbf065103; Fri, 21 Nov 2014 21:34:20 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201411212134.sALLYKbf065103@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 21 Nov 2014 21:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274823 - in head/sys: boot/fdt/dts/mips dev/terasic/mtl mips/beri mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 21:34:23 -0000 Author: brooks Date: Fri Nov 21 21:34:19 2014 New Revision: 274823 URL: https://svnweb.freebsd.org/changeset/base/274823 Log: Merge from CheriBSD: commit 6d3c4c09226ad6bdd662e3e52489ef294a6ce298 Add terasic_mtl vt(4) framebuffer driver terasic_mtl can be built with syscons(4) and vt(4) attachments, selected at compile time. commit 33240259b47a7c990a5a88a19f133a5600432a4c Clear terasic_mtl text buffer on attach commit d188c2d2412953f949624aa35cd07082830943c9 Update terasic vt(4) driver for FreeBSD r269783 commit d1cc54eee852fa4fc9d359d5bb2171d24ec73369 Safety belt to ensure vt(4) fb parameters are correct commit 76e6d468ef45711d7952786095fc4791289ebb4b Improve terasic_mtl_vt fdt parsing - Use OF_getencprop to avoid need for explicit endian handling (submitted by ray@freebsd.org) - Check for expected length and correct pointer type commit 3e2524b8995ab66e8a9295e4c87cbc7126eeddf4 Correct device_printf usage commit 9e53e3c8e0766414e25662c95b09cc51c92443b0 Switch framebuffer to match host endianness Xorg and xf86-video-scfb work much better with a native-endian framebuffer. commit 0f49259d596321ed85288ac0e1fb4ee1c966df48 Switch DE4 to vt(4) and enable kbdmux commit 5bc96ebc89db7d134ad478335090c8477c1677c7 Add missing \n in device_printf calls Submitted by: emaste Sponsored by: DARPA, AFRL Added: head/sys/dev/terasic/mtl/terasic_mtl_vt.c (contents, props changed) Modified: head/sys/boot/fdt/dts/mips/beripad-de4.dts head/sys/dev/terasic/mtl/terasic_mtl.c head/sys/dev/terasic/mtl/terasic_mtl.h head/sys/dev/terasic/mtl/terasic_mtl_fdt.c head/sys/dev/terasic/mtl/terasic_mtl_nexus.c head/sys/dev/terasic/mtl/terasic_mtl_reg.c head/sys/dev/terasic/mtl/terasic_mtl_text.c head/sys/mips/beri/files.beri head/sys/mips/conf/BERI_DE4_BASE Modified: head/sys/boot/fdt/dts/mips/beripad-de4.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beripad-de4.dts Fri Nov 21 21:30:08 2014 (r274822) +++ head/sys/boot/fdt/dts/mips/beripad-de4.dts Fri Nov 21 21:34:19 2014 (r274823) @@ -216,6 +216,7 @@ touchscreen@70400000 { compatible = "sri-cambridge,mtl"; + panel-size = < 800 480 >; reg = <0x70400000 0x1000 0x70000000 0x177000 0x70177000 0x2000>; Modified: head/sys/dev/terasic/mtl/terasic_mtl.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl.c Fri Nov 21 21:30:08 2014 (r274822) +++ head/sys/dev/terasic/mtl/terasic_mtl.c Fri Nov 21 21:34:19 2014 (r274823) @@ -31,11 +31,14 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_syscons.h" + #include #include #include #include #include /* struct vt_mode */ +#include #include /* video_adapter_t */ #include #include @@ -53,8 +56,8 @@ __FBSDID("$FreeBSD$"); /* * Device driver for the Terasic Multitouch LCD (MTL). Three separate * sub-drivers that support, respectively, access to device control registers, - * the pixel frame buffer, and the text frame buffer. The last of these is - * also hooked up to syscons. + * the pixel frame buffer, and the text frame buffer. The pixel frame buffer + * is hooked up to vt(4), and the text frame buffer to syscons(4). * * Eventually, the frame buffer control registers and touch screen input FIFO * will end up being separate sub-drivers as well. @@ -81,16 +84,27 @@ terasic_mtl_attach(struct terasic_mtl_so if (error) goto error; /* - * XXXRW: Once we've attached syscons, we can't detach it, so do it - * last. + * XXXRW: Once we've attached syscons or vt, we can't detach it, so do + * it last. */ +#if defined(DEV_VT) + terasic_mtl_reg_pixel_endian_set(sc, BYTE_ORDER == BIG_ENDIAN); + error = terasic_mtl_fbd_attach(sc); + if (error) + goto error; + terasic_mtl_blend_pixel_set(sc, TERASIC_MTL_ALPHA_OPAQUE); + terasic_mtl_blend_textfg_set(sc, TERASIC_MTL_ALPHA_TRANSPARENT); + terasic_mtl_blend_textbg_set(sc, TERASIC_MTL_ALPHA_TRANSPARENT); +#endif +#if defined(DEV_SC) error = terasic_mtl_syscons_attach(sc); if (error) goto error; - terasic_mtl_blend_default_set(sc, TERASIC_MTL_COLOR_BLACK); terasic_mtl_blend_pixel_set(sc, TERASIC_MTL_ALPHA_TRANSPARENT); terasic_mtl_blend_textfg_set(sc, TERASIC_MTL_ALPHA_OPAQUE); terasic_mtl_blend_textbg_set(sc, TERASIC_MTL_ALPHA_OPAQUE); +#endif + terasic_mtl_blend_default_set(sc, TERASIC_MTL_COLOR_BLACK); return (0); error: terasic_mtl_text_detach(sc); @@ -103,8 +117,13 @@ void terasic_mtl_detach(struct terasic_mtl_softc *sc) { - /* XXXRW: syscons can't detach, but we try anyway, only to panic. */ + /* XXXRW: syscons and vt can't detach, but try anyway, only to panic. */ +#if defined(DEV_SC) terasic_mtl_syscons_detach(sc); +#endif +#if defined(DEV_VT) + terasic_mtl_fbd_detach(sc); +#endif /* All other aspects of the driver can detach just fine. */ terasic_mtl_text_detach(sc); Modified: head/sys/dev/terasic/mtl/terasic_mtl.h ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl.h Fri Nov 21 21:30:08 2014 (r274822) +++ head/sys/dev/terasic/mtl/terasic_mtl.h Fri Nov 21 21:34:19 2014 (r274823) @@ -33,13 +33,17 @@ #ifndef _DEV_TERASIC_MTL_H_ #define _DEV_TERASIC_MTL_H_ +#include "opt_syscons.h" + struct terasic_mtl_softc { +#if defined(DEV_SC) /* * syscons requires that its video_adapter_t be at the front of the * softc, so place syscons fields first, which we otherwise would * probably not do. */ video_adapter_t mtl_va; +#endif /* * Bus-related fields. @@ -62,7 +66,8 @@ struct terasic_mtl_softc { int mtl_reg_rid; /* - * Graphics frame buffer device -- mappable from userspace. + * Graphics frame buffer device -- mappable from userspace, and used + * by the vt framebuffer interface. */ struct cdev *mtl_pixel_cdev; struct resource *mtl_pixel_res; @@ -76,6 +81,11 @@ struct terasic_mtl_softc { struct resource *mtl_text_res; int mtl_text_rid; uint16_t *mtl_text_soft; + + /* + * Framebuffer hookup for vt(4). + */ + struct fb_info mtl_fb_info; }; #define TERASIC_MTL_LOCK(sc) mtx_lock(&(sc)->mtl_lock) @@ -106,6 +116,7 @@ struct terasic_mtl_softc { /* * Constants to help interpret various control registers. */ +#define TERASIC_MTL_BLEND_PIXEL_ENDIAN_SWAP 0x10000000 #define TERASIC_MTL_BLEND_DEFAULT_MASK 0x0f000000 #define TERASIC_MTL_BLEND_DEFAULT_SHIFT 24 #define TERASIC_MTL_BLEND_PIXEL_MASK 0x00ff0000 @@ -148,6 +159,12 @@ struct terasic_mtl_softc { #define TERASIC_MTL_TEXTFRAMEBUF_ATTR_SHIFT 8 /* + * Framebuffer constants. + */ +#define TERASIC_MTL_FB_WIDTH 800 +#define TERASIC_MTL_FB_HEIGHT 640 + +/* * Alpha-blending constants. */ #define TERASIC_MTL_ALPHA_TRANSPARENT 0 @@ -164,6 +181,8 @@ extern devclass_t terasic_mtl_devclass; /* * Sub-driver setup routines. */ +int terasic_mtl_fbd_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_fbd_detach(struct terasic_mtl_softc *sc); int terasic_mtl_pixel_attach(struct terasic_mtl_softc *sc); void terasic_mtl_pixel_detach(struct terasic_mtl_softc *sc); int terasic_mtl_reg_attach(struct terasic_mtl_softc *sc); @@ -202,6 +221,8 @@ void terasic_mtl_blend_textfg_set(struct uint8_t alpha); void terasic_mtl_blend_textbg_set(struct terasic_mtl_softc *sc, uint8_t alpha); +void terasic_mtl_reg_pixel_endian_set(struct terasic_mtl_softc *sc, + int endian_swap); /* * Text frame buffer I/O routines. Modified: head/sys/dev/terasic/mtl/terasic_mtl_fdt.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl_fdt.c Fri Nov 21 21:30:08 2014 (r274822) +++ head/sys/dev/terasic/mtl/terasic_mtl_fdt.c Fri Nov 21 21:34:19 2014 (r274823) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include +#include "fb_if.h" + static int terasic_mtl_fdt_probe(device_t dev) { @@ -94,12 +96,12 @@ terasic_mtl_fdt_attach(device_t dev) goto error; } if (rman_get_start(sc->mtl_reg_res) % PAGE_SIZE != 0) { - device_printf(dev, "improper register address"); + device_printf(dev, "improper register address\n"); error = ENXIO; goto error; } if (rman_get_size(sc->mtl_reg_res) % PAGE_SIZE != 0) { - device_printf(dev, "improper register size"); + device_printf(dev, "improper register size\n"); error = ENXIO; goto error; } @@ -117,12 +119,12 @@ terasic_mtl_fdt_attach(device_t dev) goto error; } if (rman_get_start(sc->mtl_pixel_res) % PAGE_SIZE != 0) { - device_printf(dev, "improper pixel address"); + device_printf(dev, "improper pixel address\n"); error = ENXIO; goto error; } if (rman_get_size(sc->mtl_pixel_res) % PAGE_SIZE != 0) { - device_printf(dev, "improper pixel size"); + device_printf(dev, "improper pixel size\n"); error = ENXIO; goto error; } @@ -140,12 +142,12 @@ terasic_mtl_fdt_attach(device_t dev) goto error; } if (rman_get_start(sc->mtl_text_res) % PAGE_SIZE != 0) { - device_printf(dev, "improper text address"); + device_printf(dev, "improper text address\n"); error = ENXIO; goto error; } if (rman_get_size(sc->mtl_text_res) % PAGE_SIZE != 0) { - device_printf(dev, "improper text size"); + device_printf(dev, "improper text size\n"); error = ENXIO; goto error; } @@ -186,10 +188,20 @@ terasic_mtl_fdt_detach(device_t dev) return (0); } +static struct fb_info * +terasic_mtl_fb_getinfo(device_t dev) +{ + struct terasic_mtl_softc *sc; + + sc = device_get_softc(dev); + return (&sc->mtl_fb_info); +} + static device_method_t terasic_mtl_fdt_methods[] = { DEVMETHOD(device_probe, terasic_mtl_fdt_probe), DEVMETHOD(device_attach, terasic_mtl_fdt_attach), DEVMETHOD(device_detach, terasic_mtl_fdt_detach), + DEVMETHOD(fb_getinfo, terasic_mtl_fb_getinfo), { 0, 0 } }; Modified: head/sys/dev/terasic/mtl/terasic_mtl_nexus.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Fri Nov 21 21:30:08 2014 (r274822) +++ head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Fri Nov 21 21:34:19 2014 (r274823) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include +#include "fb_if.h" + static int terasic_mtl_nexus_probe(device_t dev) { @@ -76,36 +78,36 @@ terasic_mtl_nexus_attach(device_t dev) */ if (resource_long_value(device_get_name(dev), device_get_unit(dev), "reg_maddr", ®_maddr) != 0 || (reg_maddr % PAGE_SIZE != 0)) { - device_printf(dev, "improper register address"); + device_printf(dev, "improper register address\n"); return (ENXIO); } if (resource_long_value(device_get_name(dev), device_get_unit(dev), "reg_msize", ®_msize) != 0 || (reg_msize % PAGE_SIZE != 0)) { - device_printf(dev, "improper register size"); + device_printf(dev, "improper register size\n"); return (ENXIO); } if (resource_long_value(device_get_name(dev), device_get_unit(dev), "pixel_maddr", &pixel_maddr) != 0 || (pixel_maddr % PAGE_SIZE != 0)) { - device_printf(dev, "improper pixel frame buffer address"); + device_printf(dev, "improper pixel frame buffer address\n"); return (ENXIO); } if (resource_long_value(device_get_name(dev), device_get_unit(dev), "pixel_msize", &pixel_msize) != 0 || (pixel_msize % PAGE_SIZE != 0)) { - device_printf(dev, "improper pixel frame buffer size"); + device_printf(dev, "improper pixel frame buffer size\n"); return (ENXIO); } if (resource_long_value(device_get_name(dev), device_get_unit(dev), "text_maddr", &text_maddr) != 0 || (text_maddr % PAGE_SIZE != 0)) { - device_printf(dev, "improper text frame buffer address"); + device_printf(dev, "improper text frame buffer address\n"); return (ENXIO); } if (resource_long_value(device_get_name(dev), device_get_unit(dev), "text_msize", &text_msize) != 0 || (text_msize % PAGE_SIZE != 0)) { - device_printf(dev, "improper text frame buffer size"); + device_printf(dev, "improper text frame buffer size\n"); return (ENXIO); } @@ -177,10 +179,20 @@ terasic_mtl_nexus_detach(device_t dev) return (0); } +static struct fb_info * +terasic_mtl_fb_getinfo(device_t dev) +{ + struct terasic_mtl_softc *sc; + + sc = device_get_softc(dev); + return (&sc->mtl_fb_info); +} + static device_method_t terasic_mtl_nexus_methods[] = { DEVMETHOD(device_probe, terasic_mtl_nexus_probe), DEVMETHOD(device_attach, terasic_mtl_nexus_attach), DEVMETHOD(device_detach, terasic_mtl_nexus_detach), + DEVMETHOD(fb_getinfo, terasic_mtl_fb_getinfo), { 0, 0 } }; Modified: head/sys/dev/terasic/mtl/terasic_mtl_reg.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl_reg.c Fri Nov 21 21:30:08 2014 (r274822) +++ head/sys/dev/terasic/mtl/terasic_mtl_reg.c Fri Nov 21 21:34:19 2014 (r274823) @@ -205,6 +205,21 @@ terasic_mtl_blend_textbg_set(struct tera } void +terasic_mtl_reg_pixel_endian_set(struct terasic_mtl_softc *sc, int endian_swap) +{ + uint32_t v; + + TERASIC_MTL_LOCK(sc); + terasic_mtl_reg_blend_get(sc, &v); + if (endian_swap) + v |= TERASIC_MTL_BLEND_PIXEL_ENDIAN_SWAP; + else + v &= ~TERASIC_MTL_BLEND_PIXEL_ENDIAN_SWAP; + terasic_mtl_reg_blend_set(sc, v); + TERASIC_MTL_UNLOCK(sc); +} + +void terasic_mtl_reg_textcursor_get(struct terasic_mtl_softc *sc, uint8_t *colp, uint8_t *rowp) { @@ -232,7 +247,7 @@ void terasic_mtl_reg_blank(struct terasic_mtl_softc *sc) { - device_printf(sc->mtl_dev, "%s: not yet", __func__); + device_printf(sc->mtl_dev, "%s: not yet\n", __func__); } void Modified: head/sys/dev/terasic/mtl/terasic_mtl_text.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl_text.c Fri Nov 21 21:30:08 2014 (r274822) +++ head/sys/dev/terasic/mtl/terasic_mtl_text.c Fri Nov 21 21:34:19 2014 (r274823) @@ -158,6 +158,7 @@ int terasic_mtl_text_attach(struct terasic_mtl_softc *sc) { uint32_t v; + u_int offset; terasic_mtl_reg_textframebufaddr_get(sc, &v); if (v != TERASIC_MTL_TEXTFRAMEBUF_EXPECTED_ADDR) { @@ -165,6 +166,9 @@ terasic_mtl_text_attach(struct terasic_m "address (%08x); cannot attach\n", __func__, v); return (ENXIO); } + for (offset = 0; offset < rman_get_size(sc->mtl_text_res); + offset += sizeof(uint16_t)) + bus_write_2(sc->mtl_text_res, offset, 0); sc->mtl_text_cdev = make_dev(&terasic_mtl_text_cdevsw, sc->mtl_unit, UID_ROOT, GID_WHEEL, 0400, "mtl_text%d", sc->mtl_unit); Added: head/sys/dev/terasic/mtl/terasic_mtl_vt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl_vt.c Fri Nov 21 21:34:19 2014 (r274823) @@ -0,0 +1,133 @@ +/*- + * Copyright (c) 2014 Ed Maste + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 + +/* + * Terasic Multitouch LCD (MTL) vt(4) framebuffer driver. + */ + +#include +#include + +static int +terasic_mtl_fbd_panel_info(struct terasic_mtl_softc *sc, struct fb_info *info) +{ + phandle_t node; + pcell_t dts_value[2]; + int len; + + if ((node = ofw_bus_get_node(sc->mtl_dev)) == -1) + return (ENXIO); + + /* panel size */ + if ((len = OF_getproplen(node, "panel-size")) != sizeof(dts_value)) + return (ENXIO); + OF_getencprop(node, "panel-size", dts_value, len); + info->fb_width = dts_value[0]; + info->fb_height = dts_value[1]; + info->fb_bpp = info->fb_depth = 32; + info->fb_stride = info->fb_width * (info->fb_depth / 8); + + /* + * Safety belt to ensure framebuffer params are as expected. May be + * removed when we have full confidence in fdt / hints params. + */ + if (info->fb_width != TERASIC_MTL_FB_WIDTH || + info->fb_height != TERASIC_MTL_FB_HEIGHT || + info->fb_stride != 3200 || + info->fb_bpp != 32 || info->fb_depth != 32) { + device_printf(sc->mtl_dev, + "rejecting invalid panel params width=%u height=%u\n", + (unsigned)info->fb_width, (unsigned)info->fb_height); + return (EINVAL); + } + + return (0); +} + +int +terasic_mtl_fbd_attach(struct terasic_mtl_softc *sc) +{ + struct fb_info *info; + device_t fbd; + + info = &sc->mtl_fb_info; + info->fb_name = device_get_nameunit(sc->mtl_dev); + info->fb_pbase = rman_get_start(sc->mtl_pixel_res); + info->fb_size = rman_get_size(sc->mtl_pixel_res); + info->fb_vbase = (intptr_t)pmap_mapdev(info->fb_pbase, info->fb_size); + if (terasic_mtl_fbd_panel_info(sc, info) != 0) { + device_printf(sc->mtl_dev, "using default panel params\n"); + info->fb_bpp = info->fb_depth = 32; + info->fb_width = 800; + info->fb_height = 480; + info->fb_stride = info->fb_width * (info->fb_depth / 8); + } + + fbd = device_add_child(sc->mtl_dev, "fbd", + device_get_unit(sc->mtl_dev)); + if (fbd == NULL) { + device_printf(sc->mtl_dev, "Failed to attach fbd child\n"); + return (ENXIO); + } + if (device_probe_and_attach(fbd) != 0) { + device_printf(sc->mtl_dev, + "Failed to attach fbd device\n"); + return (ENXIO); + } + return (0); +} + +void +terasic_mtl_fbd_detach(struct terasic_mtl_softc *sc) +{ + panic("%s: detach not implemented", __func__); +} + +extern device_t fbd_driver; +extern devclass_t fbd_devclass; +DRIVER_MODULE(fbd, terasic_mtl, fbd_driver, fbd_devclass, 0, 0); Modified: head/sys/mips/beri/files.beri ============================================================================== --- head/sys/mips/beri/files.beri Fri Nov 21 21:30:08 2014 (r274822) +++ head/sys/mips/beri/files.beri Fri Nov 21 21:34:19 2014 (r274823) @@ -16,8 +16,9 @@ dev/terasic/mtl/terasic_mtl_fdt.c option dev/terasic/mtl/terasic_mtl_nexus.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_pixel.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_reg.c optional terasic_mtl -dev/terasic/mtl/terasic_mtl_syscons.c optional terasic_mtl +dev/terasic/mtl/terasic_mtl_syscons.c optional terasic_mtl sc dev/terasic/mtl/terasic_mtl_text.c optional terasic_mtl +dev/terasic/mtl/terasic_mtl_vt.c optional terasic_mtl vt mips/beri/beri_machdep.c standard mips/beri/beri_pic.c optional fdt mips/beri/beri_simplebus.c optional fdt Modified: head/sys/mips/conf/BERI_DE4_BASE ============================================================================== --- head/sys/mips/conf/BERI_DE4_BASE Fri Nov 21 21:30:08 2014 (r274822) +++ head/sys/mips/conf/BERI_DE4_BASE Fri Nov 21 21:34:19 2014 (r274823) @@ -33,7 +33,8 @@ device cfi device cfid options CFI_SUPPORT_STRATAFLASH options ATSE_CFI_HACK -device sc +device vt +device kbdmux device uart From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 23:04:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EC19330; Fri, 21 Nov 2014 23:04:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BF67A58; Fri, 21 Nov 2014 23:04:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALN4Dit039755; Fri, 21 Nov 2014 23:04:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALN4DCZ039754; Fri, 21 Nov 2014 23:04:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411212304.sALN4DCZ039754@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 21 Nov 2014 23:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274825 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 23:04:13 -0000 Author: imp Date: Fri Nov 21 23:04:12 2014 New Revision: 274825 URL: https://svnweb.freebsd.org/changeset/base/274825 Log: Sort -K option before -k rather than at the top. MFC after: 1 week Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Nov 21 23:03:30 2014 (r274824) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Nov 21 23:04:12 2014 (r274825) @@ -909,11 +909,11 @@ pprint() ( usage () { ( echo "Usage: $0 [-bfiKknqvw] [-c config_file]" - echo " -K suppress installkernel" echo " -b suppress builds (both kernel and world)" echo " -c specify config file" echo " -f suppress code slice extraction" echo " -i suppress disk image build" + echo " -K suppress installkernel" echo " -k suppress buildkernel" echo " -n add -DNO_CLEAN to buildworld, buildkernel, etc" echo " -q make output more quiet" From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 23:26:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C095DB3D for ; Fri, 21 Nov 2014 23:26:57 +0000 (UTC) Received: from nm19-vm4.bullet.mail.gq1.yahoo.com (nm19-vm4.bullet.mail.gq1.yahoo.com [98.136.217.27]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85143C4A for ; Fri, 21 Nov 2014 23:26:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1416612410; bh=CsUrKUZloZb85sN1GErGwcwL0lU65Na1eiw+eCbKWg8=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=q491NJEVQzZEUxjFUNkZuUjfM6KSXdrL6wjsF65z4ffnho2tx2NpHTBWyJBksfC3CexWqHB6uaCuTkcPOye/SP0Fp5vRv9iQT7V59Ml44DaUWwlE0LEexqyku4tTjtDAViX2TJeR6o1gQVNSzIB9r3ReftWULQFHQsbsc/iWsSHeckuTO7jF38LiPnTPbDHtywrBT+KLgSiaAXKbdcXMBUmmpdVRbaQwehbxdElPaqWC9b+mmKiJegwMo++5usCEKGz+IPeCjDTDcKkepX9Pg4wZHo4ADPKmGZjPqQgA8vEEfSxKq6L3A6vl3gBnMHVoED9x8IBrpIG+BYJaggW1Xw== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=YKonyy+ZMfzD092gHepHvkssQx+GU2B1WAeiSVZvX+xZhH9R6i33/hmO03a9WlU6Dy4KJ+j4nqdCS+hblppvx5yKm/CTlwIHub2TrKOO56/6BeK1HWEB8OMNTwnzkD9i1GXnutZGPMJlEYHYqsqrsdh7rTTfuQaRDzPiMcEQitYpxjA+nE3sShydKgi7u0Zq/fC4dq9TrvTrJG+AMjVpmAvitRkkxuvQVDsXaQq5dE60EBBA+t7ko+RuOxyTlL3MxbtzKiNDmTXQAsYlV0LrwQ1ZVctKOLqGmNAD3Wex5NRjtDxsYMaeTvtfuBL1/aLbFX0jfr0WMxEYIKnENAcxRQ==; Received: from [216.39.60.182] by nm19.bullet.mail.gq1.yahoo.com with NNFMP; 21 Nov 2014 23:26:50 -0000 Received: from [208.71.42.197] by tm18.bullet.mail.gq1.yahoo.com with NNFMP; 21 Nov 2014 23:26:50 -0000 Received: from [127.0.0.1] by smtp208.mail.gq1.yahoo.com with NNFMP; 21 Nov 2014 23:26:49 -0000 X-Yahoo-Newman-Id: 993052.746.bm@smtp208.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: L0sNw.MVM1nJ8kXb7dxEfh1SJ8US8xTZw_GBjtglt8hrQXb sfu2xEPBmuNJ3zrkM61E19d1pdOIAYN_MBbAHzz5C2m1_dXTy0F19k6fGkYp dyg1G9j21_ultI5VcTetq0STaZ83l.JX0HHpa3rn3DClvsiHvl2ff3qsghhe 8ma9O5cGBqn1xpY1T23WO07VqXYxstxwA8rjwG2..aAlMD8BswMj1y8x8FH8 V11.ijjOZfWUErQBzzx5wjPvXiRJuNHalIaADvV9RGgXUoDGevF4923KGxsD GLLK2Q9D2DC.JB76qhTfRVZJKhqCciUN_dpRduUYsDkGkEtnqvP0Zp3O5JO0 CsVWACma3ip2KYo5BkXGXSYtqdFpUN4asQ8sk2MqSv3TUnM_eVNF9MAMRymq Qkh3rzr1qYkd3cdJlQ7TF2qvEO.0xcEE1uQAvuLXRqhUrKKtnJ7VjUJem3iR 4kVW_Emx5G9sbjtwFkTbL64SSHkVgs0cWDgve4m6zFcs8lSmyur8RCDg9K22 kOfFAMimJ75aZuxu_OQCHSkoDKg5qaZYihg-- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r274489 - in head/sys/amd64: amd64 include From: Scott Long In-Reply-To: <35E5EAD8-99C1-43C0-8D01-B3B5B86ECA25@me.com> Date: Fri, 21 Nov 2014 16:26:47 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <13EC3116-6146-42FC-8941-2C7C009224B3@yahoo.com> References: <201411132211.sADMBjP3009246@svn.freebsd.org> <35E5EAD8-99C1-43C0-8D01-B3B5B86ECA25@me.com> To: Rui Paulo X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Scott Long X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 23:26:57 -0000 > On Nov 20, 2014, at 11:33 PM, Rui Paulo wrote: >=20 > On Nov 13, 2014, at 14:11, Scott Long wrote: >>=20 >> Author: scottl >> Date: Thu Nov 13 22:11:44 2014 >> New Revision: 274489 >> URL: https://svnweb.freebsd.org/changeset/base/274489 >>=20 >> Log: >> Extend earlier addition of stack frames to most of support.S. This = makes >> stack traces in KDB, HWPMC, and DTrace much more reliable and useful. >=20 > No performance differences? The kernel enables/disables the compiler = option to omit the frame pointer based on the kernel config file. If = DDB, DTrace, or HWPMC is enabled, the frame pointer is always saved in C = functions.=20 >=20 > Some of these functions are in the hot path, so if you didn't see any = performance problem, I wonder if we should disable -fomit-frame-pointer = always. That=E2=80=99s a good question to look further into. I didn=E2=80=99t = see any measurable differences with this change. I think that the cost = of the function call itself masks the cost of a few extra instructions, = but I didn=E2=80=99t test with switching it on/off for the entire = kernel. That said, I purposely implemented this as macros so it could = be easily changed in the future. If someone finds that this measurably = impacts a certain workload, I wouldn=E2=80=99t object to making it = conditional, though it does complicate any hand-written ASM code that = tries to access the stack via %esp offsets. We don=E2=80=99t have = anything like that now, but Kip was concerned enough about it in the = future that I left it enabled unconditionally. Scott From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 00:37:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7365FC5D; Sat, 22 Nov 2014 00:37:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45F9E2BD; Sat, 22 Nov 2014 00:37:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM0bcZR017275; Sat, 22 Nov 2014 00:37:38 GMT (envelope-from davide@FreeBSD.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM0bcdi017274; Sat, 22 Nov 2014 00:37:38 GMT (envelope-from davide@FreeBSD.org) Message-Id: <201411220037.sAM0bcdi017274@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davide set sender to davide@FreeBSD.org using -f From: Davide Italiano Date: Sat, 22 Nov 2014 00:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274834 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 00:37:38 -0000 Author: davide Date: Sat Nov 22 00:37:37 2014 New Revision: 274834 URL: https://svnweb.freebsd.org/changeset/base/274834 Log: Make ufs_dirhashreclaimperc a percentage for real and rename it to ufs_dirhashreclaimpercent, as suggested by jhb@. As an added bonus this avoids divide-by-zero errors. Requested by: jhb, markj Reviewied by: jhb, markj Modified: head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Sat Nov 22 00:01:14 2014 (r274833) +++ head/sys/ufs/ufs/ufs_dirhash.c Sat Nov 22 00:37:37 2014 (r274834) @@ -85,10 +85,11 @@ SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_d static int ufs_dirhashlowmemcount = 0; SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_lowmemcount, CTLFLAG_RD, &ufs_dirhashlowmemcount, 0, "number of times low memory hook called"); -static int ufs_dirhash_reclaimperc = 10; -SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_reclaimperc, CTLFLAG_RW, - &ufs_dirhash_reclaimperc, 0, - "percentage of dirhash cache to be removed in low VM events"); +static int ufs_dirhashreclaimpercent = 10; +static int ufsdirhash_set_reclaimpercent(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vfs_ufs, OID_AUTO, dirhash_reclaimpercent, + CTLTYPE_INT | CTLFLAG_RW, 0, 0, ufsdirhash_set_reclaimpercent, "I", + "set percentage of dirhash cache to be removed in low VM events"); static int ufsdirhash_hash(struct dirhash *dh, char *name, int namelen); @@ -1251,7 +1252,7 @@ ufsdirhash_lowmem() ufs_dirhashlowmemcount++; memfreed = 0; - memwanted = ufs_dirhashmem / ufs_dirhash_reclaimperc; + memwanted = ufs_dirhashmem * ufs_dirhash_reclaimpercent / 100; DIRHASHLIST_LOCK(); @@ -1273,6 +1274,26 @@ ufsdirhash_lowmem() DIRHASHLIST_UNLOCK(); } +static int +ufsdirhash_set_reclaimpercent(SYSCTL_HANDLER_ARGS) +{ + int error, v; + + v = ufs_dirhashreclaimpercent; + error = sysctl_handle_int(oidp, &v, v, req); + if (error) + return (error); + if (req->newptr == NULL) + return (error); + if (v == ufs_dirhashreclaimpercent) + return (0); + + /* Refuse invalid percentages */ + if (v < 0 || v > 100) + return (EINVAL); + ufs_dirhashreclaimpercent = v; + return (0); +} void ufsdirhash_init() From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 00:42:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46E14E0D; Sat, 22 Nov 2014 00:42:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33424381; Sat, 22 Nov 2014 00:42:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM0gVBO022940; Sat, 22 Nov 2014 00:42:31 GMT (envelope-from davide@FreeBSD.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM0gVf1022939; Sat, 22 Nov 2014 00:42:31 GMT (envelope-from davide@FreeBSD.org) Message-Id: <201411220042.sAM0gVf1022939@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davide set sender to davide@FreeBSD.org using -f From: Davide Italiano Date: Sat, 22 Nov 2014 00:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274835 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 00:42:31 -0000 Author: davide Date: Sat Nov 22 00:42:30 2014 New Revision: 274835 URL: https://svnweb.freebsd.org/changeset/base/274835 Log: Use the correct variable name. Modified: head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Sat Nov 22 00:37:37 2014 (r274834) +++ head/sys/ufs/ufs/ufs_dirhash.c Sat Nov 22 00:42:30 2014 (r274835) @@ -1252,7 +1252,7 @@ ufsdirhash_lowmem() ufs_dirhashlowmemcount++; memfreed = 0; - memwanted = ufs_dirhashmem * ufs_dirhash_reclaimpercent / 100; + memwanted = ufs_dirhashmem * ufs_dirhashreclaimpercent / 100; DIRHASHLIST_LOCK(); From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 01:22:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A96B8EA; Sat, 22 Nov 2014 01:22:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2259790B; Sat, 22 Nov 2014 01:22:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM1M4UX054814; Sat, 22 Nov 2014 01:22:04 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM1M4Y5054804; Sat, 22 Nov 2014 01:22:04 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411220122.sAM1M4Y5054804@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 01:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274836 - in head/usr.bin: . soeliminate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 01:22:05 -0000 Author: bapt Date: Sat Nov 22 01:22:03 2014 New Revision: 274836 URL: https://svnweb.freebsd.org/changeset/base/274836 Log: Add a new soeliminate(1) command mandoc(1) does not provide an equivalent of the GNU groff's soelim(1) as an external binary. It does provide the funcitonnality but internally. Lots if manpages in ports uses ".so" directives to include the content of another manpage, which works properly if the manpages are not compressed. With compressed manpages it will fail. So we need to preprocess those manpages with soelim(1) before compressing them. soeliminate(1) add the minimum functionnality from soelim(1) required for that task, in order to still be able to prepare properly those manpages in case we ship the base system only with mandoc as a manpage renderer. soeliminate(1) accept all the arguments from soelim(1) for compatibility but only '-I dir' is really functionnal. Name it soeliminate and not soelim, so groff from base or ports can still call soelim(1) for its internal use and avoid potential incompatibilities MFC after: 1 month Added: head/usr.bin/soeliminate/ head/usr.bin/soeliminate/Makefile (contents, props changed) head/usr.bin/soeliminate/soeliminate.1 (contents, props changed) head/usr.bin/soeliminate/soeliminate.c (contents, props changed) Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sat Nov 22 00:42:30 2014 (r274835) +++ head/usr.bin/Makefile Sat Nov 22 01:22:03 2014 (r274836) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.3 (Berkeley) 1/7/94 # $FreeBSD$ -.include +.include # XXX MISSING: deroff diction graph learn plot # spell spline struct xsend @@ -149,6 +149,7 @@ SUBDIR= alias \ shar \ showmount \ sockstat \ + soeliminate \ sort \ split \ stat \ @@ -164,7 +165,6 @@ SUBDIR= alias \ ${_tests} \ tftp \ time \ - timeout \ tip \ top \ touch \ @@ -184,6 +184,7 @@ SUBDIR= alias \ unvis \ uudecode \ uuencode \ + vi \ vis \ vmstat \ w \ @@ -233,10 +234,6 @@ SUBDIR+= calendar _clang= clang .endif -.if ${MK_FMAKE} != "no" -SUBDIR+= make -.endif - .if ${MK_GPL_DTC} != "yes" SUBDIR+= dtc .endif @@ -269,6 +266,10 @@ SUBDIR+= drill SUBDIR+= host .endif +.if ${MK_LIBTHR} != "no" +SUBDIR+= csup +.endif + .if ${MK_LOCATE} != "no" SUBDIR+= locate .endif @@ -282,7 +283,11 @@ SUBDIR+= msgs .endif .if ${MK_MAKE} != "no" +.if ${MK_BMAKE} != "no" SUBDIR+= bmake +.else +SUBDIR+= make +.endif .endif .if ${MK_MAN_UTILS} != "no" @@ -358,10 +363,6 @@ SUBDIR+= xstr SUBDIR+= yacc .endif -.if ${MK_VI} != "no" -SUBDIR+= vi -.endif - .if ${MK_VT} != "no" SUBDIR+= vtfontcvt .endif Added: head/usr.bin/soeliminate/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/soeliminate/Makefile Sat Nov 22 01:22:03 2014 (r274836) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +PROG= soeliminate + +.include Added: head/usr.bin/soeliminate/soeliminate.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/soeliminate/soeliminate.1 Sat Nov 22 01:22:03 2014 (r274836) @@ -0,0 +1,82 @@ +.\" Copyright (c) 2014 Baptiste Daroussin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 22, 2014 +.Dt SOELIMINATE 1 +.Os +.Sh NAME +.Nm soeliminate +.Nd interpret .so directive in manpages +.Sh SYNOPSIS +.Nm +.Op Fl Crtv +.Op Fl I Ar dir +.Op Ar files ... +.Sh DESCRIPTION +.Nm +reads +.Ar files +lines by lines. +.Pp +If a line starts by: +.Dq .so anotherfile +it replace the line by processing +.Dq anotherfile . +Otherwise the line is printed to stdout. +.Bl -tag -width "-I dir" +.It Fl C +Compatibility with GNU groff's +.Xr soelim 1 +(does nothing). +.It Fl r +Compatibility with GNU groff's +.Xr soelim 1 +(does nothing). +.It Fl t +Compatibility with GNU groff's +.Xr soelim 1 +(does nothing). +.It Fl v +Compatibility with GNU groff's +.Xr soelim 1 +(does nothing). +.It Fl I Ar dir +This option specify directories where +.Nm +searches for files (both those on the command line and those named in +.Dq .so +directive.) +This options may be specified multiple times. The directories will be searched +in the order specified. +.El +.Pp +The files are always searched first in the current directory. +.Pp +A file specified with an absolute path will be opened directly without +performing a search. +.Sh SEE ALSO +.Xr mandoc 1 , +.Xr soelim 1 Added: head/usr.bin/soeliminate/soeliminate.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/soeliminate/soeliminate.c Sat Nov 22 01:22:03 2014 (r274836) @@ -0,0 +1,153 @@ +/*- + * Copyright (c) 2014 Baptiste Daroussin + * 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 + * in this position and unchanged. + * 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(S) ``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(S) 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 + +#define _WITH_GETLINE +#include +#include +#include +#include +#include +#include +#include +#include + +static StringList *includes; + +static void +usage(void) +{ + + fprintf(stderr, "usage: soeliminate [-Crtv] [-I dir] [files]\n"); + + exit(EXIT_FAILURE); +} + +static FILE * +soelim_fopen(const char *name) +{ + FILE *f; + char path[MAXPATHLEN]; + size_t i; + + if ((f = fopen(name, "r")) != NULL) + return (f); + + if (*name == '/') { + warn("can't open '%s'", name); + return (NULL); + } + + for (i = 0; i < includes->sl_cur; i++) { + snprintf(path, sizeof(path), "%s/%s", includes->sl_str[i], + name); + if ((f = fopen(path, "r")) != NULL) + return (f); + } + + warn("can't open '%s'", name); + + return (f); +} + +static int +soelim_file(FILE *f) +{ + char *line = NULL; + char *walk; + size_t linecap = 0; + ssize_t linelen; + + if (f == NULL) + return (1); + + while ((linelen = getline(&line, &linecap, f)) > 0) { + if (strncmp(line, ".so", 3) != 0) { + printf("%s", line); + continue; + } + walk = line + 3; + while (isspace(*walk)) + walk++; + + while (isspace(walk[strlen(walk) - 1])) + walk[strlen(walk) - 1] = '\0'; + if (soelim_file(soelim_fopen(walk)) == 1) { + free(line); + return (1); + } + } + + free(line); + fclose(f); + + return (0); +} + +int +main(int argc, char **argv) +{ + int ch, i; + int ret = 0; + + includes = sl_init(); + if (includes == NULL) + err(EXIT_FAILURE, "sl_init()"); + + while ((ch = getopt(argc, argv, "CrtvI:")) != -1) { + switch (ch) { + case 'C': + case 'r': + case 'v': + case 't': + /* stub compatibility with groff's soelim */ + break; + case 'I': + sl_add(includes, optarg); + break; + default: + sl_free(includes, 0); + usage(); + } + } + + argc -= optind; + argv += optind; + + if (argc == 0) + ret = soelim_file(stdin); + + for (i = 0; i < argc; i++) + ret = soelim_file(soelim_fopen(argv[i])); + + sl_free(includes, 0); + + return (ret); +} From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 01:27:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2A30BEA; Sat, 22 Nov 2014 01:27:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF52692F; Sat, 22 Nov 2014 01:27:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM1RkpB057537; Sat, 22 Nov 2014 01:27:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM1RkER057536; Sat, 22 Nov 2014 01:27:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411220127.sAM1RkER057536@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 01:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274837 - head/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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 01:27:46 -0000 Author: bapt Date: Sat Nov 22 01:27:45 2014 New Revision: 274837 URL: https://svnweb.freebsd.org/changeset/base/274837 Log: Revert accidently message Makefile from 274836 and connect soeliminate(1) Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sat Nov 22 01:22:03 2014 (r274836) +++ head/usr.bin/Makefile Sat Nov 22 01:27:45 2014 (r274837) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.3 (Berkeley) 1/7/94 # $FreeBSD$ -.include +.include # XXX MISSING: deroff diction graph learn plot # spell spline struct xsend @@ -165,6 +165,7 @@ SUBDIR= alias \ ${_tests} \ tftp \ time \ + timeout \ tip \ top \ touch \ @@ -184,7 +185,6 @@ SUBDIR= alias \ unvis \ uudecode \ uuencode \ - vi \ vis \ vmstat \ w \ @@ -234,6 +234,10 @@ SUBDIR+= calendar _clang= clang .endif +.if ${MK_FMAKE} != "no" +SUBDIR+= make +.endif + .if ${MK_GPL_DTC} != "yes" SUBDIR+= dtc .endif @@ -266,10 +270,6 @@ SUBDIR+= drill SUBDIR+= host .endif -.if ${MK_LIBTHR} != "no" -SUBDIR+= csup -.endif - .if ${MK_LOCATE} != "no" SUBDIR+= locate .endif @@ -283,11 +283,7 @@ SUBDIR+= msgs .endif .if ${MK_MAKE} != "no" -.if ${MK_BMAKE} != "no" SUBDIR+= bmake -.else -SUBDIR+= make -.endif .endif .if ${MK_MAN_UTILS} != "no" @@ -363,6 +359,10 @@ SUBDIR+= xstr SUBDIR+= yacc .endif +.if ${MK_VI} != "no" +SUBDIR+= vi +.endif + .if ${MK_VT} != "no" SUBDIR+= vtfontcvt .endif From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 03:03:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B858FE13; Sat, 22 Nov 2014 03:03:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CECD2AD; Sat, 22 Nov 2014 03:03:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM33CNm035311; Sat, 22 Nov 2014 03:03:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM33C5o035310; Sat, 22 Nov 2014 03:03:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411220303.sAM33C5o035310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 22 Nov 2014 03:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274839 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 03:03:12 -0000 Author: ian Date: Sat Nov 22 03:03:11 2014 New Revision: 274839 URL: https://svnweb.freebsd.org/changeset/base/274839 Log: When doing a PREREAD sync of an mbuf-type dma buffer, do a writeback of the first cacheline if the buffer start address is not on a cacheline boundary. Normally a buffer which is not cacheline-aligned is bounced, but a special rule applies for mbufs, which are always misaligned due to the header. We know the cpu will not write to the header while dma is in progress (so we've been told anyway), but it may have written to the header shortly before starting a read, so we need to flush that write out to memory before invalidating the whole buffer. In collaboration with Mical Meloun and Svata Kraus. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sat Nov 22 02:44:39 2014 (r274838) +++ head/sys/arm/arm/busdma_machdep-v6.c Sat Nov 22 03:03:11 2014 (r274839) @@ -1456,7 +1456,24 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus break; case BUS_DMASYNC_PREREAD: + /* + * An mbuf may start in the middle of a cacheline. There + * will be no cpu writes to the beginning of that line + * (which contains the mbuf header) while dma is in + * progress. Handle that case by doing a writeback of + * just the first cacheline before invalidating the + * overall buffer. Any mbuf in a chain may have this + * misalignment. Buffers which are not mbufs bounce if + * they are not aligned to a cacheline. + */ while (sl != end) { + if (sl->vaddr & arm_dcache_align_mask) { + KASSERT(map->flags & DMAMAP_MBUF, + ("unaligned buffer is not an mbuf")); + cpu_dcache_wb_range(sl->vaddr, 1); + l2cache_wb_range(sl->vaddr, + sl->busaddr, 1); + } cpu_dcache_inv_range(sl->vaddr, sl->datacount); l2cache_inv_range(sl->vaddr, sl->busaddr, sl->datacount); From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 04:40:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BE2CCFC; Sat, 22 Nov 2014 04:40:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 088E8D6E; Sat, 22 Nov 2014 04:40:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM4eOuF010806; Sat, 22 Nov 2014 04:40:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM4eOwY010805; Sat, 22 Nov 2014 04:40:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411220440.sAM4eOwY010805@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 22 Nov 2014 04:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274840 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 04:40:25 -0000 Author: mav Date: Sat Nov 22 04:40:24 2014 New Revision: 274840 URL: https://svnweb.freebsd.org/changeset/base/274840 Log: Make iSCSI frontend less chatty while waiting for tasks termination. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sat Nov 22 03:03:11 2014 (r274839) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sat Nov 22 04:40:24 2014 (r274840) @@ -1058,7 +1058,7 @@ cfiscsi_session_terminate_tasks(struct c { struct cfiscsi_data_wait *cdw; union ctl_io *io; - int error, last; + int error, last, wait; if (cs->cs_target == NULL) return; /* No target yet, so nothing to do. */ @@ -1103,16 +1103,20 @@ cfiscsi_session_terminate_tasks(struct c /* * Wait for CTL to terminate all the tasks. */ + wait = cs->cs_outstanding_ctl_pdus; + if (wait > 0) + CFISCSI_SESSION_WARN(cs, + "waiting for CTL to terminate %d tasks", wait); for (;;) { refcount_acquire(&cs->cs_outstanding_ctl_pdus); last = refcount_release(&cs->cs_outstanding_ctl_pdus); if (last != 0) break; - CFISCSI_SESSION_WARN(cs, "waiting for CTL to terminate tasks, " - "%d remaining", cs->cs_outstanding_ctl_pdus); tsleep(__DEVOLATILE(void *, &cs->cs_outstanding_ctl_pdus), 0, "cfiscsi_terminate", hz / 100); } + if (wait > 0) + CFISCSI_SESSION_WARN(cs, "tasks terminated"); } static void From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 07:18:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEEB039B; Sat, 22 Nov 2014 07:18:02 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 67B0ECBC; Sat, 22 Nov 2014 07:18:01 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 8AC48D66ECB; Sat, 22 Nov 2014 18:17:45 +1100 (AEDT) Date: Sat, 22 Nov 2014 18:17:44 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rui Paulo Subject: Re: svn commit: r274489 - in head/sys/amd64: amd64 include In-Reply-To: <35E5EAD8-99C1-43C0-8D01-B3B5B86ECA25@me.com> Message-ID: <20141122163552.H1447@besplex.bde.org> References: <201411132211.sADMBjP3009246@svn.freebsd.org> <35E5EAD8-99C1-43C0-8D01-B3B5B86ECA25@me.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=x5yxdju0Swl4lk78KJwA:9 a=_ixRp0c-x380KhqA:21 a=pzufiC-cxJxxEct-:21 a=MPmkvig3PXUWFwLU:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Scott Long X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 07:18:03 -0000 On Thu, 20 Nov 2014, Rui Paulo wrote: > On Nov 13, 2014, at 14:11, Scott Long wrote: >> >> Author: scottl >> Date: Thu Nov 13 22:11:44 2014 >> New Revision: 274489 >> URL: https://svnweb.freebsd.org/changeset/base/274489 >> >> Log: >> Extend earlier addition of stack frames to most of support.S. This makes >> stack traces in KDB, HWPMC, and DTrace much more reliable and useful. > > No performance differences? The kernel enables/disables the compiler option to omit the frame pointer based on the kernel config file. If DDB, DTrace, or HWPMC is enabled, the frame pointer is always saved in C functions. That bug is only implemented for amd64 and powerpc: - it is in Makefile.amd64. It is hard-coded under the above options, and thus breaks any settings of -fno-omit-frame-pointer -fno-omit-leaf-frame- pointer in the user's options, depending on undocumented ordering of the options. It also breaks profiling. - it is in Makefile.powerpc unless DDB is configured. - it is not in Makefile.i386. files.i386 and files.pc98 take the necessary care to not blow away -fno-omit-frame-pointer in the user's options for atomic.c; however, all functions in atomic.c are leaf functions, so this may be broken now. The null documentation in cc.1 doesn't say. - it is in kmod.mk for some amd64 and powerpc. There it breaks modules unconditionally. The breakage for profiling is quite serious, since the frame pointer might be dereferenced unconditionally. However, amd64 and i386 still use my optimization of avoiding the dereference unless profiling is enabled as well as configured. Asm code in them uses my related optimization of not using a frame pointer at all for functions written in asm (ENTRY() hides the details, and the details are arranged so as not to The breakage is maximal for profiling of modules. You could have a kernel compile for profiling or just DDB, DTrace, or HWPMC, but modules not compiled for these. Only broken modules can depend on kernel options, and kmod.mk doesn't check the options anyway. The default is fail-unsafe for amd64 and powerpc. It gives broken modules that can never match the kernel profiling, DDB, DTrace or HWPMC options unless these are hacked into individual module Makefiles. This gives crashes soon if any module is used by a kernel with profiling configured and enabled. DDB can make invalid dereferences of the frame pointer, but these are trapped harmlessly (except someone broke the trap handler, so it now does a stack trace of ddb internals; this spams the console and risks a recursive trap). I don't know if DTrace and HWPMC also trap the dereferences. Profiling certainly doesn't. Kernel stack traces without DDB, DTrace or HWPMC on amd64 or DDB on powerpc seem to be broken, even without modules. > Some of these functions are in the hot path, so if you didn't see any performance problem, I wonder if we should disable -fomit-frame-pointer always. The performance problem is about 0.0001% of the time spent in the kernel (which is hopefully a small fraction of the time spent in userland) on modern OOE pipelined systems, since the frame pointer switch can run ini parallel on these systems and not many functions are well enough scheduled to not have spare resources for this. Especially on i386 where args are passed on the stack -- lots can run in parallel with just loading the args, and the only problems are the extra code size and extra memory accesses for switching the frame pointer. I made up the 0.0001% number. The number is tiny anyway, since there aren't many asm functions so it would take an unusual workload to spend even 1% of the time in these functions except possibly if they are copyin/out of large data. Then any extra 1-10 cycles in each function might be 1% of this. Functions like fubyte() are an exception -- even 1 extra cycle in them might have a measurable effect if they were called a lot. However, fubyte() isn't called a lot, and if it were then then a frame pointer is the least of its pessimizations. My old optimizations to avoid frame pointers for profiling had a small effect for i486's since i486's are in-order and only have 1 pipeline. Even then, the effect was insignificant when profiling was enabled since the main profiling routine took a long time and needs a frame pointer anyway. In a quick test of a microbenchmark in userland, -fomit-frame-frame-pointer -fomit-leaf-frame-pointer was 1 cycle slower (30 -> 31) for one function but 1 cycle faster (26 -> 25) for another function. The benchmark is known to execute about 2 copies of the function in parallel, so the extra instructions cost nothing if there is a spare slot for them to run in every 20-30 cycles. Compilers understand little of this. I think using a frame pointer is sometimes faster on x86 because instructions to access stack variables are 1 byte longer when not using a frame pointer and this sometimes cost. OTOH, it might be best to set up a frame pointer but not actually use it explicitly (it would only be used by DDB etc.), so that the frame pointer accesses have no dependencies except each other. Modern x86 hardware already does a lot of virtualization with special cases for the frame pointer to reduce dependencies, but it shouldn't hurt to reduce them explicitly. This happens automatically in the recent amd64 changes -- the frame pointer isn't used explicityly before or after. Bugs in this change include: - it isn't done for all arches. It would be harder on i386 since the args are on the stack and all stack offsets would change. - the details aren't hidden in the ENTRY() macro. Putting it there would make the necessary stack offsets a little harder to apply. The correct register to use for the stack offsets would also be a problem. Hard-coding use of the frame pointer would make the offsets easier to get right and not depend on options, except it would make using a frame pointer non-optional. Always using it wouldn't be too bad for leaf functions in asm, but there would still be complications for non-C functions. Profiling avoids some of these complications basically by setting up a frame pointer for the profiling call but undoing that before ENTRY() returns. This also allows the change to not interfere with profiling. - it doesn't track the -fomit-*-frame-pointer option in CFLAGS. Compilers are bad about putting their options in predefines. For profiling, the kernel options GPROF and GUPROF are used. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 08:09:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6C24C34; Sat, 22 Nov 2014 08:09:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93846E7; Sat, 22 Nov 2014 08:09:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM89R1Z008923; Sat, 22 Nov 2014 08:09:27 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM89Rqe008922; Sat, 22 Nov 2014 08:09:27 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201411220809.sAM89Rqe008922@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 22 Nov 2014 08:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274841 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 08:09:27 -0000 Author: hrs Date: Sat Nov 22 08:09:26 2014 New Revision: 274841 URL: https://svnweb.freebsd.org/changeset/base/274841 Log: Remove examples of gif_interfaces and gifconfig. These have already been marked as deprecated in rc.conf(5) manual page but these examples were still here. Spotted by: jmg Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sat Nov 22 04:40:24 2014 (r274840) +++ head/etc/defaults/rc.conf Sat Nov 22 08:09:26 2014 (r274841) @@ -231,11 +231,6 @@ cloned_interfaces="" # List of cloned n sppp_interfaces="" # List of sppp interfaces. #sppp_interfaces="...0" # example: sppp over ... #spppconfig_...0="authproto=chap myauthname=foo myauthsecret='top secret' hisauthname=some-gw hisauthsecret='another secret'" -gif_interfaces="" # List of GIF tunnels. -#gif_interfaces="gif0 gif1" # Examples typically for a router. - # Choose correct tunnel addrs. -#gifconfig_gif0="10.1.1.1 10.1.2.1" # Examples typically for a router. -#gifconfig_gif1="10.1.1.2 10.1.2.2" # Examples typically for a router. # User ppp configuration. ppp_enable="NO" # Start user-ppp (or NO). From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 08:47:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3D7E142; Sat, 22 Nov 2014 08:47:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B68EB60F; Sat, 22 Nov 2014 08:47:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM8l58F027435; Sat, 22 Nov 2014 08:47:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM8l5ph027433; Sat, 22 Nov 2014 08:47:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411220847.sAM8l5ph027433@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 22 Nov 2014 08:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274842 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 08:47:06 -0000 Author: hselasky Date: Sat Nov 22 08:47:04 2014 New Revision: 274842 URL: https://svnweb.freebsd.org/changeset/base/274842 Log: Use correct length mask for split transactions. The hardware would sometimes put non-zero values in the upper length bits, which are available for high-speed-only USB transactions, breaking the reception of data. Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg_reg.h Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Sat Nov 22 08:09:26 2014 (r274841) +++ head/sys/dev/usb/controller/saf1761_otg.c Sat Nov 22 08:47:04 2014 (r274842) @@ -510,7 +510,10 @@ saf1761_host_bulk_data_rx(struct saf1761 td->error_any = 1; goto complete; } - count = (status & SOTG_PTD_DW3_XFER_COUNT); + if (td->dw1_value & SOTG_PTD_DW1_ENABLE_SPLIT) + count = (status & SOTG_PTD_DW3_XFER_COUNT_SPLIT); + else + count = (status & SOTG_PTD_DW3_XFER_COUNT_HS); got_short = 0; /* verify the packet byte count */ @@ -700,7 +703,10 @@ saf1761_host_intr_data_rx(struct saf1761 td->error_any = 1; goto complete; } - count = (status & SOTG_PTD_DW3_XFER_COUNT); + if (td->dw1_value & SOTG_PTD_DW1_ENABLE_SPLIT) + count = (status & SOTG_PTD_DW3_XFER_COUNT_SPLIT); + else + count = (status & SOTG_PTD_DW3_XFER_COUNT_HS); got_short = 0; /* verify the packet byte count */ @@ -895,7 +901,10 @@ saf1761_host_isoc_data_rx(struct saf1761 } else if (status & SOTG_PTD_DW3_HALTED) { goto complete; } - count = (status & SOTG_PTD_DW3_XFER_COUNT); + if (td->dw1_value & SOTG_PTD_DW1_ENABLE_SPLIT) + count = (status & SOTG_PTD_DW3_XFER_COUNT_SPLIT); + else + count = (status & SOTG_PTD_DW3_XFER_COUNT_HS); /* verify the packet byte count */ if (count != td->max_packet_size) { Modified: head/sys/dev/usb/controller/saf1761_otg_reg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_reg.h Sat Nov 22 08:09:26 2014 (r274841) +++ head/sys/dev/usb/controller/saf1761_otg_reg.h Sat Nov 22 08:47:04 2014 (r274842) @@ -211,7 +211,8 @@ #define SOTG_PTD_DW3_CERR_3 (3U << 23) #define SOTG_PTD_DW3_CERR_2 (2U << 23) /* infinite NAKs */ #define SOTG_PTD_DW3_CERR_1 (1U << 23) -#define SOTG_PTD_DW3_XFER_COUNT 0x7FFF +#define SOTG_PTD_DW3_XFER_COUNT_HS 0x7FFF +#define SOTG_PTD_DW3_XFER_COUNT_SPLIT 0x03FF #define SOTG_PTD_DW4 16 #define SOTG_PTD_DW5 20 #define SOTG_PTD_DW6 24 From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 09:05:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB0E43D3; Sat, 22 Nov 2014 09:05:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC1DC7D0; Sat, 22 Nov 2014 09:05:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM95sBt036724; Sat, 22 Nov 2014 09:05:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM95ser036723; Sat, 22 Nov 2014 09:05:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411220905.sAM95ser036723@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 22 Nov 2014 09:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274843 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 09:05:55 -0000 Author: mav Date: Sat Nov 22 09:05:54 2014 New Revision: 274843 URL: https://svnweb.freebsd.org/changeset/base/274843 Log: Move icl_pdu_get_data() and xpt_done() out of initiator's session lock. During heavy reads data copying in icl_pdu_get_data() may consume large percent of CPU time. Moving it out of the lock significantly reduces lock hold time and respectively lock congestion on read operations. MFC after: 2 weeks Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sat Nov 22 08:47:04 2014 (r274842) +++ head/sys/dev/iscsi/iscsi.c Sat Nov 22 09:05:54 2014 (r274843) @@ -139,6 +139,7 @@ static uma_zone_t iscsi_outstanding_zone #define ISCSI_SESSION_LOCK(X) mtx_lock(&X->is_lock) #define ISCSI_SESSION_UNLOCK(X) mtx_unlock(&X->is_lock) #define ISCSI_SESSION_LOCK_ASSERT(X) mtx_assert(&X->is_lock, MA_OWNED) +#define ISCSI_SESSION_LOCK_ASSERT_NOT(X) mtx_assert(&X->is_lock, MA_NOTOWNED) static int iscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int mode, struct thread *td); @@ -709,37 +710,46 @@ iscsi_receive_callback(struct icl_pdu *r switch (response->ip_bhs->bhs_opcode) { case ISCSI_BHS_OPCODE_NOP_IN: iscsi_pdu_handle_nop_in(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_SCSI_RESPONSE: iscsi_pdu_handle_scsi_response(response); + /* Session lock dropped inside. */ + ISCSI_SESSION_LOCK_ASSERT_NOT(is); break; case ISCSI_BHS_OPCODE_TASK_RESPONSE: iscsi_pdu_handle_task_response(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_SCSI_DATA_IN: iscsi_pdu_handle_data_in(response); + /* Session lock dropped inside. */ + ISCSI_SESSION_LOCK_ASSERT_NOT(is); break; case ISCSI_BHS_OPCODE_LOGOUT_RESPONSE: iscsi_pdu_handle_logout_response(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_R2T: iscsi_pdu_handle_r2t(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_ASYNC_MESSAGE: iscsi_pdu_handle_async_message(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_REJECT: iscsi_pdu_handle_reject(response); + ISCSI_SESSION_UNLOCK(is); break; default: ISCSI_SESSION_WARN(is, "received PDU with unsupported " "opcode 0x%x; reconnecting", response->ip_bhs->bhs_opcode); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); icl_pdu_free(response); } - - ISCSI_SESSION_UNLOCK(is); } static void @@ -840,9 +850,13 @@ iscsi_pdu_handle_scsi_response(struct ic ISCSI_SESSION_WARN(is, "bad itt 0x%x", bhssr->bhssr_initiator_task_tag); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } + iscsi_outstanding_remove(is, io); + ISCSI_SESSION_UNLOCK(is); + if (bhssr->bhssr_response != BHSSR_RESPONSE_COMMAND_COMPLETED) { ISCSI_SESSION_WARN(is, "service response 0x%x", bhssr->bhssr_response); if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { @@ -861,15 +875,7 @@ iscsi_pdu_handle_scsi_response(struct ic io->io_ccb->csio.scsi_status = bhssr->bhssr_status; } - if (bhssr->bhssr_flags & BHSSR_FLAGS_RESIDUAL_OVERFLOW) { - ISCSI_SESSION_WARN(is, "target indicated residual overflow"); - icl_pdu_free(response); - iscsi_session_reconnect(is); - return; - } - csio = &io->io_ccb->csio; - data_segment_len = icl_pdu_data_segment_length(response); if (data_segment_len > 0) { if (data_segment_len < sizeof(sense_len)) { @@ -931,7 +937,6 @@ out: } xpt_done(io->io_ccb); - iscsi_outstanding_remove(is, io); icl_pdu_free(response); } @@ -974,7 +979,7 @@ iscsi_pdu_handle_data_in(struct icl_pdu struct iscsi_outstanding *io; struct iscsi_session *is; struct ccb_scsiio *csio; - size_t data_segment_len; + size_t data_segment_len, received; is = PDU_SESSION(response); bhsdi = (struct iscsi_bhs_data_in *)response->ip_bhs; @@ -983,6 +988,7 @@ iscsi_pdu_handle_data_in(struct icl_pdu ISCSI_SESSION_WARN(is, "bad itt 0x%x", bhsdi->bhsdi_initiator_task_tag); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } @@ -993,6 +999,7 @@ iscsi_pdu_handle_data_in(struct icl_pdu * but initiators and targets MUST be able to properly receive * 0 length data segments." */ + ISCSI_SESSION_UNLOCK(is); icl_pdu_free(response); return; } @@ -1007,6 +1014,7 @@ iscsi_pdu_handle_data_in(struct icl_pdu io->io_received, (size_t)ntohl(bhsdi->bhsdi_buffer_offset)); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } @@ -1018,11 +1026,17 @@ iscsi_pdu_handle_data_in(struct icl_pdu data_segment_len, io->io_received, csio->dxfer_len); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } - icl_pdu_get_data(response, 0, csio->data_ptr + io->io_received, data_segment_len); + received = io->io_received; io->io_received += data_segment_len; + if ((bhsdi->bhsdi_flags & BHSDI_FLAGS_S) != 0) + iscsi_outstanding_remove(is, io); + ISCSI_SESSION_UNLOCK(is); + + icl_pdu_get_data(response, 0, csio->data_ptr + received, data_segment_len); /* * XXX: Check DataSN. @@ -1064,7 +1078,6 @@ iscsi_pdu_handle_data_in(struct icl_pdu } xpt_done(io->io_ccb); - iscsi_outstanding_remove(is, io); icl_pdu_free(response); } From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 09:45:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1C96E6; Sat, 22 Nov 2014 09:45:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3005B26; Sat, 22 Nov 2014 09:45:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM9jW8U059987; Sat, 22 Nov 2014 09:45:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM9jWh7059986; Sat, 22 Nov 2014 09:45:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411220945.sAM9jWh7059986@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 22 Nov 2014 09:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274845 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 09:45:33 -0000 Author: mav Date: Sat Nov 22 09:45:32 2014 New Revision: 274845 URL: https://svnweb.freebsd.org/changeset/base/274845 Log: Fix use-after-free introduced in r274843. I've missed that iscsi_outstanding_remove() frees the second pointer, so it should no longer be used. And in fact we don't really need to. MFC after: 2 weeks Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sat Nov 22 09:38:18 2014 (r274844) +++ head/sys/dev/iscsi/iscsi.c Sat Nov 22 09:45:32 2014 (r274845) @@ -838,8 +838,9 @@ iscsi_pdu_handle_scsi_response(struct ic struct iscsi_bhs_scsi_response *bhssr; struct iscsi_outstanding *io; struct iscsi_session *is; + union ccb *ccb; struct ccb_scsiio *csio; - size_t data_segment_len; + size_t data_segment_len, received; uint16_t sense_len; is = PDU_SESSION(response); @@ -854,38 +855,40 @@ iscsi_pdu_handle_scsi_response(struct ic return; } + ccb = io->io_ccb; + received = io->io_received; iscsi_outstanding_remove(is, io); ISCSI_SESSION_UNLOCK(is); if (bhssr->bhssr_response != BHSSR_RESPONSE_COMMAND_COMPLETED) { ISCSI_SESSION_WARN(is, "service response 0x%x", bhssr->bhssr_response); - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; } else if (bhssr->bhssr_status == 0) { - io->io_ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_CMP; } else { - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; - io->io_ccb->csio.scsi_status = bhssr->bhssr_status; + ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; + ccb->csio.scsi_status = bhssr->bhssr_status; } - csio = &io->io_ccb->csio; + csio = &ccb->csio; data_segment_len = icl_pdu_data_segment_length(response); if (data_segment_len > 0) { if (data_segment_len < sizeof(sense_len)) { ISCSI_SESSION_WARN(is, "truncated data segment (%zd bytes)", data_segment_len); - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; goto out; } icl_pdu_get_data(response, 0, &sense_len, sizeof(sense_len)); @@ -898,11 +901,11 @@ iscsi_pdu_handle_scsi_response(struct ic ISCSI_SESSION_WARN(is, "truncated data segment " "(%zd bytes, should be %zd)", data_segment_len, sizeof(sense_len) + sense_len); - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; goto out; } else if (sizeof(sense_len) + sense_len < data_segment_len) ISCSI_SESSION_WARN(is, "oversize data segment " @@ -915,7 +918,7 @@ iscsi_pdu_handle_scsi_response(struct ic } icl_pdu_get_data(response, sizeof(sense_len), &csio->sense_data, sense_len); csio->sense_resid = csio->sense_len - sense_len; - io->io_ccb->ccb_h.status |= CAM_AUTOSNS_VALID; + ccb->ccb_h.status |= CAM_AUTOSNS_VALID; } out: @@ -923,20 +926,19 @@ out: csio->resid = ntohl(bhssr->bhssr_residual_count); if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - KASSERT(io->io_received <= csio->dxfer_len, - ("io->io_received > csio->dxfer_len")); - if (io->io_received < csio->dxfer_len) { - if (csio->resid != csio->dxfer_len - io->io_received) { + KASSERT(received <= csio->dxfer_len, + ("received > csio->dxfer_len")); + if (received < csio->dxfer_len) { + if (csio->resid != csio->dxfer_len - received) { ISCSI_SESSION_WARN(is, "underflow mismatch: " "target indicates %d, we calculated %zd", - csio->resid, - csio->dxfer_len - io->io_received); + csio->resid, csio->dxfer_len - received); } - csio->resid = csio->dxfer_len - io->io_received; + csio->resid = csio->dxfer_len - received; } } - xpt_done(io->io_ccb); + xpt_done(ccb); icl_pdu_free(response); } @@ -978,8 +980,9 @@ iscsi_pdu_handle_data_in(struct icl_pdu struct iscsi_bhs_data_in *bhsdi; struct iscsi_outstanding *io; struct iscsi_session *is; + union ccb *ccb; struct ccb_scsiio *csio; - size_t data_segment_len, received; + size_t data_segment_len, received, oreceived; is = PDU_SESSION(response); bhsdi = (struct iscsi_bhs_data_in *)response->ip_bhs; @@ -1018,7 +1021,8 @@ iscsi_pdu_handle_data_in(struct icl_pdu return; } - csio = &io->io_ccb->csio; + ccb = io->io_ccb; + csio = &ccb->csio; if (io->io_received + data_segment_len > csio->dxfer_len) { ISCSI_SESSION_WARN(is, "oversize data segment (%zd bytes " @@ -1030,13 +1034,14 @@ iscsi_pdu_handle_data_in(struct icl_pdu return; } - received = io->io_received; + oreceived = io->io_received; io->io_received += data_segment_len; + received = io->io_received; if ((bhsdi->bhsdi_flags & BHSDI_FLAGS_S) != 0) iscsi_outstanding_remove(is, io); ISCSI_SESSION_UNLOCK(is); - icl_pdu_get_data(response, 0, csio->data_ptr + received, data_segment_len); + icl_pdu_get_data(response, 0, csio->data_ptr + oreceived, data_segment_len); /* * XXX: Check DataSN. @@ -1052,32 +1057,31 @@ iscsi_pdu_handle_data_in(struct icl_pdu //ISCSI_SESSION_DEBUG(is, "got S flag; status 0x%x", bhsdi->bhsdi_status); if (bhsdi->bhsdi_status == 0) { - io->io_ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_CMP; } else { - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; csio->scsi_status = bhsdi->bhsdi_status; } if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - KASSERT(io->io_received <= csio->dxfer_len, - ("io->io_received > csio->dxfer_len")); - if (io->io_received < csio->dxfer_len) { + KASSERT(received <= csio->dxfer_len, + ("received > csio->dxfer_len")); + if (received < csio->dxfer_len) { csio->resid = ntohl(bhsdi->bhsdi_residual_count); - if (csio->resid != csio->dxfer_len - io->io_received) { + if (csio->resid != csio->dxfer_len - received) { ISCSI_SESSION_WARN(is, "underflow mismatch: " "target indicates %d, we calculated %zd", - csio->resid, - csio->dxfer_len - io->io_received); + csio->resid, csio->dxfer_len - received); } - csio->resid = csio->dxfer_len - io->io_received; + csio->resid = csio->dxfer_len - received; } } - xpt_done(io->io_ccb); + xpt_done(ccb); icl_pdu_free(response); } From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 12:10:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1C76EBD; Sat, 22 Nov 2014 12:10:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E625A22; Sat, 22 Nov 2014 12:10:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMCAANm028054; Sat, 22 Nov 2014 12:10:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMCAAIV028053; Sat, 22 Nov 2014 12:10:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411221210.sAMCAAIV028053@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 22 Nov 2014 12:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274846 - head/contrib/libarchive/cpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 12:10:10 -0000 Author: dim Date: Sat Nov 22 12:10:09 2014 New Revision: 274846 URL: https://svnweb.freebsd.org/changeset/base/274846 Log: Fix the following -Werror warning from clang 3.5.0, while building usr.bin/cpio on amd64 (or any arch with 64-bit time_t): contrib/libarchive/cpio/cpio.c:1143:6: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value] if (abs(mtime - now) > (365/2)*86400) ^ contrib/libarchive/cpio/cpio.c:1143:6: note: use function 'labs' instead if (abs(mtime - now) > (365/2)*86400) ^~~ labs 1 error generated. This is because time_t is a long on amd64. To avoid the warning, just copy the equivalent test from a few lines before, which is used in the Windows case, and which is type safe. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D1198 Modified: head/contrib/libarchive/cpio/cpio.c Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Sat Nov 22 09:45:32 2014 (r274845) +++ head/contrib/libarchive/cpio/cpio.c Sat Nov 22 12:10:09 2014 (r274846) @@ -1140,7 +1140,8 @@ list_item_verbose(struct cpio *cpio, str else fmt = cpio->day_first ? "%d %b %H:%M" : "%b %d %H:%M"; #else - if (abs(mtime - now) > (365/2)*86400) + if (mtime - now > 365*86400/2 + || mtime - now < -365*86400/2) fmt = cpio->day_first ? "%e %b %Y" : "%b %e %Y"; else fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M"; From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 12:13:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3E04E3; Sat, 22 Nov 2014 12:13:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4B48A4B; Sat, 22 Nov 2014 12:13:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMCD6Xq031224; Sat, 22 Nov 2014 12:13:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMCD69L031223; Sat, 22 Nov 2014 12:13:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411221213.sAMCD69L031223@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 22 Nov 2014 12:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274847 - head/usr.bin/locate/locate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 12:13:07 -0000 Author: dim Date: Sat Nov 22 12:13:05 2014 New Revision: 274847 URL: https://svnweb.freebsd.org/changeset/base/274847 Log: Fix the following -Werror warnings from clang 3.5.0, while building usr.bin/locate: usr.bin/locate/locate/util.c:249:29: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i)); ^ usr.bin/locate/locate/util.c:249:29: note: remove the call to 'abs' since unsigned values cannot be negative MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i)); ^~~ usr.bin/locate/locate/util.c:274:32: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] MAXPATHLEN, abs(word) < abs(htonl(word)) ? word : ^ usr.bin/locate/locate/util.c:274:32: note: remove the call to 'abs' since unsigned values cannot be negative MAXPATHLEN, abs(word) < abs(htonl(word)) ? word : ^~~ The problem is that ntohl() always returns an unsigned quantity. In this case, it's expected to be cast back to a signed integer, but to stop complaints about abs() we just store it into an integer, and don't call ntohl() again. Reviewed by: ngie MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D1196 Modified: head/usr.bin/locate/locate/util.c Modified: head/usr.bin/locate/locate/util.c ============================================================================== --- head/usr.bin/locate/locate/util.c Sat Nov 22 12:10:09 2014 (r274846) +++ head/usr.bin/locate/locate/util.c Sat Nov 22 12:13:05 2014 (r274847) @@ -235,7 +235,7 @@ getwm(p) char buf[INTSIZE]; int i; } u; - register int i; + register int i, hi; for (i = 0; i < (int)INTSIZE; i++) u.buf[i] = *p++; @@ -243,10 +243,11 @@ getwm(p) i = u.i; if (i > MAXPATHLEN || i < -(MAXPATHLEN)) { - i = ntohl(i); - if (i > MAXPATHLEN || i < -(MAXPATHLEN)) + hi = ntohl(i); + if (hi > MAXPATHLEN || hi < -(MAXPATHLEN)) errx(1, "integer out of +-MAXPATHLEN (%d): %u", - MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i)); + MAXPATHLEN, abs(i) < abs(hi) ? i : hi); + return(hi); } return(i); } @@ -263,16 +264,16 @@ int getwf(fp) FILE *fp; { - register int word; + register int word, hword; word = getw(fp); if (word > MAXPATHLEN || word < -(MAXPATHLEN)) { - word = ntohl(word); - if (word > MAXPATHLEN || word < -(MAXPATHLEN)) + hword = ntohl(word); + if (hword > MAXPATHLEN || hword < -(MAXPATHLEN)) errx(1, "integer out of +-MAXPATHLEN (%d): %u", - MAXPATHLEN, abs(word) < abs(htonl(word)) ? word : - htonl(word)); + MAXPATHLEN, abs(word) < abs(hword) ? word : hword); + return(hword); } return(word); } From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 12:48:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2B2B8BE; Sat, 22 Nov 2014 12:48:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF492CDD; Sat, 22 Nov 2014 12:48:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMCm9wI046371; Sat, 22 Nov 2014 12:48:09 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMCm9rY046370; Sat, 22 Nov 2014 12:48:09 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411221248.sAMCm9rY046370@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 12:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274849 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 12:48:10 -0000 Author: bapt Date: Sat Nov 22 12:48:09 2014 New Revision: 274849 URL: https://svnweb.freebsd.org/changeset/base/274849 Log: Enforce -lpthread and -lc to always be the 2 last components of the link list Differential Revision: https://reviews.freebsd.org/D1118 Suggested by: kib Modified: head/share/mk/bsd.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Sat Nov 22 12:44:31 2014 (r274848) +++ head/share/mk/bsd.libnames.mk Sat Nov 22 12:48:09 2014 (r274849) @@ -161,3 +161,13 @@ LIBZ?= ${DESTDIR}${LIBDIR}/libz.a LIBZFS?= ${DESTDIR}${LIBDIR}/libzfs.a LIBZFS_CORE?= ${DESTDIR}${LIBDIR}/libzfs_core.a LIBZPOOL?= ${DESTDIR}${LIBDIR}/libzpool.a + +# enforce the 2 -lpthread and -lc to always be the last in that exact order +.if defined(LDADD) +.if ${LDADD:M-lpthread} +LDADD:= ${LDADD:N-lpthread} -lpthread +.endif +.if ${LDADD:M-lc} +LDADD:= ${LDADD:N-lc} -lc +.endif +.endif From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 14:53:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEDD2F78; Sat, 22 Nov 2014 14:53:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB740AC2; Sat, 22 Nov 2014 14:53:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMEroER011186; Sat, 22 Nov 2014 14:53:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMEroJP011185; Sat, 22 Nov 2014 14:53:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411221453.sAMEroJP011185@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 22 Nov 2014 14:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274851 - head/usr.bin/dpv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 14:53:51 -0000 Author: ian Date: Sat Nov 22 14:53:50 2014 New Revision: 274851 URL: https://svnweb.freebsd.org/changeset/base/274851 Log: Add libm to eliminate "undefined reference to sqrt" on arm 'softfp' builds. Modified: head/usr.bin/dpv/Makefile Modified: head/usr.bin/dpv/Makefile ============================================================================== --- head/usr.bin/dpv/Makefile Sat Nov 22 13:06:47 2014 (r274850) +++ head/usr.bin/dpv/Makefile Sat Nov 22 14:53:50 2014 (r274851) @@ -4,8 +4,8 @@ PROG= dpv CFLAGS+= -I${.CURDIR} -DPADD= ${LIBDPV} ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBUTIL} -LDADD= -ldpv -ldialog -lfigpar -lncursesw -lutil +DPADD= ${LIBDPV} ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBUTIL} ${LIBM} +LDADD= -ldpv -ldialog -lfigpar -lncursesw -lutil -lm WARNS?= 6 From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 14:59:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0856025F; Sat, 22 Nov 2014 14:59:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF430AED; Sat, 22 Nov 2014 14:59:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMExoIl012008; Sat, 22 Nov 2014 14:59:50 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMExoJj012007; Sat, 22 Nov 2014 14:59:50 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201411221459.sAMExoJj012007@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sat, 22 Nov 2014 14:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274852 - head/sys/dev/asr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 14:59:51 -0000 Author: smh Date: Sat Nov 22 14:59:50 2014 New Revision: 274852 URL: https://svnweb.freebsd.org/changeset/base/274852 Log: Fix build with asr driver This was broken by r274819 as asr is not in GENERIC because its not 64bit safe. MFC after: 1 month X-MFC-With: r274819 Sponsored by: Multiplay Modified: head/sys/dev/asr/asr.c Modified: head/sys/dev/asr/asr.c ============================================================================== --- head/sys/dev/asr/asr.c Sat Nov 22 14:53:50 2014 (r274851) +++ head/sys/dev/asr/asr.c Sat Nov 22 14:59:50 2014 (r274852) @@ -384,26 +384,6 @@ typedef struct Asr_softc { static STAILQ_HEAD(, Asr_softc) Asr_softc_list = STAILQ_HEAD_INITIALIZER(Asr_softc_list); - -static __inline void -set_ccb_timeout_ch(union asr_ccb *ccb) -{ - struct callout_handle ch; - - ch = timeout(asr_timeout, (caddr_t)ccb, - (int)((u_int64_t)(ccb->ccb_h.timeout) * (u_int32_t)hz / 1000)); - ccb->ccb_h.sim_priv.entries[0].ptr = ch.callout; -} - -static __inline struct callout_handle -get_ccb_timeout_ch(union asr_ccb *ccb) -{ - struct callout_handle ch; - - ch.callout = ccb->ccb_h.sim_priv.entries[0].ptr; - return ch; -} - /* * Prototypes of the routines we have in this object. */ @@ -426,6 +406,25 @@ static void asr_action(struct cam_sim *s static void asr_poll(struct cam_sim *sim); static int ASR_queue(Asr_softc_t *sc, PI2O_MESSAGE_FRAME Message); +static __inline void +set_ccb_timeout_ch(union asr_ccb *ccb) +{ + struct callout_handle ch; + + ch = timeout(asr_timeout, (caddr_t)ccb, + (int)((u_int64_t)(ccb->ccb_h.timeout) * (u_int32_t)hz / 1000)); + ccb->ccb_h.sim_priv.entries[0].ptr = ch.callout; +} + +static __inline struct callout_handle +get_ccb_timeout_ch(union asr_ccb *ccb) +{ + struct callout_handle ch; + + ch.callout = ccb->ccb_h.sim_priv.entries[0].ptr; + return ch; +} + /* * Here is the auto-probe structure used to nest our tests appropriately * during the startup phase of the operating system. From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 15:09:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E12CA408; Sat, 22 Nov 2014 15:09:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCE96BCA; Sat, 22 Nov 2014 15:09:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMF9KMq016810; Sat, 22 Nov 2014 15:09:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMF9JIh016800; Sat, 22 Nov 2014 15:09:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411221509.sAMF9JIh016800@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 22 Nov 2014 15:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274853 - in head: sys/dev/iscsi usr.sbin/ctld usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 15:09:21 -0000 Author: mav Date: Sat Nov 22 15:09:18 2014 New Revision: 274853 URL: https://svnweb.freebsd.org/changeset/base/274853 Log: For both iSCSI initiator and target increase socket buffer sizes before establishing connection. This is a workaround for Chelsio TOE driver, that does not update socket buffer size in hardware after connection established, and unless that is done beforehand, kernel code will stuck, attempting to send/receive full PDU at once. MFC after: 1 week Modified: head/sys/dev/iscsi/icl.c head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/iscsid/iscsid.c head/usr.sbin/iscsid/iscsid.h Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Sat Nov 22 14:59:50 2014 (r274852) +++ head/sys/dev/iscsi/icl.c Sat Nov 22 15:09:18 2014 (r274853) @@ -1199,6 +1199,8 @@ icl_conn_start(struct icl_conn *ic) icl_conn_close(ic); return (error); } + ic->ic_socket->so_snd.sb_flags |= SB_AUTOSIZE; + ic->ic_socket->so_rcv.sb_flags |= SB_AUTOSIZE; /* * Disable Nagle. Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Sat Nov 22 14:59:50 2014 (r274852) +++ head/usr.sbin/ctld/ctld.c Sat Nov 22 15:09:18 2014 (r274853) @@ -1602,7 +1602,7 @@ conf_apply(struct conf *oldconf, struct struct portal *oldp, *newp; struct isns *oldns, *newns; pid_t otherpid; - int changed, cumulated_error = 0, error; + int changed, cumulated_error = 0, error, sockbuf; int one = 1; if (oldconf->conf_debug != newconf->conf_debug) { @@ -1899,6 +1899,16 @@ conf_apply(struct conf *oldconf, struct cumulated_error++; continue; } + sockbuf = SOCKBUF_SIZE; + if (setsockopt(newp->p_socket, SOL_SOCKET, SO_RCVBUF, + &sockbuf, sizeof(sockbuf)) == -1) + log_warn("setsockopt(SO_RCVBUF) failed " + "for %s", newp->p_listen); + sockbuf = SOCKBUF_SIZE; + if (setsockopt(newp->p_socket, SOL_SOCKET, SO_SNDBUF, + &sockbuf, sizeof(sockbuf)) == -1) + log_warn("setsockopt(SO_SNDBUF) failed " + "for %s", newp->p_listen); error = setsockopt(newp->p_socket, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); if (error != 0) { Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Sat Nov 22 14:59:50 2014 (r274852) +++ head/usr.sbin/ctld/ctld.h Sat Nov 22 15:09:18 2014 (r274853) @@ -48,6 +48,7 @@ #define MAX_NAME_LEN 223 #define MAX_DATA_SEGMENT_LENGTH (128 * 1024) #define MAX_BURST_LENGTH 16776192 +#define SOCKBUF_SIZE 1048576 struct auth { TAILQ_ENTRY(auth) a_next; Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Sat Nov 22 14:59:50 2014 (r274852) +++ head/usr.sbin/iscsid/iscsid.c Sat Nov 22 15:09:18 2014 (r274853) @@ -160,7 +160,7 @@ connection_new(unsigned int session_id, #ifdef ICL_KERNEL_PROXY struct iscsi_daemon_connect idc; #endif - int error; + int error, sockbuf; conn = calloc(1, sizeof(*conn)); if (conn == NULL) @@ -237,6 +237,14 @@ connection_new(unsigned int session_id, fail(conn, strerror(errno)); log_err(1, "failed to create socket for %s", from_addr); } + sockbuf = SOCKBUF_SIZE; + if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_RCVBUF, + &sockbuf, sizeof(sockbuf)) == -1) + log_warn("setsockopt(SO_RCVBUF) failed"); + sockbuf = SOCKBUF_SIZE; + if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_SNDBUF, + &sockbuf, sizeof(sockbuf)) == -1) + log_warn("setsockopt(SO_SNDBUF) failed"); if (from_ai != NULL) { error = bind(conn->conn_socket, from_ai->ai_addr, from_ai->ai_addrlen); Modified: head/usr.sbin/iscsid/iscsid.h ============================================================================== --- head/usr.sbin/iscsid/iscsid.h Sat Nov 22 14:59:50 2014 (r274852) +++ head/usr.sbin/iscsid/iscsid.h Sat Nov 22 15:09:18 2014 (r274853) @@ -44,6 +44,7 @@ #define CONN_DIGEST_CRC32C 1 #define CONN_MUTUAL_CHALLENGE_LEN 1024 +#define SOCKBUF_SIZE 1048576 struct connection { int conn_iscsi_fd; From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 16:03:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 827E5FA2; Sat, 22 Nov 2014 16:03:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EBA4114; Sat, 22 Nov 2014 16:03:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMG3JdA044390; Sat, 22 Nov 2014 16:03:19 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMG3Jho044388; Sat, 22 Nov 2014 16:03:19 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201411221603.sAMG3Jho044388@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 22 Nov 2014 16:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274854 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 16:03:19 -0000 Author: jilles Date: Sat Nov 22 16:03:18 2014 New Revision: 274854 URL: https://svnweb.freebsd.org/changeset/base/274854 Log: sh: Use DQSYNTAX only while expanding, not SQSYNTAX. Quoting during expansion only cares about CCTL, which is the same for DQSYNTAX and SQSYNTAX. Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sat Nov 22 15:09:18 2014 (r274853) +++ head/bin/sh/expand.c Sat Nov 22 16:03:18 2014 (r274854) @@ -337,7 +337,7 @@ done: if (home == NULL || *home == '\0') return (startp); if (quotes) - STPUTS_QUOTES(home, SQSYNTAX, expdest); + STPUTS_QUOTES(home, DQSYNTAX, expdest); else STPUTS(home, expdest); return (p); From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 16:30:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F326FC72; Sat, 22 Nov 2014 16:30:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFCAA380; Sat, 22 Nov 2014 16:30:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMGUVg7056588; Sat, 22 Nov 2014 16:30:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMGUV83056587; Sat, 22 Nov 2014 16:30:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411221630.sAMGUV83056587@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 22 Nov 2014 16:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274856 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 16:30:32 -0000 Author: dim Date: Sat Nov 22 16:30:31 2014 New Revision: 274856 URL: https://svnweb.freebsd.org/changeset/base/274856 Log: Avoid undefined behaviour in gas's rotate_left() macro for n == 0. Otherwise, clang can effectively remove the first iteration of the for loops where this macro is invoked, and as a result, "cmp r0, #99" fails to assemble. Obtained from: joerg at netbsd MFC after: 3 days Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Sat Nov 22 16:27:51 2014 (r274855) +++ head/contrib/binutils/gas/config/tc-arm.c Sat Nov 22 16:30:31 2014 (r274856) @@ -6079,7 +6079,7 @@ parse_operands (char *str, const unsigne /* Functions for operand encoding. ARM, then Thumb. */ -#define rotate_left(v, n) (v << n | v >> (32 - n)) +#define rotate_left(v, n) (v << (n % 32) | v >> ((32 - n) % 32)) /* If VAL can be encoded in the immediate field of an ARM instruction, return the encoded form. Otherwise, return FAIL. */ From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 16:43:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84D23F84; Sat, 22 Nov 2014 16:43:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 714BB6EF; Sat, 22 Nov 2014 16:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMGhbEJ064580; Sat, 22 Nov 2014 16:43:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMGhbuU064579; Sat, 22 Nov 2014 16:43:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411221643.sAMGhbuU064579@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 22 Nov 2014 16:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274857 - head/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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 16:43:37 -0000 Author: trasz Date: Sat Nov 22 16:43:36 2014 New Revision: 274857 URL: https://svnweb.freebsd.org/changeset/base/274857 Log: Cross-reference automount(8) from mount(8). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/mount/mount.8 Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Sat Nov 22 16:30:31 2014 (r274856) +++ head/sbin/mount/mount.8 Sat Nov 22 16:43:36 2014 (r274857) @@ -28,7 +28,7 @@ .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" $FreeBSD$ .\" -.Dd August 20, 2014 +.Dd November 22, 2014 .Dt MOUNT 8 .Os .Sh NAME @@ -548,6 +548,7 @@ support for a particular file system mig .Xr ext2fs 5 , .Xr fstab 5 , .Xr procfs 5 , +.Xr automount 8 , .Xr kldload 8 , .Xr mount_cd9660 8 , .Xr mount_msdosfs 8 , From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 16:46:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F0E223F; Sat, 22 Nov 2014 16:46:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C04875E; Sat, 22 Nov 2014 16:46:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMGk159065227; Sat, 22 Nov 2014 16:46:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMGk1SG065225; Sat, 22 Nov 2014 16:46:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411221646.sAMGk1SG065225@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 22 Nov 2014 16:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274858 - head/sbin/umount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 16:46:01 -0000 Author: trasz Date: Sat Nov 22 16:46:00 2014 New Revision: 274858 URL: https://svnweb.freebsd.org/changeset/base/274858 Log: Cross-reference autounmountd(8) from umount(8). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/umount/umount.8 Modified: head/sbin/umount/umount.8 ============================================================================== --- head/sbin/umount/umount.8 Sat Nov 22 16:43:36 2014 (r274857) +++ head/sbin/umount/umount.8 Sat Nov 22 16:46:00 2014 (r274858) @@ -28,7 +28,7 @@ .\" @(#)umount.8 8.2 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd May 31, 2011 +.Dd November 22, 2014 .Dt UMOUNT 8 .Os .Sh NAME @@ -140,6 +140,7 @@ file system table .Sh SEE ALSO .Xr unmount 2 , .Xr fstab 5 , +.Xr autounmountd 8 , .Xr mount 8 .Sh HISTORY A From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 16:48:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A2983CC; Sat, 22 Nov 2014 16:48:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B1C5770; Sat, 22 Nov 2014 16:48:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMGmVvo065756; Sat, 22 Nov 2014 16:48:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMGmUtR065746; Sat, 22 Nov 2014 16:48:30 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411221648.sAMGmUtR065746@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 22 Nov 2014 16:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274859 - in head: sys/fs/autofs usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 16:48:31 -0000 Author: trasz Date: Sat Nov 22 16:48:29 2014 New Revision: 274859 URL: https://svnweb.freebsd.org/changeset/base/274859 Log: Implement "automount -c". MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs.c head/sys/fs/autofs/autofs.h head/sys/fs/autofs/autofs_vfsops.c head/usr.sbin/autofs/automount.8 head/usr.sbin/autofs/automount.c Modified: head/sys/fs/autofs/autofs.c ============================================================================== --- head/sys/fs/autofs/autofs.c Sat Nov 22 16:46:00 2014 (r274858) +++ head/sys/fs/autofs/autofs.c Sat Nov 22 16:48:29 2014 (r274859) @@ -318,6 +318,18 @@ autofs_cache_callout(void *context) anp->an_cached = false; } +void +autofs_flush(struct autofs_mount *amp) +{ + + /* + * XXX: This will do for now, but ideally we should iterate + * over all the nodes. + */ + amp->am_root->an_cached = false; + AUTOFS_DEBUG("%s flushed", amp->am_mountpoint); +} + /* * The set/restore sigmask functions are used to (temporarily) overwrite * the thread td_sigmask during triggering. Modified: head/sys/fs/autofs/autofs.h ============================================================================== --- head/sys/fs/autofs/autofs.h Sat Nov 22 16:46:00 2014 (r274858) +++ head/sys/fs/autofs/autofs.h Sat Nov 22 16:48:29 2014 (r274859) @@ -133,6 +133,7 @@ int autofs_trigger(struct autofs_node *a int componentlen); bool autofs_cached(struct autofs_node *anp, const char *component, int componentlen); +void autofs_flush(struct autofs_mount *amp); bool autofs_ignore_thread(const struct thread *td); int autofs_node_new(struct autofs_node *parent, struct autofs_mount *amp, const char *name, int namelen, struct autofs_node **anpp); Modified: head/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- head/sys/fs/autofs/autofs_vfsops.c Sat Nov 22 16:46:00 2014 (r274858) +++ head/sys/fs/autofs/autofs_vfsops.c Sat Nov 22 16:48:29 2014 (r274859) @@ -61,8 +61,10 @@ autofs_mount(struct mount *mp) if (vfs_filteropt(mp->mnt_optnew, autofs_opts)) return (EINVAL); - if (mp->mnt_flag & MNT_UPDATE) + if (mp->mnt_flag & MNT_UPDATE) { + autofs_flush(VFSTOAUTOFS(mp)); return (0); + } if (vfs_getopt(mp->mnt_optnew, "from", (void **)&from, NULL)) return (EINVAL); Modified: head/usr.sbin/autofs/automount.8 ============================================================================== --- head/usr.sbin/autofs/automount.8 Sat Nov 22 16:46:00 2014 (r274858) +++ head/usr.sbin/autofs/automount.8 Sat Nov 22 16:48:29 2014 (r274859) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2014 +.Dd November 22, 2014 .Dt AUTOMOUNT 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Nm .Op Fl D Ar name=value .Op Fl L +.Op Fl c .Op Fl f .Op Fl o Ar options .Op Fl v @@ -64,6 +65,9 @@ and any direct maps, then print them to When specified more than once, all the maps, including indirect ones, will be parsed and shown. This is useful when debugging configuration problems. +.It Fl c +Flush caches, discarding possibly stale information obtained from maps +and directory services. .It Fl f Force unmount, to be used with .Fl u . Modified: head/usr.sbin/autofs/automount.c ============================================================================== --- head/usr.sbin/autofs/automount.c Sat Nov 22 16:46:00 2014 (r274858) +++ head/usr.sbin/autofs/automount.c Sat Nov 22 16:48:29 2014 (r274859) @@ -230,6 +230,57 @@ mount_unmount(struct node *root) } static void +flush_autofs(const char *fspath) +{ + struct iovec *iov = NULL; + char errmsg[255]; + int error, iovlen = 0; + + log_debugx("flushing %s", fspath); + memset(errmsg, 0, sizeof(errmsg)); + + build_iovec(&iov, &iovlen, "fstype", + __DECONST(void *, "autofs"), (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", + __DECONST(void *, fspath), (size_t)-1); + build_iovec(&iov, &iovlen, "errmsg", + errmsg, sizeof(errmsg)); + + error = nmount(iov, iovlen, MNT_UPDATE); + if (error != 0) { + if (*errmsg != '\0') { + log_err(1, "cannot flush %s: %s", + fspath, errmsg); + } else { + log_err(1, "cannot flush %s", fspath); + } + } +} + +static void +flush_caches(void) +{ + struct statfs *mntbuf; + int i, nitems; + + nitems = getmntinfo(&mntbuf, MNT_WAIT); + if (nitems <= 0) + log_err(1, "getmntinfo"); + + log_debugx("flushing autofs caches"); + + for (i = 0; i < nitems; i++) { + if (strcmp(mntbuf[i].f_fstypename, "autofs") != 0) { + log_debugx("skipping %s, filesystem type is not autofs", + mntbuf[i].f_mntonname); + continue; + } + + flush_autofs(mntbuf[i].f_mntonname); + } +} + +static void unmount_automounted(bool force) { struct statfs *mntbuf; @@ -262,7 +313,7 @@ static void usage_automount(void) { - fprintf(stderr, "usage: automount [-D name=value][-o opts][-Lfuv]\n"); + fprintf(stderr, "usage: automount [-D name=value][-o opts][-Lcfuv]\n"); exit(1); } @@ -272,7 +323,7 @@ main_automount(int argc, char **argv) struct node *root; int ch, debug = 0, show_maps = 0; char *options = NULL; - bool do_unmount = false, force_unmount = false; + bool do_unmount = false, force_unmount = false, flush = false; /* * Note that in automount(8), the only purpose of variable @@ -280,7 +331,7 @@ main_automount(int argc, char **argv) */ defined_init(); - while ((ch = getopt(argc, argv, "D:Lfo:uv")) != -1) { + while ((ch = getopt(argc, argv, "D:Lfco:uv")) != -1) { switch (ch) { case 'D': defined_parse_and_add(optarg); @@ -288,6 +339,9 @@ main_automount(int argc, char **argv) case 'L': show_maps++; break; + case 'c': + flush = true; + break; case 'f': force_unmount = true; break; @@ -319,6 +373,11 @@ main_automount(int argc, char **argv) log_init(debug); + if (flush) { + flush_caches(); + return (0); + } + if (do_unmount) { unmount_automounted(force_unmount); return (0); From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 17:26:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE871870; Sat, 22 Nov 2014 17:26:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A71DBB8; Sat, 22 Nov 2014 17:26:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMHQiTp086314; Sat, 22 Nov 2014 17:26:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMHQibd086313; Sat, 22 Nov 2014 17:26:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411221726.sAMHQibd086313@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 22 Nov 2014 17:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274863 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 17:26:44 -0000 Author: hselasky Date: Sat Nov 22 17:26:43 2014 New Revision: 274863 URL: https://svnweb.freebsd.org/changeset/base/274863 Log: Fix the host mode ISOCHRONOUS transfer interval programming in the SAF1761 OTG driver. Currently the driver logic is very simple and double buffering the USB transactions is not done. Also you need to use an external USB high speed USB HUB for reliable FULL speed outgoing ISOCHRONOUS traffic, because the internal one chokes on so-called split transfers above 188 bytes. Modified: head/sys/dev/usb/controller/saf1761_otg.c Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Sat Nov 22 17:19:39 2014 (r274862) +++ head/sys/dev/usb/controller/saf1761_otg.c Sat Nov 22 17:26:43 2014 (r274863) @@ -756,10 +756,14 @@ saf1761_host_intr_data_rx(struct saf1761 SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW7, 0); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); - temp = (0xFC << td->uframe) & 0xFF; /* complete split */ + if (td->dw1_value & SOTG_PTD_DW1_ENABLE_SPLIT) { + temp = (0xFC << td->uframe) & 0xFF; /* complete split */ + } else { + temp = 0; + } SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, temp); - temp = (1U << td->uframe); /* start split */ + temp = (1U << td->uframe); /* start mask or start split */ SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, temp); temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR_3; @@ -846,10 +850,14 @@ saf1761_host_intr_data_tx(struct saf1761 SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW7, 0); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); - temp = (0xFC << td->uframe) & 0xFF; /* complete split */ + if (td->dw1_value & SOTG_PTD_DW1_ENABLE_SPLIT) { + temp = (0xFC << td->uframe) & 0xFF; /* complete split */ + } else { + temp = 0; + } SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, temp); - temp = (1U << td->uframe); /* start split */ + temp = (1U << td->uframe); /* start mask or start split */ SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, temp); temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR_3; @@ -939,16 +947,21 @@ saf1761_host_isoc_data_rx(struct saf1761 SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW7, 0); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); - temp = (0xFC << td->uframe) & 0xFF; /* complete split */ + if (td->dw1_value & SOTG_PTD_DW1_ENABLE_SPLIT) { + temp = (0xFC << (td->uframe & 7)) & 0xFF; /* complete split */ + } else { + temp = 0; + } SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, temp); - temp = (1U << td->uframe); /* start split */ + temp = (1U << (td->uframe & 7)); /* start mask or start split */ SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, temp); temp = SOTG_PTD_DW3_ACTIVE | SOTG_PTD_DW3_CERR_3; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); - temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | + (td->uframe & 0xF8); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (1 << 10) /* IN-PID */ | (td->ep_index >> 1); @@ -991,7 +1004,6 @@ saf1761_host_isoc_data_tx(struct saf1761 } else if (status & SOTG_PTD_DW3_HALTED) { goto complete; } - goto complete; } if (saf1761_host_channel_alloc(sc, td)) @@ -1014,13 +1026,14 @@ saf1761_host_isoc_data_tx(struct saf1761 SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, 0); - temp = (1U << td->uframe); /* start split */ + temp = (1U << (td->uframe & 7)); /* start mask or start split */ SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, temp); temp = SOTG_PTD_DW3_ACTIVE | SOTG_PTD_DW3_CERR_3; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); - temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | + (td->uframe & 0xF8); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (0 << 10) /* OUT-PID */ | (td->ep_index >> 1); @@ -1685,6 +1698,8 @@ saf1761_otg_setup_standard_chain(struct uint8_t ep_type; uint8_t need_sync; uint8_t is_host; + uint8_t uframe_start; + uint8_t uframe_interval; DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", xfer->address, UE_GET_ADDR(xfer->endpointno), @@ -1738,15 +1753,25 @@ saf1761_otg_setup_standard_chain(struct x = 0; } + uframe_start = 0; + uframe_interval = 0; + if (x != xfer->nframes) { if (xfer->endpointno & UE_DIR_IN) { if (is_host) { - if (ep_type == UE_INTERRUPT) + if (ep_type == UE_INTERRUPT) { temp.func = &saf1761_host_intr_data_rx; - else if (ep_type == UE_ISOCHRONOUS) + } else if (ep_type == UE_ISOCHRONOUS) { temp.func = &saf1761_host_isoc_data_rx; - else + uframe_start = (SAF1761_READ_LE_4(sc, SOTG_FRINDEX) + 8) & + (SOTG_FRINDEX_MASK & ~7); + if (xfer->xroot->udev->speed == USB_SPEED_HIGH) + uframe_interval = 1U << xfer->fps_shift; + else + uframe_interval = 8U; + } else { temp.func = &saf1761_host_bulk_data_rx; + } need_sync = 0; } else { temp.func = &saf1761_device_data_tx; @@ -1754,12 +1779,19 @@ saf1761_otg_setup_standard_chain(struct } } else { if (is_host) { - if (ep_type == UE_INTERRUPT) + if (ep_type == UE_INTERRUPT) { temp.func = &saf1761_host_intr_data_tx; - else if (ep_type == UE_ISOCHRONOUS) + } else if (ep_type == UE_ISOCHRONOUS) { temp.func = &saf1761_host_isoc_data_tx; - else + uframe_start = (SAF1761_READ_LE_4(sc, SOTG_FRINDEX) + 8) & + (SOTG_FRINDEX_MASK & ~7); + if (xfer->xroot->udev->speed == USB_SPEED_HIGH) + uframe_interval = 1U << xfer->fps_shift; + else + uframe_interval = 8U; + } else { temp.func = &saf1761_host_bulk_data_tx; + } need_sync = 0; } else { temp.func = &saf1761_device_data_rx; @@ -1807,6 +1839,12 @@ saf1761_otg_setup_standard_chain(struct if (xfer->flags_int.isochronous_xfr) { temp.offset += temp.len; + + /* stamp the starting point for this transaction */ + temp.td->uframe = uframe_start; + + /* advance to next */ + uframe_start += uframe_interval; } else { /* get next Page Cache pointer */ temp.pc = xfer->frbuffers + x; @@ -3404,17 +3442,8 @@ saf1761_otg_xfer_setup(struct usb_setup_ td->ep_index = ep_no; td->ep_type = ep_type; td->dw1_value = dw1; - if (ep_type == UE_ISOCHRONOUS) { - if (parm->udev->speed == USB_SPEED_HIGH) { - uint8_t uframe_index = (ntd - 1 - n); - uframe_index <<= usbd_xfer_get_fps_shift(xfer); - td->uframe = (uframe_index & 7); - } else { - td->uframe = 0; - } - } else { - td->uframe = 0; - } + td->uframe = 0; + if (ep_type == UE_INTERRUPT) { if (xfer->interval > 32) td->interval = (32 / 2) << 3; From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 17:46:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A500113; Sat, 22 Nov 2014 17:46:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1790CD75; Sat, 22 Nov 2014 17:46:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMHkUWa096280; Sat, 22 Nov 2014 17:46:30 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMHkUUc096279; Sat, 22 Nov 2014 17:46:30 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201411221746.sAMHkUUc096279@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 22 Nov 2014 17:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274867 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 17:46:31 -0000 Author: alc Date: Sat Nov 22 17:46:30 2014 New Revision: 274867 URL: https://svnweb.freebsd.org/changeset/base/274867 Log: By the time that vm_reserv_init() runs, vm_phys_segs[] is initialized. Use it instead of phys_avail[]. Discussed with: Svatopluk Kraus Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sat Nov 22 17:39:39 2014 (r274866) +++ head/sys/vm/vm_reserv.c Sat Nov 22 17:46:30 2014 (r274867) @@ -818,15 +818,17 @@ void vm_reserv_init(void) { vm_paddr_t paddr; - int i; + struct vm_phys_seg *seg; + int segind; /* * Initialize the reservation array. Specifically, initialize the * "pages" field for every element that has an underlying superpage. */ - for (i = 0; phys_avail[i + 1] != 0; i += 2) { - paddr = roundup2(phys_avail[i], VM_LEVEL_0_SIZE); - while (paddr + VM_LEVEL_0_SIZE <= phys_avail[i + 1]) { + for (segind = 0; segind < vm_phys_nsegs; segind++) { + seg = &vm_phys_segs[segind]; + paddr = roundup2(seg->start, VM_LEVEL_0_SIZE); + while (paddr + VM_LEVEL_0_SIZE <= seg->end) { vm_reserv_array[paddr >> VM_LEVEL_0_SHIFT].pages = PHYS_TO_VM_PAGE(paddr); paddr += VM_LEVEL_0_SIZE; From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 18:03:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF76BEAD; Sat, 22 Nov 2014 18:03:26 +0000 (UTC) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1E7F43; Sat, 22 Nov 2014 18:03:26 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id ft15so7226942pdb.22 for ; Sat, 22 Nov 2014 10:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=1+RyV8J15bT0JHQW1IlyGN7s5UKGqW7tB34CykbNzI4=; b=as4AHSDCO0hdnS4ITMNgLUHWnshhQiIRCRSqHGlbnMcuJi3rVzHw761CqLb6PrDPOe QHzmYnY57nO4Psw+b1G95JgajwnRSS32TzhIkqlAaBRfQMWdqqWZAGan0tbUrsZxI8Gi LVI5YkzMEh4NovD4/jy2AQGgVXwtwZFYU2ModeaqakPqPUnplVNGEeyHdcDU/0Ysxury JdA5SVafKkQpibjuLQRI2nYJx79z4bb5TRLBisVjgVGvkZCRm1KxoacOHy5BVCL5JapX VBHsUJ3cUUsYUBzKu2dTz4yPSPyqg4XlK+3yWJfyGdcr7Zqu9ZrXNuYeQylrY0Kqd72r Hy/Q== X-Received: by 10.68.247.5 with SMTP id ya5mr18038027pbc.42.1416679405982; Sat, 22 Nov 2014 10:03:25 -0800 (PST) Received: from ox ([24.6.44.228]) by mx.google.com with ESMTPSA id ql6sm7985450pbb.39.2014.11.22.10.03.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 22 Nov 2014 10:03:24 -0800 (PST) Date: Sat, 22 Nov 2014 10:03:18 -0800 From: Navdeep Parhar To: Alexander Motin Subject: Re: svn commit: r274853 - in head: sys/dev/iscsi usr.sbin/ctld usr.sbin/iscsid Message-ID: <20141122180318.GA3921@ox> Mail-Followup-To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201411221509.sAMF9JIh016800@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411221509.sAMF9JIh016800@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 18:03:26 -0000 On Sat, Nov 22, 2014 at 03:09:19PM +0000, Alexander Motin wrote: > Author: mav > Date: Sat Nov 22 15:09:18 2014 > New Revision: 274853 > URL: https://svnweb.freebsd.org/changeset/base/274853 > > Log: > For both iSCSI initiator and target increase socket buffer sizes before > establishing connection. > > This is a workaround for Chelsio TOE driver, that does not update socket > buffer size in hardware after connection established, and unless that is > done beforehand, kernel code will stuck, attempting to send/receive full > PDU at once. cxgbe's TOE driver does update the rcv window in the hardware in response to changes in the socket buffer size (see t4_rcvd in cxgbe/tom/t4_cpl_io.c). The bug is that the driver tries to avoid sending too many small updates to the chip, and instead tries to build up a balance of credits before an update. This doesn't interact well with some applications that set the sockbuf size to a high fixed value and then wait for the entire buffer to fill up before draining it. The driver ends up waiting for the application to drain the socket's receive buffer so that pru_rcvd (t4_rcvd) can then send a big batch of credits to the chip, the application is waiting for the receive to reach its high water mark before draining the buffer, but the TOE on the chip has shut down the receive window because it's out of credits. If you see the peer sending zero window probes and the TOE refusing to budge, then the problem you've observed is definitely the problem I just described. I'll fix this in the TOE driver. I can send you an early patch in case you'd like to try out the fix before it gets committed. Regards, Navdeep > > MFC after: 1 week > > Modified: > head/sys/dev/iscsi/icl.c > head/usr.sbin/ctld/ctld.c > head/usr.sbin/ctld/ctld.h > head/usr.sbin/iscsid/iscsid.c > head/usr.sbin/iscsid/iscsid.h > > Modified: head/sys/dev/iscsi/icl.c > ============================================================================== > --- head/sys/dev/iscsi/icl.c Sat Nov 22 14:59:50 2014 (r274852) > +++ head/sys/dev/iscsi/icl.c Sat Nov 22 15:09:18 2014 (r274853) > @@ -1199,6 +1199,8 @@ icl_conn_start(struct icl_conn *ic) > icl_conn_close(ic); > return (error); > } > + ic->ic_socket->so_snd.sb_flags |= SB_AUTOSIZE; > + ic->ic_socket->so_rcv.sb_flags |= SB_AUTOSIZE; > > /* > * Disable Nagle. > > Modified: head/usr.sbin/ctld/ctld.c > ============================================================================== > --- head/usr.sbin/ctld/ctld.c Sat Nov 22 14:59:50 2014 (r274852) > +++ head/usr.sbin/ctld/ctld.c Sat Nov 22 15:09:18 2014 (r274853) > @@ -1602,7 +1602,7 @@ conf_apply(struct conf *oldconf, struct > struct portal *oldp, *newp; > struct isns *oldns, *newns; > pid_t otherpid; > - int changed, cumulated_error = 0, error; > + int changed, cumulated_error = 0, error, sockbuf; > int one = 1; > > if (oldconf->conf_debug != newconf->conf_debug) { > @@ -1899,6 +1899,16 @@ conf_apply(struct conf *oldconf, struct > cumulated_error++; > continue; > } > + sockbuf = SOCKBUF_SIZE; > + if (setsockopt(newp->p_socket, SOL_SOCKET, SO_RCVBUF, > + &sockbuf, sizeof(sockbuf)) == -1) > + log_warn("setsockopt(SO_RCVBUF) failed " > + "for %s", newp->p_listen); > + sockbuf = SOCKBUF_SIZE; > + if (setsockopt(newp->p_socket, SOL_SOCKET, SO_SNDBUF, > + &sockbuf, sizeof(sockbuf)) == -1) > + log_warn("setsockopt(SO_SNDBUF) failed " > + "for %s", newp->p_listen); > error = setsockopt(newp->p_socket, SOL_SOCKET, > SO_REUSEADDR, &one, sizeof(one)); > if (error != 0) { > > Modified: head/usr.sbin/ctld/ctld.h > ============================================================================== > --- head/usr.sbin/ctld/ctld.h Sat Nov 22 14:59:50 2014 (r274852) > +++ head/usr.sbin/ctld/ctld.h Sat Nov 22 15:09:18 2014 (r274853) > @@ -48,6 +48,7 @@ > #define MAX_NAME_LEN 223 > #define MAX_DATA_SEGMENT_LENGTH (128 * 1024) > #define MAX_BURST_LENGTH 16776192 > +#define SOCKBUF_SIZE 1048576 > > struct auth { > TAILQ_ENTRY(auth) a_next; > > Modified: head/usr.sbin/iscsid/iscsid.c > ============================================================================== > --- head/usr.sbin/iscsid/iscsid.c Sat Nov 22 14:59:50 2014 (r274852) > +++ head/usr.sbin/iscsid/iscsid.c Sat Nov 22 15:09:18 2014 (r274853) > @@ -160,7 +160,7 @@ connection_new(unsigned int session_id, > #ifdef ICL_KERNEL_PROXY > struct iscsi_daemon_connect idc; > #endif > - int error; > + int error, sockbuf; > > conn = calloc(1, sizeof(*conn)); > if (conn == NULL) > @@ -237,6 +237,14 @@ connection_new(unsigned int session_id, > fail(conn, strerror(errno)); > log_err(1, "failed to create socket for %s", from_addr); > } > + sockbuf = SOCKBUF_SIZE; > + if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_RCVBUF, > + &sockbuf, sizeof(sockbuf)) == -1) > + log_warn("setsockopt(SO_RCVBUF) failed"); > + sockbuf = SOCKBUF_SIZE; > + if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_SNDBUF, > + &sockbuf, sizeof(sockbuf)) == -1) > + log_warn("setsockopt(SO_SNDBUF) failed"); > if (from_ai != NULL) { > error = bind(conn->conn_socket, from_ai->ai_addr, > from_ai->ai_addrlen); > > Modified: head/usr.sbin/iscsid/iscsid.h > ============================================================================== > --- head/usr.sbin/iscsid/iscsid.h Sat Nov 22 14:59:50 2014 (r274852) > +++ head/usr.sbin/iscsid/iscsid.h Sat Nov 22 15:09:18 2014 (r274853) > @@ -44,6 +44,7 @@ > #define CONN_DIGEST_CRC32C 1 > > #define CONN_MUTUAL_CHALLENGE_LEN 1024 > +#define SOCKBUF_SIZE 1048576 > > struct connection { > int conn_iscsi_fd; > From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 18:15:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08AD0582; Sat, 22 Nov 2014 18:15:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E97E4AB; Sat, 22 Nov 2014 18:15:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMIF2sT011413; Sat, 22 Nov 2014 18:15:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMIF2il011412; Sat, 22 Nov 2014 18:15:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411221815.sAMIF2il011412@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 22 Nov 2014 18:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274878 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 18:15:03 -0000 Author: kib Date: Sat Nov 22 18:15:02 2014 New Revision: 274878 URL: https://svnweb.freebsd.org/changeset/base/274878 Log: The size value should be asserted when it is known. Reported and tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Nov 22 18:09:24 2014 (r274877) +++ head/sys/kern/imgact_elf.c Sat Nov 22 18:15:02 2014 (r274878) @@ -1800,7 +1800,7 @@ __elfN(note_threadmd)(void *arg, struct buf = NULL; size = 0; __elfN(dump_thread)(td, buf, &size); - KASSERT(*sizep == size, ("invalid size")); + KASSERT(sb == NULL || *sizep == size, ("invalid size")); if (size != 0 && sb != NULL) sbuf_bcat(sb, buf, size); free(buf, M_TEMP); From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 18:40:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C28DDCD; Sat, 22 Nov 2014 18:40:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F274A2E0; Sat, 22 Nov 2014 18:40:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMIeFYn021947; Sat, 22 Nov 2014 18:40:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMIeFKY021945; Sat, 22 Nov 2014 18:40:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411221840.sAMIeFKY021945@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 22 Nov 2014 18:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274879 - in head/sys/dev: pccard wi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 18:40:16 -0000 Author: imp Date: Sat Nov 22 18:40:14 2014 New Revision: 274879 URL: https://svnweb.freebsd.org/changeset/base/274879 Log: Retire old, transition code for managing the FreeBSD 5 -> 6 migration. Modified: head/sys/dev/pccard/pccardvar.h head/sys/dev/wi/if_wi_pccard.c Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Sat Nov 22 18:15:02 2014 (r274878) +++ head/sys/dev/pccard/pccardvar.h Sat Nov 22 18:40:14 2014 (r274879) @@ -31,18 +31,6 @@ */ /* - * PCCARD_API_LEVEL. When set to 5, we provide a 5.x compatible API - * for driver writers that have to share their code between 5.x and 6.x. - * The 5.x compatibility interfaces will be unsupported in 7.0, at which - * point we'll only support 6 and newer, etc. - */ -#ifndef PCCARD_API_LEVEL -#define PCCARD_API_LEVEL 6 -#elif PCCARD_API_LEVEL < 5 -#error "pccard API less than 5 unsupported" -#endif - -/* * Contains information about mapped/allocated i/o spaces. */ struct pccard_io_handle { @@ -229,7 +217,6 @@ enum { #define PCCARD_S(a, b) PCMCIA_STR_ ## a ## _ ## b #define PCCARD_P(a, b) PCMCIA_PRODUCT_ ## a ## _ ## b #define PCCARD_C(a, b) PCMCIA_CIS_ ## a ## _ ## b -#if PCCARD_API_LEVEL >= 6 #define PCMCIA_CARD_D(v, p) { PCCARD_S(v, p), PCMCIA_VENDOR_ ## v, \ PCCARD_P(v, p), PCCARD_C(v, p) } #define PCMCIA_CARD2_D(v1, p1, p2) \ @@ -240,18 +227,6 @@ enum { #define PCMCIA_CARD2(v1, p1, p2) \ { NULL, PCMCIA_VENDOR_ ## v1, PCCARD_P(v1, p1), \ PCMCIA_CIS_ ## p2} -#else -#define PCMCIA_CARD_D(v, p, f) { PCCARD_S(v, p), PCMCIA_VENDOR_ ## v, \ - PCCARD_P(v, p), PCCARD_C(v, p) } -#define PCMCIA_CARD2_D(v1, p1, p2, f) \ - { PCMCIA_STR_ ## p2, PCMCIA_VENDOR_ ## v1, PCCARD_P(v1, p1), \ - PCMCIA_CIS_ ## p2} -#define PCMCIA_CARD(v, p, f) { NULL, PCMCIA_VENDOR_ ## v, \ - PCCARD_P(v, p), PCCARD_C(v, p) } -#define PCMCIA_CARD2(v1, p1, p2, f) \ - { NULL, PCMCIA_VENDOR_ ## v1, PCCARD_P(v1, p1), \ - PCMCIA_CIS_ ## p2} -#endif /* * Defines to decode the get_funce_disk return value. See the PCMCIA standard Modified: head/sys/dev/wi/if_wi_pccard.c ============================================================================== --- head/sys/dev/wi/if_wi_pccard.c Sat Nov 22 18:15:02 2014 (r274878) +++ head/sys/dev/wi/if_wi_pccard.c Sat Nov 22 18:40:14 2014 (r274879) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define PCCARD_API_LEVEL 6 #include #include From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 18:57:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AF3E552; Sat, 22 Nov 2014 18:57:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2465B69B; Sat, 22 Nov 2014 18:57:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMIvPYk034171; Sat, 22 Nov 2014 18:57:25 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMIvNU7034161; Sat, 22 Nov 2014 18:57:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411221857.sAMIvNU7034161@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 18:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274880 - in head: contrib/mdocml usr.bin/mandoc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 18:57:25 -0000 Author: bapt Date: Sat Nov 22 18:57:23 2014 New Revision: 274880 URL: https://svnweb.freebsd.org/changeset/base/274880 Log: Update mandoc to 1.13.1 Added: head/contrib/mdocml/INSTALL - copied unchanged from r274878, vendor/mdocml/dist/INSTALL head/contrib/mdocml/LICENSE - copied unchanged from r274878, vendor/mdocml/dist/LICENSE head/contrib/mdocml/Makefile (contents, props changed) head/contrib/mdocml/Makefile.depend - copied unchanged from r274878, vendor/mdocml/dist/Makefile.depend head/contrib/mdocml/apropos.1 (contents, props changed) head/contrib/mdocml/apropos.c (contents, props changed) head/contrib/mdocml/cgi.c (contents, props changed) head/contrib/mdocml/cgi.h.example - copied unchanged from r274878, vendor/mdocml/dist/cgi.h.example head/contrib/mdocml/compat_ohash.c - copied unchanged from r274878, vendor/mdocml/dist/compat_ohash.c head/contrib/mdocml/compat_ohash.h - copied unchanged from r274878, vendor/mdocml/dist/compat_ohash.h head/contrib/mdocml/compat_reallocarray.c - copied unchanged from r274878, vendor/mdocml/dist/compat_reallocarray.c head/contrib/mdocml/compat_sqlite3_errstr.c - copied unchanged from r274878, vendor/mdocml/dist/compat_sqlite3_errstr.c head/contrib/mdocml/compat_strcasestr.c - copied unchanged from r274878, vendor/mdocml/dist/compat_strcasestr.c head/contrib/mdocml/compat_strsep.c - copied unchanged from r274878, vendor/mdocml/dist/compat_strsep.c head/contrib/mdocml/config.h.post head/contrib/mdocml/config.h.pre head/contrib/mdocml/configure - copied unchanged from r274878, vendor/mdocml/dist/configure head/contrib/mdocml/demandoc.c (contents, props changed) head/contrib/mdocml/gmdiff head/contrib/mdocml/makewhatis.8 - copied unchanged from r274878, vendor/mdocml/dist/makewhatis.8 head/contrib/mdocml/man.cgi.8 - copied unchanged from r274878, vendor/mdocml/dist/man.cgi.8 head/contrib/mdocml/mandoc.db.5 - copied unchanged from r274878, vendor/mdocml/dist/mandoc.db.5 head/contrib/mdocml/mandoc_aux.c - copied unchanged from r274878, vendor/mdocml/dist/mandoc_aux.c head/contrib/mdocml/mandoc_aux.h - copied unchanged from r274878, vendor/mdocml/dist/mandoc_aux.h head/contrib/mdocml/mandoc_escape.3 - copied unchanged from r274878, vendor/mdocml/dist/mandoc_escape.3 head/contrib/mdocml/mandoc_html.3 - copied unchanged from r274878, vendor/mdocml/dist/mandoc_html.3 head/contrib/mdocml/mandoc_malloc.3 - copied unchanged from r274878, vendor/mdocml/dist/mandoc_malloc.3 head/contrib/mdocml/mandocdb.c (contents, props changed) head/contrib/mdocml/manpage.c - copied unchanged from r274878, vendor/mdocml/dist/manpage.c head/contrib/mdocml/manpath.c (contents, props changed) head/contrib/mdocml/manpath.h (contents, props changed) head/contrib/mdocml/mansearch.3 - copied unchanged from r274878, vendor/mdocml/dist/mansearch.3 head/contrib/mdocml/mansearch.c - copied unchanged from r274878, vendor/mdocml/dist/mansearch.c head/contrib/mdocml/mansearch.h - copied unchanged from r274878, vendor/mdocml/dist/mansearch.h head/contrib/mdocml/mansearch_const.c - copied unchanged from r274878, vendor/mdocml/dist/mansearch_const.c head/contrib/mdocml/mchars_alloc.3 - copied unchanged from r274878, vendor/mdocml/dist/mchars_alloc.3 head/contrib/mdocml/test-fgetln.c (contents, props changed) head/contrib/mdocml/test-getsubopt.c (contents, props changed) head/contrib/mdocml/test-mmap.c (contents, props changed) head/contrib/mdocml/test-ohash.c - copied unchanged from r274878, vendor/mdocml/dist/test-ohash.c head/contrib/mdocml/test-reallocarray.c - copied unchanged from r274878, vendor/mdocml/dist/test-reallocarray.c head/contrib/mdocml/test-sqlite3_errstr.c - copied unchanged from r274878, vendor/mdocml/dist/test-sqlite3_errstr.c head/contrib/mdocml/test-strcasestr.c - copied unchanged from r274878, vendor/mdocml/dist/test-strcasestr.c head/contrib/mdocml/test-strlcat.c (contents, props changed) head/contrib/mdocml/test-strlcpy.c (contents, props changed) head/contrib/mdocml/test-strsep.c - copied unchanged from r274878, vendor/mdocml/dist/test-strsep.c Deleted: head/contrib/mdocml/external.png Modified: head/contrib/mdocml/NEWS head/contrib/mdocml/TODO head/contrib/mdocml/arch.c head/contrib/mdocml/arch.in head/contrib/mdocml/att.c head/contrib/mdocml/chars.c head/contrib/mdocml/chars.in head/contrib/mdocml/config.h head/contrib/mdocml/eqn.c head/contrib/mdocml/eqn_html.c head/contrib/mdocml/eqn_term.c head/contrib/mdocml/html.c head/contrib/mdocml/html.h head/contrib/mdocml/lib.c head/contrib/mdocml/lib.in head/contrib/mdocml/libman.h head/contrib/mdocml/libmandoc.h head/contrib/mdocml/libmdoc.h head/contrib/mdocml/libroff.h head/contrib/mdocml/main.c head/contrib/mdocml/main.h head/contrib/mdocml/man.7 head/contrib/mdocml/man.c head/contrib/mdocml/man.h head/contrib/mdocml/man_hash.c head/contrib/mdocml/man_html.c head/contrib/mdocml/man_macro.c head/contrib/mdocml/man_term.c head/contrib/mdocml/man_validate.c head/contrib/mdocml/mandoc.1 head/contrib/mdocml/mandoc.3 head/contrib/mdocml/mandoc.c head/contrib/mdocml/mandoc.h head/contrib/mdocml/mdoc.7 head/contrib/mdocml/mdoc.c head/contrib/mdocml/mdoc.h head/contrib/mdocml/mdoc_argv.c head/contrib/mdocml/mdoc_hash.c head/contrib/mdocml/mdoc_html.c head/contrib/mdocml/mdoc_macro.c head/contrib/mdocml/mdoc_man.c head/contrib/mdocml/mdoc_term.c head/contrib/mdocml/mdoc_validate.c head/contrib/mdocml/msec.c head/contrib/mdocml/out.c head/contrib/mdocml/out.h head/contrib/mdocml/read.c head/contrib/mdocml/roff.7 head/contrib/mdocml/roff.c head/contrib/mdocml/st.c head/contrib/mdocml/st.in head/contrib/mdocml/tbl.c head/contrib/mdocml/tbl_data.c head/contrib/mdocml/tbl_html.c head/contrib/mdocml/tbl_layout.c head/contrib/mdocml/tbl_opts.c head/contrib/mdocml/tbl_term.c head/contrib/mdocml/term.c head/contrib/mdocml/term.h head/contrib/mdocml/term_ascii.c head/contrib/mdocml/term_ps.c head/contrib/mdocml/tree.c head/contrib/mdocml/vol.c head/usr.bin/mandoc/Makefile Directory Properties: head/contrib/mdocml/ (props changed) Copied: head/contrib/mdocml/INSTALL (from r274878, vendor/mdocml/dist/INSTALL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/INSTALL Sat Nov 22 18:57:23 2014 (r274880, copy of r274878, vendor/mdocml/dist/INSTALL) @@ -0,0 +1,187 @@ +$Id: INSTALL,v 1.2 2014/08/10 17:22:26 schwarze Exp $ + +About mdocml, the portable mandoc distribution +---------------------------------------------- +The mandoc manpage compiler toolset is a suite of tools compiling +mdoc(7), the roff(7) macro language of choice for BSD manual pages, +and man(7), the predominant historical language for UNIX manuals. +The toolset does not yet implement man(1); that is only scheduled +for the next release, 1.13.2. It can, however, already serve to +translate source manpages to the output displayed by man(1). +For general information, see . + +In this document, we describe the installation and deployment of +mandoc(1), first as a simple, standalone formatter, and then as part of +the man(1) system. + +In case you have questions or want to provide feedback, read +. Consider subscribing to the +discuss@ mailing list mentioned on that page. If you intend to +help with the development of mandoc, consider subscribing to the +tech@ mailing list, too. + +Enjoy using the mandoc toolset! + +Ingo Schwarze, Karlsruhe, August 2014 + + +Installation +------------ +Before manually installing mandoc on your system, please check +whether the newest version of mandoc is already installed by default +or available via a binary package or a ports system. A list of the +latest bundled and ported versions of mandoc for various operating +systems is maintained at . + +If mandoc is installed, you can check the version by running "mandoc -V". +The version contained in this distribution tarball is listed near +the beginning of the file "Makefile". + +Regarding how packages and ports are maintained for your operating +system, please consult your operating system documentation. +To install mandoc manually, the following steps are needed: + +1. Decide whether you want to build the base tools mandoc(1), +preconv(1) and demandoc(1) only or whether you also want to build the +database tools apropos(1) and makewhatis(8). For the latter, +the following dependencies are required: + +1.1. The SQLite database system, see . +The recommended version of SQLite is 3.8.4.3 or newer. The mandoc +toolset is known to work with version 3.7.5 or newer. Versions +older than 3.8.3 may not achieve full performance due to the +missing SQLITE_DETERMINISTIC optimization flag. Versions older +than 3.8.0 may not show full error information if opening a database +fails due to the missing sqlite3_errstr() API. Both are very minor +problems, apropos(1) is fully usable with SQLite 3.7.5. Versions +older than 3.7.5 may or may not work, they have not been tested. + +1.2. The fts(3) directory traversion functions. +A compatibility version will be bundled for 1.13.2 but is not available +yet. If you want apropos(1) and makewhatis(8) but do not have fts(3), +please stay with mandoc 1.12.3 for now and upgrade first to 1.12.4, +then to 1.13.2 when these versionns are released. Be careful: the +glibc version of fts(3) is known to be broken on 32bit platforms, +see . + +1.3. Marc Espie's ohash(3) library. +If your system does not have it, the bundled compatibility version +will be used, so you probably need not worry about it. + +2. If you choose to build the database tools, too, decide whether +you also want to build the CGI program, man.cgi(8). + +3. Read the beginning of the file "Makefile" from "USER SETTINGS" +to "END OF USER SETTINGS" and edit it as required. In particular, +disable "BUILD_TARGETS += db-build" if you do not want database +support or enable "BUILD_TARGETS += cgi-build" if you do want +the CGI program. + +4. Run "make". No separate "./configure" or "make depend" steps +are needed. The former is run automatically by "make". The latter +is a maintainer target. If you merely want to build the released +version as opposed to doing active development, there is no need +to regenerate the dependency specifications. Any POSIX-compatible +make, in particular both BSD make and GNU make, should work. + +5. Run "make -n install" and check whether everything will be +installed to the intended places. Otherwise, edit the *DIR variables +in the Makefile until it is. + +6. Run "sudo make install". If you intend to build a binary +package using some kind of fake root mechanism, you may need a +command like "make DESTDIR=... install". Read the *-install targets +in the "Makefile" to understand how DESTDIR is used. + +7. To set up a man.cgi(8) server, read its manual page. + +8. To use mandoc(1) as your man(1) formatter, read the "Deployment" +section below. + + +Checking autoconfiguration quality +---------------------------------- +If you want to check whether automatic configuration works well +on your platform, consider the following: + +The mandoc package intentionally does not use GNU autoconf because +we consider that toolset a blatant example of overengineering that +is obsolete nowadays, since all modern operating systems are now +reasonably close to POSIX and do not need arcane shell magic any +longer. If your system does need such magic, consider upgrading +to reasonably modern POSIX-compliant tools rather than asking for +autoconf-style workarounds. + +As far as mandoc is using any features not mandated by ANSI X3.159-1989 +("ANSI C") or IEEE Std 1003.1-2008 ("POSIX") that some modern systems +do not have, we intend to provide autoconfiguration tests and +compat_*.c implementations. Please report any that turn out to be +missing. Note that while we do strive to produce portable code, +we do not slavishly restrict ourselves to POSIX-only interfaces. +For improved security and readability, we do use well-designed, +modern interfaces like reallocarray(3) even if they are still rather +uncommon, of course bundling compat_*.c implementations as needed. + +Where mandoc is using ANSI C or POSIX features that some systems +still lack and that compat_*.c implementations can be provided for +without too much hassle, we will consider adding them, too, so +please report whatever is missing on your platform. + +The following steps can be used to manually check the automatic +configuration on your platform: + +1. Run "make clean". + +2. Run "make config.h" + +3. Read the file "config.log". It shows the compiler commands used +to test the libraries installed on your system and the standard +output and standard error output these commands produce. Watch out +for unexpected failures. Those are most likely to happen if headers +or libraries are installed in unusual places or interfaces defined +in unusual headers. You can also look at the file "config.h" and +check that no expected "#define HAVE_*" lines are missing. The +list of tests run can be found in the file "configure". + + +Deployment +---------- +If you want to integrate the mandoc(1) tools with your existing +man(1) system as a formatter, then contact us first: on systems without +mandoc(1) as the default, you may have your work cut out for you! +Usually, you can have your default installation and mandoc(1) work right +alongside each other by using user-specific versions of the files +mentioned below. + +0. Back up each file you want to change! + +1. First see whether your system has "/etc/man.conf" or "/etc/manpath.conf" +(if it has neither, but man(1) is functional, then let us know) or, +if running as your own user, a per-user override file. In either +case, find where man(1) is executing nroff(1) or groff(1) to format +manuals. Replace these calls with mandoc(1). + +2. Then make sure that man(1) isn't running preprocessors, so you may +need to replace tbl(1), eqn(1), and similar references with cat(1). +Some man(1) implementations, like that on Mac OSX, let you run "man -d" +to see how the formatter is invoked. Use this to test your changes. On +Mac OS X, for instance, man(1) will prepend all files with ".ll" and +".nr" to set the terminal size, so you need to pass "tail -n+2 | +mandoc(1)" to disregard them. + +3. Finally, make sure that mandoc(1) is actually being invoked instead +of cached pages being pulled up. You can usually do this by commenting +out NOCACHE or similar. + +mandoc(1) still has a long way to go in understanding non-trivial +low-level roff(7) markup embedded in some man(7) pages. On the BSD +systems using mandoc(1), third-party software is generally vetted +on whether it may be formatted with mandoc(1). If not, groff(1) +is pulled in as a dependency and used to install a pre-formatted +"catpage" intead of directly as manual page source. + +For more background on switching operating systems to use mandoc(1) +instead of groff(1) to format manuals, see the two BSDCan presentations +by Ingo Schwarze: + + Copied: head/contrib/mdocml/LICENSE (from r274878, vendor/mdocml/dist/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/LICENSE Sat Nov 22 18:57:23 2014 (r274880, copy of r274878, vendor/mdocml/dist/LICENSE) @@ -0,0 +1,44 @@ +$Id: LICENSE,v 1.2 2014/04/23 21:06:41 schwarze Exp $ + +With the exceptions noted below, all code and documentation +contained in the mdocml toolkit is protected by the Copyright +of the following developers: + +Copyright (c) 2008, 2009, 2010, 2011, 2012 Kristaps Dzonsons +Copyright (c) 2010, 2011, 2012, 2013, 2014 Ingo Schwarze +Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger +Copyright (c) 2013 Franco Fichtner +Copyright (c) 1999, 2004 Marc Espie +Copyright (c) 1998, 2010 Todd C. Miller +Copyright (c) 2008 Otto Moerbeek +Copyright (c) 2003 Jason McIntyre + +See the individual source files for information about who contributed +to which file during which years. + + +The mdocml distribution as a whole is distributed by its developers +under the following license: + +Permission to use, copy, modify, and 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. + + +The following files included from outside sources are protected by +other people's Copyright and are distributed under a 3-clause BSD +license; see these individual files for details. + +compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c: +Copyright (c) 1990, 1993 The Regents of the University of California + +compat_fgetln.c: +Copyright (c) 1998 The NetBSD Foundation, Inc. Added: head/contrib/mdocml/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/Makefile Sat Nov 22 18:57:23 2014 (r274880) @@ -0,0 +1,505 @@ +# $Id: Makefile,v 1.435 2014/08/10 02:45:04 schwarze Exp $ +# +# Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons +# Copyright (c) 2011, 2013, 2014 Ingo Schwarze +# +# Permission to use, copy, modify, and 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. + +VERSION = 1.13.1 + +# === USER SETTINGS ==================================================== + +# --- user settings relevant for all builds ---------------------------- + +# Specify this if you want to hard-code the operating system to appear +# in the lower-left hand corner of -mdoc manuals. +# +# CFLAGS += -DOSNAME="\"OpenBSD 5.5\"" + +# IFF your system supports multi-byte functions (setlocale(), wcwidth(), +# putwchar()) AND has __STDC_ISO_10646__ (that is, wchar_t is simply a +# UCS-4 value) should you define USE_WCHAR. If you define it and your +# system DOESN'T support this, -Tlocale will produce garbage. +# If you don't define it, -Tlocale is a synonym for -Tacsii. +# +CFLAGS += -DUSE_WCHAR + +CFLAGS += -g -DHAVE_CONFIG_H +CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings +PREFIX = /usr/local +BINDIR = $(PREFIX)/bin +INCLUDEDIR = $(PREFIX)/include/mandoc +LIBDIR = $(PREFIX)/lib/mandoc +MANDIR = $(PREFIX)/man +EXAMPLEDIR = $(PREFIX)/share/examples/mandoc + +INSTALL = install +INSTALL_PROGRAM = $(INSTALL) -m 0555 +INSTALL_DATA = $(INSTALL) -m 0444 +INSTALL_LIB = $(INSTALL) -m 0444 +INSTALL_SOURCE = $(INSTALL) -m 0644 +INSTALL_MAN = $(INSTALL_DATA) + +# --- user settings related to database support ------------------------ + +# Building apropos(1) and makewhatis(8) requires both SQLite3 and fts(3). +# To avoid those dependencies, comment the following line. +# Be careful: the fts(3) implementation in glibc is broken on 32bit +# machines, see: https://sourceware.org/bugzilla/show_bug.cgi?id=15838 +# +BUILD_TARGETS += db-build + +# The remaining settings in this section +# are only relevant if db-build is enabled. +# Otherwise, they have no effect either way. + +# If your system has manpath(1), uncomment this. This is most any +# system that's not OpenBSD or NetBSD. If uncommented, apropos(1) +# and makewhatis(8) will use manpath(1) to get the MANPATH variable. +# +#CFLAGS += -DUSE_MANPATH + +# On some systems, SQLite3 may be installed below /usr/local. +# In that case, uncomment the following two lines. +# +#CFLAGS += -I/usr/local/include +#DBLIB += -L/usr/local/lib + +# OpenBSD has the ohash functions in libutil. +# Comment the following line if your system doesn't. +# +DBLIB += -lutil + +SBINDIR = $(PREFIX)/sbin + +# --- user settings related to man.cgi --------------------------------- + +# To build man.cgi, copy cgi.h.example to cgi.h, edit it, +# and enable the following line. +# Obviously, this requires that db-build is enabled, too. +# +#BUILD_TARGETS += cgi-build + +# The remaining settings in this section +# are only relevant if cgi-build is enabled. +# Otherwise, they have no effect either way. + +# If your system does not support static binaries, comment this, +# for example on Mac OS X. +# +STATIC = -static + +# Linux requires -pthread for statical linking. +# +#STATIC += -pthread + +WWWPREFIX = /var/www +HTDOCDIR = $(WWWPREFIX)/htdocs +CGIBINDIR = $(WWWPREFIX)/cgi-bin + +# === END OF USER SETTINGS ============================================= + +INSTALL_TARGETS = $(BUILD_TARGETS:-build=-install) + +BASEBIN = mandoc preconv demandoc +DBBIN = apropos makewhatis +CGIBIN = man.cgi + +DBLIB += -lsqlite3 + +TESTSRCS = test-fgetln.c \ + test-getsubopt.c \ + test-mmap.c \ + test-ohash.c \ + test-reallocarray.c \ + test-sqlite3_errstr.c \ + test-strcasestr.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + test-strsep.c + +SRCS = apropos.c \ + arch.c \ + att.c \ + cgi.c \ + chars.c \ + compat_fgetln.c \ + compat_getsubopt.c \ + compat_ohash.c \ + compat_reallocarray.c \ + compat_sqlite3_errstr.c \ + compat_strcasestr.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + compat_strsep.c \ + demandoc.c \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + html.c \ + lib.c \ + main.c \ + man.c \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.c \ + mandoc_aux.c \ + mandocdb.c \ + manpage.c \ + manpath.c \ + mansearch.c \ + mansearch_const.c \ + mdoc.c \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + out.c \ + preconv.c \ + read.c \ + roff.c \ + st.c \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term_ascii.c \ + term_ps.c \ + tree.c \ + vol.c \ + $(TESTSRCS) + +DISTFILES = INSTALL \ + LICENSE \ + Makefile \ + Makefile.depend \ + NEWS \ + TODO \ + apropos.1 \ + arch.in \ + att.in \ + cgi.h.example \ + chars.in \ + compat_ohash.h \ + config.h.post \ + config.h.pre \ + configure \ + demandoc.1 \ + eqn.7 \ + example.style.css \ + gmdiff \ + html.h \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.h \ + makewhatis.8 \ + man-cgi.css \ + man.7 \ + man.cgi.8 \ + man.h \ + mandoc.1 \ + mandoc.3 \ + mandoc.db.5 \ + mandoc.h \ + mandoc_aux.h \ + mandoc_char.7 \ + mandoc_escape.3 \ + mandoc_html.3 \ + mandoc_malloc.3 \ + manpath.h \ + mansearch.3 \ + mansearch.h \ + mchars_alloc.3 \ + mdoc.7 \ + mdoc.h \ + msec.in \ + out.h \ + preconv.1 \ + predefs.in \ + roff.7 \ + st.in \ + style.css \ + tbl.3 \ + tbl.7 \ + term.h \ + vol.in \ + $(SRCS) + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o + +LIBMDOC_OBJS = arch.o \ + att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_validate.o \ + st.o \ + vol.o + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + mandoc_aux.o \ + msec.o \ + read.o + +COMPAT_OBJS = compat_fgetln.o \ + compat_getsubopt.o \ + compat_ohash.o \ + compat_reallocarray.o \ + compat_sqlite3_errstr.o \ + compat_strcasestr.o \ + compat_strlcat.o \ + compat_strlcpy.o \ + compat_strsep.o + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o + +MANDOC_MAN_OBJS = mdoc_man.o + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o + +MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + main.o \ + out.o \ + tree.o + +MAKEWHATIS_OBJS = mandocdb.o mansearch_const.o manpath.o + +PRECONV_OBJS = preconv.o + +APROPOS_OBJS = apropos.o mansearch.o mansearch_const.o manpath.o + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + cgi.o \ + mansearch.o \ + mansearch_const.o \ + out.o + +MANPAGE_OBJS = manpage.o mansearch.o mansearch_const.o manpath.o + +DEMANDOC_OBJS = demandoc.o + +WWW_MANS = apropos.1.html \ + demandoc.1.html \ + mandoc.1.html \ + preconv.1.html \ + mandoc.3.html \ + mandoc_escape.3.html \ + mandoc_html.3.html \ + mandoc_malloc.3.html \ + mansearch.3.html \ + mchars_alloc.3.html \ + tbl.3.html \ + mandoc.db.5.html \ + eqn.7.html \ + man.7.html \ + mandoc_char.7.html \ + mdoc.7.html \ + roff.7.html \ + tbl.7.html \ + makewhatis.8.html \ + man.cgi.8.html \ + man.h.html \ + mandoc.h.html \ + mandoc_aux.h.html \ + manpath.h.html \ + mansearch.h.html \ + mdoc.h.html + +WWW_OBJS = mdocml.tar.gz \ + mdocml.sha256 + +# === DEPENDENCY HANDLING ============================================== + +all: base-build $(BUILD_TARGETS) + +base-build: $(BASEBIN) + +db-build: $(DBBIN) + +cgi-build: $(CGIBIN) + +install: base-install $(INSTALL_TARGETS) + +www: $(WWW_OBJS) $(WWW_MANS) + +include Makefile.depend + +# === TARGETS CONTAINING SHELL COMMANDS ================================ + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) + rm -f apropos $(APROPOS_OBJS) + rm -f makewhatis $(MAKEWHATIS_OBJS) + rm -f preconv $(PRECONV_OBJS) + rm -f man.cgi $(CGI_OBJS) + rm -f manpage $(MANPAGE_OBJS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f mandoc $(MANDOC_OBJS) + rm -f config.h config.log $(COMPAT_OBJS) + rm -f $(WWW_MANS) $(WWW_OBJS) + rm -rf *.dSYM + +base-install: base-build + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(EXAMPLEDIR) + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_PROGRAM) $(BASEBIN) $(DESTDIR)$(BINDIR) + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h \ + $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ + mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 \ + $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) + +db-install: db-build + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(SBINDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man5 + mkdir -p $(DESTDIR)$(MANDIR)/man8 + $(INSTALL_PROGRAM) apropos $(DESTDIR)$(BINDIR) + ln -f $(DESTDIR)$(BINDIR)/apropos $(DESTDIR)$(BINDIR)/whatis + $(INSTALL_PROGRAM) makewhatis $(DESTDIR)$(SBINDIR) + $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1 + ln -f $(DESTDIR)$(MANDIR)/man1/apropos.1 \ + $(DESTDIR)$(MANDIR)/man1/whatis.1 + $(INSTALL_MAN) mansearch.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5 + $(INSTALL_MAN) makewhatis.8 $(DESTDIR)$(MANDIR)/man8 + +cgi-install: cgi-build + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1 + mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8 + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css + $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + $(INSTALL_MAN) apropos.1 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1/ + $(INSTALL_MAN) man.cgi.8 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8/ + +www-install: www + mkdir -p $(DESTDIR)$(HTDOCDIR)/snapshots + $(INSTALL_DATA) $(WWW_MANS) style.css $(DESTDIR)$(HTDOCDIR) + $(INSTALL_DATA) $(WWW_OBJS) $(DESTDIR)$(HTDOCDIR)/snapshots + $(INSTALL_DATA) mdocml.tar.gz \ + $(DESTDIR)$(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.sha256 \ + $(DESTDIR)$(HTDOCDIR)/snapshots/mdocml-$(VERSION).sha256 + +depend: config.h + mkdep -f Makefile.depend $(CFLAGS) $(SRCS) + perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \ + s|\\\n||g; s| +| |g; print;' Makefile.depend > Makefile.tmp + mv Makefile.tmp Makefile.depend + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +mandoc: $(MANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a + +makewhatis: $(MAKEWHATIS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MAKEWHATIS_OBJS) libmandoc.a $(DBLIB) + +preconv: $(PRECONV_OBJS) + $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) + +manpage: $(MANPAGE_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANPAGE_OBJS) libmandoc.a $(DBLIB) + +apropos: $(APROPOS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +mdocml.sha256: mdocml.tar.gz + sha256 mdocml.tar.gz > $@ + +mdocml.tar.gz: $(DISTFILES) + mkdir -p .dist/mdocml-$(VERSION)/ + $(INSTALL_SOURCE) $(DISTFILES) .dist/mdocml-$(VERSION) + chmod 755 .dist/mdocml-$(VERSION)/configure + ( cd .dist/ && tar zcf ../$@ mdocml-$(VERSION) ) + rm -rf .dist/ + +config.h: configure config.h.pre config.h.post $(TESTSRCS) + rm -f config.log + CC="$(CC)" CFLAGS="$(CFLAGS)" DBLIB="$(DBLIB)" \ + VERSION="$(VERSION)" ./configure + +.PHONY: base-install cgi-install db-install install www-install +.PHONY: clean depend +.SUFFIXES: .1 .3 .5 .7 .8 .h +.SUFFIXES: .1.html .3.html .5.html .7.html .8.html .h.html + +.h.h.html: + highlight -I $< > $@ + +.1.1.html .3.3.html .5.5.html .7.7.html .8.8.html: mandoc + ./mandoc -Thtml -Wall,stop \ + -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< > $@ Copied: head/contrib/mdocml/Makefile.depend (from r274878, vendor/mdocml/dist/Makefile.depend) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/Makefile.depend Sat Nov 22 18:57:23 2014 (r274880, copy of r274878, vendor/mdocml/dist/Makefile.depend) @@ -0,0 +1,70 @@ +apropos.o: apropos.c config.h manpath.h mansearch.h +arch.o: arch.c config.h mdoc.h libmdoc.h arch.in +att.o: att.c config.h mdoc.h libmdoc.h att.in +cgi.o: cgi.c config.h mandoc.h mandoc_aux.h main.h manpath.h mansearch.h cgi.h +chars.o: chars.c config.h mandoc.h mandoc_aux.h libmandoc.h chars.in +compat_fgetln.o: compat_fgetln.c config.h +compat_getsubopt.o: compat_getsubopt.c config.h +compat_ohash.o: compat_ohash.c config.h +compat_reallocarray.o: compat_reallocarray.c config.h +compat_sqlite3_errstr.o: compat_sqlite3_errstr.c config.h +compat_strcasestr.o: compat_strcasestr.c config.h +compat_strlcat.o: compat_strlcat.c config.h +compat_strlcpy.o: compat_strlcpy.c config.h +compat_strsep.o: compat_strsep.c config.h +demandoc.o: demandoc.c config.h man.h mdoc.h mandoc.h +eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h +eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h +html.o: html.c config.h mandoc.h mandoc_aux.h libmandoc.h out.h html.h main.h +lib.o: lib.c config.h mdoc.h libmdoc.h lib.in +main.o: main.c config.h mandoc.h mandoc_aux.h main.h mdoc.h man.h +man.o: man.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h +man_hash.o: man_hash.c config.h man.h mandoc.h libman.h +man_html.o: man_html.c config.h mandoc.h mandoc_aux.h out.h html.h man.h main.h +man_macro.o: man_macro.c config.h man.h mandoc.h libmandoc.h libman.h +man_term.o: man_term.c config.h mandoc.h mandoc_aux.h out.h man.h term.h main.h +man_validate.o: man_validate.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h +mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h +mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h +mandocdb.o: mandocdb.c config.h mdoc.h man.h mandoc.h mandoc_aux.h manpath.h mansearch.h +manpage.o: manpage.c config.h manpath.h mansearch.h +manpath.o: manpath.c config.h mandoc_aux.h manpath.h +mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h manpath.h mansearch.h +mansearch_const.o: mansearch_const.c config.h manpath.h mansearch.h +mdoc.o: mdoc.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h +mdoc_argv.o: mdoc_argv.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h +mdoc_hash.o: mdoc_hash.c config.h mdoc.h libmdoc.h +mdoc_html.o: mdoc_html.c config.h mandoc.h mandoc_aux.h out.h html.h mdoc.h main.h +mdoc_macro.o: mdoc_macro.c config.h mdoc.h mandoc.h libmdoc.h libmandoc.h +mdoc_man.o: mdoc_man.c config.h mandoc.h mandoc_aux.h out.h man.h mdoc.h main.h +mdoc_term.o: mdoc_term.c config.h mandoc.h mandoc_aux.h out.h term.h mdoc.h main.h +mdoc_validate.o: mdoc_validate.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h +msec.o: msec.c config.h mandoc.h libmandoc.h msec.in +out.o: out.c config.h mandoc_aux.h mandoc.h out.h +preconv.o: preconv.c config.h +read.o: read.c config.h mandoc.h mandoc_aux.h libmandoc.h mdoc.h man.h main.h +roff.o: roff.c config.h mandoc.h mandoc_aux.h libroff.h libmandoc.h predefs.in +st.o: st.c config.h mdoc.h libmdoc.h st.in +tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_html.o: tbl_html.c config.h mandoc.h out.h html.h +tbl_layout.o: tbl_layout.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_opts.o: tbl_opts.c config.h mandoc.h libmandoc.h libroff.h +tbl_term.o: tbl_term.c config.h mandoc.h out.h term.h +term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h +term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h main.h +term_ps.o: term_ps.c config.h mandoc.h mandoc_aux.h out.h main.h term.h +tree.o: tree.c config.h mandoc.h mdoc.h man.h main.h +vol.o: vol.c config.h mdoc.h libmdoc.h vol.in +test-fgetln.o: test-fgetln.c +test-getsubopt.o: test-getsubopt.c +test-mmap.o: test-mmap.c +test-ohash.o: test-ohash.c +test-reallocarray.o: test-reallocarray.c +test-sqlite3_errstr.o: test-sqlite3_errstr.c +test-strcasestr.o: test-strcasestr.c +test-strlcat.o: test-strlcat.c +test-strlcpy.o: test-strlcpy.c +test-strptime.o: test-strptime.c +test-strsep.o: test-strsep.c Modified: head/contrib/mdocml/NEWS ============================================================================== --- head/contrib/mdocml/NEWS Sat Nov 22 18:40:14 2014 (r274879) +++ head/contrib/mdocml/NEWS Sat Nov 22 18:57:23 2014 (r274880) @@ -1,7 +1,87 @@ -$Id: NEWS,v 1.3 2013/10/13 16:06:50 schwarze Exp $ +$Id: NEWS,v 1.5 2014/08/10 16:32:57 schwarze Exp $ This file lists the most important changes in the mdocml.bsd.lv distribution. +Changes in version 1.13.1, released on August 10, 2014 + + --- MAJOR NEW FEATURES --- + * A complete apropos(1)/makewhatis(8)/man.cgi(8) suite + based on SQLite3 is now included. + CAVEAT: This also requires a working fts(3) implementation. + If your system lacks that *and* you want apropos(1)/makewhatis(8), + stay with 1.12.3 for now, then go to 1.12.4 and 1.13.2. + * The roff(7) parser now provides an almost complete implementation + of numerical expressions. + * Warning and error messages have been improved in many ways. + Almost all fatal errors were downgraded to normal errors and some + even to warnings. Almost all messages now mention the macro where + the issue is detected and many indicate the workaround employed. + The mandoc(1) manual now includes a list explaining all messages. + --- MINOR NEW FEATURES --- + * The roff(7) parser now supports the .ami (append to macro with + indirectly specified name), .as (append to user-defined + string), .dei (define macro with indirectly specified name), + .ll (line length), and .rr (remove register) requests. + * The roff(7) parser now supports string comparison and numerical + conditionals in the .if and .ie requests. + * The roff parser now fully supports the \B (validate numerical + expression) and partially supports the \w (measure text width) + escape sequences. + * The terminal formatter now supports the \: (optional line break) + escape sequence. + * The roff parser now supports expansion of user-defined strings + involving indirect references. + * The roff(7) parser now handles some pre-defined read-only + number registers that occur in the pod2man(1) preamble. + * For backward compatibility, the mdoc(7) parser and formatters + now support the obsolete macros .En, .Es, .Fr, and .Ot. + * The mdoc(7) formatter non partially supports .Bd -centered. + * tbl(7) now handles leading and trailing vertical lines. + * The build system now provides fallback versions of strcasestr(3) + and strsep(3) for systems lacking them. + * The mdoc(7) manual now explains how various standards + supported by the .St macro are related to each other. + --- BUGFIXES --- + * In the roff(7) parser, several bugs were fixed with respect + to closing conditional blocks on macro lines. + * Parsing of roff(7) identifiers and escape sequences was improved + in multiple respects. + * In the mdoc(7) parser, the handling of defective document + prologues was improved in multiple ways. + * The mdoc(7) parser no longer skips content before the first section + header, and it no longer deletes non-.% content from .Rs blocks. + * In the mdoc(7) parser, a crash was fixed related to weird .Sh headers. + * In the mdoc(7) parser, handling of .Sm with missing or invalid + arguments was corrected. + * In the mdoc(7) parser, trailing punctuation at the end of partial + implicit macros no longer triggers end-of-sentence spacing. + * In the terminal formatter, two crashes were fixed: one triggered by + excessive indentation and another by excessively long .Nm arguments. + * In the terminal formatter, a floating point rounding bug was + fixed that sometimes caused an off-by-one error in indentation. + * In the UTF-8 formatter, rendering of accents, breakable hyphens, + and non-breakable spaces was corrected. + * In the HTML formatter, encoding of special characters was + corrected in multiple respects. + * In the mdoc(7) formatter, rendering of .Ex and .Rv was + improved for various edge cases. + * In the mdoc(7) formatter, handling of empty .Bl -inset item + heads was improved. + * In the man(7) formatter, some bugs were fixed with respect + to same-line detection in the context of .TP and .nf macros, + and the indentation of .IP and .TP blocks was improved. + * The mandoc(3) library no longer prints to stderr. + --- THANKS TO --- + Abhinav Upadhyay (NetBSD), Andreas Voegele, Anthony Bentley (OpenBSD), + Christian Weisgerber (OpenBSD), Havard Eidnes (NetBSD), Jan Stary, + Jason McIntyre (OpenBSD), Jeremie Courreges-Anglas (OpenBSD), + Joerg Sonnenberger (NetBSD), Juan Francisco Cantero Hurtado (OpenBSD), + Marc Espie (OpenBSD), Matthias Scheler (NetBSD), Pascal Stumpf (OpenBSD), + Paul Onyschuk (Alpine Linux), Sebastien Marie, Steffen Nurpmeso, + Stuart Henderson (OpenBSD), Ted Unangst (OpenBSD), Theo de Raadt (OpenBSD), + Thomas Klausner (NetBSD), and Ulrich Spoerlein (FreeBSD) + for reporting bugs and missing features. + Changes in version 1.12.3, released on December 31, 2013 * In the mdoc(7) SYNOPSIS, line breaks and hanging indentation Modified: head/contrib/mdocml/TODO ============================================================================== --- head/contrib/mdocml/TODO Sat Nov 22 18:40:14 2014 (r274879) +++ head/contrib/mdocml/TODO Sat Nov 22 18:57:23 2014 (r274880) @@ -1,13 +1,15 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.162 2013/12/25 14:40:34 schwarze Exp $ +* $Id: TODO,v 1.176 2014/08/09 14:24:53 schwarze Exp $ ************************************************************************ ************************************************************************ * crashes ************************************************************************ -None known. +- The abort() in bufcat(), html.c, can be triggered via buffmt_includes() + by running -Thtml -Oincludes on a file containing a long .In argument. + Fixing this will probably require reworking the whole bufcat() concept. ************************************************************************ * missing features @@ -15,11 +17,6 @@ None known. --- missing roff features ---------------------------------------------- -- roff.c should treat \n(.H>23 and \n(.V>19 in the pod2man(1) - preamble as true, see for example AUTHORS in MooseX::Getopt.3p - reported by Andreas Voegele - Tue, 22 Nov 2011 15:34:47 +0100 on ports@ - - .ad (adjust margins) .ad l -- adjust left margin only (flush left) .ad r -- adjust right margin only (flush right) @@ -29,20 +26,9 @@ None known. .ad -- re-enable adjustment without changing the mode Adjustment mode is ignored while in no-fill mode (.nf). -- .as (append to string) - found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200 - -- .ce (center N lines) - found by naddy@ in xloadimage(1) - found by Juan Francisco Cantero Hurtado - in lang/racket(1) Thu, 20 Jun 2013 03:19:11 +0200 - - .fc (field control) found by naddy@ in xloadimage(1) -- .ll (line length) - found by naddy@ in textproc/enchant(1) Sat, 12 Oct 2013 03:27:10 +0200 - - .nr third argument (auto-increment step size, requires \n+) found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 @@ -51,6 +37,7 @@ None known. - .ta (tab settings) occurs in ircbug(1) and probably gnats(1) reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 + also Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 - .ti (temporary indent) found by naddy@ in xloadimage(1) @@ -70,6 +57,10 @@ None known. - \n+ and \n- numerical register increment and decrement found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 +- \w'' width measurements + would not be very useful without an expression parser, see below + needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 + - using undefined strings or macros defines them to be empty wl@ Mon, 14 Nov 2011 14:37:01 +0000 @@ -96,6 +87,12 @@ None known. because libmdoc does not yet use mandoc_getarg(). Also check what happens in plain text, it must be identical to \e. +- .Bd -centered implies -filled, not -unfilled, which is not + easy to implement; it requires code similar to .ce, which + we don't have either. + Besides, groff has bug causing text right *before* .Bd -centered + to be centered as well. + - .Bd -filled should not be the same as .Bd -ragged, but align both the left and right margin. In groff, it is implemented in terms of .ad b, which we don't have either. Found in cksum(1). @@ -129,10 +126,19 @@ None known. - have a blank `It' head for `Bl -tag' not puke +- check whether it is correct that `D1' uses INDENT+1; + does it need its own constant? *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 19:17:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28A48E15; Sat, 22 Nov 2014 19:17:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 099468D4; Sat, 22 Nov 2014 19:17:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMJH6Rl045039; Sat, 22 Nov 2014 19:17:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMJH6LQ045031; Sat, 22 Nov 2014 19:17:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411221917.sAMJH6LQ045031@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 19:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274883 - in head/usr.bin/svn: svnadmin svndumpfilter svnlook svnversion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 19:17:07 -0000 Author: bapt Date: Sat Nov 22 19:17:05 2014 New Revision: 274883 URL: https://svnweb.freebsd.org/changeset/base/274883 Log: Add missing dependencies on pthread (sqlite being built with threadsafety on) Modified: head/usr.bin/svn/svnadmin/Makefile head/usr.bin/svn/svndumpfilter/Makefile head/usr.bin/svn/svnlook/Makefile head/usr.bin/svn/svnversion/Makefile Modified: head/usr.bin/svn/svnadmin/Makefile ============================================================================== --- head/usr.bin/svn/svnadmin/Makefile Sat Nov 22 19:10:52 2014 (r274882) +++ head/usr.bin/svn/svnadmin/Makefile Sat Nov 22 19:17:05 2014 (r274883) @@ -28,10 +28,10 @@ LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos -lbsdxml \ -L${LIBAPRDIR} -lapr \ -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt + -lz -lcrypt -lpthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_SUBR} ${LIBAPR_UTIL} \ - ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} + ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} .include Modified: head/usr.bin/svn/svndumpfilter/Makefile ============================================================================== --- head/usr.bin/svn/svndumpfilter/Makefile Sat Nov 22 19:10:52 2014 (r274882) +++ head/usr.bin/svn/svndumpfilter/Makefile Sat Nov 22 19:17:05 2014 (r274883) @@ -28,10 +28,10 @@ LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos -lbsdxml \ -L${LIBAPRDIR} -lapr \ -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt + -lz -lcrypt -lpthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_SUBR} ${LIBAPR_UTIL} \ - ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} + ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} .include Modified: head/usr.bin/svn/svnlook/Makefile ============================================================================== --- head/usr.bin/svn/svnlook/Makefile Sat Nov 22 19:10:52 2014 (r274882) +++ head/usr.bin/svn/svnlook/Makefile Sat Nov 22 19:17:05 2014 (r274883) @@ -29,10 +29,10 @@ LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos -lbsdxml \ -L${LIBAPRDIR} -lapr \ -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt + -lz -lcrypt -lpthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_DIFF} ${LIBSVN_SUBR} ${LIBAPR_UTIL} \ - ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} + ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} .include Modified: head/usr.bin/svn/svnversion/Makefile ============================================================================== --- head/usr.bin/svn/svnversion/Makefile Sat Nov 22 19:10:52 2014 (r274882) +++ head/usr.bin/svn/svnversion/Makefile Sat Nov 22 19:17:05 2014 (r274883) @@ -26,10 +26,10 @@ LDADD= -L${LIBSVN_WCDIR} -lsvn_wc \ -lbsdxml \ -L${LIBAPRDIR} -lapr \ -L${LIBSQLITEDIR} -lsqlite3 \ - -lz -lcrypt + -lz -lcrypt -lpthread DPADD= ${LIBSVN_WC} ${LIBSVN_DELTA} ${LIBSVN_DIFF} ${LIBSVN_SUBR} \ ${LIBSERF} ${LIBAPR_UTIL} ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} \ - ${LIBZ} ${LIBCRYPT} + ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} .include From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 19:18:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D51CF56; Sat, 22 Nov 2014 19:18:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28A688DC; Sat, 22 Nov 2014 19:18:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMJIAGC045223; Sat, 22 Nov 2014 19:18:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMJI9YB045217; Sat, 22 Nov 2014 19:18:09 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411221918.sAMJI9YB045217@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 19:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274884 - head/contrib/sqlite3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 19:18:10 -0000 Author: bapt Date: Sat Nov 22 19:18:08 2014 New Revision: 274884 URL: https://svnweb.freebsd.org/changeset/base/274884 Log: Update sqlite3 to 3.8.7.2 Modified: head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/sqlite3ext.h Directory Properties: head/contrib/sqlite3/ (props changed) Modified: head/contrib/sqlite3/configure ============================================================================== --- head/contrib/sqlite3/configure Sat Nov 22 19:17:05 2014 (r274883) +++ head/contrib/sqlite3/configure Sat Nov 22 19:18:08 2014 (r274884) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.8.5. +# Generated by GNU Autoconf 2.69 for sqlite 3.8.7.2. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.8.5' -PACKAGE_STRING='sqlite 3.8.5' +PACKAGE_VERSION='3.8.7.2' +PACKAGE_STRING='sqlite 3.8.7.2' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1313,7 +1313,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.8.5 to adapt to many kinds of systems. +\`configure' configures sqlite 3.8.7.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1383,7 +1383,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.8.5:";; + short | recursive ) echo "Configuration of sqlite 3.8.7.2:";; esac cat <<\_ACEOF @@ -1489,7 +1489,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.8.5 +sqlite configure 3.8.7.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1813,7 +1813,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.8.5, which was +It was created by sqlite $as_me 3.8.7.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2631,7 +2631,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.8.5' + VERSION='3.8.7.2' cat >>confdefs.h <<_ACEOF @@ -13196,7 +13196,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.8.5, which was +This file was extended by sqlite $as_me 3.8.7.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13253,7 +13253,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.8.5 +sqlite config.status 3.8.7.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/sqlite3/configure.ac ============================================================================== --- head/contrib/sqlite3/configure.ac Sat Nov 22 19:17:05 2014 (r274883) +++ head/contrib/sqlite3/configure.ac Sat Nov 22 19:18:08 2014 (r274884) @@ -8,7 +8,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.8.5, http://www.sqlite.org) +AC_INIT(sqlite, 3.8.7.2, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) # Use automake. Modified: head/contrib/sqlite3/shell.c ============================================================================== --- head/contrib/sqlite3/shell.c Sat Nov 22 19:17:05 2014 (r274883) +++ head/contrib/sqlite3/shell.c Sat Nov 22 19:18:08 2014 (r274884) @@ -33,6 +33,9 @@ #include #include #include "sqlite3.h" +#if SQLITE_USER_AUTHENTICATION +# include "sqlite3userauth.h" +#endif #include #include @@ -64,6 +67,7 @@ #if defined(_WIN32) || defined(WIN32) # include +# include #define isatty(h) _isatty(h) #ifndef access # define access(f,m) _access((f),(m)) @@ -431,19 +435,24 @@ static char *one_input_line(FILE *in, ch return zResult; } -struct previous_mode_data { - int valid; /* Is there legit data in here? */ - int mode; - int showHeader; - int colWidth[100]; +/* +** Shell output mode information from before ".explain on", +** saved so that it can be restored by ".explain off" +*/ +typedef struct SavedModeInfo SavedModeInfo; +struct SavedModeInfo { + int valid; /* Is there legit data in here? */ + int mode; /* Mode prior to ".explain on" */ + int showHeader; /* The ".header" setting prior to ".explain on" */ + int colWidth[100]; /* Column widths prior to ".explain on" */ }; /* -** An pointer to an instance of this structure is passed from -** the main program to the callback. This is used to communicate -** state and mode information. +** State information about the database connection is contained in an +** instance of the following structure. */ -struct callback_data { +typedef struct ShellState ShellState; +struct ShellState { sqlite3 *db; /* The database */ int echoOn; /* True to echo input commands */ int autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL stmt */ @@ -456,15 +465,15 @@ struct callback_data { int mode; /* An output mode setting */ int writableSchema; /* True if PRAGMA writable_schema=ON */ int showHeader; /* True to show column names in List or Column mode */ + unsigned shellFlgs; /* Various flags */ char *zDestTable; /* Name of destination table when MODE_Insert */ char separator[20]; /* Separator character for MODE_List */ + char newline[20]; /* Record separator in MODE_Csv */ int colWidth[100]; /* Requested width of each column when in column mode*/ int actualWidth[100]; /* Actual width of each column */ char nullvalue[20]; /* The text to print when a NULL comes back from ** the database */ - struct previous_mode_data explainPrev; - /* Holds the mode information just before - ** .explain ON */ + SavedModeInfo normalMode;/* Holds the mode just before .explain ON */ char outfile[FILENAME_MAX]; /* Filename for *out */ const char *zDbFilename; /* name of the database file */ char *zFreeOnClose; /* Filename to free when closing */ @@ -477,6 +486,13 @@ struct callback_data { }; /* +** These are the allowed shellFlgs values +*/ +#define SHFLG_Scratch 0x00001 /* The --scratch option is used */ +#define SHFLG_Pagecache 0x00002 /* The --pagecache option is used */ +#define SHFLG_Lookaside 0x00004 /* Lookaside memory is used */ + +/* ** These are the allowed modes. */ #define MODE_Line 0 /* One column per line. Blank line between records */ @@ -520,7 +536,7 @@ static int strlen30(const char *z){ ** A callback for the sqlite3_log() interface. */ static void shellLog(void *pArg, int iErrCode, const char *zMsg){ - struct callback_data *p = (struct callback_data*)pArg; + ShellState *p = (ShellState*)pArg; if( p->pLog==0 ) return; fprintf(p->pLog, "(%d) %s\n", iErrCode, zMsg); fflush(p->pLog); @@ -659,9 +675,10 @@ static const char needCsvQuote[] = { /* ** Output a single term of CSV. Actually, p->separator is used for ** the separator, which may or may not be a comma. p->nullvalue is -** the null value. Strings are quoted if necessary. +** the null value. Strings are quoted if necessary. The separator +** is only issued if bSep is true. */ -static void output_csv(struct callback_data *p, const char *z, int bSep){ +static void output_csv(ShellState *p, const char *z, int bSep){ FILE *out = p->out; if( z==0 ){ fprintf(out,"%s",p->nullvalue); @@ -710,7 +727,7 @@ static void interrupt_handler(int NotUse */ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int *aiType){ int i; - struct callback_data *p = (struct callback_data*)pArg; + ShellState *p = (ShellState*)pArg; switch( p->mode ){ case MODE_Line: { @@ -855,17 +872,26 @@ static int shell_callback(void *pArg, in break; } case MODE_Csv: { +#if defined(WIN32) || defined(_WIN32) + fflush(p->out); + _setmode(_fileno(p->out), _O_BINARY); +#endif if( p->cnt++==0 && p->showHeader ){ for(i=0; iout,"\n"); + fprintf(p->out,"%s",p->newline); } - if( azArg==0 ) break; - for(i=0; i0 ){ + for(i=0; iout,"%s",p->newline); } - fprintf(p->out,"\n"); +#if defined(WIN32) || defined(_WIN32) + fflush(p->out); + _setmode(_fileno(p->out), _O_TEXT); +#endif break; } case MODE_Insert: { @@ -911,11 +937,11 @@ static int callback(void *pArg, int nArg } /* -** Set the destination table field of the callback_data structure to +** Set the destination table field of the ShellState structure to ** the name of the table given. Escape any quote characters in the ** table name. */ -static void set_table_name(struct callback_data *p, const char *zName){ +static void set_table_name(ShellState *p, const char *zName){ int i, n; int needQuote; char *z; @@ -1005,7 +1031,7 @@ static char *appendText(char *zIn, char ** won't consume the semicolon terminator. */ static int run_table_dump_query( - struct callback_data *p, /* Query context */ + ShellState *p, /* Query context */ const char *zSelect, /* SELECT statement to extract content */ const char *zFirstRow /* Print before first row, if not NULL */ ){ @@ -1068,7 +1094,7 @@ static char *save_err_msg( */ static int display_stats( sqlite3 *db, /* Database to query */ - struct callback_data *pArg, /* Pointer to struct callback_data */ + ShellState *pArg, /* Pointer to ShellState */ int bReset /* True to reset the stats */ ){ int iCur; @@ -1082,21 +1108,19 @@ static int display_stats( iHiwtr = iCur = -1; sqlite3_status(SQLITE_STATUS_MALLOC_COUNT, &iCur, &iHiwtr, bReset); fprintf(pArg->out, "Number of Outstanding Allocations: %d (max %d)\n", iCur, iHiwtr); -/* -** Not currently used by the CLI. -** iHiwtr = iCur = -1; -** sqlite3_status(SQLITE_STATUS_PAGECACHE_USED, &iCur, &iHiwtr, bReset); -** fprintf(pArg->out, "Number of Pcache Pages Used: %d (max %d) pages\n", iCur, iHiwtr); -*/ + if( pArg->shellFlgs & SHFLG_Pagecache ){ + iHiwtr = iCur = -1; + sqlite3_status(SQLITE_STATUS_PAGECACHE_USED, &iCur, &iHiwtr, bReset); + fprintf(pArg->out, "Number of Pcache Pages Used: %d (max %d) pages\n", iCur, iHiwtr); + } iHiwtr = iCur = -1; sqlite3_status(SQLITE_STATUS_PAGECACHE_OVERFLOW, &iCur, &iHiwtr, bReset); fprintf(pArg->out, "Number of Pcache Overflow Bytes: %d (max %d) bytes\n", iCur, iHiwtr); -/* -** Not currently used by the CLI. -** iHiwtr = iCur = -1; -** sqlite3_status(SQLITE_STATUS_SCRATCH_USED, &iCur, &iHiwtr, bReset); -** fprintf(pArg->out, "Number of Scratch Allocations Used: %d (max %d)\n", iCur, iHiwtr); -*/ + if( pArg->shellFlgs & SHFLG_Scratch ){ + iHiwtr = iCur = -1; + sqlite3_status(SQLITE_STATUS_SCRATCH_USED, &iCur, &iHiwtr, bReset); + fprintf(pArg->out, "Number of Scratch Allocations Used: %d (max %d)\n", iCur, iHiwtr); + } iHiwtr = iCur = -1; sqlite3_status(SQLITE_STATUS_SCRATCH_OVERFLOW, &iCur, &iHiwtr, bReset); fprintf(pArg->out, "Number of Scratch Overflow Bytes: %d (max %d) bytes\n", iCur, iHiwtr); @@ -1117,15 +1141,17 @@ static int display_stats( } if( pArg && pArg->out && db ){ - iHiwtr = iCur = -1; - sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_USED, &iCur, &iHiwtr, bReset); - fprintf(pArg->out, "Lookaside Slots Used: %d (max %d)\n", iCur, iHiwtr); - sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_HIT, &iCur, &iHiwtr, bReset); - fprintf(pArg->out, "Successful lookaside attempts: %d\n", iHiwtr); - sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, &iCur, &iHiwtr, bReset); - fprintf(pArg->out, "Lookaside failures due to size: %d\n", iHiwtr); - sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL, &iCur, &iHiwtr, bReset); - fprintf(pArg->out, "Lookaside failures due to OOM: %d\n", iHiwtr); + if( pArg->shellFlgs & SHFLG_Lookaside ){ + iHiwtr = iCur = -1; + sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_USED, &iCur, &iHiwtr, bReset); + fprintf(pArg->out, "Lookaside Slots Used: %d (max %d)\n", iCur, iHiwtr); + sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_HIT, &iCur, &iHiwtr, bReset); + fprintf(pArg->out, "Successful lookaside attempts: %d\n", iHiwtr); + sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, &iCur, &iHiwtr, bReset); + fprintf(pArg->out, "Lookaside failures due to size: %d\n", iHiwtr); + sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL, &iCur, &iHiwtr, bReset); + fprintf(pArg->out, "Lookaside failures due to OOM: %d\n", iHiwtr); + } iHiwtr = iCur = -1; sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_USED, &iCur, &iHiwtr, bReset); fprintf(pArg->out, "Pager Heap Usage: %d bytes\n", iCur); iHiwtr = iCur = -1; @@ -1175,7 +1201,7 @@ static int str_in_array(const char *zStr /* ** If compiled statement pSql appears to be an EXPLAIN statement, allocate -** and populate the callback_data.aiIndent[] array with the number of +** and populate the ShellState.aiIndent[] array with the number of ** spaces each opcode should be indented before it is output. ** ** The indenting rules are: @@ -1191,7 +1217,7 @@ static int str_in_array(const char *zStr ** then indent all opcodes between the earlier instruction ** and "Goto" by 2 spaces. */ -static void explain_data_prepare(struct callback_data *p, sqlite3_stmt *pSql){ +static void explain_data_prepare(ShellState *p, sqlite3_stmt *pSql){ const char *zSql; /* The text of the SQL statement */ const char *z; /* Used to check if this is an EXPLAIN */ int *abYield = 0; /* True if op is an OP_Yield */ @@ -1251,7 +1277,7 @@ static void explain_data_prepare(struct /* ** Free the array allocated by explain_data_prepare(). */ -static void explain_data_delete(struct callback_data *p){ +static void explain_data_delete(ShellState *p){ sqlite3_free(p->aiIndent); p->aiIndent = 0; p->nIndent = 0; @@ -1268,12 +1294,12 @@ static void explain_data_delete(struct c ** and callback data argument. */ static int shell_exec( - sqlite3 *db, /* An open database */ - const char *zSql, /* SQL to be evaluated */ + sqlite3 *db, /* An open database */ + const char *zSql, /* SQL to be evaluated */ int (*xCallback)(void*,int,char**,char**,int*), /* Callback function */ - /* (not the same as sqlite3_exec) */ - struct callback_data *pArg, /* Pointer to struct callback_data */ - char **pzErrMsg /* Error msg written here */ + /* (not the same as sqlite3_exec) */ + ShellState *pArg, /* Pointer to ShellState */ + char **pzErrMsg /* Error msg written here */ ){ sqlite3_stmt *pStmt = NULL; /* Statement to execute. */ int rc = SQLITE_OK; /* Return Code */ @@ -1327,15 +1353,6 @@ static int shell_exec( sqlite3_free(zEQP); } - /* Output TESTCTRL_EXPLAIN text of requested */ - if( pArg && pArg->mode==MODE_Explain ){ - const char *zExplain = 0; - sqlite3_test_control(SQLITE_TESTCTRL_EXPLAIN_STMT, pStmt, &zExplain); - if( zExplain && zExplain[0] ){ - fprintf(pArg->out, "%s", zExplain); - } - } - /* If the shell is currently in ".explain" mode, gather the extra ** data required to add indents to the output.*/ if( pArg && pArg->mode==MODE_Explain ){ @@ -1441,7 +1458,7 @@ static int dump_callback(void *pArg, int const char *zType; const char *zSql; const char *zPrepStmt = 0; - struct callback_data *p = (struct callback_data *)pArg; + ShellState *p = (ShellState *)pArg; UNUSED_PARAMETER(azCol); if( nArg!=3 ) return 1; @@ -1537,7 +1554,7 @@ static int dump_callback(void *pArg, int ** "ORDER BY rowid DESC" to the end. */ static int run_schema_dump_query( - struct callback_data *p, + ShellState *p, const char *zQuery ){ int rc; @@ -1579,9 +1596,11 @@ static char zHelp[] = " If TABLE specified, only dump tables matching\n" " LIKE pattern TABLE.\n" ".echo on|off Turn command echo on or off\n" + ".eqp on|off Enable or disable automatic EXPLAIN QUERY PLAN\n" ".exit Exit this program\n" ".explain ?on|off? Turn output mode suitable for EXPLAIN on or off.\n" " With no args, it turns EXPLAIN on.\n" + ".fullschema Show schema and the content of sqlite_stat tables\n" ".headers on|off Turn display of headers on or off\n" ".help Show this message\n" ".import FILE TABLE Import data from FILE into TABLE\n" @@ -1617,7 +1636,8 @@ static char zHelp[] = ".schema ?TABLE? Show the CREATE statements\n" " If TABLE specified, only show tables matching\n" " LIKE pattern TABLE.\n" - ".separator STRING Change separator used by output mode and .import\n" + ".separator STRING ?NL? Change separator used by output mode and .import\n" + " NL is the end-of-line mark for CSV\n" ".shell CMD ARGS... Run CMD ARGS... in a system shell\n" ".show Show the current values for various settings\n" ".stats on|off Turn stats on or off\n" @@ -1634,13 +1654,73 @@ static char zHelp[] = ; /* Forward reference */ -static int process_input(struct callback_data *p, FILE *in); +static int process_input(ShellState *p, FILE *in); +/* +** Implementation of the "readfile(X)" SQL function. The entire content +** of the file named X is read and returned as a BLOB. NULL is returned +** if the file does not exist or is unreadable. +*/ +static void readfileFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + const char *zName; + FILE *in; + long nIn; + void *pBuf; + + zName = (const char*)sqlite3_value_text(argv[0]); + if( zName==0 ) return; + in = fopen(zName, "rb"); + if( in==0 ) return; + fseek(in, 0, SEEK_END); + nIn = ftell(in); + rewind(in); + pBuf = sqlite3_malloc( nIn ); + if( pBuf && 1==fread(pBuf, nIn, 1, in) ){ + sqlite3_result_blob(context, pBuf, nIn, sqlite3_free); + }else{ + sqlite3_free(pBuf); + } + fclose(in); +} + +/* +** Implementation of the "writefile(X,Y)" SQL function. The argument Y +** is written into file X. The number of bytes written is returned. Or +** NULL is returned if something goes wrong, such as being unable to open +** file X for writing. +*/ +static void writefileFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + FILE *out; + const char *z; + sqlite3_int64 rc; + const char *zFile; + + zFile = (const char*)sqlite3_value_text(argv[0]); + if( zFile==0 ) return; + out = fopen(zFile, "wb"); + if( out==0 ) return; + z = (const char*)sqlite3_value_blob(argv[1]); + if( z==0 ){ + rc = 0; + }else{ + rc = fwrite(z, 1, sqlite3_value_bytes(argv[1]), out); + } + fclose(out); + sqlite3_result_int64(context, rc); +} /* ** Make sure the database is open. If it is not, then open it. If ** the database fails to open, print an error message and exit. */ -static void open_db(struct callback_data *p, int keepAlive){ +static void open_db(ShellState *p, int keepAlive){ if( p->db==0 ){ sqlite3_initialize(); sqlite3_open(p->zDbFilename, &p->db); @@ -1658,6 +1738,10 @@ static void open_db(struct callback_data #ifndef SQLITE_OMIT_LOAD_EXTENSION sqlite3_enable_load_extension(p->db, 1); #endif + sqlite3_create_function(db, "readfile", 1, SQLITE_UTF8, 0, + readfileFunc, 0, 0); + sqlite3_create_function(db, "writefile", 2, SQLITE_UTF8, 0, + writefileFunc, 0, 0); } } @@ -1817,7 +1901,11 @@ static FILE *output_file_open(const char */ static void sql_trace_callback(void *pArg, const char *z){ FILE *f = (FILE*)pArg; - if( f ) fprintf(f, "%s\n", z); + if( f ){ + int i = (int)strlen(z); + while( i>0 && z[i-1]==';' ){ i--; } + fprintf(f, "%.*s;\n", i, z); + } } /* @@ -1935,7 +2023,7 @@ static char *csv_read_one_field(CSVReade ** work for WITHOUT ROWID tables. */ static void tryToCloneData( - struct callback_data *p, + ShellState *p, sqlite3 *newDb, const char *zTable ){ @@ -2048,10 +2136,10 @@ end_data_xfer: ** sqlite_master table, try again moving backwards. */ static void tryToCloneSchema( - struct callback_data *p, + ShellState *p, sqlite3 *newDb, const char *zWhere, - void (*xForEach)(struct callback_data*,sqlite3*,const char*) + void (*xForEach)(ShellState*,sqlite3*,const char*) ){ sqlite3_stmt *pQuery = 0; char *zQuery = 0; @@ -2122,7 +2210,7 @@ end_schema_xfer: ** as possible out of the main database (which might be corrupt) and write it ** into zNewDb. */ -static void tryToClone(struct callback_data *p, const char *zNewDb){ +static void tryToClone(ShellState *p, const char *zNewDb){ int rc; sqlite3 *newDb = 0; if( access(zNewDb,0)==0 ){ @@ -2147,7 +2235,7 @@ static void tryToClone(struct callback_d /* ** Change the output file back to stdout */ -static void output_reset(struct callback_data *p){ +static void output_reset(ShellState *p){ if( p->outfile[0]=='|' ){ pclose(p->out); }else{ @@ -2163,7 +2251,7 @@ static void output_reset(struct callback ** ** Return 1 on error, 2 to exit, and 0 otherwise. */ -static int do_meta_command(char *zLine, struct callback_data *p){ +static int do_meta_command(char *zLine, ShellState *p){ int i = 1; int nArg = 0; int n, c; @@ -2281,7 +2369,7 @@ static int do_meta_command(char *zLine, }else if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){ - struct callback_data data; + ShellState data; char *zErrMsg = 0; open_db(p, 0); memcpy(&data, p, sizeof(data)); @@ -2379,11 +2467,11 @@ static int do_meta_command(char *zLine, if( c=='e' && strncmp(azArg[0], "explain", n)==0 ){ int val = nArg>=2 ? booleanValue(azArg[1]) : 1; if(val == 1) { - if(!p->explainPrev.valid) { - p->explainPrev.valid = 1; - p->explainPrev.mode = p->mode; - p->explainPrev.showHeader = p->showHeader; - memcpy(p->explainPrev.colWidth,p->colWidth,sizeof(p->colWidth)); + if(!p->normalMode.valid) { + p->normalMode.valid = 1; + p->normalMode.mode = p->mode; + p->normalMode.showHeader = p->showHeader; + memcpy(p->normalMode.colWidth,p->colWidth,sizeof(p->colWidth)); } /* We could put this code under the !p->explainValid ** condition so that it does not execute if we are already in @@ -2403,11 +2491,62 @@ static int do_meta_command(char *zLine, p->colWidth[5] = 13; /* P4 */ p->colWidth[6] = 2; /* P5 */ p->colWidth[7] = 13; /* Comment */ - }else if (p->explainPrev.valid) { - p->explainPrev.valid = 0; - p->mode = p->explainPrev.mode; - p->showHeader = p->explainPrev.showHeader; - memcpy(p->colWidth,p->explainPrev.colWidth,sizeof(p->colWidth)); + }else if (p->normalMode.valid) { + p->normalMode.valid = 0; + p->mode = p->normalMode.mode; + p->showHeader = p->normalMode.showHeader; + memcpy(p->colWidth,p->normalMode.colWidth,sizeof(p->colWidth)); + } + }else + + if( c=='f' && strncmp(azArg[0], "fullschema", n)==0 ){ + ShellState data; + char *zErrMsg = 0; + int doStats = 0; + if( nArg!=1 ){ + fprintf(stderr, "Usage: .fullschema\n"); + rc = 1; + goto meta_command_exit; + } + open_db(p, 0); + memcpy(&data, p, sizeof(data)); + data.showHeader = 0; + data.mode = MODE_Semi; + rc = sqlite3_exec(p->db, + "SELECT sql FROM" + " (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x" + " FROM sqlite_master UNION ALL" + " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) " + "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%' " + "ORDER BY rowid", + callback, &data, &zErrMsg + ); + if( rc==SQLITE_OK ){ + sqlite3_stmt *pStmt; + rc = sqlite3_prepare_v2(p->db, + "SELECT rowid FROM sqlite_master" + " WHERE name GLOB 'sqlite_stat[134]'", + -1, &pStmt, 0); + doStats = sqlite3_step(pStmt)==SQLITE_ROW; + sqlite3_finalize(pStmt); + } + if( doStats==0 ){ + fprintf(p->out, "/* No STAT tables available */\n"); + }else{ + fprintf(p->out, "ANALYZE sqlite_master;\n"); + sqlite3_exec(p->db, "SELECT 'ANALYZE sqlite_master'", + callback, &data, &zErrMsg); + data.mode = MODE_Insert; + data.zDestTable = "sqlite_stat1"; + shell_exec(p->db, "SELECT * FROM sqlite_stat1", + shell_callback, &data,&zErrMsg); + data.zDestTable = "sqlite_stat3"; + shell_exec(p->db, "SELECT * FROM sqlite_stat3", + shell_callback, &data,&zErrMsg); + data.zDestTable = "sqlite_stat4"; + shell_exec(p->db, "SELECT * FROM sqlite_stat4", + shell_callback, &data, &zErrMsg); + fprintf(p->out, "ANALYZE sqlite_master;\n"); } }else @@ -2553,7 +2692,7 @@ static int do_meta_command(char *zLine, "filling the rest with NULL\n", sCsv.zFile, startLine, nCol, i+1); i++; - while( imode = MODE_Csv; sqlite3_snprintf(sizeof(p->separator), p->separator, ","); + sqlite3_snprintf(sizeof(p->newline), p->newline, "\r\n"); }else if( c2=='t' && strncmp(azArg[1],"tabs",n2)==0 ){ p->mode = MODE_List; sqlite3_snprintf(sizeof(p->separator), p->separator, "\t"); @@ -2875,7 +3015,7 @@ static int do_meta_command(char *zLine, }else if( c=='s' && strncmp(azArg[0], "schema", n)==0 ){ - struct callback_data data; + ShellState data; char *zErrMsg = 0; open_db(p, 0); memcpy(&data, p, sizeof(data)); @@ -2931,7 +3071,7 @@ static int do_meta_command(char *zLine, " (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x" " FROM sqlite_master UNION ALL" " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) " - "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'" + "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%' " "ORDER BY rowid", callback, &data, &zErrMsg ); @@ -2952,6 +3092,15 @@ static int do_meta_command(char *zLine, } }else + +#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE) + if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){ + extern int sqlite3SelectTrace; + sqlite3SelectTrace = nArg>=2 ? booleanValue(azArg[1]) : 0xff; + }else +#endif + + #ifdef SQLITE_DEBUG /* Undocumented commands for internal testing. Subject to change ** without notice. */ @@ -2976,20 +3125,23 @@ static int do_meta_command(char *zLine, #endif if( c=='s' && strncmp(azArg[0], "separator", n)==0 ){ - if( nArg==2 ){ - sqlite3_snprintf(sizeof(p->separator), p->separator, - "%.*s", (int)sizeof(p->separator)-1, azArg[1]); - }else{ - fprintf(stderr, "Usage: .separator STRING\n"); + if( nArg<2 || nArg>3 ){ + fprintf(stderr, "Usage: .separator SEPARATOR ?NEWLINE?\n"); rc = 1; } + if( nArg>=2 ){ + sqlite3_snprintf(sizeof(p->separator), p->separator, azArg[1]); + } + if( nArg>=3 ){ + sqlite3_snprintf(sizeof(p->newline), p->newline, azArg[2]); + } }else if( c=='s' && (strncmp(azArg[0], "shell", n)==0 || strncmp(azArg[0],"system",n)==0) ){ char *zCmd; - int i; + int i, x; if( nArg<2 ){ fprintf(stderr, "Usage: .system COMMAND\n"); rc = 1; @@ -3000,8 +3152,9 @@ static int do_meta_command(char *zLine, zCmd = sqlite3_mprintf(strchr(azArg[i],' ')==0?"%z %s":"%z \"%s\"", zCmd, azArg[i]); } - (void)system(zCmd); + x = system(zCmd); sqlite3_free(zCmd); + if( x ) fprintf(stderr, "System command returns %d\n", x); }else if( c=='s' && strncmp(azArg[0], "show", n)==0 ){ @@ -3013,7 +3166,7 @@ static int do_meta_command(char *zLine, } fprintf(p->out,"%9.9s: %s\n","echo", p->echoOn ? "on" : "off"); fprintf(p->out,"%9.9s: %s\n","eqp", p->autoEQP ? "on" : "off"); - fprintf(p->out,"%9.9s: %s\n","explain", p->explainPrev.valid ? "on" :"off"); + fprintf(p->out,"%9.9s: %s\n","explain", p->normalMode.valid ? "on" :"off"); fprintf(p->out,"%9.9s: %s\n","headers", p->showHeader ? "on" : "off"); fprintf(p->out,"%9.9s: %s\n","mode", modeDescr[p->mode]); fprintf(p->out,"%9.9s: ", "nullvalue"); @@ -3023,6 +3176,8 @@ static int do_meta_command(char *zLine, strlen30(p->outfile) ? p->outfile : "stdout"); fprintf(p->out,"%9.9s: ", "separator"); output_c_string(p->out, p->separator); + fprintf(p->out," "); + output_c_string(p->out, p->newline); fprintf(p->out, "\n"); fprintf(p->out,"%9.9s: %s\n","stats", p->statsOn ? "on" : "off"); fprintf(p->out,"%9.9s: ","width"); @@ -3283,6 +3438,71 @@ static int do_meta_command(char *zLine, #endif }else +#if SQLITE_USER_AUTHENTICATION + if( c=='u' && strncmp(azArg[0], "user", n)==0 ){ + if( nArg<2 ){ + fprintf(stderr, "Usage: .user SUBCOMMAND ...\n"); + rc = 1; + goto meta_command_exit; + } + open_db(p, 0); + if( strcmp(azArg[1],"login")==0 ){ + if( nArg!=4 ){ + fprintf(stderr, "Usage: .user login USER PASSWORD\n"); + rc = 1; + goto meta_command_exit; + } + rc = sqlite3_user_authenticate(p->db, azArg[2], azArg[3], + (int)strlen(azArg[3])); + if( rc ){ + fprintf(stderr, "Authentication failed for user %s\n", azArg[2]); + rc = 1; + } + }else if( strcmp(azArg[1],"add")==0 ){ + if( nArg!=5 ){ + fprintf(stderr, "Usage: .user add USER PASSWORD ISADMIN\n"); + rc = 1; + goto meta_command_exit; + } + rc = sqlite3_user_add(p->db, azArg[2], + azArg[3], (int)strlen(azArg[3]), + booleanValue(azArg[4])); + if( rc ){ + fprintf(stderr, "User-Add failed: %d\n", rc); + rc = 1; + } + }else if( strcmp(azArg[1],"edit")==0 ){ + if( nArg!=5 ){ + fprintf(stderr, "Usage: .user edit USER PASSWORD ISADMIN\n"); + rc = 1; + goto meta_command_exit; + } + rc = sqlite3_user_change(p->db, azArg[2], + azArg[3], (int)strlen(azArg[3]), + booleanValue(azArg[4])); + if( rc ){ + fprintf(stderr, "User-Edit failed: %d\n", rc); + rc = 1; + } + }else if( strcmp(azArg[1],"delete")==0 ){ + if( nArg!=3 ){ + fprintf(stderr, "Usage: .user delete USER\n"); + rc = 1; + goto meta_command_exit; + } + rc = sqlite3_user_delete(p->db, azArg[2]); + if( rc ){ + fprintf(stderr, "User-Delete failed: %d\n", rc); + rc = 1; + } + }else{ + fprintf(stderr, "Usage: .user login|add|edit|delete ...\n"); + rc = 1; + goto meta_command_exit; + } + }else +#endif /* SQLITE_USER_AUTHENTICATION */ + if( c=='v' && strncmp(azArg[0], "version", n)==0 ){ fprintf(p->out, "SQLite %s %s\n" /*extra-version-info*/, sqlite3_libversion(), sqlite3_sourceid()); @@ -3403,7 +3623,7 @@ static int line_is_complete(char *zSql, ** ** Return the number of errors. */ -static int process_input(struct callback_data *p, FILE *in){ +static int process_input(ShellState *p, FILE *in){ char *zLine = 0; /* A single input line */ char *zSql = 0; /* Accumulated SQL text */ int nLine; /* Length of current line */ @@ -3505,6 +3725,7 @@ static int process_input(struct callback if( nSql ){ if( !_all_whitespace(zSql) ){ fprintf(stderr, "Error: incomplete SQL: %s\n", zSql); + errCnt++; } free(zSql); } @@ -3582,7 +3803,7 @@ static char *find_home_dir(void){ ** Returns the number of errors. */ static int process_sqliterc( - struct callback_data *p, /* Configuration data */ + ShellState *p, /* Configuration data */ const char *sqliterc_override /* Name of config file. NULL to use default */ ){ char *home_dir = NULL; @@ -3635,11 +3856,15 @@ static const char zOptions[] = " -interactive force interactive I/O\n" " -line set output mode to 'line'\n" " -list set output mode to 'list'\n" + " -lookaside SIZE N use N entries of SZ bytes for lookaside memory\n" " -mmap N default mmap size set to N\n" #ifdef SQLITE_ENABLE_MULTIPLEX " -multiplex enable the multiplexor VFS\n" #endif + " -newline SEP set newline character(s) for CSV\n" " -nullvalue TEXT set text string for NULL values. Default ''\n" + " -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n" + " -scratch SIZE N use N slots of SZ bytes each for scratch memory\n" " -separator SEP set output field separator. Default: '|'\n" " -stats print memory stats before each finalize\n" " -version show SQLite version\n" @@ -3664,16 +3889,18 @@ static void usage(int showDetail){ /* ** Initialize the state information in data */ -static void main_init(struct callback_data *data) { +static void main_init(ShellState *data) { memset(data, 0, sizeof(*data)); data->mode = MODE_List; memcpy(data->separator,"|", 2); + memcpy(data->newline,"\r\n", 3); data->showHeader = 0; + data->shellFlgs = SHFLG_Lookaside; sqlite3_config(SQLITE_CONFIG_URI, 1); sqlite3_config(SQLITE_CONFIG_LOG, shellLog, data); + sqlite3_config(SQLITE_CONFIG_MULTITHREAD); sqlite3_snprintf(sizeof(mainPrompt), mainPrompt,"sqlite> "); sqlite3_snprintf(sizeof(continuePrompt), continuePrompt," ...> "); - sqlite3_config(SQLITE_CONFIG_SINGLETHREAD); } /* @@ -3711,7 +3938,7 @@ static char *cmdline_option_value(int ar int main(int argc, char **argv){ char *zErrMsg = 0; - struct callback_data data; + ShellState data; const char *zInitFile = 0; char *zFirstCmd = 0; int i; @@ -3760,6 +3987,7 @@ int main(int argc, char **argv){ if( z[1]=='-' ) z++; if( strcmp(z,"-separator")==0 || strcmp(z,"-nullvalue")==0 + || strcmp(z,"-newline")==0 || strcmp(z,"-cmd")==0 ){ (void)cmdline_option_value(argc, argv, ++i); @@ -3781,6 +4009,33 @@ int main(int argc, char **argv){ if( szHeap>0x7fff0000 ) szHeap = 0x7fff0000; sqlite3_config(SQLITE_CONFIG_HEAP, malloc((int)szHeap), (int)szHeap, 64); #endif + }else if( strcmp(z,"-scratch")==0 ){ + int n, sz; + sz = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( sz>400000 ) sz = 400000; + if( sz<2500 ) sz = 2500; + n = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( n>10 ) n = 10; + if( n<1 ) n = 1; + sqlite3_config(SQLITE_CONFIG_SCRATCH, malloc(n*sz+1), sz, n); + data.shellFlgs |= SHFLG_Scratch; + }else if( strcmp(z,"-pagecache")==0 ){ + int n, sz; + sz = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( sz>70000 ) sz = 70000; + if( sz<800 ) sz = 800; + n = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( n<10 ) n = 10; + sqlite3_config(SQLITE_CONFIG_PAGECACHE, malloc(n*sz+1), sz, n); + data.shellFlgs |= SHFLG_Pagecache; + }else if( strcmp(z,"-lookaside")==0 ){ + int n, sz; + sz = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( sz<0 ) sz = 0; + n = (int)integerValue(cmdline_option_value(argc,argv,++i)); + if( n<0 ) n = 0; + sqlite3_config(SQLITE_CONFIG_LOOKASIDE, sz, n); + if( sz*n==0 ) data.shellFlgs &= ~SHFLG_Lookaside; #ifdef SQLITE_ENABLE_VFSTRACE }else if( strcmp(z,"-vfstrace")==0 ){ extern int vfstrace_register( @@ -3869,6 +4124,9 @@ int main(int argc, char **argv){ }else if( strcmp(z,"-separator")==0 ){ sqlite3_snprintf(sizeof(data.separator), data.separator, "%s",cmdline_option_value(argc,argv,++i)); + }else if( strcmp(z,"-newline")==0 ){ + sqlite3_snprintf(sizeof(data.newline), data.newline, + "%s",cmdline_option_value(argc,argv,++i)); }else if( strcmp(z,"-nullvalue")==0 ){ sqlite3_snprintf(sizeof(data.nullvalue), data.nullvalue, "%s",cmdline_option_value(argc,argv,++i)); @@ -3893,6 +4151,12 @@ int main(int argc, char **argv){ stdin_is_interactive = 0; }else if( strcmp(z,"-heap")==0 ){ i++; + }else if( strcmp(z,"-scratch")==0 ){ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 19:39:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A947D943; Sat, 22 Nov 2014 19:39:45 +0000 (UTC) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 396CBADD; Sat, 22 Nov 2014 19:39:45 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id z12so9272050wgg.15 for ; Sat, 22 Nov 2014 11:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=S2cv/UEyOaR/aGAjtOJXvzp9dnz7TItkFjSYAxJOel4=; b=Yl0L/txhrZPa08IL6Dp18e1+8BJI+GNFEGbDLcdhZh4AApvo9ZJWSuEAjCPPCy9ar3 d35Gh/ilfAS9OVbvR6iGh3T+MtrjFoBudb5P+mzC3ZKhxphZfAKNjNuDCjeNPYxb6n+a uAhsYXKkwDu2Uktqx2FPZ39HE93Llz+eHMuyZMmRbKhYDz6MNobO1PRPDQyQIdipzsW4 6Ui32gF+0hZcdpVxNTFJ/giiKFRPQwgDneaPSbzCvEEKDbHAGKLcg24YfmyB9U/iDQOr txYgfrO5wG3Owfh7cz93z9Fgv988bTetYIlw7EfAj27KfQJMhb7tigfmKOVrtsHujZSb sYEg== MIME-Version: 1.0 X-Received: by 10.194.235.193 with SMTP id uo1mr18871438wjc.105.1416685183665; Sat, 22 Nov 2014 11:39:43 -0800 (PST) Received: by 10.27.179.168 with HTTP; Sat, 22 Nov 2014 11:39:43 -0800 (PST) In-Reply-To: <201411221857.sAMIvNU7034161@svn.freebsd.org> References: <201411221857.sAMIvNU7034161@svn.freebsd.org> Date: Sat, 22 Nov 2014 14:39:43 -0500 Message-ID: Subject: Re: svn commit: r274880 - in head: contrib/mdocml usr.bin/mandoc From: Benjamin Kaduk To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 19:39:45 -0000 On Sat, Nov 22, 2014 at 1:57 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Nov 22 18:57:23 2014 > New Revision: 274880 > URL: https://svnweb.freebsd.org/changeset/base/274880 > > Log: > Update mandoc to 1.13.1 > Thank you! -Ben From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 19:44:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F65BB51; Sat, 22 Nov 2014 19:44:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDA6CBA1; Sat, 22 Nov 2014 19:44:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMJirBe059383; Sat, 22 Nov 2014 19:44:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMJionc059362; Sat, 22 Nov 2014 19:44:50 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411221944.sAMJionc059362@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 19:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274885 - in head: lib lib/libsqlite3 usr.bin/svn usr.bin/svn/lib usr.bin/svn/lib/libsqlite3 usr.bin/svn/svn usr.bin/svn/svnadmin usr.bin/svn/svndumpfilter usr.bin/svn/svnlook usr.bin/s... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 19:44:54 -0000 Author: bapt Date: Sat Nov 22 19:44:49 2014 New Revision: 274885 URL: https://svnweb.freebsd.org/changeset/base/274885 Log: Promote SQLite3 as a privatelib as it will also be used by mandoc While here ensure sqlite3 is using pread(2) and enable the suppot for FTS4 Added: head/lib/libsqlite3/ - copied from r274850, head/usr.bin/svn/lib/libsqlite3/ Deleted: head/usr.bin/svn/lib/libsqlite3/ Modified: head/lib/Makefile head/lib/libsqlite3/Makefile head/usr.bin/svn/Makefile.inc head/usr.bin/svn/lib/Makefile head/usr.bin/svn/svn/Makefile head/usr.bin/svn/svnadmin/Makefile head/usr.bin/svn/svndumpfilter/Makefile head/usr.bin/svn/svnlook/Makefile head/usr.bin/svn/svnmucc/Makefile head/usr.bin/svn/svnrdump/Makefile head/usr.bin/svn/svnserve/Makefile head/usr.bin/svn/svnsync/Makefile head/usr.bin/svn/svnversion/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/lib/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -90,6 +90,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libsmb} \ ${_libsmdb} \ ${_libsmutil} \ + libsqlite3 \ libstand \ libstdbuf \ libstdthreads \ Modified: head/lib/libsqlite3/Makefile ============================================================================== --- head/usr.bin/svn/lib/libsqlite3/Makefile Sat Nov 22 13:06:47 2014 (r274850) +++ head/lib/libsqlite3/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -1,25 +1,38 @@ # $FreeBSD$ -.include "${.CURDIR}/../Makefile.inc" - -INTERNALLIB= yes -LIB= sqlite3 - -SRCS= sqlite3.c - -.PATH: ${SQLITE} - -CFLAGS+= -DHAVE_CONFIG_H -I${.CURDIR} \ - -I${APR}/include/arch/unix -I${APR}/include - -CFLAGS+= -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \ - -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 \ - -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 \ - -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_USLEEP=1 \ - -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 \ - -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 \ - -DHAVE_READLINE=1 -DHAVE_POSIX_FALLOCATE=1 \ - -I${SQLITE} -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 \ - -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +PRIVATELIB= yes +LIB= sqlite3 +SHLIB_MAJOR?= 0 + +SRCS= sqlite3.c + +SQLITE= ${.CURDIR}/../../contrib/sqlite3 +.PATH: ${SQLITE} + +WARNS= 3 +CFLAGS+= -I${SQLITE} \ + -DSTDC_HEADERS=1 \ + -DHAVE_SYS_TYPES_H=1 \ + -DHAVE_SYS_STAT_H=1 \ + -DUSE_PREAD=1 \ + -DHAVE_STDLIB_H=1 \ + -DHAVE_STRING_H=1 \ + -DHAVE_MEMORY_H=1 \ + -DHAVE_STRINGS_H=1 \ + -DHAVE_INTTYPES_H=1 \ + -DHAVE_STDINT_H=1 \ + -DHAVE_UNISTD_H=1 \ + -DHAVE_DLFCN_H=1 \ + -DHAVE_USLEEP=1 \ + -DHAVE_LOCALTIME_R=1 \ + -DHAVE_GMTIME_R=1 \ + -DHAVE_DECL_STRERROR_R=1 \ + -DHAVE_STRERROR_R=1 \ + -DHAVE_POSIX_FALLOCATE=1 \ + -D_REENTRANT=1 \ + -DSQLITE_THREADSAFE=1 \ + -DSQLITE_ENABLE_FTS3 \ + -DSQLITE_ENABLE_FTS4 \ + -DSQLITE_ENABLE_RTREE .include Modified: head/usr.bin/svn/Makefile.inc ============================================================================== --- head/usr.bin/svn/Makefile.inc Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/Makefile.inc Sat Nov 22 19:44:49 2014 (r274885) @@ -13,7 +13,6 @@ SVNLITE?= lite SVNDIR= ${.CURDIR}/../../../contrib/subversion/subversion APRU= ${.CURDIR}/../../../contrib/apr-util APR= ${.CURDIR}/../../../contrib/apr -SQLITE= ${.CURDIR}/../../../contrib/sqlite3 WARNS?= 0 # defintely not warns friendly .if exists(${.CURDIR}/../../Makefile.inc) @@ -22,7 +21,6 @@ WARNS?= 0 # defintely not warns friendl LIBAPRDIR= ${.OBJDIR}/../lib/libapr LIBAPR_UTILDIR= ${.OBJDIR}/../lib/libapr_util -LIBSQLITEDIR= ${.OBJDIR}/../lib/libsqlite3 LIBSERFDIR= ${.OBJDIR}/../lib/libserf LIBSVN_CLIENTDIR= ${.OBJDIR}/../lib/libsvn_client @@ -41,7 +39,6 @@ LIBSVN_WCDIR= ${.OBJDIR}/../lib/libsvn_ LIBAPR= ${LIBAPRDIR}/libapr.a LIBAPR_UTIL= ${LIBAPR_UTILDIR}/libapr-util.a -LIBSQLITE= ${LIBSQLITEDIR}/libsqlite3.a LIBSERF= ${LIBSERFDIR}/libserf.a LIBSVN_CLIENT= ${LIBSVN_CLIENTDIR}/libsvn_client.a Modified: head/usr.bin/svn/lib/Makefile ============================================================================== --- head/usr.bin/svn/lib/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/lib/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -1,6 +1,6 @@ # $FreeBSD$ -SUBDIR= libapr libapr_util libserf libsqlite3 \ +SUBDIR= libapr libapr_util libserf \ libsvn_client libsvn_delta libsvn_diff libsvn_fs libsvn_fs_fs \ libsvn_fs_util libsvn_ra libsvn_ra_local libsvn_ra_serf \ libsvn_ra_svn libsvn_repos libsvn_subr libsvn_wc Modified: head/usr.bin/svn/svn/Makefile ============================================================================== --- head/usr.bin/svn/svn/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/svn/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -41,15 +41,16 @@ LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_clien -L${LIBAPR_UTILDIR} -lapr-util \ -lbsdxml \ -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ + ${LDSQLITE3} \ -lz -lcrypt -lmagic -lcrypto -lssl -lpthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_WC} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} \ ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} ${LIBSVN_REPOS} \ ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} ${LIBSVN_DELTA} \ ${LIBSVN_DIFF} ${LIBSVN_SUBR} ${LIBSERF} ${LIBAPR_UTIL} \ - ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBMAGIC} \ + ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE3} ${LIBZ} ${LIBCRYPT} ${LIBMAGIC} \ ${LIBCRYPTO} ${LIBSSL} ${LIBPTHREAD} +USEPRIVATELIB= sqlite3 CLEANFILES+= svnlite.1 .if(defined(ORGANIZATION) && !empty(ORGANIZATION)) Modified: head/usr.bin/svn/svnadmin/Makefile ============================================================================== --- head/usr.bin/svn/svnadmin/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/svnadmin/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -27,11 +27,13 @@ LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos -L${LIBAPR_UTILDIR} -lapr-util \ -lbsdxml \ -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ + ${LDSQLITE3} \ -lz -lcrypt -lpthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_SUBR} ${LIBAPR_UTIL} \ - ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} + ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE3} ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} + +USEPRIVATELIB= sqlite3 .include Modified: head/usr.bin/svn/svndumpfilter/Makefile ============================================================================== --- head/usr.bin/svn/svndumpfilter/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/svndumpfilter/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -27,11 +27,12 @@ LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos -L${LIBAPR_UTILDIR} -lapr-util \ -lbsdxml \ -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ + ${LDSQLITE3} \ -lz -lcrypt -lpthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_SUBR} ${LIBAPR_UTIL} \ - ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} + ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE3} ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} +USEPRIVATELIB= sqlite3 .include Modified: head/usr.bin/svn/svnlook/Makefile ============================================================================== --- head/usr.bin/svn/svnlook/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/svnlook/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -28,11 +28,12 @@ LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos -L${LIBAPR_UTILDIR} -lapr-util \ -lbsdxml \ -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ + ${LDSQLITE3} \ -lz -lcrypt -lpthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_DIFF} ${LIBSVN_SUBR} ${LIBAPR_UTIL} \ - ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} + ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE3} ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} +USEPRIVATELIB= sqlite3 .include Modified: head/usr.bin/svn/svnmucc/Makefile ============================================================================== --- head/usr.bin/svn/svnmucc/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/svnmucc/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -33,13 +33,14 @@ LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_clien -L${LIBAPR_UTILDIR} -lapr-util \ -lbsdxml \ -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ + ${LDSQLITE3} \ -lz -lcrypt -lmagic -lcrypto -lssl -lpthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} \ ${LIBSVN_RA_SERF} ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} \ ${LIBSVN_FS_UTIL} ${LIBSVN_DELTA} ${LIBSVN_SUBR} ${LIBSERF} \ - ${LIBAPR_UTIL} ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} \ + ${LIBAPR_UTIL} ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE3} ${LIBZ} \ ${LIBCRYPT} ${LIBMAGIC} ${LIBCRYPTO} ${LIBSSL} ${LIBPTHREAD} +USEPRIVATELIB= sqlite3 .include Modified: head/usr.bin/svn/svnrdump/Makefile ============================================================================== --- head/usr.bin/svn/svnrdump/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/svnrdump/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -35,14 +35,15 @@ LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_clien -L${LIBAPR_UTILDIR} -lapr-util \ -lbsdxml \ -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ + ${LDSQLITE3} \ -lz -lcrypt -lmagic -lcrypto -lssl -lpthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_WC} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} \ ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} ${LIBSVN_REPOS} \ ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} ${LIBSVN_DELTA} \ ${LIBSVN_DIFF} ${LIBSVN_SUBR} ${LIBSERF} ${LIBAPR_UTIL} \ - ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBMAGIC} \ + ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE3} ${LIBZ} ${LIBCRYPT} ${LIBMAGIC} \ ${LIBCRYPTO} ${LIBSSL} ${LIBPTHREAD} +USEPRIVATELIB= sqlite3 .include Modified: head/usr.bin/svn/svnserve/Makefile ============================================================================== --- head/usr.bin/svn/svnserve/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/svnserve/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -32,13 +32,14 @@ LDADD= -L${LIBSVN_RADIR} -lsvn_ra \ -L${LIBAPR_UTILDIR} -lapr-util \ -lbsdxml \ -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ + ${LDSQLITE3} \ -lz -lcrypt -lmagic -lcrypto -lssl -lpthread DPADD= ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} \ ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_SUBR} ${LIBSERF} ${LIBAPR_UTIL} \ - ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBMAGIC} \ + ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE3} ${LIBZ} ${LIBCRYPT} ${LIBMAGIC} \ ${LIBCRYPTO} ${LIBSSL} ${LIBPTHREAD} +USEPRIVATELIB= sqlite3 .include Modified: head/usr.bin/svn/svnsync/Makefile ============================================================================== --- head/usr.bin/svn/svnsync/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/svnsync/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -32,13 +32,14 @@ LDADD= -L${LIBSVN_RADIR} -lsvn_ra \ -L${LIBAPR_UTILDIR} -lapr-util \ -lbsdxml \ -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ + ${LDSQLITE3} \ -lz -lcrypt -lmagic -lcrypto -lssl -lpthread DPADD= ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} \ ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ ${LIBSVN_DELTA} ${LIBSVN_SUBR} ${LIBSERF} ${LIBAPR_UTIL} \ - ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBMAGIC} \ + ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE3} ${LIBZ} ${LIBCRYPT} ${LIBMAGIC} \ ${LIBCRYPTO} ${LIBSSL} ${LIBPTHREAD} +USEPRIVATELIB= sqlite3 .include Modified: head/usr.bin/svn/svnversion/Makefile ============================================================================== --- head/usr.bin/svn/svnversion/Makefile Sat Nov 22 19:18:08 2014 (r274884) +++ head/usr.bin/svn/svnversion/Makefile Sat Nov 22 19:44:49 2014 (r274885) @@ -25,11 +25,12 @@ LDADD= -L${LIBSVN_WCDIR} -lsvn_wc \ -L${LIBAPR_UTILDIR} -lapr-util \ -lbsdxml \ -L${LIBAPRDIR} -lapr \ - -L${LIBSQLITEDIR} -lsqlite3 \ + ${LDSQLITE3} \ -lz -lcrypt -lpthread DPADD= ${LIBSVN_WC} ${LIBSVN_DELTA} ${LIBSVN_DIFF} ${LIBSVN_SUBR} \ - ${LIBSERF} ${LIBAPR_UTIL} ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} \ + ${LIBSERF} ${LIBAPR_UTIL} ${LIBBSDXML} ${LIBAPR} ${LIBSQLITE3} \ ${LIBZ} ${LIBCRYPT} ${LIBPTHREAD} +USEPRIVATELIB= sqlite3 .include From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 19:48:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6C82D1E; Sat, 22 Nov 2014 19:48:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93B3CBBB; Sat, 22 Nov 2014 19:48:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMJmFGM059894; Sat, 22 Nov 2014 19:48:15 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMJmFt4059893; Sat, 22 Nov 2014 19:48:15 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411221948.sAMJmFt4059893@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 19:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274886 - head/lib/libmandoc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 19:48:15 -0000 Author: bapt Date: Sat Nov 22 19:48:14 2014 New Revision: 274886 URL: https://svnweb.freebsd.org/changeset/base/274886 Log: Forgot to update libmandoc Modified: head/lib/libmandoc/Makefile Modified: head/lib/libmandoc/Makefile ============================================================================== --- head/lib/libmandoc/Makefile Sat Nov 22 19:44:49 2014 (r274885) +++ head/lib/libmandoc/Makefile Sat Nov 22 19:48:14 2014 (r274886) @@ -7,12 +7,11 @@ LIB= mandoc #NO_PIC= INTERNALLIB= MAN= mandoc.3 -SRCS= arch.c att.c chars.c \ - compat_fgetln.c compat_getsubopt.c compat_strlcat.c compat_strlcpy.c \ - eqn.c lib.c man.c man_hash.c man_macro.c man_validate.c mandoc.c \ - mdoc.c mdoc_argv.c mdoc_hash.c mdoc_macro.c mdoc_validate.c \ - msec.c read.c roff.c st.c \ - tbl.c tbl_data.c tbl_layout.c tbl_opts.c vol.c +SRCS= mdoc_argv.c mdoc_hash.c mdoc_macro.c mdoc_validate.c \ + mdoc.c arch.c att.c lib.c st.c vol.c \ + man.c man_hash.c man_macro.c man_validate.c \ + roff.c eqn.c tbl.c tbl_data.c tbl_layout.c tbl_opts.c \ + mandoc.c mandoc_aux.c chars.c msec.c read.c WARNS?= 3 CFLAGS+= -DHAVE_CONFIG_H From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 20:18:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F881360; Sat, 22 Nov 2014 20:18:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A049E47; Sat, 22 Nov 2014 20:18:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMKIepF074643; Sat, 22 Nov 2014 20:18:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMKId2G074637; Sat, 22 Nov 2014 20:18:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411222018.sAMKId2G074637@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 20:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274888 - head/contrib/mdocml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 20:18:40 -0000 Author: bapt Date: Sat Nov 22 20:18:38 2014 New Revision: 274888 URL: https://svnweb.freebsd.org/changeset/base/274888 Log: Add missing bits svn merge did not catch Added: head/contrib/mdocml/demandoc.1 (contents, props changed) head/contrib/mdocml/man-cgi.css (contents, props changed) head/contrib/mdocml/preconv.1 (contents, props changed) head/contrib/mdocml/preconv.c (contents, props changed) head/contrib/mdocml/tbl.3 (contents, props changed) head/contrib/mdocml/test-strptime.c (contents, props changed) Modified: Directory Properties: head/contrib/mdocml/ (props changed) Added: head/contrib/mdocml/demandoc.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/demandoc.1 Sat Nov 22 20:18:38 2014 (r274888) @@ -0,0 +1,108 @@ +.\" $Id: demandoc.1,v 1.7 2013/07/13 19:41:16 schwarze Exp $ +.\" +.\" Copyright (c) 2011 Kristaps Dzonsons +.\" +.\" Permission to use, copy, modify, and 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. +.\" +.Dd $Mdocdate: July 13 2013 $ +.Dt DEMANDOC 1 +.Os +.Sh NAME +.Nm demandoc +.Nd emit only text of UNIX manuals +.Sh SYNOPSIS +.Nm demandoc +.Op Fl w +.Op Ar +.Sh DESCRIPTION +The +.Nm +utility emits only the text portions of well-formed +.Xr mdoc 7 +and +.Xr man 7 +.Ux +manual files. +.Pp +By default, +.Nm +parses standard input and outputs only text nodes, preserving line +and column position. +Escape sequences are omitted from the output. +.Pp +Its arguments are as follows: +.Bl -tag -width Ds +.It Fl w +Output a word list. +This outputs each word of text on its own line. +A +.Qq word , +in this case, refers to whitespace-delimited terms beginning with at +least two letters and not consisting of any escape sequences. +Words have their leading and trailing punctuation +.Pq double-quotes, sentence punctuation, etc. +stripped. +.It Ar +The input files. +.El +.Pp +If a document is not well-formed, it is skipped. +.Pp +The +.Fl i , +.Fl k , +.Fl m , +and +.Fl p +flags are silently discarded for calling compatibility with the +historical deroff. +.Sh EXIT STATUS +The +.Nm +utility exits with one of the following values: +.Pp +.Bl -tag -width Ds -compact +.It 0 +No errors occurred. +.It 6 +An operating system error occurred, for example memory exhaustion or an +error accessing input files. +Such errors cause +.Nm +to exit at once, possibly in the middle of parsing or formatting a file. +The output databases are corrupt and should be removed . +.El +.Sh EXAMPLES +The traditional usage of +.Nm +is for spell-checking manuals on +.Bx . +This is accomplished as follows (assuming British spelling): +.Pp +.Dl $ demandoc -w file.1 | spell -b +.Sh SEE ALSO +.Xr mandoc 1 , +.Xr man 7 +.Xr mdoc 7 +.Sh HISTORY +.Nm +replaces the historical deroff utility for handling modern +.Xr man 7 +and +.Xr mdoc 7 +documents. +.Sh AUTHORS +The +.Nm +utility was written by +.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . Added: head/contrib/mdocml/man-cgi.css ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/man-cgi.css Sat Nov 22 20:18:38 2014 (r274888) @@ -0,0 +1,13 @@ +body { font-family: Helvetica, Arial, sans-serif; } +body > div { padding-left: 2em; + padding-top: 1em; } +body > div#mancgi { padding-left: 0em; + padding-top: 0em; } +body > div.results { font-size: smaller; } +#mancgi fieldset { text-align: center; + border: thin solid silver; + border-radius: 1em; + font-size: small; } +#mancgi input[name=expr] { width: 25%; } +.results td.title { vertical-align: top; + padding-right: 1em; } Added: head/contrib/mdocml/preconv.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/preconv.1 Sat Nov 22 20:18:38 2014 (r274888) @@ -0,0 +1,157 @@ +.\" $Id: preconv.1,v 1.7 2013/07/13 19:41:16 schwarze Exp $ +.\" +.\" Copyright (c) 2011 Kristaps Dzonsons +.\" +.\" Permission to use, copy, modify, and 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. +.\" +.Dd $Mdocdate: July 13 2013 $ +.Dt PRECONV 1 +.Os +.Sh NAME +.Nm preconv +.Nd recode multibyte UNIX manuals +.Sh SYNOPSIS +.Nm preconv +.Op Fl D Ar enc +.Op Fl e Ar enc +.Op Ar file +.Sh DESCRIPTION +The +.Nm +utility recodes multibyte +.Ux +manual files into +.Xr mandoc 1 +.Po +or other troff system supporting the +.Sq \e[uNNNN] +escape sequence +.Pc +input. +.Pp +By default, it parses from standard output, determining encoding as +described in +.Sx Algorithm . +.Pp +Its arguments are as follows: +.Bl -tag -width Ds +.It Fl D Ar enc +The default encoding. +.It Fl e Ar enc +The document's encoding. +.It Ar file +The input file. +.El +.Pp +The recoded input is written to standard output: Unicode characters in +the ASCII range are printed as regular ASCII characters, while those +above this range are printed using the +.Sq \e[uNNNN] +format documented in +.Xr mandoc_char 7 . +.Pp +If input bytes are improperly formed in the current encoding, they're +passed unmodified to standard output. +For some encodings, such as UTF-8, unrecoverable input sequences will +cause +.Nm +to stop processing and exit. +.Ss Algorithm +An encoding is chosen according to the following steps: +.Bl -enum +.It +From the argument passed to +.Fl e Ar enc . +.It +If a BOM exists, UTF\-8 encoding is selected. +.It +From the coding tags parsed from +.Qq File Variables +on the first two lines of input. +A file variable is an input line of the form +.Pp +.Dl \%.\e\(dq -*- key: val [; key: val ]* -*- +.Pp +A coding tag variable is where +.Cm key +is +.Qq coding +and +.Cm val +is the name of the encoding. +A typical file variable with a coding tag is +.Pp +.Dl \%.\e\(dq -*- mode: troff; coding: utf-8 -*- +.It +From the argument passed to +.Fl D Ar enc . +.It +If all else fails, Latin\-1 is used. +.El +.Pp +The +.Nm +utility recognises the UTF\-8, us\-ascii, and latin\-1 encodings as +passed to the +.Fl e +and +.Fl D +arguments, or as coding tags. +Encodings are matched case-insensitively. +.\" .Sh IMPLEMENTATION NOTES +.\" Not used in OpenBSD. +.\" .Sh RETURN VALUES +.\" For sections 2, 3, & 9 only. +.\" .Sh ENVIRONMENT +.\" For sections 1, 6, 7, & 8 only. +.\" .Sh FILES +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +Explicitly page a UTF\-8 manual +.Pa foo.1 +in the current locale: +.Pp +.Dl $ preconv \-e utf\-8 foo.1 | mandoc -Tlocale | less +.\" .Sh DIAGNOSTICS +.\" For sections 1, 4, 6, 7, & 8 only. +.\" .Sh ERRORS +.\" For sections 2, 3, & 9 only. +.Sh SEE ALSO +.Xr mandoc 1 , +.Xr mandoc_char 7 +.Sh STANDARDS +The +.Nm +utility references the US-ASCII character set standard, ANSI_X3.4\-1968; +the Latin\-1 character set standard, ISO/IEC 8859\-1:1998; the UTF\-8 +character set standard; and UCS (Unicode), ISO/IEC 10646. +.Sh HISTORY +The +.Nm +utility first appeared in the GNU troff +.Pq Dq groff +system in December 2005, authored by Tomohiro Kubota and Werner +Lemberg. +The implementation that is part of the +.Xr mandoc 1 +utility appeared in May 2011. +.Sh AUTHORS +The +.Nm +utility was written by +.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . +.\" .Sh CAVEATS +.\" .Sh BUGS +.\" .Sh SECURITY CONSIDERATIONS +.\" Not used in OpenBSD. Added: head/contrib/mdocml/preconv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/preconv.c Sat Nov 22 20:18:38 2014 (r274888) @@ -0,0 +1,523 @@ +/* $Id: preconv.c,v 1.6 2013/06/02 03:52:21 schwarze Exp $ */ +/* + * Copyright (c) 2011 Kristaps Dzonsons + * + * Permission to use, copy, modify, and 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. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_MMAP +#include +#include +#endif + +#include +#include +#include +#include +#include +#include + +/* + * The read_whole_file() and resize_buf() functions are copied from + * read.c, including all dependency code. + */ + +enum enc { + ENC_UTF_8, /* UTF-8 */ + ENC_US_ASCII, /* US-ASCII */ + ENC_LATIN_1, /* Latin-1 */ + ENC__MAX +}; + +struct buf { + char *buf; /* binary input buffer */ + size_t sz; /* size of binary buffer */ + size_t offs; /* starting buffer offset */ +}; + +struct encode { + const char *name; + int (*conv)(const struct buf *); +}; + +static int cue_enc(const struct buf *, size_t *, enum enc *); +static int conv_latin_1(const struct buf *); +static int conv_us_ascii(const struct buf *); +static int conv_utf_8(const struct buf *); +static int read_whole_file(const char *, int, + struct buf *, int *); +static void resize_buf(struct buf *, size_t); +static void usage(void); + +static const struct encode encs[ENC__MAX] = { + { "utf-8", conv_utf_8 }, /* ENC_UTF_8 */ + { "us-ascii", conv_us_ascii }, /* ENC_US_ASCII */ + { "latin-1", conv_latin_1 }, /* ENC_LATIN_1 */ +}; + +static const char *progname; + +static void +usage(void) +{ + + fprintf(stderr, "usage: %s " + "[-D enc] " + "[-e ENC] " + "[file]\n", progname); +} + +static int +conv_latin_1(const struct buf *b) +{ + size_t i; + unsigned char cu; + const char *cp; + + cp = b->buf + (int)b->offs; + + /* + * Latin-1 falls into the first 256 code-points of Unicode, so + * there's no need for any sort of translation. Just make the + * 8-bit characters use the Unicode escape. + * Note that binary values 128 < v < 160 are passed through + * unmodified to mandoc. + */ + + for (i = b->offs; i < b->sz; i++) { + cu = (unsigned char)*cp++; + cu < 160U ? putchar(cu) : printf("\\[u%.4X]", cu); + } + + return(1); +} + +static int +conv_us_ascii(const struct buf *b) +{ + + /* + * US-ASCII has no conversion since it falls into the first 128 + * bytes of Unicode. + */ + + fwrite(b->buf, 1, b->sz, stdout); + return(1); +} + +static int +conv_utf_8(const struct buf *b) +{ + int state, be; + unsigned int accum; + size_t i; + unsigned char cu; + const char *cp; + const long one = 1L; + + cp = b->buf + (int)b->offs; + state = 0; + accum = 0U; + be = 0; + + /* Quick test for big-endian value. */ + + if ( ! (*((const char *)(&one)))) + be = 1; + + for (i = b->offs; i < b->sz; i++) { + cu = (unsigned char)*cp++; + if (state) { + if ( ! (cu & 128) || (cu & 64)) { + /* Bad sequence header. */ + return(0); + } + + /* Accept only legitimate bit patterns. */ + + if (cu > 191 || cu < 128) { + /* Bad in-sequence bits. */ + return(0); + } + + accum |= (cu & 63) << --state * 6; + + /* + * Accum is held in little-endian order as + * stipulated by the UTF-8 sequence coding. We + * need to convert to a native big-endian if our + * architecture requires it. + */ + + if (0 == state && be) + accum = (accum >> 24) | + ((accum << 8) & 0x00FF0000) | + ((accum >> 8) & 0x0000FF00) | + (accum << 24); + + if (0 == state) { + accum < 128U ? putchar(accum) : + printf("\\[u%.4X]", accum); + accum = 0U; + } + } else if (cu & (1 << 7)) { + /* + * Entering a UTF-8 state: if we encounter a + * UTF-8 bitmask, calculate the expected UTF-8 + * state from it. + */ + for (state = 0; state < 7; state++) + if ( ! (cu & (1 << (7 - state)))) + break; + + /* Accept only legitimate bit patterns. */ + + switch (state) { + case (4): + if (cu <= 244 && cu >= 240) { + accum = (cu & 7) << 18; + break; + } + /* Bad 4-sequence start bits. */ + return(0); + case (3): + if (cu <= 239 && cu >= 224) { + accum = (cu & 15) << 12; + break; + } + /* Bad 3-sequence start bits. */ + return(0); + case (2): + if (cu <= 223 && cu >= 194) { + accum = (cu & 31) << 6; + break; + } + /* Bad 2-sequence start bits. */ + return(0); + default: + /* Bad sequence bit mask. */ + return(0); + } + state--; + } else + putchar(cu); + } + + if (0 != state) { + /* Bad trailing bits. */ + return(0); + } + + return(1); +} + +static void +resize_buf(struct buf *buf, size_t initial) +{ + + buf->sz = buf->sz > initial / 2 ? + 2 * buf->sz : initial; + + buf->buf = realloc(buf->buf, buf->sz); + if (NULL == buf->buf) { + perror(NULL); + exit(EXIT_FAILURE); + } +} + +static int +read_whole_file(const char *f, int fd, + struct buf *fb, int *with_mmap) +{ + size_t off; + ssize_t ssz; + +#ifdef HAVE_MMAP + struct stat st; + if (-1 == fstat(fd, &st)) { + perror(f); + return(0); + } + + /* + * If we're a regular file, try just reading in the whole entry + * via mmap(). This is faster than reading it into blocks, and + * since each file is only a few bytes to begin with, I'm not + * concerned that this is going to tank any machines. + */ + + if (S_ISREG(st.st_mode) && st.st_size >= (1U << 31)) { + fprintf(stderr, "%s: input too large\n", f); + return(0); + } + + if (S_ISREG(st.st_mode)) { + *with_mmap = 1; + fb->sz = (size_t)st.st_size; + fb->buf = mmap(NULL, fb->sz, PROT_READ, MAP_SHARED, fd, 0); + if (fb->buf != MAP_FAILED) + return(1); + } +#endif + + /* + * If this isn't a regular file (like, say, stdin), then we must + * go the old way and just read things in bit by bit. + */ + + *with_mmap = 0; + off = 0; + fb->sz = 0; + fb->buf = NULL; + for (;;) { + if (off == fb->sz && fb->sz == (1U << 31)) { + fprintf(stderr, "%s: input too large\n", f); + break; + } + + if (off == fb->sz) + resize_buf(fb, 65536); + + ssz = read(fd, fb->buf + (int)off, fb->sz - off); + if (ssz == 0) { + fb->sz = off; + return(1); + } + if (ssz == -1) { + perror(f); + break; + } + off += (size_t)ssz; + } + + free(fb->buf); + fb->buf = NULL; + return(0); +} + +static int +cue_enc(const struct buf *b, size_t *offs, enum enc *enc) +{ + const char *ln, *eoln, *eoph; + size_t sz, phsz, nsz; + int i; + + ln = b->buf + (int)*offs; + sz = b->sz - *offs; + + /* Look for the end-of-line. */ + + if (NULL == (eoln = memchr(ln, '\n', sz))) + return(-1); + + /* Set next-line marker. */ + + *offs = (size_t)((eoln + 1) - b->buf); + + /* Check if we have the correct header/trailer. */ + + if ((sz = (size_t)(eoln - ln)) < 10 || + memcmp(ln, ".\\\" -*-", 7) || + memcmp(eoln - 3, "-*-", 3)) + return(0); + + /* Move after the header and adjust for the trailer. */ + + ln += 7; + sz -= 10; + + while (sz > 0) { + while (sz > 0 && ' ' == *ln) { + ln++; + sz--; + } + if (0 == sz) + break; + + /* Find the end-of-phrase marker (or eoln). */ + + if (NULL == (eoph = memchr(ln, ';', sz))) + eoph = eoln - 3; + else + eoph++; + + /* Only account for the "coding" phrase. */ + + if ((phsz = (size_t)(eoph - ln)) < 7 || + strncasecmp(ln, "coding:", 7)) { + sz -= phsz; + ln += phsz; + continue; + } + + sz -= 7; + ln += 7; + + while (sz > 0 && ' ' == *ln) { + ln++; + sz--; + } + if (0 == sz) + break; + + /* Check us against known encodings. */ + + for (i = 0; i < (int)ENC__MAX; i++) { + nsz = strlen(encs[i].name); + if (phsz < nsz) + continue; + if (strncasecmp(ln, encs[i].name, nsz)) + continue; + + *enc = (enum enc)i; + return(1); + } + + /* Unknown encoding. */ + + *enc = ENC__MAX; + return(1); + } + + return(0); +} + +int +main(int argc, char *argv[]) +{ + int i, ch, map, fd, rc; + struct buf b; + const char *fn; + enum enc enc, def; + unsigned char bom[3] = { 0xEF, 0xBB, 0xBF }; + size_t offs; + extern int optind; + extern char *optarg; + + progname = strrchr(argv[0], '/'); + if (progname == NULL) + progname = argv[0]; + else + ++progname; + + fn = ""; + fd = STDIN_FILENO; + rc = EXIT_FAILURE; + enc = def = ENC__MAX; + map = 0; + + memset(&b, 0, sizeof(struct buf)); + + while (-1 != (ch = getopt(argc, argv, "D:e:rdvh"))) + switch (ch) { + case ('D'): + /* FALLTHROUGH */ + case ('e'): + for (i = 0; i < (int)ENC__MAX; i++) { + if (strcasecmp(optarg, encs[i].name)) + continue; + break; + } + if (i < (int)ENC__MAX) { + if ('D' == ch) + def = (enum enc)i; + else + enc = (enum enc)i; + break; + } + + fprintf(stderr, "%s: Bad encoding\n", optarg); + return(EXIT_FAILURE); + case ('r'): + /* FALLTHROUGH */ + case ('d'): + /* FALLTHROUGH */ + case ('v'): + /* Compatibility with GNU preconv. */ + break; + case ('h'): + /* Compatibility with GNU preconv. */ + /* FALLTHROUGH */ + default: + usage(); + return(EXIT_FAILURE); + } + + argc -= optind; + argv += optind; + + /* + * Open and read the first argument on the command-line. + * If we don't have one, we default to stdin. + */ + + if (argc > 0) { + fn = *argv; + fd = open(fn, O_RDONLY, 0); + if (-1 == fd) { + perror(fn); + return(EXIT_FAILURE); + } + } + + if ( ! read_whole_file(fn, fd, &b, &map)) + goto out; + + /* Try to read the UTF-8 BOM. */ + + if (ENC__MAX == enc) + if (b.sz > 3 && 0 == memcmp(b.buf, bom, 3)) { + b.offs = 3; + enc = ENC_UTF_8; + } + + /* Try reading from the "-*-" cue. */ + + if (ENC__MAX == enc) { + offs = b.offs; + ch = cue_enc(&b, &offs, &enc); + if (0 == ch) + ch = cue_enc(&b, &offs, &enc); + } + + /* + * No encoding has been detected. + * Thus, we either fall into our default encoder, if specified, + * or use Latin-1 if all else fails. + */ + + if (ENC__MAX == enc) + enc = ENC__MAX == def ? ENC_LATIN_1 : def; + + if ( ! (*encs[(int)enc].conv)(&b)) { + fprintf(stderr, "%s: Bad encoding\n", fn); + goto out; + } + + rc = EXIT_SUCCESS; +out: +#ifdef HAVE_MMAP + if (map) + munmap(b.buf, b.sz); + else +#endif + free(b.buf); + + if (fd > STDIN_FILENO) + close(fd); + + return(rc); +} Added: head/contrib/mdocml/tbl.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/tbl.3 Sat Nov 22 20:18:38 2014 (r274888) @@ -0,0 +1,295 @@ +.\" $Id: tbl.3,v 1.1 2013/06/01 05:44:39 schwarze Exp $ +.\" +.\" Copyright (c) 2013 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and 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. +.\" +.Dd $Mdocdate: June 1 2013 $ +.Dt TBL 3 +.Os +.Sh NAME +.Nm tbl_alloc , +.Nm tbl_read , +.Nm tbl_restart , +.Nm tbl_span , +.Nm tbl_end , +.Nm tbl_free +.Nd roff table parser library for mandoc +.Sh SYNOPSIS +.In mandoc.h +.In libmandoc.h +.In libroff.h +.Ft struct tbl_node * +.Fo tbl_alloc +.Fa "int pos" +.Fa "int line" +.Fa "struct mparse *parse" +.Fc +.Ft enum rofferr +.Fo tbl_read +.Fa "struct tbl_node *tbl" +.Fa "int ln" +.Fa "const char *p" +.Fa "int offs" +.Fc +.Ft void +.Fo tbl_restart +.Fa "int line" +.Fa "int pos" +.Fa "struct tbl_node *tbl" +.Fc +.Ft const struct tbl_span * +.Fo tbl_span +.Fa "struct tbl_node *tbl" +.Fc +.Ft void +.Fo tbl_end +.Fa "struct tbl_node **tblp" +.Fc +.Ft void +.Fo tbl_free +.Fa "struct tbl_node *tbl" +.Fc +.Sh DESCRIPTION +This library is tightly integrated into the +.Xr mandoc 1 +utility and not designed for stand-alone use. +The present manual is intended as a reference for developers working on +.Xr mandoc 1 . +.Ss Data structures +Unless otherwise noted, all of the following data structures are defined in +.In mandoc.h +and are deleted in +.Fn tbl_free . +.Bl -tag -width Ds +.It Vt struct tbl_node +This structure describes a complete table. +It is defined in +.In libroff.h , +created in +.Fn tbl_alloc , +and stored in the members +.Va first_tbl , +.Va last_tbl , +and +.Va tbl +of +.Vt struct roff Bq Pa roff.c . +.It Vt struct tbl_opts +This structure describes the options of one table. +It is used as a substructure of +.Vt struct tbl_node +and thus created and deleted together with it. +It is filled in +.Fn tbl_options . +.It Vt struct tbl_head +This structure describes one layout column in a table, +in particular the vertical line to its left. +It is allocated and filled in +.Fn cell_alloc Bq Pa tbl_layout.c +and referenced from the +.Va first_head +and +.Va last_head +members of +.Vt struct tbl_node . +.It Vt struct tbl_row +This structure describes one layout line in a table +by maintaining a list of all the cells in that line. +It is allocated and filled in +.Fn row Bq Pa tbl_layout.c +and referenced from the +.Va layout +member of +.Vt struct tbl_node . +.It Vt struct tbl_cell +This structure describes one layout cell in a table, +in particular its alignment, membership in spans, and +usage for lines. +It is allocated and filled in +.Fn cell_alloc Bq Pa tbl_layout.c +and referenced from the +.Va first +and +.Va last +members of +.Vt struct tbl_row . +.It Vt struct tbl_span +This structure describes one data line in a table +by maintaining a list of all data cells in that line +or by specifying that it is a horizontal line. +It is allocated and filled in +.Fn newspan Bq Pa tbl_data.c +which is called from +.Fn tbl_data +and referenced from the +.Va first_span , +.Va current_span , +and +.Va last_span +members of +.Vt struct tbl_node , +and from the +.Va span +members of +.Vt struct man_node +and +.Vt struct mdoc_node +from +.In man.h +and +.In mdoc.h . +.It Vt struct tbl_dat +This structure describes one data cell in a table by specifying +whether it contains a line or data, whether it spans additional +layout cells, and by storing the data. +It is allocated and filled in +.Fn data +and referenced from the +.Va first +and +.Va last +members of +.Vt struct tbl_span . +.El +.Ss Interface functions +The following functions are implemented in +.Pa tbl.c , +and all callers in +.Pa roff.c . +.Bl -tag -width Ds +.It Fn tbl_alloc +Allocates, initializes, and returns a new +.Vt struct tbl_node . +Called from +.Fn roff_TS . +.It Fn tbl_read +Dispatches to +.Fn tbl_option , +.Fn tbl_layout , +.Fn tbl_cdata , +and +.Fn tbl_data , +see below. +Called from *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 20:26:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E37A5AF; Sat, 22 Nov 2014 20:26:25 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39C51F12; Sat, 22 Nov 2014 20:26:25 +0000 (UTC) Received: from mobile-166-171-248-010.mycingular.net ([166.171.248.10]:14078 helo=[10.233.163.100]) by shxd.cx with esmtps (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1XrzxJ-000B5K-Hz; Fri, 21 Nov 2014 17:57:45 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r274851 - head/usr.bin/dpv From: Devin Teske X-Mailer: iPhone Mail (11B554a) In-Reply-To: <201411221453.sAMEroJP011185@svn.freebsd.org> Date: Sat, 22 Nov 2014 12:26:24 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411221453.sAMEroJP011185@svn.freebsd.org> To: Ian Lepore Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 20:26:25 -0000 > On Nov 22, 2014, at 6:53 AM, Ian Lepore wrote: >=20 > Author: ian > Date: Sat Nov 22 14:53:50 2014 > New Revision: 274851 > URL: https://svnweb.freebsd.org/changeset/base/274851 >=20 > Log: > Add libm to eliminate "undefined reference to sqrt" on arm 'softfp' build= s. >=20 > Modified: > head/usr.bin/dpv/Makefile >=20 > Modified: head/usr.bin/dpv/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/usr.bin/dpv/Makefile Sat Nov 22 13:06:47 2014 (r274850) > +++ head/usr.bin/dpv/Makefile Sat Nov 22 14:53:50 2014 (r274851) > @@ -4,8 +4,8 @@ PROG=3D dpv >=20 > CFLAGS+=3D -I${.CURDIR} >=20 > -DPADD=3D ${LIBDPV} ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBU= TIL} > -LDADD=3D -ldpv -ldialog -lfigpar -lncursesw -lutil > +DPADD=3D ${LIBDPV} ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBU= TIL} ${LIBM} > +LDADD=3D -ldpv -ldialog -lfigpar -lncursesw -lutil -lm >=20 > WARNS?=3D 6 >=20 >=20 Thank you. --=20 Devin= From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 20:31:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C28888E9; Sat, 22 Nov 2014 20:31:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEDBBFC9; Sat, 22 Nov 2014 20:31:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMKVLl2083197; Sat, 22 Nov 2014 20:31:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMKVLGG083194; Sat, 22 Nov 2014 20:31:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411222031.sAMKVLGG083194@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 22 Nov 2014 20:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274889 - in head/sys: conf dev/joy modules/joy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 20:31:21 -0000 Author: imp Date: Sat Nov 22 20:31:20 2014 New Revision: 274889 URL: https://svnweb.freebsd.org/changeset/base/274889 Log: There never was a PC Card joystick attachment that worked. Kill the current stub one until such time as one shows up. Deleted: head/sys/dev/joy/joy_pccard.c Modified: head/sys/conf/files head/sys/modules/joy/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Nov 22 20:18:38 2014 (r274888) +++ head/sys/conf/files Sat Nov 22 20:31:20 2014 (r274889) @@ -1797,7 +1797,6 @@ dev/ixgbe/ixgbe_dcb_82599.c optional ixg dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa -dev/joy/joy_pccard.c optional joy pccard dev/kbdmux/kbdmux.c optional kbdmux dev/ksyms/ksyms.c optional ksyms dev/le/am7990.c optional le Modified: head/sys/modules/joy/Makefile ============================================================================== --- head/sys/modules/joy/Makefile Sat Nov 22 20:18:38 2014 (r274888) +++ head/sys/modules/joy/Makefile Sat Nov 22 20:31:20 2014 (r274889) @@ -3,7 +3,6 @@ .PATH: ${.CURDIR}/../../dev/joy KMOD= joy -SRCS= bus_if.h device_if.h isa_if.h card_if.h joy.c joy_isa.c joy_pccard.c \ - pccarddevs.h +SRCS= bus_if.h device_if.h isa_if.h joy.c joy_isa.c .include From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 20:42:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1E46DE8; Sat, 22 Nov 2014 20:42:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE95510A; Sat, 22 Nov 2014 20:42:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMKgWND090120; Sat, 22 Nov 2014 20:42:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMKgWwR090119; Sat, 22 Nov 2014 20:42:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411222042.sAMKgWwR090119@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 20:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274890 - head/lib/libmandoc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 20:42:33 -0000 Author: bapt Date: Sat Nov 22 20:42:32 2014 New Revision: 274890 URL: https://svnweb.freebsd.org/changeset/base/274890 Log: Rework makefile in something closer to upstream Makefile to ease maintainance Modified: head/lib/libmandoc/Makefile Modified: head/lib/libmandoc/Makefile ============================================================================== --- head/lib/libmandoc/Makefile Sat Nov 22 20:31:20 2014 (r274889) +++ head/lib/libmandoc/Makefile Sat Nov 22 20:42:32 2014 (r274890) @@ -7,11 +7,34 @@ LIB= mandoc #NO_PIC= INTERNALLIB= MAN= mandoc.3 -SRCS= mdoc_argv.c mdoc_hash.c mdoc_macro.c mdoc_validate.c \ - mdoc.c arch.c att.c lib.c st.c vol.c \ - man.c man_hash.c man_macro.c man_validate.c \ - roff.c eqn.c tbl.c tbl_data.c tbl_layout.c tbl_opts.c \ - mandoc.c mandoc_aux.c chars.c msec.c read.c +LIBMAN_SRCS= man.c \ + man_hash.c \ + man_macro.c \ + man_validate.c +LIBMDOC_SRCS= arch.c \ + att.c \ + lib.c \ + mdoc.c \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_macro.c \ + mdoc_validate.c \ + st.c \ + vol.c +LIBROFF_SRCS= eqn.c \ + roff.c \ + tbl.c \ + tbl_data.c \ + tbl_layout.c \ + tbl_opts.c +SRCS= ${LIBMAN_SRCS} \ + ${LIBMDOC_SRCS} \ + ${LIBROFF_SRCS} \ + chars.c \ + mandoc.c \ + mandoc_aux.c \ + msec.c \ + read.c WARNS?= 3 CFLAGS+= -DHAVE_CONFIG_H From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 20:48:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2FF4218; Sat, 22 Nov 2014 20:48:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF9A8143; Sat, 22 Nov 2014 20:48:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMKmMIK090953; Sat, 22 Nov 2014 20:48:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMKmM7x090951; Sat, 22 Nov 2014 20:48:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411222048.sAMKmM7x090951@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 20:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274891 - in head: lib/libmandoc usr.bin/mandoc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 20:48:22 -0000 Author: bapt Date: Sat Nov 22 20:48:21 2014 New Revision: 274891 URL: https://svnweb.freebsd.org/changeset/base/274891 Log: Rework mandoc Makefile to ease maintainance Add compat_reallocarray into libmandoc given other mandoc components will use it. Modified: head/lib/libmandoc/Makefile head/usr.bin/mandoc/Makefile Modified: head/lib/libmandoc/Makefile ============================================================================== --- head/lib/libmandoc/Makefile Sat Nov 22 20:42:32 2014 (r274890) +++ head/lib/libmandoc/Makefile Sat Nov 22 20:48:21 2014 (r274891) @@ -27,9 +27,11 @@ LIBROFF_SRCS= eqn.c \ tbl_data.c \ tbl_layout.c \ tbl_opts.c +COMPAT_SRCS= compat_reallocarray.c SRCS= ${LIBMAN_SRCS} \ ${LIBMDOC_SRCS} \ ${LIBROFF_SRCS} \ + ${COMPAT_SRCS} \ chars.c \ mandoc.c \ mandoc_aux.c \ Modified: head/usr.bin/mandoc/Makefile ============================================================================== --- head/usr.bin/mandoc/Makefile Sat Nov 22 20:42:32 2014 (r274890) +++ head/usr.bin/mandoc/Makefile Sat Nov 22 20:48:21 2014 (r274891) @@ -10,11 +10,26 @@ FILESDIR= ${SHAREDIR}/mdocml LINKS= mdocml MAN= mandoc.1 eqn.7 mandoc_char.7 tbl.7 # man.7 mdoc.7 roff.7 MLINKS= mandoc.1 mdocml.1 -SRCS= main.c mdoc_term.c chars.c term.c tree.c man_term.c eqn_term.c \ - mdoc_man.c -SRCS+= html.c mdoc_html.c man_html.c out.c eqn_html.c -SRCS+= term_ps.c term_ascii.c tbl_term.c tbl_html.c -SRCS+= manpath.c compat_reallocarray.c + +HTML_SRCS= eqn_html.c \ + html.c \ + man_html.c \ + mdoc_html.c \ + tbl_html.c +MAN_SRCS= mdoc_man.c +TERM_SRCS= eqn_term.c \ + man_term.c \ + mdoc_term.c \ + term.c \ + term_ascii.c \ + term_ps.c \ + tbl_term.c +SRCS= ${HTML_SRCS} \ + ${MAN_SRCS} \ + ${TERM_SRCS} \ + main.c \ + out.c \ + tree.c WARNS?= 3 CFLAGS+= -DHAVE_CONFIG_H From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 20:55:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C16E7D1; Sat, 22 Nov 2014 20:55:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 190C7235; Sat, 22 Nov 2014 20:55:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMKta9j095379; Sat, 22 Nov 2014 20:55:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMKtaAp095377; Sat, 22 Nov 2014 20:55:36 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411222055.sAMKtaAp095377@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 20:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274893 - in head/usr.bin: . preconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 20:55:37 -0000 Author: bapt Date: Sat Nov 22 20:55:36 2014 New Revision: 274893 URL: https://svnweb.freebsd.org/changeset/base/274893 Log: Add the preconv utility from mandoc project it recodes multibyte UNIX manual files into mandoc(1) Added: head/usr.bin/preconv/ head/usr.bin/preconv/Makefile (contents, props changed) Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sat Nov 22 20:55:21 2014 (r274892) +++ head/usr.bin/Makefile Sat Nov 22 20:55:36 2014 (r274893) @@ -129,6 +129,7 @@ SUBDIR= alias \ pathchk \ perror \ pr \ + preconv \ printenv \ printf \ procstat \ Added: head/usr.bin/preconv/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/preconv/Makefile Sat Nov 22 20:55:36 2014 (r274893) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../contrib/mdocml + +PROG= preconv + +.include From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 21:03:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4106CB65; Sat, 22 Nov 2014 21:03:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E056337; Sat, 22 Nov 2014 21:03:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAML36dg000274; Sat, 22 Nov 2014 21:03:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAML36S4000273; Sat, 22 Nov 2014 21:03:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411222103.sAML36S4000273@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 21:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274894 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 21:03:06 -0000 Author: bapt Date: Sat Nov 22 21:03:05 2014 New Revision: 274894 URL: https://svnweb.freebsd.org/changeset/base/274894 Log: Define LIBSQLITE3 and LIBMANDOC Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sat Nov 22 20:55:36 2014 (r274893) +++ head/share/mk/src.libnames.mk Sat Nov 22 21:03:05 2014 (r274894) @@ -56,3 +56,11 @@ LIBREADLINE?= ${LIBREADLINEDIR}/libreadl LIBOHASHDIR= ${ROOTOBJDIR}/lib/libohash LDOHASH?= ${LIBOHASHDIR}/libohash.a LIBOHASH?= ${LIBOHASHDIR}/libohash.a + +LIBSQLITE3DIR= ${ROOTOBJDIR}/lib/libsqlite3 +LDSQLITE3?= ${LIBSQLITE3DIR}/libsqlite3.so +LIBSQLITE3?= ${LIBSQLITE3DIR}/libsqlite3.a + +LIBMANDOCDIR= ${ROOTOBJDIR}/lib/libmandoc +LDMANDOC?= ${LIBMANDOCDIR}/libmandoc.a +LIBMANDOC?= ${LIBMANDOCDIR}/libmandoc.a From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 21:11:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39FD6F00; Sat, 22 Nov 2014 21:11:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26A225F8; Sat, 22 Nov 2014 21:11:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMLBIUm002678; Sat, 22 Nov 2014 21:11:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMLBHgL002676; Sat, 22 Nov 2014 21:11:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411222111.sAMLBHgL002676@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 21:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274895 - in head/usr.bin: . demandoc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 21:11:18 -0000 Author: bapt Date: Sat Nov 22 21:11:17 2014 New Revision: 274895 URL: https://svnweb.freebsd.org/changeset/base/274895 Log: Add the demandoc utility from the mandoc project This is a modern version of the deroff utility, useful for example to do spellchecking on manpages Added: head/usr.bin/demandoc/ head/usr.bin/demandoc/Makefile (contents, props changed) Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sat Nov 22 21:03:05 2014 (r274894) +++ head/usr.bin/Makefile Sat Nov 22 21:11:17 2014 (r274895) @@ -35,6 +35,7 @@ SUBDIR= alias \ csplit \ ctlstat \ cut \ + demandoc \ dirname \ dpv \ du \ Added: head/usr.bin/demandoc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/demandoc/Makefile Sat Nov 22 21:11:17 2014 (r274895) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../contrib/mdocml + +PROG= demandoc + +LDADD= ${LDMANDOC} +DPADD= ${LIBMANDOC} + +.include From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 22:11:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A47FB391; Sat, 22 Nov 2014 22:11:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91D80B72; Sat, 22 Nov 2014 22:11:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMMBahj033364; Sat, 22 Nov 2014 22:11:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMMBasW033363; Sat, 22 Nov 2014 22:11:36 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411222211.sAMMBasW033363@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 22:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274896 - head/usr.bin/demandoc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 22:11:36 -0000 Author: bapt Date: Sat Nov 22 22:11:35 2014 New Revision: 274896 URL: https://svnweb.freebsd.org/changeset/base/274896 Log: Lower warning to allow building with gcc Modified: head/usr.bin/demandoc/Makefile Modified: head/usr.bin/demandoc/Makefile ============================================================================== --- head/usr.bin/demandoc/Makefile Sat Nov 22 21:11:17 2014 (r274895) +++ head/usr.bin/demandoc/Makefile Sat Nov 22 22:11:35 2014 (r274896) @@ -7,4 +7,6 @@ PROG= demandoc LDADD= ${LDMANDOC} DPADD= ${LIBMANDOC} +WARNS?= 5 + .include From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 22:13:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8B024CD; Sat, 22 Nov 2014 22:13:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5D95B7A; Sat, 22 Nov 2014 22:13:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMMD0kj034034; Sat, 22 Nov 2014 22:13:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMMD02Q034033; Sat, 22 Nov 2014 22:13:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411222213.sAMMD02Q034033@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 22 Nov 2014 22:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274897 - head/usr.bin/preconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 22:13:01 -0000 Author: bapt Date: Sat Nov 22 22:13:00 2014 New Revision: 274897 URL: https://svnweb.freebsd.org/changeset/base/274897 Log: Lower warnings to fix build with gcc Modified: head/usr.bin/preconv/Makefile Modified: head/usr.bin/preconv/Makefile ============================================================================== --- head/usr.bin/preconv/Makefile Sat Nov 22 22:11:35 2014 (r274896) +++ head/usr.bin/preconv/Makefile Sat Nov 22 22:13:00 2014 (r274897) @@ -4,4 +4,6 @@ PROG= preconv +WARNS?= 5 + .include From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 23:04:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05A1056B; Sat, 22 Nov 2014 23:04:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB06BF65; Sat, 22 Nov 2014 23:04:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMN4XW5058292; Sat, 22 Nov 2014 23:04:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMN4X2b058291; Sat, 22 Nov 2014 23:04:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411222304.sAMN4X2b058291@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 22 Nov 2014 23:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274898 - head/usr.sbin/rtadvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 23:04:34 -0000 Author: dim Date: Sat Nov 22 23:04:33 2014 New Revision: 274898 URL: https://svnweb.freebsd.org/changeset/base/274898 Log: Fix the following -Werror warnings from clang 3.5.0, while building usr.sbin/rtadvd: usr.sbin/rtadvd/rtadvd.c:1291:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] abs(preferred_time - pfx->pfx_pltimeexpire) > rai->rai_clockskew) { ^ usr.sbin/rtadvd/rtadvd.c:1291:7: note: remove the call to 'abs' since unsigned values cannot be negative abs(preferred_time - pfx->pfx_pltimeexpire) > rai->rai_clockskew) { ^~~ usr.sbin/rtadvd/rtadvd.c:1324:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] abs(valid_time - pfx->pfx_vltimeexpire) > rai->rai_clockskew) { ^ usr.sbin/rtadvd/rtadvd.c:1324:7: note: remove the call to 'abs' since unsigned values cannot be negative abs(valid_time - pfx->pfx_vltimeexpire) > rai->rai_clockskew) { ^~~ 2 errors generated. These warnings occur because both preferred_time and pfx_pltimeexpire are uint32_t's, so the subtraction expression is also unsigned, and calling abs() is a no-op. However, the intention was to look at the absolute difference between the two unsigned quantities. Introduce a small static function to clarify what we're doing, and call that instead. Reviewed by: hrs MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D1197 Modified: head/usr.sbin/rtadvd/rtadvd.c Modified: head/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.c Sat Nov 22 22:13:00 2014 (r274897) +++ head/usr.sbin/rtadvd/rtadvd.c Sat Nov 22 23:04:33 2014 (r274898) @@ -1230,6 +1230,12 @@ ra_input(int len, struct nd_router_adver return; } +static uint32_t +udiff(uint32_t u, uint32_t v) +{ + return (u >= v ? u - v : v - u); +} + /* return a non-zero value if the received prefix is inconsitent with ours */ static int prefix_check(struct nd_opt_prefix_info *pinfo, @@ -1288,7 +1294,7 @@ prefix_check(struct nd_opt_prefix_info * preferred_time += now.tv_sec; if (!pfx->pfx_timer && rai->rai_clockskew && - abs(preferred_time - pfx->pfx_pltimeexpire) > rai->rai_clockskew) { + udiff(preferred_time, pfx->pfx_pltimeexpire) > rai->rai_clockskew) { syslog(LOG_INFO, "<%s> preferred lifetime for %s/%d" " (decr. in real time) inconsistent on %s:" @@ -1321,7 +1327,7 @@ prefix_check(struct nd_opt_prefix_info * valid_time += now.tv_sec; if (!pfx->pfx_timer && rai->rai_clockskew && - abs(valid_time - pfx->pfx_vltimeexpire) > rai->rai_clockskew) { + udiff(valid_time, pfx->pfx_vltimeexpire) > rai->rai_clockskew) { syslog(LOG_INFO, "<%s> valid lifetime for %s/%d" " (decr. in real time) inconsistent on %s:" From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 23:28:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD63AB35; Sat, 22 Nov 2014 23:28:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99FE6186; Sat, 22 Nov 2014 23:28:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMNSg9m068519; Sat, 22 Nov 2014 23:28:42 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMNSg9O068517; Sat, 22 Nov 2014 23:28:42 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201411222328.sAMNSg9O068517@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 22 Nov 2014 23:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274899 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 23:28:42 -0000 Author: jilles Date: Sat Nov 22 23:28:41 2014 New Revision: 274899 URL: https://svnweb.freebsd.org/changeset/base/274899 Log: sh: Prepend "$0: " to error messages if there is no command name. Modified: head/bin/sh/error.c head/bin/sh/parser.c Modified: head/bin/sh/error.c ============================================================================== --- head/bin/sh/error.c Sat Nov 22 23:04:33 2014 (r274898) +++ head/bin/sh/error.c Sat Nov 22 23:28:41 2014 (r274899) @@ -139,6 +139,8 @@ vwarning(const char *msg, va_list ap) { if (commandname) outfmt(out2, "%s: ", commandname); + else if (arg0) + outfmt(out2, "%s: ", arg0); doformat(out2, msg, ap); out2fmt_flush("\n"); } Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sat Nov 22 23:04:33 2014 (r274898) +++ head/bin/sh/parser.c Sat Nov 22 23:28:41 2014 (r274899) @@ -1879,6 +1879,8 @@ synerror(const char *msg) { if (commandname) outfmt(out2, "%s: %d: ", commandname, startlinno); + else if (arg0) + outfmt(out2, "%s: ", arg0); outfmt(out2, "Syntax error: %s\n", msg); error((char *)NULL); } From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 23:50:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFC01174; Sat, 22 Nov 2014 23:50:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3DA8372; Sat, 22 Nov 2014 23:50:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMNoJGn078601; Sat, 22 Nov 2014 23:50:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMNoJIJ078600; Sat, 22 Nov 2014 23:50:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411222350.sAMNoJIJ078600@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 22 Nov 2014 23:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274900 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 23:50:20 -0000 Author: dim Date: Sat Nov 22 23:50:18 2014 New Revision: 274900 URL: https://svnweb.freebsd.org/changeset/base/274900 Log: Fix the following -Werror warnings from clang 3.5.0, while building bsnmpd's snmp_hostres module: usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value] str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600); ^ usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: note: use function 'labs' instead str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600); ^~~ labs usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value] str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60); ^ usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: note: use function 'labs' instead str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60); ^~~ labs Since tm::tm_gmtoff is a long, use labs(3) instead. MFC after: 3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Sat Nov 22 23:28:41 2014 (r274899) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Sat Nov 22 23:50:18 2014 (r274900) @@ -201,8 +201,8 @@ make_date_time(u_char *str, const struct else str[8] = '+'; - str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600); - str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60); + str[9] = (u_char)(labs(tm->tm_gmtoff) / 3600); + str[10] = (u_char)((labs(tm->tm_gmtoff) % 3600) / 60); return (11); }