From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 09:34:56 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5169DA57; Sun, 14 Dec 2014 09:34: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 33514196; Sun, 14 Dec 2014 09:34: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 sBE9YuJN063972; Sun, 14 Dec 2014 09:34:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBE9YuXw063971; Sun, 14 Dec 2014 09:34:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412140934.sBE9YuXw063971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Dec 2014 09:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275754 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 09:34:56 -0000 Author: kib Date: Sun Dec 14 09:34:55 2014 New Revision: 275754 URL: https://svnweb.freebsd.org/changeset/base/275754 Log: MFC r275347: Provide mutual exclusion between zone allocation/destruction and uma_reclaim(). Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Sun Dec 14 08:43:13 2014 (r275753) +++ stable/10/sys/vm/uma_core.c Sun Dec 14 09:34:55 2014 (r275754) @@ -145,6 +145,8 @@ static LIST_HEAD(,uma_slab) uma_boot_pag /* This mutex protects the boot time pages list */ static struct mtx_padalign uma_boot_pages_mtx; +static struct sx uma_drain_lock; + /* Is the VM done starting up? */ static int booted = 0; #define UMA_STARTUP 1 @@ -1876,6 +1878,7 @@ uma_startup2(void) { booted = UMA_STARTUP2; bucket_enable(); + sx_init(&uma_drain_lock, "umadrain"); #ifdef UMA_DEBUG printf("UMA startup2 complete.\n"); #endif @@ -1930,6 +1933,8 @@ uma_zcreate(const char *name, size_t siz { struct uma_zctor_args args; + uma_zone_t res; + bool locked; /* This stuff is essential for the zone ctor */ memset(&args, 0, sizeof(args)); @@ -1943,7 +1948,16 @@ uma_zcreate(const char *name, size_t siz args.flags = flags; args.keg = NULL; - return (zone_alloc_item(zones, &args, M_WAITOK)); + if (booted < UMA_STARTUP2) { + locked = false; + } else { + sx_slock(&uma_drain_lock); + locked = true; + } + res = zone_alloc_item(zones, &args, M_WAITOK); + if (locked) + sx_sunlock(&uma_drain_lock); + return (res); } /* See uma.h */ @@ -1953,6 +1967,8 @@ uma_zsecond_create(char *name, uma_ctor { struct uma_zctor_args args; uma_keg_t keg; + uma_zone_t res; + bool locked; keg = zone_first_keg(master); memset(&args, 0, sizeof(args)); @@ -1966,8 +1982,17 @@ uma_zsecond_create(char *name, uma_ctor args.flags = keg->uk_flags | UMA_ZONE_SECONDARY; args.keg = keg; + if (booted < UMA_STARTUP2) { + locked = false; + } else { + sx_slock(&uma_drain_lock); + locked = true; + } /* XXX Attaches only one keg of potentially many. */ - return (zone_alloc_item(zones, &args, M_WAITOK)); + res = zone_alloc_item(zones, &args, M_WAITOK); + if (locked) + sx_sunlock(&uma_drain_lock); + return (res); } /* See uma.h */ @@ -2085,7 +2110,9 @@ void uma_zdestroy(uma_zone_t zone) { + sx_slock(&uma_drain_lock); zone_free_item(zones, zone, NULL, SKIP_NONE); + sx_sunlock(&uma_drain_lock); } /* See uma.h */ @@ -3171,6 +3198,7 @@ uma_reclaim(void) #ifdef UMA_DEBUG printf("UMA: vm asked us to release pages!\n"); #endif + sx_xlock(&uma_drain_lock); bucket_enable(); zone_foreach(zone_drain); if (vm_page_count_min()) { @@ -3185,6 +3213,7 @@ uma_reclaim(void) zone_drain(slabzone); zone_drain(slabrefzone); bucket_zone_drain(); + sx_xunlock(&uma_drain_lock); } /* See uma.h */ From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 11:03:23 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5AA9D8F; Sun, 14 Dec 2014 11:03: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 905C4B39; Sun, 14 Dec 2014 11:03:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEB3Ndt007849; Sun, 14 Dec 2014 11:03:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEB3N4V007848; Sun, 14 Dec 2014 11:03:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201412141103.sBEB3N4V007848@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 14 Dec 2014 11:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275757 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 11:03:23 -0000 Author: trasz Date: Sun Dec 14 11:03:22 2014 New Revision: 275757 URL: https://svnweb.freebsd.org/changeset/base/275757 Log: MFC r274495: Add missing commas to .Xr. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/mkimg/mkimg.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/10/usr.bin/mkimg/mkimg.1 Sun Dec 14 10:49:22 2014 (r275756) +++ stable/10/usr.bin/mkimg/mkimg.1 Sun Dec 14 11:03:22 2014 (r275757) @@ -220,9 +220,9 @@ utility supports assigning labels to the In the following example the file system partition is labeled as 'backup': .Dl % mkimg -s gpt -p freebsd-ufs/backup:=file-system.ufs -o gpt.img .Sh SEE ALSO -.Xr gpart 8 -.Xr makefs 8 -.Xr mdconfig 8 +.Xr gpart 8 , +.Xr makefs 8 , +.Xr mdconfig 8 , .Xr newfs 8 .Sh HISTORY The From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 14:56:31 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0BBE2F8 for ; Sun, 14 Dec 2014 14:56:31 +0000 (UTC) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) (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 83218300 for ; Sun, 14 Dec 2014 14:56:31 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id n3so6605420wiv.11 for ; Sun, 14 Dec 2014 06:56:24 -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=UgkyLLGs09GDlFU0MJHgjAsSpvcWhlaeeFWhSwvwp4Q=; b=RPE6wNY7sTO16JKtBfzduYo6GF4KI9v0mlMuQjn8cmmIdQMppt26Ff9z6licGs/9QS LBogqTpw0foYDu5ZstyQ8de9S442sTMv/W3iFOSXi+MbiiJx2+s8AEosrkpWh3FtFQUu KD+qph1VR3gjY5JMOtlsB5NEI8mKRKid2BR/w3WIGmKWN4TuxF31DF27e0FvexDx8My6 IXQ5ihgT98pvGYLA5OwR25dR2K29HSyjPIj9QZ494OzuU11lXSv6JE/6l7Zaslzycv+p eoPsV9AVd1wW7xMd4pvgSsUu2joLO9TqO9Uogd9MBiUBfH7PQlnlOVB2ugZEg23F5aWc m0sw== X-Gm-Message-State: ALoCoQlXrd6afwKdhslcQOehmF+zPs2lcYxYEPb2XIUv4S8mc0jF5VrhMto0o10ZDm6Lqy71wMfH X-Received: by 10.180.108.205 with SMTP id hm13mr24538897wib.5.1418568983926; Sun, 14 Dec 2014 06:56:23 -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 d2sm9416411wjs.32.2014.12.14.06.56.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Dec 2014 06:56:23 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <548DA4A3.8020000@freebsd.org> Date: Sun, 14 Dec 2014 14:54:27 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r275742 - in stable: 10/contrib/llvm/lib/Transforms/Vectorize 10/sys/sys 9/contrib/llvm/lib/Transforms/Vectorize 9/sys/sys References: <201412131214.sBDCESwJ033037@svn.freebsd.org> In-Reply-To: <201412131214.sBDCESwJ033037@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 14:56:32 -0000 Sounds nasty, is this something that only effects stable/10 or does it also effects 10.1-RELEASE? On 13/12/2014 12:14, Dimitry Andric wrote: > Author: dim > Date: Sat Dec 13 12:14:26 2014 > New Revision: 275742 > URL: https://svnweb.freebsd.org/changeset/base/275742 > > Log: > MFC r275633: > > Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin): > > PR21302. Vectorize only bottom-tested loops. > > rdar://problem/18886083 > > This fixes a bug in the llvm vectorizer, which could sometimes cause > vectorized loops to perform an additional iteration, leading to possible > buffer overruns. Symptoms of this, which are usually segfaults, were > first noticed when building gcc ports, here: > > https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.html > https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/001211.html > > Since this fix is very important for ports, bump __FreeBSD_version to > make it easier for port maintainers to test whether the fix has been > applied. > > Upstream PR: http://llvm.org/PR21302 > > Modified: > stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp > stable/10/sys/sys/param.h > Directory Properties: > stable/10/ (props changed) > > Changes in other areas also in this revision: > Modified: > stable/9/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp > stable/9/sys/sys/param.h > Directory Properties: > stable/9/contrib/llvm/ (props changed) > stable/9/sys/ (props changed) > > Modified: stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp > ============================================================================== > --- stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sat Dec 13 04:50:14 2014 (r275741) > +++ stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sat Dec 13 12:14:26 2014 (r275742) > @@ -2864,6 +2864,14 @@ bool LoopVectorizationLegality::canVecto > if (!TheLoop->getExitingBlock()) > return false; > > + // We only handle bottom-tested loops, i.e. loop in which the condition is > + // checked at the end of each iteration. With that we can assume that all > + // instructions in the loop are executed the same number of times. > + if (TheLoop->getExitingBlock() != TheLoop->getLoopLatch()) { > + DEBUG(dbgs() << "LV: loop control flow is not understood by vectorizer\n"); > + return false; > + } > + > // We need to have a loop header. > DEBUG(dbgs() << "LV: Found a loop: " << > TheLoop->getHeader()->getName() << '\n'); > > Modified: stable/10/sys/sys/param.h > ============================================================================== > --- stable/10/sys/sys/param.h Sat Dec 13 04:50:14 2014 (r275741) > +++ stable/10/sys/sys/param.h Sat Dec 13 12:14:26 2014 (r275742) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1001503 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1001504 /* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, > From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 15:03:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68D7D609; Sun, 14 Dec 2014 15: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 3A69B61C; Sun, 14 Dec 2014 15: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 sBEF3C8f025219; Sun, 14 Dec 2014 15:03:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEF3CZD025218; Sun, 14 Dec 2014 15:03:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141503.sBEF3CZD025218@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 15:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275762 - stable/10/sys/boot/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:03:12 -0000 Author: andrew Date: Sun Dec 14 15:03:11 2014 New Revision: 275762 URL: https://svnweb.freebsd.org/changeset/base/275762 Log: MFC r273913: Clean up the types of a few strings to make them const when they are never written to. MFC r273914: The command name is a constant, use the correct type. Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Sun Dec 14 14:03:40 2014 (r275761) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Sun Dec 14 15:03:11 2014 (r275762) @@ -93,9 +93,9 @@ static int fdt_cmd_mres(int argc, char * typedef int cmdf_t(int, char *[]); struct cmdtab { - char *name; - cmdf_t *handler; - int flags; + const char *name; + cmdf_t *handler; + int flags; }; static const struct cmdtab commands[] = { @@ -364,11 +364,11 @@ fdt_setup_fdtp() (cellbuf), (lim), (cellsize), 16); static int -_fdt_strtovect(char *str, void *cellbuf, int lim, unsigned char cellsize, +_fdt_strtovect(const char *str, void *cellbuf, int lim, unsigned char cellsize, uint8_t base) { - char *buf = str; - char *end = str + strlen(str) - 2; + const char *buf = str; + const char *end = str + strlen(str) - 2; uint32_t *u32buf = NULL; uint8_t *u8buf = NULL; int cnt = 0; @@ -411,7 +411,8 @@ _fdt_strtovect(char *str, void *cellbuf, static void fixup_ethernet(const char *env, char *ethstr, int *eth_no, int len) { - char *end, *str; + const char *str; + char *end; uint8_t tmp_addr[6]; int i, n; @@ -1347,7 +1348,7 @@ static int fdt_modprop(int nodeoff, char *propname, void *value, char mode) { uint32_t cells[100]; - char *buf; + const char *buf; int len, rv; const struct fdt_property *p; @@ -1365,7 +1366,7 @@ fdt_modprop(int nodeoff, char *propname, } len = strlen(value); rv = 0; - buf = (char *)value; + buf = value; switch (*buf) { case '&': From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 15:11:31 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E32158BF; Sun, 14 Dec 2014 15:11:31 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A21E77B; Sun, 14 Dec 2014 15:11:31 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::ec02:9330:f41e:f824] (unknown [IPv6:2001:7b8:3a7:0:ec02:9330:f41e:f824]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 56967B80A; Sun, 14 Dec 2014 16:11:17 +0100 (CET) Subject: Re: svn commit: r275742 - in stable: 10/contrib/llvm/lib/Transforms/Vectorize 10/sys/sys 9/contrib/llvm/lib/Transforms/Vectorize 9/sys/sys Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_11473C2F-6908-4332-8B72-2C7072FDDD52"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b3 From: Dimitry Andric In-Reply-To: <548DA4A3.8020000@freebsd.org> Date: Sun, 14 Dec 2014 16:11:09 +0100 Message-Id: <43A88D44-A799-46AB-8853-560407BABC84@FreeBSD.org> References: <201412131214.sBDCESwJ033037@svn.freebsd.org> <548DA4A3.8020000@freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.1993) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:11:32 -0000 --Apple-Mail=_11473C2F-6908-4332-8B72-2C7072FDDD52 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 14 Dec 2014, at 15:54, Steven Hartland = wrote: >=20 > On 13/12/2014 12:14, Dimitry Andric wrote: >> Author: dim >> Date: Sat Dec 13 12:14:26 2014 >> New Revision: 275742 >> URL: https://svnweb.freebsd.org/changeset/base/275742 >>=20 >> Log: >> MFC r275633: >> Pull in r223171 from upstream llvm trunk (by Michael = Zolotukhin): >> PR21302. Vectorize only bottom-tested loops. >> rdar://problem/18886083 >> This fixes a bug in the llvm vectorizer, which could sometimes = cause >> vectorized loops to perform an additional iteration, leading to = possible >> buffer overruns. Symptoms of this, which are usually segfaults, = were >> first noticed when building gcc ports, here: >> = https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.ht= ml >> = https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/00121= 1.html >> Since this fix is very important for ports, bump = __FreeBSD_version to >> make it easier for port maintainers to test whether the fix has = been >> applied. >> Upstream PR: http://llvm.org/PR21302 >=20 > Sounds nasty, is this something that only effects stable/10 or does it = also effects 10.1-RELEASE? Yes, this is quite nasty, and it does affect 10.1-RELEASE, 9.3-RELEASE, and any other release with clang 3.4.x, which turned on the vectorizer by default. Although it is in fact rather hard to create the situation where it can possibly do an off-by-one, I would really advise to apply this diff to release systems as well. I also contacted secteam@ about it, but apparently they have not yet decided whether to do a security advisory for this bug. -Dimitry --Apple-Mail=_11473C2F-6908-4332-8B72-2C7072FDDD52 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----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlSNqJUACgkQsF6jCi4glqNu4QCfUAG/IKnCl61Lz557s4NHDmId WuQAoMw6P5IekLs/uJ55PgziVWKTTwfs =4Yf+ -----END PGP SIGNATURE----- --Apple-Mail=_11473C2F-6908-4332-8B72-2C7072FDDD52-- From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 15:17:19 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 98181A61; Sun, 14 Dec 2014 15:17:19 +0000 (UTC) Date: Sun, 14 Dec 2014 15:17:19 +0000 From: Alexey Dokuchaev To: Dimitry Andric Subject: Re: svn commit: r275742 - in stable: 10/contrib/llvm/lib/Transforms/Vectorize 10/sys/sys 9/contrib/llvm/lib/Transforms/Vectorize 9/sys/sys Message-ID: <20141214151719.GB76347@FreeBSD.org> References: <201412131214.sBDCESwJ033037@svn.freebsd.org> <548DA4A3.8020000@freebsd.org> <43A88D44-A799-46AB-8853-560407BABC84@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43A88D44-A799-46AB-8853-560407BABC84@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steven Hartland , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:17:19 -0000 On Sun, Dec 14, 2014 at 04:11:09PM +0100, Dimitry Andric wrote: > Yes, this is quite nasty, and it does affect 10.1-RELEASE, 9.3-RELEASE, > and any other release with clang 3.4.x, which turned on the vectorizer > by default. Could it be the cause of "REDZONE: Buffer overflow detected. 16 bytes corrupted after 0xd2375200 (256 bytes allocated)" bug reported by dhw@ WRT nvidia-driver-340.46 on 2014-11-18 [1]? ./danfe [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195154 From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 15:22:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8F9EBD9; Sun, 14 Dec 2014 15:22:02 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FF6E853; Sun, 14 Dec 2014 15:22:02 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::ec02:9330:f41e:f824] (unknown [IPv6:2001:7b8:3a7:0:ec02:9330:f41e:f824]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6EDDDB80A; Sun, 14 Dec 2014 16:21:57 +0100 (CET) Subject: Re: svn commit: r275742 - in stable: 10/contrib/llvm/lib/Transforms/Vectorize 10/sys/sys 9/contrib/llvm/lib/Transforms/Vectorize 9/sys/sys Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_279BC7EC-83DD-4B3C-81FD-833658439F75"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b3 From: Dimitry Andric In-Reply-To: <20141214151719.GB76347@FreeBSD.org> Date: Sun, 14 Dec 2014 16:21:52 +0100 Message-Id: References: <201412131214.sBDCESwJ033037@svn.freebsd.org> <548DA4A3.8020000@freebsd.org> <43A88D44-A799-46AB-8853-560407BABC84@FreeBSD.org> <20141214151719.GB76347@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1993) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steven Hartland , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:22:02 -0000 --Apple-Mail=_279BC7EC-83DD-4B3C-81FD-833658439F75 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 14 Dec 2014, at 16:17, Alexey Dokuchaev wrote: > > On Sun, Dec 14, 2014 at 04:11:09PM +0100, Dimitry Andric wrote: >> Yes, this is quite nasty, and it does affect 10.1-RELEASE, 9.3-RELEASE, >> and any other release with clang 3.4.x, which turned on the vectorizer >> by default. > > Could it be the cause of "REDZONE: Buffer overflow detected. 16 bytes > corrupted after 0xd2375200 (256 bytes allocated)" bug reported by dhw@ > WRT nvidia-driver-340.46 on 2014-11-18 [1]? This is extremely unlikely, since the kernel is compiled without SSE. (The bug was in the vectorizer, which transforms loops into SSE constructs.) Does this problem disappear when both the kernel and the NVIDIA kernel module are compiled with -O1? -Dimitry --Apple-Mail=_279BC7EC-83DD-4B3C-81FD-833658439F75 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----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlSNqxYACgkQsF6jCi4glqNbqgCcCH9cA6OQGJwJ8flg79jd4m3N iQcAoL2TT2QnQ+m9Hr3W8gvlbLSABrS0 =q+b5 -----END PGP SIGNATURE----- --Apple-Mail=_279BC7EC-83DD-4B3C-81FD-833658439F75-- From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 15:33:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 885709DB; Sun, 14 Dec 2014 15:33: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 7217AB38; Sun, 14 Dec 2014 15:33: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 sBEFXnwI040942; Sun, 14 Dec 2014 15:33:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEFXkoB040925; Sun, 14 Dec 2014 15:33:46 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141533.sBEFXkoB040925@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 15:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275763 - in stable/10/sys/boot: arm/uboot fdt powerpc/uboot uboot uboot/common uboot/fdt uboot/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:33:49 -0000 Author: andrew Date: Sun Dec 14 15:33:45 2014 New Revision: 275763 URL: https://svnweb.freebsd.org/changeset/base/275763 Log: MFC 273927: Move the definitions of the fdt functions from a uboot header to a new fdt header. There is nothing in the fdt spec that ties it to U-Boot. While here sort and fix the signature of fdt_setup_fdtp. MFC 273934: Start to allow platforms other than U-Boot to use the FDT code in loader by moving U-Boot specific code from libfdt.a to a new libuboot_fdt.a. This needs to be a new library for linking to work correctly. Differential Revision: https://reviews.freebsd.org/D1054 Reviewed by: ian, rpaulo (earlier version) Added: stable/10/sys/boot/fdt/fdt_platform.h - copied, changed from r273927, head/sys/boot/fdt/fdt_platform.h stable/10/sys/boot/uboot/fdt/ - copied from r273934, head/sys/boot/uboot/fdt/ Modified: stable/10/sys/boot/arm/uboot/Makefile stable/10/sys/boot/fdt/Makefile stable/10/sys/boot/fdt/fdt_loader_cmd.c stable/10/sys/boot/powerpc/uboot/Makefile stable/10/sys/boot/uboot/Makefile stable/10/sys/boot/uboot/common/metadata.c stable/10/sys/boot/uboot/fdt/Makefile stable/10/sys/boot/uboot/lib/Makefile stable/10/sys/boot/uboot/lib/libuboot.h stable/10/sys/boot/uboot/lib/module.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/10/sys/boot/arm/uboot/Makefile Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/arm/uboot/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -72,6 +72,7 @@ CFLAGS+= -DLOADER_TFTP_SUPPORT CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt CFLAGS+= -DLOADER_FDT_SUPPORT +LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif @@ -112,8 +113,8 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # clang doesn't understand %D as a specifier to printf NO_WERROR.clang= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: stable/10/sys/boot/fdt/Makefile ============================================================================== --- stable/10/sys/boot/fdt/Makefile Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/fdt/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -11,8 +11,7 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw. # Loader's fdt commands extension sources. SRCS+= fdt_loader_cmd.c -CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ \ - -I${.CURDIR}/../uboot/lib +CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ CFLAGS+= -ffreestanding Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Sun Dec 14 15:33:45 2014 (r275763) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" -#include "glue.h" +#include "fdt_platform.h" #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ @@ -52,9 +52,6 @@ __FBSDID("$FreeBSD$"); #define FDT_PROP_SEP " = " -#define STR(number) #number -#define STRINGIFY(number) STR(number) - #define COPYOUT(s,d,l) archsw.arch_copyout(s, d, l) #define COPYIN(s,d,l) archsw.arch_copyin(s, d, l) @@ -228,7 +225,7 @@ fdt_load_dtb(vm_offset_t va) return (0); } -static int +int fdt_load_dtb_addr(struct fdt_header *header) { int err; @@ -253,7 +250,7 @@ fdt_load_dtb_addr(struct fdt_header *hea return (0); } -static int +int fdt_load_dtb_file(const char * filename) { struct preloaded_file *bfp, *oldbfp; @@ -283,9 +280,6 @@ int fdt_setup_fdtp() { struct preloaded_file *bfp; - struct fdt_header *hdr; - const char *s; - char *p; vm_offset_t va; debugf("fdt_setup_fdtp()\n"); @@ -308,41 +302,8 @@ fdt_setup_fdtp() } } - /* - * If the U-boot environment contains a variable giving the address of a - * valid blob in memory, use it. The U-boot README says the right - * variable for fdt data loaded into ram is fdt_addr_r, so try that - * first. Board vendors also use both fdtaddr and fdt_addr names. - */ - s = ub_env_get("fdt_addr_r"); - if (s == NULL) - s = ub_env_get("fdtaddr"); - if (s == NULL) - s = ub_env_get("fdt_addr"); - if (s != NULL && *s != '\0') { - hdr = (struct fdt_header *)strtoul(s, &p, 16); - if (*p == '\0') { - if (fdt_load_dtb_addr(hdr) == 0) { - printf("Using DTB provided by U-Boot at " - "address 0x%p.\n", hdr); - return (0); - } - } - } - - /* - * If the U-boot environment contains a variable giving the name of a - * file, use it if we can load and validate it. - */ - s = ub_env_get("fdtfile"); - if (s == NULL) - s = ub_env_get("fdt_file"); - if (s != NULL && *s != '\0') { - if (fdt_load_dtb_file(s) == 0) { - printf("Loaded DTB from file '%s'.\n", s); - return (0); - } - } + if (fdt_platform_load_dtb() == 0) + return (0); /* If there is a dtb compiled into the kernel, use it. */ if ((va = fdt_find_static_dtb()) != 0) { @@ -406,48 +367,20 @@ _fdt_strtovect(const char *str, void *ce return (cnt); } -#define TMP_MAX_ETH 8 - -static void -fixup_ethernet(const char *env, char *ethstr, int *eth_no, int len) +void +fdt_fixup_ethernet(const char *str, char *ethstr, int len) { - const char *str; - char *end; uint8_t tmp_addr[6]; - int i, n; - - /* Extract interface number */ - i = strtol(env + 3, &end, 10); - if (end == (env + 3)) - /* 'ethaddr' means interface 0 address */ - n = 0; - else - n = i; - - if (n > TMP_MAX_ETH) - return; - - str = ub_env_get(env); /* Convert macaddr string into a vector of uints */ fdt_strtovectx(str, &tmp_addr, 6, sizeof(uint8_t)); - if (n != 0) { - i = strlen(env) - 7; - strncpy(ethstr + 8, env + 3, i); - } /* Set actual property to a value from vect */ fdt_setprop(fdtp, fdt_path_offset(fdtp, ethstr), "local-mac-address", &tmp_addr, 6 * sizeof(uint8_t)); - - /* Clear ethernet..XXXX.. string */ - bzero(ethstr + 8, len - 8); - - if (n + 1 > *eth_no) - *eth_no = n + 1; } -static void -fixup_cpubusfreqs(unsigned long cpufreq, unsigned long busfreq) +void +fdt_fixup_cpubusfreqs(unsigned long cpufreq, unsigned long busfreq) { int lo, o = 0, o2, maxo = 0, depth; const uint32_t zero = 0; @@ -526,13 +459,14 @@ fdt_reg_valid(uint32_t *reg, int len, in return (0); } -static void -fixup_memory(struct sys_info *si) +void +fdt_fixup_memory(struct fdt_mem_region *region, size_t num) { - struct mem_region *curmr; + struct fdt_mem_region *curmr; uint32_t addr_cells, size_cells; uint32_t *addr_cellsp, *reg, *size_cellsp; - int err, i, len, memory, realmrno, root; + int err, i, len, memory, root; + size_t realmrno; uint8_t *buf, *sb; uint64_t rstart, rsize; int reserved; @@ -590,7 +524,6 @@ fixup_memory(struct sys_info *si) bzero(buf, len); for (i = 0; i < reserved; i++) { - curmr = &si->mr[i]; if (fdt_get_mem_rsv(fdtp, i, &rstart, &rsize)) break; if (rsize) { @@ -622,9 +555,9 @@ fixup_memory(struct sys_info *si) } /* Count valid memory regions entries in sysinfo. */ - realmrno = si->mr_no; - for (i = 0; i < si->mr_no; i++) - if (si->mr[i].start == 0 && si->mr[i].size == 0) + realmrno = num; + for (i = 0; i < num; i++) + if (region[i].start == 0 && region[i].size == 0) realmrno--; if (realmrno == 0) { @@ -651,8 +584,8 @@ fixup_memory(struct sys_info *si) bzero(buf, len); - for (i = 0; i < si->mr_no; i++) { - curmr = &si->mr[i]; + for (i = 0; i < num; i++) { + curmr = ®ion[i]; if (curmr->size != 0) { /* Ensure endianess, and put cells into a buffer */ if (addr_cells == 2) @@ -681,17 +614,15 @@ fixup_memory(struct sys_info *si) free(sb); } -static void -fixup_stdout(const char *env) +void +fdt_fixup_stdout(const char *str) { - const char *str; char *ptr; int serialno; int len, no, sero; const struct fdt_property *prop; char *tmp[10]; - str = ub_env_get(env); ptr = (char *)str + strlen(str) - 1; while (ptr > str && isdigit(*(str - 1))) str--; @@ -737,14 +668,8 @@ fixup_stdout(const char *env) static int fdt_fixup(void) { - const char *env; - char *ethstr; - int chosen, eth_no, len; - struct sys_info *si; - - env = NULL; - eth_no = 0; - ethstr = NULL; + int chosen, len; + len = 0; debugf("fdt_fixup()\n"); @@ -761,45 +686,7 @@ fdt_fixup(void) if (fdt_getprop(fdtp, chosen, "fixup-applied", NULL)) return (1); - /* Acquire sys_info */ - si = ub_get_sys_info(); - - while ((env = ub_env_enum(env)) != NULL) { - if (strncmp(env, "eth", 3) == 0 && - strncmp(env + (strlen(env) - 4), "addr", 4) == 0) { - /* - * Handle Ethernet addrs: parse uboot env eth%daddr - */ - - if (!eth_no) { - /* - * Check how many chars we will need to store - * maximal eth iface number. - */ - len = strlen(STRINGIFY(TMP_MAX_ETH)) + - strlen("ethernet"); - - /* - * Reserve mem for string "ethernet" and len - * chars for iface no. - */ - ethstr = (char *)malloc(len * sizeof(char)); - bzero(ethstr, len * sizeof(char)); - strcpy(ethstr, "ethernet0"); - } - - /* Modify blob */ - fixup_ethernet(env, ethstr, ð_no, len); - - } else if (strcmp(env, "consoledev") == 0) - fixup_stdout(env); - } - - /* Modify cpu(s) and bus clock frequenties in /cpus node [Hz] */ - fixup_cpubusfreqs(si->clk_cpu, si->clk_bus); - - /* Fixup memory regions */ - fixup_memory(si); + fdt_platform_fixups(); fdt_setprop(fdtp, chosen, "fixup-applied", NULL, 0); return (1); Copied and modified: stable/10/sys/boot/fdt/fdt_platform.h (from r273927, head/sys/boot/fdt/fdt_platform.h) ============================================================================== --- head/sys/boot/fdt/fdt_platform.h Sat Nov 1 10:50:18 2014 (r273927, copy source) +++ stable/10/sys/boot/fdt/fdt_platform.h Sun Dec 14 15:33:45 2014 (r275763) @@ -29,7 +29,26 @@ #ifndef FDT_PLATFORM_H #define FDT_PLATFORM_H -extern int fdt_copy(vm_offset_t); -extern int fdt_setup_fdtp(void); +struct fdt_header; + +struct fdt_mem_region { + unsigned long start; + unsigned long size; +}; + +#define TMP_MAX_ETH 8 + +int fdt_copy(vm_offset_t); +void fdt_fixup_cpubusfreqs(unsigned long, unsigned long); +void fdt_fixup_ethernet(const char *, char *, int); +void fdt_fixup_memory(struct fdt_mem_region *, size_t); +void fdt_fixup_stdout(const char *); +int fdt_load_dtb_addr(struct fdt_header *); +int fdt_load_dtb_file(const char *); +int fdt_setup_fdtp(void); + +/* The platform library needs to implement these functions */ +int fdt_platform_load_dtb(void); +void fdt_platform_fixups(void); #endif /* FDT_PLATFORM_H */ Modified: stable/10/sys/boot/powerpc/uboot/Makefile ============================================================================== --- stable/10/sys/boot/powerpc/uboot/Makefile Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/powerpc/uboot/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -62,6 +62,7 @@ CFLAGS+= -DLOADER_TFTP_SUPPORT CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt CFLAGS+= -DLOADER_FDT_SUPPORT +LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif @@ -98,8 +99,8 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: stable/10/sys/boot/uboot/Makefile ============================================================================== --- stable/10/sys/boot/uboot/Makefile Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/uboot/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -1,5 +1,11 @@ # $FreeBSD$ +.include + SUBDIR= lib +.if ${MK_FDT} != "no" +SUBDIR+=fdt +.endif + .include Modified: stable/10/sys/boot/uboot/common/metadata.c ============================================================================== --- stable/10/sys/boot/uboot/common/metadata.c Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/uboot/common/metadata.c Sun Dec 14 15:33:45 2014 (r275763) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #if defined(LOADER_FDT_SUPPORT) -#include "libuboot.h" +#include #endif static int Modified: stable/10/sys/boot/uboot/fdt/Makefile ============================================================================== --- head/sys/boot/uboot/fdt/Makefile Sat Nov 1 17:12:44 2014 (r273934) +++ stable/10/sys/boot/uboot/fdt/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include .PATH: ${.CURDIR}/../../common Modified: stable/10/sys/boot/uboot/lib/Makefile ============================================================================== --- stable/10/sys/boot/uboot/lib/Makefile Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/uboot/lib/Makefile Sun Dec 14 15:33:45 2014 (r275763) @@ -27,7 +27,7 @@ LOADER_FDT_SUPPORT= no .endif .if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -DLOADER_FDT_SUPPORT +CFLAGS+= -DLOADER_FDT_SUPPORT -I${.CURDIR}/../../fdt .endif # Pick up FDT includes Modified: stable/10/sys/boot/uboot/lib/libuboot.h ============================================================================== --- stable/10/sys/boot/uboot/lib/libuboot.h Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/uboot/lib/libuboot.h Sun Dec 14 15:33:45 2014 (r275763) @@ -72,8 +72,3 @@ void reboot(void); int uboot_diskgetunit(int type, int type_unit); -#if defined(LOADER_FDT_SUPPORT) -extern int fdt_setup_fdtp(); -extern int fdt_copy(vm_offset_t); -#endif - Modified: stable/10/sys/boot/uboot/lib/module.c ============================================================================== --- stable/10/sys/boot/uboot/lib/module.c Sun Dec 14 15:03:11 2014 (r275762) +++ stable/10/sys/boot/uboot/lib/module.c Sun Dec 14 15:33:45 2014 (r275763) @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(LOADER_FDT_SUPPORT) +#include +#endif + #include "bootstrap.h" #include "libuboot.h" From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 15:41:57 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D8B1D2C; Sun, 14 Dec 2014 15:41: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 89C25C3C; Sun, 14 Dec 2014 15:41: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 sBEFfvhl045563; Sun, 14 Dec 2014 15:41:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEFfvjq045562; Sun, 14 Dec 2014 15:41:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141541.sBEFfvjq045562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 15:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275764 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 15:41:57 -0000 Author: andrew Date: Sun Dec 14 15:41:56 2014 New Revision: 275764 URL: https://svnweb.freebsd.org/changeset/base/275764 Log: MFC 275207: We don't use the hypervisor interrupt, make it optional in the device tree. Submitted by: Julien Grall MFC 275208: Some device tree configurations place the generic timer under the root of the tree and not under simplebus. Update the driver to handle this. Submitted by: Julien Grall Modified: stable/10/sys/arm/arm/generic_timer.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/generic_timer.c ============================================================================== --- stable/10/sys/arm/arm/generic_timer.c Sun Dec 14 15:33:45 2014 (r275763) +++ stable/10/sys/arm/arm/generic_timer.c Sun Dec 14 15:41:56 2014 (r275764) @@ -86,7 +86,7 @@ static struct resource_spec timer_spec[] { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Secure */ { SYS_RES_IRQ, 1, RF_ACTIVE }, /* Non-secure */ { SYS_RES_IRQ, 2, RF_ACTIVE }, /* Virt */ - { SYS_RES_IRQ, 3, RF_ACTIVE }, /* Hyp */ + { SYS_RES_IRQ, 3, RF_ACTIVE | RF_OPTIONAL }, /* Hyp */ { -1, 0 } }; @@ -345,6 +345,8 @@ static devclass_t arm_tmr_devclass; EARLY_DRIVER_MODULE(timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(timer, ofwbus, arm_tmr_driver, arm_tmr_devclass, 0, 0, + BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); void DELAY(int usec) From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 16:28:58 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B80B9822; Sun, 14 Dec 2014 16:28:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0C6BFE8; Sun, 14 Dec 2014 16:28:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBEGSwv5066403; Sun, 14 Dec 2014 16:28:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEGSsbO066365; Sun, 14 Dec 2014 16:28:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141628.sBEGSsbO066365@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 16:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275767 - in stable/10: lib/libc/arm/string sys/arm/arm sys/arm/include sys/arm/ti sys/arm/xscale/ixp425 sys/libkern/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 16:28:58 -0000 Author: andrew Date: Sun Dec 14 16:28:53 2014 New Revision: 275767 URL: https://svnweb.freebsd.org/changeset/base/275767 Log: Clean up our ARM assembly: MFC 275256: Switch to the ARM unified assembly language as the clang integrated as only supports it. Binutils supports it when the ".syntax unified" directive is set. Sponsored by: ABT Systems Ltd MFC 275264: Update _ENTRY to use _EENTRY to reduce the common code. MFC 275321: Remove extra labels, ENTRY_NP already provides them. Sponsored by: ABT Systems Ltd MFC 275322: Correctly a few incorrect uses of ENTRY/EENTRY and END/EEND Sponsored by: ABT Systems Ltd MFC 275416: Fix the name of the coprocessor to include the "p" prefix, the clang integrated assembler expects this. Sponsored by: ABT Systems Ltd MFC 275418: Switch to unified syntax so these can be built with clang 3.5. Sponsored by: ABT Systems Ltd MFC 275519: Add missing END macros to some of the xscale functions. Sponsored by: ABT Systems Ltd MFC 275520: Use the unified syntax in a few more assembly files Sponsored by: ABT Systems Ltd MFC 275521: Set the alignment to 4-bytes after a string as clang 3.5 can switch to thumb mode if this is incorrect. Sponsored by: ABT Systems Ltd MFC 275522: Place the literal pool after a RET otherwise clang 3.5 tries to put it too far away from a ldr psuedo instruction. With this clang will place the literal value here where it's close enough to be loaded. Sponsored by: ABT Systems Ltd MFC 275523: Switch to an armv6k cpu, without this clang 3.5 complains "bx lr" is unsupported as it needs a newer cpu. Sponsored by: ABT Systems Ltd MFC 275524: Switch to a .cpu directive. These will work when clang 3.5 is imported where the .arch directive is a nop. Sponsored by: ABT Systems Ltd Modified: stable/10/lib/libc/arm/string/ffs.S stable/10/lib/libc/arm/string/memcmp.S stable/10/lib/libc/arm/string/memcpy_arm.S stable/10/lib/libc/arm/string/memcpy_xscale.S stable/10/lib/libc/arm/string/memmove.S stable/10/lib/libc/arm/string/memset.S stable/10/lib/libc/arm/string/strlen.S stable/10/sys/arm/arm/bcopyinout_xscale.S stable/10/sys/arm/arm/blockio.S stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S stable/10/sys/arm/arm/cpufunc_asm_armv5.S stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S stable/10/sys/arm/arm/fusu.S stable/10/sys/arm/arm/in_cksum_arm.S stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/support.S stable/10/sys/arm/include/asm.h stable/10/sys/arm/ti/ti_smc.S stable/10/sys/arm/xscale/ixp425/ixp425_a4x_io.S stable/10/sys/arm/xscale/ixp425/ixp425_pci_asm.S stable/10/sys/libkern/arm/ffs.S Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/arm/string/ffs.S ============================================================================== --- stable/10/lib/libc/arm/string/ffs.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/ffs.S Sun Dec 14 16:28:53 2014 (r275767) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); +.syntax unified + /* * ffs - find first set bit, this algorithm isolates the first set * bit, then multiplies the number by 0x0450fbaf which leaves the top @@ -60,7 +62,7 @@ ENTRY(ffs) rsbne r0, r0, r0, lsl #16 /* r0 = X * 0x0450fbaf */ /* now lookup in table indexed on top 6 bits of r0 */ - ldrneb r0, [ r2, r0, lsr #26 ] + ldrbne r0, [ r2, r0, lsr #26 ] RET .text; Modified: stable/10/lib/libc/arm/string/memcmp.S ============================================================================== --- stable/10/lib/libc/arm/string/memcmp.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/memcmp.S Sun Dec 14 16:28:53 2014 (r275767) @@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$"); +.syntax unified + ENTRY(memcmp) mov ip, r0 #if defined(_KERNEL) && !defined(_STANDALONE) @@ -76,7 +78,7 @@ ENTRY(memcmp) /* Are both addresses aligned the same way? */ cmp r2, #0x00 - eornes r3, ip, r1 + eorsne r3, ip, r1 RETeq /* len == 0, or same addresses! */ tst r3, #0x03 subne r2, r2, #0x01 Modified: stable/10/lib/libc/arm/string/memcpy_arm.S ============================================================================== --- stable/10/lib/libc/arm/string/memcpy_arm.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/memcpy_arm.S Sun Dec 14 16:28:53 2014 (r275767) @@ -31,6 +31,9 @@ #include __FBSDID("$FreeBSD$"); + +.syntax unified + /* * This is one fun bit of code ... * Some easy listening music is suggested while trying to understand this @@ -91,8 +94,8 @@ ENTRY(memcpy) bge .Lmemcpy_loop32 cmn r2, #0x10 - ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ - stmgeia r0!, {r3, r4, r12, lr} + ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ + stmiage r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 ldmia sp!, {r4} /* return r4 */ @@ -101,9 +104,9 @@ ENTRY(memcpy) /* blat 12 bytes at a time */ .Lmemcpy_loop12: - ldmgeia r1!, {r3, r12, lr} - stmgeia r0!, {r3, r12, lr} - subges r2, r2, #0x0c + ldmiage r1!, {r3, r12, lr} + stmiage r0!, {r3, r12, lr} + subsge r2, r2, #0x0c bge .Lmemcpy_loop12 .Lmemcpy_l12: @@ -113,26 +116,26 @@ ENTRY(memcpy) subs r2, r2, #4 ldrlt r3, [r1], #4 strlt r3, [r0], #4 - ldmgeia r1!, {r3, r12} - stmgeia r0!, {r3, r12} + ldmiage r1!, {r3, r12} + stmiage r0!, {r3, r12} subge r2, r2, #4 .Lmemcpy_l4: /* less than 4 bytes to go */ adds r2, r2, #4 #ifdef __APCS_26_ - ldmeqia sp!, {r0, pc}^ /* done */ + ldmiaeq sp!, {r0, pc}^ /* done */ #else - ldmeqia sp!, {r0, pc} /* done */ + ldmiaeq sp!, {r0, pc} /* done */ #endif /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 ldmia sp!, {r0, pc} /* erg - unaligned destination */ @@ -143,10 +146,10 @@ ENTRY(memcpy) /* align destination with byte copies */ ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 subs r2, r2, r12 blt .Lmemcpy_l4 /* less the 4 bytes */ Modified: stable/10/lib/libc/arm/string/memcpy_xscale.S ============================================================================== --- stable/10/lib/libc/arm/string/memcpy_xscale.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/memcpy_xscale.S Sun Dec 14 16:28:53 2014 (r275767) @@ -38,6 +38,8 @@ #include __FBSDID("$FreeBSD$"); +.syntax unified + /* LINTSTUB: Func: void *memcpy(void *dst, const void *src, size_t len) */ ENTRY(memcpy) pld [r1] @@ -52,12 +54,12 @@ ENTRY(memcpy) ldrb ip, [r1], #0x01 sub r2, r2, #0x01 strb ip, [r3], #0x01 - ldrleb ip, [r1], #0x01 + ldrble ip, [r1], #0x01 suble r2, r2, #0x01 - strleb ip, [r3], #0x01 - ldrltb ip, [r1], #0x01 + strble ip, [r3], #0x01 + ldrblt ip, [r1], #0x01 sublt r2, r2, #0x01 - strltb ip, [r3], #0x01 + strblt ip, [r3], #0x01 /* Destination buffer is now word aligned */ .Lmemcpy_wordaligned: @@ -134,7 +136,7 @@ ENTRY(memcpy) .Lmemcpy_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} bxeq lr /* Return now if done */ subs r2, r2, #0x20 blt .Lmemcpy_w_lessthan32 @@ -159,7 +161,7 @@ ENTRY(memcpy) .Lmemcpy_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} bxeq lr /* Return now if done */ and r4, r2, #0x18 @@ -195,11 +197,11 @@ ENTRY(memcpy) addlt r2, r2, #0x04 ldrb ip, [r1], #0x01 cmp r2, #0x02 - ldrgeb r2, [r1], #0x01 + ldrbge r2, [r1], #0x01 strb ip, [r3], #0x01 - ldrgtb ip, [r1] - strgeb r2, [r3], #0x01 - strgtb ip, [r3] + ldrbgt ip, [r1] + strbge r2, [r3], #0x01 + strbgt ip, [r3] bx lr @@ -253,7 +255,7 @@ ENTRY(memcpy) bge .Lmemcpy_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} bxeq lr /* Return now if done */ subs r2, r2, #0x04 sublt r1, r1, #0x03 @@ -314,7 +316,7 @@ ENTRY(memcpy) bge .Lmemcpy_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} bxeq lr /* Return now if done */ subs r2, r2, #0x04 sublt r1, r1, #0x02 @@ -375,7 +377,7 @@ ENTRY(memcpy) bge .Lmemcpy_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} bxeq lr /* Return now if done */ subs r2, r2, #0x04 sublt r1, r1, #0x01 @@ -404,11 +406,11 @@ ENTRY(memcpy) bxeq lr ldrb ip, [r1], #0x01 cmp r2, #0x02 - ldrgeb r2, [r1], #0x01 + ldrbge r2, [r1], #0x01 strb ip, [r3], #0x01 - ldrgtb ip, [r1] - strgeb r2, [r3], #0x01 - strgtb ip, [r3] + ldrbgt ip, [r1] + strbge r2, [r3], #0x01 + strbgt ip, [r3] bx lr @@ -440,7 +442,7 @@ ENTRY(memcpy) ldrb ip, [r1], #0x01 1: subs r2, r2, #0x01 strb ip, [r3], #0x01 - ldrneb ip, [r1], #0x01 + ldrbne ip, [r1], #0x01 bne 1b bx lr Modified: stable/10/lib/libc/arm/string/memmove.S ============================================================================== --- stable/10/lib/libc/arm/string/memmove.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/memmove.S Sun Dec 14 16:28:53 2014 (r275767) @@ -32,6 +32,8 @@ #include __FBSDID("$FreeBSD$"); +.syntax unified + #ifndef _BCOPY /* LINTSTUB: Func: void *memmove(void *, const void *, size_t) */ ENTRY(memmove) @@ -86,8 +88,8 @@ ENTRY(bcopy) bge .Lmemmove_floop32 cmn r2, #0x10 - ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ - stmgeia r0!, {r3, r4, r12, lr} + ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ + stmiage r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 ldmia sp!, {r4} /* return r4 */ @@ -96,9 +98,9 @@ ENTRY(bcopy) /* blat 12 bytes at a time */ .Lmemmove_floop12: - ldmgeia r1!, {r3, r12, lr} - stmgeia r0!, {r3, r12, lr} - subges r2, r2, #0x0c + ldmiage r1!, {r3, r12, lr} + stmiage r0!, {r3, r12, lr} + subsge r2, r2, #0x0c bge .Lmemmove_floop12 .Lmemmove_fl12: @@ -108,23 +110,23 @@ ENTRY(bcopy) subs r2, r2, #4 ldrlt r3, [r1], #4 strlt r3, [r0], #4 - ldmgeia r1!, {r3, r12} - stmgeia r0!, {r3, r12} + ldmiage r1!, {r3, r12} + stmiage r0!, {r3, r12} subge r2, r2, #4 .Lmemmove_fl4: /* less than 4 bytes to go */ adds r2, r2, #4 - ldmeqia sp!, {r0, pc} /* done */ + ldmiaeq sp!, {r0, pc} /* done */ /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 ldmia sp!, {r0, pc} /* erg - unaligned destination */ @@ -135,10 +137,10 @@ ENTRY(bcopy) /* align destination with byte copies */ ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 subs r2, r2, r12 blt .Lmemmove_fl4 /* less the 4 bytes */ @@ -353,12 +355,12 @@ ENTRY(bcopy) .Lmemmove_bl32: cmn r2, #0x10 - ldmgedb r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ - stmgedb r0!, {r3, r4, r12, lr} + ldmdbge r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ + stmdbge r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 adds r2, r2, #0x14 - ldmgedb r1!, {r3, r12, lr} /* blat a remaining 12 bytes */ - stmgedb r0!, {r3, r12, lr} + ldmdbge r1!, {r3, r12, lr} /* blat a remaining 12 bytes */ + stmdbge r0!, {r3, r12, lr} subge r2, r2, #0x0c ldmia sp!, {r4, lr} @@ -368,8 +370,8 @@ ENTRY(bcopy) subs r2, r2, #4 ldrlt r3, [r1, #-4]! strlt r3, [r0, #-4]! - ldmgedb r1!, {r3, r12} - stmgedb r0!, {r3, r12} + ldmdbge r1!, {r3, r12} + stmdbge r0!, {r3, r12} subge r2, r2, #4 .Lmemmove_bl4: @@ -381,10 +383,10 @@ ENTRY(bcopy) cmp r2, #2 ldrb r3, [r1, #-1]! strb r3, [r0, #-1]! - ldrgeb r3, [r1, #-1]! - strgeb r3, [r0, #-1]! - ldrgtb r3, [r1, #-1]! - strgtb r3, [r0, #-1]! + ldrbge r3, [r1, #-1]! + strbge r3, [r0, #-1]! + ldrbgt r3, [r1, #-1]! + strbgt r3, [r0, #-1]! RET /* erg - unaligned destination */ @@ -394,10 +396,10 @@ ENTRY(bcopy) /* align destination with byte copies */ ldrb r3, [r1, #-1]! strb r3, [r0, #-1]! - ldrgeb r3, [r1, #-1]! - strgeb r3, [r0, #-1]! - ldrgtb r3, [r1, #-1]! - strgtb r3, [r0, #-1]! + ldrbge r3, [r1, #-1]! + strbge r3, [r0, #-1]! + ldrbgt r3, [r1, #-1]! + strbgt r3, [r0, #-1]! subs r2, r2, r12 blt .Lmemmove_bl4 /* less than 4 bytes to go */ ands r12, r1, #3 Modified: stable/10/lib/libc/arm/string/memset.S ============================================================================== --- stable/10/lib/libc/arm/string/memset.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/memset.S Sun Dec 14 16:28:53 2014 (r275767) @@ -69,6 +69,8 @@ #include __FBSDID("$FreeBSD$"); +.syntax unified + /* * memset: Sets a block of memory to the specified value * @@ -125,39 +127,39 @@ ENTRY(memset) .Lmemset_loop128: subs r1, r1, #0x80 #ifdef _ARM_ARCH_5E - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 -#else - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 +#else + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} #endif bgt .Lmemset_loop128 RETeq /* Zero length so just exit */ @@ -168,15 +170,15 @@ ENTRY(memset) .Lmemset_loop32: subs r1, r1, #0x20 #ifdef _ARM_ARCH_5E - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 -#else - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 +#else + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} #endif bgt .Lmemset_loop32 RETeq /* Zero length so just exit */ @@ -185,11 +187,11 @@ ENTRY(memset) /* Deal with 16 bytes or more */ #ifdef _ARM_ARCH_5E - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 #else - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} #endif RETeq /* Zero length so just exit */ @@ -212,17 +214,17 @@ ENTRY(memset) #endif strb r3, [ip], #0x01 /* Set 1 byte */ - strgeb r3, [ip], #0x01 /* Set another byte */ - strgtb r3, [ip] /* and a third */ + strbge r3, [ip], #0x01 /* Set another byte */ + strbgt r3, [ip] /* and a third */ RET /* Exit */ .Lmemset_wordunaligned: rsb r2, r2, #0x004 strb r3, [ip], #0x01 /* Set 1 byte */ cmp r2, #0x02 - strgeb r3, [ip], #0x01 /* Set another byte */ + strbge r3, [ip], #0x01 /* Set another byte */ sub r1, r1, r2 - strgtb r3, [ip], #0x01 /* and a third */ + strbgt r3, [ip], #0x01 /* and a third */ cmp r1, #0x04 /* More than 4 bytes left? */ bge .Lmemset_wordaligned /* Yup */ @@ -231,8 +233,8 @@ ENTRY(memset) RETeq /* Zero length so exit */ strb r3, [ip], #0x01 /* Set 1 byte */ cmp r1, #0x02 - strgeb r3, [ip], #0x01 /* Set another byte */ - strgtb r3, [ip] /* and a third */ + strbge r3, [ip], #0x01 /* Set another byte */ + strbgt r3, [ip] /* and a third */ RET /* Exit */ #ifdef _BZERO END(bzero) Modified: stable/10/lib/libc/arm/string/strlen.S ============================================================================== --- stable/10/lib/libc/arm/string/strlen.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/lib/libc/arm/string/strlen.S Sun Dec 14 16:28:53 2014 (r275767) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +.syntax unified + ENTRY(strlen) mov r1, #0 /* Check that the pointer is aligned on 32 bits. */ @@ -53,23 +55,23 @@ ENTRY(strlen) addne r1, r1, #1 .Ldo_3: #ifndef __ARMEB__ - andnes r3, r2, #0x0000ff00 + andsne r3, r2, #0x0000ff00 #else - andnes r3, r2, #0x00ff0000 + andsne r3, r2, #0x00ff0000 #endif addne r1, r1, #1 .Ldo_2: #ifndef __ARMEB__ - andnes r3, r2, #0x00ff0000 + andsne r3, r2, #0x00ff0000 #else - andnes r3, r2, #0x0000ff00 + andsne r3, r2, #0x0000ff00 #endif addne r1, r1, #1 .Ldo_1: #ifndef __ARMEB__ - andnes r3, r2, #0xff000000 + andsne r3, r2, #0xff000000 #else - andnes r3, r2, #0x000000ff + andsne r3, r2, #0x000000ff #endif addne r1, r1, #1 bne .Loop Modified: stable/10/sys/arm/arm/bcopyinout_xscale.S ============================================================================== --- stable/10/sys/arm/arm/bcopyinout_xscale.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/bcopyinout_xscale.S Sun Dec 14 16:28:53 2014 (r275767) @@ -38,6 +38,7 @@ #include __FBSDID("$FreeBSD$"); + .syntax unified .text .align 0 @@ -104,8 +105,8 @@ ENTRY(copyin) ldr r0, =EFAULT str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 - ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ - ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ + ldmfdgt sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ + ldmfdlt sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ ldmfd sp!, {r10-r11, pc} .Lcopyin_guts: @@ -138,7 +139,7 @@ ENTRY(copyin) /* Quad-align the destination buffer */ tst r1, #0x07 /* Already quad aligned? */ - ldrnet ip, [r0], #0x04 + ldrtne ip, [r0], #0x04 strne ip, [r1], #0x04 subne r2, r2, #0x04 stmfd sp!, {r4-r9} /* Free up some registers */ @@ -207,7 +208,7 @@ ENTRY(copyin) .Lcopyin_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq subs r2, r2, #0x20 blt .Lcopyin_w_lessthan32 @@ -232,7 +233,7 @@ ENTRY(copyin) .Lcopyin_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ and r4, r2, #0x18 @@ -266,17 +267,17 @@ ENTRY(copyin) .Lcopyin_w_less_than8: subs r2, r2, #0x04 - ldrget ip, [r0], #0x04 + ldrtge ip, [r0], #0x04 strge ip, [r1], #0x04 RETeq /* Return now if done */ addlt r2, r2, #0x04 ldrbt ip, [r0], #0x01 cmp r2, #0x02 - ldrgebt r2, [r0], #0x01 + ldrbtge r2, [r0], #0x01 strb ip, [r1], #0x01 - ldrgtbt ip, [r0] - strgeb r2, [r1], #0x01 - strgtb ip, [r1] + ldrbtgt ip, [r0] + strbge r2, [r1], #0x01 + strbgt ip, [r1] RET /* @@ -331,7 +332,7 @@ ENTRY(copyin) bge .Lcopyin_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x03 @@ -392,7 +393,7 @@ ENTRY(copyin) bge .Lcopyin_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x02 @@ -453,7 +454,7 @@ ENTRY(copyin) bge .Lcopyin_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x01 @@ -546,8 +547,8 @@ ENTRY(copyout) ldr r0, =EFAULT str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 - ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ - ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ + ldmfdgt sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ + ldmfdlt sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ ldmfd sp!, {r10-r11, pc} .Lcopyout_guts: @@ -582,7 +583,7 @@ ENTRY(copyout) tst r0, #0x07 /* Already quad aligned? */ ldrne ip, [r0], #0x04 subne r2, r2, #0x04 - strnet ip, [r1], #0x04 + strtne ip, [r1], #0x04 stmfd sp!, {r4-r9} /* Free up some registers */ mov r3, #-1 /* Signal restore r4-r9 */ @@ -650,7 +651,7 @@ ENTRY(copyout) .Lcopyout_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ subs r2, r2, #0x20 blt .Lcopyout_w_lessthan32 @@ -675,7 +676,7 @@ ENTRY(copyout) .Lcopyout_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ and r4, r2, #0x18 @@ -710,16 +711,16 @@ ENTRY(copyout) .Lcopyout_w_less_than8: subs r2, r2, #0x04 ldrge ip, [r0], #0x04 - strget ip, [r1], #0x04 + strtge ip, [r1], #0x04 RETeq /* Return now if done */ addlt r2, r2, #0x04 ldrb ip, [r0], #0x01 cmp r2, #0x02 - ldrgeb r2, [r0], #0x01 + ldrbge r2, [r0], #0x01 strbt ip, [r1], #0x01 - ldrgtb ip, [r0] - strgebt r2, [r1], #0x01 - strgtbt ip, [r1] + ldrbgt ip, [r0] + strbtge r2, [r1], #0x01 + strbtgt ip, [r1] RET /* @@ -774,7 +775,7 @@ ENTRY(copyout) bge .Lcopyout_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x03 @@ -835,7 +836,7 @@ ENTRY(copyout) bge .Lcopyout_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x02 @@ -896,7 +897,7 @@ ENTRY(copyout) bge .Lcopyout_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x01 Modified: stable/10/sys/arm/arm/blockio.S ============================================================================== --- stable/10/sys/arm/arm/blockio.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/blockio.S Sun Dec 14 16:28:53 2014 (r275767) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); + .syntax unified + /* * Read bytes from an I/O address into a block of memory * @@ -71,10 +73,10 @@ ENTRY(read_multi_1) cmp r12, #2 ldrb r3, [r0] strb r3, [r1], #1 - ldrgeb r3, [r0] - strgeb r3, [r1], #1 - ldrgtb r3, [r0] - strgtb r3, [r1], #1 + ldrbge r3, [r0] + strbge r3, [r1], #1 + ldrbgt r3, [r0] + strbgt r3, [r1], #1 subs r2, r2, r12 blt .Lrm1_l4 .Lrm1_main: @@ -91,15 +93,15 @@ ENTRY(read_multi_1) bge .Lrm1loop .Lrm1_l4: adds r2, r2, #4 /* r2 = length again */ - ldmeqdb fp, {fp, sp, pc} + ldmdbeq fp, {fp, sp, pc} RETeq cmp r2, #2 ldrb r3, [r0] strb r3, [r1], #1 - ldrgeb r3, [r0] - strgeb r3, [r1], #1 - ldrgtb r3, [r0] - strgtb r3, [r1], #1 + ldrbge r3, [r0] + strbge r3, [r1], #1 + ldrbgt r3, [r0] + strbgt r3, [r1], #1 ldmdb fp, {fp, sp, pc} END(read_multi_1) @@ -124,10 +126,10 @@ ENTRY(write_multi_1) cmp r12, #2 ldrb r3, [r1], #1 strb r3, [r0] - ldrgeb r3, [r1], #1 - strgeb r3, [r0] - ldrgtb r3, [r1], #1 - strgtb r3, [r0] + ldrbge r3, [r1], #1 + strbge r3, [r0] + ldrbgt r3, [r1], #1 + strbgt r3, [r0] subs r2, r2, r12 blt .Lwm1_l4 .Lwm1_main: @@ -144,14 +146,14 @@ ENTRY(write_multi_1) bge .Lwm1loop .Lwm1_l4: adds r2, r2, #4 /* r2 = length again */ - ldmeqdb fp, {fp, sp, pc} + ldmdbeq fp, {fp, sp, pc} cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0] - ldrgeb r3, [r1], #1 - strgeb r3, [r0] - ldrgtb r3, [r1], #1 - strgtb r3, [r0] + ldrbge r3, [r1], #1 + strbge r3, [r0] + ldrbgt r3, [r1], #1 + strbgt r3, [r0] ldmdb fp, {fp, sp, pc} END(write_multi_1) Modified: stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S Sun Dec 14 16:28:53 2014 (r275767) @@ -62,7 +62,7 @@ #include __FBSDID("$FreeBSD$"); - .cpu arm1136js + .cpu arm1176jz-s #if 0 #define Invalidate_I_cache(Rtmp1, Rtmp2) \ Modified: stable/10/sys/arm/arm/cpufunc_asm_armv5.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv5.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/cpufunc_asm_armv5.S Sun Dec 14 16:28:53 2014 (r275767) @@ -194,7 +194,6 @@ ENTRY(armv5_idcache_wbinv_range) END(armv5_idcache_wbinv_range) ENTRY_NP(armv5_idcache_wbinv_all) -armv5_idcache_wbinv_all: .Larmv5_idcache_wbinv_all: /* * We assume that the code here can never be out of sync with the Modified: stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S Sun Dec 14 16:28:53 2014 (r275767) @@ -143,7 +143,6 @@ __FBSDID("$FreeBSD$"); ENTRY_NP(xscalec3_cache_syncI) -xscalec3_cache_purgeID: EENTRY_NP(xscalec3_cache_purgeID) mcr p15, 0, r0, c7, c5, 0 /* flush I cache (D cleaned below) */ EENTRY_NP(xscalec3_cache_cleanID) Modified: stable/10/sys/arm/arm/fusu.S ============================================================================== --- stable/10/sys/arm/arm/fusu.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/fusu.S Sun Dec 14 16:28:53 2014 (r275767) @@ -38,6 +38,8 @@ #include "assym.s" __FBSDID("$FreeBSD$"); + .syntax unified + #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ @@ -83,7 +85,7 @@ EENTRY_NP(casuword32) ldrt r5, [r0] cmp r5, r1 movne r0, r5 - streqt r2, [r0] + strteq r2, [r0] #endif moveq r0, r1 2: @@ -129,7 +131,7 @@ EENTRY_NP(fuword32) str r1, [r2, #PCB_ONFAULT] mov r0, r3 RET -END(fuword32) +EEND(fuword32) END(fuword) /* @@ -269,7 +271,7 @@ _C_LABEL(fusubailout): fusupcbfaulttext: .asciz "Yikes - no valid PCB during fusuxxx() addr=%08x\n" - .align 0 + .align 2 #endif /* @@ -295,7 +297,7 @@ EENTRY_NP(suword32) mov r0, #0x00000000 str r0, [r2, #PCB_ONFAULT] RET -END(suword32) +EEND(suword32) END(suword) /* Modified: stable/10/sys/arm/arm/in_cksum_arm.S ============================================================================== --- stable/10/sys/arm/arm/in_cksum_arm.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/in_cksum_arm.S Sun Dec 14 16:28:53 2014 (r275767) @@ -46,6 +46,7 @@ #include "assym.s" __FBSDID("$FreeBSD$"); + .syntax unified /* * int in_cksum(struct mbuf *m, int len) * @@ -128,9 +129,9 @@ ASENTRY_NP(L_cksumdata) blt .Lcksumdata_endgame cmp r7, #0x02 ldrb r4, [r0], #0x01 /* Fetch 1st byte */ - ldrgeb r5, [r0], #0x01 /* Fetch 2nd byte */ + ldrbge r5, [r0], #0x01 /* Fetch 2nd byte */ movlt r5, #0x00 - ldrgtb r6, [r0], #0x01 /* Fetch 3rd byte */ + ldrbgt r6, [r0], #0x01 /* Fetch 3rd byte */ movle r6, #0x00 /* Combine the three bytes depending on endianness and alignment */ #ifdef __ARMEB__ @@ -196,7 +197,7 @@ ASENTRY_NP(L_cksumdata) adcs r2, r2, r5 adc r2, r2, #0x00 subs r1, r1, #0x40 - ldrged r4, [r0], #0x08 + ldrdge r4, [r0], #0x08 bge .Lcksumdata_bigloop adds r2, r2, r6 /* r6/r7 still need summing */ @@ -241,7 +242,7 @@ ASENTRY_NP(L_cksumdata) cmp r1, #0x20 #ifdef _ARM_ARCH_5E - ldrged r4, [r0], #0x08 /* Avoid stalling pld and result */ + ldrdge r4, [r0], #0x08 /* Avoid stalling pld and result */ blt .Lcksumdata_less_than_32 pld [r0, #0x18] ldrd r6, [r0], #0x08 @@ -319,9 +320,9 @@ ASENTRY_NP(L_cksumdata) .Lcksumdata_endgame: ldrb r3, [r0] /* Fetch first byte */ cmp r1, #0x02 - ldrgeb r4, [r0, #0x01] /* Fetch 2nd and 3rd as necessary */ + ldrbge r4, [r0, #0x01] /* Fetch 2nd and 3rd as necessary */ movlt r4, #0x00 - ldrgtb r5, [r0, #0x02] + ldrbgt r5, [r0, #0x02] movle r5, #0x00 /* Combine the three bytes depending on endianness and alignment */ tst r0, #0x01 Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/locore.S Sun Dec 14 16:28:53 2014 (r275767) @@ -474,8 +474,8 @@ ENTRY_NP(cpu_halt) * Hurl ourselves into the ROM */ mov r0, #(CPU_CONTROL_32BP_ENABLE | CPU_CONTROL_32BD_ENABLE) - mcr 15, 0, r0, c1, c0, 0 - mcrne 15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */ + mcr p15, 0, r0, c1, c0, 0 + mcrne p15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */ mov pc, r4 /* Modified: stable/10/sys/arm/arm/support.S ============================================================================== --- stable/10/sys/arm/arm/support.S Sun Dec 14 16:26:19 2014 (r275766) +++ stable/10/sys/arm/arm/support.S Sun Dec 14 16:28:53 2014 (r275767) @@ -91,6 +91,8 @@ __FBSDID("$FreeBSD$"); #include "assym.s" + .syntax unified + .L_arm_memcpy: .word _C_LABEL(_arm_memcpy) .L_arm_bzero: @@ -130,7 +132,7 @@ ENTRY(bzero) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 17:28:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5555040D; Sun, 14 Dec 2014 17:28: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 403E77F7; Sun, 14 Dec 2014 17:28: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 sBEHS3OH095784; Sun, 14 Dec 2014 17:28:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEHS34C095783; Sun, 14 Dec 2014 17:28:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141728.sBEHS34C095783@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 17:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275769 - stable/10/contrib/binutils/bfd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 17:28:03 -0000 Author: andrew Date: Sun Dec 14 17:28:02 2014 New Revision: 275769 URL: https://svnweb.freebsd.org/changeset/base/275769 Log: MFC 275336: Use llabs when getting the absolute value of a long long. Sponsored by: ABT Ststems Ltd Modified: stable/10/contrib/binutils/bfd/elf32-arm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- stable/10/contrib/binutils/bfd/elf32-arm.c Sun Dec 14 16:40:46 2014 (r275768) +++ stable/10/contrib/binutils/bfd/elf32-arm.c Sun Dec 14 17:28:02 2014 (r275769) @@ -4960,7 +4960,7 @@ elf32_arm_final_link_relocate (reloc_how + input_section->output_offset + rel->r_offset); - value = abs (relocation); + value = llabs (relocation); if (value >= 0x1000) return bfd_reloc_overflow; @@ -4998,7 +4998,7 @@ elf32_arm_final_link_relocate (reloc_how + input_section->output_offset + rel->r_offset); - value = abs (relocation); + value = llabs (relocation); if (value >= 0x1000) return bfd_reloc_overflow; @@ -5984,7 +5984,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_n, in encoded constant-with-rotation format. */ - g_n = calculate_group_reloc_mask (abs (signed_value), group, + g_n = calculate_group_reloc_mask (llabs (signed_value), group, &residual); /* Check for overflow if required. */ @@ -5998,7 +5998,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6077,7 +6077,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. */ if (residual >= 0x1000) @@ -6085,7 +6085,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6160,7 +6160,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. */ if (residual >= 0x100) @@ -6168,7 +6168,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6243,7 +6243,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. (The absolute value to go in the place must be divisible by four and, after having been divided by four, must @@ -6253,7 +6253,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 17:38:44 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7173567A; Sun, 14 Dec 2014 17:38: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 443748D6; Sun, 14 Dec 2014 17:38: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 sBEHciJQ000926; Sun, 14 Dec 2014 17:38:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEHciRH000923; Sun, 14 Dec 2014 17:38:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141738.sBEHciRH000923@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 17:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275770 - stable/10/contrib/binutils/gas/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 17:38:44 -0000 Author: andrew Date: Sun Dec 14 17:38:43 2014 New Revision: 275770 URL: https://svnweb.freebsd.org/changeset/base/275770 Log: MFC 275415: Allow the UAL APSR_nzcv format for the mrc and mrc2 instructions. The clang integrated assembler only allows these forms so binutils will need to support them. Sponsored by: ABT Systems Ltd MFC 275584: Fix mrc and mrc2 with APSR_nzcv. Binutils encodes it internally as 0 where we need it to be set to 15 for it to be equivalent to r15. Sponsored by: ABT Systems Ltd Modified: stable/10/contrib/binutils/gas/config/tc-arm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-arm.c Sun Dec 14 17:28:02 2014 (r275769) +++ stable/10/contrib/binutils/gas/config/tc-arm.c Sun Dec 14 17:38:43 2014 (r275770) @@ -6771,7 +6771,11 @@ do_co_reg (void) { inst.instruction |= inst.operands[0].reg << 8; inst.instruction |= inst.operands[1].imm << 21; - inst.instruction |= inst.operands[2].reg << 12; + /* If this is a vector we are using the APSR_nzcv syntax, encode as r15 */ + if (inst.operands[2].isvec != 0) + inst.instruction |= 15 << 12; + else + inst.instruction |= inst.operands[2].reg << 12; inst.instruction |= inst.operands[3].reg << 16; inst.instruction |= inst.operands[4].reg; inst.instruction |= inst.operands[5].imm << 5; @@ -15029,7 +15033,7 @@ static const struct asm_opcode insns[] = TCE(stc, c000000, ec000000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TC3(stcl, c400000, ec400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TCE(mcr, e000010, ee000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), - TCE(mrc, e100010, ee100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + TCE(mrc, e100010, ee100010, 6, (RCP, I7b, APSR_RR, RCN, RCN, oI7b), co_reg, co_reg), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v2s /* ARM 3 - swp instructions. */ @@ -15088,7 +15092,7 @@ static const struct asm_opcode insns[] = TUF(stc2l, c400000, fc400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TUF(cdp2, e000000, fe000000, 6, (RCP, I15b, RCN, RCN, RCN, oI7b), cdp, cdp), TUF(mcr2, e000010, fe000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), - TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, APSR_RR, RCN, RCN, oI7b), co_reg, co_reg), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v5exp /* ARM Architecture 5TExP. */ From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 18:01:11 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45CA1E7A; Sun, 14 Dec 2014 18:01: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 17DCFB4F; Sun, 14 Dec 2014 18:01: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 sBEI1Ake013679; Sun, 14 Dec 2014 18:01:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEI1AWk013677; Sun, 14 Dec 2014 18:01:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141801.sBEI1AWk013677@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 18:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275771 - stable/10/contrib/gcc/config/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:01:11 -0000 Author: andrew Date: Sun Dec 14 18:01:09 2014 New Revision: 275771 URL: https://svnweb.freebsd.org/changeset/base/275771 Log: MFC 275337: There is no need to use FUNC_END with aeabi_ldiv0 or aeabi_idiv0 as they are aliases. Sponsored by: ABT Systems Ltd MFC 275380: Use the floating-point instruction on ARMv7 as the clang 3.5 integrated assembler doesn't allow these two instructions to use co-processor 11. Sponsored by: ABT Systems Ltd Modified: stable/10/contrib/gcc/config/arm/lib1funcs.asm stable/10/contrib/gcc/config/arm/libunwind.S Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/config/arm/lib1funcs.asm ============================================================================== --- stable/10/contrib/gcc/config/arm/lib1funcs.asm Sun Dec 14 17:38:43 2014 (r275770) +++ stable/10/contrib/gcc/config/arm/lib1funcs.asm Sun Dec 14 18:01:09 2014 (r275771) @@ -980,8 +980,6 @@ LSYM(Lover12): RET - FUNC_END aeabi_ldiv0 - FUNC_END aeabi_idiv0 FUNC_END div0 #endif /* L_divmodsi_tools */ Modified: stable/10/contrib/gcc/config/arm/libunwind.S ============================================================================== --- stable/10/contrib/gcc/config/arm/libunwind.S Sun Dec 14 17:38:43 2014 (r275770) +++ stable/10/contrib/gcc/config/arm/libunwind.S Sun Dec 14 18:01:09 2014 (r275771) @@ -26,6 +26,13 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + +/* Allow the use of VFP instructions */ +#if __ARM_ARCH >= 7 +.fpu vfp +#endif + #ifndef __symbian__ #include "lib1funcs.asm" @@ -66,14 +73,22 @@ ARM_FUNC_START restore_core_regs ARM_FUNC_START gnu_Unwind_Restore_VFP /* Use the generic coprocessor form so that gas doesn't complain on soft-float targets. */ +#if __ARM_ARCH >= 7 + fldmiax r0, {d0-d15} +#else ldc p11,cr0,[r0],{0x21} /* fldmiax r0, {d0-d15} */ +#endif RET /* Store VFR regsters d0-d15 to the address in r0. */ ARM_FUNC_START gnu_Unwind_Save_VFP /* Use the generic coprocessor form so that gas doesn't complain on soft-float targets. */ +#if __ARM_ARCH >= 7 + fstmiax r0, {d0-d15} +#else stc p11,cr0,[r0],{0x21} /* fstmiax r0, {d0-d15} */ +#endif RET /* Wrappers to save core registers, then call the real routine. */ From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 18:23:31 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FA60916; Sun, 14 Dec 2014 18:23: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 5AF19D59; Sun, 14 Dec 2014 18:23: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 sBEINVjH025539; Sun, 14 Dec 2014 18:23:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEINVne025538; Sun, 14 Dec 2014 18:23:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141823.sBEINVne025538@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 18:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275775 - stable/10/sys/arm/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:23:31 -0000 Author: andrew Date: Sun Dec 14 18:23:30 2014 New Revision: 275775 URL: https://svnweb.freebsd.org/changeset/base/275775 Log: MFC 275378: Pull in the NetBSD global offset table handling code. Clang 3.5 creates relocations the linker complains about. Obtained from: NetBSD Modified: stable/10/sys/arm/include/asm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/include/asm.h ============================================================================== --- stable/10/sys/arm/include/asm.h Sun Dec 14 18:21:03 2014 (r275774) +++ stable/10/sys/arm/include/asm.h Sun Dec 14 18:23:30 2014 (r275775) @@ -118,10 +118,16 @@ ldr x, [x, got] #define GOT_INIT(got,gotsym,pclabel) \ ldr got, gotsym; \ - add got, got, pc; \ - pclabel: + pclabel: add got, got, pc +#ifdef __thumb__ #define GOT_INITSYM(gotsym,pclabel) \ - gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (pclabel+4)) + .align 0; \ + gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+4) +#else +#define GOT_INITSYM(gotsym,pclabel) \ + .align 0; \ + gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+8) +#endif #ifdef __STDC__ #define PIC_SYM(x,y) x ## ( ## y ## ) From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 18:28:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5538DA9E; Sun, 14 Dec 2014 18:28:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40BBED7A; Sun, 14 Dec 2014 18:28: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 sBEIS2E1026250; Sun, 14 Dec 2014 18:28:02 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEIS2Uo026249; Sun, 14 Dec 2014 18:28:02 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141828.sBEIS2Uo026249@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 18:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275776 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:28:02 -0000 Author: andrew Date: Sun Dec 14 18:28:01 2014 New Revision: 275776 URL: https://svnweb.freebsd.org/changeset/base/275776 Log: MFC 275564: Use the unified syntax when generating assembly for clang. The clang 3.5 integrated assembler only accepts it. Sponsored by: ABT Systems Ltd Modified: stable/10/sys/arm/arm/stdatomic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/stdatomic.c ============================================================================== --- stable/10/sys/arm/arm/stdatomic.c Sun Dec 14 18:23:30 2014 (r275775) +++ stable/10/sys/arm/arm/stdatomic.c Sun Dec 14 18:28:01 2014 (r275776) @@ -854,8 +854,13 @@ EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str, fetch_and_sub, "sub") \ EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str, fetch_and_xor, "eor") +#ifdef __clang__ +EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "strbeq") +EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "strheq") +#else EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "streqb") EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "streqh") +#endif EMIT_ALL_OPS_N(4, uint32_t, "ldr", "str", "streq") #ifndef __clang__ From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 18:30:32 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF47DBF0; Sun, 14 Dec 2014 18: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 C0986D8F; Sun, 14 Dec 2014 18: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 sBEIUVBo026752; Sun, 14 Dec 2014 18:30:31 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEIUVuq026749; Sun, 14 Dec 2014 18:30:31 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201412141830.sBEIUVuq026749@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 14 Dec 2014 18:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275777 - in stable/10/bin/sh: . tests/parameters X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:30:32 -0000 Author: jilles Date: Sun Dec 14 18:30:30 2014 New Revision: 275777 URL: https://svnweb.freebsd.org/changeset/base/275777 Log: MFC r268576: sh: Correctly handle positional parameters beyond INT_MAX on 64-bit systems. Currently, there can be no more than INT_MAX positional parameters. Make sure to treat all higher ones as unset to avoid incorrect results and crashes. On 64-bit systems, our atoi() takes the low 32 bits of the strtol() and sign-extends them. On 32-bit systems, the call to atoi() returned INT_MAX for too high values and there is not enough address space for so many positional parameters, so there was no issue. PR: 195918 Added: stable/10/bin/sh/tests/parameters/positional5.0 - copied unchanged from r268576, head/bin/sh/tests/parameters/positional5.0 Modified: stable/10/bin/sh/expand.c stable/10/bin/sh/tests/parameters/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Sun Dec 14 18:28:01 2014 (r275776) +++ stable/10/bin/sh/expand.c Sun Dec 14 18:30:30 2014 (r275777) @@ -846,9 +846,11 @@ varisset(const char *name, int nulok) } } else if (is_digit(*name)) { char *ap; - int num = atoi(name); + long num; - if (num > shellparam.nparam) + errno = 0; + num = strtol(name, NULL, 10); + if (errno != 0 || num > shellparam.nparam) return 0; if (num == 0) Modified: stable/10/bin/sh/tests/parameters/Makefile ============================================================================== --- stable/10/bin/sh/tests/parameters/Makefile Sun Dec 14 18:28:01 2014 (r275776) +++ stable/10/bin/sh/tests/parameters/Makefile Sun Dec 14 18:30:30 2014 (r275777) @@ -13,6 +13,7 @@ FILES+= optind1.0 FILES+= optind2.0 FILES+= positional1.0 FILES+= positional2.0 +FILES+= positional5.0 FILES+= pwd1.0 FILES+= pwd2.0 Copied: stable/10/bin/sh/tests/parameters/positional5.0 (from r268576, head/bin/sh/tests/parameters/positional5.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/bin/sh/tests/parameters/positional5.0 Sun Dec 14 18:30:30 2014 (r275777, copy of r268576, head/bin/sh/tests/parameters/positional5.0) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +i=1 +r=0 +while [ $i -lt $((0x100000000)) ]; do + t= + eval t=\${$i-x} + case $t in + x) ;; + *) echo "Problem with \${$i}" >&2; r=1 ;; + esac + i=$((i + 0x10000000)) +done +exit $r From owner-svn-src-stable@FreeBSD.ORG Sun Dec 14 18:51:14 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 516FAF64; Sun, 14 Dec 2014 18:51: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 3D4F6FD8; Sun, 14 Dec 2014 18:51: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 sBEIpEU4038079; Sun, 14 Dec 2014 18:51:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBEIpEkG038078; Sun, 14 Dec 2014 18:51:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412141851.sBEIpEkG038078@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 14 Dec 2014 18:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275778 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2014 18:51:14 -0000 Author: andrew Date: Sun Dec 14 18:51:13 2014 New Revision: 275778 URL: https://svnweb.freebsd.org/changeset/base/275778 Log: MFC 275379: Set the correct architecture when targeting ARMv7 Sponsored by: ABT Systems Ltd Modified: stable/10/share/mk/bsd.cpu.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.cpu.mk ============================================================================== --- stable/10/share/mk/bsd.cpu.mk Sun Dec 14 18:30:30 2014 (r275777) +++ stable/10/share/mk/bsd.cpu.mk Sun Dec 14 18:51:13 2014 (r275778) @@ -101,7 +101,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ . elif ${CPUTYPE} == "armv6" _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 . elif ${CPUTYPE} == "cortexa" -_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp +_CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp . else _CPUCFLAGS = -mcpu=${CPUTYPE} . endif From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 08:26:38 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00C7E956; Mon, 15 Dec 2014 08:26:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E007F8AA; Mon, 15 Dec 2014 08:26:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBF8QbrW033386; Mon, 15 Dec 2014 08:26:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF8Qbte033385; Mon, 15 Dec 2014 08:26:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150826.sBF8Qbte033385@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 08:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275785 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:26:38 -0000 Author: hselasky Date: Mon Dec 15 08:26:36 2014 New Revision: 275785 URL: https://svnweb.freebsd.org/changeset/base/275785 Log: MFC r275624: Add port routing support for Wildcat Point. PR: 195793 Modified: stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:02:22 2014 (r275784) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:26:36 2014 (r275785) @@ -249,6 +249,7 @@ xhci_pci_attach(device_t self) case 0x9c318086: /* Panther Point */ case 0x1e318086: /* Panther Point */ case 0x8c318086: /* Lynx Point */ + case 0x8cb18086: /* Wildcat Point */ sc->sc_port_route = &xhci_pci_port_route; sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; break; From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 08:28:01 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1008AC6; Mon, 15 Dec 2014 08:28: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 AC6798BD; Mon, 15 Dec 2014 08:28: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 sBF8S1dh033681; Mon, 15 Dec 2014 08:28:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF8S1Bc033679; Mon, 15 Dec 2014 08:28:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150828.sBF8S1Bc033679@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 08:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275786 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:28:01 -0000 Author: hselasky Date: Mon Dec 15 08:28:00 2014 New Revision: 275786 URL: https://svnweb.freebsd.org/changeset/base/275786 Log: MFC r275624: Add port routing support for Wildcat Point. PR: 195793 Modified: stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:26:36 2014 (r275785) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:28:00 2014 (r275786) @@ -233,6 +233,7 @@ xhci_pci_attach(device_t self) case 0x9c318086: /* Panther Point */ case 0x1e318086: /* Panther Point */ case 0x8c318086: /* Lynx Point */ + case 0x8cb18086: /* Wildcat Point */ sc->sc_port_route = &xhci_pci_port_route; sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; break; From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 08:31:59 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B75ABC6F; Mon, 15 Dec 2014 08:31: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 A2D02976; Mon, 15 Dec 2014 08:31: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 sBF8VxTr037829; Mon, 15 Dec 2014 08:31:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF8VxEx037828; Mon, 15 Dec 2014 08:31:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150831.sBF8VxEx037828@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 08:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r275787 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:31:59 -0000 Author: hselasky Date: Mon Dec 15 08:31:58 2014 New Revision: 275787 URL: https://svnweb.freebsd.org/changeset/base/275787 Log: MFC r275624: Add port routing support for Wildcat Point. PR: 195793 Modified: stable/8/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:28:00 2014 (r275786) +++ stable/8/sys/dev/usb/controller/xhci_pci.c Mon Dec 15 08:31:58 2014 (r275787) @@ -231,6 +231,7 @@ xhci_pci_attach(device_t self) case 0x9c318086: /* Panther Point */ case 0x1e318086: /* Panther Point */ case 0x8c318086: /* Lynx Point */ + case 0x8cb18086: /* Wildcat Point */ sc->sc_port_route = &xhci_pci_port_route; sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; break; From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 08:33:55 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75FAEDDF; Mon, 15 Dec 2014 08:33: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 474ED989; Mon, 15 Dec 2014 08:33: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 sBF8Xt4f038189; Mon, 15 Dec 2014 08:33:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF8XsWN038185; Mon, 15 Dec 2014 08:33:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150833.sBF8XsWN038185@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 08:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275788 - in stable/9/sys/dev/usb: . serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:33:55 -0000 Author: hselasky Date: Mon Dec 15 08:33:53 2014 New Revision: 275788 URL: https://svnweb.freebsd.org/changeset/base/275788 Log: MFC r275606: Add more U3G USB IDs. Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Mon Dec 15 08:31:58 2014 (r275787) +++ stable/9/sys/dev/usb/serial/u3g.c Mon Dec 15 08:33:53 2014 (r275788) @@ -400,7 +400,11 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMM2, GOBI2000_QDL, 0), U3G_DEV(QUALCOMM2, GOBI2000, 0), + U3G_DEV(QUALCOMM2, VT80N, 0), + U3G_DEV(QUALCOMM3, VFAST2, 0), U3G_DEV(QUALCOMMINC, AC2726, 0), + U3G_DEV(QUALCOMMINC, AC682_INIT, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMMINC, AC682, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), U3G_DEV(QUALCOMMINC, AC8710, 0), U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GINIT_SCSIEJECT), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Dec 15 08:31:58 2014 (r275787) +++ stable/9/sys/dev/usb/usbdevs Mon Dec 15 08:33:53 2014 (r275788) @@ -695,6 +695,7 @@ vendor QCOM 0x18e8 Qcom vendor ELV 0x18ef ELV vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated +vendor QUALCOMM3 0x19f5 Qualcomm, Inc. vendor BAYER 0x1a79 Bayer vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless @@ -3572,6 +3573,8 @@ product QUALCOMM2 VW110L 0x1000 Vertex W product QUALCOMM2 SIM5218 0x9000 SIM5218 product QUALCOMM2 GOBI2000_QDL 0x9204 Qualcomm Gobi 2000 QDL product QUALCOMM2 GOBI2000 0x9205 Qualcomm Gobi 2000 modem +product QUALCOMM2 VT80N 0x6500 Venus VT80N +product QUALCOMM3 VFAST2 0x9909 Venus Fast2 modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem @@ -3646,6 +3649,8 @@ product QUALCOMMINC MF195E 0x1516 MF195E product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem +product QUALCOMMINC AC682 0xffdd CDMA 1xEVDO USB modem +product QUALCOMMINC AC682_INIT 0xffde CDMA 1xEVDO USB modem (initial) product QUALCOMMINC AC8710 0xfff1 3G modem product QUALCOMMINC AC2726 0xfff5 3G modem product QUALCOMMINC AC8700 0xfffe CDMA 1xEVDO USB modem From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 08:35:09 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21350FAF; Mon, 15 Dec 2014 08:35:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E67F899F; Mon, 15 Dec 2014 08:35: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 sBF8Z8lb038466; Mon, 15 Dec 2014 08:35:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBF8Z8El038463; Mon, 15 Dec 2014 08:35:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412150835.sBF8Z8El038463@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Dec 2014 08:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275789 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 08:35:09 -0000 Author: hselasky Date: Mon Dec 15 08:35:07 2014 New Revision: 275789 URL: https://svnweb.freebsd.org/changeset/base/275789 Log: MFC r275606: Add more U3G USB IDs. Modified: stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Mon Dec 15 08:33:53 2014 (r275788) +++ stable/10/sys/dev/usb/serial/u3g.c Mon Dec 15 08:35:07 2014 (r275789) @@ -399,7 +399,11 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMM2, GOBI2000_QDL, 0), U3G_DEV(QUALCOMM2, GOBI2000, 0), + U3G_DEV(QUALCOMM2, VT80N, 0), + U3G_DEV(QUALCOMM3, VFAST2, 0), U3G_DEV(QUALCOMMINC, AC2726, 0), + U3G_DEV(QUALCOMMINC, AC682_INIT, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMMINC, AC682, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), U3G_DEV(QUALCOMMINC, AC8710, 0), U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GINIT_SCSIEJECT), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Mon Dec 15 08:33:53 2014 (r275788) +++ stable/10/sys/dev/usb/usbdevs Mon Dec 15 08:35:07 2014 (r275789) @@ -695,6 +695,7 @@ vendor QCOM 0x18e8 Qcom vendor ELV 0x18ef ELV vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated +vendor QUALCOMM3 0x19f5 Qualcomm, Inc. vendor BAYER 0x1a79 Bayer vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless @@ -3572,6 +3573,8 @@ product QUALCOMM2 VW110L 0x1000 Vertex W product QUALCOMM2 SIM5218 0x9000 SIM5218 product QUALCOMM2 GOBI2000_QDL 0x9204 Qualcomm Gobi 2000 QDL product QUALCOMM2 GOBI2000 0x9205 Qualcomm Gobi 2000 modem +product QUALCOMM2 VT80N 0x6500 Venus VT80N +product QUALCOMM3 VFAST2 0x9909 Venus Fast2 modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem @@ -3646,6 +3649,8 @@ product QUALCOMMINC MF195E 0x1516 MF195E product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem +product QUALCOMMINC AC682 0xffdd CDMA 1xEVDO USB modem +product QUALCOMMINC AC682_INIT 0xffde CDMA 1xEVDO USB modem (initial) product QUALCOMMINC AC8710 0xfff1 3G modem product QUALCOMMINC AC2726 0xfff5 3G modem product QUALCOMMINC AC8700 0xfffe CDMA 1xEVDO USB modem From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 10:29:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69748B5C; Mon, 15 Dec 2014 10:29: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 3B3927F5; Mon, 15 Dec 2014 10:29: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 sBFAT3pL091730; Mon, 15 Dec 2014 10:29:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFAT3Ng091729; Mon, 15 Dec 2014 10:29:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151029.sBFAT3Ng091729@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 10:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275793 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 10:29:03 -0000 Author: kib Date: Mon Dec 15 10:29:02 2014 New Revision: 275793 URL: https://svnweb.freebsd.org/changeset/base/275793 Log: MFC r275615: When process is exiting, check for suspension regardless of multithreaded status of the process. Modified: stable/10/sys/kern/kern_exit.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_exit.c ============================================================================== --- stable/10/sys/kern/kern_exit.c Mon Dec 15 09:40:25 2014 (r275792) +++ stable/10/sys/kern/kern_exit.c Mon Dec 15 10:29:02 2014 (r275793) @@ -183,14 +183,15 @@ exit1(struct thread *td, int rv) * MUST abort all other threads before proceeding past here. */ PROC_LOCK(p); + /* + * First check if some other thread or external request got + * here before us. If so, act appropriately: exit or suspend. + * We must ensure that stop requests are handled before we set + * P_WEXIT. + */ + thread_suspend_check(0); while (p->p_flag & P_HADTHREADS) { /* - * First check if some other thread got here before us. - * If so, act appropriately: exit or suspend. - */ - thread_suspend_check(0); - - /* * Kill off the other threads. This requires * some co-operation from other parts of the kernel * so it may not be instantaneous. With this state set @@ -208,12 +209,18 @@ exit1(struct thread *td, int rv) * either be suspended there or exit. */ if (!thread_single(SINGLE_EXIT)) + /* + * All other activity in this process is now + * stopped. Threading support has been turned + * off. + */ break; - /* - * All other activity in this process is now stopped. - * Threading support has been turned off. + * Recheck for new stop or suspend requests which + * might appear while process lock was dropped in + * thread_single(). */ + thread_suspend_check(0); } KASSERT(p->p_numthreads == 1, ("exit1: proc %p exiting with %d threads", p, p->p_numthreads)); From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 10:46:09 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A69BFC3; Mon, 15 Dec 2014 10:46: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 756B69D4; Mon, 15 Dec 2014 10:46: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 sBFAk9Pn001116; Mon, 15 Dec 2014 10:46:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFAk8dr001107; Mon, 15 Dec 2014 10:46:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151046.sBFAk8dr001107@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 10:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275794 - in stable/10/sys: kern powerpc/aim powerpc/booke sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 10:46:09 -0000 Author: kib Date: Mon Dec 15 10:46:07 2014 New Revision: 275794 URL: https://svnweb.freebsd.org/changeset/base/275794 Log: MFC r275616: Thread waiting for the vfork(2)-ed child to exec or exit, must allow for the suspension. MFC r275683 (by andreast): Fix build for powerpc(32|64) kernels. MFC r275686 (by andreast): Fix kernel build for booke. r275639 (by andrew) is not merged, since arm/arm/syscall.c is not present on the stable/10 branch, and arm/arm/trap.c already includes sys/kernel.h. Modified: stable/10/sys/kern/kern_thread.c stable/10/sys/kern/subr_syscall.c stable/10/sys/powerpc/aim/trap.c stable/10/sys/powerpc/booke/trap.c stable/10/sys/sys/proc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_thread.c ============================================================================== --- stable/10/sys/kern/kern_thread.c Mon Dec 15 10:29:02 2014 (r275793) +++ stable/10/sys/kern/kern_thread.c Mon Dec 15 10:46:07 2014 (r275794) @@ -724,6 +724,19 @@ stopme: return (0); } +bool +thread_suspend_check_needed(void) +{ + struct proc *p; + struct thread *td; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + return (P_SHOULDSTOP(p) || ((p->p_flag & P_TRACED) != 0 && + (td->td_dbgflags & TDB_SUSPEND) != 0)); +} + /* * Called in from locations that can safely check to see * whether we have to suspend or at least throttle for a @@ -768,8 +781,7 @@ thread_suspend_check(int return_instead) p = td->td_proc; mtx_assert(&Giant, MA_NOTOWNED); PROC_LOCK_ASSERT(p, MA_OWNED); - while (P_SHOULDSTOP(p) || - ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND))) { + while (thread_suspend_check_needed()) { if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { KASSERT(p->p_singlethread != NULL, ("singlethread not set")); Modified: stable/10/sys/kern/subr_syscall.c ============================================================================== --- stable/10/sys/kern/subr_syscall.c Mon Dec 15 10:29:02 2014 (r275793) +++ stable/10/sys/kern/subr_syscall.c Mon Dec 15 10:46:07 2014 (r275794) @@ -227,9 +227,20 @@ syscallret(struct thread *td, int error, */ td->td_pflags &= ~TDP_RFPPWAIT; p2 = td->td_rfppwait_p; +again: PROC_LOCK(p2); - while (p2->p_flag & P_PPWAIT) - cv_wait(&p2->p_pwait, &p2->p_mtx); + while (p2->p_flag & P_PPWAIT) { + PROC_LOCK(p); + if (thread_suspend_check_needed()) { + PROC_UNLOCK(p2); + thread_suspend_check(0); + PROC_UNLOCK(p); + goto again; + } else { + PROC_UNLOCK(p); + } + cv_timedwait(&p2->p_pwait, &p2->p_mtx, hz); + } PROC_UNLOCK(p2); } } Modified: stable/10/sys/powerpc/aim/trap.c ============================================================================== --- stable/10/sys/powerpc/aim/trap.c Mon Dec 15 10:29:02 2014 (r275793) +++ stable/10/sys/powerpc/aim/trap.c Mon Dec 15 10:46:07 2014 (r275794) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/10/sys/powerpc/booke/trap.c ============================================================================== --- stable/10/sys/powerpc/booke/trap.c Mon Dec 15 10:29:02 2014 (r275793) +++ stable/10/sys/powerpc/booke/trap.c Mon Dec 15 10:46:07 2014 (r275794) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Mon Dec 15 10:29:02 2014 (r275793) +++ stable/10/sys/sys/proc.h Mon Dec 15 10:46:07 2014 (r275794) @@ -947,6 +947,7 @@ void childproc_stopped(struct proc *chil void childproc_continued(struct proc *child); void childproc_exited(struct proc *child); int thread_suspend_check(int how); +bool thread_suspend_check_needed(void); void thread_suspend_switch(struct thread *); void thread_suspend_one(struct thread *td); void thread_unlink(struct thread *td); From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 10:50:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D7BF1CA; Mon, 15 Dec 2014 10:50: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 099DB9FF; Mon, 15 Dec 2014 10:50: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 sBFAoRWb001876; Mon, 15 Dec 2014 10:50:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFAoR74001875; Mon, 15 Dec 2014 10:50:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151050.sBFAoR74001875@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 10:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275795 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 10:50:28 -0000 Author: kib Date: Mon Dec 15 10:50:26 2014 New Revision: 275795 URL: https://svnweb.freebsd.org/changeset/base/275795 Log: MFC r275617: Do some refactoring and minor cleanups of the thread_single() code. Modified: stable/10/sys/kern/kern_thread.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_thread.c ============================================================================== --- stable/10/sys/kern/kern_thread.c Mon Dec 15 10:46:07 2014 (r275794) +++ stable/10/sys/kern/kern_thread.c Mon Dec 15 10:50:26 2014 (r275795) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); SDT_PROVIDER_DECLARE(proc); SDT_PROBE_DEFINE(proc, , , lwp__exit); - /* * thread related storage. */ @@ -583,6 +582,46 @@ calc_remaining(struct proc *p, int mode) return (remaining); } +static int +remain_for_mode(int mode) +{ + + return (1); +} + +static int +weed_inhib(int mode, struct thread *td2, struct proc *p) +{ + int wakeup_swapper; + + PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); + THREAD_LOCK_ASSERT(td2, MA_OWNED); + + wakeup_swapper = 0; + switch (mode) { + case SINGLE_EXIT: + if (TD_IS_SUSPENDED(td2)) + wakeup_swapper |= thread_unsuspend_one(td2); + if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) + wakeup_swapper |= sleepq_abort(td2, EINTR); + break; + case SINGLE_BOUNDARY: + if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY) == 0) + wakeup_swapper |= thread_unsuspend_one(td2); + if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) + wakeup_swapper |= sleepq_abort(td2, ERESTART); + break; + case SINGLE_NO_EXIT: + if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY) == 0) + wakeup_swapper |= thread_unsuspend_one(td2); + if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) + wakeup_swapper |= sleepq_abort(td2, ERESTART); + break; + } + return (wakeup_swapper); +} + /* * Enforce single-threading. * @@ -630,7 +669,7 @@ thread_single(int mode) PROC_SLOCK(p); p->p_singlethread = td; remaining = calc_remaining(p, mode); - while (remaining != 1) { + while (remaining != remain_for_mode(mode)) { if (P_SHOULDSTOP(p) != P_STOPPED_SINGLE) goto stopme; wakeup_swapper = 0; @@ -639,41 +678,8 @@ thread_single(int mode) continue; thread_lock(td2); td2->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; - if (TD_IS_INHIBITED(td2)) { - switch (mode) { - case SINGLE_EXIT: - if (TD_IS_SUSPENDED(td2)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2) && - (td2->td_flags & TDF_SINTR)) - wakeup_swapper |= - sleepq_abort(td2, EINTR); - break; - case SINGLE_BOUNDARY: - if (TD_IS_SUSPENDED(td2) && - !(td2->td_flags & TDF_BOUNDARY)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2) && - (td2->td_flags & TDF_SINTR)) - wakeup_swapper |= - sleepq_abort(td2, ERESTART); - break; - case SINGLE_NO_EXIT: - if (TD_IS_SUSPENDED(td2) && - !(td2->td_flags & TDF_BOUNDARY)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2) && - (td2->td_flags & TDF_SINTR)) - wakeup_swapper |= - sleepq_abort(td2, ERESTART); - break; - default: - break; - } - } + if (TD_IS_INHIBITED(td2)) + wakeup_swapper |= weed_inhib(mode, td2, p); #ifdef SMP else if (TD_IS_RUNNING(td2) && td != td2) { forward_signal(td2); @@ -688,7 +694,7 @@ thread_single(int mode) /* * Maybe we suspended some threads.. was it enough? */ - if (remaining == 1) + if (remaining == remain_for_mode(mode)) break; stopme: @@ -967,8 +973,7 @@ thread_single_end(void) struct proc *p; int wakeup_swapper; - td = curthread; - p = td->td_proc; + p = curproc; PROC_LOCK_ASSERT(p, MA_OWNED); p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT | P_SINGLE_BOUNDARY); PROC_SLOCK(p); @@ -980,7 +985,8 @@ thread_single_end(void) * on the process. The single threader must be allowed * to continue however as this is a bad place to stop. */ - if ((p->p_numthreads != 1) && (!P_SHOULDSTOP(p))) { + if (p->p_numthreads != remain_for_mode(SINGLE_EXIT) && + !P_SHOULDSTOP(p)) { FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); if (TD_IS_SUSPENDED(td)) { From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 10:58:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FE213E6; Mon, 15 Dec 2014 10:58: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 6C024ADD; Mon, 15 Dec 2014 10:58: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 sBFAw34T006282; Mon, 15 Dec 2014 10:58:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFAw3rY006281; Mon, 15 Dec 2014 10:58:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151058.sBFAw3rY006281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 10:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275796 - stable/10/sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 10:58:03 -0000 Author: kib Date: Mon Dec 15 10:58:02 2014 New Revision: 275796 URL: https://svnweb.freebsd.org/changeset/base/275796 Log: MFC r275618: Check for stop condition in nfsd threads. Modified: stable/10/sys/rpc/svc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc.c ============================================================================== --- stable/10/sys/rpc/svc.c Mon Dec 15 10:50:26 2014 (r275795) +++ stable/10/sys/rpc/svc.c Mon Dec 15 10:58:02 2014 (r275796) @@ -1101,6 +1101,7 @@ svc_run_internal(SVCGROUP *grp, bool_t i SVCXPRT *xprt; enum xprt_stat stat; struct svc_req *rqstp; + struct proc *p; size_t sz; int error; @@ -1183,11 +1184,22 @@ svc_run_internal(SVCGROUP *grp, bool_t i > grp->sg_minthreads) && !st->st_xprt) break; - } else if (error) { + } else if (error != 0) { + KASSERT(error == EINTR || error == ERESTART, + ("non-signal error %d", error)); mtx_unlock(&grp->sg_lock); - svc_exit(pool); - mtx_lock(&grp->sg_lock); - break; + p = curproc; + PROC_LOCK(p); + if (P_SHOULDSTOP(p)) { + thread_suspend_check(0); + PROC_UNLOCK(p); + mtx_lock(&grp->sg_lock); + } else { + PROC_UNLOCK(p); + svc_exit(pool); + mtx_lock(&grp->sg_lock); + break; + } } continue; } From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 11:00:57 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 577DA557; Mon, 15 Dec 2014 11:00: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 438DAAFD; Mon, 15 Dec 2014 11:00: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 sBFB0v4C006870; Mon, 15 Dec 2014 11:00:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFB0vA3006869; Mon, 15 Dec 2014 11:00:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151100.sBFB0vA3006869@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 11:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275797 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 11:00:57 -0000 Author: kib Date: Mon Dec 15 11:00:56 2014 New Revision: 275797 URL: https://svnweb.freebsd.org/changeset/base/275797 Log: MFC r275619: Check for bo_bufobj->bo_object for NULL and cache the value in local variable to avoid NULL dereference in getnewbuf_reuse_bp(). The vnode owning the buffer is not locked there. Modified: stable/10/sys/kern/vfs_bio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_bio.c ============================================================================== --- stable/10/sys/kern/vfs_bio.c Mon Dec 15 10:58:02 2014 (r275796) +++ stable/10/sys/kern/vfs_bio.c Mon Dec 15 11:00:56 2014 (r275797) @@ -1852,15 +1852,18 @@ out: static void vfs_vmio_release(struct buf *bp) { - int i; + vm_object_t obj; vm_page_t m; + int i; if ((bp->b_flags & B_UNMAPPED) == 0) { BUF_CHECK_MAPPED(bp); pmap_qremove(trunc_page((vm_offset_t)bp->b_data), bp->b_npages); } else BUF_CHECK_UNMAPPED(bp); - VM_OBJECT_WLOCK(bp->b_bufobj->bo_object); + obj = bp->b_bufobj->bo_object; + if (obj != NULL) + VM_OBJECT_WLOCK(obj); for (i = 0; i < bp->b_npages; i++) { m = bp->b_pages[i]; bp->b_pages[i] = NULL; @@ -1885,7 +1888,8 @@ vfs_vmio_release(struct buf *bp) vm_page_try_to_cache(m); vm_page_unlock(m); } - VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object); + if (obj != NULL) + VM_OBJECT_WUNLOCK(obj); if (bp->b_bufsize) { bufspacewakeup(); From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 11:05:54 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E15CB6D2; Mon, 15 Dec 2014 11: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 B3916BB7; Mon, 15 Dec 2014 11: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 sBFB5sHi010960; Mon, 15 Dec 2014 11:05:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFB5sXX010958; Mon, 15 Dec 2014 11:05:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151105.sBFB5sXX010958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 11:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275798 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 11:05:55 -0000 Author: kib Date: Mon Dec 15 11:05:53 2014 New Revision: 275798 URL: https://svnweb.freebsd.org/changeset/base/275798 Log: MFC r275620: Add functions syncer_suspend() and syncer_resume(). MFC r275637: Remove local variable for real. Modified: stable/10/sys/kern/vfs_subr.c stable/10/sys/sys/mount.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon Dec 15 11:00:56 2014 (r275797) +++ stable/10/sys/kern/vfs_subr.c Mon Dec 15 11:05:53 2014 (r275798) @@ -1773,6 +1773,8 @@ sync_vnode(struct synclist *slp, struct return (0); } +static int first_printf = 1; + /* * System filesystem synchronizer daemon. */ @@ -1786,12 +1788,10 @@ sched_sync(void) int last_work_seen; int net_worklist_len; int syncer_final_iter; - int first_printf; int error; last_work_seen = 0; syncer_final_iter = 0; - first_printf = 1; syncer_state = SYNCER_RUNNING; starttime = time_uptime; td->td_pflags |= TDP_NORUNNINGBUF; @@ -1948,6 +1948,25 @@ syncer_shutdown(void *arg, int howto) kproc_shutdown(arg, howto); } +void +syncer_suspend(void) +{ + + syncer_shutdown(updateproc, 0); +} + +void +syncer_resume(void) +{ + + mtx_lock(&sync_mtx); + first_printf = 1; + syncer_state = SYNCER_RUNNING; + mtx_unlock(&sync_mtx); + cv_broadcast(&sync_wakeup); + kproc_resume(updateproc); +} + /* * Reassign a buffer from one vnode to another. * Used to assign file specific control information Modified: stable/10/sys/sys/mount.h ============================================================================== --- stable/10/sys/sys/mount.h Mon Dec 15 11:00:56 2014 (r275797) +++ stable/10/sys/sys/mount.h Mon Dec 15 11:05:53 2014 (r275798) @@ -919,6 +919,9 @@ vfs_uninit_t vfs_stduninit; vfs_extattrctl_t vfs_stdextattrctl; vfs_sysctl_t vfs_stdsysctl; +void syncer_suspend(void); +void syncer_resume(void); + #else /* !_KERNEL */ #include From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 16:14:50 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDFDD2BA; Mon, 15 Dec 2014 16:14: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 9F1D818A; Mon, 15 Dec 2014 16:14: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 sBFGEols063239; Mon, 15 Dec 2014 16:14:50 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFGEo1q063237; Mon, 15 Dec 2014 16:14:50 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201412151614.sBFGEo1q063237@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 15 Dec 2014 16:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275807 - in stable/10: . sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 16:14:50 -0000 Author: sbruno Date: Mon Dec 15 16:14:49 2014 New Revision: 275807 URL: https://svnweb.freebsd.org/changeset/base/275807 Log: MFC r271982 and r271990 to support CentOS 6 ports. Modified: stable/10/UPDATING stable/10/sys/compat/linux/linux_mib.c Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Mon Dec 15 14:58:10 2014 (r275806) +++ stable/10/UPDATING Mon Dec 15 16:14:49 2014 (r275807) @@ -16,6 +16,16 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20141215: + At svn r271982, The default linux compat kernel ABI has been adjusted + to 2.6.18 in support of the linux-c6 compat ports infrastructure + update. If you wish to continue using the linux-f10 compat ports, + add compat.linux.osrelease=2.6.16 to your local sysctl.conf. Users are + encouraged to update their linux-compat packages to linux-c6 during + their next update cycle. + + See ports/UPDATING 20141202 on migration to CentOS 6 ports. + 20141205: pjdfstest has been integrated into kyua as an opt-in test suite. Please see share/doc/pjdfstest/README for a more details on how to Modified: stable/10/sys/compat/linux/linux_mib.c ============================================================================== --- stable/10/sys/compat/linux/linux_mib.c Mon Dec 15 14:58:10 2014 (r275806) +++ stable/10/sys/compat/linux/linux_mib.c Mon Dec 15 16:14:49 2014 (r275807) @@ -130,9 +130,9 @@ struct linux_prison { static struct linux_prison lprison0 = { .pr_osname = "Linux", - .pr_osrelease = "2.6.16", + .pr_osrelease = "2.6.18", .pr_oss_version = 0x030600, - .pr_osrel = 2006016 + .pr_osrel = 2006018 }; static unsigned linux_osd_jail_slot; From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 18:13:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFB64FE6; Mon, 15 Dec 2014 18:13:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B0CB1E2; Mon, 15 Dec 2014 18:13:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFID4G8022059; Mon, 15 Dec 2014 18:13:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFID4g8022058; Mon, 15 Dec 2014 18:13:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412151813.sBFID4g8022058@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Dec 2014 18:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275809 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 18:13:04 -0000 Author: andrew Date: Mon Dec 15 18:13:03 2014 New Revision: 275809 URL: https://svnweb.freebsd.org/changeset/base/275809 Log: Revert r275778, gcc 4.2.1 doesn't handle -march=armv7. Modified: stable/10/share/mk/bsd.cpu.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.cpu.mk ============================================================================== --- stable/10/share/mk/bsd.cpu.mk Mon Dec 15 17:52:08 2014 (r275808) +++ stable/10/share/mk/bsd.cpu.mk Mon Dec 15 18:13:03 2014 (r275809) @@ -101,7 +101,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ . elif ${CPUTYPE} == "armv6" _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 . elif ${CPUTYPE} == "cortexa" -_CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp +_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp . else _CPUCFLAGS = -mcpu=${CPUTYPE} . endif From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 21:22:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 541B9BC1; Mon, 15 Dec 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 3FED1C71; Mon, 15 Dec 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 sBFLMh98016162; Mon, 15 Dec 2014 21:22:43 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFLMh9b016161; Mon, 15 Dec 2014 21:22:43 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201412152122.sBFLMh9b016161@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 15 Dec 2014 21:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275814 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 21:22:43 -0000 Author: sbruno Date: Mon Dec 15 21:22:42 2014 New Revision: 275814 URL: https://svnweb.freebsd.org/changeset/base/275814 Log: Correct to the stable/10 commit in UPDATING and specify the correct ports/UPDATING note. Modified: stable/10/UPDATING Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Mon Dec 15 20:48:06 2014 (r275813) +++ stable/10/UPDATING Mon Dec 15 21:22:42 2014 (r275814) @@ -17,14 +17,14 @@ stable/10, and then rebuild without this older version of current is a bit fragile. 20141215: - At svn r271982, The default linux compat kernel ABI has been adjusted + At svn r275807, The default linux compat kernel ABI has been adjusted to 2.6.18 in support of the linux-c6 compat ports infrastructure update. If you wish to continue using the linux-f10 compat ports, add compat.linux.osrelease=2.6.16 to your local sysctl.conf. Users are encouraged to update their linux-compat packages to linux-c6 during their next update cycle. - See ports/UPDATING 20141202 on migration to CentOS 6 ports. + See ports/UPDATING 20141209 and 20141215 on migration to CentOS 6 ports. 20141205: pjdfstest has been integrated into kyua as an opt-in test suite. From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 11:24:09 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F16EFA5B; Tue, 16 Dec 2014 11:24: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 DD75C11B1; Tue, 16 Dec 2014 11:24: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 sBGBO8W2024825; Tue, 16 Dec 2014 11:24:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBO8fJ024824; Tue, 16 Dec 2014 11:24:08 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161124.sBGBO8fJ024824@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275822 - stable/10/sys/netipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:24:09 -0000 Author: ae Date: Tue Dec 16 11:24:07 2014 New Revision: 275822 URL: https://svnweb.freebsd.org/changeset/base/275822 Log: MFC r275575: key_getspacq() returns holding the spacq_lock. Unlock it in all cases. Sponsored by: Yandex LLC Modified: stable/10/sys/netipsec/key.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/key.c ============================================================================== --- stable/10/sys/netipsec/key.c Tue Dec 16 09:49:07 2014 (r275821) +++ stable/10/sys/netipsec/key.c Tue Dec 16 11:24:07 2014 (r275822) @@ -2336,7 +2336,8 @@ key_spdacquire(sp) } else { /* increment counter and do nothing. */ newspacq->count++; - return 0; + SPACQ_UNLOCK(); + return (0); } SPACQ_UNLOCK(); } else { From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 11:30:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 881651286; Tue, 16 Dec 2014 11:30: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 73E5F124E; Tue, 16 Dec 2014 11:30: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 sBGBUUA4026188; Tue, 16 Dec 2014 11:30:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBUUsJ026187; Tue, 16 Dec 2014 11:30:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161130.sBGBUUsJ026187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275824 - stable/9/sys/netipsec X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:30:30 -0000 Author: ae Date: Tue Dec 16 11:30:29 2014 New Revision: 275824 URL: https://svnweb.freebsd.org/changeset/base/275824 Log: MFC r275575: key_getspacq() returns holding the spacq_lock. Unlock it in all cases. Sponsored by: Yandex LLC Modified: stable/9/sys/netipsec/key.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/key.c ============================================================================== --- stable/9/sys/netipsec/key.c Tue Dec 16 11:25:12 2014 (r275823) +++ stable/9/sys/netipsec/key.c Tue Dec 16 11:30:29 2014 (r275824) @@ -2328,7 +2328,8 @@ key_spdacquire(sp) } else { /* increment counter and do nothing. */ newspacq->count++; - return 0; + SPACQ_UNLOCK(); + return (0); } SPACQ_UNLOCK(); } else { From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 11:45:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D323247; Tue, 16 Dec 2014 11:45: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 18C0F159A; Tue, 16 Dec 2014 11:45: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 sBGBjXk1035609; Tue, 16 Dec 2014 11:45:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBjXxe035608; Tue, 16 Dec 2014 11:45:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161145.sBGBjXxe035608@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275825 - stable/10/sys/netipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:45:34 -0000 Author: ae Date: Tue Dec 16 11:45:33 2014 New Revision: 275825 URL: https://svnweb.freebsd.org/changeset/base/275825 Log: MFC r275393: Remove unneded check. No need to do m_pullup to the size that we prepended. MFC r275473: Fix style(9) and remove m_freem(NULL). Add XXX comment, it looks incorrect, because m_pkthdr.len is already incremented by M_PREPEND(). Sponsored by: Yandex LLC Modified: stable/10/sys/netipsec/keysock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/keysock.c ============================================================================== --- stable/10/sys/netipsec/keysock.c Tue Dec 16 11:30:29 2014 (r275824) +++ stable/10/sys/netipsec/keysock.c Tue Dec 16 11:45:33 2014 (r275825) @@ -149,14 +149,11 @@ key_sendup0(rp, m, promisc) struct sadb_msg *pmsg; M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT); - if (m && m->m_len < sizeof(struct sadb_msg)) - m = m_pullup(m, sizeof(struct sadb_msg)); - if (!m) { + if (m == NULL) { PFKEYSTAT_INC(in_nomem); - m_freem(m); - return ENOBUFS; + return (ENOBUFS); } - m->m_pkthdr.len += sizeof(*pmsg); + m->m_pkthdr.len += sizeof(*pmsg); /* XXX: is this correct? */ pmsg = mtod(m, struct sadb_msg *); bzero(pmsg, sizeof(*pmsg)); From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 11:49:36 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9031242A; Tue, 16 Dec 2014 11:49: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 7BFD915E4; Tue, 16 Dec 2014 11:49: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 sBGBnaBi036196; Tue, 16 Dec 2014 11:49:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBna9r036195; Tue, 16 Dec 2014 11:49:36 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161149.sBGBna9r036195@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275826 - stable/9/sys/netipsec X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:49:36 -0000 Author: ae Date: Tue Dec 16 11:49:35 2014 New Revision: 275826 URL: https://svnweb.freebsd.org/changeset/base/275826 Log: MFC r275393: Remove unneded check. No need to do m_pullup to the size that we prepended. MFC r275473: Fix style(9) and remove m_freem(NULL). Add XXX comment, it looks incorrect, because m_pkthdr.len is already incremented by M_PREPEND(). Sponsored by: Yandex LLC Modified: stable/9/sys/netipsec/keysock.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/keysock.c ============================================================================== --- stable/9/sys/netipsec/keysock.c Tue Dec 16 11:45:33 2014 (r275825) +++ stable/9/sys/netipsec/keysock.c Tue Dec 16 11:49:35 2014 (r275826) @@ -144,14 +144,11 @@ key_sendup0(rp, m, promisc) struct sadb_msg *pmsg; M_PREPEND(m, sizeof(struct sadb_msg), M_DONTWAIT); - if (m && m->m_len < sizeof(struct sadb_msg)) - m = m_pullup(m, sizeof(struct sadb_msg)); - if (!m) { + if (m == NULL) { PFKEYSTAT_INC(in_nomem); - m_freem(m); - return ENOBUFS; + return (ENOBUFS); } - m->m_pkthdr.len += sizeof(*pmsg); + m->m_pkthdr.len += sizeof(*pmsg); /* XXX: is this correct? */ pmsg = mtod(m, struct sadb_msg *); bzero(pmsg, sizeof(*pmsg)); From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 11:52:17 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82FDD5A4; Tue, 16 Dec 2014 11:52:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EFCF169C; Tue, 16 Dec 2014 11:52:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGBqHSr040034; Tue, 16 Dec 2014 11:52:17 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBqH6O040031; Tue, 16 Dec 2014 11:52:17 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161152.sBGBqH6O040031@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275827 - in stable/9/sys: net netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:52:17 -0000 Author: ae Date: Tue Dec 16 11:52:15 2014 New Revision: 275827 URL: https://svnweb.freebsd.org/changeset/base/275827 Log: MFC r275394: Remove unneded check. No need to do m_pullup to the size that we prepended. Sponsored by: Yandex LLC Modified: stable/9/sys/net/if_stf.c stable/9/sys/netinet6/icmp6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if_stf.c ============================================================================== --- stable/9/sys/net/if_stf.c Tue Dec 16 11:49:35 2014 (r275826) +++ stable/9/sys/net/if_stf.c Tue Dec 16 11:52:15 2014 (r275827) @@ -511,8 +511,6 @@ stf_output(ifp, m, dst, ro) } M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); - if (m && m->m_len < sizeof(struct ip)) - m = m_pullup(m, sizeof(struct ip)); if (m == NULL) { ifa_free(&ia6->ia_ifa); ifp->if_oerrors++; Modified: stable/9/sys/netinet6/icmp6.c ============================================================================== --- stable/9/sys/netinet6/icmp6.c Tue Dec 16 11:49:35 2014 (r275826) +++ stable/9/sys/netinet6/icmp6.c Tue Dec 16 11:52:15 2014 (r275827) @@ -361,8 +361,6 @@ icmp6_error(struct mbuf *m, int type, in preplen = sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr); M_PREPEND(m, preplen, M_DONTWAIT); /* FIB is also copied over. */ - if (m && m->m_len < preplen) - m = m_pullup(m, preplen); if (m == NULL) { nd6log((LOG_DEBUG, "ENOBUFS in icmp6_error %d\n", __LINE__)); return; From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 11:53:47 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E4946EE; Tue, 16 Dec 2014 11:53: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 57E6116AC; Tue, 16 Dec 2014 11:53: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 sBGBrlkW040279; Tue, 16 Dec 2014 11:53:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGBrkTW040277; Tue, 16 Dec 2014 11:53:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412161153.sBGBrkTW040277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 16 Dec 2014 11:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275828 - in stable/10/sys: net netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 11:53:47 -0000 Author: ae Date: Tue Dec 16 11:53:45 2014 New Revision: 275828 URL: https://svnweb.freebsd.org/changeset/base/275828 Log: MFC r275394: Remove unneded check. No need to do m_pullup to the size that we prepended. Sponsored by: Yandex LLC Modified: stable/10/sys/net/if_stf.c stable/10/sys/netinet6/icmp6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_stf.c ============================================================================== --- stable/10/sys/net/if_stf.c Tue Dec 16 11:52:15 2014 (r275827) +++ stable/10/sys/net/if_stf.c Tue Dec 16 11:53:45 2014 (r275828) @@ -499,8 +499,6 @@ stf_output(struct ifnet *ifp, struct mbu } M_PREPEND(m, sizeof(struct ip), M_NOWAIT); - if (m && m->m_len < sizeof(struct ip)) - m = m_pullup(m, sizeof(struct ip)); if (m == NULL) { ifa_free(&ia6->ia_ifa); ifp->if_oerrors++; Modified: stable/10/sys/netinet6/icmp6.c ============================================================================== --- stable/10/sys/netinet6/icmp6.c Tue Dec 16 11:52:15 2014 (r275827) +++ stable/10/sys/netinet6/icmp6.c Tue Dec 16 11:53:45 2014 (r275828) @@ -366,8 +366,6 @@ icmp6_error(struct mbuf *m, int type, in preplen = sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr); M_PREPEND(m, preplen, M_NOWAIT); /* FIB is also copied over. */ - if (m && m->m_len < preplen) - m = m_pullup(m, preplen); if (m == NULL) { nd6log((LOG_DEBUG, "ENOBUFS in icmp6_error %d\n", __LINE__)); return; From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 18:45:32 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE15A10C; Tue, 16 Dec 2014 18: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 7F41BADC; Tue, 16 Dec 2014 18: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 sBGIjWnF039999; Tue, 16 Dec 2014 18:45:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGIjWX6039998; Tue, 16 Dec 2014 18:45:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412161845.sBGIjWX6039998@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Dec 2014 18:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275834 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 18:45:32 -0000 Author: pfg Date: Tue Dec 16 18:45:31 2014 New Revision: 275834 URL: https://svnweb.freebsd.org/changeset/base/275834 Log: MFC r275645; ext2fs: Fix old out-of-bounds access. Overrunning buffer pointed to by (caddr_t)&oip->i_db[0] of 48 bytes by passing it to a function which accesses it at byte offset 59 using argument 60UL. The issue was inherited from an older FFS implementation and fixed there with by merging UFS2 in r98542. We follow the FFS fix. CID: 1007665 Discussed with: bde Modified: stable/10/sys/fs/ext2fs/ext2_inode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_inode.c Tue Dec 16 18:28:33 2014 (r275833) +++ stable/10/sys/fs/ext2fs/ext2_inode.c Tue Dec 16 18:45:31 2014 (r275834) @@ -224,14 +224,18 @@ ext2_truncate(struct vnode *vp, off_t le * will be returned to the free list. lastiblock values are also * normalized to -1 for calls to ext2_indirtrunc below. */ - bcopy((caddr_t)&oip->i_db[0], (caddr_t)oldblks, sizeof(oldblks)); - for (level = TRIPLE; level >= SINGLE; level--) + for (level = TRIPLE; level >= SINGLE; level--) { + oldblks[NDADDR + level] = oip->i_ib[level]; if (lastiblock[level] < 0) { oip->i_ib[level] = 0; lastiblock[level] = -1; } - for (i = NDADDR - 1; i > lastblock; i--) - oip->i_db[i] = 0; + } + for (i = 0; i < NDADDR; i++) { + oldblks[i] = oip->i_db[i]; + if (i > lastblock) + oip->i_db[i] = 0; + } oip->i_flag |= IN_CHANGE | IN_UPDATE; allerror = ext2_update(ovp, !DOINGASYNC(ovp)); @@ -241,8 +245,14 @@ ext2_truncate(struct vnode *vp, off_t le * Note that we save the new block configuration so we can check it * when we are done. */ - bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof(newblks)); - bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof(oldblks)); + for (i = 0; i < NDADDR; i++) { + newblks[i] = oip->i_db[i]; + oip->i_db[i] = oldblks[i]; + } + for (i = 0; i < NIADDR; i++) { + newblks[NDADDR + i] = oip->i_ib[i]; + oip->i_ib[i] = oldblks[NDADDR + i]; + } oip->i_size = osize; error = vtruncbuf(ovp, cred, length, (int)fs->e2fs_bsize); if (error && (allerror == 0)) From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 19:45:57 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C8E54DC; Tue, 16 Dec 2014 19:45: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 4CEE81CD; Tue, 16 Dec 2014 19:45: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 sBGJjvTd069479; Tue, 16 Dec 2014 19:45:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGJjv7n069478; Tue, 16 Dec 2014 19:45:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412161945.sBGJjv7n069478@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Dec 2014 19:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275836 - in stable: 10/sys/dev/e1000 9/sys/dev/e1000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 19:45:57 -0000 Author: jhb Date: Tue Dec 16 19:45:56 2014 New Revision: 275836 URL: https://svnweb.freebsd.org/changeset/base/275836 Log: MFC 272897: Various fixes to stats: - Read the counts of received, dropped, and transmitted management packets and add sysctl nodes for them. - Fix the total octets received/transmitted to read all 64 bits of the counters. - Add missing sysctl nodes for rlec, tncrs, fcruc, tor, and tot. - Remove spurious spaces. Modified: stable/10/sys/dev/e1000/if_igb.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/e1000/if_igb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Tue Dec 16 18:57:42 2014 (r275835) +++ stable/10/sys/dev/e1000/if_igb.c Tue Dec 16 19:45:56 2014 (r275836) @@ -5422,8 +5422,14 @@ igb_update_stats_counters(struct adapter stats->roc += E1000_READ_REG(hw, E1000_ROC); stats->rjc += E1000_READ_REG(hw, E1000_RJC); - stats->tor += E1000_READ_REG(hw, E1000_TORH); - stats->tot += E1000_READ_REG(hw, E1000_TOTH); + stats->mgprc += E1000_READ_REG(hw, E1000_MGTPRC); + stats->mgpdc += E1000_READ_REG(hw, E1000_MGTPDC); + stats->mgptc += E1000_READ_REG(hw, E1000_MGTPTC); + + stats->tor += E1000_READ_REG(hw, E1000_TORL) + + ((u64)E1000_READ_REG(hw, E1000_TORH) << 32); + stats->tot += E1000_READ_REG(hw, E1000_TOTL) + + ((u64)E1000_READ_REG(hw, E1000_TOTH) << 32); stats->tpr += E1000_READ_REG(hw, E1000_TPR); stats->tpt += E1000_READ_REG(hw, E1000_TPT); @@ -5750,6 +5756,9 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "missed_packets", CTLFLAG_RD, &stats->mpc, "Missed Packets"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_length_errors", + CTLFLAG_RD, &stats->rlec, + "Receive Length Errors"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_no_buff", CTLFLAG_RD, &stats->rnbc, "Receive No Buffers"); @@ -5758,7 +5767,7 @@ igb_add_hw_stats(struct adapter *adapter "Receive Undersize"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_fragmented", CTLFLAG_RD, &stats->rfc, - "Fragmented Packets Received "); + "Fragmented Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_oversize", CTLFLAG_RD, &stats->roc, "Oversized Packets Received"); @@ -5774,6 +5783,9 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "alignment_errs", CTLFLAG_RD, &stats->algnerrc, "Alignment Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_no_crs", + CTLFLAG_RD, &stats->tncrs, + "Transmit with No CRS"); /* On 82575 these are collision counts */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "coll_ext_errs", CTLFLAG_RD, &stats->cexterr, @@ -5790,10 +5802,22 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_txd", CTLFLAG_RD, &stats->xofftxc, "XOFF Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "unsupported_fc_recvd", + CTLFLAG_RD, &stats->fcruc, + "Unsupported Flow Control Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_recvd", + CTLFLAG_RD, &stats->mgprc, + "Management Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_drop", + CTLFLAG_RD, &stats->mgpdc, + "Management Packets Dropped"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_txd", + CTLFLAG_RD, &stats->mgptc, + "Management Packets Transmitted"); /* Packet Reception Stats */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd", CTLFLAG_RD, &stats->tpr, - "Total Packets Received "); + "Total Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_recvd", CTLFLAG_RD, &stats->gprc, "Good Packets Received"); @@ -5805,7 +5829,7 @@ igb_add_hw_stats(struct adapter *adapter "Multicast Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_64", CTLFLAG_RD, &stats->prc64, - "64 byte frames received "); + "64 byte frames received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_65_127", CTLFLAG_RD, &stats->prc127, "65-127 byte frames received"); @@ -5823,12 +5847,18 @@ igb_add_hw_stats(struct adapter *adapter "1023-1522 byte frames received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd", CTLFLAG_RD, &stats->gorc, - "Good Octets Received"); + "Good Octets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_recvd", + CTLFLAG_RD, &stats->tor, + "Total Octets Received"); /* Packet Transmission Stats */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd", CTLFLAG_RD, &stats->gotc, "Good Octets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_txd", + CTLFLAG_RD, &stats->tot, + "Total Octets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", CTLFLAG_RD, &stats->tpt, "Total Packets Transmitted"); @@ -5843,7 +5873,7 @@ igb_add_hw_stats(struct adapter *adapter "Multicast Packets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_64", CTLFLAG_RD, &stats->ptc64, - "64 byte frames transmitted "); + "64 byte frames transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_65_127", CTLFLAG_RD, &stats->ptc127, "65-127 byte frames transmitted"); From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 19:45:57 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E158F4DF; Tue, 16 Dec 2014 19:45: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 C280A1CF; Tue, 16 Dec 2014 19:45: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 sBGJjvPL069487; Tue, 16 Dec 2014 19:45:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGJjvTU069486; Tue, 16 Dec 2014 19:45:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412161945.sBGJjvTU069486@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Dec 2014 19:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275836 - in stable: 10/sys/dev/e1000 9/sys/dev/e1000 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 19:45:58 -0000 Author: jhb Date: Tue Dec 16 19:45:56 2014 New Revision: 275836 URL: https://svnweb.freebsd.org/changeset/base/275836 Log: MFC 272897: Various fixes to stats: - Read the counts of received, dropped, and transmitted management packets and add sysctl nodes for them. - Fix the total octets received/transmitted to read all 64 bits of the counters. - Add missing sysctl nodes for rlec, tncrs, fcruc, tor, and tot. - Remove spurious spaces. Modified: stable/9/sys/dev/e1000/if_igb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/e1000/if_igb.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Tue Dec 16 18:57:42 2014 (r275835) +++ stable/9/sys/dev/e1000/if_igb.c Tue Dec 16 19:45:56 2014 (r275836) @@ -5410,8 +5410,14 @@ igb_update_stats_counters(struct adapter stats->roc += E1000_READ_REG(hw, E1000_ROC); stats->rjc += E1000_READ_REG(hw, E1000_RJC); - stats->tor += E1000_READ_REG(hw, E1000_TORH); - stats->tot += E1000_READ_REG(hw, E1000_TOTH); + stats->mgprc += E1000_READ_REG(hw, E1000_MGTPRC); + stats->mgpdc += E1000_READ_REG(hw, E1000_MGTPDC); + stats->mgptc += E1000_READ_REG(hw, E1000_MGTPTC); + + stats->tor += E1000_READ_REG(hw, E1000_TORL) + + ((u64)E1000_READ_REG(hw, E1000_TORH) << 32); + stats->tot += E1000_READ_REG(hw, E1000_TOTL) + + ((u64)E1000_READ_REG(hw, E1000_TOTH) << 32); stats->tpr += E1000_READ_REG(hw, E1000_TPR); stats->tpt += E1000_READ_REG(hw, E1000_TPT); @@ -5738,6 +5744,9 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "missed_packets", CTLFLAG_RD, &stats->mpc, "Missed Packets"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_length_errors", + CTLFLAG_RD, &stats->rlec, + "Receive Length Errors"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_no_buff", CTLFLAG_RD, &stats->rnbc, "Receive No Buffers"); @@ -5746,7 +5755,7 @@ igb_add_hw_stats(struct adapter *adapter "Receive Undersize"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_fragmented", CTLFLAG_RD, &stats->rfc, - "Fragmented Packets Received "); + "Fragmented Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_oversize", CTLFLAG_RD, &stats->roc, "Oversized Packets Received"); @@ -5762,6 +5771,9 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "alignment_errs", CTLFLAG_RD, &stats->algnerrc, "Alignment Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_no_crs", + CTLFLAG_RD, &stats->tncrs, + "Transmit with No CRS"); /* On 82575 these are collision counts */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "coll_ext_errs", CTLFLAG_RD, &stats->cexterr, @@ -5778,10 +5790,22 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_txd", CTLFLAG_RD, &stats->xofftxc, "XOFF Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "unsupported_fc_recvd", + CTLFLAG_RD, &stats->fcruc, + "Unsupported Flow Control Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_recvd", + CTLFLAG_RD, &stats->mgprc, + "Management Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_drop", + CTLFLAG_RD, &stats->mgpdc, + "Management Packets Dropped"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_txd", + CTLFLAG_RD, &stats->mgptc, + "Management Packets Transmitted"); /* Packet Reception Stats */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd", CTLFLAG_RD, &stats->tpr, - "Total Packets Received "); + "Total Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_recvd", CTLFLAG_RD, &stats->gprc, "Good Packets Received"); @@ -5793,7 +5817,7 @@ igb_add_hw_stats(struct adapter *adapter "Multicast Packets Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_64", CTLFLAG_RD, &stats->prc64, - "64 byte frames received "); + "64 byte frames received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_65_127", CTLFLAG_RD, &stats->prc127, "65-127 byte frames received"); @@ -5811,12 +5835,18 @@ igb_add_hw_stats(struct adapter *adapter "1023-1522 byte frames received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd", CTLFLAG_RD, &stats->gorc, - "Good Octets Received"); + "Good Octets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_recvd", + CTLFLAG_RD, &stats->tor, + "Total Octets Received"); /* Packet Transmission Stats */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd", CTLFLAG_RD, &stats->gotc, "Good Octets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_octets_txd", + CTLFLAG_RD, &stats->tot, + "Total Octets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", CTLFLAG_RD, &stats->tpt, "Total Packets Transmitted"); @@ -5831,7 +5861,7 @@ igb_add_hw_stats(struct adapter *adapter "Multicast Packets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_64", CTLFLAG_RD, &stats->ptc64, - "64 byte frames transmitted "); + "64 byte frames transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_65_127", CTLFLAG_RD, &stats->ptc127, "65-127 byte frames transmitted"); From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 20:05:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20BF2D62; Tue, 16 Dec 2014 20:05: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 E6B9F698; Tue, 16 Dec 2014 20:05: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 sBGK5BsS079494; Tue, 16 Dec 2014 20:05:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGK5BFC079493; Tue, 16 Dec 2014 20:05:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412162005.sBGK5BFC079493@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Dec 2014 20:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275837 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 20:05:12 -0000 Author: jhb Date: Tue Dec 16 20:05:10 2014 New Revision: 275837 URL: https://svnweb.freebsd.org/changeset/base/275837 Log: MFC 271635,271722: - Only the manpage updates from 271635 are merged to give additional heads up for the stricter checks in 11, but the kernel in 10 remains permissive. - Fail with EINVAL if an invalid protection mask is passed to mmap(). - Fail with EINVAL if an unknown flag is passed to mmap(). - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap(). - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous mappings. - Remove mention of MAP_INHERIT. It hasn't been implemented for thirteen years. - Remove mention of unimplemented MAP_SWAP. There are no future plans to implement it. Modified: stable/10/lib/libc/sys/mmap.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/mmap.2 ============================================================================== --- stable/10/lib/libc/sys/mmap.2 Tue Dec 16 19:45:56 2014 (r275836) +++ stable/10/lib/libc/sys/mmap.2 Tue Dec 16 20:05:10 2014 (r275837) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd June 19, 2014 +.Dd September 17, 2014 .Dt MMAP 2 .Os .Sh NAME @@ -176,11 +176,6 @@ already exists within the range. .It Dv MAP_HASSEMAPHORE Notify the kernel that the region may contain semaphores and that special handling may be necessary. -.It Dv MAP_INHERIT -This flag never operated as advertised and is no longer supported. -Please refer to -.Xr minherit 2 -for further information. .It Dv MAP_NOCORE Region is not included in a core file. .It Dv MAP_NOSYNC @@ -300,14 +295,6 @@ The system call does not unmap pages, see .Xr munmap 2 for further information. -.Pp -The current design does not allow a process to specify the location of -swap space. -In the future we may define an additional mapping type, -.Dv MAP_SWAP , -in which -the file descriptor argument specifies a file or device to which swapping -should be done. .Sh NOTES Although this implementation does not impose any alignment restrictions on the @@ -372,6 +359,29 @@ The argument is not a valid open file descriptor. .It Bq Er EINVAL +An invalid value was passed in the +.Fa prot +argument. +.It Bq Er EINVAL +An undefined option was set in the +.Fa flags +argument. +.It Bq Er EINVAL +Both +.Dv MAP_PRIVATE +and +.Dv MAP_SHARED +were specified. +.It Bq Er EINVAL +None of +.Dv MAP_ANON , +.Dv MAP_PRIVATE , +.Dv MAP_SHARED , +or +.Dv MAP_STACK +was specified. +At least one of these flags must be included. +.It Bq Er EINVAL .Dv MAP_FIXED was specified and the .Fa addr From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 21:05:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C1D0218; Tue, 16 Dec 2014 21:05: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 579EBEB; Tue, 16 Dec 2014 21:05: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 sBGL5UOY009087; Tue, 16 Dec 2014 21:05:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGL5TEE009084; Tue, 16 Dec 2014 21:05:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412162105.sBGL5TEE009084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Dec 2014 21:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275840 - stable/10/usr.bin/patch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 21:05:30 -0000 Author: pfg Date: Tue Dec 16 21:05:28 2014 New Revision: 275840 URL: https://svnweb.freebsd.org/changeset/base/275840 Log: MFC r275531, r275581, r275582; patch(1): Small changes to sync with OpenBSD Update OpenBSD CVS revision tag for our r255232. Prefer setvbuf() to setlinebuf(). Small space changes, mostly to keep in sync with OpenBSD Obtained from: OpenBSD Modified: stable/10/usr.bin/patch/patch.c stable/10/usr.bin/patch/pch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/patch/patch.c ============================================================================== --- stable/10/usr.bin/patch/patch.c Tue Dec 16 20:45:17 2014 (r275839) +++ stable/10/usr.bin/patch/patch.c Tue Dec 16 21:05:28 2014 (r275840) @@ -23,7 +23,7 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: patch.c,v 1.50 2012/05/15 19:32:02 millert Exp $ + * $OpenBSD: patch.c,v 1.52 2014/11/26 18:34:51 millert Exp $ * $FreeBSD$ * */ @@ -150,8 +150,8 @@ main(int argc, char *argv[]) const char *tmpdir; char *v; - setlinebuf(stdout); - setlinebuf(stderr); + setvbuf(stdout, NULL, _IOLBF, 0); + setvbuf(stderr, NULL, _IOLBF, 0); for (i = 0; i < MAXFILEC; i++) filearg[i] = NULL; Modified: stable/10/usr.bin/patch/pch.c ============================================================================== --- stable/10/usr.bin/patch/pch.c Tue Dec 16 20:45:17 2014 (r275839) +++ stable/10/usr.bin/patch/pch.c Tue Dec 16 21:05:28 2014 (r275840) @@ -24,7 +24,7 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: pch.c,v 1.39 2012/04/11 08:07:13 ajacoutot Exp $ + * $OpenBSD: pch.c,v 1.43 2014/11/18 17:03:35 tobias Exp $ * $FreeBSD$ */ @@ -318,7 +318,8 @@ intuit_diff_type(void) for (t = s + 7; isspace((unsigned char)*t); t++) ; revision = savestr(t); - for (t = revision; *t && !isspace((unsigned char)*t); t++) + for (t = revision; + *t && !isspace((unsigned char)*t); t++) ; *t = '\0'; if (*revision == '\0') { @@ -583,7 +584,8 @@ another_hunk(void) p_end--; return false; } - for (s = buf; *s && !isdigit((unsigned char)*s); s++) + for (s = buf; + *s && !isdigit((unsigned char)*s); s++) ; if (!*s) malformed(); @@ -593,7 +595,8 @@ another_hunk(void) while (isdigit((unsigned char)*s)) s++; if (*s == ',') { - for (; *s && !isdigit((unsigned char)*s); s++) + for (; + *s && !isdigit((unsigned char)*s); s++) ; if (!*s) malformed(); @@ -690,8 +693,8 @@ another_hunk(void) change_line: if (buf[1] == '\n' && canonicalize) strlcpy(buf + 1, " \n", buf_size - 1); - if (!isspace((unsigned char)buf[1]) && buf[1] != '>' && - buf[1] != '<' && + if (!isspace((unsigned char)buf[1]) && + buf[1] != '>' && buf[1] != '<' && repl_beginning && repl_could_be_missing) { repl_missing = true; goto hunk_done; @@ -1420,8 +1423,8 @@ do_ed_script(void) for (t = buf; isdigit((unsigned char)*t) || *t == ','; t++) ; /* POSIX defines allowed commands as {a,c,d,i,s} */ - if (isdigit((unsigned char)*buf) && (*t == 'a' || *t == 'c' || - *t == 'd' || *t == 'i' || *t == 's')) { + if (isdigit((unsigned char)*buf) && + (*t == 'a' || *t == 'c' || *t == 'd' || *t == 'i' || *t == 's')) { if (pipefp != NULL) fputs(buf, pipefp); if (*t != 'd') { From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 21:13:56 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B10D502; Tue, 16 Dec 2014 21:13: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 75BBD1EB; Tue, 16 Dec 2014 21:13: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 sBGLDuN2013743; Tue, 16 Dec 2014 21:13:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGLDuMZ013739; Tue, 16 Dec 2014 21:13:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412162113.sBGLDuMZ013739@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Dec 2014 21:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275841 - stable/10/usr.bin/patch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 21:13:56 -0000 Author: pfg Date: Tue Dec 16 21:13:55 2014 New Revision: 275841 URL: https://svnweb.freebsd.org/changeset/base/275841 Log: MFC r275553, r275612; patch(1): Bring fixes from OpenBSD Check fstat return value. Use off_t for file size and offsets. Avoid iterating over end of string. Introduce strtolinenum to properly check line numbers while parsing: no signs, no spaces, just digits, 0 <= x <= LONG_MAX Properly validate line ranges supplied in diff file to prevent overflows. Also fixes an out of boundary memory access because the resulting values are used as array indices. PR: 195436 Obtained from: OpenBSD Modified: stable/10/usr.bin/patch/common.h stable/10/usr.bin/patch/pch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/patch/common.h ============================================================================== --- stable/10/usr.bin/patch/common.h Tue Dec 16 21:05:28 2014 (r275840) +++ stable/10/usr.bin/patch/common.h Tue Dec 16 21:13:55 2014 (r275841) @@ -40,6 +40,7 @@ #define INITHUNKMAX 125 /* initial dynamic allocation size */ #define INITLINELEN 4096 #define BUFFERSIZE 4096 +#define LINENUM_MAX LONG_MAX #define SCCSPREFIX "s." #define GET "get -e %s" Modified: stable/10/usr.bin/patch/pch.c ============================================================================== --- stable/10/usr.bin/patch/pch.c Tue Dec 16 21:05:28 2014 (r275840) +++ stable/10/usr.bin/patch/pch.c Tue Dec 16 21:13:55 2014 (r275841) @@ -46,7 +46,7 @@ /* Patch (diff listing) abstract type. */ -static long p_filesize; /* size of the patch file */ +static off_t p_filesize; /* size of the patch file */ static LINENUM p_first; /* 1st line number */ static LINENUM p_newfirst; /* 1st line number of replacement */ static LINENUM p_ptrn_lines; /* # lines in pattern */ @@ -60,9 +60,9 @@ static unsigned short *p_len = NULL; /* static char *p_char = NULL; /* +, -, and ! */ static int hunkmax = INITHUNKMAX; /* size of above arrays to begin with */ static int p_indent; /* indent to patch */ -static LINENUM p_base; /* where to intuit this time */ +static off_t p_base; /* where to intuit this time */ static LINENUM p_bline; /* line # of p_base */ -static LINENUM p_start; /* where intuit found a patch */ +static off_t p_start; /* where intuit found a patch */ static LINENUM p_sline; /* and the line number for it */ static LINENUM p_hunk_beg; /* line number of current hunk */ static LINENUM p_efake = -1; /* end of faked up lines--don't free */ @@ -72,12 +72,13 @@ static char *bestguess = NULL; /* guess static void grow_hunkmax(void); static int intuit_diff_type(void); -static void next_intuit_at(LINENUM, LINENUM); -static void skip_to(LINENUM, LINENUM); +static void next_intuit_at(off_t, LINENUM); +static void skip_to(off_t, LINENUM); static size_t pgets(bool _do_indent); static char *best_name(const struct file_name *, bool); static char *posix_name(const struct file_name *, bool); static size_t num_components(const char *); +static LINENUM strtolinenum(char *, char **); /* * Prepare to look for the next patch in the patch file. @@ -119,9 +120,10 @@ open_patch_file(const char *filename) pfp = fopen(filename, "r"); if (pfp == NULL) pfatal("patch file %s not found", filename); - fstat(fileno(pfp), &filestat); + if (fstat(fileno(pfp), &filestat)) + pfatal("can't stat %s", filename); p_filesize = filestat.st_size; - next_intuit_at(0L, 1L); /* start at the beginning */ + next_intuit_at(0, 1L); /* start at the beginning */ set_hunkmax(); } @@ -172,7 +174,7 @@ there_is_another_patch(void) { bool exists = false; - if (p_base != 0L && p_base >= p_filesize) { + if (p_base != 0 && p_base >= p_filesize) { if (verbose) say("done\n"); return false; @@ -181,7 +183,7 @@ there_is_another_patch(void) say("Hmm..."); diff_type = intuit_diff_type(); if (!diff_type) { - if (p_base != 0L) { + if (p_base != 0) { if (verbose) say(" Ignoring the trailing garbage.\ndone\n"); } else @@ -190,7 +192,7 @@ there_is_another_patch(void) } if (verbose) say(" %sooks like %s to me...\n", - (p_base == 0L ? "L" : "The next patch l"), + (p_base == 0 ? "L" : "The next patch l"), diff_type == UNI_DIFF ? "a unified diff" : diff_type == CONTEXT_DIFF ? "a context diff" : diff_type == NEW_CONTEXT_DIFF ? "a new-style context diff" : @@ -252,8 +254,8 @@ p4_fetchname(struct file_name *name, cha static int intuit_diff_type(void) { - long this_line = 0, previous_line; - long first_command_line = -1; + off_t this_line = 0, previous_line; + off_t first_command_line = -1; LINENUM fcl_line = -1; bool last_line_was_command = false, this_is_a_command = false; bool stars_last_line = false, stars_this_line = false; @@ -263,17 +265,17 @@ intuit_diff_type(void) memset(names, 0, sizeof(names)); ok_to_create_file = false; - fseek(pfp, p_base, SEEK_SET); + fseeko(pfp, p_base, SEEK_SET); p_input_line = p_bline - 1; for (;;) { previous_line = this_line; last_line_was_command = this_is_a_command; stars_last_line = stars_this_line; - this_line = ftell(pfp); + this_line = ftello(pfp); indent = 0; p_input_line++; if (pgets(false) == 0) { - if (first_command_line >= 0L) { + if (first_command_line >= 0) { /* nothing but deletes!? */ p_start = first_command_line; p_sline = fcl_line; @@ -296,7 +298,7 @@ intuit_diff_type(void) ; this_is_a_command = (isdigit((unsigned char)*s) && (*t == 'd' || *t == 'c' || *t == 'a')); - if (first_command_line < 0L && this_is_a_command) { + if (first_command_line < 0 && this_is_a_command) { first_command_line = this_line; fcl_line = p_input_line; p_indent = indent; /* assume this for now */ @@ -333,7 +335,7 @@ intuit_diff_type(void) p4_fetchname(&names[OLD_FILE], s + 5); } if ((!diff_type || diff_type == ED_DIFF) && - first_command_line >= 0L && + first_command_line >= 0 && strEQ(s, ".\n")) { p_indent = indent; p_start = first_command_line; @@ -353,13 +355,13 @@ intuit_diff_type(void) stars_this_line = strnEQ(s, "********", 8); if ((!diff_type || diff_type == CONTEXT_DIFF) && stars_last_line && strnEQ(s, "*** ", 4)) { - if (atol(s + 4) == 0) + if (strtolinenum(s + 4, &s) == 0) ok_to_create_file = true; /* * If this is a new context diff the character just - * before the newline is a '*'. + * at the end of the line is a '*'. */ - while (*s != '\n') + while (*s && *s != '\n') s++; p_indent = indent; p_start = previous_line; @@ -423,26 +425,27 @@ scan_exit: * Remember where this patch ends so we know where to start up again. */ static void -next_intuit_at(LINENUM file_pos, LINENUM file_line) +next_intuit_at(off_t file_pos, LINENUM file_line) { p_base = file_pos; p_bline = file_line; } /* - * Basically a verbose fseek() to the actual diff listing. + * Basically a verbose fseeko() to the actual diff listing. */ static void -skip_to(LINENUM file_pos, LINENUM file_line) +skip_to(off_t file_pos, LINENUM file_line) { size_t len; if (p_base > file_pos) - fatal("Internal error: seek %ld>%ld\n", p_base, file_pos); + fatal("Internal error: seek %lld>%lld\n", + (long long)p_base, (long long)file_pos); if (verbose && p_base < file_pos) { - fseek(pfp, p_base, SEEK_SET); + fseeko(pfp, p_base, SEEK_SET); say("The text leading up to this was:\n--------------------------\n"); - while (ftell(pfp) < file_pos) { + while (ftello(pfp) < file_pos) { len = pgets(false); if (len == 0) fatal("Unexpected end of file\n"); @@ -450,7 +453,7 @@ skip_to(LINENUM file_pos, LINENUM file_l } say("--------------------------\n"); } else - fseek(pfp, file_pos, SEEK_SET); + fseeko(pfp, file_pos, SEEK_SET); p_input_line = file_line - 1; } @@ -480,7 +483,7 @@ remove_special_line(void) return true; } if (c != EOF) - fseek(pfp, -1L, SEEK_CUR); + fseeko(pfp, -1, SEEK_CUR); return false; } @@ -491,7 +494,7 @@ remove_special_line(void) bool another_hunk(void) { - long line_beginning; /* file pos of the current line */ + off_t line_beginning; /* file pos of the current line */ LINENUM repl_beginning; /* index of --- line */ LINENUM fillcnt; /* #lines of missing ptrn or repl */ LINENUM fillsrc; /* index of first line to copy */ @@ -499,7 +502,7 @@ another_hunk(void) bool ptrn_spaces_eaten; /* ptrn was slightly misformed */ bool repl_could_be_missing; /* no + or ! lines in this hunk */ bool repl_missing; /* we are now backtracking */ - long repl_backtrack_position; /* file pos of first repl line */ + off_t repl_backtrack_position; /* file pos of first repl line */ LINENUM repl_patch_line; /* input line number for same */ LINENUM ptrn_copiable; /* # of copiable lines in ptrn */ char *s; @@ -517,7 +520,7 @@ another_hunk(void) p_max = hunkmax; /* gets reduced when --- found */ if (diff_type == CONTEXT_DIFF || diff_type == NEW_CONTEXT_DIFF) { - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); repl_beginning = 0; fillcnt = 0; fillsrc = 0; @@ -538,7 +541,7 @@ another_hunk(void) p_context = 100; p_hunk_beg = p_input_line + 1; while (p_end < p_max) { - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); len = pgets(true); p_input_line++; if (len == 0) { @@ -591,22 +594,25 @@ another_hunk(void) malformed(); if (strnEQ(s, "0,0", 3)) memmove(s, s + 2, strlen(s + 2) + 1); - p_first = (LINENUM) atol(s); - while (isdigit((unsigned char)*s)) - s++; + p_first = strtolinenum(s, &s); if (*s == ',') { for (; *s && !isdigit((unsigned char)*s); s++) ; if (!*s) malformed(); - p_ptrn_lines = ((LINENUM) atol(s)) - p_first + 1; + p_ptrn_lines = strtolinenum(s, &s) - p_first + 1; + if (p_ptrn_lines < 0) + malformed(); } else if (p_first) p_ptrn_lines = 1; else { p_ptrn_lines = 0; p_first = 1; } + if (p_first >= LINENUM_MAX - p_ptrn_lines || + p_ptrn_lines >= LINENUM_MAX - 6) + malformed(); /* we need this much at least */ p_max = p_ptrn_lines + 6; @@ -647,7 +653,7 @@ another_hunk(void) } } repl_beginning = p_end; - repl_backtrack_position = ftell(pfp); + repl_backtrack_position = ftello(pfp); repl_patch_line = p_input_line; p_line[p_end] = savestr(buf); if (out_of_mem) { @@ -659,22 +665,25 @@ another_hunk(void) ; if (!*s) malformed(); - p_newfirst = (LINENUM) atol(s); - while (isdigit((unsigned char)*s)) - s++; + p_newfirst = strtolinenum(s, &s); if (*s == ',') { for (; *s && !isdigit((unsigned char)*s); s++) ; if (!*s) malformed(); - p_repl_lines = ((LINENUM) atol(s)) - + p_repl_lines = strtolinenum(s, &s) - p_newfirst + 1; + if (p_repl_lines < 0) + malformed(); } else if (p_newfirst) p_repl_lines = 1; else { p_repl_lines = 0; p_newfirst = 1; } + if (p_newfirst >= LINENUM_MAX - p_repl_lines || + p_repl_lines >= LINENUM_MAX - p_end) + malformed(); p_max = p_repl_lines + p_end; if (p_max > MAXHUNKSIZE) fatal("hunk too large (%ld lines) at line %ld: %s", @@ -779,7 +788,7 @@ hunk_done: p_input_line = repl_patch_line; for (p_end--; p_end > repl_beginning; p_end--) free(p_line[p_end]); - fseek(pfp, repl_backtrack_position, SEEK_SET); + fseeko(pfp, repl_backtrack_position, SEEK_SET); /* redundant 'new' context lines were omitted - set */ /* up to fill them in from the old file context */ @@ -857,7 +866,7 @@ hunk_done: LINENUM fillnew; /* index of new lines */ char ch; - line_beginning = ftell(pfp); /* file pos of the current line */ + line_beginning = ftello(pfp); /* file pos of the current line */ len = pgets(true); p_input_line++; if (len == 0 || strnNE(buf, "@@ -", 4)) { @@ -867,32 +876,28 @@ hunk_done: s = buf + 4; if (!*s) malformed(); - p_first = (LINENUM) atol(s); - while (isdigit((unsigned char)*s)) - s++; + p_first = strtolinenum(s, &s); if (*s == ',') { - p_ptrn_lines = (LINENUM) atol(++s); - while (isdigit((unsigned char)*s)) - s++; + p_ptrn_lines = strtolinenum(s + 1, &s); } else p_ptrn_lines = 1; if (*s == ' ') s++; if (*s != '+' || !*++s) malformed(); - p_newfirst = (LINENUM) atol(s); - while (isdigit((unsigned char)*s)) - s++; + p_newfirst = strtolinenum(s, &s); if (*s == ',') { - p_repl_lines = (LINENUM) atol(++s); - while (isdigit((unsigned char)*s)) - s++; + p_repl_lines = strtolinenum(s + 1, &s); } else p_repl_lines = 1; if (*s == ' ') s++; if (*s != '@') malformed(); + if (p_first >= LINENUM_MAX - p_ptrn_lines || + p_newfirst > LINENUM_MAX - p_repl_lines || + p_ptrn_lines >= LINENUM_MAX - p_repl_lines - 1) + malformed(); if (!p_ptrn_lines) p_first++; /* do append rather than insert */ p_max = p_ptrn_lines + p_repl_lines + 1; @@ -921,7 +926,7 @@ hunk_done: context = 0; p_hunk_beg = p_input_line + 1; while (fillold <= p_ptrn_lines || fillnew <= p_end) { - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); len = pgets(true); p_input_line++; if (len == 0) { @@ -1024,7 +1029,7 @@ hunk_done: int i; LINENUM min, max; - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); p_context = 0; len = pgets(true); p_input_line++; @@ -1032,35 +1037,36 @@ hunk_done: next_intuit_at(line_beginning, p_input_line); return false; } - p_first = (LINENUM) atol(buf); - for (s = buf; isdigit((unsigned char)*s); s++) - ; + p_first = strtolinenum(buf, &s); if (*s == ',') { - p_ptrn_lines = (LINENUM) atol(++s) - p_first + 1; - while (isdigit((unsigned char)*s)) - s++; + p_ptrn_lines = strtolinenum(s + 1, &s) - p_first + 1; + if (p_ptrn_lines < 0) + malformed(); } else p_ptrn_lines = (*s != 'a'); hunk_type = *s; if (hunk_type == 'a') p_first++; /* do append rather than insert */ - min = (LINENUM) atol(++s); - for (; isdigit((unsigned char)*s); s++) - ; + min = strtolinenum(s + 1, &s); if (*s == ',') - max = (LINENUM) atol(++s); + max = strtolinenum(s + 1, &s); else max = min; + if (min < 0 || min > max || max - min == LINENUM_MAX) + malformed(); if (hunk_type == 'd') min++; - p_end = p_ptrn_lines + 1 + max - min + 1; + p_newfirst = min; + p_repl_lines = max - min + 1; + if (p_newfirst > LINENUM_MAX - p_repl_lines || + p_ptrn_lines >= LINENUM_MAX - p_repl_lines - 1) + malformed(); + p_end = p_ptrn_lines + p_repl_lines + 1; if (p_end > MAXHUNKSIZE) fatal("hunk too large (%ld lines) at line %ld: %s", p_end, p_input_line, buf); while (p_end >= hunkmax) grow_hunkmax(); - p_newfirst = min; - p_repl_lines = max - min + 1; snprintf(buf, buf_size, "*** %ld,%ld\n", p_first, p_first + p_ptrn_lines - 1); p_line[0] = savestr(buf); @@ -1401,7 +1407,7 @@ void do_ed_script(void) { char *t; - long beginning_of_this_line; + off_t beginning_of_this_line; FILE *pipefp = NULL; if (!skip_rest_of_patch) { @@ -1414,7 +1420,7 @@ do_ed_script(void) pipefp = popen(buf, "w"); } for (;;) { - beginning_of_this_line = ftell(pfp); + beginning_of_this_line = ftello(pfp); if (pgets(true) == 0) { next_intuit_at(beginning_of_this_line, p_input_line); break; @@ -1580,3 +1586,36 @@ num_components(const char *path) } return n; } + +/* + * Convert number at NPTR into LINENUM and save address of first + * character that is not a digit in ENDPTR. If conversion is not + * possible, call fatal. + */ +static LINENUM +strtolinenum(char *nptr, char **endptr) +{ + LINENUM rv; + char c; + char *p; + const char *errstr; + + for (p = nptr; isdigit((unsigned char)*p); p++) + ; + + if (p == nptr) + malformed(); + + c = *p; + *p = '\0'; + + rv = strtonum(nptr, 0, LINENUM_MAX, &errstr); + if (errstr != NULL) + fatal("invalid line number at line %ld: `%s' is %s\n", + p_input_line, nptr, errstr); + + *p = c; + *endptr = p; + + return rv; +} From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 21:57:57 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB58D294; Tue, 16 Dec 2014 21:57: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 A59B291C; Tue, 16 Dec 2014 21:57: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 sBGLvvMP033819; Tue, 16 Dec 2014 21:57:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGLvu5n033815; Tue, 16 Dec 2014 21:57:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412162157.sBGLvu5n033815@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Dec 2014 21:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275843 - in stable/10/usr.bin: kdump truss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 21:57:57 -0000 Author: jhb Date: Tue Dec 16 21:57:55 2014 New Revision: 275843 URL: https://svnweb.freebsd.org/changeset/base/275843 Log: MFC 273053: Decode the arguments passed to _umtx_op(). In particular, decode the opcode. Modified: stable/10/usr.bin/kdump/kdump.c stable/10/usr.bin/kdump/mksubr stable/10/usr.bin/truss/syscall.h stable/10/usr.bin/truss/syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/kdump/kdump.c ============================================================================== --- stable/10/usr.bin/kdump/kdump.c Tue Dec 16 21:51:21 2014 (r275842) +++ stable/10/usr.bin/kdump/kdump.c Tue Dec 16 21:57:55 2014 (r275843) @@ -57,6 +57,7 @@ extern int errno; #include #include #include +#include #include #include #include @@ -1187,6 +1188,26 @@ ktrsyscall(struct ktr_syscall *ktr, u_in ip++; narg--; break; + case SYS__umtx_op: + print_number(ip, narg, c); + putchar(','); + umtxopname(*ip); + switch (*ip) { + case UMTX_OP_CV_WAIT: + ip++; + narg--; + putchar(','); + umtxcvwaitflags(*ip); + break; + case UMTX_OP_RW_RDLOCK: + ip++; + narg--; + putchar(','); + umtxrwlockflags(*ip); + break; + } + ip++; + narg--; } } while (narg > 0) { Modified: stable/10/usr.bin/kdump/mksubr ============================================================================== --- stable/10/usr.bin/kdump/mksubr Tue Dec 16 21:51:21 2014 (r275842) +++ stable/10/usr.bin/kdump/mksubr Tue Dec 16 21:57:55 2014 (r275843) @@ -156,6 +156,7 @@ _EOF_ # C start cat <<_EOF_ +#include #include #include #include @@ -185,6 +186,8 @@ cat <<_EOF_ #include #include #include +#include +#include #include #include #include @@ -489,6 +492,7 @@ auto_if_type "sockipprotoname" " auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" auto_or_type "thrcreateflagsname" "THR_[A-Z]+[[:space:]]+0x[0-9]+" "sys/thr.h" +auto_switch_type "umtxopname" "UMTX_OP_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/umtx.h" auto_switch_type "vmresultname" "KERN_[A-Z]+[[:space:]]+[0-9]+" "vm/vm_param.h" auto_or_type "wait6optname" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h" auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h" @@ -677,6 +681,62 @@ cat <<_EOF_ } } +/* + * AUTO - Special + * + * Just print 0 as 0. + */ +void +umtxcvwaitflags(intmax_t arg) +{ + int or = 0; + if (arg == 0) { + printf("0"); + return; + } + printf("%#jx<", (uintmax_t)arg); +_EOF_ + egrep "^#[[:space:]]*define[[:space:]]+CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+[[:space:]]*" \ + $include_dir/sys/umtx.h | \ + awk '{ for (i = 1; i <= NF; i++) \ + if ($i ~ /define/) \ + break; \ + ++i; \ + printf "\tif (!((arg > 0) ^ ((%s) > 0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }' +cat <<_EOF_ + printf(">"); + if (or == 0) + printf("%jd", arg); +} + + +/* + * AUTO - Special + * + * Just print 0 as 0. + */ +void +umtxrwlockflags(intmax_t arg) +{ + int or = 0; + if (arg == 0) { + printf("0"); + return; + } + printf("%#jx<", (uintmax_t)arg); +_EOF_ + egrep "^#[[:space:]]*define[[:space:]]+URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+[[:space:]]*" \ + $include_dir/sys/umtx.h | \ + awk '{ for (i = 1; i <= NF; i++) \ + if ($i ~ /define/) \ + break; \ + ++i; \ + printf "\tif (!((arg > 0) ^ ((%s) > 0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }' +cat <<_EOF_ + printf(">"); + if (or == 0) + printf("%jd", arg); +} _EOF_ egrep '#define[[:space:]]+CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)' \ $include_dir/sys/capability.h | \ Modified: stable/10/usr.bin/truss/syscall.h ============================================================================== --- stable/10/usr.bin/truss/syscall.h Tue Dec 16 21:51:21 2014 (r275842) +++ stable/10/usr.bin/truss/syscall.h Tue Dec 16 21:57:55 2014 (r275843) @@ -5,6 +5,7 @@ * Hex -- values that should be printed in hex (addresses) * Octal -- Same as above, but octal * Int -- normal integer values (file descriptors, for example) + * LongHex -- long value that should be printed in hex * Name -- pointer to a NULL-terminated string. * BinString -- pointer to an array of chars, printed via strvisx(). * Ptr -- pointer to some unspecified structure. Just print as hex for now. @@ -35,13 +36,13 @@ * $FreeBSD$ */ -enum Argtype { None = 1, Hex, Octal, Int, Name, Ptr, Stat, Ioctl, Quad, +enum Argtype { None = 1, Hex, Octal, Int, LongHex, Name, Ptr, Stat, Ioctl, Quad, Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval, Pollfd, Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres, Umtx, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open, Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, - LinuxSockArgs }; + LinuxSockArgs, Umtxop }; #define ARG_MASK 0xff #define OUT 0x100 Modified: stable/10/usr.bin/truss/syscalls.c ============================================================================== --- stable/10/usr.bin/truss/syscalls.c Tue Dec 16 21:51:21 2014 (r275842) +++ stable/10/usr.bin/truss/syscalls.c Tue Dec 16 21:57:55 2014 (r275843) @@ -283,6 +283,9 @@ static struct syscall syscalls[] = { { Waitoptions, 3 }, { Rusage | OUT, 4 }, { Ptr, 5 } } }, { .name = "procctl", .ret_type = 1, .nargs = 4, .args = { { Idtype, 0 }, { Int, 1 }, { Procctl, 2 }, { Ptr, 3 } } }, + { .name = "_umtx_op", .ret_type = 1, .nargs = 5, + .args = { { Ptr, 0 }, { Umtxop, 1 }, { LongHex, 2 }, { Ptr, 3 }, + { Ptr, 4 } } }, { .name = 0 }, }; @@ -416,6 +419,18 @@ static struct xlat procctl_arg[] = { X(PROC_SPROTECT) XEND }; +static struct xlat umtx_ops[] = { + X(UMTX_OP_LOCK) X(UMTX_OP_UNLOCK) X(UMTX_OP_WAIT) + X(UMTX_OP_WAKE) X(UMTX_OP_MUTEX_TRYLOCK) X(UMTX_OP_MUTEX_LOCK) + X(UMTX_OP_MUTEX_UNLOCK) X(UMTX_OP_SET_CEILING) X(UMTX_OP_CV_WAIT) + X(UMTX_OP_CV_SIGNAL) X(UMTX_OP_CV_BROADCAST) X(UMTX_OP_WAIT_UINT) + X(UMTX_OP_RW_RDLOCK) X(UMTX_OP_RW_WRLOCK) X(UMTX_OP_RW_UNLOCK) + X(UMTX_OP_WAIT_UINT_PRIVATE) X(UMTX_OP_WAKE_PRIVATE) + X(UMTX_OP_MUTEX_WAIT) X(UMTX_OP_MUTEX_WAKE) X(UMTX_OP_SEM_WAIT) + X(UMTX_OP_SEM_WAKE) X(UMTX_OP_NWAKE_PRIVATE) X(UMTX_OP_MUTEX_WAKE2) + XEND +}; + #undef X #undef XEND @@ -612,6 +627,9 @@ print_arg(struct syscall_args *sc, unsig case Int: asprintf(&tmp, "%d", (int)args[sc->offset]); break; + case LongHex: + asprintf(&tmp, "0x%lx", args[sc->offset]); + break; case Name: { /* NULL-terminated string. */ char *tmp2; @@ -1288,6 +1306,9 @@ print_arg(struct syscall_args *sc, unsig case Procctl: tmp = strdup(xlookup(procctl_arg, args[sc->offset])); break; + case Umtxop: + tmp = strdup(xlookup(umtx_ops, args[sc->offset])); + break; default: errx(1, "Invalid argument type %d\n", sc->type & ARG_MASK); } From owner-svn-src-stable@FreeBSD.ORG Wed Dec 17 06:58:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15B3F380; Wed, 17 Dec 2014 06:58: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 0055C23D; Wed, 17 Dec 2014 06:58: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 sBH6w19W094883; Wed, 17 Dec 2014 06:58:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBH6w1uc094879; Wed, 17 Dec 2014 06:58:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412170658.sBH6w1uc094879@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 17 Dec 2014 06:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275853 - stable/10/contrib/unbound/iterator X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 06:58:02 -0000 Author: delphij Date: Wed Dec 17 06:58:00 2014 New Revision: 275853 URL: https://svnweb.freebsd.org/changeset/base/275853 Log: MFC r275852: MFV r275844: Fix unbound remote denial of service vulnerability. Security: FreeBSD-SA-14:30.unbound Security: CVE-2014-8602 Approved by: so Modified: stable/10/contrib/unbound/iterator/iterator.c stable/10/contrib/unbound/iterator/iterator.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/unbound/iterator/iterator.c ============================================================================== --- stable/10/contrib/unbound/iterator/iterator.c Wed Dec 17 06:55:44 2014 (r275852) +++ stable/10/contrib/unbound/iterator/iterator.c Wed Dec 17 06:58:00 2014 (r275853) @@ -120,6 +120,7 @@ iter_new(struct module_qstate* qstate, i iq->query_restart_count = 0; iq->referral_count = 0; iq->sent_count = 0; + iq->target_count = NULL; iq->wait_priming_stub = 0; iq->refetch_glue = 0; iq->dnssec_expected = 0; @@ -445,6 +446,26 @@ handle_cname_response(struct module_qsta return 1; } +/** create target count structure for this query */ +static void +target_count_create(struct iter_qstate* iq) +{ + if(!iq->target_count) { + iq->target_count = (int*)calloc(2, sizeof(int)); + /* if calloc fails we simply do not track this number */ + if(iq->target_count) + iq->target_count[0] = 1; + } +} + +static void +target_count_increase(struct iter_qstate* iq, int num) +{ + target_count_create(iq); + if(iq->target_count) + iq->target_count[1] += num; +} + /** * Generate a subrequest. * Generate a local request event. Local events are tied to this module, and @@ -516,6 +537,10 @@ generate_sub_request(uint8_t* qname, siz subiq = (struct iter_qstate*)subq->minfo[id]; memset(subiq, 0, sizeof(*subiq)); subiq->num_target_queries = 0; + target_count_create(iq); + subiq->target_count = iq->target_count; + if(iq->target_count) + iq->target_count[0] ++; /* extra reference */ subiq->num_current_queries = 0; subiq->depth = iq->depth+1; outbound_list_init(&subiq->outlist); @@ -1342,6 +1367,12 @@ query_for_targets(struct module_qstate* if(iq->depth == ie->max_dependency_depth) return 0; + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return 0; + } iter_mark_cycle_targets(qstate, iq->dp); missing = (int)delegpt_count_missing_targets(iq->dp); @@ -1524,6 +1555,7 @@ processLastResort(struct module_qstate* return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += qs; + target_count_increase(iq, qs); if(qs != 0) { qstate->ext_state[id] = module_wait_subquery; return 0; /* and wait for them */ @@ -1533,6 +1565,12 @@ processLastResort(struct module_qstate* verbose(VERB_QUERY, "maxdepth and need more nameservers, fail"); return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); } + if(iq->depth > 0 && iq->target_count && + iq->target_count[1] > MAX_TARGET_COUNT) { + verbose(VERB_QUERY, "request has exceeded the maximum " + "number of glue fetches %d", iq->target_count[1]); + return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); + } /* mark cycle targets for parent-side lookups */ iter_mark_pside_cycle_targets(qstate, iq->dp); /* see if we can issue queries to get nameserver addresses */ @@ -1562,6 +1600,7 @@ processLastResort(struct module_qstate* if(query_count != 0) { /* suspend to await results */ verbose(VERB_ALGO, "try parent-side glue lookup"); iq->num_target_queries += query_count; + target_count_increase(iq, query_count); qstate->ext_state[id] = module_wait_subquery; return 0; } @@ -1717,6 +1756,7 @@ processQueryTargets(struct module_qstate return error_response(qstate, id, LDNS_RCODE_SERVFAIL); } iq->num_target_queries += extra; + target_count_increase(iq, extra); if(iq->num_target_queries > 0) { /* wait to get all targets, we want to try em */ verbose(VERB_ALGO, "wait for all targets for fallback"); @@ -1757,6 +1797,7 @@ processQueryTargets(struct module_qstate /* errors ignored, these targets are not strictly necessary for * this result, we do not have to reply with SERVFAIL */ iq->num_target_queries += extra; + target_count_increase(iq, extra); } /* Add the current set of unused targets to our queue. */ @@ -1802,6 +1843,7 @@ processQueryTargets(struct module_qstate return 1; } iq->num_target_queries += qs; + target_count_increase(iq, qs); } /* Since a target query might have been made, we * need to check again. */ @@ -2894,6 +2936,8 @@ iter_clear(struct module_qstate* qstate, iq = (struct iter_qstate*)qstate->minfo[id]; if(iq) { outbound_list_clear(&iq->outlist); + if(iq->target_count && --iq->target_count[0] == 0) + free(iq->target_count); iq->num_current_queries = 0; } qstate->minfo[id] = NULL; Modified: stable/10/contrib/unbound/iterator/iterator.h ============================================================================== --- stable/10/contrib/unbound/iterator/iterator.h Wed Dec 17 06:55:44 2014 (r275852) +++ stable/10/contrib/unbound/iterator/iterator.h Wed Dec 17 06:58:00 2014 (r275853) @@ -52,6 +52,8 @@ struct iter_donotq; struct iter_prep_list; struct iter_priv; +/** max number of targets spawned for a query and its subqueries */ +#define MAX_TARGET_COUNT 32 /** max number of query restarts. Determines max number of CNAME chain. */ #define MAX_RESTART_COUNT 8 /** max number of referrals. Makes sure resolver does not run away */ @@ -254,6 +256,10 @@ struct iter_qstate { /** number of queries fired off */ int sent_count; + + /** number of target queries spawned in [1], for this query and its + * subqueries, the malloced-array is shared, [0] refcount. */ + int* target_count; /** * The query must store NS records from referrals as parentside RRs From owner-svn-src-stable@FreeBSD.ORG Wed Dec 17 14:50:58 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96811398; Wed, 17 Dec 2014 14:50: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 68BE3885; Wed, 17 Dec 2014 14:50: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 sBHEowEJ026159; Wed, 17 Dec 2014 14:50:58 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHEow8m026158; Wed, 17 Dec 2014 14:50:58 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412171450.sBHEow8m026158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 17 Dec 2014 14:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275863 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 14:50:58 -0000 Author: pfg Date: Wed Dec 17 14:50:57 2014 New Revision: 275863 URL: https://svnweb.freebsd.org/changeset/base/275863 Log: MFC r275645; ext2fs: Fix old out-of-bounds access. Overrunning buffer pointed to by (caddr_t)&oip->i_db[0] of 48 bytes by passing it to a function which accesses it at byte offset 59 using argument 60UL. The issue was inherited from an older FFS implementation and fixed there with by merging UFS2 in r98542. We follow the FFS fix. CID: 1007665 Discussed with: bde Modified: stable/9/sys/fs/ext2fs/ext2_inode.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_inode.c Wed Dec 17 14:46:21 2014 (r275862) +++ stable/9/sys/fs/ext2fs/ext2_inode.c Wed Dec 17 14:50:57 2014 (r275863) @@ -223,14 +223,18 @@ ext2_truncate(struct vnode *vp, off_t le * will be returned to the free list. lastiblock values are also * normalized to -1 for calls to ext2_indirtrunc below. */ - bcopy((caddr_t)&oip->i_db[0], (caddr_t)oldblks, sizeof(oldblks)); - for (level = TRIPLE; level >= SINGLE; level--) + for (level = TRIPLE; level >= SINGLE; level--) { + oldblks[NDADDR + level] = oip->i_ib[level]; if (lastiblock[level] < 0) { oip->i_ib[level] = 0; lastiblock[level] = -1; } - for (i = NDADDR - 1; i > lastblock; i--) - oip->i_db[i] = 0; + } + for (i = 0; i < NDADDR; i++) { + oldblks[i] = oip->i_db[i]; + if (i > lastblock) + oip->i_db[i] = 0; + } oip->i_flag |= IN_CHANGE | IN_UPDATE; allerror = ext2_update(ovp, !DOINGASYNC(ovp)); @@ -240,8 +244,14 @@ ext2_truncate(struct vnode *vp, off_t le * Note that we save the new block configuration so we can check it * when we are done. */ - bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof(newblks)); - bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof(oldblks)); + for (i = 0; i < NDADDR; i++) { + newblks[i] = oip->i_db[i]; + oip->i_db[i] = oldblks[i]; + } + for (i = 0; i < NIADDR; i++) { + newblks[NDADDR + i] = oip->i_ib[i]; + oip->i_ib[i] = oldblks[NDADDR + i]; + } oip->i_size = osize; error = vtruncbuf(ovp, cred, td, length, (int)fs->e2fs_bsize); if (error && (allerror == 0)) From owner-svn-src-stable@FreeBSD.ORG Wed Dec 17 21:36:46 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67713402; Wed, 17 Dec 2014 21:36: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 51263104; Wed, 17 Dec 2014 21:36: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 sBHLakoj020835; Wed, 17 Dec 2014 21:36:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHLakDJ020834; Wed, 17 Dec 2014 21:36:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412172136.sBHLakDJ020834@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Dec 2014 21:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275872 - in stable: 10/contrib/llvm/tools/clang/lib/CodeGen 9/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 21:36:46 -0000 Author: dim Date: Wed Dec 17 21:36:45 2014 New Revision: 275872 URL: https://svnweb.freebsd.org/changeset/base/275872 Log: MFC r275759: Pull in r221170 from upstream clang trunk (by Roman Divacky): Implement vaarg lowering for ppc32. Lowering of scalars and aggregates is supported. Complex numbers are not. This adds va_args support for PowerPC (32 bit) to clang. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D1308 Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Wed Dec 17 21:27:27 2014 (r275871) +++ stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Wed Dec 17 21:36:45 2014 (r275872) @@ -2733,11 +2733,19 @@ llvm::Value *NaClX86_64ABIInfo::EmitVAAr // PowerPC-32 - namespace { -class PPC32TargetCodeGenInfo : public DefaultTargetCodeGenInfo { +/// PPC32_SVR4_ABIInfo - The 32-bit PowerPC ELF (SVR4) ABI information. +class PPC32_SVR4_ABIInfo : public DefaultABIInfo { public: - PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : DefaultTargetCodeGenInfo(CGT) {} + PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {} + + llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, + CodeGenFunction &CGF) const; +}; + +class PPC32TargetCodeGenInfo : public TargetCodeGenInfo { +public: + PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT)) {} int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const { // This is recovered from gcc output. @@ -2750,6 +2758,96 @@ public: } +llvm::Value *PPC32_SVR4_ABIInfo::EmitVAArg(llvm::Value *VAListAddr, + QualType Ty, + CodeGenFunction &CGF) const { + if (const ComplexType *CTy = Ty->getAs()) { + // TODO: Implement this. For now ignore. + (void)CTy; + return NULL; + } + + bool isI64 = Ty->isIntegerType() && getContext().getTypeSize(Ty) == 64; + bool isInt = Ty->isIntegerType() || Ty->isPointerType() || Ty->isAggregateType(); + llvm::Type *CharPtr = CGF.Int8PtrTy; + llvm::Type *CharPtrPtr = CGF.Int8PtrPtrTy; + + CGBuilderTy &Builder = CGF.Builder; + llvm::Value *GPRPtr = Builder.CreateBitCast(VAListAddr, CharPtr, "gprptr"); + llvm::Value *GPRPtrAsInt = Builder.CreatePtrToInt(GPRPtr, CGF.Int32Ty); + llvm::Value *FPRPtrAsInt = Builder.CreateAdd(GPRPtrAsInt, Builder.getInt32(1)); + llvm::Value *FPRPtr = Builder.CreateIntToPtr(FPRPtrAsInt, CharPtr); + llvm::Value *OverflowAreaPtrAsInt = Builder.CreateAdd(FPRPtrAsInt, Builder.getInt32(3)); + llvm::Value *OverflowAreaPtr = Builder.CreateIntToPtr(OverflowAreaPtrAsInt, CharPtrPtr); + llvm::Value *RegsaveAreaPtrAsInt = Builder.CreateAdd(OverflowAreaPtrAsInt, Builder.getInt32(4)); + llvm::Value *RegsaveAreaPtr = Builder.CreateIntToPtr(RegsaveAreaPtrAsInt, CharPtrPtr); + llvm::Value *GPR = Builder.CreateLoad(GPRPtr, false, "gpr"); + // Align GPR when TY is i64. + if (isI64) { + llvm::Value *GPRAnd = Builder.CreateAnd(GPR, Builder.getInt8(1)); + llvm::Value *CC64 = Builder.CreateICmpEQ(GPRAnd, Builder.getInt8(1)); + llvm::Value *GPRPlusOne = Builder.CreateAdd(GPR, Builder.getInt8(1)); + GPR = Builder.CreateSelect(CC64, GPRPlusOne, GPR); + } + llvm::Value *FPR = Builder.CreateLoad(FPRPtr, false, "fpr"); + llvm::Value *OverflowArea = Builder.CreateLoad(OverflowAreaPtr, false, "overflow_area"); + llvm::Value *OverflowAreaAsInt = Builder.CreatePtrToInt(OverflowArea, CGF.Int32Ty); + llvm::Value *RegsaveArea = Builder.CreateLoad(RegsaveAreaPtr, false, "regsave_area"); + llvm::Value *RegsaveAreaAsInt = Builder.CreatePtrToInt(RegsaveArea, CGF.Int32Ty); + + llvm::Value *CC = Builder.CreateICmpULT(isInt ? GPR : FPR, + Builder.getInt8(8), "cond"); + + llvm::Value *RegConstant = Builder.CreateMul(isInt ? GPR : FPR, + Builder.getInt8(isInt ? 4 : 8)); + + llvm::Value *OurReg = Builder.CreateAdd(RegsaveAreaAsInt, Builder.CreateSExt(RegConstant, CGF.Int32Ty)); + + if (Ty->isFloatingType()) + OurReg = Builder.CreateAdd(OurReg, Builder.getInt32(32)); + + llvm::BasicBlock *UsingRegs = CGF.createBasicBlock("using_regs"); + llvm::BasicBlock *UsingOverflow = CGF.createBasicBlock("using_overflow"); + llvm::BasicBlock *Cont = CGF.createBasicBlock("cont"); + + Builder.CreateCondBr(CC, UsingRegs, UsingOverflow); + + CGF.EmitBlock(UsingRegs); + + llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); + llvm::Value *Result1 = Builder.CreateIntToPtr(OurReg, PTy); + // Increase the GPR/FPR indexes. + if (isInt) { + GPR = Builder.CreateAdd(GPR, Builder.getInt8(isI64 ? 2 : 1)); + Builder.CreateStore(GPR, GPRPtr); + } else { + FPR = Builder.CreateAdd(FPR, Builder.getInt8(1)); + Builder.CreateStore(FPR, FPRPtr); + } + CGF.EmitBranch(Cont); + + CGF.EmitBlock(UsingOverflow); + + // Increase the overflow area. + llvm::Value *Result2 = Builder.CreateIntToPtr(OverflowAreaAsInt, PTy); + OverflowAreaAsInt = Builder.CreateAdd(OverflowAreaAsInt, Builder.getInt32(isInt ? 4 : 8)); + Builder.CreateStore(Builder.CreateIntToPtr(OverflowAreaAsInt, CharPtr), OverflowAreaPtr); + CGF.EmitBranch(Cont); + + CGF.EmitBlock(Cont); + + llvm::PHINode *Result = CGF.Builder.CreatePHI(PTy, 2, "vaarg.addr"); + Result->addIncoming(Result1, UsingRegs); + Result->addIncoming(Result2, UsingOverflow); + + if (Ty->isAggregateType()) { + llvm::Value *AGGPtr = Builder.CreateBitCast(Result, CharPtrPtr, "aggrptr") ; + return Builder.CreateLoad(AGGPtr, false, "aggr"); + } + + return Result; +} + bool PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const { From owner-svn-src-stable@FreeBSD.ORG Wed Dec 17 21:36:47 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B958403; Wed, 17 Dec 2014 21:36: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 05162105; Wed, 17 Dec 2014 21:36: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 sBHLakNj020846; Wed, 17 Dec 2014 21:36:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBHLakR5020845; Wed, 17 Dec 2014 21:36:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412172136.sBHLakR5020845@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Dec 2014 21:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275872 - in stable: 10/contrib/llvm/tools/clang/lib/CodeGen 9/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 21:36:47 -0000 Author: dim Date: Wed Dec 17 21:36:45 2014 New Revision: 275872 URL: https://svnweb.freebsd.org/changeset/base/275872 Log: MFC r275759: Pull in r221170 from upstream clang trunk (by Roman Divacky): Implement vaarg lowering for ppc32. Lowering of scalars and aggregates is supported. Complex numbers are not. This adds va_args support for PowerPC (32 bit) to clang. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D1308 Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Wed Dec 17 21:27:27 2014 (r275871) +++ stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Wed Dec 17 21:36:45 2014 (r275872) @@ -2733,11 +2733,19 @@ llvm::Value *NaClX86_64ABIInfo::EmitVAAr // PowerPC-32 - namespace { -class PPC32TargetCodeGenInfo : public DefaultTargetCodeGenInfo { +/// PPC32_SVR4_ABIInfo - The 32-bit PowerPC ELF (SVR4) ABI information. +class PPC32_SVR4_ABIInfo : public DefaultABIInfo { public: - PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : DefaultTargetCodeGenInfo(CGT) {} + PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {} + + llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, + CodeGenFunction &CGF) const; +}; + +class PPC32TargetCodeGenInfo : public TargetCodeGenInfo { +public: + PPC32TargetCodeGenInfo(CodeGenTypes &CGT) : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT)) {} int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const { // This is recovered from gcc output. @@ -2750,6 +2758,96 @@ public: } +llvm::Value *PPC32_SVR4_ABIInfo::EmitVAArg(llvm::Value *VAListAddr, + QualType Ty, + CodeGenFunction &CGF) const { + if (const ComplexType *CTy = Ty->getAs()) { + // TODO: Implement this. For now ignore. + (void)CTy; + return NULL; + } + + bool isI64 = Ty->isIntegerType() && getContext().getTypeSize(Ty) == 64; + bool isInt = Ty->isIntegerType() || Ty->isPointerType() || Ty->isAggregateType(); + llvm::Type *CharPtr = CGF.Int8PtrTy; + llvm::Type *CharPtrPtr = CGF.Int8PtrPtrTy; + + CGBuilderTy &Builder = CGF.Builder; + llvm::Value *GPRPtr = Builder.CreateBitCast(VAListAddr, CharPtr, "gprptr"); + llvm::Value *GPRPtrAsInt = Builder.CreatePtrToInt(GPRPtr, CGF.Int32Ty); + llvm::Value *FPRPtrAsInt = Builder.CreateAdd(GPRPtrAsInt, Builder.getInt32(1)); + llvm::Value *FPRPtr = Builder.CreateIntToPtr(FPRPtrAsInt, CharPtr); + llvm::Value *OverflowAreaPtrAsInt = Builder.CreateAdd(FPRPtrAsInt, Builder.getInt32(3)); + llvm::Value *OverflowAreaPtr = Builder.CreateIntToPtr(OverflowAreaPtrAsInt, CharPtrPtr); + llvm::Value *RegsaveAreaPtrAsInt = Builder.CreateAdd(OverflowAreaPtrAsInt, Builder.getInt32(4)); + llvm::Value *RegsaveAreaPtr = Builder.CreateIntToPtr(RegsaveAreaPtrAsInt, CharPtrPtr); + llvm::Value *GPR = Builder.CreateLoad(GPRPtr, false, "gpr"); + // Align GPR when TY is i64. + if (isI64) { + llvm::Value *GPRAnd = Builder.CreateAnd(GPR, Builder.getInt8(1)); + llvm::Value *CC64 = Builder.CreateICmpEQ(GPRAnd, Builder.getInt8(1)); + llvm::Value *GPRPlusOne = Builder.CreateAdd(GPR, Builder.getInt8(1)); + GPR = Builder.CreateSelect(CC64, GPRPlusOne, GPR); + } + llvm::Value *FPR = Builder.CreateLoad(FPRPtr, false, "fpr"); + llvm::Value *OverflowArea = Builder.CreateLoad(OverflowAreaPtr, false, "overflow_area"); + llvm::Value *OverflowAreaAsInt = Builder.CreatePtrToInt(OverflowArea, CGF.Int32Ty); + llvm::Value *RegsaveArea = Builder.CreateLoad(RegsaveAreaPtr, false, "regsave_area"); + llvm::Value *RegsaveAreaAsInt = Builder.CreatePtrToInt(RegsaveArea, CGF.Int32Ty); + + llvm::Value *CC = Builder.CreateICmpULT(isInt ? GPR : FPR, + Builder.getInt8(8), "cond"); + + llvm::Value *RegConstant = Builder.CreateMul(isInt ? GPR : FPR, + Builder.getInt8(isInt ? 4 : 8)); + + llvm::Value *OurReg = Builder.CreateAdd(RegsaveAreaAsInt, Builder.CreateSExt(RegConstant, CGF.Int32Ty)); + + if (Ty->isFloatingType()) + OurReg = Builder.CreateAdd(OurReg, Builder.getInt32(32)); + + llvm::BasicBlock *UsingRegs = CGF.createBasicBlock("using_regs"); + llvm::BasicBlock *UsingOverflow = CGF.createBasicBlock("using_overflow"); + llvm::BasicBlock *Cont = CGF.createBasicBlock("cont"); + + Builder.CreateCondBr(CC, UsingRegs, UsingOverflow); + + CGF.EmitBlock(UsingRegs); + + llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); + llvm::Value *Result1 = Builder.CreateIntToPtr(OurReg, PTy); + // Increase the GPR/FPR indexes. + if (isInt) { + GPR = Builder.CreateAdd(GPR, Builder.getInt8(isI64 ? 2 : 1)); + Builder.CreateStore(GPR, GPRPtr); + } else { + FPR = Builder.CreateAdd(FPR, Builder.getInt8(1)); + Builder.CreateStore(FPR, FPRPtr); + } + CGF.EmitBranch(Cont); + + CGF.EmitBlock(UsingOverflow); + + // Increase the overflow area. + llvm::Value *Result2 = Builder.CreateIntToPtr(OverflowAreaAsInt, PTy); + OverflowAreaAsInt = Builder.CreateAdd(OverflowAreaAsInt, Builder.getInt32(isInt ? 4 : 8)); + Builder.CreateStore(Builder.CreateIntToPtr(OverflowAreaAsInt, CharPtr), OverflowAreaPtr); + CGF.EmitBranch(Cont); + + CGF.EmitBlock(Cont); + + llvm::PHINode *Result = CGF.Builder.CreatePHI(PTy, 2, "vaarg.addr"); + Result->addIncoming(Result1, UsingRegs); + Result->addIncoming(Result2, UsingOverflow); + + if (Ty->isAggregateType()) { + llvm::Value *AGGPtr = Builder.CreateBitCast(Result, CharPtrPtr, "aggrptr") ; + return Builder.CreateLoad(AGGPtr, false, "aggr"); + } + + return Result; +} + bool PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const { From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 07:37:22 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AF522C6; Thu, 18 Dec 2014 07:37: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 25F191049; Thu, 18 Dec 2014 07:37: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 sBI7bMFm096698; Thu, 18 Dec 2014 07:37:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI7bMTj096697; Thu, 18 Dec 2014 07:37:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180737.sBI7bMTj096697@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 07:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275876 - stable/10/sys/geom/raid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 07:37:22 -0000 Author: mav Date: Thu Dec 18 07:37:21 2014 New Revision: 275876 URL: https://svnweb.freebsd.org/changeset/base/275876 Log: MFC r275475: Decode some binary fields of Intel metadata. Submitted by: Dmitry Luhtionov Modified: stable/10/sys/geom/raid/md_intel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/raid/md_intel.c ============================================================================== --- stable/10/sys/geom/raid/md_intel.c Thu Dec 18 05:17:18 2014 (r275875) +++ stable/10/sys/geom/raid/md_intel.c Thu Dec 18 07:37:21 2014 (r275876) @@ -366,6 +366,78 @@ intel_set_vol_curr_migr_unit(struct inte vol->curr_migr_unit_hi = curr_migr_unit >> 32; } +static char * +intel_status2str(int status) +{ + + switch (status) { + case INTEL_S_READY: + return ("READY"); + case INTEL_S_UNINITIALIZED: + return ("UNINITIALIZED"); + case INTEL_S_DEGRADED: + return ("DEGRADED"); + case INTEL_S_FAILURE: + return ("FAILURE"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_type2str(int type) +{ + + switch (type) { + case INTEL_T_RAID0: + return ("RAID0"); + case INTEL_T_RAID1: + return ("RAID1"); + case INTEL_T_RAID5: + return ("RAID5"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_cngst2str(int cng_state) +{ + + switch (cng_state) { + case INTEL_CNGST_UPDATED: + return ("UPDATED"); + case INTEL_CNGST_NEEDS_UPDATE: + return ("NEEDS_UPDATE"); + case INTEL_CNGST_MASTER_MISSING: + return ("MASTER_MISSING"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_mt2str(int type) +{ + + switch (type) { + case INTEL_MT_INIT: + return ("INIT"); + case INTEL_MT_REBUILD: + return ("REBUILD"); + case INTEL_MT_VERIFY: + return ("VERIFY"); + case INTEL_MT_GEN_MIGR: + return ("GEN_MIGR"); + case INTEL_MT_STATE_CHANGE: + return ("STATE_CHANGE"); + case INTEL_MT_REPAIR: + return ("REPAIR"); + default: + return ("UNKNOWN"); + } +} + static void g_raid_md_intel_print(struct intel_raid_conf *meta) { @@ -384,7 +456,22 @@ g_raid_md_intel_print(struct intel_raid_ printf("config_id 0x%08x\n", meta->config_id); printf("generation 0x%08x\n", meta->generation); printf("error_log_size %d\n", meta->error_log_size); - printf("attributes 0x%08x\n", meta->attributes); + printf("attributes 0x%b\n", meta->attributes, + "\020" + "\001RAID0" + "\002RAID1" + "\003RAID10" + "\004RAID1E" + "\005RAID15" + "\006RAIDCNG" + "\007EXT_STRIP" + "\032NVM_CACHE" + "\0332TB_DISK" + "\034BBM" + "\035NVM_CACHE" + "\0362TB" + "\037PM" + "\040CHECKSUM"); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); printf("error_log_pos %u\n", meta->error_log_pos); @@ -392,32 +479,50 @@ g_raid_md_intel_print(struct intel_raid_ printf("orig_config_id 0x%08x\n", meta->orig_config_id); printf("pwr_cycle_count %u\n", meta->pwr_cycle_count); printf("bbm_log_size %u\n", meta->bbm_log_size); + printf("Flags: S - Spare, A - Assigned, F - Failed, O - Online, D - Disabled\n"); printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags owner\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u %u 0x%08x 0x%08x %08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%b %08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, meta->disk[i].sectors_hi, meta->disk[i].id, - meta->disk[i].flags, meta->disk[i].owner_cfg_num); + meta->disk[i].flags, "\20\01S\02A\03F\04O\05D", + meta->disk[i].owner_cfg_num); } for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); printf(" ****** Volume %d ******\n", i); printf(" name %.16s\n", mvol->name); printf(" total_sectors %ju\n", mvol->total_sectors); - printf(" state 0x%08x\n", mvol->state); + printf(" state 0x%b\n", mvol->state, + "\020" + "\001BOOTABLE" + "\002BOOT_DEVICE" + "\003READ_COALESCING" + "\004WRITE_COALESCING" + "\005LAST_SHUTDOWN_DIRTY" + "\006HIDDEN_AT_BOOT" + "\007CURRENTLY_HIDDEN" + "\010VERIFY_AND_FIX" + "\011MAP_STATE_UNINIT" + "\012NO_AUTO_RECOVERY" + "\013CLONE_N_GO" + "\014CLONE_MAN_SYNC" + "\015CNG_MASTER_DISK_NUM"); printf(" reserved %u\n", mvol->reserved); printf(" migr_priority %u\n", mvol->migr_priority); printf(" num_sub_vols %u\n", mvol->num_sub_vols); printf(" tid %u\n", mvol->tid); printf(" cng_master_disk %u\n", mvol->cng_master_disk); printf(" cache_policy %u\n", mvol->cache_policy); - printf(" cng_state %u\n", mvol->cng_state); + printf(" cng_state %u (%s)\n", mvol->cng_state, + intel_cngst2str(mvol->cng_state)); printf(" cng_sub_state %u\n", mvol->cng_sub_state); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); printf(" migr_state %u\n", mvol->migr_state); - printf(" migr_type %u\n", mvol->migr_type); + printf(" migr_type %u (%s)\n", mvol->migr_type, + intel_mt2str(mvol->migr_type)); printf(" dirty %u\n", mvol->dirty); printf(" fs_state %u\n", mvol->fs_state); printf(" verify_errors %u\n", mvol->verify_errors); @@ -433,8 +538,10 @@ g_raid_md_intel_print(struct intel_raid_ printf(" stripe_count %u\n", mmap->stripe_count); printf(" stripe_count_hi %u\n", mmap->stripe_count_hi); printf(" strip_sectors %u\n", mmap->strip_sectors); - printf(" status %u\n", mmap->status); - printf(" type %u\n", mmap->type); + printf(" status %u (%s)\n", mmap->status, + intel_status2str(mmap->status)); + printf(" type %u (%s)\n", mmap->type, + intel_type2str(mmap->type)); printf(" total_disks %u\n", mmap->total_disks); printf(" total_domains %u\n", mmap->total_domains); printf(" failed_disk_num %u\n", mmap->failed_disk_num); From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 07:38:42 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A23E40F; Thu, 18 Dec 2014 07:38: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 34D9E1062; Thu, 18 Dec 2014 07:38: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 sBI7cgTG096908; Thu, 18 Dec 2014 07:38:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI7cgvd096907; Thu, 18 Dec 2014 07:38:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180738.sBI7cgvd096907@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 07:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275877 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 07:38:42 -0000 Author: mav Date: Thu Dec 18 07:38:41 2014 New Revision: 275877 URL: https://svnweb.freebsd.org/changeset/base/275877 Log: MFC r275475: Decode some binary fields of Intel metadata. Submitted by: Dmitry Luhtionov Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Dec 18 07:37:21 2014 (r275876) +++ stable/9/sys/geom/raid/md_intel.c Thu Dec 18 07:38:41 2014 (r275877) @@ -366,6 +366,78 @@ intel_set_vol_curr_migr_unit(struct inte vol->curr_migr_unit_hi = curr_migr_unit >> 32; } +static char * +intel_status2str(int status) +{ + + switch (status) { + case INTEL_S_READY: + return ("READY"); + case INTEL_S_UNINITIALIZED: + return ("UNINITIALIZED"); + case INTEL_S_DEGRADED: + return ("DEGRADED"); + case INTEL_S_FAILURE: + return ("FAILURE"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_type2str(int type) +{ + + switch (type) { + case INTEL_T_RAID0: + return ("RAID0"); + case INTEL_T_RAID1: + return ("RAID1"); + case INTEL_T_RAID5: + return ("RAID5"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_cngst2str(int cng_state) +{ + + switch (cng_state) { + case INTEL_CNGST_UPDATED: + return ("UPDATED"); + case INTEL_CNGST_NEEDS_UPDATE: + return ("NEEDS_UPDATE"); + case INTEL_CNGST_MASTER_MISSING: + return ("MASTER_MISSING"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_mt2str(int type) +{ + + switch (type) { + case INTEL_MT_INIT: + return ("INIT"); + case INTEL_MT_REBUILD: + return ("REBUILD"); + case INTEL_MT_VERIFY: + return ("VERIFY"); + case INTEL_MT_GEN_MIGR: + return ("GEN_MIGR"); + case INTEL_MT_STATE_CHANGE: + return ("STATE_CHANGE"); + case INTEL_MT_REPAIR: + return ("REPAIR"); + default: + return ("UNKNOWN"); + } +} + static void g_raid_md_intel_print(struct intel_raid_conf *meta) { @@ -384,7 +456,22 @@ g_raid_md_intel_print(struct intel_raid_ printf("config_id 0x%08x\n", meta->config_id); printf("generation 0x%08x\n", meta->generation); printf("error_log_size %d\n", meta->error_log_size); - printf("attributes 0x%08x\n", meta->attributes); + printf("attributes 0x%b\n", meta->attributes, + "\020" + "\001RAID0" + "\002RAID1" + "\003RAID10" + "\004RAID1E" + "\005RAID15" + "\006RAIDCNG" + "\007EXT_STRIP" + "\032NVM_CACHE" + "\0332TB_DISK" + "\034BBM" + "\035NVM_CACHE" + "\0362TB" + "\037PM" + "\040CHECKSUM"); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); printf("error_log_pos %u\n", meta->error_log_pos); @@ -392,32 +479,50 @@ g_raid_md_intel_print(struct intel_raid_ printf("orig_config_id 0x%08x\n", meta->orig_config_id); printf("pwr_cycle_count %u\n", meta->pwr_cycle_count); printf("bbm_log_size %u\n", meta->bbm_log_size); + printf("Flags: S - Spare, A - Assigned, F - Failed, O - Online, D - Disabled\n"); printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags owner\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u %u 0x%08x 0x%08x %08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%b %08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, meta->disk[i].sectors_hi, meta->disk[i].id, - meta->disk[i].flags, meta->disk[i].owner_cfg_num); + meta->disk[i].flags, "\20\01S\02A\03F\04O\05D", + meta->disk[i].owner_cfg_num); } for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); printf(" ****** Volume %d ******\n", i); printf(" name %.16s\n", mvol->name); printf(" total_sectors %ju\n", mvol->total_sectors); - printf(" state 0x%08x\n", mvol->state); + printf(" state 0x%b\n", mvol->state, + "\020" + "\001BOOTABLE" + "\002BOOT_DEVICE" + "\003READ_COALESCING" + "\004WRITE_COALESCING" + "\005LAST_SHUTDOWN_DIRTY" + "\006HIDDEN_AT_BOOT" + "\007CURRENTLY_HIDDEN" + "\010VERIFY_AND_FIX" + "\011MAP_STATE_UNINIT" + "\012NO_AUTO_RECOVERY" + "\013CLONE_N_GO" + "\014CLONE_MAN_SYNC" + "\015CNG_MASTER_DISK_NUM"); printf(" reserved %u\n", mvol->reserved); printf(" migr_priority %u\n", mvol->migr_priority); printf(" num_sub_vols %u\n", mvol->num_sub_vols); printf(" tid %u\n", mvol->tid); printf(" cng_master_disk %u\n", mvol->cng_master_disk); printf(" cache_policy %u\n", mvol->cache_policy); - printf(" cng_state %u\n", mvol->cng_state); + printf(" cng_state %u (%s)\n", mvol->cng_state, + intel_cngst2str(mvol->cng_state)); printf(" cng_sub_state %u\n", mvol->cng_sub_state); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); printf(" migr_state %u\n", mvol->migr_state); - printf(" migr_type %u\n", mvol->migr_type); + printf(" migr_type %u (%s)\n", mvol->migr_type, + intel_mt2str(mvol->migr_type)); printf(" dirty %u\n", mvol->dirty); printf(" fs_state %u\n", mvol->fs_state); printf(" verify_errors %u\n", mvol->verify_errors); @@ -433,8 +538,10 @@ g_raid_md_intel_print(struct intel_raid_ printf(" stripe_count %u\n", mmap->stripe_count); printf(" stripe_count_hi %u\n", mmap->stripe_count_hi); printf(" strip_sectors %u\n", mmap->strip_sectors); - printf(" status %u\n", mmap->status); - printf(" type %u\n", mmap->type); + printf(" status %u (%s)\n", mmap->status, + intel_status2str(mmap->status)); + printf(" type %u (%s)\n", mmap->type, + intel_type2str(mmap->type)); printf(" total_disks %u\n", mmap->total_disks); printf(" total_domains %u\n", mmap->total_domains); printf(" failed_disk_num %u\n", mmap->failed_disk_num); From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:22:20 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 528EBAFC; Thu, 18 Dec 2014 08:22: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 3CFB21754; Thu, 18 Dec 2014 08:22: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 sBI8MKpn019415; Thu, 18 Dec 2014 08:22:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8MHv8019400; Thu, 18 Dec 2014 08:22:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180822.sBI8MHv8019400@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275878 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:22:20 -0000 Author: mav Date: Thu Dec 18 08:22:16 2014 New Revision: 275878 URL: https://svnweb.freebsd.org/changeset/base/275878 Log: MFC r274962: Replace home-grown CTL IO allocator with UMA. Old allocator created significant lock congestion protecting its lists of preallocated I/Os, while UMA provides much better SMP scalability. The downside of UMA is lack of reliable preallocation, that could guarantee successful allocation in non-sleepable environments. But careful code review shown, that only CAM target frontend really has that requirement. Fix that making that frontend preallocate and statically bind CTL I/O for every ATIO/INOT it preallocates any way. That allows to avoid allocations in hot I/O path. Other frontends either may sleep in allocation context or can properly handle allocation errors. On 40-core server with 6 ZVOL-backed LUNs and 7 iSCSI client connections this change increases peak performance from ~700K to >1M IOPS! Yay! :) Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_internal.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/ctl_tpc.c stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:22:16 2014 (r275878) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -646,7 +647,7 @@ ctl_isc_event_handler(ctl_ha_channel cha #if 0 printf("Serialize\n"); #endif - io = ctl_alloc_io((void *)ctl_softc->othersc_pool); + io = ctl_alloc_io_nowait(ctl_softc->othersc_pool); if (io == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -891,8 +892,8 @@ ctl_isc_event_handler(ctl_ha_channel cha /* Handle resets sent from the other side */ case CTL_MSG_MANAGE_TASKS: { struct ctl_taskio *taskio; - taskio = (struct ctl_taskio *)ctl_alloc_io( - (void *)ctl_softc->othersc_pool); + taskio = (struct ctl_taskio *)ctl_alloc_io_nowait( + ctl_softc->othersc_pool); if (taskio == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -920,8 +921,8 @@ ctl_isc_event_handler(ctl_ha_channel cha } /* Persistent Reserve action which needs attention */ case CTL_MSG_PERS_ACTION: - presio = (struct ctl_prio *)ctl_alloc_io( - (void *)ctl_softc->othersc_pool); + presio = (struct ctl_prio *)ctl_alloc_io_nowait( + ctl_softc->othersc_pool); if (presio == NULL) { printf("ctl_isc_event_handler: can't allocate " "ctl_io!\n"); @@ -1005,7 +1006,7 @@ static int ctl_init(void) { struct ctl_softc *softc; - struct ctl_io_pool *internal_pool, *emergency_pool, *other_pool; + void *other_pool; struct ctl_port *port; int i, error, retval; //int isc_retval; @@ -1051,7 +1052,8 @@ ctl_init(void) "Report no lun possible for invalid LUNs"); mtx_init(&softc->ctl_lock, "CTL mutex", NULL, MTX_DEF); - mtx_init(&softc->pool_lock, "CTL pool mutex", NULL, MTX_DEF); + softc->io_zone = uma_zcreate("CTL IO", sizeof(union ctl_io), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); softc->open_count = 0; /* @@ -1088,36 +1090,15 @@ ctl_init(void) STAILQ_INIT(&softc->fe_list); STAILQ_INIT(&softc->port_list); STAILQ_INIT(&softc->be_list); - STAILQ_INIT(&softc->io_pools); ctl_tpc_init(softc); - if (ctl_pool_create(softc, CTL_POOL_INTERNAL, CTL_POOL_ENTRIES_INTERNAL, - &internal_pool)!= 0){ - printf("ctl: can't allocate %d entry internal pool, " - "exiting\n", CTL_POOL_ENTRIES_INTERNAL); - return (ENOMEM); - } - - if (ctl_pool_create(softc, CTL_POOL_EMERGENCY, - CTL_POOL_ENTRIES_EMERGENCY, &emergency_pool) != 0) { - printf("ctl: can't allocate %d entry emergency pool, " - "exiting\n", CTL_POOL_ENTRIES_EMERGENCY); - ctl_pool_free(internal_pool); - return (ENOMEM); - } - - if (ctl_pool_create(softc, CTL_POOL_4OTHERSC, CTL_POOL_ENTRIES_OTHER_SC, + if (ctl_pool_create(softc, "othersc", CTL_POOL_ENTRIES_OTHER_SC, &other_pool) != 0) { printf("ctl: can't allocate %d entry other SC pool, " "exiting\n", CTL_POOL_ENTRIES_OTHER_SC); - ctl_pool_free(internal_pool); - ctl_pool_free(emergency_pool); return (ENOMEM); } - - softc->internal_pool = internal_pool; - softc->emergency_pool = emergency_pool; softc->othersc_pool = other_pool; if (worker_threads <= 0) @@ -1139,8 +1120,6 @@ ctl_init(void) &softc->ctl_proc, &thr->thread, 0, 0, "ctl", "work%d", i); if (error != 0) { printf("error creating CTL work thread!\n"); - ctl_pool_free(internal_pool); - ctl_pool_free(emergency_pool); ctl_pool_free(other_pool); return (error); } @@ -1149,8 +1128,6 @@ ctl_init(void) &softc->ctl_proc, NULL, 0, 0, "ctl", "lun"); if (error != 0) { printf("error creating CTL lun thread!\n"); - ctl_pool_free(internal_pool); - ctl_pool_free(emergency_pool); ctl_pool_free(other_pool); return (error); } @@ -1158,8 +1135,6 @@ ctl_init(void) &softc->ctl_proc, NULL, 0, 0, "ctl", "thresh"); if (error != 0) { printf("error creating CTL threshold thread!\n"); - ctl_pool_free(internal_pool); - ctl_pool_free(emergency_pool); ctl_pool_free(other_pool); return (error); } @@ -1212,7 +1187,6 @@ ctl_shutdown(void) { struct ctl_softc *softc; struct ctl_lun *lun, *next_lun; - struct ctl_io_pool *pool; softc = (struct ctl_softc *)control_softc; @@ -1233,24 +1207,13 @@ ctl_shutdown(void) ctl_frontend_deregister(&ioctl_frontend); - /* - * This will rip the rug out from under any FETDs or anyone else - * that has a pool allocated. Since we increment our module - * refcount any time someone outside the main CTL module allocates - * a pool, we shouldn't have any problems here. The user won't be - * able to unload the CTL module until client modules have - * successfully unloaded. - */ - while ((pool = STAILQ_FIRST(&softc->io_pools)) != NULL) - ctl_pool_free(pool); - #if 0 ctl_shutdown_thread(softc->work_thread); mtx_destroy(&softc->queue_lock); #endif ctl_tpc_shutdown(softc); - mtx_destroy(&softc->pool_lock); + uma_zdestroy(softc->io_zone); mtx_destroy(&softc->ctl_lock); destroy_dev(softc->dev); @@ -2373,21 +2336,15 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } io = ctl_alloc_io(softc->ioctl_info.port.ctl_pool_ref); - if (io == NULL) { - printf("ctl_ioctl: can't allocate ctl_io!\n"); - retval = ENOSPC; - break; - } /* * Need to save the pool reference so it doesn't get * spammed by the user's ctl_io. */ pool_tmp = io->io_hdr.pool; - memcpy(io, (void *)addr, sizeof(*io)); - io->io_hdr.pool = pool_tmp; + /* * No status yet, so make sure the status is set properly. */ @@ -3731,285 +3688,95 @@ ctl_kfree_io(union ctl_io *io) #endif /* unused */ /* - * ctl_softc, pool_type, total_ctl_io are passed in. + * ctl_softc, pool_name, total_ctl_io are passed in. * npool is passed out. */ int -ctl_pool_create(struct ctl_softc *ctl_softc, ctl_pool_type pool_type, - uint32_t total_ctl_io, struct ctl_io_pool **npool) +ctl_pool_create(struct ctl_softc *ctl_softc, const char *pool_name, + uint32_t total_ctl_io, void **npool) { - uint32_t i; - union ctl_io *cur_io, *next_io; +#ifdef IO_POOLS struct ctl_io_pool *pool; - int retval; - - retval = 0; pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, M_NOWAIT | M_ZERO); - if (pool == NULL) { - retval = ENOMEM; - goto bailout; - } + if (pool == NULL) + return (ENOMEM); - pool->type = pool_type; + snprintf(pool->name, sizeof(pool->name), "CTL IO %s", pool_name); pool->ctl_softc = ctl_softc; - - mtx_lock(&ctl_softc->pool_lock); - pool->id = ctl_softc->cur_pool_id++; - mtx_unlock(&ctl_softc->pool_lock); - - pool->flags = CTL_POOL_FLAG_NONE; - pool->refcount = 1; /* Reference for validity. */ - STAILQ_INIT(&pool->free_queue); - - /* - * XXX KDM other options here: - * - allocate a page at a time - * - allocate one big chunk of memory. - * Page allocation might work well, but would take a little more - * tracking. - */ - for (i = 0; i < total_ctl_io; i++) { - cur_io = (union ctl_io *)malloc(sizeof(*cur_io), M_CTLIO, - M_NOWAIT); - if (cur_io == NULL) { - retval = ENOMEM; - break; - } - cur_io->io_hdr.pool = pool; - STAILQ_INSERT_TAIL(&pool->free_queue, &cur_io->io_hdr, links); - pool->total_ctl_io++; - pool->free_ctl_io++; - } - - if (retval != 0) { - for (cur_io = (union ctl_io *)STAILQ_FIRST(&pool->free_queue); - cur_io != NULL; cur_io = next_io) { - next_io = (union ctl_io *)STAILQ_NEXT(&cur_io->io_hdr, - links); - STAILQ_REMOVE(&pool->free_queue, &cur_io->io_hdr, - ctl_io_hdr, links); - free(cur_io, M_CTLIO); - } - - free(pool, M_CTL); - goto bailout; - } - mtx_lock(&ctl_softc->pool_lock); - ctl_softc->num_pools++; - STAILQ_INSERT_TAIL(&ctl_softc->io_pools, pool, links); - /* - * Increment our usage count if this is an external consumer, so we - * can't get unloaded until the external consumer (most likely a - * FETD) unloads and frees his pool. - * - * XXX KDM will this increment the caller's module use count, or - * mine? - */ -#if 0 - if ((pool_type != CTL_POOL_EMERGENCY) - && (pool_type != CTL_POOL_INTERNAL) - && (pool_type != CTL_POOL_4OTHERSC)) - MOD_INC_USE_COUNT; -#endif - - mtx_unlock(&ctl_softc->pool_lock); + pool->zone = uma_zsecond_create(pool->name, NULL, + NULL, NULL, NULL, ctl_softc->io_zone); + /* uma_prealloc(pool->zone, total_ctl_io); */ *npool = pool; - -bailout: - - return (retval); -} - -static int -ctl_pool_acquire(struct ctl_io_pool *pool) -{ - - mtx_assert(&pool->ctl_softc->pool_lock, MA_OWNED); - - if (pool->flags & CTL_POOL_FLAG_INVALID) - return (EINVAL); - - pool->refcount++; - - return (0); -} - -static void -ctl_pool_release(struct ctl_io_pool *pool) -{ - struct ctl_softc *ctl_softc = pool->ctl_softc; - union ctl_io *io; - - mtx_assert(&ctl_softc->pool_lock, MA_OWNED); - - if (--pool->refcount != 0) - return; - - while ((io = (union ctl_io *)STAILQ_FIRST(&pool->free_queue)) != NULL) { - STAILQ_REMOVE(&pool->free_queue, &io->io_hdr, ctl_io_hdr, - links); - free(io, M_CTLIO); - } - - STAILQ_REMOVE(&ctl_softc->io_pools, pool, ctl_io_pool, links); - ctl_softc->num_pools--; - - /* - * XXX KDM will this decrement the caller's usage count or mine? - */ -#if 0 - if ((pool->type != CTL_POOL_EMERGENCY) - && (pool->type != CTL_POOL_INTERNAL) - && (pool->type != CTL_POOL_4OTHERSC)) - MOD_DEC_USE_COUNT; +#else + *npool = ctl_softc->io_zone; #endif - - free(pool, M_CTL); + return (0); } void ctl_pool_free(struct ctl_io_pool *pool) { - struct ctl_softc *ctl_softc; if (pool == NULL) return; - ctl_softc = pool->ctl_softc; - mtx_lock(&ctl_softc->pool_lock); - pool->flags |= CTL_POOL_FLAG_INVALID; - ctl_pool_release(pool); - mtx_unlock(&ctl_softc->pool_lock); +#ifdef IO_POOLS + uma_zdestroy(pool->zone); + free(pool, M_CTL); +#endif } -/* - * This routine does not block (except for spinlocks of course). - * It tries to allocate a ctl_io union from the caller's pool as quickly as - * possible. - */ union ctl_io * ctl_alloc_io(void *pool_ref) { union ctl_io *io; - struct ctl_softc *ctl_softc; - struct ctl_io_pool *pool, *npool; - struct ctl_io_pool *emergency_pool; +#ifdef IO_POOLS + struct ctl_io_pool *pool = (struct ctl_io_pool *)pool_ref; - pool = (struct ctl_io_pool *)pool_ref; - - if (pool == NULL) { - printf("%s: pool is NULL\n", __func__); - return (NULL); - } - - emergency_pool = NULL; - - ctl_softc = pool->ctl_softc; - - mtx_lock(&ctl_softc->pool_lock); - /* - * First, try to get the io structure from the user's pool. - */ - if (ctl_pool_acquire(pool) == 0) { - io = (union ctl_io *)STAILQ_FIRST(&pool->free_queue); - if (io != NULL) { - STAILQ_REMOVE_HEAD(&pool->free_queue, links); - pool->total_allocated++; - pool->free_ctl_io--; - mtx_unlock(&ctl_softc->pool_lock); - return (io); - } else - ctl_pool_release(pool); - } - /* - * If he doesn't have any io structures left, search for an - * emergency pool and grab one from there. - */ - STAILQ_FOREACH(npool, &ctl_softc->io_pools, links) { - if (npool->type != CTL_POOL_EMERGENCY) - continue; - - if (ctl_pool_acquire(npool) != 0) - continue; - - emergency_pool = npool; - - io = (union ctl_io *)STAILQ_FIRST(&npool->free_queue); - if (io != NULL) { - STAILQ_REMOVE_HEAD(&npool->free_queue, links); - npool->total_allocated++; - npool->free_ctl_io--; - mtx_unlock(&ctl_softc->pool_lock); - return (io); - } else - ctl_pool_release(npool); - } - - /* Drop the spinlock before we malloc */ - mtx_unlock(&ctl_softc->pool_lock); + io = uma_zalloc(pool->zone, M_WAITOK); +#else + io = uma_zalloc((uma_zone_t)pool_ref, M_WAITOK); +#endif + if (io != NULL) + io->io_hdr.pool = pool_ref; + return (io); +} - /* - * The emergency pool (if it exists) didn't have one, so try an - * atomic (i.e. nonblocking) malloc and see if we get lucky. - */ - io = (union ctl_io *)malloc(sizeof(*io), M_CTLIO, M_NOWAIT); - if (io != NULL) { - /* - * If the emergency pool exists but is empty, add this - * ctl_io to its list when it gets freed. - */ - if (emergency_pool != NULL) { - mtx_lock(&ctl_softc->pool_lock); - if (ctl_pool_acquire(emergency_pool) == 0) { - io->io_hdr.pool = emergency_pool; - emergency_pool->total_ctl_io++; - /* - * Need to bump this, otherwise - * total_allocated and total_freed won't - * match when we no longer have anything - * outstanding. - */ - emergency_pool->total_allocated++; - } - mtx_unlock(&ctl_softc->pool_lock); - } else - io->io_hdr.pool = NULL; - } +union ctl_io * +ctl_alloc_io_nowait(void *pool_ref) +{ + union ctl_io *io; +#ifdef IO_POOLS + struct ctl_io_pool *pool = (struct ctl_io_pool *)pool_ref; + io = uma_zalloc(pool->zone, M_NOWAIT); +#else + io = uma_zalloc((uma_zone_t)pool_ref, M_NOWAIT); +#endif + if (io != NULL) + io->io_hdr.pool = pool_ref; return (io); } void ctl_free_io(union ctl_io *io) { +#ifdef IO_POOLS + struct ctl_io_pool *pool; +#endif + if (io == NULL) return; - /* - * If this ctl_io has a pool, return it to that pool. - */ - if (io->io_hdr.pool != NULL) { - struct ctl_io_pool *pool; - - pool = (struct ctl_io_pool *)io->io_hdr.pool; - mtx_lock(&pool->ctl_softc->pool_lock); - io->io_hdr.io_type = 0xff; - STAILQ_INSERT_TAIL(&pool->free_queue, &io->io_hdr, links); - pool->total_freed++; - pool->free_ctl_io++; - ctl_pool_release(pool); - mtx_unlock(&pool->ctl_softc->pool_lock); - } else { - /* - * Otherwise, just free it. We probably malloced it and - * the emergency pool wasn't available. - */ - free(io, M_CTLIO); - } - +#ifdef IO_POOLS + pool = (struct ctl_io_pool *)io->io_hdr.pool; + uma_zfree(pool->zone, io); +#else + uma_zfree((uma_zone_t)io->io_hdr.pool, io); +#endif } void @@ -4024,9 +3791,7 @@ ctl_zero_io(union ctl_io *io) * May need to preserve linked list pointers at some point too. */ pool_ref = io->io_hdr.pool; - memset(io, 0, sizeof(*io)); - io->io_hdr.pool = pool_ref; } @@ -5659,16 +5424,10 @@ ctl_start_stop(struct ctl_scsiio *ctsio) union ctl_io *new_io; new_io = ctl_alloc_io(ctsio->io_hdr.pool); - if (new_io == NULL) { - ctl_set_busy(ctsio); - ctl_done((union ctl_io *)ctsio); - } else { - ctl_copy_io((union ctl_io *)ctsio, - new_io); - retval = lun->backend->config_write(new_io); - ctl_set_success(ctsio); - ctl_done((union ctl_io *)ctsio); - } + ctl_copy_io((union ctl_io *)ctsio, new_io); + retval = lun->backend->config_write(new_io); + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); } else { retval = lun->backend->config_write( (union ctl_io *)ctsio); Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_frontend.c Thu Dec 18 08:22:16 2014 (r275878) @@ -138,7 +138,7 @@ ctl_frontend_find(char *frontend_name) int ctl_port_register(struct ctl_port *port) { - struct ctl_io_pool *pool; + void *pool; int port_num; int retval; @@ -176,7 +176,7 @@ ctl_port_register(struct ctl_port *port) * pending sense queue on the next command, whether or not it is * a REQUEST SENSE. */ - retval = ctl_pool_create(control_softc, CTL_POOL_FETD, + retval = ctl_pool_create(control_softc, port->port_name, port->num_requested_ctl_io + 20, &pool); if (retval != 0) { free(port->wwpn_iid, M_CTL); Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Dec 18 08:22:16 2014 (r275878) @@ -545,7 +545,7 @@ cfcs_action(struct cam_sim *sim, union c return; } - io = ctl_alloc_io(softc->port.ctl_pool_ref); + io = ctl_alloc_io_nowait(softc->port.ctl_pool_ref); if (io == NULL) { printf("%s: can't allocate ctl_io\n", __func__); ccb->ccb_h.status = CAM_BUSY | CAM_DEV_QFRZN; @@ -642,7 +642,7 @@ cfcs_action(struct cam_sim *sim, union c return; } - io = ctl_alloc_io(softc->port.ctl_pool_ref); + io = ctl_alloc_io_nowait(softc->port.ctl_pool_ref); if (io == NULL) { ccb->ccb_h.status = CAM_BUSY | CAM_DEV_QFRZN; xpt_freeze_devq(ccb->ccb_h.path, 1); @@ -737,7 +737,7 @@ cfcs_action(struct cam_sim *sim, union c return; } - io = ctl_alloc_io(softc->port.ctl_pool_ref); + io = ctl_alloc_io_nowait(softc->port.ctl_pool_ref); if (io == NULL) { ccb->ccb_h.status = CAM_BUSY | CAM_DEV_QFRZN; xpt_freeze_devq(ccb->ccb_h.path, 1); Modified: stable/10/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_internal.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_frontend_internal.c Thu Dec 18 08:22:16 2014 (r275878) @@ -761,11 +761,6 @@ cfi_done(union ctl_io *io) struct cfi_lun_io *new_lun_io; new_io = ctl_alloc_io(softc->port.ctl_pool_ref); - if (new_io == NULL) { - printf("%s: unable to allocate ctl_io for " - "error recovery\n", __func__); - goto done; - } ctl_zero_io(new_io); new_io->io_hdr.io_type = CTL_IO_TASK; @@ -967,12 +962,6 @@ cfi_lun_probe(struct cfi_lun *lun, int h union ctl_io *io; io = ctl_alloc_io(lun->softc->port.ctl_pool_ref); - if (io == NULL) { - printf("%s: unable to alloc ctl_io for target %ju " - "lun %d probe\n", __func__, - (uintmax_t)lun->target_id.id, lun->lun_id); - return; - } ctl_scsi_inquiry(io, /*data_ptr*/(uint8_t *)&lun->inq_data, /*data_len*/ sizeof(lun->inq_data), @@ -1014,12 +1003,6 @@ cfi_lun_probe(struct cfi_lun *lun, int h union ctl_io *io; io = ctl_alloc_io(lun->softc->port.ctl_pool_ref); - if (io == NULL) { - printf("%s: unable to alloc ctl_io for target %ju " - "lun %d probe\n", __func__, - (uintmax_t)lun->target_id.id, lun->lun_id); - return; - } dataptr = malloc(sizeof(struct scsi_read_capacity_data_long), M_CTL_CFI, M_NOWAIT); @@ -1394,7 +1377,7 @@ cfi_action(struct cfi_metatask *metatask if (SID_TYPE(&lun->inq_data) != T_DIRECT) continue; da_luns++; - io = ctl_alloc_io(softc->port.ctl_pool_ref); + io = ctl_alloc_io_nowait(softc->port.ctl_pool_ref); if (io != NULL) { ios_allocated++; STAILQ_INSERT_TAIL(&tmp_io_list, &io->io_hdr, @@ -1548,7 +1531,7 @@ cfi_action(struct cfi_metatask *metatask } - io = ctl_alloc_io(softc->port.ctl_pool_ref); + io = ctl_alloc_io_nowait(softc->port.ctl_pool_ref); if (io == NULL) { metatask->status = CFI_MT_ERROR; metatask->taskinfo.bbrread.status = CFI_BBR_NO_MEM; Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Dec 18 08:22:16 2014 (r275878) @@ -546,13 +546,6 @@ cfiscsi_pdu_handle_scsi_command(struct i return; } io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); - if (io == NULL) { - CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io; " - "dropping connection"); - icl_pdu_free(request); - cfiscsi_session_terminate(cs); - return; - } ctl_zero_io(io); io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request; io->io_hdr.io_type = CTL_IO_SCSI; @@ -610,13 +603,6 @@ cfiscsi_pdu_handle_task_request(struct i cs = PDU_SESSION(request); bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); - if (io == NULL) { - CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io;" - "dropping connection"); - icl_pdu_free(request); - cfiscsi_session_terminate(cs); - return; - } ctl_zero_io(io); io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request; io->io_hdr.io_type = CTL_IO_TASK; @@ -1067,10 +1053,6 @@ cfiscsi_session_terminate_tasks(struct c 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"); - return; - } ctl_zero_io(io); io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = cs; io->io_hdr.io_type = CTL_IO_TASK; Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_io.h Thu Dec 18 08:22:16 2014 (r275878) @@ -511,6 +511,7 @@ union ctl_io { #ifdef _KERNEL union ctl_io *ctl_alloc_io(void *pool_ref); +union ctl_io *ctl_alloc_io_nowait(void *pool_ref); void ctl_free_io(union ctl_io *io); void ctl_zero_io(union ctl_io *io); void ctl_copy_io(union ctl_io *src, union ctl_io *dest); Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:22:16 2014 (r275878) @@ -71,34 +71,13 @@ struct ctl_fe_ioctl_params { ctl_fe_ioctl_state state; }; -#define CTL_POOL_ENTRIES_INTERNAL 200 -#define CTL_POOL_ENTRIES_EMERGENCY 300 #define CTL_POOL_ENTRIES_OTHER_SC 200 -typedef enum { - CTL_POOL_INTERNAL, - CTL_POOL_FETD, - CTL_POOL_EMERGENCY, - CTL_POOL_4OTHERSC -} ctl_pool_type; - -typedef enum { - CTL_POOL_FLAG_NONE = 0x00, - CTL_POOL_FLAG_INVALID = 0x01 -} ctl_pool_flags; - struct ctl_io_pool { - ctl_pool_type type; - ctl_pool_flags flags; + char name[64]; uint32_t id; struct ctl_softc *ctl_softc; - uint32_t refcount; - uint64_t total_allocated; - uint64_t total_freed; - int32_t total_ctl_io; - int32_t free_ctl_io; - STAILQ_HEAD(, ctl_io_hdr) free_queue; - STAILQ_ENTRY(ctl_io_pool) links; + struct uma_zone *zone; }; typedef enum { @@ -475,9 +454,7 @@ struct ctl_softc { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; struct ctl_ioctl_info ioctl_info; - struct ctl_io_pool *internal_pool; - struct ctl_io_pool *emergency_pool; - struct ctl_io_pool *othersc_pool; + void *othersc_pool; struct proc *ctl_proc; int targ_online; uint32_t ctl_lun_mask[(CTL_MAX_LUNS + 31) / 32]; @@ -492,10 +469,8 @@ struct ctl_softc { struct ctl_port *ctl_ports[CTL_MAX_PORTS]; uint32_t num_backends; STAILQ_HEAD(, ctl_backend_driver) be_list; - struct mtx pool_lock; - uint32_t num_pools; + struct uma_zone *io_zone; uint32_t cur_pool_id; - STAILQ_HEAD(, ctl_io_pool) io_pools; struct ctl_thread threads[CTL_MAX_THREADS]; TAILQ_HEAD(tpc_tokens, tpc_token) tpc_tokens; struct callout tpc_timeout; @@ -508,8 +483,8 @@ extern const struct ctl_cmd_entry ctl_cm uint32_t ctl_get_initindex(struct ctl_nexus *nexus); uint32_t ctl_get_resindex(struct ctl_nexus *nexus); uint32_t ctl_port_idx(int port_num); -int ctl_pool_create(struct ctl_softc *ctl_softc, ctl_pool_type pool_type, - uint32_t total_ctl_io, struct ctl_io_pool **npool); +int ctl_pool_create(struct ctl_softc *ctl_softc, const char *pool_name, + uint32_t total_ctl_io, void **npool); void ctl_pool_free(struct ctl_io_pool *pool); int ctl_scsi_release(struct ctl_scsiio *ctsio); int ctl_scsi_reserve(struct ctl_scsiio *ctsio); Modified: stable/10/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/ctl_tpc.c Thu Dec 18 08:22:16 2014 (r275878) @@ -812,7 +812,6 @@ tpc_process_b2b(struct tpc_list *list) uint32_t srcblock, dstblock; if (list->stage == 1) { -complete: while ((tior = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tior, links); ctl_free_io(tior->io); @@ -886,10 +885,6 @@ complete: tior->list = list; TAILQ_INSERT_TAIL(&list->allio, tior, links); tior->io = tpcl_alloc_io(); - if (tior->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_read_write(tior->io, /*data_ptr*/ &list->buf[donebytes], /*data_len*/ roundbytes, @@ -909,10 +904,6 @@ complete: tiow->list = list; TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); - if (tiow->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_read_write(tiow->io, /*data_ptr*/ &list->buf[donebytes], /*data_len*/ roundbytes, @@ -951,7 +942,6 @@ tpc_process_verify(struct tpc_list *list uint64_t sl; if (list->stage == 1) { -complete: while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); ctl_free_io(tio->io); @@ -990,10 +980,6 @@ complete: tio->list = list; TAILQ_INSERT_TAIL(&list->allio, tio, links); tio->io = tpcl_alloc_io(); - if (tio->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_tur(tio->io, /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); tio->io->io_hdr.retries = 3; tio->lun = sl; @@ -1013,7 +999,6 @@ tpc_process_register_key(struct tpc_list int datalen; if (list->stage == 1) { -complete: while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); ctl_free_io(tio->io); @@ -1050,10 +1035,6 @@ complete: tio->list = list; TAILQ_INSERT_TAIL(&list->allio, tio, links); tio->io = tpcl_alloc_io(); - if (tio->io == NULL) { - list->error = 1; - goto complete; - } datalen = sizeof(struct scsi_per_res_out_parms); list->buf = malloc(datalen, M_CTL, M_WAITOK); ctl_scsi_persistent_res_out(tio->io, @@ -1112,7 +1093,6 @@ tpc_process_wut(struct tpc_list *list) uint32_t srcblock, dstblock; if (list->stage > 0) { -complete: /* Cleanup after previous rounds. */ while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); @@ -1184,10 +1164,6 @@ complete: tior->list = list; TAILQ_INSERT_TAIL(&list->allio, tior, links); tior->io = tpcl_alloc_io(); - if (tior->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_read_write(tior->io, /*data_ptr*/ &list->buf[donebytes], /*data_len*/ roundbytes, @@ -1207,10 +1183,6 @@ complete: tiow->list = list; TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); - if (tiow->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_read_write(tiow->io, /*data_ptr*/ &list->buf[donebytes], /*data_len*/ roundbytes, @@ -1289,10 +1261,6 @@ complete: tiow->list = list; TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); - if (tiow->io == NULL) { - list->error = 1; - goto complete; - } ctl_scsi_write_same(tiow->io, /*data_ptr*/ list->buf, /*data_len*/ dstblock, Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 07:38:41 2014 (r275877) +++ stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:22:16 2014 (r275878) @@ -72,10 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -typedef enum { - CTLFE_CCB_DEFAULT = 0x00 -} ctlfe_ccb_types; - struct ctlfe_softc { struct ctl_port port; path_id_t path_id; @@ -189,9 +185,7 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, dma_ &ctlfe_dma_enabled, 0, "DMA enabled"); MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CAM CTL FE interface"); -#define ccb_type ppriv_field0 -/* This is only used in the ATIO */ -#define io_ptr ppriv_ptr1 +#define io_ptr ppriv_ptr0 /* This is only used in the CTIO */ #define ccb_atio ppriv_ptr1 @@ -546,6 +540,7 @@ ctlferegister(struct cam_periph *periph, for (i = 0; i < CTLFE_ATIO_PER_LUN; i++) { union ccb *new_ccb; + union ctl_io *new_io; new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE, M_ZERO|M_NOWAIT); @@ -553,6 +548,14 @@ ctlferegister(struct cam_periph *periph, status = CAM_RESRC_UNAVAIL; break; } + new_io = ctl_alloc_io_nowait(bus_softc->port.ctl_pool_ref); + if (new_io == NULL) { + free(new_ccb, M_CTLFE); + status = CAM_RESRC_UNAVAIL; + break; + } + new_ccb->ccb_h.io_ptr = new_io; + xpt_setup_ccb(&new_ccb->ccb_h, periph->path, /*priority*/ 1); new_ccb->ccb_h.func_code = XPT_ACCEPT_TARGET_IO; new_ccb->ccb_h.cbfcnp = ctlfedone; @@ -561,6 +564,7 @@ ctlferegister(struct cam_periph *periph, softc->atios_sent++; status = new_ccb->ccb_h.status; if ((status & CAM_STATUS_MASK) != CAM_REQ_INPROG) { + ctl_free_io(new_io); free(new_ccb, M_CTLFE); break; } @@ -581,6 +585,7 @@ ctlferegister(struct cam_periph *periph, for (i = 0; i < CTLFE_IN_PER_LUN; i++) { union ccb *new_ccb; + union ctl_io *new_io; new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE, M_ZERO|M_NOWAIT); @@ -588,6 +593,13 @@ ctlferegister(struct cam_periph *periph, status = CAM_RESRC_UNAVAIL; break; } + new_io = ctl_alloc_io_nowait(bus_softc->port.ctl_pool_ref); + if (new_io == NULL) { + free(new_ccb, M_CTLFE); + status = CAM_RESRC_UNAVAIL; + break; + } + new_ccb->ccb_h.io_ptr = new_io; xpt_setup_ccb(&new_ccb->ccb_h, periph->path, /*priority*/ 1); new_ccb->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; @@ -766,8 +778,6 @@ ctlfestart(struct cam_periph *periph, un softc->ccbs_alloced++; - start_ccb->ccb_h.ccb_type = CTLFE_CCB_DEFAULT; - ccb_h = TAILQ_FIRST(&softc->work_queue); if (ccb_h == NULL) { softc->ccbs_freed++; @@ -812,7 +822,6 @@ ctlfestart(struct cam_periph *periph, un xpt_print(periph->path, "%s: aborted " "command 0x%04x discarded\n", __func__, io->scsiio.tag_num); - ctl_free_io(io); /* * For a wildcard attachment, commands can * come in with a specific target/lun. Reset @@ -1038,6 +1047,7 @@ ctlfe_free_ccb(struct cam_periph *periph break; } + ctl_free_io(ccb->ccb_h.io_ptr); free(ccb, M_CTLFE); KASSERT(softc->atios_returned <= softc->atios_sent, ("%s: " @@ -1139,8 +1149,8 @@ ctlfedone(struct cam_periph *periph, uni KASSERT((done_ccb->ccb_h.flags & CAM_UNLOCKED) != 0, ("CCB in ctlfedone() without CAM_UNLOCKED flag")); #ifdef CTLFE_DEBUG - printf("%s: entered, func_code = %#x, type = %#lx\n", __func__, - done_ccb->ccb_h.func_code, done_ccb->ccb_h.ccb_type); + printf("%s: entered, func_code = %#x\n", __func__, + done_ccb->ccb_h.func_code); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:23:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03D6BC2D; Thu, 18 Dec 2014 08:23:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9869175D; Thu, 18 Dec 2014 08:23:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8N5OJ019563; Thu, 18 Dec 2014 08:23:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8N5FV019561; Thu, 18 Dec 2014 08:23:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180823.sBI8N5FV019561@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275879 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:23:06 -0000 Author: mav Date: Thu Dec 18 08:23:04 2014 New Revision: 275879 URL: https://svnweb.freebsd.org/changeset/base/275879 Log: MFC r275009: Use ctl_set_success() instead of direct inlining. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:22:16 2014 (r275878) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:23:04 2014 (r275879) @@ -5213,8 +5213,7 @@ ctl_scsi_release(struct ctl_scsiio *ctsi mtx_unlock(&lun->lun_lock); - ctsio->scsi_status = SCSI_STATUS_OK; - ctsio->io_hdr.status = CTL_SUCCESS; + ctl_set_success(ctsio); if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { free(ctsio->kern_data_ptr, M_CTL); @@ -5301,8 +5300,7 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi lun->flags |= CTL_LUN_RESERVED; lun->res_idx = residx; - ctsio->scsi_status = SCSI_STATUS_OK; - ctsio->io_hdr.status = CTL_SUCCESS; + ctl_set_success(ctsio); bailout: mtx_unlock(&lun->lun_lock); @@ -5612,8 +5610,7 @@ ctl_format(struct ctl_scsiio *ctsio) lun->flags &= ~CTL_LUN_INOPERABLE; mtx_unlock(&lun->lun_lock); - ctsio->scsi_status = SCSI_STATUS_OK; - ctsio->io_hdr.status = CTL_SUCCESS; + ctl_set_success(ctsio); bailout: if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { @@ -9608,9 +9605,7 @@ ctl_tur(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_tur\n")); - ctsio->scsi_status = SCSI_STATUS_OK; - ctsio->io_hdr.status = CTL_SUCCESS; - + ctl_set_success(ctsio); ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:22:16 2014 (r275878) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:23:04 2014 (r275879) @@ -250,7 +250,7 @@ ctl_backend_ramdisk_move_done(union ctl_ &be_lun->io_task); return (0); } - io->io_hdr.status = CTL_SUCCESS; + ctl_set_success(&io->scsiio); } else if ((io->io_hdr.port_status != 0) && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)){ From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:24:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 512AFD6B; Thu, 18 Dec 2014 08:24: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 3AED9176D; Thu, 18 Dec 2014 08:24: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 sBI8O00l019721; Thu, 18 Dec 2014 08:24:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8O0jm019715; Thu, 18 Dec 2014 08:24:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180824.sBI8O0jm019715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275880 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:24:00 -0000 Author: mav Date: Thu Dec 18 08:23:59 2014 New Revision: 275880 URL: https://svnweb.freebsd.org/changeset/base/275880 Log: MFC r275032: Decouple datamove/done logic from CTL status set. Modified: stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:23:04 2014 (r275879) +++ stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:23:59 2014 (r275880) @@ -86,7 +86,6 @@ struct ctlfe_softc { STAILQ_HEAD(, ctlfe_softc) ctlfe_softc_list; struct mtx ctlfe_list_mtx; static char ctlfe_mtx_desc[] = "ctlfelist"; -static int ctlfe_dma_enabled = 1; #ifdef CTLFE_INIT_ENABLE static int ctlfe_max_targets = 1; static int ctlfe_num_targets = 0; @@ -101,7 +100,6 @@ struct ctlfe_lun_softc { struct ctlfe_softc *parent_softc; struct cam_periph *periph; ctlfe_lun_flags flags; - struct callout dma_callout; uint64_t ccbs_alloced; uint64_t ccbs_freed; uint64_t ctios_sent; @@ -136,6 +134,7 @@ struct ctlfe_lun_cmd_info { #define CTLFE_MAX_SEGS 32 bus_dma_segment_t cam_sglist[CTLFE_MAX_SEGS]; }; +CTASSERT(sizeof(struct ctlfe_lun_cmd_info) <= CTL_PORT_PRIV_SIZE); /* * When we register the adapter/bus, request that this many ctl_ios be @@ -181,8 +180,6 @@ struct ctlfe_lun_cmd_info { #define RANDOM_WWNN #endif -SYSCTL_INT(_kern_cam_ctl, OID_AUTO, dma_enabled, CTLFLAG_RW, - &ctlfe_dma_enabled, 0, "DMA enabled"); MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CAM CTL FE interface"); #define io_ptr ppriv_ptr0 @@ -211,8 +208,8 @@ static int ctlfe_lun_disable(void *arg int lun_id); static void ctlfe_dump_sim(struct cam_sim *sim); static void ctlfe_dump_queue(struct ctlfe_lun_softc *softc); -static void ctlfe_dma_timeout(void *arg); -static void ctlfe_datamove_done(union ctl_io *io); +static void ctlfe_datamove(union ctl_io *io); +static void ctlfe_done(union ctl_io *io); static void ctlfe_dump(void); static struct periph_driver ctlfe_driver = @@ -402,8 +399,8 @@ ctlfeasync(void *callback_arg, uint32_t port->lun_enable = ctlfe_lun_enable; port->lun_disable = ctlfe_lun_disable; port->targ_lun_arg = softc; - port->fe_datamove = ctlfe_datamove_done; - port->fe_done = ctlfe_datamove_done; + port->fe_datamove = ctlfe_datamove; + port->fe_done = ctlfe_done; /* * XXX KDM the path inquiry doesn't give us the maximum * number of targets supported. @@ -518,9 +515,6 @@ ctlferegister(struct cam_periph *periph, TAILQ_INIT(&softc->work_queue); softc->periph = periph; - - callout_init_mtx(&softc->dma_callout, xpt_path_mtx(periph->path), - /*flags*/ 0); periph->softc = softc; xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); @@ -679,8 +673,6 @@ ctlfecleanup(struct cam_periph *periph) * XXX KDM is there anything else that needs to be done here? */ - callout_stop(&softc->dma_callout); - free(softc, M_CTLFE); } @@ -772,260 +764,213 @@ static void ctlfestart(struct cam_periph *periph, union ccb *start_ccb) { struct ctlfe_lun_softc *softc; + struct ctlfe_lun_cmd_info *cmd_info; struct ccb_hdr *ccb_h; + struct ccb_accept_tio *atio; + struct ccb_scsiio *csio; + uint8_t *data_ptr; + uint32_t dxfer_len; + ccb_flags flags; + union ctl_io *io; + uint8_t scsi_status; softc = (struct ctlfe_lun_softc *)periph->softc; - softc->ccbs_alloced++; ccb_h = TAILQ_FIRST(&softc->work_queue); if (ccb_h == NULL) { softc->ccbs_freed++; xpt_release_ccb(start_ccb); - } else { - struct ccb_accept_tio *atio; - struct ccb_scsiio *csio; - uint8_t *data_ptr; - uint32_t dxfer_len; - ccb_flags flags; - union ctl_io *io; - uint8_t scsi_status; + return; + } + + /* Take the ATIO off the work queue */ + TAILQ_REMOVE(&softc->work_queue, ccb_h, periph_links.tqe); + atio = (struct ccb_accept_tio *)ccb_h; + io = (union ctl_io *)ccb_h->io_ptr; + csio = &start_ccb->csio; - /* Take the ATIO off the work queue */ - TAILQ_REMOVE(&softc->work_queue, ccb_h, periph_links.tqe); - atio = (struct ccb_accept_tio *)ccb_h; - io = (union ctl_io *)ccb_h->io_ptr; - csio = &start_ccb->csio; + flags = atio->ccb_h.flags & + (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); - flags = atio->ccb_h.flags & - (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); + if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) { + /* + * Datamove call, we need to setup the S/G list. + */ + cmd_info = (struct ctlfe_lun_cmd_info *) + io->io_hdr.port_priv; + bzero(cmd_info, sizeof(*cmd_info)); + scsi_status = 0; + csio->cdb_len = atio->cdb_len; + ctlfedata(softc, io, &flags, &data_ptr, &dxfer_len, + &csio->sglist_cnt); + io->scsiio.ext_data_filled += dxfer_len; + if (io->scsiio.ext_data_filled > io->scsiio.kern_total_len) { + xpt_print(periph->path, "%s: tag 0x%04x " + "fill len %u > total %u\n", + __func__, io->scsiio.tag_num, + io->scsiio.ext_data_filled, + io->scsiio.kern_total_len); + } + } else { + /* + * We're done, send status back. + */ + if ((io->io_hdr.flags & CTL_FLAG_ABORT) && + (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { + io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED; - if ((io == NULL) - || (io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) { /* - * We're done, send status back. + * If this command was aborted, we don't + * need to send status back to the SIM. + * Just free the CTIO and ctl_io, and + * recycle the ATIO back to the SIM. */ - flags |= CAM_SEND_STATUS; - if (io == NULL) { - scsi_status = SCSI_STATUS_BUSY; - csio->sense_len = 0; - } else if ((io->io_hdr.flags & CTL_FLAG_ABORT) && - (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { - io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED; - - /* - * If this command was aborted, we don't - * need to send status back to the SIM. - * Just free the CTIO and ctl_io, and - * recycle the ATIO back to the SIM. - */ - xpt_print(periph->path, "%s: aborted " - "command 0x%04x discarded\n", - __func__, io->scsiio.tag_num); - /* - * For a wildcard attachment, commands can - * come in with a specific target/lun. Reset - * the target and LUN fields back to the - * wildcard values before we send them back - * down to the SIM. The SIM has a wildcard - * LUN enabled, not whatever target/lun - * these happened to be. - */ - if (softc->flags & CTLFE_LUN_WILDCARD) { - atio->ccb_h.target_id = - CAM_TARGET_WILDCARD; - atio->ccb_h.target_lun = - CAM_LUN_WILDCARD; - } - - if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(periph->path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - atio->ccb_h.status &= ~CAM_DEV_QFRZN; - } - - ccb_h = TAILQ_FIRST(&softc->work_queue); - - if (atio->ccb_h.func_code != - XPT_ACCEPT_TARGET_IO) { - xpt_print(periph->path, "%s: func_code " - "is %#x\n", __func__, - atio->ccb_h.func_code); - } - start_ccb->ccb_h.func_code = XPT_ABORT; - start_ccb->cab.abort_ccb = (union ccb *)atio; - - /* Tell the SIM that we've aborted this ATIO */ - xpt_action(start_ccb); - softc->ccbs_freed++; - xpt_release_ccb(start_ccb); - - /* - * Send the ATIO back down to the SIM. - */ - xpt_action((union ccb *)atio); - softc->atios_sent++; - - /* - * If we still have work to do, ask for - * another CCB. Otherwise, deactivate our - * callout. - */ - if (ccb_h != NULL) - xpt_schedule(periph, /*priority*/ 1); - else - callout_stop(&softc->dma_callout); - - return; - } else { - io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED; - scsi_status = io->scsiio.scsi_status; - csio->sense_len = io->scsiio.sense_len; - } - data_ptr = NULL; - dxfer_len = 0; - if (io == NULL) { - printf("%s: tag %04x io is NULL\n", __func__, - atio->tag_id); - } else { -#ifdef CTLFEDEBUG - printf("%s: tag %04x status %x\n", __func__, - atio->tag_id, io->io_hdr.status); -#endif - } - csio->sglist_cnt = 0; - if (csio->sense_len != 0) { - csio->sense_data = io->scsiio.sense_data; - flags |= CAM_SEND_SENSE; - } else if (scsi_status == SCSI_STATUS_CHECK_COND) { - xpt_print(periph->path, "%s: check condition " - "with no sense\n", __func__); - } - } else { - struct ctlfe_lun_cmd_info *cmd_info; - + xpt_print(periph->path, "%s: aborted " + "command 0x%04x discarded\n", + __func__, io->scsiio.tag_num); /* - * Datamove call, we need to setup the S/G list. + * For a wildcard attachment, commands can + * come in with a specific target/lun. Reset + * the target and LUN fields back to the + * wildcard values before we send them back + * down to the SIM. The SIM has a wildcard + * LUN enabled, not whatever target/lun + * these happened to be. */ + if (softc->flags & CTLFE_LUN_WILDCARD) { + atio->ccb_h.target_id = CAM_TARGET_WILDCARD; + atio->ccb_h.target_lun = CAM_LUN_WILDCARD; + } - cmd_info = (struct ctlfe_lun_cmd_info *) - io->io_hdr.port_priv; + if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) { + cam_release_devq(periph->path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + atio->ccb_h.status &= ~CAM_DEV_QFRZN; + } + + if (atio->ccb_h.func_code != XPT_ACCEPT_TARGET_IO) { + xpt_print(periph->path, "%s: func_code " + "is %#x\n", __func__, + atio->ccb_h.func_code); + } + start_ccb->ccb_h.func_code = XPT_ABORT; + start_ccb->cab.abort_ccb = (union ccb *)atio; - KASSERT(sizeof(*cmd_info) < CTL_PORT_PRIV_SIZE, - ("%s: sizeof(struct ctlfe_lun_cmd_info) %zd < " - "CTL_PORT_PRIV_SIZE %d", __func__, - sizeof(*cmd_info), CTL_PORT_PRIV_SIZE)); - io->io_hdr.flags &= ~CTL_FLAG_DMA_QUEUED; + /* Tell the SIM that we've aborted this ATIO */ + xpt_action(start_ccb); + softc->ccbs_freed++; + xpt_release_ccb(start_ccb); /* - * Need to zero this, in case it has been used for - * a previous datamove for this particular I/O. + * Send the ATIO back down to the SIM. */ - bzero(cmd_info, sizeof(*cmd_info)); - scsi_status = 0; - - csio->cdb_len = atio->cdb_len; - - ctlfedata(softc, io, &flags, &data_ptr, &dxfer_len, - &csio->sglist_cnt); + xpt_action((union ccb *)atio); + softc->atios_sent++; - io->scsiio.ext_data_filled += dxfer_len; + /* + * If we still have work to do, ask for + * another CCB. Otherwise, deactivate our + * callout. + */ + if (!TAILQ_EMPTY(&softc->work_queue)) + xpt_schedule(periph, /*priority*/ 1); + return; + } - if (io->scsiio.ext_data_filled > - io->scsiio.kern_total_len) { - xpt_print(periph->path, "%s: tag 0x%04x " - "fill len %u > total %u\n", - __func__, io->scsiio.tag_num, - io->scsiio.ext_data_filled, - io->scsiio.kern_total_len); - } + flags |= CAM_SEND_STATUS; + scsi_status = io->scsiio.scsi_status; + csio->sense_len = io->scsiio.sense_len; + data_ptr = NULL; + dxfer_len = 0; +#ifdef CTLFEDEBUG + printf("%s: tag %04x status %x\n", __func__, + atio->tag_id, io->io_hdr.status); +#endif + csio->sglist_cnt = 0; + if (csio->sense_len != 0) { + csio->sense_data = io->scsiio.sense_data; + flags |= CAM_SEND_SENSE; + } else if (scsi_status == SCSI_STATUS_CHECK_COND) { + xpt_print(periph->path, "%s: check condition " + "with no sense\n", __func__); } + } #ifdef CTLFEDEBUG - printf("%s: %s: tag %04x flags %x ptr %p len %u\n", __func__, - (flags & CAM_SEND_STATUS) ? "done" : "datamove", - atio->tag_id, flags, data_ptr, dxfer_len); + printf("%s: %s: tag %04x flags %x ptr %p len %u\n", __func__, + (flags & CAM_SEND_STATUS) ? "done" : "datamove", + atio->tag_id, flags, data_ptr, dxfer_len); #endif - /* - * Valid combinations: - * - CAM_SEND_STATUS, CAM_DATA_SG = 0, dxfer_len = 0, - * sglist_cnt = 0 - * - CAM_SEND_STATUS = 0, CAM_DATA_SG = 0, dxfer_len != 0, - * sglist_cnt = 0 - * - CAM_SEND_STATUS = 0, CAM_DATA_SG, dxfer_len != 0, - * sglist_cnt != 0 - */ + /* + * Valid combinations: + * - CAM_SEND_STATUS, CAM_DATA_SG = 0, dxfer_len = 0, + * sglist_cnt = 0 + * - CAM_SEND_STATUS = 0, CAM_DATA_SG = 0, dxfer_len != 0, + * sglist_cnt = 0 + * - CAM_SEND_STATUS = 0, CAM_DATA_SG, dxfer_len != 0, + * sglist_cnt != 0 + */ #ifdef CTLFEDEBUG - if (((flags & CAM_SEND_STATUS) - && (((flags & CAM_DATA_SG) != 0) - || (dxfer_len != 0) - || (csio->sglist_cnt != 0))) - || (((flags & CAM_SEND_STATUS) == 0) - && (dxfer_len == 0)) - || ((flags & CAM_DATA_SG) - && (csio->sglist_cnt == 0)) - || (((flags & CAM_DATA_SG) == 0) - && (csio->sglist_cnt != 0))) { - printf("%s: tag %04x cdb %02x flags %#x dxfer_len " - "%d sg %u\n", __func__, atio->tag_id, - atio->cdb_io.cdb_bytes[0], flags, dxfer_len, - csio->sglist_cnt); - if (io != NULL) { - printf("%s: tag %04x io status %#x\n", __func__, - atio->tag_id, io->io_hdr.status); - } else { - printf("%s: tag %04x no associated io\n", - __func__, atio->tag_id); - } - } + if (((flags & CAM_SEND_STATUS) + && (((flags & CAM_DATA_SG) != 0) + || (dxfer_len != 0) + || (csio->sglist_cnt != 0))) + || (((flags & CAM_SEND_STATUS) == 0) + && (dxfer_len == 0)) + || ((flags & CAM_DATA_SG) + && (csio->sglist_cnt == 0)) + || (((flags & CAM_DATA_SG) == 0) + && (csio->sglist_cnt != 0))) { + printf("%s: tag %04x cdb %02x flags %#x dxfer_len " + "%d sg %u\n", __func__, atio->tag_id, + atio->cdb_io.cdb_bytes[0], flags, dxfer_len, + csio->sglist_cnt); + printf("%s: tag %04x io status %#x\n", __func__, + atio->tag_id, io->io_hdr.status); + } #endif - cam_fill_ctio(csio, - /*retries*/ 2, - ctlfedone, - flags, - (flags & CAM_TAG_ACTION_VALID) ? - MSG_SIMPLE_Q_TAG : 0, - atio->tag_id, - atio->init_id, - scsi_status, - /*data_ptr*/ data_ptr, - /*dxfer_len*/ dxfer_len, - /*timeout*/ 5 * 1000); - start_ccb->ccb_h.flags |= CAM_UNLOCKED; - start_ccb->ccb_h.ccb_atio = atio; - if (((flags & CAM_SEND_STATUS) == 0) - && (io != NULL)) - io->io_hdr.flags |= CTL_FLAG_DMA_INPROG; - - softc->ctios_sent++; - - cam_periph_unlock(periph); - xpt_action(start_ccb); - cam_periph_lock(periph); + cam_fill_ctio(csio, + /*retries*/ 2, + ctlfedone, + flags, + (flags & CAM_TAG_ACTION_VALID) ? MSG_SIMPLE_Q_TAG : 0, + atio->tag_id, + atio->init_id, + scsi_status, + /*data_ptr*/ data_ptr, + /*dxfer_len*/ dxfer_len, + /*timeout*/ 5 * 1000); + start_ccb->ccb_h.flags |= CAM_UNLOCKED; + start_ccb->ccb_h.ccb_atio = atio; + if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) + io->io_hdr.flags |= CTL_FLAG_DMA_INPROG; + io->io_hdr.flags &= ~(CTL_FLAG_DMA_QUEUED | CTL_FLAG_STATUS_QUEUED); - if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(periph->path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - atio->ccb_h.status &= ~CAM_DEV_QFRZN; - } + softc->ctios_sent++; - ccb_h = TAILQ_FIRST(&softc->work_queue); + cam_periph_unlock(periph); + xpt_action(start_ccb); + cam_periph_lock(periph); + + if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) { + cam_release_devq(periph->path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + atio->ccb_h.status &= ~CAM_DEV_QFRZN; } + /* - * If we still have work to do, ask for another CCB. Otherwise, - * deactivate our callout. + * If we still have work to do, ask for another CCB. */ - if (ccb_h != NULL) + if (!TAILQ_EMPTY(&softc->work_queue)) xpt_schedule(periph, /*priority*/ 1); - else - callout_stop(&softc->dma_callout); } static void @@ -1278,7 +1223,7 @@ ctlfedone(struct cam_periph *periph, uni | (done_ccb->csio.msg_ptr[6]); } - if (srr && (done_ccb->ccb_h.flags & CAM_SEND_STATUS)) { + if (srr && (io->io_hdr.flags & CTL_FLAG_DMA_INPROG) == 0) { /* * If status was being sent, the back end data is now * history. Hack it up and resubmit a new command with @@ -1317,7 +1262,7 @@ ctlfedone(struct cam_periph *periph, uni * resources. If we were doing a datamove, call the * datamove done routine. */ - if (done_ccb->ccb_h.flags & CAM_SEND_STATUS) { + if ((io->io_hdr.flags & CTL_FLAG_DMA_INPROG) == 0) { softc->ccbs_freed++; xpt_release_ccb(done_ccb); /* @@ -1986,7 +1931,6 @@ ctlfe_dump_sim(struct cam_sim *sim) printf("%s%d: max tagged openings: %d, max dev openings: %d\n", sim->sim_name, sim->unit_number, sim->max_tagged_dev_openings, sim->max_dev_openings); - printf("\n"); } /* @@ -2003,27 +1947,11 @@ ctlfe_dump_queue(struct ctlfe_lun_softc num_items = 0; TAILQ_FOREACH(hdr, &softc->work_queue, periph_links.tqe) { - union ctl_io *io; - - io = hdr->io_ptr; + union ctl_io *io = hdr->io_ptr; num_items++; /* - * This can happen when we get an ATIO but can't allocate - * a ctl_io. See the XPT_ACCEPT_TARGET_IO case in ctlfedone(). - */ - if (io == NULL) { - struct ccb_scsiio *csio; - - csio = (struct ccb_scsiio *)hdr; - - xpt_print(periph->path, "CCB %#x ctl_io allocation " - "failed\n", csio->tag_id); - continue; - } - - /* * Only regular SCSI I/O is put on the work * queue, so we can print sense here. There may be no * sense if it's no the queue for a DMA, but this serves to @@ -2035,20 +1963,15 @@ ctlfe_dump_queue(struct ctlfe_lun_softc ctl_io_error_print(io, NULL); /* - * We're sending status back to the - * initiator, so we're on the queue waiting - * for a CTIO to do that. + * Print DMA status if we are DMA_QUEUED. */ - if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) - continue; - - /* - * Otherwise, we're on the queue waiting to - * do a data transfer. - */ - xpt_print(periph->path, "Total %u, Current %u, Resid %u\n", - io->scsiio.kern_total_len, io->scsiio.kern_data_len, - io->scsiio.kern_data_resid); + if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) { + xpt_print(periph->path, + "Total %u, Current %u, Resid %u\n", + io->scsiio.kern_total_len, + io->scsiio.kern_data_len, + io->scsiio.kern_data_resid); + } } xpt_print(periph->path, "%d requests total waiting for CCBs\n", @@ -2064,66 +1987,43 @@ ctlfe_dump_queue(struct ctlfe_lun_softc } /* - * This function is called when we fail to get a CCB for a DMA or status return - * to the initiator within the specified time period. - * - * The callout code should insure that we hold the sim mutex here. + * Datamove/done routine called by CTL. Put ourselves on the queue to + * receive a CCB from CAM so we can queue the continue I/O request down + * to the adapter. */ static void -ctlfe_dma_timeout(void *arg) +ctlfe_datamove(union ctl_io *io) { - struct ctlfe_lun_softc *softc; + union ccb *ccb; struct cam_periph *periph; - struct cam_sim *sim; - int num_queued; - - softc = (struct ctlfe_lun_softc *)arg; - periph = softc->periph; - sim = xpt_path_sim(periph->path); - num_queued = 0; - - /* - * Nothing to do... - */ - if (TAILQ_FIRST(&softc->work_queue) == NULL) { - xpt_print(periph->path, "TIMEOUT triggered after %d " - "seconds, but nothing on work queue??\n", - CTLFE_DMA_TIMEOUT); - return; - } - - xpt_print(periph->path, "TIMEOUT (%d seconds) waiting for DMA to " - "start\n", CTLFE_DMA_TIMEOUT); - - ctlfe_dump_queue(softc); - - ctlfe_dump_sim(sim); + struct ctlfe_lun_softc *softc; - xpt_print(periph->path, "calling xpt_schedule() to attempt to " - "unstick our queue\n"); + KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, + ("Unexpected io_type (%d) in ctlfe_datamove", io->io_hdr.io_type)); + ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + periph = xpt_path_periph(ccb->ccb_h.path); + cam_periph_lock(periph); + softc = (struct ctlfe_lun_softc *)periph->softc; + io->io_hdr.flags |= CTL_FLAG_DMA_QUEUED; + if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) + io->io_hdr.flags |= CTL_FLAG_STATUS_QUEUED; + TAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h, + periph_links.tqe); xpt_schedule(periph, /*priority*/ 1); - - xpt_print(periph->path, "xpt_schedule() call complete\n"); + cam_periph_unlock(periph); } -/* - * Datamove/done routine called by CTL. Put ourselves on the queue to - * receive a CCB from CAM so we can queue the continue I/O request down - * to the adapter. - */ static void -ctlfe_datamove_done(union ctl_io *io) +ctlfe_done(union ctl_io *io) { union ccb *ccb; struct cam_periph *periph; struct ctlfe_lun_softc *softc; ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; - periph = xpt_path_periph(ccb->ccb_h.path); cam_periph_lock(periph); - softc = (struct ctlfe_lun_softc *)periph->softc; if (io->io_hdr.io_type == CTL_IO_TASK) { @@ -2143,27 +2043,10 @@ ctlfe_datamove_done(union ctl_io *io) ccb->ccb_h.func_code = XPT_NOTIFY_ACKNOWLEDGE; xpt_action(ccb); } else { - if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) - io->io_hdr.flags |= CTL_FLAG_STATUS_QUEUED; - else - io->io_hdr.flags |= CTL_FLAG_DMA_QUEUED; - + io->io_hdr.flags |= CTL_FLAG_STATUS_QUEUED; TAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h, periph_links.tqe); - - /* - * Reset the timeout for our latest active DMA. - */ - callout_reset(&softc->dma_callout, - CTLFE_DMA_TIMEOUT * hz, - ctlfe_dma_timeout, softc); - /* - * Ask for the CAM transport layer to send us a CCB to do - * the DMA or send status, unless ctlfe_dma_enabled is set - * to 0. - */ - if (ctlfe_dma_enabled != 0) - xpt_schedule(periph, /*priority*/ 1); + xpt_schedule(periph, /*priority*/ 1); } cam_periph_unlock(periph); @@ -2173,14 +2056,11 @@ static void ctlfe_dump(void) { struct ctlfe_softc *bus_softc; + struct ctlfe_lun_softc *lun_softc; STAILQ_FOREACH(bus_softc, &ctlfe_softc_list, links) { - struct ctlfe_lun_softc *lun_softc; - ctlfe_dump_sim(bus_softc->sim); - - STAILQ_FOREACH(lun_softc, &bus_softc->lun_softc_list, links) { + STAILQ_FOREACH(lun_softc, &bus_softc->lun_softc_list, links) ctlfe_dump_queue(lun_softc); - } } } From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:25:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D857DEBA; Thu, 18 Dec 2014 08:25: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 C28F21787; Thu, 18 Dec 2014 08:25: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 sBI8P2CE019952; Thu, 18 Dec 2014 08:25:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8P1mc019934; Thu, 18 Dec 2014 08:25:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180825.sBI8P1mc019934@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275881 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:25:03 -0000 Author: mav Date: Thu Dec 18 08:25:00 2014 New Revision: 275881 URL: https://svnweb.freebsd.org/changeset/base/275881 Log: MFC r275058: Coalesce last data move and command status for read commands. Make CTL core and block backend set success status before initiating last data move for read commands. Make CAM target and iSCSI frontends detect such condition and send command status together with data. New I/O flag allows to skip duplicate status sending on later fe_done() call. For Fibre Channel this change saves one of three interrupts per read command, increasing performance from 126K to 160K IOPS. For iSCSI this change saves one of three PDUs per read command, increasing performance from 1M to 1.2M IOPS. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_tpc.c stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:25:00 2014 (r275881) @@ -4998,23 +4998,13 @@ ctl_config_move_done(union ctl_io *io) { int retval; - retval = CTL_RETVAL_COMPLETE; - - CTL_DEBUG_PRINT(("ctl_config_move_done\n")); - /* - * XXX KDM this shouldn't happen, but what if it does? - */ - if (io->io_hdr.io_type != CTL_IO_SCSI) - panic("I/O type isn't CTL_IO_SCSI!"); + KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, + ("Config I/O type isn't CTL_IO_SCSI (%d)!", io->io_hdr.io_type)); - if ((io->io_hdr.port_status == 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) - io->io_hdr.status = CTL_SUCCESS; - else if ((io->io_hdr.port_status != 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)){ + if ((io->io_hdr.port_status != 0) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { /* * For hardware error sense keys, the sense key * specific value is defined to be a retry count, @@ -5027,15 +5017,12 @@ ctl_config_move_done(union ctl_io *io) /*sks_valid*/ 1, /*retry_count*/ io->io_hdr.port_status); - if (io->io_hdr.flags & CTL_FLAG_ALLOCATED) - free(io->scsiio.kern_data_ptr, M_CTL); - ctl_done(io); - goto bailout; } - if (((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) - || ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) - || ((io->io_hdr.flags & CTL_FLAG_ABORT) != 0)) { + if (((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) || + ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE && + (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) || + ((io->io_hdr.flags & CTL_FLAG_ABORT) != 0)) { /* * XXX KDM just assuming a single pointer here, and not a * S/G list. If we start using S/G lists for config data, @@ -5043,8 +5030,8 @@ ctl_config_move_done(union ctl_io *io) */ if (io->io_hdr.flags & CTL_FLAG_ALLOCATED) free(io->scsiio.kern_data_ptr, M_CTL); - /* Hopefully the user has already set the status... */ ctl_done(io); + retval = CTL_RETVAL_COMPLETE; } else { /* * XXX KDM now we need to continue data movement. Some @@ -5067,7 +5054,6 @@ ctl_config_move_done(union ctl_io *io) */ retval = ctl_scsiio(&io->scsiio); } -bailout: return (retval); } @@ -5213,13 +5199,12 @@ ctl_scsi_release(struct ctl_scsiio *ctsi mtx_unlock(&lun->lun_lock); - ctl_set_success(ctsio); - if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { free(ctsio->kern_data_ptr, M_CTL); ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED; } + ctl_set_success(ctsio); ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } @@ -5683,9 +5668,9 @@ ctl_read_buffer(struct ctl_scsiio *ctsio ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctl_set_success(ctsio); ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -5748,8 +5733,8 @@ ctl_write_buffer(struct ctl_scsiio *ctsi return (CTL_RETVAL_COMPLETE); } + ctl_set_success(ctsio); ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -6878,12 +6863,10 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) } } - ctsio->scsi_status = SCSI_STATUS_OK; - + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -7033,11 +7016,10 @@ ctl_log_sense(struct ctl_scsiio *ctsio) memcpy(header + 1, page_index->page_data, page_index->page_len); - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -7092,12 +7074,10 @@ ctl_read_capacity(struct ctl_scsiio *cts */ scsi_ulto4b(lun->be_lun->blocksize, data->length); - ctsio->scsi_status = SCSI_STATUS_OK; - + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -7155,12 +7135,10 @@ ctl_read_capacity_16(struct ctl_scsiio * if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) data->lalba_lbp[0] |= SRC16_LBPME | SRC16_LBPRZ; - ctsio->scsi_status = SCSI_STATUS_OK; - + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -7220,7 +7198,7 @@ ctl_read_defect(struct ctl_scsiio *ctsio scsi_ulto4b(0, data12->length); } - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -7363,15 +7341,9 @@ ctl_report_tagret_port_groups(struct ctl } mtx_unlock(&softc->ctl_lock); + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - - CTL_DEBUG_PRINT(("buf = %x %x %x %x %x %x %x %x\n", - ctsio->kern_data_ptr[0], ctsio->kern_data_ptr[1], - ctsio->kern_data_ptr[2], ctsio->kern_data_ptr[3], - ctsio->kern_data_ptr[4], ctsio->kern_data_ptr[5], - ctsio->kern_data_ptr[6], ctsio->kern_data_ptr[7])); - ctl_datamove((union ctl_io *)ctsio); return(retval); } @@ -7535,9 +7507,9 @@ fill_one: break; } + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return(retval); } @@ -7579,9 +7551,9 @@ ctl_report_supported_tmf(struct ctl_scsi data->byte1 |= RST_ATS | RST_ATSS | RST_CTSS | RST_LURS | RST_TRS; data->byte2 |= RST_ITNRS; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -7629,9 +7601,9 @@ ctl_report_timestamp(struct ctl_scsiio * scsi_ulto4b(timestamp >> 16, data->timestamp); scsi_ulto2b(timestamp & 0xffff, &data->timestamp[4]); + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -7896,17 +7868,10 @@ retry: } mtx_unlock(&lun->lun_lock); + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - - CTL_DEBUG_PRINT(("buf = %x %x %x %x %x %x %x %x\n", - ctsio->kern_data_ptr[0], ctsio->kern_data_ptr[1], - ctsio->kern_data_ptr[2], ctsio->kern_data_ptr[3], - ctsio->kern_data_ptr[4], ctsio->kern_data_ptr[5], - ctsio->kern_data_ptr[6], ctsio->kern_data_ptr[7])); - ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9435,12 +9400,10 @@ ctl_report_luns(struct ctl_scsiio *ctsio * We can only return SCSI_STATUS_CHECK_COND when we can't satisfy * this request. */ - ctsio->scsi_status = SCSI_STATUS_OK; - + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (retval); } @@ -9554,19 +9517,14 @@ ctl_request_sense(struct ctl_scsiio *cts /* * We report the SCSI status as OK, since the status of the * request sense command itself is OK. - */ - ctsio->scsi_status = SCSI_STATUS_OK; - - /* * We report 0 for the sense length, because we aren't doing * autosense in this case. We're reporting sense as * parameter data. */ - ctsio->sense_len = 0; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9585,17 +9543,14 @@ no_sense: /*ascq*/ 0x00, SSD_ELEM_NONE); - ctsio->scsi_status = SCSI_STATUS_OK; - /* * We report 0 for the sense length, because we aren't doing * autosense in this case. We're reporting sense as parameter data. */ - ctsio->sense_len = 0; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9680,12 +9635,10 @@ ctl_inquiry_evpd_supported(struct ctl_sc /* Logical Block Provisioning */ pages->page_list[9] = SVPD_LBP; - ctsio->scsi_status = SCSI_STATUS_OK; - + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9736,12 +9689,11 @@ ctl_inquiry_evpd_serial(struct ctl_scsii (char *)lun->be_lun->serial_num, CTL_SN_LEN); } else memset(sn_ptr->serial_num, 0x20, CTL_SN_LEN); - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9787,11 +9739,10 @@ ctl_inquiry_evpd_eid(struct ctl_scsiio * eid_ptr->flags2 = SVPD_EID_HEADSUP | SVPD_EID_ORDSUP | SVPD_EID_SIMPSUP; eid_ptr->flags3 = SVPD_EID_V_SUP; - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9839,11 +9790,10 @@ ctl_inquiry_evpd_mpp(struct ctl_scsiio * mpp_ptr->descr[0].subpage_code = 0xff; mpp_ptr->descr[0].policy = SVPD_MPP_SHARED; - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -9961,11 +9911,10 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio memcpy(desc, port->target_devid->data, port->target_devid->len); } - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -10076,11 +10025,10 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s } mtx_unlock(&softc->ctl_lock); - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -10145,11 +10093,10 @@ ctl_inquiry_evpd_block_limits(struct ctl } scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length); - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -10206,11 +10153,10 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * bdc_ptr->wab_wac_ff = (i & 0x0f); bdc_ptr->flags = SVPD_FUAB | SVPD_VBULS; - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -10259,11 +10205,10 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * lbp_ptr->prov_type = SVPD_LBP_THIN; } - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); } @@ -10563,7 +10508,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio } } - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -13534,8 +13479,9 @@ ctl_process_done(union ctl_io *io) * Check to see if we have any errors to inject here. We only * inject errors for commands that don't already have errors set. */ - if ((STAILQ_FIRST(&lun->error_list) != NULL) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) + if ((STAILQ_FIRST(&lun->error_list) != NULL) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) && + ((io->io_hdr.flags & CTL_FLAG_STATUS_SENT) == 0)) ctl_inject_error(lun, io); /* Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:25:00 2014 (r275881) @@ -384,8 +384,9 @@ ctl_be_block_move_done(union ctl_io *io) * We set status at this point for read commands, and write * commands with errors. */ - if ((io->io_hdr.port_status == 0) && - ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) && + if (io->io_hdr.flags & CTL_FLAG_ABORT) { + ; + } else if ((io->io_hdr.port_status == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { lbalen = ARGS(beio->io); if (lbalen->flags & CTL_LLF_READ) { @@ -408,10 +409,9 @@ ctl_be_block_move_done(union ctl_io *io) else ctl_set_success(&io->scsiio); } - } - else if ((io->io_hdr.port_status != 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { + } else if ((io->io_hdr.port_status != 0) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { /* * For hardware error sense keys, the sense key * specific value is defined to be a retry count, @@ -535,6 +535,9 @@ ctl_be_block_biodone(struct bio *bio) ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { + if ((ARGS(io)->flags & CTL_LLF_READ) && + beio->beio_cont == NULL) + ctl_set_success(&io->scsiio); #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -742,6 +745,9 @@ ctl_be_block_dispatch_file(struct ctl_be ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { + if ((ARGS(io)->flags & CTL_LLF_READ) && + beio->beio_cont == NULL) + ctl_set_success(&io->scsiio); #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -831,6 +837,9 @@ ctl_be_block_dispatch_zvol(struct ctl_be ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { + if ((ARGS(io)->flags & CTL_LLF_READ) && + beio->beio_cont == NULL) + ctl_set_success(&io->scsiio); #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:25:00 2014 (r275881) @@ -238,9 +238,10 @@ ctl_backend_ramdisk_move_done(union ctl_ if (io->scsiio.kern_sg_entries > 0) free(io->scsiio.kern_data_ptr, M_RAMDISK); io->scsiio.kern_rel_offset += io->scsiio.kern_data_len; - if ((io->io_hdr.port_status == 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { + if (io->io_hdr.flags & CTL_FLAG_ABORT) { + ; + } else if ((io->io_hdr.port_status == 0) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { if (io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer > 0) { mtx_lock(&be_lun->queue_lock); STAILQ_INSERT_TAIL(&be_lun->cont_queue, @@ -251,9 +252,9 @@ ctl_backend_ramdisk_move_done(union ctl_ return (0); } ctl_set_success(&io->scsiio); - } else if ((io->io_hdr.port_status != 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)){ + } else if ((io->io_hdr.port_status != 0) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { /* * For hardware error sense keys, the sense key * specific value is defined to be a retry count, Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Dec 18 08:25:00 2014 (r275881) @@ -371,14 +371,16 @@ cfiscsi_pdu_prepare(struct icl_pdu *resp * See the comment below - StatSN is not meaningful and must * not be advanced. */ - if (bhssr->bhssr_opcode == ISCSI_BHS_OPCODE_SCSI_DATA_IN) + if (bhssr->bhssr_opcode == ISCSI_BHS_OPCODE_SCSI_DATA_IN && + (bhssr->bhssr_flags & BHSDI_FLAGS_S) == 0) advance_statsn = false; /* * 10.7.3: "The fields StatSN, Status, and Residual Count * only have meaningful content if the S bit is set to 1." */ - if (bhssr->bhssr_opcode != ISCSI_BHS_OPCODE_SCSI_DATA_IN) + if (bhssr->bhssr_opcode != ISCSI_BHS_OPCODE_SCSI_DATA_IN || + (bhssr->bhssr_flags & BHSDI_FLAGS_S)) bhssr->bhssr_statsn = htonl(cs->cs_statsn); bhssr->bhssr_expcmdsn = htonl(cs->cs_cmdsn); bhssr->bhssr_maxcmdsn = htonl(cs->cs_cmdsn + maxcmdsn_delta); @@ -2552,8 +2554,10 @@ cfiscsi_datamove_in(union ctl_io *io) */ buffer_offset += response->ip_data_len; if (buffer_offset == io->scsiio.kern_total_len || - buffer_offset == expected_len) - bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; + buffer_offset == expected_len) { + buffer_offset -= response->ip_data_len; + break; + } cfiscsi_pdu_queue(response); response = NULL; bhsdi = NULL; @@ -2562,8 +2566,27 @@ cfiscsi_datamove_in(union ctl_io *io) if (response != NULL) { buffer_offset += response->ip_data_len; if (buffer_offset == io->scsiio.kern_total_len || - buffer_offset == expected_len) + buffer_offset == expected_len) { bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; + if (io->io_hdr.status == CTL_SUCCESS) { + bhsdi->bhsdi_flags |= BHSDI_FLAGS_S; + if (PDU_TOTAL_TRANSFER_LEN(request) < + ntohl(bhssc->bhssc_expected_data_transfer_length)) { + bhsdi->bhsdi_flags |= BHSSR_FLAGS_RESIDUAL_UNDERFLOW; + bhsdi->bhsdi_residual_count = + htonl(ntohl(bhssc->bhssc_expected_data_transfer_length) - + PDU_TOTAL_TRANSFER_LEN(request)); + } else if (PDU_TOTAL_TRANSFER_LEN(request) > + ntohl(bhssc->bhssc_expected_data_transfer_length)) { + bhsdi->bhsdi_flags |= BHSSR_FLAGS_RESIDUAL_OVERFLOW; + bhsdi->bhsdi_residual_count = + htonl(PDU_TOTAL_TRANSFER_LEN(request) - + ntohl(bhssc->bhssc_expected_data_transfer_length)); + } + bhsdi->bhsdi_status = io->scsiio.scsi_status; + io->io_hdr.flags |= CTL_FLAG_STATUS_SENT; + } + } KASSERT(response->ip_data_len > 0, ("sending empty Data-In")); cfiscsi_pdu_queue(response); } @@ -2769,8 +2792,9 @@ cfiscsi_scsi_command_done(union ctl_io * * Do not return status for aborted commands. * There are exceptions, but none supported by CTL yet. */ - if ((io->io_hdr.flags & CTL_FLAG_ABORT) && - (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { + if (((io->io_hdr.flags & CTL_FLAG_ABORT) && + (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) || + (io->io_hdr.flags & CTL_FLAG_STATUS_SENT)) { ctl_free_io(io); icl_pdu_free(request); return; Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl_io.h Thu Dec 18 08:25:00 2014 (r275881) @@ -124,9 +124,10 @@ typedef enum { CTL_FLAG_FAILOVER = 0x04000000, /* Killed by a failover */ CTL_FLAG_IO_ACTIVE = 0x08000000, /* I/O active on this SC */ CTL_FLAG_RDMA_MASK = CTL_FLAG_NO_DATASYNC | CTL_FLAG_BUS_ADDR | - CTL_FLAG_AUTO_MIRROR | CTL_FLAG_REDIR_DONE + CTL_FLAG_AUTO_MIRROR | CTL_FLAG_REDIR_DONE, /* Flags we care about for remote DMA */ + CTL_FLAG_STATUS_SENT = 0x10000000 /* Status sent by datamove */ } ctl_io_flags; Modified: stable/10/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/ctl_tpc.c Thu Dec 18 08:25:00 2014 (r275881) @@ -425,7 +425,7 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio * gco_ptr->data_segment_granularity = 0; gco_ptr->inline_data_granularity = 0; - ctsio->scsi_status = SCSI_STATUS_OK; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -487,9 +487,9 @@ ctl_receive_copy_operating_parameters(st data->list_of_implemented_descriptor_type_codes[2] = EC_SEG_REGISTER_KEY; data->list_of_implemented_descriptor_type_codes[3] = EC_CSCD_ID; + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -584,9 +584,9 @@ ctl_receive_copy_status_lid1(struct ctl_ scsi_ulto4b(list_copy.curbytes >> 20, data->transfer_count); } + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -656,9 +656,9 @@ ctl_receive_copy_failure_details(struct scsi_ulto2b(list_copy.sense_len, data->sense_data_length); memcpy(data->sense_data, &list_copy.sense_data, list_copy.sense_len); + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -742,9 +742,9 @@ ctl_receive_copy_status_lid4(struct ctl_ data->sense_data_length = list_copy.sense_len; memcpy(data->sense_data, &list_copy.sense_data, list_copy.sense_len); + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -1482,8 +1482,6 @@ tpc_done(union ctl_io *io) * more sophisticated initiator type behavior, the CAM error * recovery code in ../common might be helpful. */ -// if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) -// ctl_io_error_print(io, NULL); tio = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) && (io->io_hdr.retries > 0)) { @@ -2180,9 +2178,9 @@ ctl_receive_rod_token_information(struct printf("RRTI(list=%u) valid=%d\n", scsi_4btoul(cdb->list_identifier), list_copy.res_token_valid); */ + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } @@ -2246,9 +2244,9 @@ ctl_report_all_rod_tokens(struct ctl_scs /* printf("RART tokens=%d\n", i); */ + ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); return (retval); } Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:23:59 2014 (r275880) +++ stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:25:00 2014 (r275881) @@ -792,14 +792,15 @@ ctlfestart(struct cam_periph *periph, un flags = atio->ccb_h.flags & (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); + cmd_info = (struct ctlfe_lun_cmd_info *)io->io_hdr.port_priv; + cmd_info->cur_transfer_index = 0; + cmd_info->cur_transfer_off = 0; + cmd_info->flags = 0; if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) { /* * Datamove call, we need to setup the S/G list. */ - cmd_info = (struct ctlfe_lun_cmd_info *) - io->io_hdr.port_priv; - bzero(cmd_info, sizeof(*cmd_info)); scsi_status = 0; csio->cdb_len = atio->cdb_len; ctlfedata(softc, io, &flags, &data_ptr, &dxfer_len, @@ -880,17 +881,23 @@ ctlfestart(struct cam_periph *periph, un xpt_schedule(periph, /*priority*/ 1); return; } - + data_ptr = NULL; + dxfer_len = 0; + csio->sglist_cnt = 0; + scsi_status = 0; + } + if ((io->io_hdr.flags & CTL_FLAG_STATUS_QUEUED) && + (cmd_info->flags & CTLFE_CMD_PIECEWISE) == 0 && + ((io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) == 0 || + io->io_hdr.status == CTL_SUCCESS)) { + io->io_hdr.flags |= CTL_FLAG_STATUS_SENT; flags |= CAM_SEND_STATUS; scsi_status = io->scsiio.scsi_status; csio->sense_len = io->scsiio.sense_len; - data_ptr = NULL; - dxfer_len = 0; #ifdef CTLFEDEBUG printf("%s: tag %04x status %x\n", __func__, atio->tag_id, io->io_hdr.status); #endif - csio->sglist_cnt = 0; if (csio->sense_len != 0) { csio->sense_data = io->scsiio.sense_data; flags |= CAM_SEND_SENSE; @@ -2042,6 +2049,19 @@ ctlfe_done(union ctl_io *io) ccb->ccb_h.status = CAM_REQ_INPROG; ccb->ccb_h.func_code = XPT_NOTIFY_ACKNOWLEDGE; xpt_action(ccb); + } else if (io->io_hdr.flags & CTL_FLAG_STATUS_SENT) { + if (softc->flags & CTLFE_LUN_WILDCARD) { + ccb->ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb->ccb_h.target_lun = CAM_LUN_WILDCARD; + } + if (periph->flags & CAM_PERIPH_INVALID) { + ctlfe_free_ccb(periph, ccb); + } else { + softc->atios_sent++; + cam_periph_unlock(periph); + xpt_action(ccb); + return; + } } else { io->io_hdr.flags |= CTL_FLAG_STATUS_QUEUED; TAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h, From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:26:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BB807A; Thu, 18 Dec 2014 08:26: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 6716F179A; Thu, 18 Dec 2014 08:26: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 sBI8QCv0020144; Thu, 18 Dec 2014 08:26:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8QCbf020143; Thu, 18 Dec 2014 08:26:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180826.sBI8QCbf020143@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275882 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:26:12 -0000 Author: mav Date: Thu Dec 18 08:26:11 2014 New Revision: 275882 URL: https://svnweb.freebsd.org/changeset/base/275882 Log: MFC r275365: Move ctlfe_onoffline() out of lock to let it sleep when needed. Do some more other polishing while there. Modified: stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:25:00 2014 (r275881) +++ stable/10/sys/cam/ctl/scsi_ctl.c Thu Dec 18 08:26:11 2014 (r275882) @@ -622,6 +622,9 @@ ctlferegister(struct cam_periph *periph, "notify CCBs, status 0x%x\n", __func__, status); return (CAM_REQ_CMP_ERR); } + mtx_lock(&bus_softc->lun_softc_mtx); + STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); + mtx_unlock(&bus_softc->lun_softc_mtx); return (CAM_REQ_CMP); } @@ -1573,12 +1576,7 @@ ctlfe_onoffline(void *arg, int online) printf("%s: unable to create path!\n", __func__); return; } - ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_NOWAIT | M_ZERO); - if (ccb == NULL) { - printf("%s: unable to malloc CCB!\n", __func__); - xpt_free_path(path); - return; - } + ccb = xpt_alloc_ccb(); xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); /* @@ -1711,10 +1709,7 @@ ctlfe_onoffline(void *arg, int online) } xpt_free_path(path); - - free(ccb, M_TEMP); - - return; + xpt_free_ccb(ccb); } static void @@ -1740,14 +1735,7 @@ ctlfe_online(void *arg) return; } - lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, - M_NOWAIT | M_ZERO); - if (lun_softc == NULL) { - xpt_print(path, "%s: unable to allocate softc for " - "wildcard periph\n", __func__); - xpt_free_path(path); - return; - } + lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, M_WAITOK | M_ZERO); xpt_path_lock(path); periph = cam_periph_find(path, "ctl"); @@ -1780,14 +1768,10 @@ ctlfe_online(void *arg) "cam_periph_alloc()\n", __func__, (entry != NULL) ? entry->status_text : "Unknown", status); free(lun_softc, M_CTLFE); - } else { - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); - ctlfe_onoffline(arg, /*online*/ 1); } xpt_path_unlock(path); + ctlfe_onoffline(arg, /*online*/ 1); xpt_free_path(path); } @@ -1801,6 +1785,8 @@ ctlfe_offline(void *arg) bus_softc = (struct ctlfe_softc *)arg; + ctlfe_onoffline(arg, /*online*/ 0); + /* * Disable the wildcard LUN for this port now that we have taken * the port offline. @@ -1813,14 +1799,9 @@ ctlfe_offline(void *arg) __func__); return; } - xpt_path_lock(path); - - ctlfe_onoffline(arg, /*online*/ 0); - if ((periph = cam_periph_find(path, "ctl")) != NULL) cam_periph_invalidate(periph); - xpt_path_unlock(path); xpt_free_path(path); } @@ -1881,10 +1862,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i "cam_periph_alloc()\n", __func__, (entry != NULL) ? entry->status_text : "Unknown", status); free(softc, M_CTLFE); - } else { - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); } xpt_path_unlock(path); From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:27:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F5861D0; Thu, 18 Dec 2014 08:27: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 1091717AD; Thu, 18 Dec 2014 08:27: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 sBI8R14s020296; Thu, 18 Dec 2014 08:27:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8R1X3020294; Thu, 18 Dec 2014 08:27:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180827.sBI8R1X3020294@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275883 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:27:02 -0000 Author: mav Date: Thu Dec 18 08:27:00 2014 New Revision: 275883 URL: https://svnweb.freebsd.org/changeset/base/275883 Log: MFC r275403: Removed unused variable and unify some names. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:26:11 2014 (r275882) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:27:00 2014 (r275883) @@ -10970,7 +10970,6 @@ ctl_check_blocked(struct ctl_lun *lun) case CTL_ACTION_SKIP: { struct ctl_softc *softc; const struct ctl_cmd_entry *entry; - uint32_t initidx; int isc_retval; /* @@ -11010,8 +11009,6 @@ ctl_check_blocked(struct ctl_lun *lun) entry = ctl_get_cmd_entry(&cur_blocked->scsiio, NULL); softc = control_softc; - initidx = ctl_get_initindex(&cur_blocked->io_hdr.nexus); - /* * Check this I/O for LUN state changes that may * have happened while this command was blocked. @@ -11848,7 +11845,7 @@ ctl_lun_reset(struct ctl_lun *lun, union { union ctl_io *xio; #if 0 - uint32_t initindex; + uint32_t initidx; #endif int i; @@ -11868,9 +11865,9 @@ ctl_lun_reset(struct ctl_lun *lun, union * This version sets unit attention for every */ #if 0 - initindex = ctl_get_initindex(&io->io_hdr.nexus); + initidx = ctl_get_initindex(&io->io_hdr.nexus); for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (initindex == i) + if (initidx == i) continue; lun->pending_ua[i] |= ua_type; } @@ -11978,9 +11975,9 @@ ctl_i_t_nexus_reset(union ctl_io *io) { struct ctl_softc *softc = control_softc; struct ctl_lun *lun; - uint32_t initindex, residx; + uint32_t initidx, residx; - initindex = ctl_get_initindex(&io->io_hdr.nexus); + initidx = ctl_get_initindex(&io->io_hdr.nexus); residx = ctl_get_resindex(&io->io_hdr.nexus); mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(lun, &softc->lun_list, links) { @@ -11989,11 +11986,11 @@ ctl_i_t_nexus_reset(union ctl_io *io) io->io_hdr.nexus.initid.id, (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0); #ifdef CTL_WITH_CA - ctl_clear_mask(lun->have_ca, initindex); + ctl_clear_mask(lun->have_ca, initidx); #endif if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == residx)) lun->flags &= ~CTL_LUN_RESERVED; - lun->pending_ua[initindex] |= CTL_UA_I_T_NEXUS_LOSS; + lun->pending_ua[initidx] |= CTL_UA_I_T_NEXUS_LOSS; mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:27:48 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 331D2311; Thu, 18 Dec 2014 08:27: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 1E5A717C7; Thu, 18 Dec 2014 08:27: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 sBI8RlNa020440; Thu, 18 Dec 2014 08:27:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8RlCh020439; Thu, 18 Dec 2014 08:27:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180827.sBI8RlCh020439@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275884 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:27:48 -0000 Author: mav Date: Thu Dec 18 08:27:46 2014 New Revision: 275884 URL: https://svnweb.freebsd.org/changeset/base/275884 Log: MFC r275404: Reduce code duplication by creating ctl_set_res_ua() helper. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:27:00 2014 (r275883) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:27:46 2014 (r275884) @@ -7875,6 +7875,15 @@ retry: return (CTL_RETVAL_COMPLETE); } +static void +ctl_set_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) +{ + + if (residx >= persis_offset && + residx < persis_offset + CTL_MAX_INITIATORS) + lun->pending_ua[residx - persis_offset] |= ua; +} + /* * Returns 0 if ctl_persistent_reserve_out() should continue, non-zero if * it should return. @@ -7928,15 +7937,8 @@ ctl_pro_preempt(struct ctl_softc *softc, if (i == residx || lun->pr_keys[i] == 0) continue; - if (!persis_offset - && i pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; lun->res_type = type; @@ -8007,12 +8009,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; - else if (persis_offset && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { mtx_unlock(&lun->lun_lock); @@ -8087,27 +8084,11 @@ ctl_pro_preempt(struct ctl_softc *softc, if (sa_res_key == lun->pr_keys[i]) { lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type ==SPR_TYPE_EX_AC_RO)){ - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[ - i-persis_offset] |= - CTL_UA_RES_RELEASE; + ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = type; @@ -8146,15 +8127,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { @@ -8209,14 +8182,8 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_keys[i] == 0) continue; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_REG_PREEMPT; lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; @@ -8231,15 +8198,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset - && i < persis_offset) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } } } else { @@ -8251,25 +8210,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (sa_res_key == lun->pr_keys[i]) { lun->pr_keys[i] = 0; lun->pr_key_count--; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (msg->pr.pr_info.res_type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type == SPR_TYPE_EX_AC_RO)) { - if (!persis_offset - && i < persis_offset) - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_RES_RELEASE; + ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = msg->pr.pr_info.res_type; @@ -8653,14 +8598,8 @@ ctl_persistent_reserve_out(struct ctl_sc for (i=0; i < 2*CTL_MAX_INITIATORS; i++) if (lun->pr_keys[i] != 0) { - if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_RES_PREEMPT; - else if (persis_offset && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_RES_PREEMPT; - lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; mtx_unlock(&lun->lun_lock); @@ -8802,14 +8741,8 @@ ctl_hndl_per_res_out_on_other_sc(union c for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { if (lun->pr_keys[i] == 0) continue; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= CTL_UA_RES_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_RES_PREEMPT; lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; break; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:28:46 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44F0244B; Thu, 18 Dec 2014 08:28: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 3061917D3; Thu, 18 Dec 2014 08:28: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 sBI8SkV5020622; Thu, 18 Dec 2014 08:28:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8SjqG020618; Thu, 18 Dec 2014 08:28:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180828.sBI8SjqG020618@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275885 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:28:46 -0000 Author: mav Date: Thu Dec 18 08:28:44 2014 New Revision: 275885 URL: https://svnweb.freebsd.org/changeset/base/275885 Log: MFC r275405: Convert persis_offset from global variable to softc field. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:27:46 2014 (r275884) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:28:44 2014 (r275885) @@ -356,7 +356,6 @@ static struct ctl_logical_block_provisio * XXX KDM move these into the softc. */ static int rcv_sync_msg; -static int persis_offset; static uint8_t ctl_pause_rtr; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); @@ -1076,7 +1075,7 @@ ctl_init(void) softc->port_offset = 0; } else softc->port_offset = (softc->ha_id - 1) * CTL_MAX_PORTS; - persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; + softc->persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; /* * XXX KDM need to figure out where we want to get our target ID @@ -7878,10 +7877,10 @@ retry: static void ctl_set_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) { + int off = lun->ctl_softc->persis_offset; - if (residx >= persis_offset && - residx < persis_offset + CTL_MAX_INITIATORS) - lun->pending_ua[residx - persis_offset] |= ua; + if (residx >= off && residx < off + CTL_MAX_INITIATORS) + lun->pending_ua[residx - off] |= ua; } /* @@ -8420,8 +8419,8 @@ ctl_persistent_reserve_out(struct ctl_sc */ for (i = 0; i < CTL_MAX_INITIATORS;i++){ - if (lun->pr_keys[ - i + persis_offset] == 0) + if (lun->pr_keys[i + + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; @@ -8568,7 +8567,7 @@ ctl_persistent_reserve_out(struct ctl_sc && type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { if (i == residx || - lun->pr_keys[i + persis_offset] == 0) + lun->pr_keys[i + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8685,8 +8684,8 @@ ctl_hndl_per_res_out_on_other_sc(union c */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i+ - persis_offset] == 0) + if (lun->pr_keys[i + + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= @@ -8719,7 +8718,7 @@ ctl_hndl_per_res_out_on_other_sc(union c if (lun->res_type != SPR_TYPE_EX_AC && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) - if (lun->pr_keys[i+persis_offset] != 0) + if (lun->pr_keys[i + softc->persis_offset] != 0) lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:27:46 2014 (r275884) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:28:44 2014 (r275885) @@ -450,6 +450,7 @@ struct ctl_softc { int ha_state; int is_single; int port_offset; + int persis_offset; int inquiry_pq_no_lun; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:30:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1124D688; Thu, 18 Dec 2014 08:30: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 EFFB018A8; Thu, 18 Dec 2014 08:30: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 sBI8UTRR023985; Thu, 18 Dec 2014 08:30:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8UTER023983; Thu, 18 Dec 2014 08:30:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180830.sBI8UTER023983@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275886 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:30:30 -0000 Author: mav Date: Thu Dec 18 08:30:28 2014 New Revision: 275886 URL: https://svnweb.freebsd.org/changeset/base/275886 Log: MFC r275447: Do not pre-allocate reservation keys memory for every possible initiator. In configurations with many ports, like iSCSI, each LUN is typically accessed only by limited subset of ports. Allocating that memory on demand allows to reduce CTL memory usage from 5.3MB/LUN to 1.3MB/LUN. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:28:44 2014 (r275885) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:30:28 2014 (r275886) @@ -3038,7 +3038,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_DUMP_STRUCTS: { - int i, j, k, idx; + int i, j, k; struct ctl_port *port; struct ctl_frontend *fe; @@ -3054,13 +3054,14 @@ ctl_ioctl(struct cdev *dev, u_long cmd, continue; for (j = 0; j < (CTL_MAX_PORTS * 2); j++) { + if (lun->pr_keys[j] == NULL) + continue; for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){ - idx = j * CTL_MAX_INIT_PER_PORT + k; - if (lun->pr_keys[idx] == 0) + if (lun->pr_keys[j][k] == 0) continue; printf(" LUN %d port %d iid %d key " "%#jx\n", i, j, k, - (uintmax_t)lun->pr_keys[idx]); + (uintmax_t)lun->pr_keys[j][k]); } } } @@ -3649,6 +3650,57 @@ ctl_is_set(uint32_t *mask, uint32_t bit) return (1); } +static uint64_t +ctl_get_prkey(struct ctl_lun *lun, uint32_t residx) +{ + uint64_t *t; + + t = lun->pr_keys[residx/CTL_MAX_INIT_PER_PORT]; + if (t == NULL) + return (0); + return (t[residx % CTL_MAX_INIT_PER_PORT]); +} + +static void +ctl_clr_prkey(struct ctl_lun *lun, uint32_t residx) +{ + uint64_t *t; + + t = lun->pr_keys[residx/CTL_MAX_INIT_PER_PORT]; + if (t == NULL) + return; + t[residx % CTL_MAX_INIT_PER_PORT] = 0; +} + +static void +ctl_alloc_prkey(struct ctl_lun *lun, uint32_t residx) +{ + uint64_t *p; + u_int i; + + i = residx/CTL_MAX_INIT_PER_PORT; + if (lun->pr_keys[i] != NULL) + return; + mtx_unlock(&lun->lun_lock); + p = malloc(sizeof(uint64_t) * CTL_MAX_INIT_PER_PORT, M_CTL, + M_WAITOK | M_ZERO); + mtx_lock(&lun->lun_lock); + if (lun->pr_keys[i] == NULL) + lun->pr_keys[i] = p; + else + free(p, M_CTL); +} + +static void +ctl_set_prkey(struct ctl_lun *lun, uint32_t residx, uint64_t key) +{ + uint64_t *t; + + t = lun->pr_keys[residx/CTL_MAX_INIT_PER_PORT]; + KASSERT(t != NULL, ("prkey %d is not allocated", residx)); + t[residx % CTL_MAX_INIT_PER_PORT] = key; +} + #ifdef unused /* * The bus, target and lun are optional, they can be filled in later. @@ -4687,6 +4739,10 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); + for (i = 0; i < 2 * CTL_MAX_PORTS; i++) { + if (lun->pr_keys[i] != NULL) + free(lun->pr_keys[i], M_CTL); + } free(lun->write_buffer, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); @@ -5347,7 +5403,7 @@ ctl_start_stop(struct ctl_scsiio *ctsio) uint32_t residx; residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if (lun->pr_keys[residx] == 0 + if (ctl_get_prkey(lun, residx) == 0 || (lun->pr_res_idx!=residx && lun->res_type < 4)) { ctl_set_reservation_conflict(ctsio); @@ -7615,6 +7671,7 @@ ctl_persistent_reserve_in(struct ctl_scs /* struct scsi_per_res_in_rsrv in_data; */ struct ctl_lun *lun; struct ctl_softc *softc; + uint64_t key; CTL_DEBUG_PRINT(("ctl_persistent_reserve_in\n")); @@ -7700,7 +7757,7 @@ retry: lun->pr_key_count, res_keys->header.length); for (i = 0, key_count = 0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] == 0) + if ((key = ctl_get_prkey(lun, i)) == 0) continue; /* @@ -7726,8 +7783,7 @@ retry: key_count++; continue; } - scsi_u64to8b(lun->pr_keys[i], - res_keys->keys[key_count].key); + scsi_u64to8b(key, res_keys->keys[key_count].key); key_count++; } break; @@ -7778,7 +7834,7 @@ retry: * is 0, since it doesn't really matter. */ if (lun->pr_res_idx != CTL_PR_ALL_REGISTRANTS) { - scsi_u64to8b(lun->pr_keys[lun->pr_res_idx], + scsi_u64to8b(ctl_get_prkey(lun, lun->pr_res_idx), res->data.reservation); } res->data.scopetype = lun->res_type; @@ -7830,10 +7886,10 @@ retry: res_desc = &res_status->desc[0]; for (i = 0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] == 0) + if ((key = ctl_get_prkey(lun, i)) == 0) continue; - scsi_u64to8b(lun->pr_keys[i], res_desc->res_key.key); + scsi_u64to8b(key, res_desc->res_key.key); if ((lun->flags & CTL_LUN_PR_RESERVED) && (lun->pr_res_idx == i || lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS)) { @@ -7933,10 +7989,10 @@ ctl_pro_preempt(struct ctl_softc *softc, * them */ for(i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (i == residx || lun->pr_keys[i] == 0) + if (i == residx || ctl_get_prkey(lun, i) == 0) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; @@ -8002,11 +8058,11 @@ ctl_pro_preempt(struct ctl_softc *softc, } for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] != sa_res_key) + if (ctl_get_prkey(lun, i) != sa_res_key) continue; found = 1; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8035,7 +8091,7 @@ ctl_pro_preempt(struct ctl_softc *softc, } else { /* Reserved but not all registrants */ /* sa_res_key is res holder */ - if (sa_res_key == lun->pr_keys[lun->pr_res_idx]) { + if (sa_res_key == ctl_get_prkey(lun, lun->pr_res_idx)) { /* validate scope and type */ if ((cdb->scope_type & SPR_SCOPE_MASK) != SPR_LU_SCOPE) { @@ -8077,11 +8133,11 @@ ctl_pro_preempt(struct ctl_softc *softc, */ for(i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (i == residx || lun->pr_keys[i] == 0) + if (i == residx || ctl_get_prkey(lun, i) == 0) continue; - if (sa_res_key == lun->pr_keys[i]) { - lun->pr_keys[i] = 0; + if (sa_res_key == ctl_get_prkey(lun, i)) { + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (type != lun->res_type @@ -8120,11 +8176,11 @@ ctl_pro_preempt(struct ctl_softc *softc, int found=0; for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (sa_res_key != lun->pr_keys[i]) + if (sa_res_key != ctl_get_prkey(lun, i)) continue; found = 1; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8170,7 +8226,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS || lun->pr_res_idx == CTL_PR_NO_RESERVATION - || sa_res_key != lun->pr_keys[lun->pr_res_idx]) { + || sa_res_key != ctl_get_prkey(lun, lun->pr_res_idx)) { if (sa_res_key == 0) { /* * Unregister everybody else and build UA for @@ -8178,10 +8234,10 @@ ctl_pro_preempt_other(struct ctl_lun *lu */ for(i=0; i < 2*CTL_MAX_INITIATORS; i++) { if (i == msg->pr.pr_info.residx || - lun->pr_keys[i] == 0) + ctl_get_prkey(lun, i) == 0) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8192,10 +8248,10 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_res_idx = msg->pr.pr_info.residx; } else { for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (sa_res_key == lun->pr_keys[i]) + if (sa_res_key == ctl_get_prkey(lun, i)) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8203,11 +8259,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu } else { for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { if (i == msg->pr.pr_info.residx || - lun->pr_keys[i] == 0) + ctl_get_prkey(lun, i) == 0) continue; - if (sa_res_key == lun->pr_keys[i]) { - lun->pr_keys[i] = 0; + if (sa_res_key == ctl_get_prkey(lun, i)) { + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (msg->pr.pr_info.res_type != lun->res_type @@ -8239,7 +8295,7 @@ ctl_persistent_reserve_out(struct ctl_sc struct scsi_per_res_out_parms* param; struct ctl_softc *softc; uint32_t residx; - uint64_t res_key, sa_res_key; + uint64_t res_key, sa_res_key, key; uint8_t type; union ctl_ha_msg persis_io; int i; @@ -8313,8 +8369,8 @@ ctl_persistent_reserve_out(struct ctl_sc */ if ((cdb->action & SPRO_ACTION_MASK) != SPRO_REG_IGNO) { mtx_lock(&lun->lun_lock); - if (lun->pr_keys[residx] != 0) { - if (res_key != lun->pr_keys[residx]) { + if ((key = ctl_get_prkey(lun, residx)) != 0) { + if (res_key != key) { /* * The current key passed in doesn't match * the one the initiator previously @@ -8395,12 +8451,12 @@ ctl_persistent_reserve_out(struct ctl_sc if ((res_key == 0 && (cdb->action & SPRO_ACTION_MASK) == SPRO_REGISTER) || ((cdb->action & SPRO_ACTION_MASK) == SPRO_REG_IGNO - && lun->pr_keys[residx] == 0)) { + && ctl_get_prkey(lun, residx) == 0)) { mtx_unlock(&lun->lun_lock); goto done; } - lun->pr_keys[residx] = 0; + ctl_clr_prkey(lun, residx); lun->pr_key_count--; if (residx == lun->pr_res_idx) { @@ -8419,8 +8475,8 @@ ctl_persistent_reserve_out(struct ctl_sc */ for (i = 0; i < CTL_MAX_INITIATORS;i++){ - if (lun->pr_keys[i + - softc->persis_offset] == 0) + if (ctl_get_prkey(lun, i + + softc->persis_offset) == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; @@ -8450,9 +8506,10 @@ ctl_persistent_reserve_out(struct ctl_sc * If we aren't registered currently then increment * the key count and set the registered flag. */ - if (lun->pr_keys[residx] == 0) + ctl_alloc_prkey(lun, residx); + if (ctl_get_prkey(lun, residx) == 0) lun->pr_key_count++; - lun->pr_keys[residx] = sa_res_key; + ctl_set_prkey(lun, residx, sa_res_key); persis_io.hdr.nexus = ctsio->io_hdr.nexus; persis_io.hdr.msg_type = CTL_MSG_PERS_ACTION; @@ -8567,7 +8624,8 @@ ctl_persistent_reserve_out(struct ctl_sc && type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { if (i == residx || - lun->pr_keys[i + softc->persis_offset] == 0) + ctl_get_prkey(lun, + i + softc->persis_offset) == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8593,11 +8651,10 @@ ctl_persistent_reserve_out(struct ctl_sc lun->pr_key_count = 0; lun->pr_res_idx = CTL_PR_NO_RESERVATION; - lun->pr_keys[residx] = 0; - + ctl_clr_prkey(lun, residx); for (i=0; i < 2*CTL_MAX_INITIATORS; i++) - if (lun->pr_keys[i] != 0) { - lun->pr_keys[i] = 0; + if (ctl_get_prkey(lun, i) != 0) { + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; @@ -8655,15 +8712,16 @@ ctl_hndl_per_res_out_on_other_sc(union c mtx_lock(&lun->lun_lock); switch(msg->pr.pr_info.action) { case CTL_PR_REG_KEY: - if (lun->pr_keys[msg->pr.pr_info.residx] == 0) + ctl_alloc_prkey(lun, msg->pr.pr_info.residx); + if (ctl_get_prkey(lun, msg->pr.pr_info.residx) == 0) lun->pr_key_count++; - lun->pr_keys[msg->pr.pr_info.residx] = - scsi_8btou64(msg->pr.pr_info.sa_res_key); + ctl_set_prkey(lun, msg->pr.pr_info.residx, + scsi_8btou64(msg->pr.pr_info.sa_res_key)); lun->PRGeneration++; break; case CTL_PR_UNREG_KEY: - lun->pr_keys[msg->pr.pr_info.residx] = 0; + ctl_clr_prkey(lun, msg->pr.pr_info.residx); lun->pr_key_count--; /* XXX Need to see if the reservation has been released */ @@ -8684,8 +8742,8 @@ ctl_hndl_per_res_out_on_other_sc(union c */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i + - softc->persis_offset] == 0) + if (ctl_get_prkey(lun, i + + softc->persis_offset) == 0) continue; lun->pending_ua[i] |= @@ -8718,7 +8776,7 @@ ctl_hndl_per_res_out_on_other_sc(union c if (lun->res_type != SPR_TYPE_EX_AC && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) - if (lun->pr_keys[i + softc->persis_offset] != 0) + if (ctl_get_prkey(lun, i + softc->persis_offset) != 0) lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8738,9 +8796,9 @@ ctl_hndl_per_res_out_on_other_sc(union c lun->pr_res_idx = CTL_PR_NO_RESERVATION; for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] == 0) + if (ctl_get_prkey(lun, i) == 0) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; @@ -11051,7 +11109,7 @@ ctl_scsiio_lun_check(struct ctl_softc *c * reservation and this isn't the res holder then set a * conflict. */ - if (lun->pr_keys[residx] == 0 + if (ctl_get_prkey(lun, residx) == 0 || (residx != lun->pr_res_idx && lun->res_type < 4)) { ctl_set_reservation_conflict(ctsio); retval = 1; Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:28:44 2014 (r275885) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:30:28 2014 (r275886) @@ -410,7 +410,7 @@ struct ctl_lun { struct ctl_lun_io_stats stats; uint32_t res_idx; unsigned int PRGeneration; - uint64_t pr_keys[2*CTL_MAX_INITIATORS]; + uint64_t *pr_keys[2 * CTL_MAX_PORTS]; int pr_key_count; uint32_t pr_res_idx; uint8_t res_type; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:31:14 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 651687D4; Thu, 18 Dec 2014 08:31: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 3729F18BF; Thu, 18 Dec 2014 08:31: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 sBI8VEAv024593; Thu, 18 Dec 2014 08:31:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8VE7Y024592; Thu, 18 Dec 2014 08:31:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180831.sBI8VE7Y024592@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275887 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:31:14 -0000 Author: mav Date: Thu Dec 18 08:31:13 2014 New Revision: 275887 URL: https://svnweb.freebsd.org/changeset/base/275887 Log: MFC r275455: Remove some unused code. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:30:28 2014 (r275886) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:31:13 2014 (r275887) @@ -402,12 +402,6 @@ static int ctl_ioctl(struct cdev *dev, u struct thread *td); static uint32_t ctl_map_lun(int port_num, uint32_t lun); static uint32_t ctl_map_lun_back(int port_num, uint32_t lun); -#ifdef unused -static union ctl_io *ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port, - uint32_t targ_target, uint32_t targ_lun, - int can_wait); -static void ctl_kfree_io(union ctl_io *io); -#endif /* unused */ static int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun, struct ctl_be_lun *be_lun, struct ctl_id target_id); static int ctl_free_lun(struct ctl_lun *lun); @@ -3701,43 +3695,6 @@ ctl_set_prkey(struct ctl_lun *lun, uint3 t[residx % CTL_MAX_INIT_PER_PORT] = key; } -#ifdef unused -/* - * The bus, target and lun are optional, they can be filled in later. - * can_wait is used to determine whether we can wait on the malloc or not. - */ -union ctl_io* -ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port, uint32_t targ_target, - uint32_t targ_lun, int can_wait) -{ - union ctl_io *io; - - if (can_wait) - io = (union ctl_io *)malloc(sizeof(*io), M_CTL, M_WAITOK); - else - io = (union ctl_io *)malloc(sizeof(*io), M_CTL, M_NOWAIT); - - if (io != NULL) { - io->io_hdr.io_type = io_type; - io->io_hdr.targ_port = targ_port; - /* - * XXX KDM this needs to change/go away. We need to move - * to a preallocated pool of ctl_scsiio structures. - */ - io->io_hdr.nexus.targ_target.id = targ_target; - io->io_hdr.nexus.targ_lun = targ_lun; - } - - return (io); -} - -void -ctl_kfree_io(union ctl_io *io) -{ - free(io, M_CTL); -} -#endif /* unused */ - /* * ctl_softc, pool_name, total_ctl_io are passed in. * npool is passed out. From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:32:08 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 145CE910; Thu, 18 Dec 2014 08:32: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 F34B118D0; Thu, 18 Dec 2014 08:32: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 sBI8W7W3024784; Thu, 18 Dec 2014 08:32:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8W7dh024780; Thu, 18 Dec 2014 08:32:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180832.sBI8W7dh024780@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275888 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:32:08 -0000 Author: mav Date: Thu Dec 18 08:32:06 2014 New Revision: 275888 URL: https://svnweb.freebsd.org/changeset/base/275888 Log: MFC r275458: Do not pre-allocate UNIT ATTENTIONs storage for every possible initiator. Abusing ability of major UAs cover minor ones we may not account UAs for inactive ports. Allocate UAs storage for port and start accounting only after some initiator from that port fetched its first POWER ON OCCURRED. This reduces per-LUN CTL memory usage from >1MB to less then 100K. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_error.c stable/10/sys/cam/ctl/ctl_error.h stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:31:13 2014 (r275887) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:32:06 2014 (r275888) @@ -964,12 +964,70 @@ ctl_copy_sense_data(union ctl_ha_msg *sr dest->io_hdr.status = src->hdr.status; } +static void +ctl_est_ua(struct ctl_lun *lun, uint32_t initidx, ctl_ua_type ua) +{ + ctl_ua_type *pu; + + mtx_assert(&lun->lun_lock, MA_OWNED); + pu = lun->pending_ua[initidx / CTL_MAX_INIT_PER_PORT]; + if (pu == NULL) + return; + pu[initidx % CTL_MAX_INIT_PER_PORT] |= ua; +} + +static void +ctl_est_ua_all(struct ctl_lun *lun, uint32_t except, ctl_ua_type ua) +{ + int i, j; + + mtx_assert(&lun->lun_lock, MA_OWNED); + for (i = 0; i < CTL_MAX_PORTS; i++) { + if (lun->pending_ua[i] == NULL) + continue; + for (j = 0; j < CTL_MAX_INIT_PER_PORT; j++) { + if (i * CTL_MAX_INIT_PER_PORT + j == except) + continue; + lun->pending_ua[i][j] |= ua; + } + } +} + +static void +ctl_clr_ua(struct ctl_lun *lun, uint32_t initidx, ctl_ua_type ua) +{ + ctl_ua_type *pu; + + mtx_assert(&lun->lun_lock, MA_OWNED); + pu = lun->pending_ua[initidx / CTL_MAX_INIT_PER_PORT]; + if (pu == NULL) + return; + pu[initidx % CTL_MAX_INIT_PER_PORT] &= ~ua; +} + +static void +ctl_clr_ua_all(struct ctl_lun *lun, uint32_t except, ctl_ua_type ua) +{ + int i, j; + + mtx_assert(&lun->lun_lock, MA_OWNED); + for (i = 0; i < CTL_MAX_PORTS; i++) { + if (lun->pending_ua[i] == NULL) + continue; + for (j = 0; j < CTL_MAX_INIT_PER_PORT; j++) { + if (i * CTL_MAX_INIT_PER_PORT + j == except) + continue; + lun->pending_ua[i][j] &= ~ua; + } + } +} + 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; + int error, value; if (softc->flags & CTL_FLAG_ACTIVE_SHELF) value = 0; @@ -987,8 +1045,7 @@ ctl_ha_state_sysctl(SYSCTL_HANDLER_ARGS) 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; + ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); @@ -4549,19 +4606,13 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft ctl_init_log_page_index(lun); /* - * Set the poweron UA for all initiators on this LUN only. - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] = CTL_UA_POWERON; - - /* * Now, before we insert this lun on the lun list, set the lun * inventory changed UA for all other luns. */ STAILQ_FOREACH(nlun, &ctl_softc->lun_list, links) { - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - nlun->pending_ua[i] |= CTL_UA_LUN_CHANGE; - } + mtx_lock(&nlun->lun_lock); + ctl_est_ua_all(nlun, -1, CTL_UA_LUN_CHANGE); + mtx_unlock(&nlun->lun_lock); } STAILQ_INSERT_TAIL(&ctl_softc->lun_list, lun, links); @@ -4696,18 +4747,18 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); - for (i = 0; i < 2 * CTL_MAX_PORTS; i++) { - if (lun->pr_keys[i] != NULL) - free(lun->pr_keys[i], M_CTL); - } + for (i = 0; i < CTL_MAX_PORTS; i++) + free(lun->pending_ua[i], M_CTL); + for (i = 0; i < 2 * CTL_MAX_PORTS; i++) + free(lun->pr_keys[i], M_CTL); free(lun->write_buffer, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); STAILQ_FOREACH(nlun, &softc->lun_list, links) { - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - nlun->pending_ua[i] |= CTL_UA_LUN_CHANGE; - } + mtx_lock(&nlun->lun_lock); + ctl_est_ua_all(nlun, -1, CTL_UA_LUN_CHANGE); + mtx_unlock(&nlun->lun_lock); } return (0); @@ -4985,19 +5036,10 @@ ctl_lun_operable(struct ctl_be_lun *be_l void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun) { - struct ctl_lun *lun; - struct ctl_softc *softc; - int i; - - softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); - - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] |= CTL_UA_CAPACITY_CHANGED; - + ctl_est_ua_all(lun, -1, CTL_UA_CAPACITY_CHANGED); mtx_unlock(&lun->lun_lock); } @@ -6045,19 +6087,8 @@ ctl_control_page_handler(struct ctl_scsi saved_cp->eca_and_aen |= user_cp->eca_and_aen & SCP_SWP; set_ua = 1; } - if (set_ua != 0) { - int i; - /* - * Let other initiators know that the mode - * parameters for this LUN have changed. - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (i == initidx) - continue; - - lun->pending_ua[i] |= CTL_UA_MODE_CHANGE; - } - } + if (set_ua != 0) + ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE); mtx_unlock(&lun->lun_lock); return (0); @@ -6093,19 +6124,8 @@ ctl_caching_sp_handler(struct ctl_scsiio saved_cp->flags1 |= user_cp->flags1 & (SCP_WCE | SCP_RCD); set_ua = 1; } - if (set_ua != 0) { - int i; - /* - * Let other initiators know that the mode - * parameters for this LUN have changed. - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (i == initidx) - continue; - - lun->pending_ua[i] |= CTL_UA_MODE_CHANGE; - } - } + if (set_ua != 0) + ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE); mtx_unlock(&lun->lun_lock); return (0); @@ -7893,7 +7913,7 @@ ctl_set_res_ua(struct ctl_lun *lun, uint int off = lun->ctl_softc->persis_offset; if (residx >= off && residx < off + CTL_MAX_INITIATORS) - lun->pending_ua[residx - off] |= ua; + ctl_est_ua(lun, residx - off, ua); } /* @@ -8435,8 +8455,8 @@ ctl_persistent_reserve_out(struct ctl_sc if (ctl_get_prkey(lun, i + softc->persis_offset) == 0) continue; - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, + CTL_UA_RES_RELEASE); } } lun->res_type = 0; @@ -8584,7 +8604,7 @@ ctl_persistent_reserve_out(struct ctl_sc ctl_get_prkey(lun, i + softc->persis_offset) == 0) continue; - lun->pending_ua[i] |= CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } } mtx_unlock(&lun->lun_lock); @@ -8703,8 +8723,7 @@ ctl_hndl_per_res_out_on_other_sc(union c softc->persis_offset) == 0) continue; - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = 0; @@ -8734,8 +8753,7 @@ ctl_hndl_per_res_out_on_other_sc(union c && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) if (ctl_get_prkey(lun, i + softc->persis_offset) != 0) - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } lun->flags &= ~CTL_LUN_PR_RESERVED; @@ -9308,7 +9326,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio */ if (request_lun != NULL) { mtx_lock(&lun->lun_lock); - lun->pending_ua[initidx] &= ~CTL_UA_LUN_CHANGE; + ctl_clr_ua(lun, initidx, CTL_UA_RES_RELEASE); mtx_unlock(&lun->lun_lock); } } @@ -9363,6 +9381,7 @@ ctl_request_sense(struct ctl_scsiio *cts uint32_t initidx; int have_error; scsi_sense_data_type sense_format; + ctl_ua_type ua_type; cdb = (struct scsi_request_sense *)ctsio->cdb; @@ -9447,11 +9466,8 @@ ctl_request_sense(struct ctl_scsiio *cts have_error = 1; } else #endif - if (lun->pending_ua[initidx] != CTL_UA_NONE) { - ctl_ua_type ua_type; - - ua_type = ctl_build_ua(&lun->pending_ua[initidx], - sense_ptr, sense_format); + { + ua_type = ctl_build_ua(lun, initidx, sense_ptr, sense_format); if (ua_type != CTL_UA_NONE) have_error = 1; } @@ -11122,7 +11138,6 @@ ctl_failover(void) union ctl_io *next_io, *pending_io; union ctl_io *io; int lun_idx; - int i; ctl_softc = control_softc; @@ -11257,13 +11272,7 @@ ctl_failover(void) } } - /* - * Build Unit Attention - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - lun->pending_ua[i] |= - CTL_UA_ASYM_ACC_CHANGE; - } + ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); } else if (((lun->flags & CTL_LUN_PRIMARY_SC) == 0) && (ctl_softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { printf("FAILOVER: secondary lun %d\n", lun_idx); @@ -11352,13 +11361,7 @@ ctl_failover(void) } } - /* - * Build Unit Attention - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - lun->pending_ua[i] |= - CTL_UA_ASYM_ACC_CHANGE; - } + ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); } else { panic("Unhandled HA mode failover, LUN flags = %#x, " "ha_mode = #%x", lun->flags, ctl_softc->ha_mode); @@ -11494,28 +11497,22 @@ ctl_scsiio_precheck(struct ctl_softc *ct */ if ((entry->flags & CTL_CMD_FLAG_NO_SENSE) == 0) { ctl_ua_type ua_type; + scsi_sense_data_type sense_format; - if (lun->pending_ua[initidx] != CTL_UA_NONE) { - scsi_sense_data_type sense_format; - - if (lun != NULL) - sense_format = (lun->flags & - CTL_LUN_SENSE_DESC) ? SSD_TYPE_DESC : - SSD_TYPE_FIXED; - else - sense_format = SSD_TYPE_FIXED; + if (lun->flags & CTL_LUN_SENSE_DESC) + sense_format = SSD_TYPE_DESC; + else + sense_format = SSD_TYPE_FIXED; - ua_type = ctl_build_ua(&lun->pending_ua[initidx], - &ctsio->sense_data, sense_format); - if (ua_type != CTL_UA_NONE) { - ctsio->scsi_status = SCSI_STATUS_CHECK_COND; - ctsio->io_hdr.status = CTL_SCSI_ERROR | - CTL_AUTOSENSE; - ctsio->sense_len = SSD_FULL_SIZE; - mtx_unlock(&lun->lun_lock); - ctl_done((union ctl_io *)ctsio); - return (retval); - } + ua_type = ctl_build_ua(lun, initidx, &ctsio->sense_data, + sense_format); + if (ua_type != CTL_UA_NONE) { + mtx_unlock(&lun->lun_lock); + ctsio->scsi_status = SCSI_STATUS_CHECK_COND; + ctsio->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE; + ctsio->sense_len = SSD_FULL_SIZE; + ctl_done((union ctl_io *)ctsio); + return (retval); } } @@ -11794,7 +11791,9 @@ ctl_lun_reset(struct ctl_lun *lun, union #if 0 uint32_t initidx; #endif +#ifdef CTL_WITH_CA int i; +#endif mtx_lock(&lun->lun_lock); /* @@ -11813,11 +11812,9 @@ ctl_lun_reset(struct ctl_lun *lun, union */ #if 0 initidx = ctl_get_initindex(&io->io_hdr.nexus); - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (initidx == i) - continue; - lun->pending_ua[i] |= ua_type; - } + ctl_est_ua_all(lun, initidx, ua_type); +#else + ctl_est_ua_all(lun, -1, ua_type); #endif /* @@ -11830,12 +11827,10 @@ ctl_lun_reset(struct ctl_lun *lun, union */ lun->flags &= ~CTL_LUN_RESERVED; - for (i = 0; i < CTL_MAX_INITIATORS; i++) { #ifdef CTL_WITH_CA + for (i = 0; i < CTL_MAX_INITIATORS; i++) ctl_clear_mask(lun->have_ca, i); #endif - lun->pending_ua[i] |= ua_type; - } mtx_unlock(&lun->lun_lock); return (0); @@ -11937,7 +11932,7 @@ ctl_i_t_nexus_reset(union ctl_io *io) #endif if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == residx)) lun->flags &= ~CTL_LUN_RESERVED; - lun->pending_ua[initidx] |= CTL_UA_I_T_NEXUS_LOSS; + ctl_est_ua(lun, initidx, CTL_UA_I_T_NEXUS_LOSS); mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); @@ -13953,14 +13948,11 @@ ctl_thresh_thread(void *arg) if (lun->lasttpt == 0 || time_uptime - lun->lasttpt >= CTL_LBP_UA_PERIOD) { lun->lasttpt = time_uptime; - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] |= - CTL_UA_THIN_PROV_THRES; + ctl_est_ua_all(lun, -1, CTL_UA_THIN_PROV_THRES); } } else { lun->lasttpt = 0; - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] &= ~CTL_UA_THIN_PROV_THRES; + ctl_clr_ua_all(lun, -1, CTL_UA_THIN_PROV_THRES); } mtx_unlock(&lun->lun_lock); } Modified: stable/10/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.c Thu Dec 18 08:31:13 2014 (r275887) +++ stable/10/sys/cam/ctl/ctl_error.c Thu Dec 18 08:32:06 2014 (r275888) @@ -367,16 +367,35 @@ ctl_set_ua(struct ctl_scsiio *ctsio, int } ctl_ua_type -ctl_build_ua(ctl_ua_type *ua_type, struct scsi_sense_data *sense, - scsi_sense_data_type sense_format) +ctl_build_ua(struct ctl_lun *lun, uint32_t initidx, + struct scsi_sense_data *sense, scsi_sense_data_type sense_format) { + ctl_ua_type *ua; ctl_ua_type ua_to_build, ua_to_clear; int asc, ascq; + uint32_t p, i; - if (*ua_type == CTL_UA_NONE) + mtx_assert(&lun->lun_lock, MA_OWNED); + p = initidx / CTL_MAX_INIT_PER_PORT; + if ((ua = lun->pending_ua[p]) == NULL) { + mtx_unlock(&lun->lun_lock); + ua = malloc(sizeof(ctl_ua_type) * CTL_MAX_INIT_PER_PORT, + M_CTL, M_WAITOK); + mtx_lock(&lun->lun_lock); + if (lun->pending_ua[p] == NULL) { + lun->pending_ua[p] = ua; + for (i = 0; i < CTL_MAX_INIT_PER_PORT; i++) + ua[i] = CTL_UA_POWERON; + } else { + free(ua, M_CTL); + ua = lun->pending_ua[p]; + } + } + i = initidx % CTL_MAX_INIT_PER_PORT; + if (ua[i] == CTL_UA_NONE) return (CTL_UA_NONE); - ua_to_build = (1 << (ffs(*ua_type) - 1)); + ua_to_build = (1 << (ffs(ua[i]) - 1)); ua_to_clear = ua_to_build; switch (ua_to_build) { @@ -482,7 +501,7 @@ ctl_build_ua(ctl_ua_type *ua_type, struc SSD_ELEM_NONE); /* We're reporting this UA, so clear it */ - *ua_type &= ~ua_to_clear; + ua[i] &= ~ua_to_clear; return (ua_to_build); } Modified: stable/10/sys/cam/ctl/ctl_error.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.h Thu Dec 18 08:31:13 2014 (r275887) +++ stable/10/sys/cam/ctl/ctl_error.h Thu Dec 18 08:32:06 2014 (r275888) @@ -42,6 +42,8 @@ #ifndef _CTL_ERROR_H_ #define _CTL_ERROR_H_ +struct ctl_lun; + void ctl_set_sense_data_va(struct scsi_sense_data *sense_data, void *lun, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq, va_list ap); @@ -55,8 +57,8 @@ void ctl_sense_to_desc(struct scsi_sense void ctl_sense_to_fixed(struct scsi_sense_data_desc *sense_src, struct scsi_sense_data_fixed *sense_dest); void ctl_set_ua(struct ctl_scsiio *ctsio, int asc, int ascq); -ctl_ua_type ctl_build_ua(ctl_ua_type *ua_type, struct scsi_sense_data *sense, - scsi_sense_data_type sense_format); +ctl_ua_type ctl_build_ua(struct ctl_lun *lun, uint32_t initidx, + struct scsi_sense_data *sense, scsi_sense_data_type sense_format); void ctl_set_overlapped_cmd(struct ctl_scsiio *ctsio); void ctl_set_overlapped_tag(struct ctl_scsiio *ctsio, uint8_t tag); void ctl_set_invalid_field(struct ctl_scsiio *ctsio, int sks_valid, int command, Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:31:13 2014 (r275887) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:32:06 2014 (r275888) @@ -403,7 +403,7 @@ struct ctl_lun { uint32_t have_ca[CTL_MAX_INITIATORS >> 5]; struct scsi_sense_data pending_sense[CTL_MAX_INITIATORS]; #endif - ctl_ua_type pending_ua[CTL_MAX_INITIATORS]; + ctl_ua_type *pending_ua[CTL_MAX_PORTS]; time_t lasttpt; struct ctl_mode_pages mode_pages; struct ctl_log_pages log_pages; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:32:57 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEA71A5D; Thu, 18 Dec 2014 08:32: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 AA01218E0; Thu, 18 Dec 2014 08:32: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 sBI8WvVT024924; Thu, 18 Dec 2014 08:32:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8Wv6j024923; Thu, 18 Dec 2014 08:32:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180832.sBI8Wv6j024923@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275889 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:32:58 -0000 Author: mav Date: Thu Dec 18 08:32:56 2014 New Revision: 275889 URL: https://svnweb.freebsd.org/changeset/base/275889 Log: MFC r275459: Unify function names after r275458. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:32:06 2014 (r275888) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:32:56 2014 (r275889) @@ -7908,7 +7908,7 @@ retry: } static void -ctl_set_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) +ctl_est_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) { int off = lun->ctl_softc->persis_offset; @@ -7970,7 +7970,7 @@ ctl_pro_preempt(struct ctl_softc *softc, continue; ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; lun->res_type = type; @@ -8041,7 +8041,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { mtx_unlock(&lun->lun_lock); @@ -8116,11 +8116,11 @@ ctl_pro_preempt(struct ctl_softc *softc, if (sa_res_key == ctl_get_prkey(lun, i)) { ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type ==SPR_TYPE_EX_AC_RO)){ - ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); + ctl_est_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = type; @@ -8159,7 +8159,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { @@ -8215,7 +8215,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu continue; ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; @@ -8230,7 +8230,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } } } else { @@ -8242,11 +8242,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (sa_res_key == ctl_get_prkey(lun, i)) { ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (msg->pr.pr_info.res_type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type == SPR_TYPE_EX_AC_RO)) { - ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); + ctl_est_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = msg->pr.pr_info.res_type; @@ -8632,7 +8632,7 @@ ctl_persistent_reserve_out(struct ctl_sc for (i=0; i < 2*CTL_MAX_INITIATORS; i++) if (ctl_get_prkey(lun, i) != 0) { ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; mtx_unlock(&lun->lun_lock); @@ -8774,7 +8774,7 @@ ctl_hndl_per_res_out_on_other_sc(union c if (ctl_get_prkey(lun, i) == 0) continue; ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; break; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:36:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9654EBC7; Thu, 18 Dec 2014 08:36: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 7A0041917; Thu, 18 Dec 2014 08:36: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 sBI8aLDZ025439; Thu, 18 Dec 2014 08:36:21 GMT (envelope-from erwin@FreeBSD.org) Received: (from erwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8aLHe025437; Thu, 18 Dec 2014 08:36:21 GMT (envelope-from erwin@FreeBSD.org) Message-Id: <201412180836.sBI8aLHe025437@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: erwin set sender to erwin@FreeBSD.org using -f From: Erwin Lansing Date: Thu, 18 Dec 2014 08:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275890 - in stable/9: contrib/bind9 contrib/bind9/bin/check contrib/bind9/bin/confgen contrib/bind9/bin/dig contrib/bind9/bin/dig/include/dig contrib/bind9/bin/dnssec contrib/bind9/bin... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:36:21 -0000 Author: erwin Date: Thu Dec 18 08:36:19 2014 New Revision: 275890 URL: https://svnweb.freebsd.org/changeset/base/275890 Log: Update BIND to 9.9.6-P1 Most notable changes in 9.9.6 and includes the latest SA: https://lists.isc.org/pipermail/bind-announce/2014-September/000928.html Note this is a direct commit to stable/9 as BIND is no longer in head. Sponsored by: DK Hostmaster A/S Added: stable/9/contrib/bind9/lib/dns/rdata/generic/caa_257.c - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/caa_257.c stable/9/contrib/bind9/lib/dns/rdata/generic/caa_257.h - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/caa_257.h stable/9/contrib/bind9/lib/dns/rdata/generic/cdnskey_60.c - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/cdnskey_60.c stable/9/contrib/bind9/lib/dns/rdata/generic/cdnskey_60.h - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/cdnskey_60.h stable/9/contrib/bind9/lib/dns/rdata/generic/cds_59.c - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/cds_59.c stable/9/contrib/bind9/lib/dns/rdata/generic/cds_59.h - copied unchanged from r275801, vendor/bind9/dist/lib/dns/rdata/generic/cds_59.h stable/9/contrib/bind9/lib/isc/counter.c - copied unchanged from r275801, vendor/bind9/dist/lib/isc/counter.c stable/9/contrib/bind9/lib/isc/include/isc/counter.h - copied unchanged from r275801, vendor/bind9/dist/lib/isc/include/isc/counter.h stable/9/contrib/bind9/lib/lwres/compat.c - copied unchanged from r275801, vendor/bind9/dist/lib/lwres/compat.c stable/9/contrib/bind9/lib/lwres/include/lwres/string.h - copied unchanged from r275801, vendor/bind9/dist/lib/lwres/include/lwres/string.h Deleted: stable/9/contrib/bind9/lib/lwres/strtoul.c Modified: stable/9/contrib/bind9/CHANGES stable/9/contrib/bind9/FAQ stable/9/contrib/bind9/FAQ.xml stable/9/contrib/bind9/README stable/9/contrib/bind9/acconfig.h stable/9/contrib/bind9/aclocal.m4 stable/9/contrib/bind9/bin/check/Makefile.in stable/9/contrib/bind9/bin/check/named-checkconf.8 stable/9/contrib/bind9/bin/check/named-checkconf.c stable/9/contrib/bind9/bin/check/named-checkconf.docbook stable/9/contrib/bind9/bin/check/named-checkconf.html stable/9/contrib/bind9/bin/check/named-checkzone.8 stable/9/contrib/bind9/bin/check/named-checkzone.docbook stable/9/contrib/bind9/bin/check/named-checkzone.html stable/9/contrib/bind9/bin/confgen/ddns-confgen.8 stable/9/contrib/bind9/bin/confgen/ddns-confgen.c stable/9/contrib/bind9/bin/confgen/ddns-confgen.docbook stable/9/contrib/bind9/bin/confgen/ddns-confgen.html stable/9/contrib/bind9/bin/confgen/rndc-confgen.8 stable/9/contrib/bind9/bin/confgen/rndc-confgen.docbook stable/9/contrib/bind9/bin/confgen/rndc-confgen.html stable/9/contrib/bind9/bin/dig/dig.1 stable/9/contrib/bind9/bin/dig/dig.c stable/9/contrib/bind9/bin/dig/dig.docbook stable/9/contrib/bind9/bin/dig/dig.html stable/9/contrib/bind9/bin/dig/dighost.c stable/9/contrib/bind9/bin/dig/host.1 stable/9/contrib/bind9/bin/dig/host.c stable/9/contrib/bind9/bin/dig/host.docbook stable/9/contrib/bind9/bin/dig/host.html stable/9/contrib/bind9/bin/dig/include/dig/dig.h stable/9/contrib/bind9/bin/dig/nslookup.1 stable/9/contrib/bind9/bin/dig/nslookup.c stable/9/contrib/bind9/bin/dig/nslookup.docbook stable/9/contrib/bind9/bin/dig/nslookup.html stable/9/contrib/bind9/bin/dnssec/Makefile.in stable/9/contrib/bind9/bin/dnssec/dnssec-dsfromkey.8 stable/9/contrib/bind9/bin/dnssec/dnssec-dsfromkey.c stable/9/contrib/bind9/bin/dnssec/dnssec-dsfromkey.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-dsfromkey.html stable/9/contrib/bind9/bin/dnssec/dnssec-importkey.8 stable/9/contrib/bind9/bin/dnssec/dnssec-importkey.c stable/9/contrib/bind9/bin/dnssec/dnssec-importkey.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-importkey.html stable/9/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.8 stable/9/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c stable/9/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.html stable/9/contrib/bind9/bin/dnssec/dnssec-keygen.8 stable/9/contrib/bind9/bin/dnssec/dnssec-keygen.c stable/9/contrib/bind9/bin/dnssec/dnssec-keygen.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-keygen.html stable/9/contrib/bind9/bin/dnssec/dnssec-revoke.8 stable/9/contrib/bind9/bin/dnssec/dnssec-revoke.c stable/9/contrib/bind9/bin/dnssec/dnssec-revoke.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-revoke.html stable/9/contrib/bind9/bin/dnssec/dnssec-settime.8 stable/9/contrib/bind9/bin/dnssec/dnssec-settime.c stable/9/contrib/bind9/bin/dnssec/dnssec-settime.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-settime.html stable/9/contrib/bind9/bin/dnssec/dnssec-signzone.8 stable/9/contrib/bind9/bin/dnssec/dnssec-signzone.c stable/9/contrib/bind9/bin/dnssec/dnssec-signzone.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-signzone.html stable/9/contrib/bind9/bin/dnssec/dnssec-verify.8 stable/9/contrib/bind9/bin/dnssec/dnssec-verify.c stable/9/contrib/bind9/bin/dnssec/dnssec-verify.docbook stable/9/contrib/bind9/bin/dnssec/dnssec-verify.html stable/9/contrib/bind9/bin/dnssec/dnssectool.c stable/9/contrib/bind9/bin/dnssec/dnssectool.h stable/9/contrib/bind9/bin/named/bind9.ver3.xsl stable/9/contrib/bind9/bin/named/bind9.ver3.xsl.h stable/9/contrib/bind9/bin/named/client.c stable/9/contrib/bind9/bin/named/config.c stable/9/contrib/bind9/bin/named/control.c stable/9/contrib/bind9/bin/named/controlconf.c stable/9/contrib/bind9/bin/named/include/named/query.h stable/9/contrib/bind9/bin/named/include/named/server.h stable/9/contrib/bind9/bin/named/lwresd.8 stable/9/contrib/bind9/bin/named/lwresd.docbook stable/9/contrib/bind9/bin/named/lwresd.html stable/9/contrib/bind9/bin/named/main.c stable/9/contrib/bind9/bin/named/named.8 stable/9/contrib/bind9/bin/named/named.conf.5 stable/9/contrib/bind9/bin/named/named.conf.docbook stable/9/contrib/bind9/bin/named/named.conf.html stable/9/contrib/bind9/bin/named/named.docbook stable/9/contrib/bind9/bin/named/named.html stable/9/contrib/bind9/bin/named/query.c stable/9/contrib/bind9/bin/named/server.c stable/9/contrib/bind9/bin/named/unix/dlz_dlopen_driver.c stable/9/contrib/bind9/bin/named/unix/os.c stable/9/contrib/bind9/bin/named/update.c stable/9/contrib/bind9/bin/named/zoneconf.c stable/9/contrib/bind9/bin/nsupdate/Makefile.in stable/9/contrib/bind9/bin/nsupdate/nsupdate.1 stable/9/contrib/bind9/bin/nsupdate/nsupdate.c stable/9/contrib/bind9/bin/nsupdate/nsupdate.docbook stable/9/contrib/bind9/bin/nsupdate/nsupdate.html stable/9/contrib/bind9/bin/rndc/rndc.8 stable/9/contrib/bind9/bin/rndc/rndc.c stable/9/contrib/bind9/bin/rndc/rndc.conf.5 stable/9/contrib/bind9/bin/rndc/rndc.conf.docbook stable/9/contrib/bind9/bin/rndc/rndc.conf.html stable/9/contrib/bind9/bin/rndc/rndc.docbook stable/9/contrib/bind9/bin/rndc/rndc.html stable/9/contrib/bind9/bin/tools/arpaname.1 stable/9/contrib/bind9/bin/tools/arpaname.docbook stable/9/contrib/bind9/bin/tools/arpaname.html stable/9/contrib/bind9/bin/tools/genrandom.8 stable/9/contrib/bind9/bin/tools/genrandom.c stable/9/contrib/bind9/bin/tools/genrandom.docbook stable/9/contrib/bind9/bin/tools/genrandom.html stable/9/contrib/bind9/bin/tools/isc-hmac-fixup.8 stable/9/contrib/bind9/bin/tools/isc-hmac-fixup.c stable/9/contrib/bind9/bin/tools/isc-hmac-fixup.docbook stable/9/contrib/bind9/bin/tools/isc-hmac-fixup.html stable/9/contrib/bind9/bin/tools/named-journalprint.8 stable/9/contrib/bind9/bin/tools/named-journalprint.docbook stable/9/contrib/bind9/bin/tools/named-journalprint.html stable/9/contrib/bind9/bin/tools/nsec3hash.8 stable/9/contrib/bind9/bin/tools/nsec3hash.c stable/9/contrib/bind9/bin/tools/nsec3hash.docbook stable/9/contrib/bind9/bin/tools/nsec3hash.html stable/9/contrib/bind9/config.h.in stable/9/contrib/bind9/configure.in stable/9/contrib/bind9/doc/arm/Bv9ARM-book.xml stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html stable/9/contrib/bind9/doc/arm/Bv9ARM.html stable/9/contrib/bind9/doc/arm/Bv9ARM.pdf stable/9/contrib/bind9/doc/arm/Makefile.in stable/9/contrib/bind9/doc/arm/libdns.xml stable/9/contrib/bind9/doc/arm/man.arpaname.html stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html stable/9/contrib/bind9/doc/arm/man.dig.html stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html stable/9/contrib/bind9/doc/arm/man.dnssec-keygen.html stable/9/contrib/bind9/doc/arm/man.dnssec-revoke.html stable/9/contrib/bind9/doc/arm/man.dnssec-settime.html stable/9/contrib/bind9/doc/arm/man.dnssec-signzone.html stable/9/contrib/bind9/doc/arm/man.dnssec-verify.html stable/9/contrib/bind9/doc/arm/man.genrandom.html stable/9/contrib/bind9/doc/arm/man.host.html stable/9/contrib/bind9/doc/arm/man.isc-hmac-fixup.html stable/9/contrib/bind9/doc/arm/man.named-checkconf.html stable/9/contrib/bind9/doc/arm/man.named-checkzone.html stable/9/contrib/bind9/doc/arm/man.named-journalprint.html stable/9/contrib/bind9/doc/arm/man.named.html stable/9/contrib/bind9/doc/arm/man.nsec3hash.html stable/9/contrib/bind9/doc/arm/man.nsupdate.html stable/9/contrib/bind9/doc/arm/man.rndc-confgen.html stable/9/contrib/bind9/doc/arm/man.rndc.conf.html stable/9/contrib/bind9/doc/arm/man.rndc.html stable/9/contrib/bind9/doc/arm/pkcs11.xml stable/9/contrib/bind9/doc/misc/options stable/9/contrib/bind9/lib/bind9/Makefile.in stable/9/contrib/bind9/lib/bind9/api stable/9/contrib/bind9/lib/bind9/check.c stable/9/contrib/bind9/lib/bind9/getaddresses.c stable/9/contrib/bind9/lib/dns/Makefile.in stable/9/contrib/bind9/lib/dns/acl.c stable/9/contrib/bind9/lib/dns/adb.c stable/9/contrib/bind9/lib/dns/api stable/9/contrib/bind9/lib/dns/dispatch.c stable/9/contrib/bind9/lib/dns/dns64.c stable/9/contrib/bind9/lib/dns/dnssec.c stable/9/contrib/bind9/lib/dns/ecdb.c stable/9/contrib/bind9/lib/dns/gen.c stable/9/contrib/bind9/lib/dns/gssapictx.c stable/9/contrib/bind9/lib/dns/include/dns/Makefile.in stable/9/contrib/bind9/lib/dns/include/dns/adb.h stable/9/contrib/bind9/lib/dns/include/dns/dns64.h stable/9/contrib/bind9/lib/dns/include/dns/dnssec.h stable/9/contrib/bind9/lib/dns/include/dns/message.h stable/9/contrib/bind9/lib/dns/include/dns/rbt.h stable/9/contrib/bind9/lib/dns/include/dns/rdataset.h stable/9/contrib/bind9/lib/dns/include/dns/resolver.h stable/9/contrib/bind9/lib/dns/include/dns/view.h stable/9/contrib/bind9/lib/dns/keytable.c stable/9/contrib/bind9/lib/dns/master.c stable/9/contrib/bind9/lib/dns/message.c stable/9/contrib/bind9/lib/dns/name.c stable/9/contrib/bind9/lib/dns/nsec.c stable/9/contrib/bind9/lib/dns/nsec3.c stable/9/contrib/bind9/lib/dns/openssl_link.c stable/9/contrib/bind9/lib/dns/peer.c stable/9/contrib/bind9/lib/dns/rbt.c stable/9/contrib/bind9/lib/dns/rbtdb.c stable/9/contrib/bind9/lib/dns/rcode.c stable/9/contrib/bind9/lib/dns/rdata.c stable/9/contrib/bind9/lib/dns/rdata/generic/gpos_27.c stable/9/contrib/bind9/lib/dns/rdata/generic/hinfo_13.c stable/9/contrib/bind9/lib/dns/rdata/generic/hip_55.c stable/9/contrib/bind9/lib/dns/rdata/generic/isdn_20.c stable/9/contrib/bind9/lib/dns/rdata/generic/naptr_35.c stable/9/contrib/bind9/lib/dns/rdata/generic/nsec3_50.c stable/9/contrib/bind9/lib/dns/rdata/generic/opt_41.c stable/9/contrib/bind9/lib/dns/rdata/generic/spf_99.c stable/9/contrib/bind9/lib/dns/rdata/generic/tkey_249.c stable/9/contrib/bind9/lib/dns/rdata/generic/tlsa_52.c stable/9/contrib/bind9/lib/dns/rdata/generic/tlsa_52.h stable/9/contrib/bind9/lib/dns/rdata/generic/txt_16.c stable/9/contrib/bind9/lib/dns/rdata/generic/uri_256.c stable/9/contrib/bind9/lib/dns/rdata/generic/x25_19.c stable/9/contrib/bind9/lib/dns/rdataslab.c stable/9/contrib/bind9/lib/dns/resolver.c stable/9/contrib/bind9/lib/dns/rootns.c stable/9/contrib/bind9/lib/dns/rpz.c stable/9/contrib/bind9/lib/dns/rrl.c stable/9/contrib/bind9/lib/dns/time.c stable/9/contrib/bind9/lib/dns/tsig.c stable/9/contrib/bind9/lib/dns/validator.c stable/9/contrib/bind9/lib/dns/view.c stable/9/contrib/bind9/lib/dns/zone.c stable/9/contrib/bind9/lib/export/isc/Makefile.in stable/9/contrib/bind9/lib/export/samples/sample-update.c stable/9/contrib/bind9/lib/irs/Makefile.in stable/9/contrib/bind9/lib/irs/api stable/9/contrib/bind9/lib/irs/context.c stable/9/contrib/bind9/lib/irs/getaddrinfo.c stable/9/contrib/bind9/lib/irs/include/irs/Makefile.in stable/9/contrib/bind9/lib/isc/Makefile.in stable/9/contrib/bind9/lib/isc/api stable/9/contrib/bind9/lib/isc/backtrace.c stable/9/contrib/bind9/lib/isc/base32.c stable/9/contrib/bind9/lib/isc/event.c stable/9/contrib/bind9/lib/isc/hash.c stable/9/contrib/bind9/lib/isc/include/isc/Makefile.in stable/9/contrib/bind9/lib/isc/include/isc/base32.h stable/9/contrib/bind9/lib/isc/include/isc/buffer.h stable/9/contrib/bind9/lib/isc/include/isc/event.h stable/9/contrib/bind9/lib/isc/include/isc/file.h stable/9/contrib/bind9/lib/isc/include/isc/iterated_hash.h stable/9/contrib/bind9/lib/isc/include/isc/print.h stable/9/contrib/bind9/lib/isc/include/isc/result.h stable/9/contrib/bind9/lib/isc/include/isc/socket.h stable/9/contrib/bind9/lib/isc/include/isc/task.h stable/9/contrib/bind9/lib/isc/include/isc/timer.h stable/9/contrib/bind9/lib/isc/include/isc/types.h stable/9/contrib/bind9/lib/isc/lib.c stable/9/contrib/bind9/lib/isc/log.c stable/9/contrib/bind9/lib/isc/mem.c stable/9/contrib/bind9/lib/isc/netaddr.c stable/9/contrib/bind9/lib/isc/print.c stable/9/contrib/bind9/lib/isc/radix.c stable/9/contrib/bind9/lib/isc/random.c stable/9/contrib/bind9/lib/isc/regex.c stable/9/contrib/bind9/lib/isc/result.c stable/9/contrib/bind9/lib/isc/socket_api.c stable/9/contrib/bind9/lib/isc/task.c stable/9/contrib/bind9/lib/isc/task_api.c stable/9/contrib/bind9/lib/isc/timer.c stable/9/contrib/bind9/lib/isc/timer_api.c stable/9/contrib/bind9/lib/isc/tm.c stable/9/contrib/bind9/lib/isc/unix/app.c stable/9/contrib/bind9/lib/isc/unix/include/isc/Makefile.in stable/9/contrib/bind9/lib/isc/unix/include/isc/net.h stable/9/contrib/bind9/lib/isc/unix/include/isc/stat.h stable/9/contrib/bind9/lib/isc/unix/socket.c stable/9/contrib/bind9/lib/isccc/Makefile.in stable/9/contrib/bind9/lib/isccfg/Makefile.in stable/9/contrib/bind9/lib/isccfg/aclconf.c stable/9/contrib/bind9/lib/isccfg/api stable/9/contrib/bind9/lib/isccfg/include/isccfg/Makefile.in stable/9/contrib/bind9/lib/isccfg/include/isccfg/aclconf.h stable/9/contrib/bind9/lib/isccfg/namedconf.c stable/9/contrib/bind9/lib/isccfg/parser.c stable/9/contrib/bind9/lib/lwres/Makefile.in stable/9/contrib/bind9/lib/lwres/api stable/9/contrib/bind9/lib/lwres/gai_strerror.c stable/9/contrib/bind9/lib/lwres/getaddrinfo.c stable/9/contrib/bind9/lib/lwres/gethost.c stable/9/contrib/bind9/lib/lwres/include/lwres/Makefile.in stable/9/contrib/bind9/lib/lwres/include/lwres/lwres.h stable/9/contrib/bind9/lib/lwres/include/lwres/netdb.h.in stable/9/contrib/bind9/lib/lwres/include/lwres/platform.h.in stable/9/contrib/bind9/lib/lwres/include/lwres/stdlib.h stable/9/contrib/bind9/lib/lwres/lwconfig.c stable/9/contrib/bind9/lib/lwres/man/lwres.3 stable/9/contrib/bind9/lib/lwres/man/lwres.docbook stable/9/contrib/bind9/lib/lwres/man/lwres.html stable/9/contrib/bind9/lib/lwres/man/lwres_buffer.3 stable/9/contrib/bind9/lib/lwres/man/lwres_buffer.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_buffer.html stable/9/contrib/bind9/lib/lwres/man/lwres_config.3 stable/9/contrib/bind9/lib/lwres/man/lwres_config.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_config.html stable/9/contrib/bind9/lib/lwres/man/lwres_context.3 stable/9/contrib/bind9/lib/lwres/man/lwres_context.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_context.html stable/9/contrib/bind9/lib/lwres/man/lwres_gabn.3 stable/9/contrib/bind9/lib/lwres/man/lwres_gabn.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_gabn.html stable/9/contrib/bind9/lib/lwres/man/lwres_gai_strerror.3 stable/9/contrib/bind9/lib/lwres/man/lwres_gai_strerror.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_gai_strerror.html stable/9/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.3 stable/9/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.html stable/9/contrib/bind9/lib/lwres/man/lwres_gethostent.3 stable/9/contrib/bind9/lib/lwres/man/lwres_gethostent.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_gethostent.html stable/9/contrib/bind9/lib/lwres/man/lwres_getipnode.3 stable/9/contrib/bind9/lib/lwres/man/lwres_getipnode.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_getipnode.html stable/9/contrib/bind9/lib/lwres/man/lwres_getnameinfo.3 stable/9/contrib/bind9/lib/lwres/man/lwres_getnameinfo.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_getnameinfo.html stable/9/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3 stable/9/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.html stable/9/contrib/bind9/lib/lwres/man/lwres_gnba.3 stable/9/contrib/bind9/lib/lwres/man/lwres_gnba.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_gnba.html stable/9/contrib/bind9/lib/lwres/man/lwres_hstrerror.3 stable/9/contrib/bind9/lib/lwres/man/lwres_hstrerror.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_hstrerror.html stable/9/contrib/bind9/lib/lwres/man/lwres_inetntop.3 stable/9/contrib/bind9/lib/lwres/man/lwres_inetntop.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_inetntop.html stable/9/contrib/bind9/lib/lwres/man/lwres_noop.3 stable/9/contrib/bind9/lib/lwres/man/lwres_noop.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_noop.html stable/9/contrib/bind9/lib/lwres/man/lwres_packet.3 stable/9/contrib/bind9/lib/lwres/man/lwres_packet.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_packet.html stable/9/contrib/bind9/lib/lwres/man/lwres_resutil.3 stable/9/contrib/bind9/lib/lwres/man/lwres_resutil.docbook stable/9/contrib/bind9/lib/lwres/man/lwres_resutil.html stable/9/contrib/bind9/lib/lwres/print.c stable/9/contrib/bind9/make/rules.in stable/9/contrib/bind9/version stable/9/lib/bind/config.h stable/9/lib/bind/dns/code.h stable/9/lib/bind/dns/dns/enumtype.h stable/9/lib/bind/dns/dns/rdatastruct.h stable/9/lib/bind/isc/Makefile stable/9/lib/bind/isc/isc/platform.h stable/9/lib/bind/lwres/Makefile stable/9/lib/bind/lwres/lwres/netdb.h stable/9/lib/bind/lwres/lwres/platform.h Directory Properties: stable/9/contrib/bind9/ (props changed) Modified: stable/9/contrib/bind9/CHANGES ============================================================================== --- stable/9/contrib/bind9/CHANGES Thu Dec 18 08:32:56 2014 (r275889) +++ stable/9/contrib/bind9/CHANGES Thu Dec 18 08:36:19 2014 (r275890) @@ -1,3 +1,5 @@ + --- 9.9.6-P1 released --- + 4006. [security] A flaw in delegation handling could be exploited to put named into an infinite loop. This has been addressed by placing limits on the number @@ -7,7 +9,430 @@ query (CVE-2014-8500). The recursion depth limit is configured via the - "max-recursion-depth" option. [RT #35780] + "max-recursion-depth" option, and the query limit + via the "max-recursion-queries" option. [RT #37580] + + --- 9.9.6 released --- + +3950. [port] Changed the bin/python Makefile to work around a + bmake bug in FreeBSD 10 and NetBSD 6. [RT #36993] + + --- 9.9.6rc2 released --- + +3947. [cleanup] Set the executable bit on libraries when using + libtool. [RT #36786] + +3946. [cleanup] Improved "configure" search for a python interpreter. + [RT #36992] + +3945. [bug] Invalid wildcard expansions could be incorrectly + accepted by the validator. [RT #37093] + +3944. [test] Added a regression test for "server-id". [RT #37057] + +3942. [bug] Wildcard responses from a optout range should be + marked as insecure. [RT #37072] + +3941. [doc] Include the BIND version number in the ARM. [RT #37067] + + --- 9.9.6rc1 released --- + +3933. [bug] Corrected the implementation of dns_rdata_casecompare() + for the HIP rdata type. [RT #36911] + +3932. [test] Improved named-checkconf tests. [RT #36911] + +3931. [cleanup] Cleanup how dlz grammar is defined. [RT #36879] + +3929. [bug] 'host -a' needed to clear idnoptions. [RT #36963] + +3928. [test] Improve rndc system test. [RT #36898] + +3925. [bug] DS lookup of RFC 1918 empty zones failed. [RT #36917] + +3924. [bug] Improve 'rndc addzone' error reporting. [RT #35187] + +3923. [bug] Sanity check the xml2-config output. [RT #22246] + +3922. [bug] When resigning, dnssec-signzone was removing + all signatures from delegation nodes. It now + retains DS and (if applicable) NSEC signatures. + [RT #36946] + +3921. [bug] AD was inappropriately set on RPZ responses. [RT #36833] + +3919. [bug] dig: continue to next line if a address lookup fails + in batch mode. [RT #36755] + +3918. [doc] Update check-spf documentation. [RT #36910] + +3917. [bug] dig, nslookup and host now continue on names that are + too long after applying a search list elements. + [RT #36892] + +3916. [contrib] zone2sqlite checked wrong result code. Address + compiler warnings. [RT #36931] + + --- 9.9.6b2 released --- + +3914. [bug] Allow the URI target and CAA value fields to + be zero length. [RT #36737] + +3913. [bug] Address race issue in dispatch. [RT #36731] + +3910. [bug] Fix races to free event during shutdown. [RT #36720] + +3909. [bug] When computing the number of elements required for a + acl count_acl_elements could have a short count leading + to a assertion failure. Also zero out new acl elements + in dns_acl_merge. [RT #36675] + +3908. [bug] rndc now differentiates between a zone in multiple + views and a zone that doesn't exist at all. [RT #36691] + +3907. [cleanup] Alphabetize rndc help. [RT #36683] + +3906. [protocol] Update URI record format to comply with + draft-faltstrom-uri-08. [RT #36642] + +3905. [bug] Address deadlock between view.c and adb.c. [RT #36341] + +3904. [func] Add the RPZ SOA to the additional section. [RT36507] + +3903. [bug] Improve the accuracy of DiG's reported round trip + time. [RT 36611] + +3902. [bug] liblwres wasn't handling link-local addresses in + nameserver clauses in resolv.conf. [RT #36039] + +3901. [protocol] Added support for CAA record type (RFC 6844). + [RT #36625] + +3900. [bug] Fix a crash in PostgreSQL DLZ driver. [RT #36637] + +3899. [bug] "request-ixfr" is only applicable to slave and redirect + zones. [RT #36608] + +3898. [bug] Too small a buffer in tohexstr() calls in test code. + [RT #36598] + +3894. [bug] Buffers in isc_print_vsnprintf were not properly + initialized leading to potential overflows when + printing out quad values. [RT #36505] + +3892. [bug] Setting '-t aaaa' in .digrc had unintended side + effects. [RT #36452] + +3891. [bug] Use ${INSTALL_SCRIPT} rather than ${INSTALL_PROGRAM} + to install python programs. + +3890. [bug] RRSIG sets that were not loaded in a single transaction + at start up where not being correctly added to + re-signing heaps. [RT #36302] + +3889. [port] hurd: configure fixes as per: + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746540 + +3887. [cleanup] Make all static symbols in rbtdb64 end in "64" so + they are easier to use in a debugger. [RT #36373] + + --- 9.9.6b1 released --- + +3885. [port] Use 'open()' rather than 'file()' to open files in + python. + +3884. [protocol] Add CDS and CDNSKEY record types. [RT #36333] + +3881. [bug] Address memory leak with UPDATE error handling. + [RT #36303] + +3880. [test] Update ans.pl to work with new TSIG support in + Net::DNS; add additional Net::DNS version prerequisite + checks. [RT #36327] + +3879. [func] Add version printing option to various BIND utilities. + [RT #10686] + +3878. [bug] Using the incorrect filename for a DLZ module + caused a segmentation fault on startup. [RT #36286] + +3874. [test] Check that only "check-names master" is needed for + updates to be accepted. + +3873. [protocol] Only warn for SPF without TXT spf record. [RT #36210] + +3872. [bug] Address issues found by static analysis. [RT #36209] + +3871. [bug] Don't publish an activated key automatically before + its publish time. [RT #35063] + +3870. [placeholder] + +3869. [placeholder] + +3868. [bug] isc_mem_setwater incorrectly cleared hi_called + potentially leaving over memory cleaner running. + [RT #35270] + +3866. [bug] Named could die on disk full in generate_session_key. + [RT #36119] + +3864. [bug] RPZ didn't work well when being used as forwarder. + [RT #36060] + +3862. [cleanup] Return immediately if we are not going to log the + message in ns_client_dumpmessage. + +3861. [bug] Benign missing isc_buffer_availablelength check in + dns_message_pseudosectiontotext. [RT #36078] + +3860. [bug] ioctl(DP_POLL) array size needs to be determined + at run time as it is limited to {OPEN_MAX}. + [RT #35878] + +3858. [bug] Disable GCC 4.9 "delete null pointer check". + [RT #35968] + +3857. [bug] Make it harder for a incorrect NOEDNS classification + to be made. [RT #36020] + +3855. [bug] Limit smoothed round trip time aging to no more than + once a second. [RT #32909] + +3854. [cleanup] Report unrecognized options, if any, in the final + configure summary. [RT #36014] + +3853. [cleanup] Refactor dns_rdataslab_fromrdataset to separate out + the handling of a rdataset with no records. [RT #35968] + +3849. [doc] Alphabetized dig's +options. [RT #35992] + +3847. [bug] 'configure --with-dlz-postgres' failed to fail when + there is not support available. + +3846. [bug] "dig +notcp ixfr=" should result in a UDP + ixfr query. [RT #35980] + +3844. [bug] Use the x64 version of the Microsoft Visual C++ + Redistributable when built for 64 bit Windows. + [RT #35973] + +3843. [protocol] Check EDNS EXPIRE option in dns_rdata_fromwire. + [RT #35969] + +3842. [bug] Adjust RRL log-only logging category. [RT #35945] + +3841. [cleanup] Refactor zone.c:add_opt to use dns_message_buildopt. + [RT #35924] + +3840. [port] Check for arc4random_addrandom() before using it; + it's been removed from OpenBSD 5.5. [RT #35907] + +3839. [test] Use only posix-compatible shell in system tests. + [RT #35625] + +3838. [protocol] EDNS EXPIRE as been assigned a code point of 9. + +3836. [bug] Address C++ keyword usage in header file. + +3834. [bug] The re-signing heaps were not being updated soon enough + leading to multiple re-generations of the same RRSIG + when a zone transfer was in progress. [RT #35273] + +3833. [bug] Cross compiling was broken due to calling genrandom at + build time. [RT #35869] + +3827. [contrib] The example DLZ driver (a version of which is + also used in the dlzexternal system test) could + use absolute names as relative. [RT #35802] + +3826. [bug] Corrected bad INSIST logic in isc_radix_remove(). + [RT #35870] + +3825. [bug] Address sign extension bug in isc_regex_validate. + [RT #35758] + +3824. [bug] A collision between two flag values could cause + problems with cache cleaning. [RT #35858] + +3822. [bug] Log the correct type of static-stub zones when + removing them. [RT #35842] + +3819. [bug] NSEC3 hashes need to be able to be entered and + displayed without padding. This is not a issue for + currently defined algorithms but may be for future + hash algorithms. [RT #27925] + +3818. [bug] Stop lying to the optimizer that 'void *arg' is a + constant in isc_event_allocate. + +3815. [doc] Clarify "nsupdate -y" usage in man page. [RT #35808] + +3809. [doc] Fix NSID documentation. + +3807. [bug] Fix sign extension bug in dns_name_fromtext when + lowercase is set. [RT #35743] + +3806. [test] Improved system test portability. [RT #35625] + +3805. [contrib] Added contrib/perftcpdns, a performance testing tool + for DNS over TCP. [RT #35710] + +3804. [bug] Corrected a race condition in dispatch.c in which + portentry could be reset leading to an assertion + failure in socket_search(). (Change #3708 + addressed the same issue but was incomplete.) + [RT #35128] + +3803. [bug] "named-checkconf -z" incorrectly rejected zones + using alternate data sources for not having a "file" + option. [RT #35685] + +3802. [bug] Various header files were not being installed. + +3801. [port] Fix probing for gssapi support on FreeBSD. [RT #35615] + +3799. [bug] Improve named's command line error reporting. + [RT #35603] + +3796. [bug] Register dns error codes. [RT #35629] + +3795. [bug] Make named-checkconf detect raw masterfiles for + hint zones and reject them. [RT #35268] + +3794. [maint] Added AAAA for C.ROOT-SERVERS.NET. + +3793. [bug] zone.c:save_nsec3param() could assert when out of + memory. [RT #35621] + +3792. [func] Provide links to the alternate statistics views when + displaying in a browser. [RT #35605] + +3791. [bug] solaris: remove extraneous return. [RT #35589] + +3787. [bug] The code that checks whether "auto-dnssec" is + allowed was ignoring "allow-update" ACLs set at + the options or view level. [RT #29536] + +3780. [bug] $GENERATE handled negative numbers incorrectly. + [RT #25528] + +3779. [cleanup] Clarify the error message when using an option + that was not enabled at compile time. [RT #35504] + +3778. [bug] Log a warning when the wrong address family is + used in "listen-on" or "listen-on-v6". [RT #17848] + +3775. [bug] dlz_dlopen driver could return the wrong error + code on API version mismatch, leading to a segfault. + [RT #35495] + +3773. [func] "host", "nslookup" and "nsupdate" now have + options to print the version number and exit. + [RT #26057] + +3770. [bug] "dig +trace" could fail with an assertion when it + needed to fall back to TCP due to a truncated + response. [RT #24660] + +3769. [doc] Improved documentation of "rndc signing -list". + [RT #30652] + +3768. [bug] "dnssec-checkds" was missing the SHA-384 digest + algorithm. [RT #34000] + +3767. [func] Log explicitly when using rndc.key to configure + command channel. [RT #35316] + +3765. [bug] Fixed a bug in "rndc secroots" that could crash + named when dumping an empty keynode. [RT #35469] + +3764. [bug] The dnssec-keygen/settime -S and -i options + (to set up a successor key and set the prepublication + interval) were missing from dnssec-keyfromlabel. + [RT #35394] + +3761. [bug] Address dangling reference bug in dns_keytable_add. + [RT #35471] + +3757. [port] Enable Python tools (dnssec-coverage, + dnssec-checkds) to run on Windows. [RT #34355] + +3756. [bug] GSSAPI Kerberos realm checking was broken in + check_config leading to spurious messages being + logged. [RT #35443] + +3754. [cleanup] win32: Installer now places files in the + Program Files area rather than system services. + [RT #35361] + +3753. [bug] allow-notify was ignoring keys. [RT #35425] + +3751. [tuning] The default setting for the -U option (setting + the number of UDP listeners per interface) has + been adjusted to improve performance. [RT #35417] + +3747. [bug] A race condition could lead to a core dump when + destroying a resolver fetch object. [RT #35385] + +3743. [bug] delegation-only flag wasn't working in forward zone + declarations despite being documented. This is + needed to support turning off forwarding and turning + on delegation only at the same name. [RT #35392] + +3742. [port] linux: libcap support: declare curval at start of + block. [RT #35387] + +3740. [contrib] Minor fixes to configure --with-dlz-bdb, + --with-dlz-postgres and --with-dlz-odbc. [RT #35340] + +3737. [bug] 'rndc retransfer' could trigger a assertion failure + with inline zones. [RT #35353] + +3736. [bug] nsupdate: When specifying a server by name, + fall back to alternate addresses if the first + address for that name is not reachable. [RT #25784] + +3734. [bug] Improve building with libtool. [RT #35314] + +3732. [contrib] Fixed a type mismatch causing the ODBC DLZ + driver to dump core on 64-bit systems. [RT #35324] + +3731. [func] Added a "no-case-compress" ACL, which causes + named to use case-insensitive compression + (disabling change #3645) for specified + clients. (This is useful when dealing + with broken client implementations that + use case-sensitive name comparisons, + rejecting responses that fail to match the + capitalization of the query that was sent.) + [RT #35300] + +3730. [cleanup] Added "never" as a synonym for "none" when + configuring key event dates in the dnssec tools. + [RT #35277] + +3729. [bug] dnssec-keygen could set the publication date + incorrectly when only the activation date was + specified on the command line. [RT #35278] + +3724. [bug] win32: Fixed a bug that prevented dig and + host from exiting properly after completing + a UDP query. [RT #35288] + +3720. [bug] Address compiler warnings. [RT #35261] + +3719. [bug] Address memory leak in in peer.c. [RT #35255] + +3718. [bug] A missing ISC_LINK_INIT in log.c. [RT #35260] + +3714. [test] System tests that need to test for cryptography + support before running can now use a common + "testcrypto.sh" script to do so. [RT #35213] + +3713. [bug] Save memory by not storing "also-notify" addresses + in zone objects that are configured not to send + notify requests. [RT #35195] --- 9.9.5 released --- @@ -174,7 +599,7 @@ 3660. [cleanup] Changed the name of "isc-config.sh" to "bind9-config". [RT #23825] -3659. [port] solaris: don't add explict dependancies/rules for +3659. [port] solaris: don't add explicit dependencies/rules for python programs as make won't use the implicit rules. [RT #34835] @@ -1026,7 +1451,7 @@ when queryperf is available. - the encoding of PASSTHRU action to "rpz-passthru". (The old encoding is still accepted.) - [RT #26172] + [RT #26172] 3329. [bug] Handle RRSIG signer-name case consistently: We @@ -1290,7 +1715,7 @@ timestamp. [RT #26883] 3238. [bug] keyrdata was not being reinitialized in - lib/dns/rbtdb.c:iszonesecure. [RT#26913] + lib/dns/rbtdb.c:iszonesecure. [RT #26913] 3237. [bug] dig -6 didn't work with +trace. [RT #26906] @@ -1542,7 +1967,7 @@ 3162. [test] start.pl: modified to allow for "named.args" in ns*/ subdirectory to override stock arguments to - named. Largely from RT#26044, but no separate ticket. + named. Largely from RT #26044, but no separate ticket. 3161. [bug] zone.c:del_sigs failed to always reset rdata leading assertion failures. [RT #25880] @@ -1798,7 +2223,7 @@ 3090. [func] Make --with-gssapi default [RT #23738] 3089. [func] dnssec-dsfromkey now supports reading keys from - standard input "dnssec-dsfromkey -f -". [RT# 20662] + standard input "dnssec-dsfromkey -f -". [RT #20662] 3088. [bug] Remove bin/tests/system/logfileconfig/ns1/named.conf and add setup.sh in order to resolve changing @@ -2324,13 +2749,13 @@ 2939. [func] Check that named successfully skips NSEC3 records that fail to match the NSEC3PARAM record currently - in use. [RT# 21868] + in use. [RT #21868] 2938. [bug] When generating signed responses, from a signed zone that uses NSEC3, named would use a uninitialized pointer if it needed to skip a NSEC3 record because it didn't match the selected NSEC3PARAM record for - zone. [RT# 21868] + zone. [RT #21868] 2937. [bug] Worked around an apparent race condition in over memory conditions. Without this fix a DNS cache DB or @@ -2409,7 +2834,7 @@ 2926. [placeholder] 2925. [bug] Named failed to accept uncachable negative responses - from insecure zones. [RT# 21555] + from insecure zones. [RT #21555] 2924. [func] 'rndc secroots' dump a combined summary of the current managed keys combined with trusted keys. @@ -2469,7 +2894,7 @@ 2904. [bug] When using DLV, sub-zones of the zones in the DLV, could be incorrectly marked as insecure instead of secure leading to negative proofs failing. This was - a unintended outcome from change 2890. [RT# 21392] + a unintended outcome from change 2890. [RT #21392] 2903. [bug] managed-keys-directory missing from namedconf.c. [RT #21370] @@ -2504,7 +2929,7 @@ 2892. [bug] Handle REVOKED keys better. [RT #20961] 2891. [maint] Update empty-zones list to match - draft-ietf-dnsop-default-local-zones-13. [RT# 21099] + draft-ietf-dnsop-default-local-zones-13. [RT #21099] 2890. [bug] Handle the introduction of new trusted-keys and DS, DLV RRsets better. [RT #21097] @@ -2915,7 +3340,7 @@ 2761. [cleanup] Enable internal symbol table for backtrace only for systems that are known to work. Currently, BSD - variants, Linux and Solaris are supported. [RT# 20202] + variants, Linux and Solaris are supported. [RT #20202] 2760. [cleanup] Corrected named-compilezone usage summary. [RT #20533] @@ -2929,7 +3354,7 @@ 2757. [bug] dig: assertion failure could occur in connect timeout. [RT #20599] -2756. [bug] Fixed corrupt logfile message in update.c. [RT# 20597] +2756. [bug] Fixed corrupt logfile message in update.c. [RT #20597] 2755. [placeholder] @@ -3924,7 +4349,7 @@ glue when sibling checks were disabled. [RT #18768] 2470. [bug] Elements of the isc_radix_node_t could be incorrectly - overwritten. [RT# 18719] + overwritten. [RT #18719] 2469. [port] solaris: Work around Solaris's select() limitations. [RT #18769] @@ -3997,7 +4422,7 @@ 2446. [func] Add a new log message about build options on startup. A new command-line option '-V' for named is also - provided to show this information. [RT# 18645] + provided to show this information. [RT #18645] 2445. [doc] ARM out-of-date on empty reverse zones (list includes RFC1918 address, but these are not yet compiled in). @@ -4011,7 +4436,7 @@ Fix this by doing an immediate WSAConnect() rather than an io completion port type for UDP. -2442. [bug] A lock could be destroyed twice. [RT# 18626] +2442. [bug] A lock could be destroyed twice. [RT #18626] 2441. [bug] isc_radix_insert() could copy radix tree nodes incompletely. [RT #18573] @@ -4248,7 +4673,7 @@ [RT #18054] 2368. [port] Linux: use libcap for capability management if - possible. [RT# 18026] + possible. [RT #18026] 2367. [bug] Improve counting of dns_resstatscounter_retry [RT #18030] @@ -4526,7 +4951,7 @@ 2277. [bug] Empty zone names were not correctly being caught at in the post parse checks. [RT #17357] -2276. [bug] Install . [RT# 17359] +2276. [bug] Install . [RT #17359] 2275. [func] Add support to dig to perform IXFR queries over UDP. [RT #17235] @@ -4534,7 +4959,7 @@ 2274. [func] Log zone transfer statistics. [RT #17336] 2273. [bug] Adjust log level to WARNING when saving inconsistent - stub/slave master and journal files. [RT# 17279] + stub/slave master and journal files. [RT #17279] 2272. [bug] Handle illegal dnssec-lookaside trust-anchor names. [RT #17262] @@ -4960,7 +5385,7 @@ packet was sent to. [RT #16613] 2142. [bug] Handle master files with a modification time that - matches the epoch. [RT# 16612] + matches the epoch. [RT #16612] 2141. [bug] dig/host should not be setting IDN_ASCCHECK (IDN equivalent of LDH checks). [RT #16609] @@ -4974,12 +5399,12 @@ 2138. [bug] Lock order reversal in resolver.c. [RT #16653] 2137. [port] Mips little endian and/or mips 64 bit are now - supported for atomic operations. [RT#16648] + supported for atomic operations. [RT #16648] 2136. [bug] nslookup/host looped if there was no search list and the host didn't exist. [RT #16657] -2135. [bug] Uninitialized rdataset in sdlz.c. [RT# 16656] +2135. [bug] Uninitialized rdataset in sdlz.c. [RT #16656] 2134. [func] Additional statistics support. [RT #16666] @@ -5047,7 +5472,7 @@ labels were failing. [RT #16447] 2113. [bug] nsupdate: if a zone is specified it should be used - for server discover. [RT# 16455] + for server discover. [RT #16455] 2112. [security] Warn if weak RSA exponent is used. [RT #16460] @@ -5095,7 +5520,7 @@ 2095. [port] libbind: alway prototype inet_cidr_ntop_ipv6() and net_cidr_ntop_ipv6(). [RT #16388] -2094. [contrib] Update named-bootconf. [RT# 16404] +2094. [contrib] Update named-bootconf. [RT #16404] 2093. [bug] named-checkzone -s was broken. @@ -5247,7 +5672,7 @@ [RT #16179] 2043. [port] nsupdate/nslookup: Force the flushing of the prompt - for interactive sessions. [RT#16148] + for interactive sessions. [RT #16148] 2042. [bug] named-checkconf was incorrectly rejecting the logging category "config". [RT #16117] @@ -5619,7 +6044,7 @@ 1927. [bug] Access to soanode or nsnode in rbtdb violated the lock order rule and could cause a dead lock. - [RT# 15518] + [RT #15518] 1926. [bug] The Windows installer did not check for empty passwords. BINDinstall was being installed in @@ -5636,7 +6061,7 @@ dns_log_setcontext(). 1921. [bug] Client memory contexts were not using internal - malloc. [RT# 15434] + malloc. [RT #15434] 1920. [bug] The cache rbtdb lock array was too small to have the desired performance characteristics. @@ -5908,7 +6333,7 @@ 1832. [bug] named fails to return BADKEY on unknown TSIG algorithm. [RT #13620] -1831. [doc] Update named-checkzone documentation. [RT#13604] +1831. [doc] Update named-checkzone documentation. [RT #13604] 1830. [bug] adb lame cache has sence of test reversed. [RT #13600] @@ -5929,7 +6354,7 @@ [RT #13510] 1823. [bug] Wrong macro used to check for point to point interface. - [RT#13418] + [RT #13418] 1822. [bug] check-names test for RT was reversed. [RT #13382] @@ -6089,7 +6514,7 @@ 1771. [placeholder] 1770. [bug] named-checkconf failed to report missing a missing - file clause for rbt{64} master/hint zones. [RT#13009] + file clause for rbt{64} master/hint zones. [RT #13009] 1769. [port] win32: change compiler flags /MTd ==> /MDd, /MT ==> /MD. @@ -6101,7 +6526,7 @@ support for (struct in6_pktinfo) failed. [RT #13077] 1766. [bug] Update the master file timestamp on successful refresh - as well as the journal's timestamp. [RT# 13062] + as well as the journal's timestamp. [RT #13062] 1765. [bug] configure --with-openssl=auto failed. [RT #12937] @@ -6254,7 +6679,7 @@ "ifconfig.sh down" didn't work for Solaris 9. 1716. [doc] named.conf(5) was being installed in the wrong - location. [RT# 12441] + location. [RT #12441] 1715. [func] 'dig +trace' now randomly selects the next servers to try. Report if there is a bad delegation. @@ -6323,7 +6748,7 @@ are defined in named.conf. [RT #12023] 1693. [bug] max-journal-size was not effective for master zones - with ixfr-from-differences set. [RT# 12024] + with ixfr-from-differences set. [RT #12024] 1692. [bug] Don't set -I, -L and -R flags when libcrypto is in /usr/lib. [RT #11971] @@ -6389,7 +6814,7 @@ 1671. [contrib] queryperf: add NAPTR to the list of known types. 1670. [func] Log UPDATE requests to slave zones without an acl as - "disabled" at debug level 3. [RT# 11657] + "disabled" at debug level 3. [RT #11657] 1669. [placeholder] @@ -6456,7 +6881,7 @@ [RT #11445] 1646. [bug] win32: logging file versions didn't work with - non-UNC filenames. [RT#11486] + non-UNC filenames. [RT #11486] 1645. [bug] named could trigger a REQUIRE failure if multiple masters with keys are specified. @@ -6506,17 +6931,17 @@ 1629. [func] dig now supports IPv6 scoped addresses with the extended format in the local-server part. [RT #8753] -1628. [bug] Typo in Compaq Trucluster support. [RT# 11264] +1628. [bug] Typo in Compaq Trucluster support. [RT #11264] 1627. [bug] win32: sockets were not being closed when the - last external reference was removed. [RT# 11179] + last external reference was removed. [RT #11179] -1626. [bug] --enable-getifaddrs was broken. [RT#11259] +1626. [bug] --enable-getifaddrs was broken. [RT #11259] 1625. [bug] named failed to load/transfer RFC2535 signed zones - which contained CNAMES. [RT# 11237] + which contained CNAMES. [RT #11237] -1624. [bug] zonemgr_putio() call should be locked. [RT# 11163] +1624. [bug] zonemgr_putio() call should be locked. [RT #11163] 1623. [bug] A serial number of zero was being displayed in the "sending notifies" log message when also-notify was @@ -6526,12 +6951,12 @@ available, and suppress wildcard binding if not. 1621. [bug] match-destinations did not work for IPv6 TCP queries. - [RT# 11156] + [RT #11156] 1620. [func] When loading a zone report if it is signed. [RT #11149] 1619. [bug] Missing ISC_LIST_UNLINK in end_reserved_dispatches(). - [RT# 11118] + [RT #11118] 1618. [bug] Fencepost errors in dns_name_ishostname() and dns_name_ismailbox() could trigger a INSIST(). @@ -6544,14 +6969,14 @@ 1615. [port] Define ISC_SOCKADDR_LEN_T based on _BSD_SOCKLEN_T_ if it is defined. -1614. [port] win32: silence resource limit messages. [RT# 11101] +1614. [port] win32: silence resource limit messages. [RT #11101] 1613. [bug] Builds would fail on machines w/o a if_nametoindex(). Missing #ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX/#endif. [RT #11119] 1612. [bug] check-names at the option/view level could trigger - an INSIST. [RT# 11116] + an INSIST. [RT #11116] 1611. [bug] solaris: IPv6 interface scanning failed to cope with no active IPv6 interfaces. @@ -6571,7 +6996,7 @@ to use when making queries. 1607. [bug] dig, host and nslookup were still using random() - to generate query ids. [RT# 11013] + to generate query ids. [RT #11013] 1606. [bug] DLV insecurity proof was failing. @@ -6582,14 +7007,14 @@ partially initialized structure. 1603. [bug] nsupdate: set interactive based on isatty(). - [RT# 10929] + [RT #10929] 1602. [bug] Logging to a file failed unless a size was specified. - [RT# 10925] + [RT #10925] 1601. [bug] Silence spurious warning 'both "recursion no;" and "allow-recursion" active' warning from view "_bind". - [RT# 10920] + [RT #10920] 1600. [bug] Duplicate zone pre-load checks were not case insensitive. @@ -6612,9 +7037,9 @@ queries while the dump was in progress. [RT #10565] 1593. [bug] rndc should return "unknown command" to unknown - commands. [RT# 10642] + commands. [RT #10642] -1592. [bug] configure_view() could leak a dispatch. [RT# 10675] +1592. [bug] configure_view() could leak a dispatch. [RT #10675] 1591. [bug] libbind: updated to BIND 8.4.5. @@ -6655,7 +7080,7 @@ workaround code. [RT #10331] 1576. [bug] Race condition in dns_dispatch_addresponse(). - [RT# 10272] + [RT #10272] 1575. [func] Log TSIG name on TSIG verify failure. [RT #4404] @@ -6680,7 +7105,7 @@ complete answer message to the last update. 1568. [bug] nsupdate now reports that the update failed in - interactive mode. [RT# 10236] + interactive mode. [RT #10236] 1567. [maint] B.ROOT-SERVERS.NET is now 192.228.79.201. @@ -6731,7 +7156,7 @@ were specified in /etc/resolv.conf. [RT #8232] 1553. [bug] The windows socket code could stop accepting - connections. [RT#10115] + connections. [RT #10115] 1552. [bug] Accept NOTIFY requests from mapped masters if matched-mapped is set. [RT #10049] @@ -6744,7 +7169,7 @@ in a easily parsable format (-D and -o). 1548. [bug] When parsing APL records it was possible to silently - accept out of range ADDRESSFAMILY values. [RT# 9979] + accept out of range ADDRESSFAMILY values. [RT #9979] 1547. [bug] Named wasted memory recording duplicate lame zone entries. [RT #9341] @@ -6781,10 +7206,10 @@ 1535. [placeholder] -1534. [bug] Race condition when priming cache. [RT# 9940] +1534. [bug] Race condition when priming cache. [RT #9940] 1533. [func] Warn if both "recursion no;" and "allow-recursion" - are active. [RT# 4389] + are active. [RT #4389] 1532. [port] netbsd: the configure test for requires . @@ -6796,7 +7221,7 @@ moment. [RT #9462] 1529. [bug] "notify explicit;" failed to log that NOTIFY messages - were being sent for the zone. [RT# 9442] + were being sent for the zone. [RT #9442] 1528. [cleanup] Simplify some dns_name_ functions based on the deprecation of bitstring labels. @@ -6812,18 +7237,18 @@ 1525. [bug] dns_cache_create() could trigger a REQUIRE failure in isc_mem_put() during error cleanup. - [RT# 9360] + [RT #9360] 1524. [port] AIX needs to be able to resolve all symbols when creating shared libraries (--with-libtool). -1523. [bug] Fix race condition in rbtdb. [RT# 9189] +1523. [bug] Fix race condition in rbtdb. [RT #9189] 1522. [bug] dns_db_findnode() relax the requirements on 'name'. - [RT# 9286] + [RT #9286] 1521. [bug] dns_view_createresolver() failed to check the - result from isc_mem_create(). [RT# 9294] + result from isc_mem_create(). [RT #9294] 1520. [protocol] Add SSHFP (SSH Finger Print) type. @@ -6923,7 +7348,7 @@ [RT #6189] 1486. [bug] isc_print_snprintf() '%%' consumed one too many format - characters. [RT# 8230] + characters. [RT #8230] 1485. [bug] gen failed to handle high type values. [RT #6225] @@ -7260,7 +7685,7 @@ 1372. [bug] named crashes with an assertion failure on exit when sharing the same port for listening and querying, and - changing listening addresses several times. [RT# 3509] + changing listening addresses several times. [RT #3509] 1371. [bug] notify-source-v6, transfer-source-v6 and query-source-v6 with explicit addresses and using the @@ -7283,7 +7708,7 @@ addresses / prefixes. 1364. [func] Log file name when unable to open memory statistics - and dump database files. [RT# 3437] + and dump database files. [RT #3437] 1363. [func] Listen-on-v6 now supports specific addresses. @@ -7595,7 +8020,7 @@ 1252. [bug] Dig, host and nslookup were not checking the address the answer was coming from against the address it was - sent to. [RT# 2692] + sent to. [RT #2692] 1251. [port] win32: a make file contained absolute version specific references. @@ -7667,7 +8092,7 @@ 1227. [bug] dns_lex_getmastertoken() now returns ISC_R_BADNUMBER if a number was expected and some other token was - found. [RT#2532] + found. [RT #2532] 1226. [func] Use EDNS for zone refresh queries. [RT #2551] @@ -9280,7 +9705,7 @@ 729. [port] pthread_setconcurrency() needs to be called on Solaris. 728. [bug] Fix comment processing on master file directives. - [RT# 757] + [RT #757] 727. [port] Work around OS bug where accept() succeeds but fails to fill in the peer address of the accepted @@ -9322,7 +9747,7 @@ failure in adb.c. [RT #738] 714. [bug] Preserve interval timers across reloads unless changed. - [RT# 729] + [RT #729] 713. [func] named-checkconf takes '-t directory' similar to named. [RT #726] @@ -9542,7 +9967,7 @@ 644. [bug] #622 needed more work. [RT #562] 643. [bug] xfrin error messages made more verbose, added class - of the zone. [RT# 599] + of the zone. [RT #599] 642. [bug] Break the exit_check() race in the zone module. [RT #598] @@ -9970,7 +10395,7 @@ assertion. [RT #399] 515. [bug] The ssu table was not being attached / detached - by dns_zone_[sg]etssutable. [RT#397] + by dns_zone_[sg]etssutable. [RT #397] 514. [func] Retry refresh and notify queries if they timeout. [RT #388] @@ -10304,7 +10729,7 @@ transfers were finished. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:37:11 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F4045D0F; Thu, 18 Dec 2014 08:37: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 DF39F192A; Thu, 18 Dec 2014 08:37: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 sBI8bAa1025673; Thu, 18 Dec 2014 08:37:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8bAct025672; Thu, 18 Dec 2014 08:37:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180837.sBI8bAct025672@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275891 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:37:11 -0000 Author: mav Date: Thu Dec 18 08:37:09 2014 New Revision: 275891 URL: https://svnweb.freebsd.org/changeset/base/275891 Log: MFC r275461: Increase CTL ports limit from 128 to 256 and LUNs limit from 256 to 1024. After recent optimizations this change is no longer blocked by CTL memory consumption. Those limits are still not free, but much cheaper now. Relnotes: yes Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl_ioctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Thu Dec 18 08:36:19 2014 (r275890) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Thu Dec 18 08:37:09 2014 (r275891) @@ -60,17 +60,17 @@ /* * Maximum number of LUNs we support at the moment. MUST be a power of 2. */ -#define CTL_MAX_LUNS 256 +#define CTL_MAX_LUNS 1024 /* * Maximum number of initiators per port. */ -#define CTL_MAX_INIT_PER_PORT 2048 // Was 16 +#define CTL_MAX_INIT_PER_PORT 2048 /* * Maximum number of ports registered at one time. */ -#define CTL_MAX_PORTS 128 +#define CTL_MAX_PORTS 256 /* * Maximum number of initiators we support. From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:38:10 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28C03E49; Thu, 18 Dec 2014 08: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 132591938; Thu, 18 Dec 2014 08: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 sBI8cA87025864; Thu, 18 Dec 2014 08:38:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8c86k025856; Thu, 18 Dec 2014 08:38:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180838.sBI8c86k025856@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275892 - in stable/10/sys: cam/ctl cam/scsi cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:38:10 -0000 Author: mav Date: Thu Dec 18 08:38:07 2014 New Revision: 275892 URL: https://svnweb.freebsd.org/changeset/base/275892 Log: MFC r275474: Add GET LBA STATUS command support to CTL. It is implemented for LUNs backed by ZVOLs in "dev" mode and files. GEOM has no such API, so for LUNs backed by raw devices all LBAs will be reported as mapped/unknown. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/scsi/scsi_all.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:38:07 2014 (r275892) @@ -5174,6 +5174,40 @@ ctl_config_write_done(union ctl_io *io) free(buf, M_CTL); } +void +ctl_config_read_done(union ctl_io *io) +{ + uint8_t *buf; + + /* + * If there is some error -- we are done, skip data transfer. + */ + if ((io->io_hdr.flags & CTL_FLAG_ABORT) != 0 || + ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE && + (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { + if (io->io_hdr.flags & CTL_FLAG_ALLOCATED) + buf = io->scsiio.kern_data_ptr; + else + buf = NULL; + ctl_done(io); + if (buf) + free(buf, M_CTL); + return; + } + + /* + * If the IO_CONT flag is set, we need to call the supplied + * function to continue processing the I/O, instead of completing + * the I/O just yet. + */ + if (io->io_hdr.flags & CTL_FLAG_IO_CONT) { + io->scsiio.io_cont(io); + return; + } + + ctl_datamove(io); +} + /* * SCSI release command. */ @@ -7175,6 +7209,66 @@ ctl_read_capacity_16(struct ctl_scsiio * } int +ctl_get_lba_status(struct ctl_scsiio *ctsio) +{ + struct scsi_get_lba_status *cdb; + struct scsi_get_lba_status_data *data; + struct ctl_lun *lun; + struct ctl_lba_len_flags *lbalen; + uint64_t lba; + uint32_t alloc_len, total_len; + int retval; + + CTL_DEBUG_PRINT(("ctl_get_lba_status\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + cdb = (struct scsi_get_lba_status *)ctsio->cdb; + lba = scsi_8btou64(cdb->addr); + alloc_len = scsi_4btoul(cdb->alloc_len); + + if (lba > lun->be_lun->maxlba) { + ctl_set_lba_out_of_range(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + total_len = sizeof(*data) + sizeof(data->descr[0]); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + data = (struct scsi_get_lba_status_data *)ctsio->kern_data_ptr; + + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* Fill dummy data in case backend can't tell anything. */ + scsi_ulto4b(4 + sizeof(data->descr[0]), data->length); + scsi_u64to8b(lba, data->descr[0].addr); + scsi_ulto4b(MIN(UINT32_MAX, lun->be_lun->maxlba + 1 - lba), + data->descr[0].length); + data->descr[0].status = 0; /* Mapped or unknown. */ + + ctl_set_success(ctsio); + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + + lbalen = (struct ctl_lba_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->lba = lba; + lbalen->len = total_len; + lbalen->flags = 0; + retval = lun->backend->config_read((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); +} + +int ctl_read_defect(struct ctl_scsiio *ctsio) { struct scsi_read_defect_data_10 *ccb10; @@ -10644,6 +10738,14 @@ ctl_get_lba_len(union ctl_io *io, uint64 *len = UINT64_MAX; break; } + case SERVICE_ACTION_IN: { /* GET LBA STATUS */ + struct scsi_get_lba_status *cdb; + + cdb = (struct scsi_get_lba_status *)io->scsiio.cdb; + *lba = scsi_8btou64(cdb->addr); + *len = UINT32_MAX; + break; + } default: return (1); break; /* NOTREACHED */ Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl.h Thu Dec 18 08:38:07 2014 (r275892) @@ -186,6 +186,7 @@ int ctl_config_move_done(union ctl_io *i void ctl_datamove(union ctl_io *io); void ctl_done(union ctl_io *io); void ctl_data_submit_done(union ctl_io *io); +void ctl_config_read_done(union ctl_io *io); void ctl_config_write_done(union ctl_io *io); void ctl_portDB_changed(int portnum); void ctl_init_isc_msg(void); Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:38:07 2014 (r275892) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -165,6 +166,7 @@ struct ctl_be_block_lun { cbb_dispatch_t dispatch; cbb_dispatch_t lun_flush; cbb_dispatch_t unmap; + cbb_dispatch_t get_lba_status; cbb_getattr_t getattr; uma_zone_t lun_zone; uint64_t size_blocks; @@ -182,6 +184,7 @@ struct ctl_be_block_lun { struct task io_task; int num_threads; STAILQ_HEAD(, ctl_io_hdr) input_queue; + STAILQ_HEAD(, ctl_io_hdr) config_read_queue; STAILQ_HEAD(, ctl_io_hdr) config_write_queue; STAILQ_HEAD(, ctl_io_hdr) datamove_queue; struct mtx_padalign io_lock; @@ -240,6 +243,8 @@ static void ctl_be_block_flush_file(stru struct ctl_be_block_io *beio); static void ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); +static void ctl_be_block_gls_file(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio); static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); static void ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, @@ -248,6 +253,8 @@ static void ctl_be_block_dispatch_dev(st struct ctl_be_block_io *beio); static uint64_t ctl_be_block_getattr_dev(struct ctl_be_block_lun *be_lun, const char *attrname); +static void ctl_be_block_cr_dispatch(struct ctl_be_block_lun *be_lun, + union ctl_io *io); static void ctl_be_block_cw_dispatch(struct ctl_be_block_lun *be_lun, union ctl_io *io); static void ctl_be_block_dispatch(struct ctl_be_block_lun *be_lun, @@ -756,6 +763,46 @@ ctl_be_block_dispatch_file(struct ctl_be } static void +ctl_be_block_gls_file(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + union ctl_io *io = beio->io; + struct ctl_lba_len_flags *lbalen = ARGS(io); + struct scsi_get_lba_status_data *data; + off_t roff, off; + int error, status; + + DPRINTF("entered\n"); + + off = roff = ((off_t)lbalen->lba) << be_lun->blocksize_shift; + vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); + error = VOP_IOCTL(be_lun->vn, FIOSEEKHOLE, &off, + 0, curthread->td_ucred, curthread); + if (error == 0 && off > roff) + status = 0; /* mapped up to off */ + else { + error = VOP_IOCTL(be_lun->vn, FIOSEEKDATA, &off, + 0, curthread->td_ucred, curthread); + if (error == 0 && off > roff) + status = 1; /* deallocated up to off */ + else { + status = 0; /* unknown up to the end */ + off = be_lun->size_bytes; + } + } + VOP_UNLOCK(be_lun->vn, 0); + + off >>= be_lun->blocksize_shift; + data = (struct scsi_get_lba_status_data *)io->scsiio.kern_data_ptr; + scsi_u64to8b(lbalen->lba, data->descr[0].addr); + scsi_ulto4b(MIN(UINT32_MAX, off - lbalen->lba), + data->descr[0].length); + data->descr[0].status = status; + + ctl_complete_beio(beio); +} + +static void ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { @@ -848,6 +895,45 @@ ctl_be_block_dispatch_zvol(struct ctl_be } static void +ctl_be_block_gls_zvol(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + struct ctl_be_block_devdata *dev_data = &be_lun->backend.dev; + union ctl_io *io = beio->io; + struct ctl_lba_len_flags *lbalen = ARGS(io); + struct scsi_get_lba_status_data *data; + off_t roff, off; + int error, status; + + DPRINTF("entered\n"); + + off = roff = ((off_t)lbalen->lba) << be_lun->blocksize_shift; + error = (*dev_data->csw->d_ioctl)(dev_data->cdev, FIOSEEKHOLE, + (caddr_t)&off, FREAD, curthread); + if (error == 0 && off > roff) + status = 0; /* mapped up to off */ + else { + error = (*dev_data->csw->d_ioctl)(dev_data->cdev, FIOSEEKDATA, + (caddr_t)&off, FREAD, curthread); + if (error == 0 && off > roff) + status = 1; /* deallocated up to off */ + else { + status = 0; /* unknown up to the end */ + off = be_lun->size_bytes; + } + } + + off >>= be_lun->blocksize_shift; + data = (struct scsi_get_lba_status_data *)io->scsiio.kern_data_ptr; + scsi_u64to8b(lbalen->lba, data->descr[0].addr); + scsi_ulto4b(MIN(UINT32_MAX, off - lbalen->lba), + data->descr[0].length); + data->descr[0].status = status; + + ctl_complete_beio(beio); +} + +static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { @@ -1220,6 +1306,49 @@ ctl_be_block_cw_dispatch_unmap(struct ct } static void +ctl_be_block_cr_done(struct ctl_be_block_io *beio) +{ + union ctl_io *io; + + io = beio->io; + ctl_free_beio(beio); + ctl_config_read_done(io); +} + +static void +ctl_be_block_cr_dispatch(struct ctl_be_block_lun *be_lun, + union ctl_io *io) +{ + struct ctl_be_block_io *beio; + struct ctl_be_block_softc *softc; + + DPRINTF("entered\n"); + + softc = be_lun->softc; + beio = ctl_alloc_beio(softc); + beio->io = io; + beio->lun = be_lun; + beio->beio_cont = ctl_be_block_cr_done; + PRIV(io)->ptr = (void *)beio; + + switch (io->scsiio.cdb[0]) { + case SERVICE_ACTION_IN: /* GET LBA STATUS */ + beio->bio_cmd = -1; + beio->ds_trans_type = DEVSTAT_NO_DATA; + beio->ds_tag_type = DEVSTAT_TAG_ORDERED; + beio->io_len = 0; + if (be_lun->get_lba_status) + be_lun->get_lba_status(be_lun, beio); + else + ctl_be_block_cr_done(beio); + break; + default: + panic("Unhandled CDB type %#x", io->scsiio.cdb[0]); + break; + } +} + +static void ctl_be_block_cw_done(struct ctl_be_block_io *beio) { union ctl_io *io; @@ -1454,16 +1583,21 @@ ctl_be_block_worker(void *context, int p } io = (union ctl_io *)STAILQ_FIRST(&be_lun->config_write_queue); if (io != NULL) { - DPRINTF("config write queue\n"); - STAILQ_REMOVE(&be_lun->config_write_queue, &io->io_hdr, ctl_io_hdr, links); - mtx_unlock(&be_lun->queue_lock); - ctl_be_block_cw_dispatch(be_lun, io); - + mtx_lock(&be_lun->queue_lock); + continue; + } + io = (union ctl_io *)STAILQ_FIRST(&be_lun->config_read_queue); + if (io != NULL) { + DPRINTF("config read queue\n"); + STAILQ_REMOVE(&be_lun->config_read_queue, &io->io_hdr, + ctl_io_hdr, links); + mtx_unlock(&be_lun->queue_lock); + ctl_be_block_cr_dispatch(be_lun, io); mtx_lock(&be_lun->queue_lock); continue; } @@ -1592,6 +1726,7 @@ ctl_be_block_open_file(struct ctl_be_blo be_lun->dev_type = CTL_BE_BLOCK_FILE; be_lun->dispatch = ctl_be_block_dispatch_file; be_lun->lun_flush = ctl_be_block_flush_file; + be_lun->get_lba_status = ctl_be_block_gls_file; error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); if (error != 0) { @@ -1678,9 +1813,10 @@ ctl_be_block_open_dev(struct ctl_be_bloc &be_lun->backend.dev.dev_ref); if (be_lun->backend.dev.csw == NULL) panic("Unable to retrieve device switch"); - if (strcmp(be_lun->backend.dev.csw->d_name, "zvol") == 0) + if (strcmp(be_lun->backend.dev.csw->d_name, "zvol") == 0) { be_lun->dispatch = ctl_be_block_dispatch_zvol; - else + be_lun->get_lba_status = ctl_be_block_gls_zvol; + } else be_lun->dispatch = ctl_be_block_dispatch_dev; be_lun->lun_flush = ctl_be_block_flush_dev; be_lun->unmap = ctl_be_block_unmap_dev; @@ -1955,6 +2091,7 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->params = req->reqdata.create; be_lun->softc = softc; STAILQ_INIT(&be_lun->input_queue); + STAILQ_INIT(&be_lun->config_read_queue); STAILQ_INIT(&be_lun->config_write_queue); STAILQ_INIT(&be_lun->datamove_queue); sprintf(be_lun->lunname, "cblk%d", softc->num_luns); @@ -2585,13 +2722,50 @@ ctl_be_block_config_write(union ctl_io * } return (retval); - } static int ctl_be_block_config_read(union ctl_io *io) { - return (0); + struct ctl_be_block_lun *be_lun; + struct ctl_be_lun *ctl_be_lun; + int retval = 0; + + DPRINTF("entered\n"); + + ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ + CTL_PRIV_BACKEND_LUN].ptr; + be_lun = (struct ctl_be_block_lun *)ctl_be_lun->be_lun; + + switch (io->scsiio.cdb[0]) { + case SERVICE_ACTION_IN: + if (io->scsiio.cdb[1] == SGLS_SERVICE_ACTION) { + mtx_lock(&be_lun->queue_lock); + STAILQ_INSERT_TAIL(&be_lun->config_read_queue, + &io->io_hdr, links); + mtx_unlock(&be_lun->queue_lock); + taskqueue_enqueue(be_lun->io_taskqueue, + &be_lun->io_task); + retval = CTL_RETVAL_QUEUED; + break; + } + ctl_set_invalid_field(&io->scsiio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 1, + /*bit_valid*/ 1, + /*bit*/ 4); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + default: + ctl_set_invalid_opcode(&io->scsiio); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + } + + return (retval); } static int Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 18 08:38:07 2014 (r275892) @@ -967,8 +967,31 @@ ctl_backend_ramdisk_config_write(union c static int ctl_backend_ramdisk_config_read(union ctl_io *io) { - /* - * XXX KDM need to implement!! - */ - return (0); + int retval = 0; + + switch (io->scsiio.cdb[0]) { + case SERVICE_ACTION_IN: + if (io->scsiio.cdb[1] == SGLS_SERVICE_ACTION) { + /* We have nothing to tell, leave default data. */ + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + } + ctl_set_invalid_field(&io->scsiio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 1, + /*bit_valid*/ 1, + /*bit*/ 4); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + default: + ctl_set_invalid_opcode(&io->scsiio); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + } + + return (retval); } Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Thu Dec 18 08:38:07 2014 (r275892) @@ -433,7 +433,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 0F */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, -/* 10 */ +/* 10 READ CAPACITY(16) */ {ctl_read_capacity_16, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN | CTL_CMD_FLAG_OK_ON_STOPPED | CTL_CMD_FLAG_OK_ON_INOPERABLE | @@ -443,7 +443,18 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_LUN_PAT_READCAP, 16, {0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, -/* 11-1f */ +/* 11 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 12 GET LBA STATUS */ +{ctl_get_lba_status, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, + CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, + 16, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + +/* 13-1f */ }; /* A3 MAINTENANCE IN */ Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:38:07 2014 (r275892) @@ -516,6 +516,7 @@ int ctl_report_supported_opcodes(struct int ctl_report_supported_tmf(struct ctl_scsiio *ctsio); int ctl_report_timestamp(struct ctl_scsiio *ctsio); int ctl_isc(struct ctl_scsiio *ctsio); +int ctl_get_lba_status(struct ctl_scsiio *ctsio); void ctl_tpc_init(struct ctl_softc *softc); void ctl_tpc_shutdown(struct ctl_softc *softc); Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cam/scsi/scsi_all.h Thu Dec 18 08:38:07 2014 (r275892) @@ -2518,6 +2518,32 @@ struct scsi_read_capacity_data_long uint8_t reserved[16]; }; +struct scsi_get_lba_status +{ + uint8_t opcode; +#define SGLS_SERVICE_ACTION 0x12 + uint8_t service_action; + uint8_t addr[8]; + uint8_t alloc_len[4]; + uint8_t reserved; + uint8_t control; +}; + +struct scsi_get_lba_status_data_descr +{ + uint8_t addr[8]; + uint8_t length[4]; + uint8_t status; + uint8_t reserved[3]; +}; + +struct scsi_get_lba_status_data +{ + uint8_t length[4]; + uint8_t reserved[4]; + struct scsi_get_lba_status_data_descr descr[]; +}; + struct scsi_report_luns { uint8_t opcode; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Dec 18 08:37:09 2014 (r275891) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Dec 18 08:38:07 2014 (r275892) @@ -91,6 +91,7 @@ #include #include #include +#include #include @@ -2914,6 +2915,18 @@ zvol_d_ioctl(struct cdev *dev, u_long cm error = ENOIOCTL; break; } + case FIOSEEKHOLE: + case FIOSEEKDATA: { + off_t *off = (off_t *)data; + uint64_t noff; + boolean_t hole; + + hole = (cmd == FIOSEEKHOLE); + noff = *off; + error = dmu_offset_next(zv->zv_objset, ZVOL_OBJ, hole, &noff); + *off = noff; + break; + } default: error = ENOIOCTL; } From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:43:37 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FB1CFB; Thu, 18 Dec 2014 08: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 618341A24; Thu, 18 Dec 2014 08: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 sBI8hbIm030079; Thu, 18 Dec 2014 08:43:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8hb7f030078; Thu, 18 Dec 2014 08:43:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180843.sBI8hb7f030078@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275893 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:43:37 -0000 Author: mav Date: Thu Dec 18 08:43:36 2014 New Revision: 275893 URL: https://svnweb.freebsd.org/changeset/base/275893 Log: MFC r275481: Add to CTL support for threshold notifications for file-backed LUNs. Previously it was supported only for ZVOL-backed LUNs, but now should work for file-backed LUNs too. Used value in this case is a space occupied by the backing file, while available value is an available space on file system. Pool thresholds are still not implemented in this case. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:38:07 2014 (r275892) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:43:36 2014 (r275893) @@ -245,6 +245,8 @@ static void ctl_be_block_dispatch_file(s struct ctl_be_block_io *beio); static void ctl_be_block_gls_file(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); +static uint64_t ctl_be_block_getattr_file(struct ctl_be_block_lun *be_lun, + const char *attrname); static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); static void ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, @@ -802,6 +804,31 @@ ctl_be_block_gls_file(struct ctl_be_bloc ctl_complete_beio(beio); } +static uint64_t +ctl_be_block_getattr_file(struct ctl_be_block_lun *be_lun, const char *attrname) +{ + struct vattr vattr; + struct statfs statfs; + int error; + + if (be_lun->vn == NULL) + return (UINT64_MAX); + if (strcmp(attrname, "blocksused") == 0) { + error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); + if (error != 0) + return (UINT64_MAX); + return (vattr.va_bytes >> be_lun->blocksize_shift); + } + if (strcmp(attrname, "blocksavail") == 0) { + error = VFS_STATFS(be_lun->vn->v_mount, &statfs); + if (error != 0) + return (UINT64_MAX); + return ((statfs.f_bavail * statfs.f_bsize) >> + be_lun->blocksize_shift); + } + return (UINT64_MAX); +} + static void ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) @@ -1727,6 +1754,7 @@ ctl_be_block_open_file(struct ctl_be_blo be_lun->dispatch = ctl_be_block_dispatch_file; be_lun->lun_flush = ctl_be_block_flush_file; be_lun->get_lba_status = ctl_be_block_gls_file; + be_lun->getattr = ctl_be_block_getattr_file; error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); if (error != 0) { From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:45:29 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE318244; Thu, 18 Dec 2014 08:45: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 B98081A46; Thu, 18 Dec 2014 08:45: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 sBI8jTN7030421; Thu, 18 Dec 2014 08:45:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8jThH030420; Thu, 18 Dec 2014 08:45:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180845.sBI8jThH030420@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275894 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:45:29 -0000 Author: mav Date: Thu Dec 18 08:45:28 2014 New Revision: 275894 URL: https://svnweb.freebsd.org/changeset/base/275894 Log: MFC r275512: In addition to r275481 allow threshold notifications work without UNMAP. While without UNMAP support there is not much initiator can do about it, the administrator still better be notified about the storage overflow. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:43:36 2014 (r275893) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:45:28 2014 (r275894) @@ -4349,8 +4349,7 @@ ctl_init_log_page_index(struct ctl_lun * continue; if (page_index->page_code == SLS_LOGICAL_BLOCK_PROVISIONING && - ((lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) == 0 || - lun->backend->lun_attr == NULL)) + lun->backend->lun_attr == NULL) continue; if (page_index->page_code != prev) { @@ -10255,8 +10254,8 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * lbp_ptr->page_code = SVPD_LBP; scsi_ulto2b(sizeof(*lbp_ptr) - 4, lbp_ptr->page_length); + lbp_ptr->threshold_exponent = CTL_LBP_EXPONENT; if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { - lbp_ptr->threshold_exponent = CTL_LBP_EXPONENT; lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10 | SVPD_LBP_RZ | SVPD_LBP_ANC_SUP; lbp_ptr->prov_type = SVPD_LBP_THIN; @@ -14004,7 +14003,6 @@ ctl_thresh_thread(void *arg) be_lun = lun->be_lun; if ((lun->flags & CTL_LUN_DISABLED) || (lun->flags & CTL_LUN_OFFLINE) || - (be_lun->flags & CTL_LUN_FLAG_UNMAP) == 0 || lun->backend->lun_attr == NULL) continue; rwpage = &lun->mode_pages.rw_er_page[CTL_PAGE_CURRENT]; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:46:56 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F82838A; Thu, 18 Dec 2014 08:46: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 419B51A5D; Thu, 18 Dec 2014 08:46: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 sBI8kuti030660; Thu, 18 Dec 2014 08:46:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8ksW7030654; Thu, 18 Dec 2014 08:46:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180846.sBI8ksW7030654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275895 - in stable/10: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:46:56 -0000 Author: mav Date: Thu Dec 18 08:46:53 2014 New Revision: 275895 URL: https://svnweb.freebsd.org/changeset/base/275895 Log: MFC r275568: Count consecutive read requests as blocking in CTL for files and ZVOLs. Technically read requests can be executed in any order or simultaneously since they are not changing any data. But ZFS prefetcher goes crasy when it receives consecutive requests from different threads. Since prefetcher works on level of separate blocks, instead of two consecutive 128K requests it may receive 32 8K requests in mixed order. This patch is more workaround then a real fix, and it does not fix all of prefetcher problems, but it improves sequential read speed by 3-4x times in some configurations. On the other side it may hurt performance if some backing store has no prefetch, that is why it is disabled by default for raw devices. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend.h stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/ctl_ser_table.c stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:46:53 2014 (r275895) @@ -435,7 +435,9 @@ static int ctl_inquiry_evpd_lbp(struct c static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio); static int ctl_inquiry_std(struct ctl_scsiio *ctsio); static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint64_t *len); -static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2); +static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2, + bool seq); +static ctl_action ctl_extent_check_seq(union ctl_io *io1, union ctl_io *io2); static ctl_action ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io, union ctl_io *ooa_io); static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, @@ -4592,6 +4594,17 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft if (value != NULL && strcmp(value, "on") == 0) lun->flags |= CTL_LUN_READONLY; + lun->serseq = CTL_LUN_SERSEQ_OFF; + if (be_lun->flags & CTL_LUN_FLAG_SERSEQ_READ) + lun->serseq = CTL_LUN_SERSEQ_READ; + value = ctl_get_opt(&be_lun->options, "serseq"); + if (value != NULL && strcmp(value, "on") == 0) + lun->serseq = CTL_LUN_SERSEQ_ON; + else if (value != NULL && strcmp(value, "read") == 0) + lun->serseq = CTL_LUN_SERSEQ_READ; + else if (value != NULL && strcmp(value, "off") == 0) + lun->serseq = CTL_LUN_SERSEQ_OFF; + lun->ctl_softc = ctl_softc; TAILQ_INIT(&lun->ooa_queue); TAILQ_INIT(&lun->blocked_queue); @@ -10754,15 +10767,15 @@ ctl_get_lba_len(union ctl_io *io, uint64 } static ctl_action -ctl_extent_check_lba(uint64_t lba1, uint64_t len1, uint64_t lba2, uint64_t len2) +ctl_extent_check_lba(uint64_t lba1, uint64_t len1, uint64_t lba2, uint64_t len2, + bool seq) { uint64_t endlba1, endlba2; - endlba1 = lba1 + len1 - 1; + endlba1 = lba1 + len1 - (seq ? 0 : 1); endlba2 = lba2 + len2 - 1; - if ((endlba1 < lba2) - || (endlba2 < lba1)) + if ((endlba1 < lba2) || (endlba2 < lba1)) return (CTL_ACTION_PASS); else return (CTL_ACTION_BLOCK); @@ -10801,23 +10814,39 @@ ctl_extent_check_unmap(union ctl_io *io, } static ctl_action -ctl_extent_check(union ctl_io *io1, union ctl_io *io2) +ctl_extent_check(union ctl_io *io1, union ctl_io *io2, bool seq) { uint64_t lba1, lba2; uint64_t len1, len2; int retval; - if (ctl_get_lba_len(io1, &lba1, &len1) != 0) + if (ctl_get_lba_len(io2, &lba2, &len2) != 0) return (CTL_ACTION_ERROR); - retval = ctl_extent_check_unmap(io2, lba1, len1); + retval = ctl_extent_check_unmap(io1, lba2, len2); if (retval != CTL_ACTION_ERROR) return (retval); + if (ctl_get_lba_len(io1, &lba1, &len1) != 0) + return (CTL_ACTION_ERROR); + + return (ctl_extent_check_lba(lba1, len1, lba2, len2, seq)); +} + +static ctl_action +ctl_extent_check_seq(union ctl_io *io1, union ctl_io *io2) +{ + uint64_t lba1, lba2; + uint64_t len1, len2; + + if (ctl_get_lba_len(io1, &lba1, &len1) != 0) + return (CTL_ACTION_ERROR); if (ctl_get_lba_len(io2, &lba2, &len2) != 0) return (CTL_ACTION_ERROR); - return (ctl_extent_check_lba(lba1, len1, lba2, len2)); + if (lba1 + len1 == lba2) + return (CTL_ACTION_BLOCK); + return (CTL_ACTION_PASS); } static ctl_action @@ -10906,12 +10935,18 @@ ctl_check_for_blockage(struct ctl_lun *l case CTL_SER_BLOCK: return (CTL_ACTION_BLOCK); case CTL_SER_EXTENT: - return (ctl_extent_check(pending_io, ooa_io)); + return (ctl_extent_check(ooa_io, pending_io, + (lun->serseq == CTL_LUN_SERSEQ_ON))); case CTL_SER_EXTENTOPT: if ((lun->mode_pages.control_page[CTL_PAGE_CURRENT].queue_flags & SCP_QUEUE_ALG_MASK) != SCP_QUEUE_ALG_UNRESTRICTED) - return (ctl_extent_check(pending_io, ooa_io)); - /* FALLTHROUGH */ + return (ctl_extent_check(ooa_io, pending_io, + (lun->serseq == CTL_LUN_SERSEQ_ON))); + return (CTL_ACTION_PASS); + case CTL_SER_EXTENTSEQ: + if (lun->serseq != CTL_LUN_SERSEQ_OFF) + return (ctl_extent_check_seq(ooa_io, pending_io)); + return (CTL_ACTION_PASS); case CTL_SER_PASS: return (CTL_ACTION_PASS); case CTL_SER_BLOCKOPT: @@ -12442,7 +12477,7 @@ ctl_cmd_pattern_match(struct ctl_scsiio return (CTL_LUN_PAT_NONE); action = ctl_extent_check_lba(lba1, len1, desc->lba_range.lba, - desc->lba_range.len); + desc->lba_range.len, FALSE); /* * A "pass" means that the LBA ranges don't overlap, so * this doesn't match the user's range criteria. Modified: stable/10/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.h Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/sys/cam/ctl/ctl_backend.h Thu Dec 18 08:46:53 2014 (r275895) @@ -85,7 +85,8 @@ typedef enum { CTL_LUN_FLAG_DEVID = 0x20, CTL_LUN_FLAG_DEV_TYPE = 0x40, CTL_LUN_FLAG_UNMAP = 0x80, - CTL_LUN_FLAG_OFFLINE = 0x100 + CTL_LUN_FLAG_OFFLINE = 0x100, + CTL_LUN_FLAG_SERSEQ_READ = 0x200 } ctl_backend_lun_flags; #ifdef _KERNEL Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Thu Dec 18 08:46:53 2014 (r275895) @@ -2207,6 +2207,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_OFFLINE; if (unmap) be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP; + if (be_lun->dispatch != ctl_be_block_dispatch_dev) + be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_SERSEQ_READ; be_lun->ctl_be_lun.be_lun = be_lun; be_lun->ctl_be_lun.maxlba = (be_lun->size_blocks == 0) ? 0 : (be_lun->size_blocks - 1); Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:46:53 2014 (r275895) @@ -97,6 +97,7 @@ typedef enum { CTL_SER_BLOCKOPT, CTL_SER_EXTENT, CTL_SER_EXTENTOPT, + CTL_SER_EXTENTSEQ, CTL_SER_PASS, CTL_SER_SKIP } ctl_serialize_action; @@ -183,6 +184,12 @@ typedef enum { } ctl_lun_flags; typedef enum { + CTL_LUN_SERSEQ_OFF, + CTL_LUN_SERSEQ_READ, + CTL_LUN_SERSEQ_ON +} ctl_lun_serseq; + +typedef enum { CTLBLOCK_FLAG_NONE = 0x00, CTLBLOCK_FLAG_INVALID = 0x01 } ctlblock_flags; @@ -386,6 +393,7 @@ struct ctl_lun { struct ctl_id target; uint64_t lun; ctl_lun_flags flags; + ctl_lun_serseq serseq; STAILQ_HEAD(,ctl_error_desc) error_list; uint64_t error_serial; struct ctl_softc *ctl_softc; Modified: stable/10/sys/cam/ctl/ctl_ser_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_ser_table.c Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/sys/cam/ctl/ctl_ser_table.c Thu Dec 18 08:46:53 2014 (r275895) @@ -59,12 +59,13 @@ #define bO CTL_SER_BLOCKOPT /* Optional block */ #define xT CTL_SER_EXTENT /* Extent check */ #define xO CTL_SER_EXTENTOPT /* Optional extent check */ +#define xS CTL_SER_EXTENTSEQ /* Sequential extent check */ static ctl_serialize_action ctl_serialize_table[CTL_SERIDX_COUNT][CTL_SERIDX_COUNT] = { /**>IDX_ :: 2nd:TUR RD WRT UNM MDSN MDSL RQSN INQ RDCP RES LSNS FMT STR*/ /*TUR */{ pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*READ */{ pS, pS, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*READ */{ pS, xS, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*WRITE */{ pS, xT, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*UNMAP */{ pS, xO, xO, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*MD_SNS */{ bK, bK, bK, bK, pS, bK, bK, pS, pS, bK, pS, bK, bK}, Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Thu Dec 18 08:45:28 2014 (r275894) +++ stable/10/usr.sbin/ctladm/ctladm.8 Thu Dec 18 08:46:53 2014 (r275895) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd November 5, 2014 +.Dd December 6, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -995,6 +995,13 @@ command sequence order shall be explicit client through the selection of appropriate commands and task attributes. The default value is "restricted". It improves data integrity, but may introduce some additional delays. +.It Va serseq +Set to "on" to serialize conseсutive reads/writes. +Set to "read" to serialize conseсutive reads. +Set to "off" to allow them be issued in parallel. +Parallel issue of consecutive operations may confuse logic of the +backing file system, hurting performance; but it may improve performance +of backing stores without prefetch/write-back. .It Va rpm Specifies medium rotation rate of the device: 0 -- not reported, 1 -- non-rotating (SSD), >1024 -- value in revolutions per minute. From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 08:49:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04EB2614; Thu, 18 Dec 2014 08:49: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 E44071BCA; Thu, 18 Dec 2014 08:49: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 sBI8npZ6031084; Thu, 18 Dec 2014 08:49:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8np7G031083; Thu, 18 Dec 2014 08:49:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180849.sBI8np7G031083@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275896 - stable/10/usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:49:52 -0000 Author: mav Date: Thu Dec 18 08:49:50 2014 New Revision: 275896 URL: https://svnweb.freebsd.org/changeset/base/275896 Log: MFC r275482: Document r275481 changes. Modified: stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Thu Dec 18 08:46:53 2014 (r275895) +++ stable/10/usr.sbin/ctladm/ctladm.8 Thu Dec 18 08:49:50 2014 (r275896) @@ -1014,10 +1014,11 @@ Set to "on", enables UNMAP support for t .It Va used-threshold .It Va pool-avail-threshold .It Va pool-used-threshold -Set per-LUN/-pool thin provisioning soft thresholds for ZVOL-backed LUNs. +Set per-LUN/-pool thin provisioning soft thresholds. LUN will establish UNIT ATTENTION condition if its or pool available space get below configured avail values, or its or pool used space get above configured used values. +Pool thresholds are working only for ZVOL-backed LUNs. .It Va writecache Set to "off", disables write caching for the LUN, if supported by the backend. .El From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 11:10:16 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B91439E4; Thu, 18 Dec 2014 11:10: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 A4DEB11FF; Thu, 18 Dec 2014 11:10:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIBAGxc097651; Thu, 18 Dec 2014 11:10:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIBAGcW097650; Thu, 18 Dec 2014 11:10:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412181110.sBIBAGcW097650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Dec 2014 11:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275898 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 11:10:16 -0000 Author: kib Date: Thu Dec 18 11:10:15 2014 New Revision: 275898 URL: https://svnweb.freebsd.org/changeset/base/275898 Log: MFC r259609 (by se): Fix overflow for timeout values of more than 68 years, which is the maximum covered by sbintime (LONG_MAX seconds). MFC r259633 (by se): Fix compilation on 32 bit architectures and use INT64_MAX instead of LONG_MAX for the upper bound check. Modified: stable/10/sys/kern/kern_event.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Thu Dec 18 10:01:12 2014 (r275897) +++ stable/10/sys/kern/kern_event.c Thu Dec 18 11:10:15 2014 (r275898) @@ -522,10 +522,14 @@ knote_fork(struct knlist *list, int pid) * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the * interval timer support code. */ -static __inline sbintime_t +static __inline sbintime_t timer2sbintime(intptr_t data) { +#ifdef __LP64__ + if (data > INT64_MAX / SBT_1MS) + return INT64_MAX; +#endif return (SBT_1MS * data); } From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 11:30:53 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6650261; Thu, 18 Dec 2014 11:30: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 A1B2F1613; Thu, 18 Dec 2014 11:30: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 sBIBUrMi009979; Thu, 18 Dec 2014 11:30:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIBUq0V009976; Thu, 18 Dec 2014 11:30:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412181130.sBIBUq0V009976@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Dec 2014 11:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275899 - in stable/10: lib/libc/sys sys/kern sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 11:30:53 -0000 Author: kib Date: Thu Dec 18 11:30:51 2014 New Revision: 275899 URL: https://svnweb.freebsd.org/changeset/base/275899 Log: MFC r268843 (by bapt): Extend kqueue's EVFILT_TIMER by adding precision unit flags support. Modified: stable/10/lib/libc/sys/kqueue.2 stable/10/sys/kern/kern_event.c stable/10/sys/sys/event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Thu Dec 18 11:10:15 2014 (r275898) +++ stable/10/lib/libc/sys/kqueue.2 Thu Dec 18 11:30:51 2014 (r275899) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2013 +.Dd July 18, 2014 .Dt KQUEUE 2 .Os .Sh NAME @@ -436,7 +436,7 @@ Establishes an arbitrary timer identifie .Va ident . When adding a timer, .Va data -specifies the timeout period in milliseconds. +specifies the timeout period. The timer will be periodic unless EV_ONESHOT is specified. On return, .Va data @@ -447,8 +447,25 @@ There is a system wide limit on the numb which is controlled by the .Va kern.kq_calloutmax sysctl. +.Bl -tag -width XXNOTE_USECONDS +.It Dv NOTE_SECONDS +.Va data +is in seconds. +.It Dv NOTE_MSECONDS +.Va data +is in milliseconds. +.It Dv NOTE_USECONDS +.Va data +is in microseconds. +.It Dv NOTE_NSECONDS +.Va data +is in nanoseconds. +.It +.El .Pp -On return, +If +.Va fflags +is not set, the default is milliseconds. On return, .Va fflags contains the events which triggered the filter. .It Dv EVFILT_USER Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Thu Dec 18 11:10:15 2014 (r275898) +++ stable/10/sys/kern/kern_event.c Thu Dec 18 11:30:51 2014 (r275899) @@ -522,15 +522,38 @@ knote_fork(struct knlist *list, int pid) * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the * interval timer support code. */ + +#define NOTE_TIMER_PRECMASK (NOTE_SECONDS|NOTE_MSECONDS|NOTE_USECONDS| \ + NOTE_NSECONDS) + static __inline sbintime_t -timer2sbintime(intptr_t data) +timer2sbintime(intptr_t data, int flags) { + sbintime_t modifier; + + switch (flags & NOTE_TIMER_PRECMASK) { + case NOTE_SECONDS: + modifier = SBT_1S; + break; + case NOTE_MSECONDS: /* FALLTHROUGH */ + case 0: + modifier = SBT_1MS; + break; + case NOTE_USECONDS: + modifier = SBT_1US; + break; + case NOTE_NSECONDS: + modifier = SBT_1NS; + break; + default: + return (-1); + } #ifdef __LP64__ - if (data > INT64_MAX / SBT_1MS) - return INT64_MAX; + if (data > SBT_MAX / modifier) + return (SBT_MAX); #endif - return (SBT_1MS * data); + return (modifier * data); } static void @@ -545,14 +568,15 @@ filt_timerexpire(void *knx) if ((kn->kn_flags & EV_ONESHOT) != EV_ONESHOT) { calloutp = (struct callout *)kn->kn_hook; - *kn->kn_ptr.p_nexttime += timer2sbintime(kn->kn_sdata); + *kn->kn_ptr.p_nexttime += timer2sbintime(kn->kn_sdata, + kn->kn_sfflags); callout_reset_sbt_on(calloutp, *kn->kn_ptr.p_nexttime, 0, filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); } } /* - * data contains amount of time to sleep, in milliseconds + * data contains amount of time to sleep */ static int filt_timerattach(struct knote *kn) @@ -565,7 +589,11 @@ filt_timerattach(struct knote *kn) return (EINVAL); if ((intptr_t)kn->kn_sdata == 0 && (kn->kn_flags & EV_ONESHOT) == 0) kn->kn_sdata = 1; - to = timer2sbintime(kn->kn_sdata); + /* Only precision unit are supported in flags so far */ + if (kn->kn_sfflags & ~NOTE_TIMER_PRECMASK) + return (EINVAL); + + to = timer2sbintime(kn->kn_sdata, kn->kn_sfflags); if (to < 0) return (EINVAL); Modified: stable/10/sys/sys/event.h ============================================================================== --- stable/10/sys/sys/event.h Thu Dec 18 11:10:15 2014 (r275898) +++ stable/10/sys/sys/event.h Thu Dec 18 11:30:51 2014 (r275899) @@ -132,6 +132,12 @@ struct kevent { #define NOTE_TRACKERR 0x00000002 /* could not track child */ #define NOTE_CHILD 0x00000004 /* am a child process */ +/* additional flags for EVFILE_TIMER */ +#define NOTE_SECONDS 0x00000001 /* data is seconds */ +#define NOTE_MSECONDS 0x00000002 /* data is milliseconds */ +#define NOTE_USECONDS 0x00000004 /* data is microseconds */ +#define NOTE_NSECONDS 0x00000008 /* data is nanoseconds */ + struct knote; SLIST_HEAD(klist, knote); struct kqueue; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 11:36:16 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D49A685; Thu, 18 Dec 2014 11:36: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 1E41A166A; Thu, 18 Dec 2014 11:36:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBIBaFMi011968; Thu, 18 Dec 2014 11:36:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIBaFWS011967; Thu, 18 Dec 2014 11:36:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412181136.sBIBaFWS011967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Dec 2014 11:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275900 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 11:36:16 -0000 Author: kib Date: Thu Dec 18 11:36:14 2014 New Revision: 275900 URL: https://svnweb.freebsd.org/changeset/base/275900 Log: MFC r271315 (by joel): Minor mdoc nit. MFC r275806: Markup fixes for kqueue(2), no content changes. Modified: stable/10/lib/libc/sys/kqueue.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Thu Dec 18 11:30:51 2014 (r275899) +++ stable/10/lib/libc/sys/kqueue.2 Thu Dec 18 11:36:14 2014 (r275900) @@ -162,56 +162,56 @@ struct kevent { The fields of .Fa struct kevent are: -.Bl -tag -width XXXfilter -.It ident +.Bl -tag -width "Fa filter" +.It Fa ident Value used to identify this event. The exact interpretation is determined by the attached filter, but often is a file descriptor. -.It filter +.It Fa filter Identifies the kernel filter used to process this event. The pre-defined system filters are described below. -.It flags +.It Fa flags Actions to perform on the event. -.It fflags +.It Fa fflags Filter-specific flags. -.It data +.It Fa data Filter-specific data value. -.It udata +.It Fa udata Opaque user-defined value passed through the kernel unchanged. .El .Pp The .Va flags field can contain the following values: -.Bl -tag -width XXXEV_ONESHOT -.It EV_ADD +.Bl -tag -width EV_DISPATCH +.It Dv EV_ADD Adds the event to the kqueue. Re-adding an existing event will modify the parameters of the original event, and not result in a duplicate entry. Adding an event automatically enables it, unless overridden by the EV_DISABLE flag. -.It EV_ENABLE +.It Dv EV_ENABLE Permit .Fn kevent to return the event if it is triggered. -.It EV_DISABLE +.It Dv EV_DISABLE Disable the event so .Fn kevent will not return it. The filter itself is not disabled. -.It EV_DISPATCH +.It Dv EV_DISPATCH Disable the event source immediately after delivery of an event. See .Dv EV_DISABLE above. -.It EV_DELETE +.It Dv EV_DELETE Removes the event from the kqueue. Events which are attached to file descriptors are automatically deleted on the last close of the descriptor. -.It EV_RECEIPT +.It Dv EV_RECEIPT This flag is useful for making bulk changes to a kqueue without draining any pending events. When passed as input, it forces @@ -220,20 +220,20 @@ to always be returned. When a filter is successfully added the .Va data field will be zero. -.It EV_ONESHOT +.It Dv EV_ONESHOT Causes the event to return only the first occurrence of the filter being triggered. After the user retrieves the event from the kqueue, it is deleted. -.It EV_CLEAR +.It Dv EV_CLEAR After the event is retrieved by the user, its state is reset. This is useful for filters which report state transitions instead of the current state. Note that some filters may automatically set this flag internally. -.It EV_EOF +.It Dv EV_EOF Filters may set this flag to indicate filter-specific EOF condition. -.It EV_ERROR +.It Dv EV_ERROR See .Sx RETURN VALUES below. @@ -245,8 +245,8 @@ Arguments may be passed to and from the and .Va data fields in the kevent structure. -.Bl -tag -width EVFILT_SIGNAL -.It EVFILT_READ +.Bl -tag -width "Dv EVFILT_PROCDESC" +.It Dv EVFILT_READ Takes a descriptor as the identifier, and returns whenever there is data available to read. The behavior of the filter is slightly different depending @@ -265,7 +265,7 @@ subject to the value of the socket buffer. This may be overridden with a per-filter low water mark at the time the filter is added by setting the -NOTE_LOWAT +.Dv NOTE_LOWAT flag in .Va fflags , and specifying the new low water mark in @@ -275,7 +275,9 @@ On return, contains the number of bytes of protocol data available to read. .Pp If the read direction of the socket has shutdown, then the filter -also sets EV_EOF in +also sets +.Dv EV_EOF +in .Va flags , and returns the socket error (if any) in .Va fflags . @@ -291,9 +293,13 @@ Returns when the there is data to read; .Va data contains the number of bytes available. .Pp -When the last writer disconnects, the filter will set EV_EOF in +When the last writer disconnects, the filter will set +.Dv EV_EOF +in .Va flags . -This may be cleared by passing in EV_CLEAR, at which point the +This may be cleared by passing in +.Dv EV_CLEAR , +at which point the filter will resume waiting for data to become available before returning. .It "BPF devices" @@ -304,7 +310,7 @@ enabled and there is any data to read; .Va data contains the number of bytes available. .El -.It EVFILT_WRITE +.It Dv EVFILT_WRITE Takes a descriptor as the identifier, and returns whenever it is possible to write to the descriptor. For sockets, pipes @@ -312,23 +318,30 @@ and fifos, .Va data will contain the amount of space remaining in the write buffer. The filter will set EV_EOF when the reader disconnects, and for -the fifo case, this may be cleared by use of EV_CLEAR. +the fifo case, this may be cleared by use of +.Dv EV_CLEAR . Note that this filter is not supported for vnodes or BPF devices. .Pp For sockets, the low water mark and socket error handling is -identical to the EVFILT_READ case. -.It EVFILT_AIO +identical to the +.Dv EVFILT_READ +case. +.It Dv EVFILT_AIO The sigevent portion of the AIO request is filled in, with .Va sigev_notify_kqueue containing the descriptor of the kqueue that the event should be attached to, .Va sigev_notify_kevent_flags -containing the kevent flags which should be EV_ONESHOT, EV_CLEAR or -EV_DISPATCH, +containing the kevent flags which should be +.Dv EV_ONESHOT , +.Dv EV_CLEAR +or +.Dv EV_DISPATCH , .Va sigev_value containing the udata value, and .Va sigev_notify -set to SIGEV_KEVENT. +set to +.Dv SIGEV_KEVENT . When the .Fn aio_* system call is made, the event will be registered @@ -339,29 +352,30 @@ argument set to the returned by the .Fn aio_* system call. -The filter returns under the same conditions as aio_error. -.It EVFILT_VNODE +The filter returns under the same conditions as +.Fn aio_error . +.It Dv EVFILT_VNODE Takes a file descriptor as the identifier and the events to watch for in .Va fflags , and returns when one or more of the requested events occurs on the descriptor. The events to monitor are: -.Bl -tag -width XXNOTE_RENAME -.It NOTE_DELETE +.Bl -tag -width "Dv NOTE_RENAME" +.It Dv NOTE_DELETE The .Fn unlink system call was called on the file referenced by the descriptor. -.It NOTE_WRITE +.It Dv NOTE_WRITE A write occurred on the file referenced by the descriptor. -.It NOTE_EXTEND +.It Dv NOTE_EXTEND The file referenced by the descriptor was extended. -.It NOTE_ATTRIB +.It Dv NOTE_ATTRIB The file referenced by the descriptor had its attributes changed. -.It NOTE_LINK +.It Dv NOTE_LINK The link count on the file changed. -.It NOTE_RENAME +.It Dv NOTE_RENAME The file referenced by the descriptor was renamed. -.It NOTE_REVOKE +.It Dv NOTE_REVOKE Access to the file was revoked via .Xr revoke 2 or the underlying file system was unmounted. @@ -370,26 +384,26 @@ or the underlying file system was unmoun On return, .Va fflags contains the events which triggered the filter. -.It EVFILT_PROC +.It Dv EVFILT_PROC Takes the process ID to monitor as the identifier and the events to watch for in .Va fflags , and returns when the process performs one or more of the requested events. If a process can normally see another process, it can attach an event to it. The events to monitor are: -.Bl -tag -width XXNOTE_TRACKERR -.It NOTE_EXIT +.Bl -tag -width "Dv NOTE_TRACKERR" +.It Dv NOTE_EXIT The process has exited. The exit status will be stored in .Va data . -.It NOTE_FORK +.It Dv NOTE_FORK The process has called .Fn fork . -.It NOTE_EXEC +.It Dv NOTE_EXEC The process has executed a new process via .Xr execve 2 or a similar call. -.It NOTE_TRACK +.It Dv NOTE_TRACK Follow a process across .Fn fork calls. @@ -397,22 +411,28 @@ The parent process registers a new keven using the same .Va fflags as the original event. -The child process will signal an event with NOTE_CHILD set in +The child process will signal an event with +.Dv NOTE_CHILD +set in .Va fflags and the parent PID in .Va data . .Pp If the parent process fails to register a new kevent .Pq usually due to resource limitations , -it will signal an event with NOTE_TRACKERR set in +it will signal an event with +.Dv NOTE_TRACKERR +set in .Va fflags , -and the child process will not signal a NOTE_CHILD event. +and the child process will not signal a +.Dv NOTE_CHILD +event. .El .Pp On return, .Va fflags contains the events which triggered the filter. -.It EVFILT_SIGNAL +.It Dv EVFILT_SIGNAL Takes the signal number to monitor as the identifier and returns when the given signal is delivered to the process. This coexists with the @@ -422,7 +442,9 @@ and facilities, and has a lower precedence. The filter will record all attempts to deliver a signal to a process, even if the signal has -been marked as SIG_IGN, except for the +been marked as +.Dv SIG_IGN , +except for the .Dv SIGCHLD signal, which, if ignored, won't be recorded by the filter. Event notification happens after normal @@ -430,14 +452,18 @@ signal delivery processing. .Va data returns the number of times the signal has occurred since the last call to .Fn kevent . -This filter automatically sets the EV_CLEAR flag internally. -.It EVFILT_TIMER +This filter automatically sets the +.Dv EV_CLEAR +flag internally. +.It Dv EVFILT_TIMER Establishes an arbitrary timer identified by .Va ident . When adding a timer, .Va data specifies the timeout period. -The timer will be periodic unless EV_ONESHOT is specified. +The timer will be periodic unless +.Dv EV_ONESHOT +is specified. On return, .Va data contains the number of times the timeout has expired since the last call to @@ -447,7 +473,7 @@ There is a system wide limit on the numb which is controlled by the .Va kern.kq_calloutmax sysctl. -.Bl -tag -width XXNOTE_USECONDS +.Bl -tag -width "Dv NOTE_USECONDS" .It Dv NOTE_SECONDS .Va data is in seconds. @@ -460,7 +486,6 @@ is in microseconds. .It Dv NOTE_NSECONDS .Va data is in nanoseconds. -.It .El .Pp If @@ -476,7 +501,7 @@ user level code. The lower 24 bits of the .Va fflags may be used for user defined flags and manipulated using the following: -.Bl -tag -width XXNOTE_FFLAGSMASK +.Bl -tag -width "Dv NOTE_FFLAGSMASK" .It Dv NOTE_FFNOP Ignore the input .Va fflags . @@ -498,7 +523,7 @@ User defined flag mask for .El .Pp A user event is triggered for output with the following: -.Bl -tag -width XXNOTE_FFLAGSMASK +.Bl -tag -width "Dv NOTE_FFLAGSMASK" .It Dv NOTE_TRIGGER Cause the event to be triggered. .El From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 13:46:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80D379D3; Thu, 18 Dec 2014 13:46: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 6BBF01A41; Thu, 18 Dec 2014 13:46: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 sBIDkCWt074020; Thu, 18 Dec 2014 13:46:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIDkCiX074019; Thu, 18 Dec 2014 13:46:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201412181346.sBIDkCiX074019@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 18 Dec 2014 13:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275901 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 13:46:12 -0000 Author: avg Date: Thu Dec 18 13:46:11 2014 New Revision: 275901 URL: https://svnweb.freebsd.org/changeset/base/275901 Log: MFC r275401: zfs_putpages: actually update mtime and ctime Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Dec 18 11:36:14 2014 (r275900) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Dec 18 13:46:11 2014 (r275901) @@ -5937,6 +5937,7 @@ top: &zp->z_pflags, 8); zfs_tstamp_update_setup(zp, CONTENT_MODIFIED, mtime, ctime, B_TRUE); + (void)sa_bulk_update(zp->z_sa_hdl, bulk, count, tx); zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, off, len, 0); zfs_vmobject_wlock(object); From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 13:46:33 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5125B02; Thu, 18 Dec 2014 13:46: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 A072C1A4C; Thu, 18 Dec 2014 13:46: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 sBIDkXYP074108; Thu, 18 Dec 2014 13:46:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIDkX4Z074107; Thu, 18 Dec 2014 13:46:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201412181346.sBIDkX4Z074107@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 18 Dec 2014 13:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275902 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 13:46:33 -0000 Author: avg Date: Thu Dec 18 13:46:32 2014 New Revision: 275902 URL: https://svnweb.freebsd.org/changeset/base/275902 Log: MFC r275401: zfs_putpages: actually update mtime and ctime Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Dec 18 13:46:11 2014 (r275901) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Dec 18 13:46:32 2014 (r275902) @@ -5914,6 +5914,7 @@ top: &zp->z_pflags, 8); zfs_tstamp_update_setup(zp, CONTENT_MODIFIED, mtime, ctime, B_TRUE); + (void)sa_bulk_update(zp->z_sa_hdl, bulk, count, tx); zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, off, len, 0); VM_OBJECT_LOCK(object); From owner-svn-src-stable@FreeBSD.ORG Thu Dec 18 23:00:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 802A99A8; Thu, 18 Dec 2014 23:00: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 6BBC31719; Thu, 18 Dec 2014 23:00: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 sBIN0Ink038577; Thu, 18 Dec 2014 23:00:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBIN0Iig038576; Thu, 18 Dec 2014 23:00:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412182300.sBIN0Iig038576@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 18 Dec 2014 23:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275921 - stable/10/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 23:00:18 -0000 Author: jhb Date: Thu Dec 18 23:00:17 2014 New Revision: 275921 URL: https://svnweb.freebsd.org/changeset/base/275921 Log: MFC 273871: Skip the smap sysctl instead of panicing if no kernel metadata can be found. Modified: stable/10/sys/i386/i386/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/machdep.c ============================================================================== --- stable/10/sys/i386/i386/machdep.c Thu Dec 18 22:32:22 2014 (r275920) +++ stable/10/sys/i386/i386/machdep.c Thu Dec 18 23:00:17 2014 (r275921) @@ -3117,6 +3117,8 @@ smap_sysctl_handler(SYSCTL_HANDLER_ARGS) kmdp = preload_search_by_type("elf kernel"); if (kmdp == NULL) kmdp = preload_search_by_type("elf32 kernel"); + if (kmdp == NULL) + return (0); smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase == NULL) From owner-svn-src-stable@FreeBSD.ORG Fri Dec 19 01:13:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E348CBDE; Fri, 19 Dec 2014 01:13: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 C3F782C07; Fri, 19 Dec 2014 01:13: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 sBJ1Dgo9004523; Fri, 19 Dec 2014 01:13:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ1DgnO004521; Fri, 19 Dec 2014 01:13:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412190113.sBJ1DgnO004521@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Dec 2014 01:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275926 - stable/10/sys/geom/raid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 01:13:43 -0000 Author: mav Date: Fri Dec 19 01:13:41 2014 New Revision: 275926 URL: https://svnweb.freebsd.org/changeset/base/275926 Log: MFC r275503: Avoid unneeded malloc/memcpy/free if there is no metadata on disk. Submitted by: Dmitry Luhtionov Modified: stable/10/sys/geom/raid/md_nvidia.c stable/10/sys/geom/raid/md_sii.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/10/sys/geom/raid/md_nvidia.c Fri Dec 19 01:12:22 2014 (r275925) +++ stable/10/sys/geom/raid/md_nvidia.c Fri Dec 19 01:13:41 2014 (r275926) @@ -256,23 +256,24 @@ nvidia_meta_read(struct g_consumer *cp) pp->name, error); return (NULL); } - meta = malloc(sizeof(*meta), M_MD_NVIDIA, M_WAITOK); - memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); - g_free(buf); + meta = (struct nvidia_raid_conf *)buf; /* Check if this is an NVIDIA RAID struct */ if (strncmp(meta->nvidia_id, NVIDIA_MAGIC, strlen(NVIDIA_MAGIC))) { G_RAID_DEBUG(1, "NVIDIA signature check failed on %s", pp->name); - free(meta, M_MD_NVIDIA); + g_free(buf); return (NULL); } if (meta->config_size > 128 || meta->config_size < 30) { G_RAID_DEBUG(1, "NVIDIA metadata size looks wrong: %d", meta->config_size); - free(meta, M_MD_NVIDIA); + g_free(buf); return (NULL); } + meta = malloc(sizeof(*meta), M_MD_NVIDIA, M_WAITOK); + memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); + g_free(buf); /* Check metadata checksum. */ for (checksum = 0, ptr = (uint32_t *)meta, Modified: stable/10/sys/geom/raid/md_sii.c ============================================================================== --- stable/10/sys/geom/raid/md_sii.c Fri Dec 19 01:12:22 2014 (r275925) +++ stable/10/sys/geom/raid/md_sii.c Fri Dec 19 01:13:41 2014 (r275926) @@ -277,15 +277,13 @@ sii_meta_read(struct g_consumer *cp) pp->name, error); return (NULL); } - meta = malloc(sizeof(*meta), M_MD_SII, M_WAITOK); - memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); - g_free(buf); + meta = (struct sii_raid_conf *)buf; /* Check vendor ID. */ if (meta->vendor_id != 0x1095) { G_RAID_DEBUG(1, "SiI vendor ID check failed on %s (0x%04x)", pp->name, meta->vendor_id); - free(meta, M_MD_SII); + g_free(buf); return (NULL); } @@ -293,9 +291,12 @@ sii_meta_read(struct g_consumer *cp) if (meta->version_major != 2) { G_RAID_DEBUG(1, "SiI version check failed on %s (%d.%d)", pp->name, meta->version_major, meta->version_minor); - free(meta, M_MD_SII); + g_free(buf); return (NULL); } + meta = malloc(sizeof(*meta), M_MD_SII, M_WAITOK); + memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); + g_free(buf); /* Check metadata checksum. */ for (checksum = 0, ptr = (uint16_t *)meta, i = 0; i <= 159; i++) From owner-svn-src-stable@FreeBSD.ORG Fri Dec 19 01:14:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F0E6D29; Fri, 19 Dec 2014 01:14:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE022C37; Fri, 19 Dec 2014 01:14: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 sBJ1Eg6e004726; Fri, 19 Dec 2014 01:14:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ1Eg8T004721; Fri, 19 Dec 2014 01:14:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412190114.sBJ1Eg8T004721@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Dec 2014 01:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275927 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 01:14:43 -0000 Author: mav Date: Fri Dec 19 01:14:41 2014 New Revision: 275927 URL: https://svnweb.freebsd.org/changeset/base/275927 Log: MFC r275503: Avoid unneeded malloc/memcpy/free if there is no metadata on disk. Submitted by: Dmitry Luhtionov Modified: stable/9/sys/geom/raid/md_nvidia.c stable/9/sys/geom/raid/md_sii.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/9/sys/geom/raid/md_nvidia.c Fri Dec 19 01:13:41 2014 (r275926) +++ stable/9/sys/geom/raid/md_nvidia.c Fri Dec 19 01:14:41 2014 (r275927) @@ -256,23 +256,24 @@ nvidia_meta_read(struct g_consumer *cp) pp->name, error); return (NULL); } - meta = malloc(sizeof(*meta), M_MD_NVIDIA, M_WAITOK); - memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); - g_free(buf); + meta = (struct nvidia_raid_conf *)buf; /* Check if this is an NVIDIA RAID struct */ if (strncmp(meta->nvidia_id, NVIDIA_MAGIC, strlen(NVIDIA_MAGIC))) { G_RAID_DEBUG(1, "NVIDIA signature check failed on %s", pp->name); - free(meta, M_MD_NVIDIA); + g_free(buf); return (NULL); } if (meta->config_size > 128 || meta->config_size < 30) { G_RAID_DEBUG(1, "NVIDIA metadata size looks wrong: %d", meta->config_size); - free(meta, M_MD_NVIDIA); + g_free(buf); return (NULL); } + meta = malloc(sizeof(*meta), M_MD_NVIDIA, M_WAITOK); + memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); + g_free(buf); /* Check metadata checksum. */ for (checksum = 0, ptr = (uint32_t *)meta, Modified: stable/9/sys/geom/raid/md_sii.c ============================================================================== --- stable/9/sys/geom/raid/md_sii.c Fri Dec 19 01:13:41 2014 (r275926) +++ stable/9/sys/geom/raid/md_sii.c Fri Dec 19 01:14:41 2014 (r275927) @@ -277,15 +277,13 @@ sii_meta_read(struct g_consumer *cp) pp->name, error); return (NULL); } - meta = malloc(sizeof(*meta), M_MD_SII, M_WAITOK); - memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); - g_free(buf); + meta = (struct sii_raid_conf *)buf; /* Check vendor ID. */ if (meta->vendor_id != 0x1095) { G_RAID_DEBUG(1, "SiI vendor ID check failed on %s (0x%04x)", pp->name, meta->vendor_id); - free(meta, M_MD_SII); + g_free(buf); return (NULL); } @@ -293,9 +291,12 @@ sii_meta_read(struct g_consumer *cp) if (meta->version_major != 2) { G_RAID_DEBUG(1, "SiI version check failed on %s (%d.%d)", pp->name, meta->version_major, meta->version_minor); - free(meta, M_MD_SII); + g_free(buf); return (NULL); } + meta = malloc(sizeof(*meta), M_MD_SII, M_WAITOK); + memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); + g_free(buf); /* Check metadata checksum. */ for (checksum = 0, ptr = (uint16_t *)meta, i = 0; i <= 159; i++) From owner-svn-src-stable@FreeBSD.ORG Fri Dec 19 09:34:15 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5845E2F1; Fri, 19 Dec 2014 09:34: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 439042E47; Fri, 19 Dec 2014 09:34: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 sBJ9YFmu037089; Fri, 19 Dec 2014 09:34:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ9YFJ6037088; Fri, 19 Dec 2014 09:34:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412190934.sBJ9YFJ6037088@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Dec 2014 09:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275932 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 09:34:15 -0000 Author: kib Date: Fri Dec 19 09:34:14 2014 New Revision: 275932 URL: https://svnweb.freebsd.org/changeset/base/275932 Log: MFC r275727: For architectures where time_t is wide enough, in particular, 64bit platforms, avoid overflow after year 2038 in clock_ct_to_ts(). PR: 195868 Modified: stable/10/sys/kern/subr_clock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_clock.c ============================================================================== --- stable/10/sys/kern/subr_clock.c Fri Dec 19 06:51:01 2014 (r275931) +++ stable/10/sys/kern/subr_clock.c Fri Dec 19 09:34:14 2014 (r275932) @@ -133,7 +133,6 @@ print_ct(struct clocktime *ct) int clock_ct_to_ts(struct clocktime *ct, struct timespec *ts) { - time_t secs; int i, year, days; year = ct->year; @@ -167,11 +166,10 @@ clock_ct_to_ts(struct clocktime *ct, str days += days_in_month(year, i); days += (ct->day - 1); - /* Add hours, minutes, seconds. */ - secs = ((days * 24 + ct->hour) * 60 + ct->min) * 60 + ct->sec; - - ts->tv_sec = secs; + ts->tv_sec = (((time_t)days * 24 + ct->hour) * 60 + ct->min) * 60 + + ct->sec; ts->tv_nsec = ct->nsec; + if (ct_debug) printf(" = %ld.%09ld\n", (long)ts->tv_sec, (long)ts->tv_nsec); return (0); From owner-svn-src-stable@FreeBSD.ORG Fri Dec 19 09:37:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D13DC5BF; Fri, 19 Dec 2014 09:37: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 BCFA42EAD; Fri, 19 Dec 2014 09:37: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 sBJ9b096037522; Fri, 19 Dec 2014 09:37:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ9b0YB037521; Fri, 19 Dec 2014 09:37:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412190937.sBJ9b0YB037521@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Dec 2014 09:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275933 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 09:37:00 -0000 Author: kib Date: Fri Dec 19 09:36:59 2014 New Revision: 275933 URL: https://svnweb.freebsd.org/changeset/base/275933 Log: MFC r275833: The iret instruction may generate #np and #ss fault, besides #gp. When returning to usermode, the handler for that exceptions is also executed with wrong gs base. Handle all three possible faults in the same way, checking for iret fault, and performing full iret. Modified: stable/10/sys/amd64/amd64/exception.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/exception.S ============================================================================== --- stable/10/sys/amd64/amd64/exception.S Fri Dec 19 09:34:14 2014 (r275932) +++ stable/10/sys/amd64/amd64/exception.S Fri Dec 19 09:36:59 2014 (r275933) @@ -154,9 +154,13 @@ IDTVEC(xmm) IDTVEC(tss) TRAP_ERR(T_TSSFLT) IDTVEC(missing) - TRAP_ERR(T_SEGNPFLT) + subq $TF_ERR,%rsp + movl $T_SEGNPFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(stk) - TRAP_ERR(T_STKFLT) + subq $TF_ERR,%rsp + movl $T_STKFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(align) TRAP_ERR(T_ALIGNFLT) @@ -319,6 +323,7 @@ IDTVEC(page) IDTVEC(prot) subq $TF_ERR,%rsp movl $T_PROTFLT,TF_TRAPNO(%rsp) +prot_addrf: movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ leaq doreti_iret(%rip),%rdi From owner-svn-src-stable@FreeBSD.ORG Fri Dec 19 09:42:42 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01952813; Fri, 19 Dec 2014 09:42: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 E129E2FAB; Fri, 19 Dec 2014 09:42: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 sBJ9gf5h041621; Fri, 19 Dec 2014 09:42:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ9gfUb041620; Fri, 19 Dec 2014 09:42:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412190942.sBJ9gfUb041620@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Dec 2014 09:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275934 - stable/9/sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 09:42:42 -0000 Author: kib Date: Fri Dec 19 09:42:40 2014 New Revision: 275934 URL: https://svnweb.freebsd.org/changeset/base/275934 Log: MFC r275833: The iret instruction may generate #np and #ss fault, besides #gp. When returning to usermode, the handler for that exceptions is also executed with wrong gs base. Handle all three possible faults in the same way, checking for iret fault, and performing full iret. Modified: stable/9/sys/amd64/amd64/exception.S Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/exception.S ============================================================================== --- stable/9/sys/amd64/amd64/exception.S Fri Dec 19 09:36:59 2014 (r275933) +++ stable/9/sys/amd64/amd64/exception.S Fri Dec 19 09:42:40 2014 (r275934) @@ -154,9 +154,13 @@ IDTVEC(xmm) IDTVEC(tss) TRAP_ERR(T_TSSFLT) IDTVEC(missing) - TRAP_ERR(T_SEGNPFLT) + subq $TF_ERR,%rsp + movl $T_SEGNPFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(stk) - TRAP_ERR(T_STKFLT) + subq $TF_ERR,%rsp + movl $T_STKFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(align) TRAP_ERR(T_ALIGNFLT) @@ -319,6 +323,7 @@ IDTVEC(page) IDTVEC(prot) subq $TF_ERR,%rsp movl $T_PROTFLT,TF_TRAPNO(%rsp) +prot_addrf: movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ leaq doreti_iret(%rip),%rdi From owner-svn-src-stable@FreeBSD.ORG Fri Dec 19 09:52:22 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E78BEA6E; Fri, 19 Dec 2014 09:52: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 D2C9310F1; Fri, 19 Dec 2014 09:52: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 sBJ9qMJg046291; Fri, 19 Dec 2014 09:52:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJ9qMr2046290; Fri, 19 Dec 2014 09:52:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412190952.sBJ9qMr2046290@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Dec 2014 09:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r275935 - stable/8/sys/amd64/amd64 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 09:52:23 -0000 Author: kib Date: Fri Dec 19 09:52:21 2014 New Revision: 275935 URL: https://svnweb.freebsd.org/changeset/base/275935 Log: MFC r275833: The iret instruction may generate #np and #ss fault, besides #gp. When returning to usermode, the handler for that exceptions is also executed with wrong gs base. Handle all three possible faults in the same way, checking for iret fault, and performing full iret. Modified: stable/8/sys/amd64/amd64/exception.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) Modified: stable/8/sys/amd64/amd64/exception.S ============================================================================== --- stable/8/sys/amd64/amd64/exception.S Fri Dec 19 09:42:40 2014 (r275934) +++ stable/8/sys/amd64/amd64/exception.S Fri Dec 19 09:52:21 2014 (r275935) @@ -150,9 +150,13 @@ IDTVEC(xmm) IDTVEC(tss) TRAP_ERR(T_TSSFLT) IDTVEC(missing) - TRAP_ERR(T_SEGNPFLT) + subq $TF_ERR,%rsp + movl $T_SEGNPFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(stk) - TRAP_ERR(T_STKFLT) + subq $TF_ERR,%rsp + movl $T_STKFLT,TF_TRAPNO(%rsp) + jmp prot_addrf IDTVEC(align) TRAP_ERR(T_ALIGNFLT) @@ -315,6 +319,7 @@ IDTVEC(page) IDTVEC(prot) subq $TF_ERR,%rsp movl $T_PROTFLT,TF_TRAPNO(%rsp) +prot_addrf: movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ leaq doreti_iret(%rip),%rdi From owner-svn-src-stable@FreeBSD.ORG Fri Dec 19 13:22:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0360D34F; Fri, 19 Dec 2014 13:22:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2D5715CA; Fri, 19 Dec 2014 13:22: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 sBJDM3ae044510; Fri, 19 Dec 2014 13:22:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJDM3PL044509; Fri, 19 Dec 2014 13:22:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412191322.sBJDM3PL044509@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 19 Dec 2014 13:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275938 - stable/10/usr.sbin/syslogd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 13:22:04 -0000 Author: ae Date: Fri Dec 19 13:22:02 2014 New Revision: 275938 URL: https://svnweb.freebsd.org/changeset/base/275938 Log: MFC r275729: Increase the buffer size to keep the list of programm names when parsing programm specification. It is safe to not check out of bounds access, because !isprint(p[i]) check will stop reading, when '\0' character will be read from the input string. Sponsored by: Yandex LLC Modified: stable/10/usr.sbin/syslogd/syslogd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/10/usr.sbin/syslogd/syslogd.c Fri Dec 19 13:07:36 2014 (r275937) +++ stable/10/usr.sbin/syslogd/syslogd.c Fri Dec 19 13:22:02 2014 (r275938) @@ -1542,7 +1542,7 @@ init(int signo) struct filed *f, *next, **nextp; char *p; char cline[LINE_MAX]; - char prog[NAME_MAX+1]; + char prog[LINE_MAX]; char host[MAXHOSTNAMELEN]; char oldLocalHostName[MAXHOSTNAMELEN]; char hostMsg[2*MAXHOSTNAMELEN+40]; @@ -1664,7 +1664,7 @@ init(int signo) (void)strlcpy(prog, "*", sizeof(prog)); continue; } - for (i = 0; i < NAME_MAX; i++) { + for (i = 0; i < LINE_MAX - 1; i++) { if (!isprint(p[i]) || isspace(p[i])) break; prog[i] = p[i]; From owner-svn-src-stable@FreeBSD.ORG Fri Dec 19 13:24:53 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DBB34A9; Fri, 19 Dec 2014 13:24: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 78CF615F9; Fri, 19 Dec 2014 13:24: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 sBJDOrBY044884; Fri, 19 Dec 2014 13:24:53 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJDOroo044883; Fri, 19 Dec 2014 13:24:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412191324.sBJDOroo044883@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 19 Dec 2014 13:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275939 - stable/9/usr.sbin/syslogd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 13:24:53 -0000 Author: ae Date: Fri Dec 19 13:24:52 2014 New Revision: 275939 URL: https://svnweb.freebsd.org/changeset/base/275939 Log: MFC r275729: Increase the buffer size to keep the list of programm names when parsing programm specification. It is safe to not check out of bounds access, because !isprint(p[i]) check will stop reading, when '\0' character will be read from the input string. Sponsored by: Yandex LLC Modified: stable/9/usr.sbin/syslogd/syslogd.c Directory Properties: stable/9/usr.sbin/syslogd/ (props changed) Modified: stable/9/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/9/usr.sbin/syslogd/syslogd.c Fri Dec 19 13:22:02 2014 (r275938) +++ stable/9/usr.sbin/syslogd/syslogd.c Fri Dec 19 13:24:52 2014 (r275939) @@ -1539,7 +1539,7 @@ init(int signo) struct filed *f, *next, **nextp; char *p; char cline[LINE_MAX]; - char prog[NAME_MAX+1]; + char prog[LINE_MAX]; char host[MAXHOSTNAMELEN]; char oldLocalHostName[MAXHOSTNAMELEN]; char hostMsg[2*MAXHOSTNAMELEN+40]; @@ -1661,7 +1661,7 @@ init(int signo) (void)strlcpy(prog, "*", sizeof(prog)); continue; } - for (i = 0; i < NAME_MAX; i++) { + for (i = 0; i < LINE_MAX - 1; i++) { if (!isprint(p[i]) || isspace(p[i])) break; prog[i] = p[i]; From owner-svn-src-stable@FreeBSD.ORG Fri Dec 19 21:46:25 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B96662D; Fri, 19 Dec 2014 21:46:25 +0000 (UTC) Received: from mail.myota.org (mail.myota.org [85.10.206.105]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4F916B9; Fri, 19 Dec 2014 21:46:23 +0000 (UTC) Received: from mobile.client (47.4.167.190.d.dyn.codetel.net.do [190.167.4.47] (may be forged)) (authenticated bits=128) by mail.myota.org (8.14.9/8.14.9) with ESMTP id sBJLjvBG021689; Fri, 19 Dec 2014 22:46:04 +0100 (CET) (envelope-from andre@albsmeier.net) Received: from submit.client ([127.0.0.1]) by schlappy.local (8.14.9/8.14.9) with ESMTP id sBJLjSle002021; Fri, 19 Dec 2014 22:45:28 +0100 (CET) (envelope-from andre@schlappy.albsmeier.net) Received: (from user@localhost) by schlappy.local (8.14.9/8.14.9/Submit) id sBJLjScG002020; Fri, 19 Dec 2014 22:45:28 +0100 (CET) (envelope-from andre@schlappy.albsmeier.net) Date: Fri, 19 Dec 2014 22:45:28 +0100 From: Andre Albsmeier To: Erwin Lansing Subject: Re: svn commit: r275890 - in stable/9: contrib/bind9 contrib/bind9/bin/check contrib/bind9/bin/confgen contrib/bind9/bin/dig contrib/bind9/bin/dig/include/dig contrib/bind9/bin/dnssec contrib/bind9/bin... Message-ID: <20141219214528.GA1998@schlappy> References: <201412180836.sBI8aLHe025437@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412180836.sBI8aLHe025437@svn.freebsd.org> X-Echelon: 757, PBX, unix, eavesdropping, 707 X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Not delayed on 85.10.206.105, ACL: AUTH(59), Origin: DO, OS: FreeBSD 9.x X-Virus-Scanned: clamav-milter 0.98.5 at colo X-Virus-Status: Clean Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 21:46:25 -0000 On Thu, 18-Dec-2014 at 08:36:21 +0000, Erwin Lansing wrote: > Author: erwin > > Log: > Update BIND to 9.9.6-P1 > I just noticed again that dnssec-importkey does not appear in usr.sbin/Makefile, is this intentional? If not we should probably add SUBDIR+= dnssec-importkey From owner-svn-src-stable@FreeBSD.ORG Fri Dec 19 23:18:23 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE0588BD; Fri, 19 Dec 2014 23:18: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 9EFAA280A; Fri, 19 Dec 2014 23:18: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 sBJNINYc024782; Fri, 19 Dec 2014 23:18:23 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBJNINjE024781; Fri, 19 Dec 2014 23:18:23 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201412192318.sBJNINjE024781@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 19 Dec 2014 23:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275945 - stable/10/usr.bin/elfdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 23:18:23 -0000 Author: brueffer Date: Fri Dec 19 23:18:22 2014 New Revision: 275945 URL: https://svnweb.freebsd.org/changeset/base/275945 Log: MFC: r274960 (slightly modified) Limit descriptors and enter capability mode. Since the header was renamed in HEAD, this commit includes sys/capability.h. Differential: D1009 Reviewed by: jonathan, pjd Relnotes: yes Modified: stable/10/usr.bin/elfdump/elfdump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/elfdump/elfdump.c ============================================================================== --- stable/10/usr.bin/elfdump/elfdump.c Fri Dec 19 23:13:46 2014 (r275944) +++ stable/10/usr.bin/elfdump/elfdump.c Fri Dec 19 23:18:22 2014 (r275945) @@ -29,12 +29,15 @@ __FBSDID("$FreeBSD$"); #include + +#include #include #include #include #include #include #include +#include #include #include #include @@ -467,6 +470,7 @@ elf_get_shstrndx(Elf32_Ehdr *e, void *sh int main(int ac, char **av) { + cap_rights_t rights; u_int64_t phoff; u_int64_t shoff; u_int64_t phentsize; @@ -527,6 +531,9 @@ main(int ac, char **av) case 'w': if ((out = fopen(optarg, "w")) == NULL) err(1, "%s", optarg); + cap_rights_init(&rights, CAP_FSTAT, CAP_WRITE); + if (cap_rights_limit(fileno(out), &rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for %s", optarg); break; case '?': default: @@ -539,6 +546,17 @@ main(int ac, char **av) if ((fd = open(*av, O_RDONLY)) < 0 || fstat(fd, &sb) < 0) err(1, "%s", *av); + cap_rights_init(&rights, CAP_MMAP_R); + if (cap_rights_limit(fd, &rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for %s", *av); + close(STDIN_FILENO); + cap_rights_init(&rights, CAP_WRITE); + if (cap_rights_limit(STDOUT_FILENO, &rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for stdout"); + if (cap_rights_limit(STDERR_FILENO, &rights) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for stderr"); + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); e = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); if (e == MAP_FAILED) err(1, NULL); From owner-svn-src-stable@FreeBSD.ORG Sat Dec 20 15:46:17 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B610C96; Sat, 20 Dec 2014 15:46:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CC9919A7; Sat, 20 Dec 2014 15:46:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBKFkGHo083530; Sat, 20 Dec 2014 15:46:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKFkGsS083528; Sat, 20 Dec 2014 15:46:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412201546.sBKFkGsS083528@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Dec 2014 15:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275956 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 15:46:17 -0000 Author: kib Date: Sat Dec 20 15:46:15 2014 New Revision: 275956 URL: https://svnweb.freebsd.org/changeset/base/275956 Log: MFC r275743: Put the buffer cleanup code after inactivation. Modified: stable/10/sys/kern/vfs_subr.c stable/10/sys/sys/bufobj.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Sat Dec 20 14:19:46 2014 (r275955) +++ stable/10/sys/kern/vfs_subr.c Sat Dec 20 15:46:15 2014 (r275956) @@ -1567,6 +1567,7 @@ buf_vlist_add(struct buf *bp, struct buf int error; ASSERT_BO_WLOCKED(bo); + KASSERT((bo->bo_flag & BO_DEAD) == 0, ("dead bo %p", bo)); KASSERT((bp->b_xflags & (BX_VNDIRTY|BX_VNCLEAN)) == 0, ("buf_vlist_add: Buf %p has existing xflags %d", bp, bp->b_xflags)); bp->b_xflags |= xflags; @@ -2794,16 +2795,6 @@ vgonel(struct vnode *vp) vfs_notify_upper(vp, VFS_NOTIFY_UPPER_RECLAIM); /* - * Clean out any buffers associated with the vnode. - * If the flush fails, just toss the buffers. - */ - mp = NULL; - if (!TAILQ_EMPTY(&vp->v_bufobj.bo_dirty.bv_hd)) - (void) vn_start_secondary_write(vp, &mp, V_WAIT); - if (vinvalbuf(vp, V_SAVE, 0, 0) != 0) - vinvalbuf(vp, 0, 0, 0); - - /* * If purging an active vnode, it must be closed and * deactivated before being reclaimed. */ @@ -2817,6 +2808,29 @@ vgonel(struct vnode *vp) } if (vp->v_type == VSOCK) vfs_unp_reclaim(vp); + + /* + * Clean out any buffers associated with the vnode. + * If the flush fails, just toss the buffers. + */ + mp = NULL; + if (!TAILQ_EMPTY(&vp->v_bufobj.bo_dirty.bv_hd)) + (void) vn_start_secondary_write(vp, &mp, V_WAIT); + if (vinvalbuf(vp, V_SAVE, 0, 0) != 0) { + while (vinvalbuf(vp, 0, 0, 0) != 0) + ; + } +#ifdef INVARIANTS + BO_LOCK(&vp->v_bufobj); + KASSERT(TAILQ_EMPTY(&vp->v_bufobj.bo_dirty.bv_hd) && + vp->v_bufobj.bo_dirty.bv_cnt == 0 && + TAILQ_EMPTY(&vp->v_bufobj.bo_clean.bv_hd) && + vp->v_bufobj.bo_clean.bv_cnt == 0, + ("vp %p bufobj not invalidated", vp)); + vp->v_bufobj.bo_flag |= BO_DEAD; + BO_UNLOCK(&vp->v_bufobj); +#endif + /* * Reclaim the vnode. */ Modified: stable/10/sys/sys/bufobj.h ============================================================================== --- stable/10/sys/sys/bufobj.h Sat Dec 20 14:19:46 2014 (r275955) +++ stable/10/sys/sys/bufobj.h Sat Dec 20 15:46:15 2014 (r275956) @@ -112,6 +112,7 @@ struct bufobj { */ #define BO_ONWORKLST (1 << 0) /* On syncer work-list */ #define BO_WWAIT (1 << 1) /* Wait for output to complete */ +#define BO_DEAD (1 << 2) /* Dead; only with INVARIANTS */ #define BO_LOCKPTR(bo) (&(bo)->bo_lock) #define BO_LOCK(bo) rw_wlock(BO_LOCKPTR((bo))) From owner-svn-src-stable@FreeBSD.ORG Sat Dec 20 15:49:13 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 648D8DEC; Sat, 20 Dec 2014 15:49: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 5019319C8; Sat, 20 Dec 2014 15:49: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 sBKFnDL6083948; Sat, 20 Dec 2014 15:49:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBKFnDsl083947; Sat, 20 Dec 2014 15:49:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412201549.sBKFnDsl083947@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Dec 2014 15:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275957 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 15:49:13 -0000 Author: kib Date: Sat Dec 20 15:49:12 2014 New Revision: 275957 URL: https://svnweb.freebsd.org/changeset/base/275957 Log: MFC r275744: Only sleep interruptible while waiting for suspension end when filesystem specified VFCF_SBDRY flag, i.e. for NFS. Modified: stable/10/sys/kern/vfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Sat Dec 20 15:46:15 2014 (r275956) +++ stable/10/sys/kern/vfs_vnops.c Sat Dec 20 15:49:12 2014 (r275957) @@ -1579,7 +1579,7 @@ vn_closefile(fp, td) static int vn_start_write_locked(struct mount *mp, int flags) { - int error; + int error, mflags; mtx_assert(MNT_MTX(mp), MA_OWNED); error = 0; @@ -1589,13 +1589,15 @@ vn_start_write_locked(struct mount *mp, */ if ((curthread->td_pflags & TDP_IGNSUSP) == 0 || mp->mnt_susp_owner != curthread) { + mflags = ((mp->mnt_vfc->vfc_flags & VFCF_SBDRY) != 0 ? + (flags & PCATCH) : 0) | (PUSER - 1); while ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0) { if (flags & V_NOWAIT) { error = EWOULDBLOCK; goto unlock; } - error = msleep(&mp->mnt_flag, MNT_MTX(mp), - (PUSER - 1) | (flags & PCATCH), "suspfs", 0); + error = msleep(&mp->mnt_flag, MNT_MTX(mp), mflags, + "suspfs", 0); if (error) goto unlock; } @@ -1705,8 +1707,9 @@ vn_start_secondary_write(vp, mpp, flags) /* * Wait for the suspension to finish. */ - error = msleep(&mp->mnt_flag, MNT_MTX(mp), - (PUSER - 1) | (flags & PCATCH) | PDROP, "suspfs", 0); + error = msleep(&mp->mnt_flag, MNT_MTX(mp), (PUSER - 1) | PDROP | + ((mp->mnt_vfc->vfc_flags & VFCF_SBDRY) != 0 ? (flags & PCATCH) : 0), + "suspfs", 0); vfs_rel(mp); if (error == 0) goto retry;