From owner-svn-src-head@FreeBSD.ORG Sun May 3 07:43:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A911578; Sun, 3 May 2015 07:43: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 78B321ED3; Sun, 3 May 2015 07:43: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 t437hxpW012181; Sun, 3 May 2015 07:43:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t437hxsT012180; Sun, 3 May 2015 07:43:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505030743.t437hxsT012180@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 3 May 2015 07:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282364 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 07:43:59 -0000 Author: mav Date: Sun May 3 07:43:58 2015 New Revision: 282364 URL: https://svnweb.freebsd.org/changeset/base/282364 Log: Implement basic PxTFD.STS.BSY reporting. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Sun May 3 07:18:06 2015 (r282363) +++ head/usr.sbin/bhyve/pci_ahci.c Sun May 3 07:43:58 2015 (r282364) @@ -269,22 +269,24 @@ ahci_write_fis(struct ahci_port *p, enum case FIS_TYPE_REGD2H: offset = 0x40; len = 20; - irq = AHCI_P_IX_DHR; + irq = (fis[1] & (1 << 6)) ? AHCI_P_IX_DHR : 0; break; case FIS_TYPE_SETDEVBITS: offset = 0x58; len = 8; - irq = AHCI_P_IX_SDB; + irq = (fis[1] & (1 << 6)) ? AHCI_P_IX_SDB : 0; break; case FIS_TYPE_PIOSETUP: offset = 0x20; len = 20; - irq = 0; + irq = (fis[1] & (1 << 6)) ? AHCI_P_IX_PS : 0; break; default: WPRINTF("unsupported fis type %d\n", ft); return; } + if (fis[2] & ATA_S_ERROR) + irq |= AHCI_P_IX_TFE; memcpy(p->rfis + offset, fis, len); if (irq) { p->is |= irq; @@ -309,22 +311,23 @@ ahci_write_fis_sdb(struct ahci_port *p, uint8_t error; error = (tfd >> 8) & 0xff; + tfd &= 0x77; memset(fis, 0, sizeof(fis)); fis[0] = FIS_TYPE_SETDEVBITS; fis[1] = (1 << 6); - fis[2] = tfd & 0x77; + fis[2] = tfd; fis[3] = error; if (fis[2] & ATA_S_ERROR) { - p->is |= AHCI_P_IX_TFE; p->err_cfis[0] = slot; - p->err_cfis[2] = tfd & 0x77; + p->err_cfis[2] = tfd; p->err_cfis[3] = error; memcpy(&p->err_cfis[4], cfis + 4, 16); } else { *(uint32_t *)(fis + 4) = (1 << slot); p->sact &= ~(1 << slot); } - p->tfd = tfd; + p->tfd &= ~0x77; + p->tfd |= tfd; ahci_write_fis(p, FIS_TYPE_SETDEVBITS, fis); } @@ -351,7 +354,6 @@ ahci_write_fis_d2h(struct ahci_port *p, fis[12] = cfis[12]; fis[13] = cfis[13]; if (fis[2] & ATA_S_ERROR) { - p->is |= AHCI_P_IX_TFE; p->err_cfis[0] = 0x80; p->err_cfis[2] = tfd & 0xff; p->err_cfis[3] = error; @@ -363,6 +365,21 @@ ahci_write_fis_d2h(struct ahci_port *p, } static void +ahci_write_fis_d2h_ncq(struct ahci_port *p, int slot) +{ + uint8_t fis[20]; + + p->tfd = ATA_S_READY | ATA_S_DSC; + memset(fis, 0, sizeof(fis)); + fis[0] = FIS_TYPE_REGD2H; + fis[1] = 0; /* No interrupt */ + fis[2] = p->tfd; /* Status */ + fis[3] = 0; /* No error */ + p->ci &= ~(1 << slot); + ahci_write_fis(p, FIS_TYPE_REGD2H, fis); +} + +static void ahci_write_reset_fis_d2h(struct ahci_port *p) { uint8_t fis[20]; @@ -589,12 +606,13 @@ ahci_handle_rw(struct ahci_port *p, int struct ahci_cmd_hdr *hdr; uint64_t lba; uint32_t len; - int err, ncq, readop; + int err, first, ncq, readop; prdt = (struct ahci_prdt_entry *)(cfis + 0x80); hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); ncq = 0; readop = 1; + first = (done == 0); if (cfis[2] == ATA_WRITE || cfis[2] == ATA_WRITE48 || cfis[2] == ATA_WRITE_MUL || cfis[2] == ATA_WRITE_MUL48 || @@ -655,14 +673,14 @@ ahci_handle_rw(struct ahci_port *p, int /* Stuff request onto busy list. */ TAILQ_INSERT_HEAD(&p->iobhd, aior, io_blist); + if (ncq && first) + ahci_write_fis_d2h_ncq(p, slot); + if (readop) err = blockif_read(p->bctx, breq); else err = blockif_write(p->bctx, breq); assert(err == 0); - - if (ncq) - p->ci &= ~(1 << slot); } static void @@ -735,15 +753,18 @@ ahci_handle_dsm_trim(struct ahci_port *p uint8_t *entry; uint64_t elba; uint32_t len, elen; - int err; + int err, first, ncq; uint8_t buf[512]; + first = (done == 0); if (cfis[2] == ATA_DATA_SET_MANAGEMENT) { len = (uint16_t)cfis[13] << 8 | cfis[12]; len *= 512; + ncq = 0; } else { /* ATA_SEND_FPDMA_QUEUED */ len = (uint16_t)cfis[11] << 8 | cfis[3]; len *= 512; + ncq = 1; } read_prdt(p, slot, cfis, buf, sizeof(buf)); @@ -793,6 +814,9 @@ next: */ TAILQ_INSERT_HEAD(&p->iobhd, aior, io_blist); + if (ncq && first) + ahci_write_fis_d2h_ncq(p, slot); + err = blockif_delete(p->bctx, breq); assert(err == 0); } @@ -1548,6 +1572,7 @@ static void ahci_handle_cmd(struct ahci_port *p, int slot, uint8_t *cfis) { + p->tfd |= ATA_S_BUSY; switch (cfis[2]) { case ATA_ATA_IDENTIFY: handle_identify(p, slot, cfis); From owner-svn-src-head@FreeBSD.ORG Sun May 3 14:00:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80895A32 for ; Sun, 3 May 2015 14:00:17 +0000 (UTC) Received: from mail-ig0-f181.google.com (mail-ig0-f181.google.com [209.85.213.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 509191FEB for ; Sun, 3 May 2015 14:00:16 +0000 (UTC) Received: by iget9 with SMTP id t9so52311896ige.1 for ; Sun, 03 May 2015 07:00:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=W4s3ZvOr2CldeZx34f73BcdTEcyUmqf4OI8aEan3kfg=; b=Trz5YwV1A2SHnszG6LjnqYrai6vzQYyFHwDyFCE/0ItY6+lP7rCLTUl7RASuPyFUbx hwY7fK1rVNwnhQLdtTnSNmfknHRi8rjw6+ITw7e0Uu56Q9c2KndfzHq+xfA5Alzri0YD D+2BLT8sHm+0/Pyo9z5D2G7r9kmBENS/W0M/6Y/t+Ip6dQs6T4wEAG6tAnCowZnAwsfq gHLbLHclVkAOR1/iz9bRIv9FFyNtbA+fVECuSn/FT0PKhSoVmu0LNfzU6xmnKz0zVcJf KMdbAm23PUQ2MZuScsvaiSfb0WlVbrD23mozU+P/DeJvC6QDGLqw1AaXr5h33GmyPfSG TQig== X-Gm-Message-State: ALoCoQn49ZvmrI8EH2YZOlon2JefL2WwpCUjA/LXIEaD09VIHl4qNXEM73Gam6Z0ZQ3atbx+j3YR MIME-Version: 1.0 X-Received: by 10.107.165.206 with SMTP id o197mr22781111ioe.56.1430661616117; Sun, 03 May 2015 07:00:16 -0700 (PDT) Received: by 10.79.11.6 with HTTP; Sun, 3 May 2015 07:00:15 -0700 (PDT) In-Reply-To: <201505011832.t41IWGSs002284@svn.freebsd.org> References: <201505011832.t41IWGSs002284@svn.freebsd.org> Date: Sun, 3 May 2015 16:00:15 +0200 Message-ID: Subject: Re: svn commit: r282314 - in head: include lib/libc/stdlib From: Oliver Pinter To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 14:00:17 -0000 On 5/1/15, Baptiste Daroussin wrote: > Author: bapt > Date: Fri May 1 18:32:16 2015 > New Revision: 282314 > URL: https://svnweb.freebsd.org/changeset/base/282314 > > Log: > Import reallocarray(3) from OpenBSD > > Add a manpage for it, assign the copyright to the OpenBSD project on it > since it > is mostly copy/paste from OpenBSD manpage. > style(9) fixes > > Differential Revision: https://reviews.freebsd.org/D2420 > Reviewed by: kib > > Added: > head/lib/libc/stdlib/reallocarray.3 (contents, props changed) > head/lib/libc/stdlib/reallocarray.c (contents, props changed) > Modified: > head/include/stdlib.h > head/lib/libc/stdlib/Makefile.inc > head/lib/libc/stdlib/Symbol.map > > Modified: head/include/stdlib.h > ... > +} Hey Bapt! Do you have any plan to MFC these changes to 10-STABLE? > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@FreeBSD.ORG Sun May 3 14:06:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C76DBD3; Sun, 3 May 2015 14:06:40 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33AAC10B8; Sun, 3 May 2015 14:06:40 +0000 (UTC) Received: by widdi4 with SMTP id di4so87110799wid.0; Sun, 03 May 2015 07:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=3c/SosCoAzTH9922UMfhDW6c8uEMMRvSF4f6XqseyRM=; b=RqQ12Jhbfrl8xZz4AHTF7j224RlOdyeGLhk3+PrvcIDkpCmGwhjp4E2/T0rstgFZ/u hdPkLzePVlh77kN9xdaICzdsT9KZRvEDeXSqZSRD1ZVUR30XprQKILWberxYEMcyPXYr fwpUkWEMWq/CI87mi2dYiCFeGxhB5k6IZ6Xbz8H+YqsORQiMxg5Tibq1wICKhDontXxt Kwiq5nuBCwNO+8nq47yZ+Uymx1AxR04T3t5nfBpq2t4mBdjzsLZagqvn3+YFiDUlC78u czD6Z7urE+VmLSAyzXxxl9eqHnk2g1tuOEg5QTX7lSZanI+2gMDIhH9e/g4NDLrJSYoO cmUA== X-Received: by 10.194.92.137 with SMTP id cm9mr34262656wjb.133.1430661998469; Sun, 03 May 2015 07:06:38 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id l1sm6771170wiy.20.2015.05.03.07.06.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 May 2015 07:06:36 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 3 May 2015 16:06:34 +0200 From: Baptiste Daroussin To: Oliver Pinter Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282314 - in head: include lib/libc/stdlib Message-ID: <20150503140634.GA80213@ivaldir.etoilebsd.net> References: <201505011832.t41IWGSs002284@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 14:06:40 -0000 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 03, 2015 at 04:00:15PM +0200, Oliver Pinter wrote: > On 5/1/15, Baptiste Daroussin wrote: > > Author: bapt > > Date: Fri May 1 18:32:16 2015 > > New Revision: 282314 > > URL: https://svnweb.freebsd.org/changeset/base/282314 > > > > Log: > > Import reallocarray(3) from OpenBSD > > > > Add a manpage for it, assign the copyright to the OpenBSD project on = it > > since it > > is mostly copy/paste from OpenBSD manpage. > > style(9) fixes > > > > Differential Revision: https://reviews.freebsd.org/D2420 > > Reviewed by: kib > > > > Added: > > head/lib/libc/stdlib/reallocarray.3 (contents, props changed) > > head/lib/libc/stdlib/reallocarray.c (contents, props changed) > > Modified: > > head/include/stdlib.h > > head/lib/libc/stdlib/Makefile.inc > > head/lib/libc/stdlib/Symbol.map > > > > Modified: head/include/stdlib.h > > ... > > +} >=20 > Hey Bapt! >=20 > Do you have any plan to MFC these changes to 10-STABLE? I had no plan to but you are the 5th one to ask me about that :) So yes I may MFC that in a couple of weeks. Best regards, Bapt --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVGK2oACgkQ8kTtMUmk6EzhfQCbB1q8aYty9p3zmrxDlfQhRrh5 ZWMAoI6BMhrNYRb7hhjqD5QHUrFi9pzZ =p8pF -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs-- From owner-svn-src-head@FreeBSD.ORG Sun May 3 14:25:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3091C95 for ; Sun, 3 May 2015 14:25:47 +0000 (UTC) Received: from mail-ig0-f177.google.com (mail-ig0-f177.google.com [209.85.213.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 013371283 for ; Sun, 3 May 2015 14:25:46 +0000 (UTC) Received: by igblo3 with SMTP id lo3so67472111igb.1 for ; Sun, 03 May 2015 07:25:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=LfrK8sE09hT/VcUinpoaejBQqACjilxPVSW9Ehi4ptY=; b=SNpEUckWJxK4oM4nGYar178Qp0jNECeNxCOM1jF+c06eeQjPEPVQyw0wgcC88E+pJ1 EwBdoXKCTtoJ2PJRisMhcISDOc9PegE6s9q4yyTW+AXG/51ELFbEPBzAsl2GTLxZTl3f CvP/36Uv1WQn4BiX6Gbwxe5bOU148qoWgmNGYm3jUNv1nTcGfwWDoQuP35eK/Pk2Wkk2 aejMFvM8c0R3flcxESBwKfE7tmCW4O7wAqmzK+ct2g3ildiER8GWo2XzNP8D2Jv4X2Yy hDIF8z/A/JnKS6MZhsbSPfh9DvR4W4MT3oFE8OW/zk56/2xmxk3stJ1Xlhvo+bvAoRZ7 IC0A== X-Gm-Message-State: ALoCoQmMwQB5j/fOrCtUF5FzWTGsGhfSoI7rO4MBl0cSqV9QKIDdmvk/VkvvfsAwI/vm4puPLEj7 MIME-Version: 1.0 X-Received: by 10.50.23.114 with SMTP id l18mr8145064igf.26.1430663139853; Sun, 03 May 2015 07:25:39 -0700 (PDT) Received: by 10.79.11.6 with HTTP; Sun, 3 May 2015 07:25:39 -0700 (PDT) In-Reply-To: <20150503140634.GA80213@ivaldir.etoilebsd.net> References: <201505011832.t41IWGSs002284@svn.freebsd.org> <20150503140634.GA80213@ivaldir.etoilebsd.net> Date: Sun, 3 May 2015 16:25:39 +0200 Message-ID: Subject: Re: svn commit: r282314 - in head: include lib/libc/stdlib From: Oliver Pinter To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 14:25:47 -0000 On 5/3/15, Baptiste Daroussin wrote: > On Sun, May 03, 2015 at 04:00:15PM +0200, Oliver Pinter wrote: >> On 5/1/15, Baptiste Daroussin wrote: >> > Author: bapt >> > Date: Fri May 1 18:32:16 2015 >> > New Revision: 282314 >> > URL: https://svnweb.freebsd.org/changeset/base/282314 >> > >> > Log: >> > Import reallocarray(3) from OpenBSD >> > >> > Add a manpage for it, assign the copyright to the OpenBSD project on >> > it >> > since it >> > is mostly copy/paste from OpenBSD manpage. >> > style(9) fixes >> > >> > Differential Revision: https://reviews.freebsd.org/D2420 >> > Reviewed by: kib >> > >> > Added: >> > head/lib/libc/stdlib/reallocarray.3 (contents, props changed) >> > head/lib/libc/stdlib/reallocarray.c (contents, props changed) >> > Modified: >> > head/include/stdlib.h >> > head/lib/libc/stdlib/Makefile.inc >> > head/lib/libc/stdlib/Symbol.map >> > >> > Modified: head/include/stdlib.h >> > ... >> > +} >> >> Hey Bapt! >> >> Do you have any plan to MFC these changes to 10-STABLE? > > I had no plan to but you are the 5th one to ask me about that :) > So yes I may MFC that in a couple of weeks. > Cool! Thanks! > Best regards, > Bapt > From owner-svn-src-head@FreeBSD.ORG Sun May 3 20:56:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CAFCF8F; Sun, 3 May 2015 20:56: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 610FA197A; Sun, 3 May 2015 20:56: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 t43KuYxR014189; Sun, 3 May 2015 20:56:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43KuXrG014186; Sun, 3 May 2015 20:56:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032056.t43KuXrG014186@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 20:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282369 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 20:56:34 -0000 Author: adrian Date: Sun May 3 20:56:33 2015 New Revision: 282369 URL: https://svnweb.freebsd.org/changeset/base/282369 Log: Retry twice at the same rate. Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 19:30:11 2015 (r282368) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 20:56:33 2015 (r282369) @@ -1957,7 +1957,7 @@ wpi_tx_done(struct wpi_softc *sc, struct struct ieee80211vap *vap; struct ieee80211com *ic; uint32_t status = le32toh(stat->status); - int ackfailcnt = stat->ackfailcnt / 2; /* wpi_mrr_setup() */ + int ackfailcnt = stat->ackfailcnt / WPI_NTRIES_DEFAULT; KASSERT(data->ni != NULL, ("no node")); KASSERT(data->m != NULL, ("no mbuf")); @@ -1966,7 +1966,7 @@ wpi_tx_done(struct wpi_softc *sc, struct DPRINTF(sc, WPI_DEBUG_XMIT, "%s: " "qid %d idx %d retries %d btkillcnt %d rate %x duration %d " - "status %x\n", __func__, desc->qid, desc->idx, ackfailcnt, + "status %x\n", __func__, desc->qid, desc->idx, stat->ackfailcnt, stat->btkillcnt, stat->rate, le32toh(stat->duration), status); /* Unmap and free mbuf. */ @@ -3125,8 +3125,8 @@ wpi_mrr_setup(struct wpi_softc *sc) /* Fallback to the immediate lower CCK rate (if any.) */ mrr.rates[i].next = (i == WPI_RIDX_CCK1) ? WPI_RIDX_CCK1 : i - 1; - /* Try one time at this rate before falling back to "next". */ - mrr.rates[i].ntries = 1; + /* Try twice at this rate before falling back to "next". */ + mrr.rates[i].ntries = WPI_NTRIES_DEFAULT; } /* OFDM rates (not used with 802.11b). */ for (i = WPI_RIDX_OFDM6; i <= WPI_RIDX_OFDM54; i++) { @@ -3138,8 +3138,8 @@ wpi_mrr_setup(struct wpi_softc *sc) ((ic->ic_curmode == IEEE80211_MODE_11A) ? WPI_RIDX_OFDM6 : WPI_RIDX_CCK2) : i - 1; - /* Try one time at this rate before falling back to "next". */ - mrr.rates[i].ntries = 1; + /* Try twice at this rate before falling back to "next". */ + mrr.rates[i].ntries = WPI_NTRIES_DEFAULT; } /* Setup MRR for control frames. */ mrr.which = htole32(WPI_MRR_CTL); Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sun May 3 19:30:11 2015 (r282368) +++ head/sys/dev/wpi/if_wpireg.h Sun May 3 20:56:33 2015 (r282369) @@ -547,6 +547,8 @@ struct wpi_mrr_setup { uint8_t plcp; uint8_t flags; uint8_t ntries; +#define WPI_NTRIES_DEFAULT 2 + uint8_t next; } __packed rates[WPI_RIDX_MAX + 1]; } __packed; From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:10:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83FB3154; Sun, 3 May 2015 22:10: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 7286B10CC; Sun, 3 May 2015 22:10: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 t43MATHW050149; Sun, 3 May 2015 22:10:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MATKb050148; Sun, 3 May 2015 22:10:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032210.t43MATKb050148@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282370 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:10:29 -0000 Author: adrian Date: Sun May 3 22:10:28 2015 New Revision: 282370 URL: https://svnweb.freebsd.org/changeset/base/282370 Log: Remove this; it's currently a no-op. History note: it's good to document what the driver expects like this even if it's currently a no-op. Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 20:56:33 2015 (r282369) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:10:28 2015 (r282370) @@ -4274,8 +4274,6 @@ wpi_run(struct wpi_softc *sc, struct iee sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); - /* Short preamble and slot time are negotiated when associating. */ - sc->rxon.flags &= ~htole32(WPI_RXON_SHPREAMBLE | WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHSLOT) sc->rxon.flags |= htole32(WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:13:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B51238C; Sun, 3 May 2015 22: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 794DF1183; Sun, 3 May 2015 22: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 t43MDu0l053837; Sun, 3 May 2015 22:13:56 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MDuh9053836; Sun, 3 May 2015 22:13:56 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032213.t43MDuh9053836@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282371 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:13:56 -0000 Author: adrian Date: Sun May 3 22:13:55 2015 New Revision: 282371 URL: https://svnweb.freebsd.org/changeset/base/282371 Log: Add a few local variables to improve readability. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:10:28 2015 (r282370) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:13:55 2015 (r282371) @@ -3710,6 +3710,7 @@ wpi_config(struct wpi_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct ieee80211_channel *c = ic->ic_curchan; uint32_t flags; int error; @@ -3734,9 +3735,9 @@ wpi_config(struct wpi_softc *sc) IEEE80211_ADDR_COPY(sc->rxon.myaddr, vap->iv_myaddr); /* Set default channel. */ - sc->rxon.chan = ieee80211_chan2ieee(ic, ic->ic_curchan); + sc->rxon.chan = ieee80211_chan2ieee(ic, c); sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); - if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) + if (IEEE80211_IS_CHAN_2GHZ(c)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); sc->rxon.filter = WPI_FILTER_MULTICAST; @@ -4044,6 +4045,7 @@ wpi_auth(struct wpi_softc *sc, struct ie { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni = vap->iv_bss; + struct ieee80211_channel *c = ni->ni_chan; int error; WPI_RXON_LOCK(sc); @@ -4054,18 +4056,18 @@ wpi_auth(struct wpi_softc *sc, struct ie sc->rxon.associd = 0; sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid); - sc->rxon.chan = ieee80211_chan2ieee(ic, ni->ni_chan); + sc->rxon.chan = ieee80211_chan2ieee(ic, c); sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); - if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + if (IEEE80211_IS_CHAN_2GHZ(c)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); if (ic->ic_flags & IEEE80211_F_SHSLOT) sc->rxon.flags |= htole32(WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) sc->rxon.flags |= htole32(WPI_RXON_SHPREAMBLE); - if (IEEE80211_IS_CHAN_A(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_A(c)) { sc->rxon.cck_mask = 0; sc->rxon.ofdm_mask = 0x15; - } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) { + } else if (IEEE80211_IS_CHAN_B(c)) { sc->rxon.cck_mask = 0x03; sc->rxon.ofdm_mask = 0; } else { @@ -4243,6 +4245,7 @@ wpi_run(struct wpi_softc *sc, struct iee { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni = vap->iv_bss; + struct ieee80211_channel *c = ni->ni_chan; int error; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -4254,7 +4257,7 @@ wpi_run(struct wpi_softc *sc, struct iee } /* XXX kernel panic workaround */ - if (ni->ni_chan == IEEE80211_CHAN_ANYC) { + if (c == IEEE80211_CHAN_ANYC) { device_printf(sc->sc_dev, "%s: incomplete configuration\n", __func__); return EINVAL; @@ -4270,18 +4273,18 @@ wpi_run(struct wpi_softc *sc, struct iee WPI_RXON_LOCK(sc); IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid); sc->rxon.associd = htole16(IEEE80211_NODE_AID(ni)); - sc->rxon.chan = ieee80211_chan2ieee(ic, ni->ni_chan); + sc->rxon.chan = ieee80211_chan2ieee(ic, c); sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); - if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + if (IEEE80211_IS_CHAN_2GHZ(c)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); if (ic->ic_flags & IEEE80211_F_SHSLOT) sc->rxon.flags |= htole32(WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) sc->rxon.flags |= htole32(WPI_RXON_SHPREAMBLE); - if (IEEE80211_IS_CHAN_A(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_A(c)) { sc->rxon.cck_mask = 0; sc->rxon.ofdm_mask = 0x15; - } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) { + } else if (IEEE80211_IS_CHAN_B(c)) { sc->rxon.cck_mask = 0x03; sc->rxon.ofdm_mask = 0; } else { From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:28:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 438F661C; Sun, 3 May 2015 22:28:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 188FE1283; Sun, 3 May 2015 22:28: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 t43MSggj059395; Sun, 3 May 2015 22:28:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MSg1P059394; Sun, 3 May 2015 22:28:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032228.t43MSg1P059394@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282372 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:28:43 -0000 Author: adrian Date: Sun May 3 22:28:42 2015 New Revision: 282372 URL: https://svnweb.freebsd.org/changeset/base/282372 Log: Remove old iv_bss entry from the node table This may happen on RUN -> SCAN -> RUN -> SCAN state transition: 1. RUN -> SCAN: in ieee80211_sta_join1(): iv_bss will be moved to obss, refcnt will be reduced by 2 (default minimum). Now, if old iv_bss have some extra references (for example, from unacknowledged probe responses), it will not be freed and will stay in the node table. 2. SCAN -> RUN. 3. If old iv_bss will not be deleted by the time when the next RUN -> SCAN state transition occurs, then sta_leave() will reduce it's reference counter once more. As a result, two last users will free it -> this will lead to kernel panic. In this patch old iv_bss entry is explicitly removed from the node table in ieee80211_sta_join1() (as a result, it will not be processed by sta_leave()). PR: kern/199676 Differential Revision: Andriy Voskoboinyk Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sun May 3 22:13:55 2015 (r282371) +++ head/sys/net80211/ieee80211_node.c Sun May 3 22:28:42 2015 (r282372) @@ -93,6 +93,8 @@ static void node_getmimoinfo(const struc static void _ieee80211_free_node(struct ieee80211_node *); +static void node_reclaim(struct ieee80211_node_table *nt, + struct ieee80211_node *ni); static void ieee80211_node_table_init(struct ieee80211com *ic, struct ieee80211_node_table *nt, const char *name, int inact, int keymaxix); @@ -719,9 +721,15 @@ ieee80211_sta_join1(struct ieee80211_nod IEEE80211_ADDR_EQ(obss->ni_macaddr, selbs->ni_macaddr)); vap->iv_bss = selbs; /* NB: caller assumed to bump refcnt */ if (obss != NULL) { + struct ieee80211_node_table *nt = obss->ni_table; + copy_bss(selbs, obss); ieee80211_node_decref(obss); /* iv_bss reference */ - ieee80211_free_node(obss); /* station table reference */ + + IEEE80211_NODE_LOCK(nt); + node_reclaim(nt, obss); /* station table reference */ + IEEE80211_NODE_UNLOCK(nt); + obss = NULL; /* NB: guard against later use */ } From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:30:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 657D77B6; Sun, 3 May 2015 22:30: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 541EE12BA; Sun, 3 May 2015 22:30: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 t43MUCGU059809; Sun, 3 May 2015 22:30:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MUC1Z059808; Sun, 3 May 2015 22:30:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032230.t43MUC1Z059808@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282373 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:30:12 -0000 Author: adrian Date: Sun May 3 22:30:11 2015 New Revision: 282373 URL: https://svnweb.freebsd.org/changeset/base/282373 Log: Remove workaround for bug 199676. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:28:42 2015 (r282372) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:30:11 2015 (r282373) @@ -2705,9 +2705,6 @@ wpi_tx_data(struct wpi_softc *sc, struct tx->id = wn->id; } - if (type != IEEE80211_FC0_TYPE_MGT) - tx->data_ntries = tp->maxretry; - if (k != NULL && !swcrypt) { switch (k->wk_cipher->ic_cipher) { case IEEE80211_CIPHER_AES_CCM: @@ -2729,6 +2726,7 @@ wpi_tx_data(struct wpi_softc *sc, struct tx->ofdm_mask = 0xff; tx->cck_mask = 0x0f; tx->rts_ntries = 7; + tx->data_ntries = tp->maxretry; tx_data.ni = ni; tx_data.m = m; From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:32:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93559ABC; Sun, 3 May 2015 22:32: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 81FA813A9; Sun, 3 May 2015 22:32: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 t43MWkDK063728; Sun, 3 May 2015 22:32:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MWk6x063727; Sun, 3 May 2015 22:32:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032232.t43MWk6x063727@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282374 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:32:46 -0000 Author: adrian Date: Sun May 3 22:32:45 2015 New Revision: 282374 URL: https://svnweb.freebsd.org/changeset/base/282374 Log: Fix KASSERT statements in if_wpi_debug.h PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi_debug.h Modified: head/sys/dev/wpi/if_wpi_debug.h ============================================================================== --- head/sys/dev/wpi/if_wpi_debug.h Sun May 3 22:30:11 2015 (r282373) +++ head/sys/dev/wpi/if_wpi_debug.h Sun May 3 22:32:45 2015 (r282374) @@ -90,7 +90,6 @@ static const char *wpi_cmd_str(int cmd) WPI_DESC(WPI_CMD_BT_COEX); default: - KASSERT(1, ("Unknown Command: %d\n", cmd)); return "UNKNOWN CMD"; } } @@ -117,7 +116,7 @@ static const char *wpi_get_csr_string(in WPI_DESC(WPI_ANA_PLL); WPI_DESC(WPI_DBG_HPET_MEM); default: - KASSERT(1, ("Unknown CSR: %d\n", csr)); + KASSERT(0, ("Unknown CSR: %d\n", csr)); return "UNKNOWN CSR"; } } @@ -130,7 +129,7 @@ static const char *wpi_get_prph_string(i WPI_DESC(WPI_APMG_PCI_STT); WPI_DESC(WPI_APMG_RFKILL); default: - KASSERT(1, ("Unknown register: %d\n", prph)); + KASSERT(0, ("Unknown register: %d\n", prph)); return "UNKNOWN PRPH"; } } From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:34:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39FE9C51; Sun, 3 May 2015 22:34: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 2804513C6; Sun, 3 May 2015 22:34: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 t43MYXAh064045; Sun, 3 May 2015 22:34:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MYXS6064044; Sun, 3 May 2015 22:34:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032234.t43MYXS6064044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282375 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:34:33 -0000 Author: adrian Date: Sun May 3 22:34:32 2015 New Revision: 282375 URL: https://svnweb.freebsd.org/changeset/base/282375 Log: Add wpi_check_bss_filter() PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:32:45 2015 (r282374) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:34:32 2015 (r282375) @@ -1651,6 +1651,12 @@ wpi_node_free(struct ieee80211_node *ni) sc->sc_node_free(ni); } +static __inline int +wpi_check_bss_filter(struct wpi_softc *sc) +{ + return (sc->rxon.filter & htole32(WPI_FILTER_BSS)) != 0; +} + /** * Called by net80211 when ever there is a change to 80211 state machine */ @@ -1681,7 +1687,7 @@ wpi_newstate(struct ieee80211vap *vap, e switch (nstate) { case IEEE80211_S_SCAN: WPI_RXON_LOCK(sc); - if ((sc->rxon.filter & htole32(WPI_FILTER_BSS)) && + if (wpi_check_bss_filter(sc) != 0 && vap->iv_opmode != IEEE80211_M_STA) { sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { @@ -1749,7 +1755,7 @@ wpi_calib_timeout(void *arg) { struct wpi_softc *sc = arg; - if (!(sc->rxon.filter & htole32(WPI_FILTER_BSS))) + if (wpi_check_bss_filter(sc) == 0) return; wpi_power_calibration(sc); @@ -3642,7 +3648,7 @@ wpi_send_rxon(struct wpi_softc *sc, int if (async) WPI_RXON_LOCK_ASSERT(sc); - if (assoc && (sc->rxon.filter & htole32(WPI_FILTER_BSS))) { + if (assoc && wpi_check_bss_filter(sc) != 0) { struct wpi_assoc rxon_assoc; rxon_assoc.flags = sc->rxon.flags; From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:43:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD5E4EB7; Sun, 3 May 2015 22:43: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 81B68150F; Sun, 3 May 2015 22:43: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 t43MhkRC068849; Sun, 3 May 2015 22:43:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MhkfO068847; Sun, 3 May 2015 22:43:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032243.t43MhkfO068847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282376 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:43:46 -0000 Author: adrian Date: Sun May 3 22:43:45 2015 New Revision: 282376 URL: https://svnweb.freebsd.org/changeset/base/282376 Log: Use another workaround for scanning. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:34:32 2015 (r282375) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:43:45 2015 (r282376) @@ -516,7 +516,6 @@ wpi_attach(device_t dev) ic->ic_scan_start = wpi_scan_start; ic->ic_scan_end = wpi_scan_end; ic->ic_set_channel = wpi_set_channel; - sc->sc_scan_curchan = ic->ic_scan_curchan; ic->ic_scan_curchan = wpi_scan_curchan; ic->ic_scan_mindwell = wpi_scan_mindwell; ic->ic_setregdomain = wpi_setregdomain; @@ -4020,6 +4019,20 @@ wpi_scan(struct wpi_softc *sc, struct ie chan->chan, IEEE80211_IS_CHAN_PASSIVE(c)); hdr->nchan++; + + if (hdr->nchan == 1 && sc->rxon.chan == chan->chan) { + /* XXX Force probe request transmission. */ + memcpy(chan + 1, chan, sizeof (struct wpi_scan_chan)); + + chan++; + + /* Reduce unnecessary delay. */ + chan->flags = 0; + chan->passive = chan->active = hdr->quiet_time; + + hdr->nchan++; + } + chan++; buflen = (uint8_t *)chan - buf; @@ -5400,16 +5413,10 @@ wpi_scan_curchan(struct ieee80211_scan_s int error; WPI_RXON_LOCK(sc); - if (sc->rxon.chan != ieee80211_chan2ieee(ic, ic->ic_curchan)) { - error = wpi_scan(sc, ic->ic_curchan); - WPI_RXON_UNLOCK(sc); - if (error != 0) - ieee80211_cancel_scan(vap); - } else { - WPI_RXON_UNLOCK(sc); - /* Send probe request when associated. */ - sc->sc_scan_curchan(ss, maxdwell); - } + error = wpi_scan(sc, ic->ic_curchan); + WPI_RXON_UNLOCK(sc); + if (error != 0) + ieee80211_cancel_scan(vap); } /** Modified: head/sys/dev/wpi/if_wpivar.h ============================================================================== --- head/sys/dev/wpi/if_wpivar.h Sun May 3 22:34:32 2015 (r282375) +++ head/sys/dev/wpi/if_wpivar.h Sun May 3 22:43:45 2015 (r282376) @@ -210,8 +210,6 @@ struct wpi_softc { struct mtx nt_mtx; void (*sc_node_free)(struct ieee80211_node *); - void (*sc_scan_curchan)(struct ieee80211_scan_state *, - unsigned long); struct wpi_rx_radiotap_header sc_rxtap; struct wpi_tx_radiotap_header sc_txtap; From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:47:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB8D6B7; Sun, 3 May 2015 22:47: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 D98A81531; Sun, 3 May 2015 22:47:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43Ml6ku069407; Sun, 3 May 2015 22:47:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43Ml6Nq069406; Sun, 3 May 2015 22:47:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032247.t43Ml6Nq069406@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282377 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:47:07 -0000 Author: adrian Date: Sun May 3 22:47:06 2015 New Revision: 282377 URL: https://svnweb.freebsd.org/changeset/base/282377 Log: Move radiooff_task to the internal taskqueue. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:43:45 2015 (r282376) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:47:06 2015 (r282377) @@ -688,8 +688,6 @@ wpi_detach(device_t dev) if (ifp != NULL) { ic = ifp->if_l2com; - ieee80211_draintask(ic, &sc->sc_reinittask); - ieee80211_draintask(ic, &sc->sc_radiooff_task); ieee80211_draintask(ic, &sc->sc_radioon_task); ieee80211_draintask(ic, &sc->sc_start_task); @@ -2168,7 +2166,8 @@ wpi_notif_intr(struct wpi_softc *sc) WPI_NT_LOCK(sc); wpi_clear_node_table(sc); WPI_NT_UNLOCK(sc); - ieee80211_runtask(ic, &sc->sc_radiooff_task); + taskqueue_enqueue(sc->sc_tq, + &sc->sc_radiooff_task); return; } break; From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:49:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 574A9253; Sun, 3 May 2015 22:49: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 2BEBE1546; Sun, 3 May 2015 22:49: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 t43MnmWV069805; Sun, 3 May 2015 22:49:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43Mnl8s069803; Sun, 3 May 2015 22:49:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032249.t43Mnl8s069803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282378 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:49:48 -0000 Author: adrian Date: Sun May 3 22:49:47 2015 New Revision: 282378 URL: https://svnweb.freebsd.org/changeset/base/282378 Log: Add TX status codes (obtained from iwlegacy) PR: kern/197143 Differential Revision: Andriy Voskoboinyk Obtained from: Linux drivers/net/wireless/iwlegacy Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:47:06 2015 (r282377) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:49:47 2015 (r282378) @@ -1983,7 +1983,7 @@ wpi_tx_done(struct wpi_softc *sc, struct /* * Update rate control statistics for the node. */ - if ((status & 0xff) != 1) { + if (status & WPI_TX_STATUS_FAIL) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ieee80211_ratectl_tx_complete(vap, ni, IEEE80211_RATECTL_TX_FAILURE, &ackfailcnt, NULL); @@ -1993,7 +1993,7 @@ wpi_tx_done(struct wpi_softc *sc, struct IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL); } - ieee80211_tx_complete(ni, m, (status & 0xff) != 1); + ieee80211_tx_complete(ni, m, (status & WPI_TX_STATUS_FAIL) != 0); WPI_TXQ_STATE_LOCK(sc); ring->queued -= 1; Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sun May 3 22:47:06 2015 (r282377) +++ head/sys/dev/wpi/if_wpireg.h Sun May 3 22:49:47 2015 (r282378) @@ -256,6 +256,26 @@ struct wpi_tx_stat { uint8_t rate; uint32_t duration; uint32_t status; +#define WPI_TX_STATUS_SUCCESS 0x01 +#define WPI_TX_STATUS_DIRECT_DONE 0x02 +#define WPI_TX_STATUS_FAIL 0x80 +#define WPI_TX_STATUS_FAIL_SHORT_LIMIT 0x82 +#define WPI_TX_STATUS_FAIL_LONG_LIMIT 0x83 +#define WPI_TX_STATUS_FAIL_FIFO_UNDERRUN 0x84 +#define WPI_TX_STATUS_FAIL_MGMNT_ABORT 0x85 +#define WPI_TX_STATUS_FAIL_NEXT_FRAG 0x86 +#define WPI_TX_STATUS_FAIL_LIFE_EXPIRE 0x87 +#define WPI_TX_STATUS_FAIL_NODE_PS 0x88 +#define WPI_TX_STATUS_FAIL_ABORTED 0x89 +#define WPI_TX_STATUS_FAIL_BT_RETRY 0x8a +#define WPI_TX_STATUS_FAIL_NODE_INVALID 0x8b +#define WPI_TX_STATUS_FAIL_FRAG_DROPPED 0x8c +#define WPI_TX_STATUS_FAIL_TID_DISABLE 0x8d +#define WPI_TX_STATUS_FAIL_FRAME_FLUSHED 0x8e +#define WPI_TX_STATUS_FAIL_INSUFFICIENT_CF_POLL 0x8f +#define WPI_TX_STATUS_FAIL_TX_LOCKED 0x90 +#define WPI_TX_STATUS_FAIL_NO_BEACON_ON_RADAR 0x91 + } __packed; struct wpi_rx_desc { From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:51:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C28F23C1; Sun, 3 May 2015 22:51: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 B13E0160E; Sun, 3 May 2015 22:51: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 t43MpUOA071792; Sun, 3 May 2015 22:51:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MpUlE071791; Sun, 3 May 2015 22:51:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201505032251.t43MpUlE071791@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 May 2015 22:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282379 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:51:30 -0000 Author: imp Date: Sun May 3 22:51:29 2015 New Revision: 282379 URL: https://svnweb.freebsd.org/changeset/base/282379 Log: When merging the floating point type attribute, and reporting an error when things don't match, report which file has them and which one doesn't correctly. Differential Revision: https://reviews.freebsd.org/D2400 Modified: head/contrib/binutils/bfd/elf32-arm.c Modified: head/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- head/contrib/binutils/bfd/elf32-arm.c Sun May 3 22:49:47 2015 (r282378) +++ head/contrib/binutils/bfd/elf32-arm.c Sun May 3 22:51:29 2015 (r282379) @@ -6794,9 +6794,22 @@ elf32_arm_merge_eabi_attributes (bfd *ib out_attr[Tag_ABI_VFP_args].i = in_attr[Tag_ABI_VFP_args].i; else if (in_attr[Tag_ABI_FP_number_model].i != 0) { + bfd *hasbfd, *hasnotbfd; + + if (in_attr[Tag_ABI_VFP_args].i) + { + hasbfd = ibfd; + hasnotbfd = obfd; + } + else + { + hasbfd = obfd; + hasnotbfd = ibfd; + } + _bfd_error_handler (_("ERROR: %B uses VFP register arguments, %B does not"), - ibfd, obfd); + hasbfd, hasnotbfd); return FALSE; } } From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:51:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17DBB4FF; Sun, 3 May 2015 22:51: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 066681611; Sun, 3 May 2015 22:51: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 t43MpgTw071858; Sun, 3 May 2015 22:51:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MpgTl071857; Sun, 3 May 2015 22:51:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201505032251.t43MpgTl071857@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 May 2015 22:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282380 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:51:43 -0000 Author: imp Date: Sun May 3 22:51:42 2015 New Revision: 282380 URL: https://svnweb.freebsd.org/changeset/base/282380 Log: For eabi 5 (what FreeBSD uses), be sure to tag all executables and shared libraries as either SOFT or HARD float to comply with the EABI standard. Differential Revision: https://reviews.freebsd.org/D2401 Modified: head/contrib/binutils/bfd/elf32-arm.c Modified: head/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- head/contrib/binutils/bfd/elf32-arm.c Sun May 3 22:51:29 2015 (r282379) +++ head/contrib/binutils/bfd/elf32-arm.c Sun May 3 22:51:42 2015 (r282380) @@ -9372,6 +9372,16 @@ elf32_arm_post_process_headers (bfd * ab if (globals->byteswap_code) i_ehdrp->e_flags |= EF_ARM_BE8; } + + /* + * For EABI 5, we have to tag dynamic binaries and execs as either + * soft float or hard float. + */ + if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_VER5 && + (i_ehdrp->e_type == ET_DYN || i_ehdrp->e_type == ET_EXEC)) + i_ehdrp->e_flags |= + bfd_elf_get_obj_attr_int (abfd, OBJ_ATTR_PROC, Tag_ABI_VFP_args) ? + EF_ARM_VFP_FLOAT : EF_ARM_SOFT_FLOAT; } static enum elf_reloc_type_class From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:55:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 453BA68F; Sun, 3 May 2015 22:55:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33B8E163D; Sun, 3 May 2015 22:55: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 t43Mt7ll074314; Sun, 3 May 2015 22:55:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43Mt7Jh074313; Sun, 3 May 2015 22:55:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032255.t43Mt7Jh074313@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282381 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:55:07 -0000 Author: adrian Date: Sun May 3 22:55:06 2015 New Revision: 282381 URL: https://svnweb.freebsd.org/changeset/base/282381 Log: Turn off led when leaving RUN state. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:51:42 2015 (r282380) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:55:06 2015 (r282381) @@ -1672,13 +1672,15 @@ wpi_newstate(struct ieee80211vap *vap, e ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]); - if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) { + if (vap->iv_state == IEEE80211_S_RUN && nstate < IEEE80211_S_RUN) { if ((error = wpi_set_pslevel(sc, 0, 0, 1)) != 0) { device_printf(sc->sc_dev, "%s: could not set power saving level\n", __func__); return error; } + + wpi_set_led(sc, WPI_LED_LINK, 1, 0); } switch (nstate) { From owner-svn-src-head@FreeBSD.ORG Sun May 3 22:56:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92D89892; Sun, 3 May 2015 22:56: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 812A8165B; Sun, 3 May 2015 22:56: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 t43Mubdd074570; Sun, 3 May 2015 22:56:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MubkL074567; Sun, 3 May 2015 22:56:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032256.t43MubkL074567@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282382 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:56:37 -0000 Author: adrian Date: Sun May 3 22:56:36 2015 New Revision: 282382 URL: https://svnweb.freebsd.org/changeset/base/282382 Log: Fix active/passive dwell calculation. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:55:06 2015 (r282381) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:56:36 2015 (r282382) @@ -3818,7 +3818,7 @@ wpi_get_active_dwell_time(struct wpi_sof } /* - * Limit the total dwell time to 85% of the beacon interval. + * Limit the total dwell time. * * Returns the dwell time in milliseconds. */ @@ -3843,11 +3843,11 @@ wpi_limit_dwell(struct wpi_softc *sc, ui if (bintval > 0) { DPRINTF(sc, WPI_DEBUG_SCAN, "%s: bintval=%d\n", __func__, bintval); - return (MIN(WPI_PASSIVE_DWELL_BASE, ((bintval * 85) / 100))); + return (MIN(dwell_time, bintval - WPI_CHANNEL_TUNE_TIME * 2)); } /* No association context? Default. */ - return (WPI_PASSIVE_DWELL_BASE); + return dwell_time; } static uint16_t @@ -3882,7 +3882,7 @@ wpi_scan(struct wpi_softc *sc, struct ie struct ieee80211_rateset *rs; uint16_t dwell_active, dwell_passive; uint8_t *buf, *frm; - int buflen, error, i, nssid; + int bgscan, bintval, buflen, error, i, nssid; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -3893,10 +3893,16 @@ wpi_scan(struct wpi_softc *sc, struct ie if (callout_pending(&sc->scan_timeout)) { device_printf(sc->sc_dev, "%s: called whilst scanning!\n", __func__); + error = EAGAIN; + goto fail; + } - DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END_ERR, __func__); - - return (EAGAIN); + bgscan = wpi_check_bss_filter(sc); + bintval = vap->iv_bss->ni_intval; + if (bgscan != 0 && + bintval < WPI_QUIET_TIME_DEFAULT + WPI_CHANNEL_TUNE_TIME * 2) { + error = EOPNOTSUPP; + goto fail; } buf = malloc(WPI_SCAN_MAXSZ, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -3913,8 +3919,8 @@ wpi_scan(struct wpi_softc *sc, struct ie * Move to the next channel if no packets are received within 10 msecs * after sending the probe request. */ - hdr->quiet_time = htole16(10); /* timeout in milliseconds */ - hdr->quiet_threshold = htole16(1); /* min # of packets */ + hdr->quiet_time = htole16(WPI_QUIET_TIME_DEFAULT); + hdr->quiet_threshold = htole16(1); /* * Max needs to be greater than active and passive and quiet! * It's also in microseconds! @@ -4003,8 +4009,8 @@ wpi_scan(struct wpi_softc *sc, struct ie dwell_passive = wpi_get_passive_dwell_time(sc, c); /* Make sure they're valid. */ - if (dwell_passive <= dwell_active) - dwell_passive = dwell_active + 1; + if (dwell_active > dwell_passive) + dwell_active = dwell_passive; chan->active = htole16(dwell_active); chan->passive = htole16(dwell_passive); Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sun May 3 22:55:06 2015 (r282381) +++ head/sys/dev/wpi/if_wpireg.h Sun May 3 22:56:36 2015 (r282382) @@ -611,8 +611,10 @@ struct wpi_scan_hdr { uint16_t len; uint8_t reserved1; uint8_t nchan; - uint16_t quiet_time; - uint16_t quiet_threshold; + uint16_t quiet_time; /* timeout in milliseconds */ +#define WPI_QUIET_TIME_DEFAULT 10 + + uint16_t quiet_threshold; /* min # of packets */ uint16_t crc_threshold; uint16_t reserved2; uint32_t max_svc; /* background scans */ @@ -652,6 +654,7 @@ struct wpi_scan_chan { #define WPI_PASSIVE_DWELL_TIME_2GHZ ( 20) #define WPI_PASSIVE_DWELL_TIME_5GHZ ( 10) #define WPI_PASSIVE_DWELL_BASE (100) +#define WPI_CHANNEL_TUNE_TIME ( 6) /* Structure for command WPI_CMD_TXPOWER. */ struct wpi_cmd_txpower { From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:03:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53DDDA8A; Sun, 3 May 2015 23:03:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 286831730; Sun, 3 May 2015 23:03: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 t43N377i079135; Sun, 3 May 2015 23:03:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43N36rW079133; Sun, 3 May 2015 23:03:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032303.t43N36rW079133@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282383 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:03:07 -0000 Author: adrian Date: Sun May 3 23:03:06 2015 New Revision: 282383 URL: https://svnweb.freebsd.org/changeset/base/282383 Log: Fix pause scan time calculation (the remainder must be less than beacon interval). PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:56:36 2015 (r282382) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:03:06 2015 (r282383) @@ -228,6 +228,7 @@ static uint16_t wpi_get_active_dwell_tim static uint16_t wpi_limit_dwell(struct wpi_softc *, uint16_t); static uint16_t wpi_get_passive_dwell_time(struct wpi_softc *, struct ieee80211_channel *); +static uint32_t wpi_get_scan_pause_time(uint32_t, uint16_t); static int wpi_scan(struct wpi_softc *, struct ieee80211_channel *); static int wpi_auth(struct wpi_softc *, struct ieee80211vap *); static int wpi_config_beacon(struct wpi_vap *); @@ -3864,6 +3865,18 @@ wpi_get_passive_dwell_time(struct wpi_so return (wpi_limit_dwell(sc, passive)); } +static uint32_t +wpi_get_scan_pause_time(uint32_t time, uint16_t bintval) +{ + uint32_t mod = (time % bintval) * IEEE80211_DUR_TU; + uint32_t nbeacons = time / bintval; + + if (mod > WPI_PAUSE_MAX_TIME) + mod = WPI_PAUSE_MAX_TIME; + + return WPI_PAUSE_SCAN(nbeacons, mod); +} + /* * Send a scan request to the firmware. */ @@ -3921,13 +3934,17 @@ wpi_scan(struct wpi_softc *sc, struct ie */ hdr->quiet_time = htole16(WPI_QUIET_TIME_DEFAULT); hdr->quiet_threshold = htole16(1); - /* - * Max needs to be greater than active and passive and quiet! - * It's also in microseconds! - */ - hdr->max_svc = htole32(250 * IEEE80211_DUR_TU); - hdr->pause_svc = htole32((4 << 24) | - (100 * IEEE80211_DUR_TU)); /* Hardcode for now */ + + if (bgscan != 0) { + /* + * Max needs to be greater than active and passive and quiet! + * It's also in microseconds! + */ + hdr->max_svc = htole32(250 * IEEE80211_DUR_TU); + hdr->pause_svc = htole32(wpi_get_scan_pause_time(100, + bintval)); + } + hdr->filter = htole32(WPI_FILTER_MULTICAST | WPI_FILTER_BEACON); tx = (struct wpi_cmd_data *)(hdr + 1); Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sun May 3 22:56:36 2015 (r282382) +++ head/sys/dev/wpi/if_wpireg.h Sun May 3 23:03:06 2015 (r282383) @@ -619,6 +619,9 @@ struct wpi_scan_hdr { uint16_t reserved2; uint32_t max_svc; /* background scans */ uint32_t pause_svc; /* background scans */ +#define WPI_PAUSE_MAX_TIME ((1 << 20) - 1) +#define WPI_PAUSE_SCAN(nbeacons, time) ((nbeacons << 24) | time) + uint32_t flags; uint32_t filter; From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:06:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 569E9C5B; Sun, 3 May 2015 23:06: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 44CE4174D; Sun, 3 May 2015 23:06: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 t43N6KBQ079633; Sun, 3 May 2015 23:06:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43N6K1Z079632; Sun, 3 May 2015 23:06:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032306.t43N6K1Z079632@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282384 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:06:20 -0000 Author: adrian Date: Sun May 3 23:06:19 2015 New Revision: 282384 URL: https://svnweb.freebsd.org/changeset/base/282384 Log: Do not disable beacon notifications (unbreaks scanning on passive channels). PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:03:06 2015 (r282383) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:06:19 2015 (r282384) @@ -3716,7 +3716,6 @@ wpi_config(struct wpi_softc *sc) struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_channel *c = ic->ic_curchan; - uint32_t flags; int error; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -3789,15 +3788,6 @@ wpi_config(struct wpi_softc *sc) return error; } - /* Disable beacon notifications (unused). */ - flags = WPI_STATISTICS_BEACON_DISABLE; - error = wpi_cmd(sc, WPI_CMD_GET_STATISTICS, &flags, sizeof flags, 1); - if (error != 0) { - device_printf(sc->sc_dev, - "could not disable beacon statistics, error %d\n", error); - return error; - } - DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); return 0; From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:08:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6F4FE07; Sun, 3 May 2015 23:08:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B553F1763; Sun, 3 May 2015 23:08:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43N8QTD079959; Sun, 3 May 2015 23:08:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43N8Qiv079958; Sun, 3 May 2015 23:08:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032308.t43N8Qiv079958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282385 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:08:26 -0000 Author: adrian Date: Sun May 3 23:08:25 2015 New Revision: 282385 URL: https://svnweb.freebsd.org/changeset/base/282385 Log: Check channels which are passed in IBSS mode. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:06:19 2015 (r282384) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:08:25 2015 (r282385) @@ -3775,6 +3775,14 @@ wpi_config(struct wpi_softc *sc) sc->rxon.cck_mask = 0x0f; /* not yet negotiated */ sc->rxon.ofdm_mask = 0xff; /* not yet negotiated */ + /* XXX Current configuration may be unusable. */ + if (IEEE80211_IS_CHAN_NOADHOC(c) && sc->rxon.mode == WPI_MODE_IBSS) { + device_printf(sc->sc_dev, + "%s: invalid channel (%d) selected for IBSS mode\n", + __func__, ieee80211_chan2ieee(ic, c)); + return EINVAL; + } + if ((error = wpi_send_rxon(sc, 0, 0)) != 0) { device_printf(sc->sc_dev, "%s: could not send RXON\n", __func__); From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:09:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 185E2F6D; Sun, 3 May 2015 23:09: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 075AC176F; Sun, 3 May 2015 23:09: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 t43N9lgk080188; Sun, 3 May 2015 23:09:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43N9leE080187; Sun, 3 May 2015 23:09:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032309.t43N9leE080187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282386 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:09:48 -0000 Author: adrian Date: Sun May 3 23:09:47 2015 New Revision: 282386 URL: https://svnweb.freebsd.org/changeset/base/282386 Log: Unbreak scanning after RUN -> SCAN state transition. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:08:25 2015 (r282385) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:09:47 2015 (r282386) @@ -1687,8 +1687,7 @@ wpi_newstate(struct ieee80211vap *vap, e switch (nstate) { case IEEE80211_S_SCAN: WPI_RXON_LOCK(sc); - if (wpi_check_bss_filter(sc) != 0 && - vap->iv_opmode != IEEE80211_M_STA) { + if (wpi_check_bss_filter(sc) != 0) { sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { device_printf(sc->sc_dev, From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:18:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E09CA212; Sun, 3 May 2015 23:18: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 CEEEB1869; Sun, 3 May 2015 23:18: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 t43NITqf084991; Sun, 3 May 2015 23:18:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NITpY084987; Sun, 3 May 2015 23:18:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032318.t43NITpY084987@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282387 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:18:30 -0000 Author: adrian Date: Sun May 3 23:18:28 2015 New Revision: 282387 URL: https://svnweb.freebsd.org/changeset/base/282387 Log: Create another debug category for WPI_BEACON_MISSED notification. Differential Revision: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpi_debug.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:09:47 2015 (r282386) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:18:28 2015 (r282387) @@ -2121,7 +2121,7 @@ wpi_notif_intr(struct wpi_softc *sc) BUS_DMASYNC_POSTREAD); misses = le32toh(miss->consecutive); - DPRINTF(sc, WPI_DEBUG_STATE, + DPRINTF(sc, WPI_DEBUG_BMISS, "%s: beacons missed %d/%d\n", __func__, misses, le32toh(miss->total)); Modified: head/sys/dev/wpi/if_wpi_debug.h ============================================================================== --- head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:09:47 2015 (r282386) +++ head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:18:28 2015 (r282387) @@ -43,6 +43,7 @@ enum { WPI_DEBUG_KEY = 0x00020000, /* node key management */ WPI_DEBUG_EDCA = 0x00040000, /* WME info */ WPI_DEBUG_REGISTER = 0x00080000, /* print chipset register */ + WPI_DEBUG_BMISS = 0x00100000, /* print number of missed beacons */ WPI_DEBUG_ANY = 0xffffffff }; From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:21:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EA66366; Sun, 3 May 2015 23:21: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 8D1B91915; Sun, 3 May 2015 23:21: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 t43NLHTP087082; Sun, 3 May 2015 23:21:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NLHeC087081; Sun, 3 May 2015 23:21:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032321.t43NLHeC087081@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282388 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:21:17 -0000 Author: adrian Date: Sun May 3 23:21:16 2015 New Revision: 282388 URL: https://svnweb.freebsd.org/changeset/base/282388 Log: Improve beacon miss detection. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:18:28 2015 (r282387) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:21:16 2015 (r282388) @@ -2115,11 +2115,14 @@ wpi_notif_intr(struct wpi_softc *sc) { struct wpi_beacon_missed *miss = (struct wpi_beacon_missed *)(desc + 1); - uint32_t misses; + uint32_t expected, misses, received; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); + misses = le32toh(miss->consecutive); + expected = le32toh(miss->expected); + received = le32toh(miss->received); DPRINTF(sc, WPI_DEBUG_BMISS, "%s: beacons missed %d/%d\n", __func__, misses, @@ -2127,7 +2130,9 @@ wpi_notif_intr(struct wpi_softc *sc) if (vap->iv_state == IEEE80211_S_RUN && (ic->ic_flags & IEEE80211_F_SCAN) == 0 && - misses >= vap->iv_bmissthreshold) + (misses >= vap->iv_bmissthreshold || + (received == 0 && + expected >= vap->iv_bmissthreshold))) ieee80211_beacon_miss(ic); break; From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:24:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A3FB4E2; Sun, 3 May 2015 23:24: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 188E4192C; Sun, 3 May 2015 23:24: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 t43NOKLI089441; Sun, 3 May 2015 23:24:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NOKHt089440; Sun, 3 May 2015 23:24:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032324.t43NOKHt089440@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282389 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:24:21 -0000 Author: adrian Date: Sun May 3 23:24:20 2015 New Revision: 282389 URL: https://svnweb.freebsd.org/changeset/base/282389 Log: Limit minimum threshold of missed beacons. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:21:16 2015 (r282388) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:24:20 2015 (r282389) @@ -2115,7 +2115,7 @@ wpi_notif_intr(struct wpi_softc *sc) { struct wpi_beacon_missed *miss = (struct wpi_beacon_missed *)(desc + 1); - uint32_t expected, misses, received; + uint32_t expected, misses, received, threshold; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); @@ -2123,6 +2123,7 @@ wpi_notif_intr(struct wpi_softc *sc) misses = le32toh(miss->consecutive); expected = le32toh(miss->expected); received = le32toh(miss->received); + threshold = MAX(2, vap->iv_bmissthreshold); DPRINTF(sc, WPI_DEBUG_BMISS, "%s: beacons missed %d/%d\n", __func__, misses, @@ -2130,9 +2131,8 @@ wpi_notif_intr(struct wpi_softc *sc) if (vap->iv_state == IEEE80211_S_RUN && (ic->ic_flags & IEEE80211_F_SCAN) == 0 && - (misses >= vap->iv_bmissthreshold || - (received == 0 && - expected >= vap->iv_bmissthreshold))) + (misses >= threshold || + (received == 0 && expected >= threshold))) ieee80211_beacon_miss(ic); break; From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:25:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8954E645; Sun, 3 May 2015 23:25: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 780131936; Sun, 3 May 2015 23:25: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 t43NPY1T089677; Sun, 3 May 2015 23:25:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NPYmd089676; Sun, 3 May 2015 23:25:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032325.t43NPYmd089676@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282390 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:25:34 -0000 Author: adrian Date: Sun May 3 23:25:33 2015 New Revision: 282390 URL: https://svnweb.freebsd.org/changeset/base/282390 Log: Display more information for beacon miss debugging. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:24:20 2015 (r282389) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:25:33 2015 (r282390) @@ -2126,8 +2126,9 @@ wpi_notif_intr(struct wpi_softc *sc) threshold = MAX(2, vap->iv_bmissthreshold); DPRINTF(sc, WPI_DEBUG_BMISS, - "%s: beacons missed %d/%d\n", __func__, misses, - le32toh(miss->total)); + "%s: beacons missed %u(%u) (received %u/%u)\n", + __func__, misses, le32toh(miss->total), received, + expected); if (vap->iv_state == IEEE80211_S_RUN && (ic->ic_flags & IEEE80211_F_SCAN) == 0 && From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:27:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C2D47B7; Sun, 3 May 2015 23:27: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 604C61949; Sun, 3 May 2015 23:27: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 t43NRbl4090003; Sun, 3 May 2015 23:27:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NRbq7090002; Sun, 3 May 2015 23:27:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032327.t43NRbq7090002@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282391 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:27:37 -0000 Author: adrian Date: Sun May 3 23:27:36 2015 New Revision: 282391 URL: https://svnweb.freebsd.org/changeset/base/282391 Log: Add comment about AUTH -> AUTH state transition + fix some style issues. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:25:33 2015 (r282390) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:27:36 2015 (r282391) @@ -1703,6 +1703,11 @@ wpi_newstate(struct ieee80211vap *vap, e /* FALLTHROUGH */ case IEEE80211_S_AUTH: /* + * NB: do not optimize AUTH -> AUTH state transmission - + * this will break powersave with non-QoS AP! + */ + + /* * The node must be registered in the firmware before auth. * Also the associd must be cleared on RUN -> ASSOC * transitions. @@ -2609,7 +2614,7 @@ wpi_tx_data(struct wpi_softc *sc, struct /* Select EDCA Access Category and TX ring for this frame. */ if (IEEE80211_QOS_HAS_SEQ(wh)) { - qos = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; + qos = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; tid = qos & IEEE80211_QOS_TID; } else { qos = 0; @@ -3764,7 +3769,6 @@ wpi_config(struct wpi_softc *sc) sc->rxon.filter |= WPI_FILTER_ASSOC | WPI_FILTER_PROMISC; break; case IEEE80211_M_AHDEMO: - /* XXX workaround for passive channels selection */ sc->rxon.mode = WPI_MODE_HOSTAP; break; case IEEE80211_M_MONITOR: @@ -4664,7 +4668,7 @@ wpi_post_alive(struct wpi_softc *sc) /* NB: Runtime firmware must be up and running. */ if (!(wpi_prph_read(sc, WPI_APMG_RFKILL) & 1)) { - device_printf(sc->sc_dev, + device_printf(sc->sc_dev, "RF switch: radio disabled (%s)\n", __func__); wpi_nic_unlock(sc); return EPERM; /* :-) */ @@ -4988,7 +4992,7 @@ wpi_apm_stop_master(struct wpi_softc *sc /* Stop busmaster DMA activity. */ WPI_SETBITS(sc, WPI_RESET, WPI_RESET_STOP_MASTER); - + if ((WPI_READ(sc, WPI_GP_CNTRL) & WPI_GP_CNTRL_PS_MASK) == WPI_GP_CNTRL_MAC_PS) return; /* Already asleep. */ From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:28:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CC2B920; Sun, 3 May 2015 23:28:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F72A1956; Sun, 3 May 2015 23:28:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43NStMX090229; Sun, 3 May 2015 23:28:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NSsiF090226; Sun, 3 May 2015 23:28:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032328.t43NSsiF090226@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282392 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:28:55 -0000 Author: adrian Date: Sun May 3 23:28:54 2015 New Revision: 282392 URL: https://svnweb.freebsd.org/changeset/base/282392 Log: Try to fix passive scanning hang on beacon miss. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpi_debug.h head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:27:36 2015 (r282391) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:28:54 2015 (r282392) @@ -2135,11 +2135,18 @@ wpi_notif_intr(struct wpi_softc *sc) __func__, misses, le32toh(miss->total), received, expected); - if (vap->iv_state == IEEE80211_S_RUN && - (ic->ic_flags & IEEE80211_F_SCAN) == 0 && - (misses >= threshold || - (received == 0 && expected >= threshold))) - ieee80211_beacon_miss(ic); + if (misses >= threshold || + (received == 0 && expected >= threshold)) { + WPI_RXON_LOCK(sc); + if (callout_pending(&sc->scan_timeout)) { + wpi_cmd(sc, WPI_CMD_SCAN_ABORT, NULL, + 0, 1); + } + WPI_RXON_UNLOCK(sc); + if (vap->iv_state == IEEE80211_S_RUN && + (ic->ic_flags & IEEE80211_F_SCAN) == 0) + ieee80211_beacon_miss(ic); + } break; } @@ -2202,17 +2209,21 @@ wpi_notif_intr(struct wpi_softc *sc) { bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); -#ifdef WPI_DEBUG + struct wpi_stop_scan *scan = (struct wpi_stop_scan *)(desc + 1); + DPRINTF(sc, WPI_DEBUG_SCAN, "scan finished nchan=%d status=%d chan=%d\n", scan->nchan, scan->status, scan->chan); -#endif + WPI_RXON_LOCK(sc); callout_stop(&sc->scan_timeout); WPI_RXON_UNLOCK(sc); - ieee80211_scan_next(vap); + if (scan->status == WPI_SCAN_ABORTED) + ieee80211_cancel_scan(vap); + else + ieee80211_scan_next(vap); break; } } Modified: head/sys/dev/wpi/if_wpi_debug.h ============================================================================== --- head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:27:36 2015 (r282391) +++ head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:28:54 2015 (r282392) @@ -86,6 +86,7 @@ static const char *wpi_cmd_str(int cmd) WPI_DESC(WPI_CMD_SET_LED); WPI_DESC(WPI_CMD_SET_POWER_MODE); WPI_DESC(WPI_CMD_SCAN); + WPI_DESC(WPI_CMD_SCAN_ABORT); WPI_DESC(WPI_CMD_SET_BEACON); WPI_DESC(WPI_CMD_TXPOWER); WPI_DESC(WPI_CMD_BT_COEX); Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sun May 3 23:27:36 2015 (r282391) +++ head/sys/dev/wpi/if_wpireg.h Sun May 3 23:28:54 2015 (r282392) @@ -352,6 +352,7 @@ struct wpi_tx_cmd { #define WPI_CMD_SET_LED 72 #define WPI_CMD_SET_POWER_MODE 119 #define WPI_CMD_SCAN 128 +#define WPI_CMD_SCAN_ABORT 129 #define WPI_CMD_SET_BEACON 145 #define WPI_CMD_TXPOWER 151 #define WPI_CMD_BT_COEX 155 @@ -725,6 +726,9 @@ struct wpi_start_scan { struct wpi_stop_scan { uint8_t nchan; uint8_t status; +#define WPI_SCAN_COMPLETED 1 +#define WPI_SCAN_ABORTED 2 + uint8_t reserved; uint8_t chan; uint64_t tsf; From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:30:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD3F9B0B; Sun, 3 May 2015 23:30:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBCAA1975; Sun, 3 May 2015 23:30: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 t43NU5an090620; Sun, 3 May 2015 23:30:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NU5o4090619; Sun, 3 May 2015 23:30:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032330.t43NU5o4090619@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282393 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:30:05 -0000 Author: adrian Date: Sun May 3 23:30:04 2015 New Revision: 282393 URL: https://svnweb.freebsd.org/changeset/base/282393 Log: Add debug output for WPI_BEACON_SENT event. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:28:54 2015 (r282392) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:30:04 2015 (r282393) @@ -2150,6 +2150,27 @@ wpi_notif_intr(struct wpi_softc *sc) break; } +#ifdef WPI_DEBUG + case WPI_BEACON_SENT: + { + struct wpi_tx_stat *stat = + (struct wpi_tx_stat *)(desc + 1); + uint64_t *tsf = (uint64_t *)(stat + 1); + uint32_t *mode = (uint32_t *)(tsf + 1); + + bus_dmamap_sync(sc->rxq.data_dmat, data->map, + BUS_DMASYNC_POSTREAD); + + DPRINTF(sc, WPI_DEBUG_BEACON, + "beacon sent: rts %u, ack %u, btkill %u, rate %u, " + "duration %u, status %x, tsf %ju, mode %x\n", + stat->rtsfailcnt, stat->ackfailcnt, + stat->btkillcnt, stat->rate, le32toh(stat->duration), + le32toh(stat->status), *tsf, *mode); + + break; + } +#endif case WPI_UC_READY: { struct wpi_ucode_info *uc = From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:34:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2E5ECE4; Sun, 3 May 2015 23:34:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A14C71A34; Sun, 3 May 2015 23:34:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43NYPWg094793; Sun, 3 May 2015 23:34:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NYPVp094792; Sun, 3 May 2015 23:34:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032334.t43NYPVp094792@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282394 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:34:25 -0000 Author: adrian Date: Sun May 3 23:34:24 2015 New Revision: 282394 URL: https://svnweb.freebsd.org/changeset/base/282394 Log: Fix sequence number generation for beacon frames. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:30:04 2015 (r282393) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:34:24 2015 (r282394) @@ -609,7 +609,12 @@ wpi_init_beacon(struct wpi_vap *wvp) cmd->ofdm_mask = 0xff; cmd->cck_mask = 0x0f; cmd->lifetime = htole32(WPI_LIFETIME_INFINITE); - cmd->flags = htole32(WPI_TX_AUTO_SEQ | WPI_TX_INSERT_TSTAMP); + + /* + * XXX WPI_TX_AUTO_SEQ seems to be ignored - workaround this issue + * XXX by using WPI_TX_NEED_ACK instead (with some side effects). + */ + cmd->flags = htole32(WPI_TX_NEED_ACK | WPI_TX_INSERT_TSTAMP); bcn->code = WPI_CMD_SET_BEACON; bcn->ac = WPI_CMD_QUEUE_NUM; From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:35:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98BA8E43; Sun, 3 May 2015 23:35: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 871211A3C; Sun, 3 May 2015 23:35: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 t43NZCTT094994; Sun, 3 May 2015 23:35:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NZCe9094993; Sun, 3 May 2015 23:35:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032335.t43NZCe9094993@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282395 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:35:12 -0000 Author: adrian Date: Sun May 3 23:35:11 2015 New Revision: 282395 URL: https://svnweb.freebsd.org/changeset/base/282395 Log: Do not include WPI_START_SCAN event processing into non-debug builds. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:34:24 2015 (r282394) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:35:11 2015 (r282395) @@ -2218,19 +2218,21 @@ wpi_notif_intr(struct wpi_softc *sc) } break; } +#ifdef WPI_DEBUG case WPI_START_SCAN: { bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); -#ifdef WPI_DEBUG + struct wpi_start_scan *scan = (struct wpi_start_scan *)(desc + 1); DPRINTF(sc, WPI_DEBUG_SCAN, "%s: scanning channel %d status %x\n", __func__, scan->chan, le32toh(scan->status)); -#endif + break; } +#endif case WPI_STOP_SCAN: { bus_dmamap_sync(sc->rxq.data_dmat, data->map, From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:35:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55E29F86; Sun, 3 May 2015 23:35:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A2911A41; Sun, 3 May 2015 23:35:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43NZjGu095130; Sun, 3 May 2015 23:35:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NZjUS095129; Sun, 3 May 2015 23:35:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032335.t43NZjUS095129@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282396 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:35:45 -0000 Author: adrian Date: Sun May 3 23:35:44 2015 New Revision: 282396 URL: https://svnweb.freebsd.org/changeset/base/282396 Log: Use nitems() for counting elements in arrays. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:35:11 2015 (r282395) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:35:44 2015 (r282396) @@ -2301,7 +2301,6 @@ wpi_wakeup_intr(struct wpi_softc *sc) static void wpi_debug_registers(struct wpi_softc *sc) { -#define COUNTOF(array) (sizeof(array) / sizeof(array[0])) int i; static const uint32_t csr_tbl[] = { WPI_HW_IF_CONFIG, @@ -2329,7 +2328,7 @@ wpi_debug_registers(struct wpi_softc *sc DPRINTF(sc, WPI_DEBUG_REGISTER,"%s","\n"); - for (i = 0; i < COUNTOF(csr_tbl); i++) { + for (i = 0; i < nitems(csr_tbl); i++) { DPRINTF(sc, WPI_DEBUG_REGISTER, " %-18s: 0x%08x ", wpi_get_csr_string(csr_tbl[i]), WPI_READ(sc, csr_tbl[i])); @@ -2339,7 +2338,7 @@ wpi_debug_registers(struct wpi_softc *sc DPRINTF(sc, WPI_DEBUG_REGISTER, "\n\n"); if (wpi_nic_lock(sc) == 0) { - for (i = 0; i < COUNTOF(prph_tbl); i++) { + for (i = 0; i < nitems(prph_tbl); i++) { DPRINTF(sc, WPI_DEBUG_REGISTER, " %-18s: 0x%08x ", wpi_get_prph_string(prph_tbl[i]), wpi_prph_read(sc, prph_tbl[i])); @@ -2353,7 +2352,6 @@ wpi_debug_registers(struct wpi_softc *sc DPRINTF(sc, WPI_DEBUG_REGISTER, "Cannot access internal registers.\n"); } -#undef COUNTOF } #endif @@ -2367,8 +2365,6 @@ wpi_fatal_intr(struct wpi_softc *sc) { struct wpi_fw_dump dump; uint32_t i, offset, count; - const uint32_t size_errmsg = - (sizeof (wpi_fw_errmsg) / sizeof ((wpi_fw_errmsg)[0])); /* Check that the error log address is valid. */ if (sc->errptr < WPI_FW_DATA_BASE || @@ -2398,7 +2394,7 @@ wpi_fatal_intr(struct wpi_softc *sc) sizeof (dump) / sizeof (uint32_t)); printf(" error type = \"%s\" (0x%08X)\n", - (dump.desc < size_errmsg) ? + (dump.desc < nitems(wpi_fw_errmsg)) ? wpi_fw_errmsg[dump.desc] : "UNKNOWN", dump.desc); printf(" error data = 0x%08X\n", From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:36:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C90317F; Sun, 3 May 2015 23:36:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD571A53; Sun, 3 May 2015 23:36:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43NaPE3095315; Sun, 3 May 2015 23:36:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NaPLu095314; Sun, 3 May 2015 23:36:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032336.t43NaPLu095314@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282397 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:36:26 -0000 Author: adrian Date: Sun May 3 23:36:25 2015 New Revision: 282397 URL: https://svnweb.freebsd.org/changeset/base/282397 Log: [iwn?] Fix memory leak in wpi_reset_tx_ring(). PR: kern/197143 Differential Revision: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:35:44 2015 (r282396) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:36:25 2015 (r282397) @@ -1279,6 +1279,10 @@ wpi_reset_tx_ring(struct wpi_softc *sc, m_freem(data->m); data->m = NULL; } + if (data->ni != NULL) { + ieee80211_free_node(data->ni); + data->ni = NULL; + } } /* Clear TX descriptors. */ memset(ring->desc, 0, ring->desc_dma.size); From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:37:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD8062DF; Sun, 3 May 2015 23:37: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 9EB941A5F; Sun, 3 May 2015 23:37: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 t43NbEnl095490; Sun, 3 May 2015 23:37:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NbE60095487; Sun, 3 May 2015 23:37:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032337.t43NbE60095487@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282398 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:37:14 -0000 Author: adrian Date: Sun May 3 23:37:13 2015 New Revision: 282398 URL: https://svnweb.freebsd.org/changeset/base/282398 Log: Fix warning about comparison of integers of different signs. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpi_debug.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:36:25 2015 (r282397) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:37:13 2015 (r282398) @@ -2080,7 +2080,7 @@ wpi_notif_intr(struct wpi_softc *sc) bus_dmamap_sync(sc->shared_dma.tag, sc->shared_dma.map, BUS_DMASYNC_POSTREAD); - hw = le32toh(sc->shared->next); + hw = le32toh(sc->shared->next) & 0xfff; hw = (hw == 0) ? WPI_RX_RING_COUNT - 1 : hw - 1; while (sc->rxq.cur != hw) { @@ -2305,7 +2305,7 @@ wpi_wakeup_intr(struct wpi_softc *sc) static void wpi_debug_registers(struct wpi_softc *sc) { - int i; + size_t i; static const uint32_t csr_tbl[] = { WPI_HW_IF_CONFIG, WPI_INT, Modified: head/sys/dev/wpi/if_wpi_debug.h ============================================================================== --- head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:36:25 2015 (r282397) +++ head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:37:13 2015 (r282398) @@ -99,7 +99,7 @@ static const char *wpi_cmd_str(int cmd) /* * Translate CSR code to string */ -static const char *wpi_get_csr_string(int csr) +static const char *wpi_get_csr_string(size_t csr) { switch (csr) { WPI_DESC(WPI_HW_IF_CONFIG); @@ -123,7 +123,7 @@ static const char *wpi_get_csr_string(in } } -static const char *wpi_get_prph_string(int prph) +static const char *wpi_get_prph_string(size_t prph) { switch (prph) { WPI_DESC(WPI_APMG_CLK_CTRL); From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:38:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23DB4453; Sun, 3 May 2015 23:38: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 124181A6D; Sun, 3 May 2015 23:38: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 t43NcWFc095726; Sun, 3 May 2015 23:38:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NcWNC095725; Sun, 3 May 2015 23:38:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032338.t43NcWNC095725@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282399 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:38:33 -0000 Author: adrian Date: Sun May 3 23:38:32 2015 New Revision: 282399 URL: https://svnweb.freebsd.org/changeset/base/282399 Log: [iwn?] Use correct sequence numbers with non-QoS STAs. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:37:13 2015 (r282398) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:38:32 2015 (r282399) @@ -2714,6 +2714,8 @@ wpi_tx_data(struct wpi_softc *sc, struct flags |= WPI_TX_NEED_ACK; } + if (!IEEE80211_QOS_HAS_SEQ(wh)) + flags |= WPI_TX_AUTO_SEQ; if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) flags |= WPI_TX_MORE_FRAG; /* Cannot happen yet. */ @@ -2818,6 +2820,8 @@ wpi_tx_data_raw(struct wpi_softc *sc, st rate = params->ibp_rate0; flags = 0; + if (!IEEE80211_QOS_HAS_SEQ(wh)) + flags |= WPI_TX_AUTO_SEQ; if ((params->ibp_flags & IEEE80211_BPF_NOACK) == 0) flags |= WPI_TX_NEED_ACK; if (params->ibp_flags & IEEE80211_BPF_RTS) From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:39:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F9E7598; Sun, 3 May 2015 23:39: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 2D8AA1A75; Sun, 3 May 2015 23:39: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 t43Nd3pV095865; Sun, 3 May 2015 23:39:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43Nd2G6095862; Sun, 3 May 2015 23:39:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032339.t43Nd2G6095862@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282400 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:39:03 -0000 Author: adrian Date: Sun May 3 23:39:02 2015 New Revision: 282400 URL: https://svnweb.freebsd.org/changeset/base/282400 Log: Fix various powersave races + optimize tx/rx pointer update when powersave is off. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:38:32 2015 (r282399) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:39:02 2015 (r282400) @@ -152,11 +152,14 @@ static int wpi_alloc_fwmem(struct wpi_so static void wpi_free_fwmem(struct wpi_softc *); static int wpi_alloc_rx_ring(struct wpi_softc *); static void wpi_update_rx_ring(struct wpi_softc *); +static void wpi_update_rx_ring_ps(struct wpi_softc *); static void wpi_reset_rx_ring(struct wpi_softc *); static void wpi_free_rx_ring(struct wpi_softc *); static int wpi_alloc_tx_ring(struct wpi_softc *, struct wpi_tx_ring *, int); static void wpi_update_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); +static void wpi_update_tx_ring_ps(struct wpi_softc *, + struct wpi_tx_ring *); static void wpi_reset_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static void wpi_free_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static int wpi_read_eeprom(struct wpi_softc *, @@ -521,6 +524,9 @@ wpi_attach(device_t dev) ic->ic_scan_mindwell = wpi_scan_mindwell; ic->ic_setregdomain = wpi_setregdomain; + sc->sc_update_rx_ring = wpi_update_rx_ring; + sc->sc_update_tx_ring = wpi_update_tx_ring; + wpi_radiotap_attach(sc); callout_init_mtx(&sc->calib_to, &sc->rxon_mtx, 0); @@ -1089,6 +1095,12 @@ fail: wpi_free_rx_ring(sc); static void wpi_update_rx_ring(struct wpi_softc *sc) { + WPI_WRITE(sc, WPI_FH_RX_WPTR, sc->rxq.cur & ~7); +} + +static void +wpi_update_rx_ring_ps(struct wpi_softc *sc) +{ struct wpi_rx_ring *ring = &sc->rxq; if (ring->update != 0) { @@ -1096,14 +1108,15 @@ wpi_update_rx_ring(struct wpi_softc *sc) return; } - if (WPI_READ(sc, WPI_UCODE_GP1) & WPI_UCODE_GP1_MAC_SLEEP) { + WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + if (WPI_READ(sc, WPI_GP_CNTRL) & WPI_GP_CNTRL_SLEEP) { DPRINTF(sc, WPI_DEBUG_PWRSAVE, "%s: wakeup request\n", __func__); - - WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); ring->update = 1; - } else - WPI_WRITE(sc, WPI_FH_RX_WPTR, ring->cur & ~7); + } else { + wpi_update_rx_ring(sc); + WPI_CLRBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + } } static void @@ -1247,19 +1260,27 @@ fail: wpi_free_tx_ring(sc, ring); static void wpi_update_tx_ring(struct wpi_softc *sc, struct wpi_tx_ring *ring) { + WPI_WRITE(sc, WPI_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); +} + +static void +wpi_update_tx_ring_ps(struct wpi_softc *sc, struct wpi_tx_ring *ring) +{ + if (ring->update != 0) { /* Wait for INT_WAKEUP event. */ return; } - if (WPI_READ(sc, WPI_UCODE_GP1) & WPI_UCODE_GP1_MAC_SLEEP) { + WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + if (WPI_READ(sc, WPI_GP_CNTRL) & WPI_GP_CNTRL_SLEEP) { DPRINTF(sc, WPI_DEBUG_PWRSAVE, "%s (%d): requesting wakeup\n", __func__, ring->qid); - - WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); ring->update = 1; - } else - WPI_WRITE(sc, WPI_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); + } else { + wpi_update_tx_ring(sc, ring); + WPI_CLRBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + } } static void @@ -2067,6 +2088,18 @@ wpi_cmd_done(struct wpi_softc *sc, struc } wakeup(&ring->cmd[desc->idx]); + + if (desc->type == WPI_CMD_SET_POWER_MODE) { + WPI_TXQ_LOCK(sc); + if (sc->sc_flags & WPI_PS_PATH) { + sc->sc_update_rx_ring = wpi_update_rx_ring_ps; + sc->sc_update_tx_ring = wpi_update_tx_ring_ps; + } else { + sc->sc_update_rx_ring = wpi_update_rx_ring; + sc->sc_update_tx_ring = wpi_update_tx_ring; + } + WPI_TXQ_UNLOCK(sc); + } } static void @@ -2262,7 +2295,7 @@ wpi_notif_intr(struct wpi_softc *sc) if (sc->rxq.cur % 8 == 0) { /* Tell the firmware what we have processed. */ - wpi_update_rx_ring(sc); + sc->sc_update_rx_ring(sc); } } } @@ -2293,9 +2326,8 @@ wpi_wakeup_intr(struct wpi_softc *sc) wpi_update_tx_ring(sc, ring); } } - WPI_TXQ_UNLOCK(sc); - WPI_CLRBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + WPI_TXQ_UNLOCK(sc); } /* @@ -2595,7 +2627,7 @@ wpi_cmd2(struct wpi_softc *sc, struct wp /* Kick TX ring. */ ring->cur = (ring->cur + 1) % WPI_TX_RING_COUNT; - wpi_update_tx_ring(sc, ring); + sc->sc_update_tx_ring(sc, ring); if (ring->qid < WPI_CMD_QUEUE_NUM) { /* Mark TX ring as full if we reach a certain threshold. */ @@ -3147,7 +3179,7 @@ wpi_cmd(struct wpi_softc *sc, int code, /* Kick command ring. */ ring->cur = (ring->cur + 1) % WPI_TX_RING_COUNT; - wpi_update_tx_ring(sc, ring); + sc->sc_update_tx_ring(sc, ring); DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); @@ -3648,8 +3680,13 @@ wpi_set_pslevel(struct wpi_softc *sc, ui pmgt = &wpi_pmgt[1][level]; memset(&cmd, 0, sizeof cmd); - if (level != 0) /* not CAM */ + WPI_TXQ_LOCK(sc); + if (level != 0) { /* not CAM */ cmd.flags |= htole16(WPI_PS_ALLOW_SLEEP); + sc->sc_flags |= WPI_PS_PATH; + } else + sc->sc_flags &= ~WPI_PS_PATH; + WPI_TXQ_UNLOCK(sc); /* Retrieve PCIe Active State Power Management (ASPM). */ reg = pci_read_config(sc->sc_dev, sc->sc_cap_off + 0x10, 1); if (!(reg & 0x1)) /* L0s Entry disabled. */ Modified: head/sys/dev/wpi/if_wpivar.h ============================================================================== --- head/sys/dev/wpi/if_wpivar.h Sun May 3 23:38:32 2015 (r282399) +++ head/sys/dev/wpi/if_wpivar.h Sun May 3 23:39:02 2015 (r282400) @@ -164,6 +164,9 @@ struct wpi_softc { struct ifnet *sc_ifp; int sc_debug; + int sc_flags; +#define WPI_PS_PATH (1 << 0) + struct mtx sc_mtx; struct mtx tx_mtx; @@ -210,6 +213,9 @@ struct wpi_softc { struct mtx nt_mtx; void (*sc_node_free)(struct ieee80211_node *); + void (*sc_update_rx_ring)(struct wpi_softc *); + void (*sc_update_tx_ring)(struct wpi_softc *, + struct wpi_tx_ring *); struct wpi_rx_radiotap_header sc_rxtap; struct wpi_tx_radiotap_header sc_txtap; From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:39:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6065C718; Sun, 3 May 2015 23:39:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E9891A85; Sun, 3 May 2015 23:39:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43Ndj4T096024; Sun, 3 May 2015 23:39:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NdiEX096022; Sun, 3 May 2015 23:39:44 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032339.t43NdiEX096022@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282401 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:39:45 -0000 Author: adrian Date: Sun May 3 23:39:44 2015 New Revision: 282401 URL: https://svnweb.freebsd.org/changeset/base/282401 Log: Handle properly IBSS merges (works with patch from bug 199632). PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:39:02 2015 (r282400) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:39:44 2015 (r282401) @@ -174,9 +174,13 @@ static int wpi_setregdomain(struct ieee8 struct ieee80211_channel[]); static int wpi_read_eeprom_group(struct wpi_softc *, int); static int wpi_add_node_entry_adhoc(struct wpi_softc *); -static void wpi_node_free(struct ieee80211_node *); static struct ieee80211_node *wpi_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); +static void wpi_node_free(struct ieee80211_node *); +static void wpi_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, int, + int); +static void wpi_restore_node(void *, struct ieee80211_node *); +static void wpi_restore_node_table(struct wpi_softc *, struct wpi_vap *); static int wpi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void wpi_calib_timeout(void *); static void wpi_rx_done(struct wpi_softc *, struct wpi_rx_desc *, @@ -654,6 +658,8 @@ wpi_vap_create(struct ieee80211com *ic, /* Override with driver methods. */ vap->iv_key_set = wpi_key_set; vap->iv_key_delete = wpi_key_delete; + wvp->wv_recv_mgmt = vap->iv_recv_mgmt; + vap->iv_recv_mgmt = wpi_recv_mgmt; wvp->wv_newstate = vap->iv_newstate; vap->iv_newstate = wpi_newstate; vap->iv_update_beacon = wpi_update_beacon; @@ -1685,6 +1691,66 @@ wpi_check_bss_filter(struct wpi_softc *s return (sc->rxon.filter & htole32(WPI_FILTER_BSS)) != 0; } +static void +wpi_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, int rssi, + int nf) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct wpi_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct wpi_vap *wvp = WPI_VAP(vap); + uint64_t ni_tstamp, rx_tstamp; + + wvp->wv_recv_mgmt(ni, m, subtype, rssi, nf); + + if (vap->iv_opmode == IEEE80211_M_IBSS && + vap->iv_state == IEEE80211_S_RUN && + (subtype == IEEE80211_FC0_SUBTYPE_BEACON || + subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP)) { + ni_tstamp = le64toh(ni->ni_tstamp.tsf); + rx_tstamp = le64toh(sc->rx_tstamp); + + if (ni_tstamp >= rx_tstamp) { + DPRINTF(sc, WPI_DEBUG_STATE, + "ibss merge, tsf %ju tstamp %ju\n", + (uintmax_t)rx_tstamp, (uintmax_t)ni_tstamp); + (void) ieee80211_ibss_merge(ni); + } + } +} + +static void +wpi_restore_node(void *arg, struct ieee80211_node *ni) +{ + struct wpi_softc *sc = arg; + struct wpi_node *wn = WPI_NODE(ni); + int error; + + WPI_NT_LOCK(sc); + if (wn->id != WPI_ID_UNDEFINED) { + wn->id = WPI_ID_UNDEFINED; + if ((error = wpi_add_ibss_node(sc, ni)) != 0) { + device_printf(sc->sc_dev, + "%s: could not add IBSS node, error %d\n", + __func__, error); + } + } + WPI_NT_UNLOCK(sc); +} + +static void +wpi_restore_node_table(struct wpi_softc *sc, struct wpi_vap *wvp) +{ + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + + /* Set group keys once. */ + WPI_NT_LOCK(sc); + wvp->wv_gtk = 0; + WPI_NT_UNLOCK(sc); + + ieee80211_iterate_nodes(&ic->ic_sta, wpi_restore_node, sc); + ieee80211_crypto_reload_keys(ic); +} + /** * Called by net80211 when ever there is a change to 80211 state machine */ @@ -1751,13 +1817,36 @@ wpi_newstate(struct ieee80211vap *vap, e case IEEE80211_S_RUN: /* - * RUN -> RUN transition; Just restart the timers. + * RUN -> RUN transition: + * STA mode: Just restart the timers. + * IBSS mode: Process IBSS merge. */ if (vap->iv_state == IEEE80211_S_RUN) { - WPI_RXON_LOCK(sc); - wpi_calib_timeout(sc); - WPI_RXON_UNLOCK(sc); - break; + if (vap->iv_opmode != IEEE80211_M_IBSS) { + WPI_RXON_LOCK(sc); + wpi_calib_timeout(sc); + WPI_RXON_UNLOCK(sc); + break; + } else { + /* + * Drop the BSS_FILTER bit + * (there is no another way to change bssid). + */ + WPI_RXON_LOCK(sc); + sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); + if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { + device_printf(sc->sc_dev, + "%s: could not send RXON\n", + __func__); + } + WPI_RXON_UNLOCK(sc); + + /* Restore all what was lost. */ + wpi_restore_node_table(sc, wvp); + + /* XXX set conditionally? */ + wpi_updateedca(ic); + } } /* @@ -1945,6 +2034,7 @@ wpi_rx_done(struct wpi_softc *sc, struct } ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + sc->rx_tstamp = tail->tstamp; if (ieee80211_radiotap_active(ic)) { struct wpi_rx_radiotap_header *tap = &sc->sc_rxtap; Modified: head/sys/dev/wpi/if_wpivar.h ============================================================================== --- head/sys/dev/wpi/if_wpivar.h Sun May 3 23:39:02 2015 (r282400) +++ head/sys/dev/wpi/if_wpivar.h Sun May 3 23:39:44 2015 (r282401) @@ -121,17 +121,19 @@ struct wpi_buf { }; struct wpi_vap { - struct ieee80211vap wv_vap; + struct ieee80211vap wv_vap; - struct wpi_buf wv_bcbuf; - struct ieee80211_beacon_offsets wv_boff; - struct mtx wv_mtx; - - uint32_t wv_gtk; -#define WPI_VAP_KEY(kid) (1 << kid) - - int (*wv_newstate)(struct ieee80211vap *, - enum ieee80211_state, int); + struct wpi_buf wv_bcbuf; + struct ieee80211_beacon_offsets wv_boff; + struct mtx wv_mtx; + + uint32_t wv_gtk; +#define WPI_VAP_KEY(kid) (1 << kid) + + int (*wv_newstate)(struct ieee80211vap *, + enum ieee80211_state, int); + void (*wv_recv_mgmt)(struct ieee80211_node *, + struct mbuf *, int, int, int); }; #define WPI_VAP(vap) ((struct wpi_vap *)(vap)) @@ -180,6 +182,7 @@ struct wpi_softc { uint32_t txq_active; struct wpi_rx_ring rxq; + uint64_t rx_tstamp; /* TX Thermal Callibration. */ struct callout calib_to; From owner-svn-src-head@FreeBSD.ORG Sun May 3 23:40:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE6DD863; Sun, 3 May 2015 23:40: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 9CC2A1B29; Sun, 3 May 2015 23:40: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 t43NeDE1096711; Sun, 3 May 2015 23:40:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NeD3E096710; Sun, 3 May 2015 23:40:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032340.t43NeD3E096710@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282402 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:40:13 -0000 Author: adrian Date: Sun May 3 23:40:12 2015 New Revision: 282402 URL: https://svnweb.freebsd.org/changeset/base/282402 Log: [iwn] Do not filter control frames in monitor mode. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:39:44 2015 (r282401) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:40:12 2015 (r282402) @@ -1972,7 +1972,7 @@ wpi_rx_done(struct wpi_softc *sc, struct goto fail1; } /* Discard frames that are too short. */ - if (len < sizeof (*wh)) { + if (len < sizeof (struct ieee80211_frame_ack)) { DPRINTF(sc, WPI_DEBUG_RECV, "%s: frame too short: %d\n", __func__, len); goto fail1; @@ -2033,7 +2033,11 @@ wpi_rx_done(struct wpi_softc *sc, struct m->m_flags |= M_WEP; } - ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + if (len >= sizeof(struct ieee80211_frame_min)) + ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + else + ni = NULL; + sc->rx_tstamp = tail->tstamp; if (ieee80211_radiotap_active(ic)) { From owner-svn-src-head@FreeBSD.ORG Mon May 4 00:01:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59D59C83; Mon, 4 May 2015 00:01:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF081D0A; Mon, 4 May 2015 00:01: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 t4401a97009717; Mon, 4 May 2015 00:01:36 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4401aRl009716; Mon, 4 May 2015 00:01:36 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505040001.t4401aRl009716@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 4 May 2015 00:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282403 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 00:01:36 -0000 Author: loos Date: Mon May 4 00:01:35 2015 New Revision: 282403 URL: https://svnweb.freebsd.org/changeset/base/282403 Log: Fix the voltage and clock levels for cpufreq on RPi 2. Submitted by: Daisuke Aoyama Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Sun May 3 23:40:12 2015 (r282402) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Mon May 4 00:01:35 2015 (r282403) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2013-2014 Daisuke Aoyama + * Copyright (C) 2013-2015 Daisuke Aoyama * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,21 +60,28 @@ __FBSDID("$FreeBSD$"); #define DPRINTF(fmt, ...) #endif -#define HZ2MHZ(freq) ((freq) / (1000 * 1000)) -#define MHZ2HZ(freq) ((freq) * (1000 * 1000)) -#define OFFSET2MVOLT(val) (1200 + ((val) * 25)) -#define MVOLT2OFFSET(val) (((val) - 1200) / 25) - -#define DEFAULT_ARM_FREQUENCY 700 -#define DEFAULT_CORE_FREQUENCY 250 -#define DEFAULT_SDRAM_FREQUENCY 400 -#define DEFAULT_LOWEST_FREQ 300 -#define TRANSITION_LATENCY 1000 -#define MIN_OVER_VOLTAGE -16 -#define MAX_OVER_VOLTAGE 6 -#define MSG_ERROR -999999999 -#define MHZSTEP 100 -#define HZSTEP (MHZ2HZ(MHZSTEP)) +#define HZ2MHZ(freq) ((freq) / (1000 * 1000)) +#define MHZ2HZ(freq) ((freq) * (1000 * 1000)) + +#ifdef SOC_BCM2836 +#define OFFSET2MVOLT(val) (((val) / 1000)) +#define MVOLT2OFFSET(val) (((val) * 1000)) +#define DEFAULT_ARM_FREQUENCY 600 +#define DEFAULT_LOWEST_FREQ 600 +#else +#define OFFSET2MVOLT(val) (1200 + ((val) * 25)) +#define MVOLT2OFFSET(val) (((val) - 1200) / 25) +#define DEFAULT_ARM_FREQUENCY 700 +#define DEFAULT_LOWEST_FREQ 300 +#endif +#define DEFAULT_CORE_FREQUENCY 250 +#define DEFAULT_SDRAM_FREQUENCY 400 +#define TRANSITION_LATENCY 1000 +#define MIN_OVER_VOLTAGE -16 +#define MAX_OVER_VOLTAGE 6 +#define MSG_ERROR -999999999 +#define MHZSTEP 100 +#define HZSTEP (MHZ2HZ(MHZSTEP)) #define TZ_ZEROC 2732 #define VC_LOCK(sc) do { \ @@ -1740,6 +1747,23 @@ bcm2835_cpufreq_make_freq_list(device_t if (min_freq > cpufreq_lowest_freq) min_freq = cpufreq_lowest_freq; +#ifdef SOC_BCM2836 + /* XXX RPi2 have only 900/600MHz */ + idx = 0; + volts = sc->min_voltage_core; + sets[idx].freq = freq; + sets[idx].volts = volts; + sets[idx].lat = TRANSITION_LATENCY; + sets[idx].dev = dev; + idx++; + if (freq != min_freq) { + sets[idx].freq = min_freq; + sets[idx].volts = volts; + sets[idx].lat = TRANSITION_LATENCY; + sets[idx].dev = dev; + idx++; + } +#else /* from freq to min_freq */ for (idx = 0; idx < *count && freq >= min_freq; idx++) { if (freq > sc->arm_min_freq) @@ -1752,7 +1776,8 @@ bcm2835_cpufreq_make_freq_list(device_t sets[idx].dev = dev; freq -= MHZSTEP; } - *count = ++idx; +#endif + *count = idx; return (0); } From owner-svn-src-head@FreeBSD.ORG Mon May 4 00:29:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A3EF93; Mon, 4 May 2015 00:29: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 180741EF3; Mon, 4 May 2015 00:29: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 t440TJ7d021973; Mon, 4 May 2015 00:29:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t440TJp1021972; Mon, 4 May 2015 00:29:19 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505040029.t440TJp1021972@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 4 May 2015 00:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282404 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 00:29:20 -0000 Author: adrian Date: Mon May 4 00:29:19 2015 New Revision: 282404 URL: https://svnweb.freebsd.org/changeset/base/282404 Log: Add node_clear_keyixmap() and use it in the ieee80211_free_node() / node_reclaim(). PR: kern/199672 Submitted by: Andriy Voskoboinyk Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Mon May 4 00:01:35 2015 (r282403) +++ head/sys/net80211/ieee80211_node.c Mon May 4 00:29:19 2015 (r282404) @@ -879,7 +879,7 @@ ieee80211_sta_leave(struct ieee80211_nod void ieee80211_node_deauth(struct ieee80211_node *ni, int reason) { - /* NB: bump the refcnt to be sure temporay nodes are not reclaimed */ + /* NB: bump the refcnt to be sure temporary nodes are not reclaimed */ ieee80211_ref_node(ni); if (ni->ni_associd != 0) IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_DEAUTH, reason); @@ -1757,6 +1757,28 @@ _ieee80211_free_node(struct ieee80211_no ni->ni_ic->ic_node_free(ni); } +/* + * Clear any entry in the unicast key mapping table. + */ +static int +node_clear_keyixmap(struct ieee80211_node_table *nt, struct ieee80211_node *ni) +{ + ieee80211_keyix keyix; + + keyix = ni->ni_ucastkey.wk_rxkeyix; + if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax && + nt->nt_keyixmap[keyix] == ni) { + IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, + "%s: %p<%s> clear key map entry %u\n", + __func__, ni, ether_sprintf(ni->ni_macaddr), keyix); + nt->nt_keyixmap[keyix] = NULL; + ieee80211_node_decref(ni); + return 1; + } + + return 0; +} + void #ifdef IEEE80211_DEBUG_REFCNT ieee80211_free_node_debug(struct ieee80211_node *ni, const char *func, int line) @@ -1778,24 +1800,9 @@ ieee80211_free_node(struct ieee80211_nod * Last reference, reclaim state. */ _ieee80211_free_node(ni); - } else if (ieee80211_node_refcnt(ni) == 1 && - nt->nt_keyixmap != NULL) { - ieee80211_keyix keyix; - /* - * Check for a last reference in the key mapping table. - */ - keyix = ni->ni_ucastkey.wk_rxkeyix; - if (keyix < nt->nt_keyixmax && - nt->nt_keyixmap[keyix] == ni) { - IEEE80211_DPRINTF(ni->ni_vap, - IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry", __func__, - ni, ether_sprintf(ni->ni_macaddr)); - nt->nt_keyixmap[keyix] = NULL; - ieee80211_node_decref(ni); /* XXX needed? */ + } else if (ieee80211_node_refcnt(ni) == 1) + if (node_clear_keyixmap(nt, ni)) _ieee80211_free_node(ni); - } - } IEEE80211_NODE_UNLOCK(nt); } else { if (ieee80211_node_dectestref(ni)) @@ -1863,7 +1870,6 @@ ieee80211_node_delucastkey(struct ieee80 static void node_reclaim(struct ieee80211_node_table *nt, struct ieee80211_node *ni) { - ieee80211_keyix keyix; IEEE80211_NODE_LOCK_ASSERT(nt); @@ -1878,15 +1884,7 @@ node_reclaim(struct ieee80211_node_table * table. We cannot depend on the mapping table entry * being cleared because the node may not be free'd. */ - keyix = ni->ni_ucastkey.wk_rxkeyix; - if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax && - nt->nt_keyixmap[keyix] == ni) { - IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry %u\n", - __func__, ni, ether_sprintf(ni->ni_macaddr), keyix); - nt->nt_keyixmap[keyix] = NULL; - ieee80211_node_decref(ni); /* NB: don't need free */ - } + (void)node_clear_keyixmap(nt, ni); if (!ieee80211_node_dectestref(ni)) { /* * Other references are present, just remove the From owner-svn-src-head@FreeBSD.ORG Mon May 4 00:32:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40956234; Mon, 4 May 2015 00:32: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 2F53C1FBB; Mon, 4 May 2015 00:32: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 t440WBlA026041; Mon, 4 May 2015 00:32:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t440WBwD026040; Mon, 4 May 2015 00:32:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505040032.t440WBwD026040@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 4 May 2015 00:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282405 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 00:32:11 -0000 Author: adrian Date: Mon May 4 00:32:10 2015 New Revision: 282405 URL: https://svnweb.freebsd.org/changeset/base/282405 Log: Use bssid validation for data frames only + add RUN -> RUN state transition However, IBSS merge will be performed only if a driver calls ieee80211_ibss_merge(); so, this applicable to the ath(4) only. Also, this should fix bug 167870. PR: kern/199632 Submitted by: Andriy Voskoboinyk Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Mon May 4 00:29:19 2015 (r282404) +++ head/sys/net80211/ieee80211_adhoc.c Mon May 4 00:32:10 2015 (r282405) @@ -229,6 +229,8 @@ adhoc_newstate(struct ieee80211vap *vap, } #endif break; + case IEEE80211_S_RUN: /* IBSS merge */ + break; default: goto invalid; } @@ -369,7 +371,10 @@ adhoc_input(struct ieee80211_node *ni, s /* * Validate the bssid. */ - if (!IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) && + if (!(type == IEEE80211_FC0_TYPE_MGT && + (subtype == IEEE80211_FC0_SUBTYPE_BEACON || + subtype == IEEE80211_FC0_SUBTYPE_PROBE_REQ)) && + !IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) && !IEEE80211_ADDR_EQ(bssid, ifp->if_broadcastaddr)) { /* not interested in */ IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, @@ -409,7 +414,7 @@ adhoc_input(struct ieee80211_node *ni, s } IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; - if (HAS_SEQ(type)) { + if (HAS_SEQ(type) && IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { uint8_t tid = ieee80211_gettid(wh); if (IEEE80211_QOS_HAS_SEQ(wh) && TID_TO_WME_AC(tid) >= WME_AC_VI) From owner-svn-src-head@FreeBSD.ORG Mon May 4 00:47:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 336546A7; Mon, 4 May 2015 00:47: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 214AA10F6; Mon, 4 May 2015 00:47: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 t440lM84032189; Mon, 4 May 2015 00:47:23 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t440lMFT032188; Mon, 4 May 2015 00:47:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505040047.t440lMFT032188@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 4 May 2015 00:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282406 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 00:47:23 -0000 Author: adrian Date: Mon May 4 00:47:22 2015 New Revision: 282406 URL: https://svnweb.freebsd.org/changeset/base/282406 Log: Fix string concatenation - "wlan_##name" -> "wlan_" #name PR: kern/197623 Submitted by: Andriy Voskoboinyk Modified: head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Mon May 4 00:32:10 2015 (r282405) +++ head/sys/net80211/ieee80211_freebsd.h Mon May 4 00:47:22 2015 (r282406) @@ -355,8 +355,8 @@ wlan_##name##_modevent(module_t mod, int case MOD_UNLOAD: \ case MOD_QUIESCE: \ if (nrefs) { \ - printf("wlan_##name: still in use (%u dynamic refs)\n",\ - nrefs); \ + printf("wlan_" #name ": still in use " \ + "(%u dynamic refs)\n", nrefs); \ return EBUSY; \ } \ if (type == MOD_UNLOAD) { \ From owner-svn-src-head@FreeBSD.ORG Mon May 4 04:27:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE924707; Mon, 4 May 2015 04:27:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC1D315EE; Mon, 4 May 2015 04:27:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t444ROe5042645; Mon, 4 May 2015 04:27:24 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t444ROCq042644; Mon, 4 May 2015 04:27:24 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505040427.t444ROCq042644@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Mon, 4 May 2015 04:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282407 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 04:27:24 -0000 Author: neel Date: Mon May 4 04:27:23 2015 New Revision: 282407 URL: https://svnweb.freebsd.org/changeset/base/282407 Log: Emulate the 'CMP r/m8, imm8' instruction encountered when booting a Windows Vista guest. Reported by: Leon Dang (ldang@nahannisys.com) MFC after: 1 week Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Mon May 4 00:47:22 2015 (r282406) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Mon May 4 04:27:23 2015 (r282407) @@ -178,14 +178,20 @@ static const struct vie_op one_byte_opco .op_byte = 0x23, .op_type = VIE_OP_TYPE_AND, }, + [0x80] = { + /* Group 1 extended opcode */ + .op_byte = 0x80, + .op_type = VIE_OP_TYPE_GROUP1, + .op_flags = VIE_OP_F_IMM8, + }, [0x81] = { - /* XXX Group 1 extended opcode */ + /* Group 1 extended opcode */ .op_byte = 0x81, .op_type = VIE_OP_TYPE_GROUP1, .op_flags = VIE_OP_F_IMM, }, [0x83] = { - /* XXX Group 1 extended opcode */ + /* Group 1 extended opcode */ .op_byte = 0x83, .op_type = VIE_OP_TYPE_GROUP1, .op_flags = VIE_OP_F_IMM8, @@ -1066,9 +1072,13 @@ emulate_cmp(void *vm, int vcpuid, uint64 rflags2 = getcc(size, op1, op2); break; + case 0x80: case 0x81: case 0x83: /* + * 80 /7 cmp r/m8, imm8 + * REX + 80 /7 cmp r/m8, imm8 + * * 81 /7 cmp r/m16, imm16 * 81 /7 cmp r/m32, imm32 * REX.W + 81 /7 cmp r/m64, imm32 sign-extended to 64 @@ -1084,6 +1094,8 @@ emulate_cmp(void *vm, int vcpuid, uint64 * the status flags. * */ + if (vie->op.op_byte == 0x80) + size = 1; /* get the first operand */ error = memread(vm, vcpuid, gpa, &op1, size, arg); From owner-svn-src-head@FreeBSD.ORG Mon May 4 04:31:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C9A8879; Mon, 4 May 2015 04:31:15 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 23DC51605; Mon, 4 May 2015 04:31:14 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id ED5D8754; Sun, 3 May 2015 21:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1430713868; bh=fAv6xeDxVs1gICJuKb5KVQD+8R+eNt9bhg3tFOEXMGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=C1zMQ7bAg/TbwNT3qFeugU3FDNF5EZpw8VAuAnJvO89mEDTCFfZLR1QLoQ3pYOQTo ulCTGzWMf9cBaOfyYhUy0Z61q/jyEb/lOONoRJCD1Tjq7+IWRHFvhSEPoMCffiHs9i CNxZ0Yi7dh4ziJrP2xP+nvEHRkkaV3b3y7MczmOw= From: Peter Wemm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281643 - head/sys/net Date: Sun, 03 May 2015 21:31:01 -0700 Message-ID: <1897115.Jgl4mMPfrQ@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <201504170639.t3H6dGd7075429@svn.freebsd.org> References: <201504170639.t3H6dGd7075429@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart8078899.yJ8FAozkei"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 04:31:15 -0000 --nextPart8078899.yJ8FAozkei Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday, April 17, 2015 06:39:16 AM Gleb Smirnoff wrote: > Author: glebius > Date: Fri Apr 17 06:39:15 2015 > New Revision: 281643 > URL: https://svnweb.freebsd.org/changeset/base/281643 >=20 > Log: > Bring in if_types.h from projects/ifnet, where types are > defined in enum. >=20 > Modified: > head/sys/net/if_types.h I'm sorry, but this breaks the freebsd.org cluster. 281642 works 281643 fails head with 281643 reverted works IPv6 doesn't work on systems with pf, carp and multiple interfaces. I = have=20 nothing more specific than that. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart8078899.yJ8FAozkei Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVRvYFAAoJEDXWlwnsgJ4EGSEH/RK9c/uutmlMyrqLhHiJ78v9 AUQJtWyGSgXWubRthimrQfAOWJLiv9BCf/bWqjoB+DxiQhi3DwOd48ZX9RFUPsNq +ZAa7YKTKu3p/xYIvTJ7c8tBIFv1fwMrlboaa9wVOT04dAOTKVycETo/RHB9RSKA bA028uu357XzvbiBSZBOMs3PEtLhgLHFwA0Ft6sRnYchaLjHE+0UbNSytwCgZOGs iZrS7x+7FCam3JF2tYMrB3ccgXzbaRmRT5gNvV5TIi+vPVR5avoiXnqTZLIEdEOY jbXlsNdEtrSyWJFimFGYQ/TGKv7pyaApkPfUPjz8Hh0SgzI1yWf26VWAVy9qnc4= =+4Re -----END PGP SIGNATURE----- --nextPart8078899.yJ8FAozkei-- From owner-svn-src-head@FreeBSD.ORG Mon May 4 04:46:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 695FBA9B; Mon, 4 May 2015 04:46:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 542DF1799; Mon, 4 May 2015 04:46:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t444k1WE052316; Mon, 4 May 2015 04:46:01 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t444k0q4052306; Mon, 4 May 2015 04:46:00 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201505040446.t444k0q4052306@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 4 May 2015 04:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282408 - in head: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys contrib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 04:46:01 -0000 Author: cy Date: Mon May 4 04:45:59 2015 New Revision: 282408 URL: https://svnweb.freebsd.org/changeset/base/282408 Log: MFV ntp 4.2.8p2 (r281348) Reviewed by: delphij (suggested MFC) Approved by: roberto Security: CVE-2015-1798, CVE-2015-1799 Security: VuXML ebd84c96-dd7e-11e4-854e-3c970e169bc2 MFC after: 1 month Added: head/contrib/ntp/scripts/update-leap/ - copied from r281348, vendor/ntp/dist/scripts/update-leap/ head/contrib/ntp/sntp/libevent/m4/acx_pthread.m4 - copied unchanged from r281348, vendor/ntp/dist/sntp/libevent/m4/acx_pthread.m4 head/contrib/ntp/sntp/m4/ax_c99_struct_init.m4 - copied unchanged from r281348, vendor/ntp/dist/sntp/m4/ax_c99_struct_init.m4 head/contrib/ntp/sntp/m4/openldap-thread-check.m4 - copied unchanged from r281348, vendor/ntp/dist/sntp/m4/openldap-thread-check.m4 head/contrib/ntp/sntp/m4/openldap.m4 - copied unchanged from r281348, vendor/ntp/dist/sntp/m4/openldap.m4 Deleted: head/contrib/ntp/sntp/libevent/README head/contrib/ntp/sntp/libevent/m4/openldap-thread-check.m4 head/contrib/ntp/sntp/libevent/m4/openldap.m4 head/contrib/ntp/util/jitter.h Modified: head/contrib/ntp/ChangeLog head/contrib/ntp/CommitLog head/contrib/ntp/Makefile.in head/contrib/ntp/NEWS head/contrib/ntp/aclocal.m4 head/contrib/ntp/adjtimed/Makefile.in head/contrib/ntp/clockstuff/Makefile.in head/contrib/ntp/config.h.in head/contrib/ntp/configure head/contrib/ntp/configure.ac head/contrib/ntp/html/build.html head/contrib/ntp/html/miscopt.html head/contrib/ntp/html/sntp.html head/contrib/ntp/include/Makefile.in head/contrib/ntp/include/binio.h head/contrib/ntp/include/isc/Makefile.in head/contrib/ntp/include/mbg_gps166.h head/contrib/ntp/include/ntp.h head/contrib/ntp/include/ntp_calendar.h head/contrib/ntp/include/ntp_fp.h head/contrib/ntp/include/ntp_md5.h head/contrib/ntp/include/ntpd.h head/contrib/ntp/include/parse.h head/contrib/ntp/include/parse_conf.h head/contrib/ntp/kernel/Makefile.in head/contrib/ntp/kernel/sys/Makefile.in head/contrib/ntp/kernel/sys/parsestreams.h head/contrib/ntp/lib/isc/inet_ntop.c head/contrib/ntp/lib/isc/log.c head/contrib/ntp/lib/isc/result.c head/contrib/ntp/lib/isc/unix/file.c head/contrib/ntp/lib/isc/unix/ifiter_getifaddrs.c head/contrib/ntp/lib/isc/unix/ifiter_ioctl.c head/contrib/ntp/lib/isc/unix/net.c head/contrib/ntp/libntp/Makefile.in head/contrib/ntp/libntp/ntp_calendar.c head/contrib/ntp/libntp/work_fork.c head/contrib/ntp/libparse/Makefile.in head/contrib/ntp/libparse/clk_computime.c head/contrib/ntp/libparse/clk_dcf7000.c head/contrib/ntp/libparse/clk_hopf6021.c head/contrib/ntp/libparse/clk_meinberg.c head/contrib/ntp/libparse/clk_rawdcf.c head/contrib/ntp/libparse/clk_rcc8000.c head/contrib/ntp/libparse/clk_schmid.c head/contrib/ntp/libparse/clk_sel240x.c head/contrib/ntp/libparse/clk_trimtaip.c head/contrib/ntp/libparse/clk_trimtsip.c head/contrib/ntp/libparse/clk_varitext.c head/contrib/ntp/libparse/clk_wharton.c head/contrib/ntp/libparse/data_mbg.c head/contrib/ntp/libparse/gpstolfp.c head/contrib/ntp/libparse/parse.c head/contrib/ntp/libparse/parse_conf.c head/contrib/ntp/libparse/parsesolaris.c head/contrib/ntp/libparse/parsestreams.c head/contrib/ntp/libparse/trim_info.c head/contrib/ntp/ntpd/Makefile.in head/contrib/ntp/ntpd/cmd_args.c head/contrib/ntp/ntpd/invoke-ntp.conf.texi head/contrib/ntp/ntpd/invoke-ntp.keys.texi head/contrib/ntp/ntpd/invoke-ntpd.texi head/contrib/ntp/ntpd/keyword-gen-utd head/contrib/ntp/ntpd/keyword-gen.c head/contrib/ntp/ntpd/ntp.conf.5man head/contrib/ntp/ntpd/ntp.conf.5mdoc head/contrib/ntp/ntpd/ntp.conf.def head/contrib/ntp/ntpd/ntp.conf.html head/contrib/ntp/ntpd/ntp.conf.man.in head/contrib/ntp/ntpd/ntp.conf.mdoc.in head/contrib/ntp/ntpd/ntp.keys.5man head/contrib/ntp/ntpd/ntp.keys.5mdoc head/contrib/ntp/ntpd/ntp.keys.html head/contrib/ntp/ntpd/ntp.keys.man.in head/contrib/ntp/ntpd/ntp.keys.mdoc.in head/contrib/ntp/ntpd/ntp_config.c head/contrib/ntp/ntpd/ntp_control.c head/contrib/ntp/ntpd/ntp_crypto.c head/contrib/ntp/ntpd/ntp_keyword.h head/contrib/ntp/ntpd/ntp_leapsec.c head/contrib/ntp/ntpd/ntp_loopfilter.c head/contrib/ntp/ntpd/ntp_parser.c head/contrib/ntp/ntpd/ntp_parser.h head/contrib/ntp/ntpd/ntp_peer.c head/contrib/ntp/ntpd/ntp_proto.c head/contrib/ntp/ntpd/ntpd-opts.c head/contrib/ntp/ntpd/ntpd-opts.h head/contrib/ntp/ntpd/ntpd.1ntpdman head/contrib/ntp/ntpd/ntpd.1ntpdmdoc head/contrib/ntp/ntpd/ntpd.c head/contrib/ntp/ntpd/ntpd.html head/contrib/ntp/ntpd/ntpd.man.in head/contrib/ntp/ntpd/ntpd.mdoc.in head/contrib/ntp/ntpd/ntpdbase-opts.def head/contrib/ntp/ntpd/refclock_palisade.c head/contrib/ntp/ntpd/refclock_palisade.h head/contrib/ntp/ntpd/refclock_parse.c head/contrib/ntp/ntpdate/Makefile.in head/contrib/ntp/ntpdc/Makefile.in head/contrib/ntp/ntpdc/invoke-ntpdc.texi head/contrib/ntp/ntpdc/ntpdc-opts.c head/contrib/ntp/ntpdc/ntpdc-opts.h head/contrib/ntp/ntpdc/ntpdc.1ntpdcman head/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc head/contrib/ntp/ntpdc/ntpdc.html head/contrib/ntp/ntpdc/ntpdc.man.in head/contrib/ntp/ntpdc/ntpdc.mdoc.in head/contrib/ntp/ntpq/Makefile.in head/contrib/ntp/ntpq/invoke-ntpq.texi head/contrib/ntp/ntpq/ntpq-opts.c head/contrib/ntp/ntpq/ntpq-opts.h head/contrib/ntp/ntpq/ntpq-subs.c head/contrib/ntp/ntpq/ntpq.1ntpqman head/contrib/ntp/ntpq/ntpq.1ntpqmdoc head/contrib/ntp/ntpq/ntpq.html head/contrib/ntp/ntpq/ntpq.man.in head/contrib/ntp/ntpq/ntpq.mdoc.in head/contrib/ntp/ntpsnmpd/Makefile.in head/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc head/contrib/ntp/ntpsnmpd/ntpsnmpd.html head/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in head/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in head/contrib/ntp/packageinfo.sh head/contrib/ntp/parseutil/Makefile.in head/contrib/ntp/parseutil/dcfd.c head/contrib/ntp/parseutil/testdcf.c head/contrib/ntp/scripts/Makefile.am head/contrib/ntp/scripts/Makefile.in head/contrib/ntp/scripts/build/Makefile.in head/contrib/ntp/scripts/calc_tickadj/Makefile.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in head/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi head/contrib/ntp/scripts/invoke-plot_summary.texi head/contrib/ntp/scripts/invoke-summary.texi head/contrib/ntp/scripts/lib/Makefile.in head/contrib/ntp/scripts/lib/NTP/Util.pm head/contrib/ntp/scripts/ntp-wait/Makefile.in head/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi head/contrib/ntp/scripts/ntp-wait/ntp-wait-opts head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc head/contrib/ntp/scripts/ntp-wait/ntp-wait.html head/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in head/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in head/contrib/ntp/scripts/ntpsweep/Makefile.in head/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi head/contrib/ntp/scripts/ntpsweep/ntpsweep-opts head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc head/contrib/ntp/scripts/ntpsweep/ntpsweep.html head/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in head/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in head/contrib/ntp/scripts/ntptrace/Makefile.in head/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi head/contrib/ntp/scripts/ntptrace/ntptrace-opts head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc head/contrib/ntp/scripts/ntptrace/ntptrace.html head/contrib/ntp/scripts/ntptrace/ntptrace.man.in head/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in head/contrib/ntp/scripts/plot_summary-opts head/contrib/ntp/scripts/plot_summary.1plot_summaryman head/contrib/ntp/scripts/plot_summary.1plot_summarymdoc head/contrib/ntp/scripts/plot_summary.html head/contrib/ntp/scripts/plot_summary.man.in head/contrib/ntp/scripts/plot_summary.mdoc.in head/contrib/ntp/scripts/summary-opts head/contrib/ntp/scripts/summary.1summaryman head/contrib/ntp/scripts/summary.1summarymdoc head/contrib/ntp/scripts/summary.html head/contrib/ntp/scripts/summary.man.in head/contrib/ntp/scripts/summary.mdoc.in head/contrib/ntp/sntp/Makefile.in head/contrib/ntp/sntp/aclocal.m4 head/contrib/ntp/sntp/configure head/contrib/ntp/sntp/include/Makefile.in head/contrib/ntp/sntp/include/version.def head/contrib/ntp/sntp/include/version.texi head/contrib/ntp/sntp/invoke-sntp.texi head/contrib/ntp/sntp/libevent/ChangeLog head/contrib/ntp/sntp/libevent/Makefile.am head/contrib/ntp/sntp/libevent/Makefile.in head/contrib/ntp/sntp/libevent/WIN32-Code/nmake/event2/event-config.h head/contrib/ntp/sntp/libevent/WIN32-Code/tree.h head/contrib/ntp/sntp/libevent/aclocal.m4 head/contrib/ntp/sntp/libevent/buffer.c head/contrib/ntp/sntp/libevent/bufferevent.c head/contrib/ntp/sntp/libevent/bufferevent_async.c head/contrib/ntp/sntp/libevent/bufferevent_filter.c head/contrib/ntp/sntp/libevent/bufferevent_openssl.c head/contrib/ntp/sntp/libevent/bufferevent_pair.c head/contrib/ntp/sntp/libevent/config.h.in head/contrib/ntp/sntp/libevent/configure head/contrib/ntp/sntp/libevent/configure.ac head/contrib/ntp/sntp/libevent/evbuffer-internal.h head/contrib/ntp/sntp/libevent/evdns.c head/contrib/ntp/sntp/libevent/event.c head/contrib/ntp/sntp/libevent/event_tagging.c head/contrib/ntp/sntp/libevent/evrpc-internal.h head/contrib/ntp/sntp/libevent/evthread-internal.h head/contrib/ntp/sntp/libevent/evthread.c head/contrib/ntp/sntp/libevent/evutil.c head/contrib/ntp/sntp/libevent/evutil_time.c head/contrib/ntp/sntp/libevent/ht-internal.h head/contrib/ntp/sntp/libevent/http-internal.h head/contrib/ntp/sntp/libevent/http.c head/contrib/ntp/sntp/libevent/include/event2/buffer.h head/contrib/ntp/sntp/libevent/include/event2/bufferevent.h head/contrib/ntp/sntp/libevent/include/event2/dns.h head/contrib/ntp/sntp/libevent/include/event2/event.h head/contrib/ntp/sntp/libevent/include/event2/http.h head/contrib/ntp/sntp/libevent/include/event2/listener.h head/contrib/ntp/sntp/libevent/include/event2/util.h head/contrib/ntp/sntp/libevent/kqueue.c head/contrib/ntp/sntp/libevent/listener.c head/contrib/ntp/sntp/libevent/sample/http-server.c head/contrib/ntp/sntp/libevent/sample/https-client.c head/contrib/ntp/sntp/libevent/sample/include.am head/contrib/ntp/sntp/libevent/test/include.am head/contrib/ntp/sntp/libevent/test/regress.c head/contrib/ntp/sntp/libevent/test/regress.h head/contrib/ntp/sntp/libevent/test/regress_buffer.c head/contrib/ntp/sntp/libevent/test/regress_bufferevent.c head/contrib/ntp/sntp/libevent/test/regress_dns.c head/contrib/ntp/sntp/libevent/test/regress_finalize.c head/contrib/ntp/sntp/libevent/test/regress_http.c head/contrib/ntp/sntp/libevent/test/regress_main.c head/contrib/ntp/sntp/libevent/test/regress_minheap.c head/contrib/ntp/sntp/libevent/test/regress_ssl.c head/contrib/ntp/sntp/libevent/test/regress_thread.c head/contrib/ntp/sntp/libevent/test/regress_util.c head/contrib/ntp/sntp/libevent/test/regress_zlib.c head/contrib/ntp/sntp/libevent/test/test-fdleak.c head/contrib/ntp/sntp/libevent/test/test-ratelim.c head/contrib/ntp/sntp/libevent/test/test-time.c head/contrib/ntp/sntp/libevent/test/tinytest.c head/contrib/ntp/sntp/libevent/test/tinytest.h head/contrib/ntp/sntp/libevent/test/tinytest_macros.h head/contrib/ntp/sntp/libevent/time-internal.h head/contrib/ntp/sntp/libevent/util-internal.h head/contrib/ntp/sntp/libevent/whatsnew-2.1.txt head/contrib/ntp/sntp/libopts/Makefile.in head/contrib/ntp/sntp/libopts/m4/libopts.m4 head/contrib/ntp/sntp/loc/darwin head/contrib/ntp/sntp/loc/debian head/contrib/ntp/sntp/loc/freebsd head/contrib/ntp/sntp/loc/legacy head/contrib/ntp/sntp/loc/netbsd head/contrib/ntp/sntp/loc/solaris head/contrib/ntp/sntp/m4/ntp_libntp.m4 head/contrib/ntp/sntp/m4/ntp_locinfo.m4 head/contrib/ntp/sntp/m4/version.m4 head/contrib/ntp/sntp/main.c head/contrib/ntp/sntp/scripts/Makefile.in head/contrib/ntp/sntp/sntp-opts.c head/contrib/ntp/sntp/sntp-opts.def head/contrib/ntp/sntp/sntp-opts.h head/contrib/ntp/sntp/sntp.1sntpman head/contrib/ntp/sntp/sntp.1sntpmdoc head/contrib/ntp/sntp/sntp.html head/contrib/ntp/sntp/sntp.man.in head/contrib/ntp/sntp/sntp.mdoc.in head/contrib/ntp/sntp/tests/Makefile.in head/contrib/ntp/tests/Makefile.in head/contrib/ntp/tests/libntp/Makefile.in head/contrib/ntp/tests/ntpd/Makefile.in head/contrib/ntp/util/Makefile.am head/contrib/ntp/util/Makefile.in head/contrib/ntp/util/invoke-ntp-keygen.texi head/contrib/ntp/util/jitter.c head/contrib/ntp/util/ntp-keygen-opts.c head/contrib/ntp/util/ntp-keygen-opts.h head/contrib/ntp/util/ntp-keygen.1ntp-keygenman head/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc head/contrib/ntp/util/ntp-keygen.c head/contrib/ntp/util/ntp-keygen.html head/contrib/ntp/util/ntp-keygen.man.in head/contrib/ntp/util/ntp-keygen.mdoc.in head/usr.sbin/ntp/config.h head/usr.sbin/ntp/scripts/mkver Directory Properties: head/contrib/ntp/ (props changed) Modified: head/contrib/ntp/ChangeLog ============================================================================== --- head/contrib/ntp/ChangeLog Mon May 4 04:27:23 2015 (r282407) +++ head/contrib/ntp/ChangeLog Mon May 4 04:45:59 2015 (r282408) @@ -1,4 +1,80 @@ --- +(4.2.8p2) 2015/04/07 Released by Harlan Stenn +(4.2.8p2-RC3) 2015/04/03 Released by Harlan Stenn + +* [Bug 2763] Fix for different thresholds for forward and backward steps. +--- +(4.2.8p2-RC2) 2015/04/03 Released by Harlan Stenn + +* [Bug 2592] FLAG_TSTAMP_PPS cleanup for refclock_parse.c. +* [Bug 2769] New script: update-leap +* [Bug 2769] cleannup for update-leap +* [Bug 2788] New flag -G (force_step_once). +* [Bug 2794] Clean up kernel clock status reports. +* [Bug 2795] Cannot build without OpenSLL (on Win32). + Provided a Win32 specific wrapper around libevent/arc4random.c. + fixed some minor warnings. +* [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32. +* [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys + on big-endian machines. +* [Bug 2798] sntp should decode and display the leap indicator. +* Simple cleanup to html/build.html +--- +(4.2.8p2-RC1) 2015/03/30 Released by Harlan Stenn + +* [Bug 2794] Don't let reports on normal kernel status changes + look like errors. +* [Bug 2788] New flag -G (force_step_once). +* [Bug 2592] Account for PPS sources which can provide an accurate + absolute time stamp, and status information. + Fixed indention and removed trailing whitespace. +* [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. +* [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument. +* [Bug 2346] "graceful termination" signals do not do peer cleanup. +* [Bug 2728] See if C99-style structure initialization works. +* [Bug 2747] Upgrade libevent to 2.1.5-beta. +* [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. . +* [Bug 2751] jitter.h has stale copies of l_fp macros. +* [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM. +* [Bug 2757] Quiet compiler warnings. +* [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq. +* [Bug 2763] Allow different thresholds for forward and backward steps. +* [Bug 2766] ntp-keygen output files should not be world-readable. +* [Bug 2767] ntp-keygen -M should symlink to ntp.keys. +* [Bug 2771] nonvolatile value is documented in wrong units. +* [Bug 2773] Early leap announcement from Palisade/Thunderbolt +* [Bug 2774] Unreasonably verbose printout - leap pending/warning +* [Bug 2775] ntp-keygen.c fails to compile under Windows. +* [Bug 2777] Fixed loops and decoding of Meinberg GPS satellite info. + Removed non-ASCII characters from some copyright comments. + Removed trailing whitespace. + Updated definitions for Meinberg clocks from current Meinberg header files. + Now use C99 fixed-width types and avoid non-ASCII characters in comments. + Account for updated definitions pulled from Meinberg header files. + Updated comments on Meinberg GPS receivers which are not only called GPS16x. + Replaced some constant numbers by defines from ntp_calendar.h + Modified creation of parse-specific variables for Meinberg devices + in gps16x_message(). + Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates. + Modified mbg_tm_str() which now expexts an additional parameter controlling + if the time status shall be printed. +* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto. +* [Sec 2781] Authentication doesn't protect symmetric associations against + DoS attacks. +* [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE. +* [Bug 2789] Quiet compiler warnings from libevent. +* [Bug 2790] If ntpd sets the Windows MM timer highest resolution + pause briefly before measuring system clock precision to yield + correct results. +* Comment from Juergen Perlinger in ntp_calendar.c to make the code clearer. +* Use predefined function types for parse driver functions + used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast parse conversion results to appropriate types to avoid + compiler warnings. + Let ioctl() for Windows accept a (void *) to avoid compiler warnings + when called with pointers to different types. +--- (4.2.8p1) 2015/02/04 Released by Harlan Stenn * Update the NEWS file. @@ -14,7 +90,7 @@ (This should work for all versions of Windows >= W2K) * [Bug 2738] Missing buffer initialization in refclocK_parse.c::parsestate(). * [Bug 2739] Parse driver with PPS enabled occasionally evaluates - PPS timestamp with wrong sign. + PPS timestamp with wrong sign. Removed some German umlauts. * [Bug 2740] Removed some obsolete code from the parse driver. * [Bug 2741] Incorrect buffer check in refclocK_parse.c::parsestatus(). @@ -94,7 +170,7 @@ * [Bug 2678] nmea_control() now checks 'refclock_params()' result. (4.2.7p481) 2014/11/22 Released by Harlan Stenn * [Bug 2314] Only enable PPS if kernel consumer binding succeeds. -* [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition. +* [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition. * Rename pps_enable to hardpps_enable. (4.2.7p480) 2014/11/21 Released by Harlan Stenn * [Bug 2677] PATH_MAX isn't #define'd under Windows. Modified: head/contrib/ntp/CommitLog ============================================================================== --- head/contrib/ntp/CommitLog Mon May 4 04:27:23 2015 (r282407) +++ head/contrib/ntp/CommitLog Mon May 4 04:45:59 2015 (r282408) @@ -1,3 +1,2569 @@ +ChangeSet@1.3320, 2015-04-07 04:28:16-04:00, stenn@deacon.udel.edu + NTP_4_2_8P2 + TAG: NTP_4_2_8P2 + + ChangeLog@1.1633 +1 -0 + NTP_4_2_8P2 + + ntpd/invoke-ntp.conf.texi@1.182 +1 -1 + NTP_4_2_8P2 + + ntpd/invoke-ntp.keys.texi@1.178 +1 -1 + NTP_4_2_8P2 + + ntpd/invoke-ntpd.texi@1.495 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.conf.5man@1.216 +3 -3 + NTP_4_2_8P2 + + ntpd/ntp.conf.5mdoc@1.216 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.conf.html@1.173 +1 -1 + NTP_4_2_8P2 + + ntpd/ntp.conf.man.in@1.216 +3 -3 + NTP_4_2_8P2 + + ntpd/ntp.conf.mdoc.in@1.216 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.5man@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.5mdoc@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.html@1.174 +1 -1 + NTP_4_2_8P2 + + ntpd/ntp.keys.man.in@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.mdoc.in@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntpd-opts.c@1.517 +245 -245 + NTP_4_2_8P2 + + ntpd/ntpd-opts.h@1.516 +3 -3 + NTP_4_2_8P2 + + ntpd/ntpd.1ntpdman@1.324 +3 -3 + NTP_4_2_8P2 + + ntpd/ntpd.1ntpdmdoc@1.324 +2 -2 + NTP_4_2_8P2 + + ntpd/ntpd.html@1.168 +2 -2 + NTP_4_2_8P2 + + ntpd/ntpd.man.in@1.324 +3 -3 + NTP_4_2_8P2 + + ntpd/ntpd.mdoc.in@1.324 +2 -2 + NTP_4_2_8P2 + + ntpdc/invoke-ntpdc.texi@1.492 +2 -2 + NTP_4_2_8P2 + + ntpdc/ntpdc-opts.c@1.510 +107 -107 + NTP_4_2_8P2 + + ntpdc/ntpdc-opts.h@1.509 +3 -3 + NTP_4_2_8P2 + + ntpdc/ntpdc.1ntpdcman@1.323 +3 -3 + NTP_4_2_8P2 + + ntpdc/ntpdc.1ntpdcmdoc@1.323 +2 -2 + NTP_4_2_8P2 + + ntpdc/ntpdc.html@1.336 +2 -2 + NTP_4_2_8P2 + + ntpdc/ntpdc.man.in@1.323 +3 -3 + NTP_4_2_8P2 + + ntpdc/ntpdc.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2 + + ntpq/invoke-ntpq.texi@1.498 +2 -2 + NTP_4_2_8P2 + + ntpq/ntpq-opts.c@1.515 +106 -106 + NTP_4_2_8P2 + + ntpq/ntpq-opts.h@1.513 +3 -3 + NTP_4_2_8P2 + + ntpq/ntpq.1ntpqman@1.326 +3 -3 + NTP_4_2_8P2 + + ntpq/ntpq.1ntpqmdoc@1.326 +2 -2 + NTP_4_2_8P2 + + ntpq/ntpq.html@1.165 +2 -2 + NTP_4_2_8P2 + + ntpq/ntpq.man.in@1.326 +3 -3 + NTP_4_2_8P2 + + ntpq/ntpq.mdoc.in@1.326 +2 -2 + NTP_4_2_8P2 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.494 +2 -2 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd-opts.c@1.512 +68 -68 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd-opts.h@1.511 +3 -3 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.323 +3 -3 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.323 +2 -2 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.html@1.163 +1 -1 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.man.in@1.323 +3 -3 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2 + + packageinfo.sh@1.509 +2 -2 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.84 +3 -3 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.85 +2 -2 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.html@1.86 +1 -1 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.man.in@1.83 +3 -3 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.85 +2 -2 + NTP_4_2_8P2 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.88 +1 -1 + NTP_4_2_8P2 + + scripts/invoke-plot_summary.texi@1.105 +2 -2 + NTP_4_2_8P2 + + scripts/invoke-summary.texi@1.105 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.315 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait-opts@1.51 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.312 +3 -3 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.313 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.html@1.332 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.man.in@1.312 +3 -3 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.313 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.91 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.html@1.104 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.man.in@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.92 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/invoke-ntptrace.texi@1.104 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.1ntptraceman@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.92 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.html@1.105 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.man.in@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.mdoc.in@1.93 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary.1plot_summaryman@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/plot_summary.1plot_summarymdoc@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary.html@1.106 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary.man.in@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/plot_summary.mdoc.in@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/summary-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/summary.1summaryman@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/summary.1summarymdoc@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/summary.html@1.106 +2 -2 + NTP_4_2_8P2 + + scripts/summary.man.in@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/summary.mdoc.in@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/update-leap/invoke-update-leap.texi@1.4 +1 -1 + NTP_4_2_8P2 + + scripts/update-leap/update-leap-opts@1.4 +2 -2 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.1update-leapman@1.4 +3 -3 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.1update-leapmdoc@1.4 +2 -2 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.html@1.4 +1 -1 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.man.in@1.4 +3 -3 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.mdoc.in@1.4 +2 -2 + NTP_4_2_8P2 + + sntp/invoke-sntp.texi@1.492 +2 -2 + NTP_4_2_8P2 + + sntp/sntp-opts.c@1.511 +159 -159 + NTP_4_2_8P2 + + sntp/sntp-opts.h@1.509 +3 -3 + NTP_4_2_8P2 + + sntp/sntp.1sntpman@1.327 +3 -3 + NTP_4_2_8P2 + + sntp/sntp.1sntpmdoc@1.327 +2 -2 + NTP_4_2_8P2 + + sntp/sntp.html@1.507 +2 -2 + NTP_4_2_8P2 + + sntp/sntp.man.in@1.327 +3 -3 + NTP_4_2_8P2 + + sntp/sntp.mdoc.in@1.327 +2 -2 + NTP_4_2_8P2 + + util/invoke-ntp-keygen.texi@1.495 +2 -2 + NTP_4_2_8P2 + + util/ntp-keygen-opts.c@1.513 +173 -173 + NTP_4_2_8P2 + + util/ntp-keygen-opts.h@1.511 +3 -3 + NTP_4_2_8P2 + + util/ntp-keygen.1ntp-keygenman@1.323 +3 -3 + NTP_4_2_8P2 + + util/ntp-keygen.1ntp-keygenmdoc@1.323 +2 -2 + NTP_4_2_8P2 + + util/ntp-keygen.html@1.169 +2 -2 + NTP_4_2_8P2 + + util/ntp-keygen.man.in@1.323 +3 -3 + NTP_4_2_8P2 + + util/ntp-keygen.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2 + +ChangeSet@1.3319, 2015-04-07 04:05:46-04:00, stenn@deacon.udel.edu + ntp-4.2.8p2 + + packageinfo.sh@1.508 +2 -2 + ntp-4.2.8p2 + +ChangeSet@1.3318, 2015-04-07 07:57:32+00:00, stenn@psp-fb1.ntp.org + NEWS update + + NEWS@1.135 +4 -2 + NEWS update + +ChangeSet@1.3314.1.3, 2015-04-03 03:56:38-04:00, stenn@deacon.udel.edu + NTP_4_2_8P2_RC3 + TAG: NTP_4_2_8P2_RC3 + + ChangeLog@1.1629.1.3 +1 -0 + NTP_4_2_8P2_RC3 + + ntpd/invoke-ntp.conf.texi@1.181 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/invoke-ntp.keys.texi@1.177 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/invoke-ntpd.texi@1.494 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.5man@1.215 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.5mdoc@1.215 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.html@1.172 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.man.in@1.215 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.mdoc.in@1.215 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.5man@1.211 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.5mdoc@1.211 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.html@1.173 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.man.in@1.211 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.mdoc.in@1.211 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntpd-opts.c@1.516 +7 -7 + NTP_4_2_8P2_RC3 + + ntpd/ntpd-opts.h@1.515 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.1ntpdman@1.323 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.1ntpdmdoc@1.323 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.html@1.167 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.man.in@1.323 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.mdoc.in@1.323 +1 -1 + NTP_4_2_8P2_RC3 + + ntpdc/invoke-ntpdc.texi@1.491 +2 -2 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc-opts.c@1.509 +7 -7 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc-opts.h@1.508 +3 -3 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.1ntpdcman@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.1ntpdcmdoc@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.html@1.335 +2 -2 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.mdoc.in@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + ntpq/invoke-ntpq.texi@1.497 +2 -2 + NTP_4_2_8P2_RC3 + + ntpq/ntpq-opts.c@1.514 +7 -7 + NTP_4_2_8P2_RC3 + + ntpq/ntpq-opts.h@1.512 +3 -3 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.1ntpqman@1.325 +3 -3 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.1ntpqmdoc@1.325 +1 -1 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.html@1.164 +2 -2 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.man.in@1.325 +3 -3 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.mdoc.in@1.325 +1 -1 + NTP_4_2_8P2_RC3 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.493 +2 -2 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd-opts.c@1.511 +7 -7 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd-opts.h@1.510 +3 -3 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.html@1.162 +1 -1 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + packageinfo.sh@1.507 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.83 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.84 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.html@1.85 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.man.in@1.82 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.84 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.87 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/invoke-plot_summary.texi@1.104 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/invoke-summary.texi@1.104 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.314 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait-opts@1.50 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.311 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.312 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.html@1.331 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.man.in@1.311 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.312 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.102 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.90 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.html@1.103 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.man.in@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.91 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/invoke-ntptrace.texi@1.103 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.1ntptraceman@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.91 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.html@1.104 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.man.in@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.mdoc.in@1.92 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/plot_summary-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.1plot_summaryman@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.1plot_summarymdoc@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.html@1.105 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.man.in@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.mdoc.in@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/summary-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/summary.1summaryman@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/summary.1summarymdoc@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/summary.html@1.105 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/summary.man.in@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/summary.mdoc.in@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/update-leap/invoke-update-leap.texi@1.3 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap-opts@1.3 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.1update-leapman@1.3 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.1update-leapmdoc@1.3 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.html@1.3 +6 -5 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.man.in@1.3 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.mdoc.in@1.3 +1 -1 + NTP_4_2_8P2_RC3 + + sntp/invoke-sntp.texi@1.491 +2 -2 + NTP_4_2_8P2_RC3 + + sntp/sntp-opts.c@1.510 +7 -7 + NTP_4_2_8P2_RC3 + + sntp/sntp-opts.h@1.508 +3 -3 + NTP_4_2_8P2_RC3 + + sntp/sntp.1sntpman@1.326 +3 -3 + NTP_4_2_8P2_RC3 + + sntp/sntp.1sntpmdoc@1.326 +1 -1 + NTP_4_2_8P2_RC3 + + sntp/sntp.html@1.506 +2 -2 + NTP_4_2_8P2_RC3 + + sntp/sntp.man.in@1.326 +3 -3 + NTP_4_2_8P2_RC3 + + sntp/sntp.mdoc.in@1.326 +1 -1 + NTP_4_2_8P2_RC3 + + util/invoke-ntp-keygen.texi@1.494 +2 -2 + NTP_4_2_8P2_RC3 + + util/ntp-keygen-opts.c@1.512 +7 -7 + NTP_4_2_8P2_RC3 + + util/ntp-keygen-opts.h@1.510 +3 -3 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.1ntp-keygenman@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.1ntp-keygenmdoc@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.html@1.168 +2 -2 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.mdoc.in@1.322 +1 -1 + NTP_4_2_8P2_RC3 + +ChangeSet@1.3314.1.2, 2015-04-03 03:35:54-04:00, stenn@deacon.udel.edu + [Bug 2763] Fix for different thresholds for forward and backward steps + + ChangeLog@1.1629.1.2 +3 -0 + [Bug 2763] Fix for different thresholds for forward and backward steps + + ntpd/ntp_loopfilter.c@1.183 +2 -2 + [Bug 2763] Fix for different thresholds for forward and backward steps + +ChangeSet@1.3314.1.1, 2015-04-03 01:16:34-04:00, stenn@deacon.udel.edu + NTP_4_2_8P2_RC2 + TAG: NTP_4_2_8P2_RC2 + + ChangeLog@1.1629.1.1 +1 -0 + NTP_4_2_8P2_RC2 + + ntpd/invoke-ntp.conf.texi@1.180 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/invoke-ntp.keys.texi@1.176 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/invoke-ntpd.texi@1.493 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.5man@1.214 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.5mdoc@1.214 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.html@1.171 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.man.in@1.214 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.mdoc.in@1.214 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.5man@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.5mdoc@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.html@1.172 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.man.in@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.mdoc.in@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntpd-opts.c@1.515 +7 -7 + NTP_4_2_8P2_RC2 + + ntpd/ntpd-opts.h@1.514 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.1ntpdman@1.322 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.1ntpdmdoc@1.322 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.html@1.166 +50 -26 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.mdoc.in@1.322 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/invoke-ntpdc.texi@1.490 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc-opts.c@1.508 +7 -7 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc-opts.h@1.507 +3 -3 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.1ntpdcman@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.1ntpdcmdoc@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.html@1.334 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.man.in@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.mdoc.in@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/invoke-ntpq.texi@1.496 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/ntpq-opts.c@1.513 +7 -7 + NTP_4_2_8P2_RC2 + + ntpq/ntpq-opts.h@1.511 +3 -3 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.1ntpqman@1.324 +3 -3 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.1ntpqmdoc@1.324 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.html@1.163 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.man.in@1.324 +3 -3 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.mdoc.in@1.324 +2 -2 + NTP_4_2_8P2_RC2 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.492 +2 -2 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd-opts.c@1.510 +7 -7 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd-opts.h@1.509 +3 -3 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.html@1.161 +1 -1 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.man.in@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + packageinfo.sh@1.506 +1 -1 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.82 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.83 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.html@1.84 +1 -1 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.man.in@1.81 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.83 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.86 +1 -1 + NTP_4_2_8P2_RC2 + + scripts/invoke-plot_summary.texi@1.103 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/invoke-summary.texi@1.103 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.313 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait-opts@1.49 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.310 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.311 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.html@1.330 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.man.in@1.310 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.311 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.101 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep-opts@1.51 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.89 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.89 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.html@1.102 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.man.in@1.89 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.90 +2 -2 + NTP_4_2_8P2_RC2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon May 4 04:52:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19E6BC34; Mon, 4 May 2015 04:52:15 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0080A187E; Mon, 4 May 2015 04:52:15 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id CED87763; Sun, 3 May 2015 21:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1430715133; bh=TBlsR4SLdyi9A8VYs2CqbLTPVvS2kgeOUt08dFIRPE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kbGqRGmIemn+2TDaKF1+NM70VRh2J0d6oWLgZct5X1gJnk0aY+iIaXMEA+dyjEUVY GNFI5F+oqXISZyp4oO/h3S/otJGMG2bLj2XRW+/S5kH7Zi1jtEkchrBnQ2i0kGhUQh bZ2r7gw7S+wraS9ANDBt/tf32KRt5C5b8a/ZJUv8= From: Peter Wemm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281643 - head/sys/net Date: Sun, 03 May 2015 21:52:08 -0700 Message-ID: <1771261.fW4ZlvR2Pp@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <1897115.Jgl4mMPfrQ@overcee.wemm.org> References: <201504170639.t3H6dGd7075429@svn.freebsd.org> <1897115.Jgl4mMPfrQ@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart238538607.hU2ZEmULYq"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 04:52:15 -0000 --nextPart238538607.hU2ZEmULYq Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Sunday, May 03, 2015 09:31:01 PM Peter Wemm wrote: > On Friday, April 17, 2015 06:39:16 AM Gleb Smirnoff wrote: > > Author: glebius > > Date: Fri Apr 17 06:39:15 2015 > > New Revision: 281643 > > URL: https://svnweb.freebsd.org/changeset/base/281643 > >=20 > > Log: > > Bring in if_types.h from projects/ifnet, where types are > > defined in enum. > >=20 > > Modified: > > head/sys/net/if_types.h >=20 > I'm sorry, but this breaks the freebsd.org cluster. >=20 > 281642 works > 281643 fails > head with 281643 reverted works >=20 > IPv6 doesn't work on systems with pf, carp and multiple interfaces. = I have > nothing more specific than that. The kernel is smaller with the enums: text data bss dec hex =20 11438123 730686 2998048 15166857 0xe76d89 =20 11437787 730686 2998048 15166521 0xe76c39 The first is with the #defines, the second is enums. The enums caused = 336 bytes=20 less code to be generated, so presumably the enums enabled some "optimi= zation"=20 that wasn't expected. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart238538607.hU2ZEmULYq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVRvr4AAoJEDXWlwnsgJ4E7/kIALIQZG7zBSG4yRgZffm1QeI3 ElTzB7NbbKXscaSLOjLGL9vOC0oZuMXV3YT8Ub3q5ZlH1l9Ds2XtWtCO6o/AZZRy NdxTghzGcgDHV/oPzOdgAT1FgOjBXfECbO+Us72mujijEg0fGyq20dleVauZqs/r AOZIPLlF9So9TQHm9W2Ja1JlRwO+RNTcG4lat20LRSRVuI/i1Z1XzSeGf2JR1qnA 7hmfq+l5X9j71yP8JYgZAKux1bkRg/g8ugRNejxV6wd5sVhrIqUVLNK/hlJQOjVc bofkwNzE5pNc0nRrnO3tAgtjdOvmE4CAQgfsxxvptm2eL1pQWII3JBFkOfB/G7k= =0Fck -----END PGP SIGNATURE----- --nextPart238538607.hU2ZEmULYq-- From owner-svn-src-head@FreeBSD.ORG Mon May 4 05:15:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B7966C; Mon, 4 May 2015 05:15:18 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 714A01A3E; Mon, 4 May 2015 05:15:18 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 1B1CE777; Sun, 3 May 2015 22:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1430716518; bh=hQO32tgcNvR2LfqFdY3c2D0OGlZzoYcSH/mM/DNONlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=k28lgYeEYH+pbuA7SBufFAbBgUObbUztc5z4W3s7aSvDE9WOQBUHu86toLBvU9ZKo uzYwP80BR1cAlaGz/o4vaztgwjq+sCwtLZeh2pAGJ/4CuR6qeKibMeOcD/J5nxqRCy Yu8N6DgywYweyzAKw77KGUAhjGOHqEkd+KNT64cw= From: Peter Wemm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281643 - head/sys/net Date: Sun, 03 May 2015 22:15:13 -0700 Message-ID: <2092700.7byBvhDAMg@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <1771261.fW4ZlvR2Pp@overcee.wemm.org> References: <201504170639.t3H6dGd7075429@svn.freebsd.org> <1897115.Jgl4mMPfrQ@overcee.wemm.org> <1771261.fW4ZlvR2Pp@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3072967.PFjSqYtG8m"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 05:15:18 -0000 --nextPart3072967.PFjSqYtG8m Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Sunday, May 03, 2015 09:52:08 PM Peter Wemm wrote: > On Sunday, May 03, 2015 09:31:01 PM Peter Wemm wrote: > > On Friday, April 17, 2015 06:39:16 AM Gleb Smirnoff wrote: > > > Author: glebius > > > Date: Fri Apr 17 06:39:15 2015 > > > New Revision: 281643 > > > URL: https://svnweb.freebsd.org/changeset/base/281643 > > >=20 > > > Log: > > > Bring in if_types.h from projects/ifnet, where types are > > > defined in enum. > > >=20 > > > Modified: > > > head/sys/net/if_types.h > >=20 > > I'm sorry, but this breaks the freebsd.org cluster. > >=20 > > 281642 works > > 281643 fails > > head with 281643 reverted works > >=20 > > IPv6 doesn't work on systems with pf, carp and multiple interfaces.= I > > have > > nothing more specific than that. >=20 > The kernel is smaller with the enums: > text data bss dec hex > 11438123 730686 2998048 15166857 0xe76d89 > 11437787 730686 2998048 15166521 0xe76c39 >=20 > The first is with the #defines, the second is enums. The enums cause= d 336 > bytes less code to be generated, so presumably the enums enabled some= > "optimization" that wasn't expected. More data; looking at size *.o in the kernel compile obj directory to s= ee what=20 changes size with enum vs #define: @@ -470,10 +470,10 @@ 1158 124 0 1282 0x502 imgact_shell.o 11617 160 36 11813 0x2e25 in.o 343 0 0 343 0x157 in4_cksum.o =2D 22155 0 0 22155 0x568b in6.o + 22187 0 0 22187 0x56ab in6.o 2084 0 0 2084 0x824 in6_cksum.o 1155 200 0 1355 0x54b in6_gif.o =2D 5208 12 16 5236 0x1474 in6_ifattach.o + 5224 12 16 5252 0x1484 in6_ifattach.o 21933 864 0 22797 0x590d in6_mcast.o 6860 0 0 6860 0x1acc in6_pcb.o 2627 6960 248 9835 0x266b in6_proto.o @@ -750,8 +750,8 @@ 25424 452 0 25876 0x6514 mvs.o 0 24 0 24 0x18 mvs_if.o 5989 268 0 6257 0x1871 mvs_pci.o =2D 17111 388 72 17571 0x44a3 nd6.o =2D 15251 92 48 15391 0x3c1f nd6_nbr.o + 17287 388 72 17747 0x4553 nd6.o + 15366 92 48 15506 0x3c92 nd6_nbr.o 16318 66 16 16400 0x4010 nd6_rtr.o 466 196 8 670 0x29e nehemiah.o 7844 2412 2036 12292 0x3004 netisr.o The size changes are confined to the ipv6 stack. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart3072967.PFjSqYtG8m Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVRwBhAAoJEDXWlwnsgJ4EUwgIAOGXDJRvXPMPr8w1jsULGAHs fKqKASPgx3dEXOuCwxLD7n88Bdgbq53NGjSTIVA2+IVnDXZWN6b1IwrOSnMIhBj7 lO/S+grBIl+Lcu1D/sgKvGXOJJbqlran7ufoAJ4Vp3QKfd4pZBC6jj//fqD2o5jc EMkaiuSogbfu+EBFPS4qEGNFjfboGT28+JkF5vx8Q2T6JT8wUrexOpvliLjD3LnN tBPScju/2PncHlCbN/lKTBACDiHLrFP+I0N4gshHUYf8HEz9fR/urjlGQsRZ+kSR td8N/RJrGD6USZmyL3LTA4AI14TFgr6QwkGYdoB3h9WWQfcy5CA9B91AbEY+2co= =uPbB -----END PGP SIGNATURE----- --nextPart3072967.PFjSqYtG8m-- From owner-svn-src-head@FreeBSD.ORG Mon May 4 05:26:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92BA0276; Mon, 4 May 2015 05:26:25 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 70BA21B2A; Mon, 4 May 2015 05:26:25 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 7D34E780; Sun, 3 May 2015 22:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1430717184; bh=iWzHafUdWRRjQM+jtj79bqmlnEJwauCoNV3vAktS+Q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aU6jVV6+RkxiaUHmzYyeopgin4m5+ZL3C0PhVZQKQzSd3uURr2RTijQXOjahNsmHi 99ppzgI+0lEjrD32fHh3VJSCRVLSWGaIwdCYqx4xgfkqaC2Kcgz4LTMrTxZMffJWQM x0OwnclmdcsHyXRg6KU92A0sZTXnP1UPgCjcU05o= From: Peter Wemm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281643 - head/sys/net Date: Sun, 03 May 2015 22:26:20 -0700 Message-ID: <1668736.kf1P9eBIoh@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <2092700.7byBvhDAMg@overcee.wemm.org> References: <201504170639.t3H6dGd7075429@svn.freebsd.org> <1771261.fW4ZlvR2Pp@overcee.wemm.org> <2092700.7byBvhDAMg@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3110857.r8a3ZQ6AtB"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 05:26:25 -0000 --nextPart3110857.r8a3ZQ6AtB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Sunday, May 03, 2015 10:15:13 PM Peter Wemm wrote: > On Sunday, May 03, 2015 09:52:08 PM Peter Wemm wrote: > > On Sunday, May 03, 2015 09:31:01 PM Peter Wemm wrote: > > > On Friday, April 17, 2015 06:39:16 AM Gleb Smirnoff wrote: > > > > Author: glebius > > > > Date: Fri Apr 17 06:39:15 2015 > > > > New Revision: 281643 > > > > URL: https://svnweb.freebsd.org/changeset/base/281643 > > > >=20 > > > > Log: > > > > Bring in if_types.h from projects/ifnet, where types are > > > > defined in enum. > > > >=20 > > > > Modified: > > > > head/sys/net/if_types.h > > >=20 > > > I'm sorry, but this breaks the freebsd.org cluster. > > >=20 > > > 281642 works > > > 281643 fails > > > head with 281643 reverted works > > >=20 > > > IPv6 doesn't work on systems with pf, carp and multiple interface= s. I > > > have > > > nothing more specific than that. > >=20 > > The kernel is smaller with the enums: > > text data bss dec hex > >=20 > > 11438123 730686 2998048 15166857 0xe76d89 > > 11437787 730686 2998048 15166521 0xe76c39 > >=20 > > The first is with the #defines, the second is enums. The enums cau= sed 336 > > bytes less code to be generated, so presumably the enums enabled so= me > > "optimization" that wasn't expected. >=20 > More data; looking at size *.o in the kernel compile obj directory to= see > what changes size with enum vs #define: > @@ -470,10 +470,10 @@ > 1158 124 0 1282 0x502 imgact_shell.o > 11617 160 36 11813 0x2e25 in.o > 343 0 0 343 0x157 in4_cksum.o > - 22155 0 0 22155 0x568b in6.o > + 22187 0 0 22187 0x56ab in6.o > 2084 0 0 2084 0x824 in6_cksum.o > 1155 200 0 1355 0x54b in6_gif.o > - 5208 12 16 5236 0x1474 in6_ifattach.o > + 5224 12 16 5252 0x1484 in6_ifattach.o > 21933 864 0 22797 0x590d in6_mcast.o > 6860 0 0 6860 0x1acc in6_pcb.o > 2627 6960 248 9835 0x266b in6_proto.o > @@ -750,8 +750,8 @@ > 25424 452 0 25876 0x6514 mvs.o > 0 24 0 24 0x18 mvs_if.o > 5989 268 0 6257 0x1871 mvs_pci.o > - 17111 388 72 17571 0x44a3 nd6.o > - 15251 92 48 15391 0x3c1f nd6_nbr.o > + 17287 388 72 17747 0x4553 nd6.o > + 15366 92 48 15506 0x3c92 nd6_nbr.o > 16318 66 16 16400 0x4010 nd6_rtr.o > 466 196 8 670 0x29e nehemiah.o > 7844 2412 2036 12292 0x3004 netisr.o >=20 > The size changes are confined to the ipv6 stack. I've just been pointed to the #ifdef IFT_* fix for this, at about the s= ame time=20 I was looking at the C code. Sigh, fixed already, I believe. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart3110857.r8a3ZQ6AtB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVRwL8AAoJEDXWlwnsgJ4Eo68IALMHjqsJdX9Ri2jBmfNuv5xQ Verj51PrijOwkp1EbIac8bt37xVAblAOs7QXiooj2fP/E8AhsH52Q00EAC5rDVVp vyTBo246qcW1Gge16sVH8rPjUwSjJNAdBR0ATAU4dy2MW06jPkI9L9eSa/qiUfhf lnyfcQcXb8GSZQ9bJEh1eid1Ik3a8skAZ8XkdzkoM74RK9lW3T6or3W4LAMpGst/ a4I/Fd4KK49WTNrQUW12xV8PUm+RMcDpUwyz+Qd1ptuJkDHDir3H14gpjKS7cTiv HuJqvMHMuoOP5+YL8u1H0//W6dfQ8t7/eOjP24hStdgHeXtLf1DzDdmQqgBwYkM= =CDkw -----END PGP SIGNATURE----- --nextPart3110857.r8a3ZQ6AtB-- From owner-svn-src-head@FreeBSD.ORG Mon May 4 12:42:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 627ABA7D; Mon, 4 May 2015 12:42: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 37FE419A7; Mon, 4 May 2015 12:42: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 t44CgrtB090710; Mon, 4 May 2015 12:42:53 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44CgrTd090709; Mon, 4 May 2015 12:42:53 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201505041242.t44CgrTd090709@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 4 May 2015 12:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282415 - head/usr.sbin/ntp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 12:42:53 -0000 Author: cy Date: Mon May 4 12:42:52 2015 New Revision: 282415 URL: https://svnweb.freebsd.org/changeset/base/282415 Log: Restore CPU dependent compile time conditionals. MFC after: 1 month (with r281143 and r282408) Modified: head/usr.sbin/ntp/config.h Modified: head/usr.sbin/ntp/config.h ============================================================================== --- head/usr.sbin/ntp/config.h Mon May 4 09:33:57 2015 (r282414) +++ head/usr.sbin/ntp/config.h Mon May 4 12:42:52 2015 (r282415) @@ -1469,13 +1469,21 @@ /* #undef SCO5_CLOCK */ /* The size of `char*', as computed by sizeof. */ +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) #define SIZEOF_CHARP 8 +#else +#define SIZEOF_CHARP 4 +#endif /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) #define SIZEOF_LONG 8 +#else +#define SIZEOF_LONG 4 +#endif /* The size of `long long', as computed by sizeof. */ #define SIZEOF_LONG_LONG 8 @@ -1490,7 +1498,11 @@ #define SIZEOF_SIGNED_CHAR 1 /* The size of `time_t', as computed by sizeof. */ +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) #define SIZEOF_TIME_T 8 +#else +#define SIZEOF_TIME_T 4 +#endif /* Does SIOCGIFCONF return size in the buffer? */ /* #undef SIZE_RETURNED_IN_BUFFER */ @@ -1516,7 +1528,15 @@ /* #undef STRERROR_R_CHAR_P */ /* canonical system (cpu-vendor-os) of where we should run */ -#define STR_SYSTEM "amd64-portbld-freebsd10.1" +#if defined(__alpha__) +#define STR_SYSTEM "alpha-undermydesk-freebsd" +#elif defined(__sparc64__) +#define STR_SYSTEM "sparc64-undermydesk-freebsd" +#elif defined(__amd64__) +#define STR_SYSTEM "amd64-undermydesk-freebsd" +#else +#define STR_SYSTEM "i386-undermydesk-freebsd" +#endif /* Does Xettimeofday take 1 arg? */ /* #undef SYSV_TIMEOFDAY */ From owner-svn-src-head@FreeBSD.ORG Mon May 4 13:29:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AF916F5; Mon, 4 May 2015 13:29:38 +0000 (UTC) Received: from relay.mailchannels.net (ar-005-i191.relay.mailchannels.net [162.253.144.73]) by mx1.freebsd.org (Postfix) with ESMTP id AC1231E51; Mon, 4 May 2015 13:29:35 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp4.ore.mailhop.org (ip-10-213-14-133.us-west-2.compute.internal [10.213.14.133]) by relay.mailchannels.net (Postfix) with ESMTPA id CF53E12181A; Mon, 4 May 2015 13:29:27 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp4.ore.mailhop.org (smtp4.ore.mailhop.org [10.45.8.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Mon, 04 May 2015 13:29:28 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1430746168194:1522415573 X-MC-Ingress-Time: 1430746168194 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp4.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YpGR3-0000tG-Ts; Mon, 04 May 2015 13:29:26 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t44DTMqP060255; Mon, 4 May 2015 07:29:22 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX18ycSAWKQ9f/AqM/LM6F3J/ Message-ID: <1430746162.6170.74.camel@freebsd.org> Subject: Re: svn commit: r282415 - head/usr.sbin/ntp From: Ian Lepore To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 04 May 2015 07:29:22 -0600 In-Reply-To: <201505041242.t44CgrTd090709@svn.freebsd.org> References: <201505041242.t44CgrTd090709@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 13:29:38 -0000 On Mon, 2015-05-04 at 12:42 +0000, Cy Schubert wrote: > Author: cy > Date: Mon May 4 12:42:52 2015 > New Revision: 282415 > URL: https://svnweb.freebsd.org/changeset/base/282415 > > Log: > Restore CPU dependent compile time conditionals. > > MFC after: 1 month (with r281143 and r282408) > > Modified: > head/usr.sbin/ntp/config.h > > Modified: head/usr.sbin/ntp/config.h > ============================================================================== > --- head/usr.sbin/ntp/config.h Mon May 4 09:33:57 2015 (r282414) > +++ head/usr.sbin/ntp/config.h Mon May 4 12:42:52 2015 (r282415) > @@ -1469,13 +1469,21 @@ > /* #undef SCO5_CLOCK */ > > /* The size of `char*', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_CHARP 8 > +#else > +#define SIZEOF_CHARP 4 > +#endif > > /* The size of `int', as computed by sizeof. */ > #define SIZEOF_INT 4 > > /* The size of `long', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_LONG 8 > +#else > +#define SIZEOF_LONG 4 > +#endif > > /* The size of `long long', as computed by sizeof. */ > #define SIZEOF_LONG_LONG 8 > @@ -1490,7 +1498,11 @@ > #define SIZEOF_SIGNED_CHAR 1 > > /* The size of `time_t', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_TIME_T 8 > +#else > +#define SIZEOF_TIME_T 4 > +#endif > > /* Does SIOCGIFCONF return size in the buffer? */ > /* #undef SIZE_RETURNED_IN_BUFFER */ > @@ -1516,7 +1528,15 @@ > /* #undef STRERROR_R_CHAR_P */ > > /* canonical system (cpu-vendor-os) of where we should run */ > -#define STR_SYSTEM "amd64-portbld-freebsd10.1" > +#if defined(__alpha__) > +#define STR_SYSTEM "alpha-undermydesk-freebsd" > +#elif defined(__sparc64__) > +#define STR_SYSTEM "sparc64-undermydesk-freebsd" > +#elif defined(__amd64__) > +#define STR_SYSTEM "amd64-undermydesk-freebsd" > +#else > +#define STR_SYSTEM "i386-undermydesk-freebsd" > +#endif > > /* Does Xettimeofday take 1 arg? */ > /* #undef SYSV_TIMEOFDAY */ > I suspect arm64 should appear in the same places as amd64. arm (all flavors) should also be in the list of 8-byte time_t. Should NTP_KEYSDIR be /usr/etc rather than /usr/local/etc for the base daemon? (/usr/local shows up in a couple places in config.h) I think WORDS_BIGENDIAN needs to be defined on the platforms where that's true. The list of ifdefs for STR_SYSTEM seems a bit beyond its sell-by date. -- Ian From owner-svn-src-head@FreeBSD.ORG Mon May 4 13:34:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB07BAE2; Mon, 4 May 2015 13:34:09 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 422581FEE; Mon, 4 May 2015 13:34:09 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t44DY0Oe060598 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 4 May 2015 16:34:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t44DY0Oe060598 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t44DY0d1060597; Mon, 4 May 2015 16:34:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 May 2015 16:34:00 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282415 - head/usr.sbin/ntp Message-ID: <20150504133400.GH2390@kib.kiev.ua> References: <201505041242.t44CgrTd090709@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201505041242.t44CgrTd090709@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 13:34:09 -0000 On Mon, May 04, 2015 at 12:42:53PM +0000, Cy Schubert wrote: > Author: cy > Date: Mon May 4 12:42:52 2015 > New Revision: 282415 > URL: https://svnweb.freebsd.org/changeset/base/282415 > > Log: > Restore CPU dependent compile time conditionals. > > MFC after: 1 month (with r281143 and r282408) > > Modified: > head/usr.sbin/ntp/config.h > > Modified: head/usr.sbin/ntp/config.h > ============================================================================== > --- head/usr.sbin/ntp/config.h Mon May 4 09:33:57 2015 (r282414) > +++ head/usr.sbin/ntp/config.h Mon May 4 12:42:52 2015 (r282415) > @@ -1469,13 +1469,21 @@ > /* #undef SCO5_CLOCK */ > > /* The size of `char*', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_CHARP 8 > +#else > +#define SIZEOF_CHARP 4 > +#endif > > /* The size of `int', as computed by sizeof. */ > #define SIZEOF_INT 4 > > /* The size of `long', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_LONG 8 > +#else > +#define SIZEOF_LONG 4 > +#endif > > /* The size of `long long', as computed by sizeof. */ > #define SIZEOF_LONG_LONG 8 > @@ -1490,7 +1498,11 @@ > #define SIZEOF_SIGNED_CHAR 1 > > /* The size of `time_t', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_TIME_T 8 > +#else > +#define SIZEOF_TIME_T 4 > +#endif We definitely do not support alpha. What about other 64bit architectures, like mips64 with 64bit ABI, powerpc64, or arm64 ? From owner-svn-src-head@FreeBSD.ORG Mon May 4 14:23:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFD4869B; Mon, 4 May 2015 14:23: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 AE9561507; Mon, 4 May 2015 14:23: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 t44ENWsl040430; Mon, 4 May 2015 14:23:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44ENWgL040429; Mon, 4 May 2015 14:23:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505041423.t44ENWgL040429@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 4 May 2015 14:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282416 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 14:23:32 -0000 Author: jhb Date: Mon May 4 14:23:31 2015 New Revision: 282416 URL: https://svnweb.freebsd.org/changeset/base/282416 Log: Partially revert r255486, the first argument to socketpair() is a socket domain, not a file descriptor. Use 'domain' instead of the original 'd' for this argument to match socket(2). PR: 199491 Reported by: sp55aa@qq.com MFC after: 1 week Modified: head/lib/libc/sys/socketpair.2 Modified: head/lib/libc/sys/socketpair.2 ============================================================================== --- head/lib/libc/sys/socketpair.2 Mon May 4 12:42:52 2015 (r282415) +++ head/lib/libc/sys/socketpair.2 Mon May 4 14:23:31 2015 (r282416) @@ -28,7 +28,7 @@ .\" @(#)socketpair.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 11, 2013 +.Dd May 4, 2015 .Dt SOCKETPAIR 2 .Os .Sh NAME @@ -40,13 +40,13 @@ .In sys/types.h .In sys/socket.h .Ft int -.Fn socketpair "int fd" "int type" "int protocol" "int *sv" +.Fn socketpair "int domain" "int type" "int protocol" "int *sv" .Sh DESCRIPTION The .Fn socketpair system call creates an unnamed pair of connected sockets in -the specified domain -.Fa fd , +the specified communications +.Fa domain , of the specified .Fa type , and using the optionally specified From owner-svn-src-head@FreeBSD.ORG Mon May 4 14:47:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C106D86; Mon, 4 May 2015 14:47: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 E52B01795; Mon, 4 May 2015 14:47: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 t44El06O050885; Mon, 4 May 2015 14:47:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44El03Y050884; Mon, 4 May 2015 14:47:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505041447.t44El03Y050884@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 4 May 2015 14:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282417 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 14:47:01 -0000 Author: jhb Date: Mon May 4 14:47:00 2015 New Revision: 282417 URL: https://svnweb.freebsd.org/changeset/base/282417 Log: Various updates to the ftruncate(2) documentation: - Note that ftruncate(2) can operate on shared memory objects and cross reference shm_open(2). - Note that ftruncate(2) does not change the file position pointer (aka seek pointer) of the file descriptor. - ftruncate(2) will fail with EINVAL for all sorts of other fd types than just sockets, so instead note that it fails for all but regular files and shared memory objects. - Note that ftruncate(2) also appeared in 4.2BSD along with truncate(2). (Or at least the manpage for both appeared in 4.2, I did not check the kernel code itself to see if either predated 4.2.) PR: 199472 (2) Submitted by: andrew@ugh.net.au (2) MFC after: 1 week Modified: head/lib/libc/sys/truncate.2 Modified: head/lib/libc/sys/truncate.2 ============================================================================== --- head/lib/libc/sys/truncate.2 Mon May 4 14:23:31 2015 (r282416) +++ head/lib/libc/sys/truncate.2 Mon May 4 14:47:00 2015 (r282417) @@ -28,7 +28,7 @@ .\" @(#)truncate.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 13, 2006 +.Dd May 4, 2015 .Dt TRUNCATE 2 .Os .Sh NAME @@ -60,9 +60,18 @@ is lost. If the file was smaller than this size, it will be extended as if by writing bytes with the value zero. -With -.Fn ftruncate , -the file must be open for writing. +.Pp +The +.Fn ftruncate +system call causes the file or shared memory object backing the file descriptor +.Fa fd +to be truncated or extended to +.Fa length +bytes in size. +The file descriptor must be a valid file descriptor open for writing. +The file position pointer associated with the file descriptor +.Fa fd +will not be modified. .Sh RETURN VALUES .Rv -std If the file to be modified is not a directory or @@ -129,7 +138,7 @@ is not a valid descriptor. The .Fa fd argument -references a socket, not a file. +references a file descriptor that is not a regular file or shared memory object. .It Bq Er EINVAL The .Fa fd @@ -138,11 +147,14 @@ is not open for writing. .El .Sh SEE ALSO .Xr chflags 2 , -.Xr open 2 +.Xr open 2 , +.Xr shm_open 2 .Sh HISTORY The .Fn truncate -system call appeared in +and +.Fn ftruncate +system calls appeared in .Bx 4.2 . .Sh BUGS These calls should be generalized to allow ranges From owner-svn-src-head@FreeBSD.ORG Mon May 4 14:55:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B03A41F; Mon, 4 May 2015 14:55: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 59A2218CD; Mon, 4 May 2015 14:55: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 t44EtMxB055655; Mon, 4 May 2015 14:55:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44EtMUc055654; Mon, 4 May 2015 14:55:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505041455.t44EtMUc055654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 4 May 2015 14:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282418 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 14:55:22 -0000 Author: ian Date: Mon May 4 14:55:21 2015 New Revision: 282418 URL: https://svnweb.freebsd.org/changeset/base/282418 Log: On an icache sync by address/len, round the length up if the operation spans a cacheline boundary. PR: 199740 Submitted by: Juergen Weiss Modified: head/sys/arm/arm/cpufunc_asm_armv7.S Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Mon May 4 14:47:00 2015 (r282417) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Mon May 4 14:55:21 2015 (r282418) @@ -266,6 +266,9 @@ END(armv7_icache_sync_all) ENTRY_NP(armv7_icache_sync_range) ldr ip, .Larmv7_icache_line_size ldr ip, [ip] + sub r3, ip, #1 /* Address need not be aligned, but */ + and r2, r0, r3 /* round length up if op spans line */ + add r1, r1, r2 /* boundary: len += addr & linemask; */ .Larmv7_sync_next: mcr CP15_DCCMVAC(r0) mcr CP15_ICIMVAU(r0) From owner-svn-src-head@FreeBSD.ORG Mon May 4 15:04:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F613942; Mon, 4 May 2015 15:04:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7F819FC; Mon, 4 May 2015 15:04:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44F4etd060792; Mon, 4 May 2015 15:04:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44F4ePQ060791; Mon, 4 May 2015 15:04:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505041504.t44F4ePQ060791@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 4 May 2015 15:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282419 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 15:04:40 -0000 Author: gjb Date: Mon May 4 15:04:39 2015 New Revision: 282419 URL: https://svnweb.freebsd.org/changeset/base/282419 Log: Add logic to detect if the net/bsdec2-image-upload port needs to be installed. [1] For the cw-ec2-portinstall and ec2ami targets, touch the .TARGET file after completion to prevent duplicate invocations. Add cw-ec2-portinstall and ec2ami to CLEANFILES. Submitted by: cperciva[1] MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Mon May 4 14:55:21 2015 (r282418) +++ head/release/Makefile.ec2 Mon May 4 15:04:39 2015 (r282419) @@ -12,6 +12,15 @@ AMINAMESUFFIX!= date +-%Y-%m-%d PUBLISH= --public .endif +CLEANFILES+= ec2ami + +.if !exists(/usr/local/bin/bsdec2-image-upload) +CW_EC2_PORTINSTALL= cw-ec2-portinstall +CLEANFILES+= ${CW_EC2_PORTINSTALL} +.else +CW_EC2_PORTINSTALL= +.endif + cw-ec2-portinstall: .if exists(${PORTSDIR}/net/bsdec2-image-upload/Makefile) make -C ${PORTSDIR}/net/bsdec2-image-upload BATCH=1 all install clean @@ -21,8 +30,10 @@ cw-ec2-portinstall: . endif env ASSUME_ALWAYS_YES=yes pkg install -y net/bsdec2-image-upload .endif + @touch ${.TARGET} -ec2ami: cw-ec2 cw-ec2-portinstall +ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} + @false .if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE}) @echo "--------------------------------------------------------------" @echo ">>> AWSKEYFILE must point at AWS keys for EC2 AMI creation" @@ -46,3 +57,4 @@ ec2ami: cw-ec2 cw-ec2-portinstall "${TYPE} ${REVISION}-${BRANCH}${AMINAMESUFFIX}" \ "${TYPE} ${REVISION}-${BRANCH}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} + @touch ${.TARGET} From owner-svn-src-head@FreeBSD.ORG Mon May 4 15:45:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC659832; Mon, 4 May 2015 15:45:09 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 875FC1F2A; Mon, 4 May 2015 15:45:09 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 89561B9B0; Mon, 4 May 2015 11:45:08 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Date: Mon, 04 May 2015 09:58:49 -0400 Message-ID: <26088556.xbkUe5VAyp@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150502191000.GE546@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <2197979.EUYqekgM4M@ralph.baldwin.cx> <20150502191000.GE546@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 May 2015 11:45:08 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 15:45:09 -0000 On Saturday, May 02, 2015 10:10:00 PM Gleb Smirnoff wrote: > On Fri, May 01, 2015 at 10:47:43AM -0400, John Baldwin wrote: > J> > J> > While you are here, let me remind you about this plan: > J> > J> > > J> > J> > https://lists.freebsd.org/pipermail/svn-src-head/2014-October/063575.html > J> > J> > > J> > J> > We can prototype the API to userland now, write down a utility that uses > J> > J> > it, or add the functionality to an existing utility. And start with Intel > J> > J> > drivers, that seem to be most interested in extra stats. > J> > J> > J> > J> So the importaing thing here is that if_get_counter() is still doing > J> > J> per-ifnet stats. The stat you underlined above is per-queue instead. > J> > J> We well need more explicitly knowledge of queues outside of drivers > J> > J> and in the stack itself to support a generic framework for per-queue > J> > J> stats. > J> > > J> > This depends on how generic we want the API to be. Of course, we can add > J> > an extra argument to if_get_counter(). > J> > > J> > However, if we don't expect the number of queues to exceed a reasonable > J> > number of 255 :), we can fit the functionality into existing API. > J> > We can keep the queue number in the highest 8 bits of the ift_counter > J> > parameter. > J> > > J> > #define IFCOUNTER_MASK 0x00ffffff > J> > #define IFCOUNTER_QUEUE(c) ((c) >> 24) > J> > J> I'd prefer that expose queues more directly and figure out how to handle > J> per-queue stats then (e.g. do we have some sort of driver-independent > J> structure that each ifnet has 1 or more of that maps to a queue and has > J> driver provided methods, etc. If so you could have a driver method for > J> queue stats). Note that I did use if_get_counter to report the > J> per-interface stats instead of adding a new sysctl. > > What do you prefer: an extra argument to the if_get_counter() or a extra > ifop? As I said, I'd prefer we expose queues to the stack more directly complete with per-queue ops (e.g. I'd like a per-queue if_transmit thing, though probably more like the old if_start). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon May 4 16:28:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 209DF6BC; Mon, 4 May 2015 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 0D17F13D7; Mon, 4 May 2015 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 t44GSvwX002379; Mon, 4 May 2015 16:28:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44GStT1002366; Mon, 4 May 2015 16:28:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505041628.t44GStT1002366@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 16:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282420 - in head: . etc/mtree lib/libevent lib/libucl share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 16:28:58 -0000 Author: bapt Date: Mon May 4 16:28:54 2015 New Revision: 282420 URL: https://svnweb.freebsd.org/changeset/base/282420 Log: Rework PRIVATELIB Now when a lib is marked as PRIVATELIB it is renamed into libprivate$foo instead of being installed in /usr/lib/private and playing with rpath. Also allow to install headers for PRIVATELIBS in that case the headers will be installed in /usr/include/private/$foo Keep the headers under a private namespace to prevent third party build system to easily find them to ensure they are only used on purpose. This allows for non base applications to statically link against a library in base which is linked to a privatelib Treating PRIVATELIBS as regular libraries allows to push them into our current compatX packages if needed. While here finish promotion of libevent as PRIVATELIB Install header for bsdstat and libucl Differential Revision: https://reviews.freebsd.org/D2365 Reviewed by: brooks, des Discussed with: imp Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.usr.dist head/lib/libevent/Makefile head/lib/libucl/Makefile head/share/mk/atf.test.mk head/share/mk/bsd.incs.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk head/share/mk/src.libnames.mk Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 4 15:04:39 2015 (r282419) +++ head/ObsoleteFiles.inc Mon May 4 16:28:54 2015 (r282420) @@ -38,6 +38,29 @@ # xargs -n1 | sort | uniq -d; # done +# 20150504 +OLD_LIBS+=usr/lib32/private/libatf-c++.so.2 +OLD_LIBS+=usr/lib32/private/libbsdstat.so.1 +OLD_LIBS+=usr/lib32/private/libheimipcs.so.11 +OLD_LIBS+=usr/lib32/private/libsqlite3.so.0 +OLD_LIBS+=usr/lib32/private/libunbound.so.5 +OLD_LIBS+=usr/lib32/private/libatf-c.so.1 +OLD_LIBS+=usr/lib32/private/libheimipcc.so.11 +OLD_LIBS+=usr/lib32/private/libldns.so.5 +OLD_LIBS+=usr/lib32/private/libssh.so.5 +OLD_LIBS+=usr/lib32/private/libucl.so.1 +OLD_DIRS+=usr/lib32/private +OLD_LIBS+=usr/lib/private/libatf-c++.so.2 +OLD_LIBS+=usr/lib/private/libbsdstat.so.1 +OLD_LIBS+=usr/lib/private/libheimipcs.so.11 +OLD_LIBS+=usr/lib/private/libsqlite3.so.0 +OLD_LIBS+=usr/lib/private/libunbound.so.5 +OLD_LIBS+=usr/lib/private/libatf-c.so.1 +OLD_LIBS+=usr/lib/private/libheimipcc.so.11 +OLD_LIBS+=usr/lib/private/libldns.so.5 +OLD_LIBS+=usr/lib/private/libssh.so.5 +OLD_LIBS+=usr/lib/private/libucl.so.1 +OLD_DIRS+=usr/lib/private # 20150501 OLD_FILES+=usr/bin/soeliminate OLD_FILES+=usr/share/man/man1/soeliminate.1.gz Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Mon May 4 15:04:39 2015 (r282419) +++ head/etc/mtree/BSD.usr.dist Mon May 4 16:28:54 2015 (r282420) @@ -8,6 +8,12 @@ bin .. include + private + bsdstat + .. + ucl + .. + .. .. lib aout @@ -32,16 +38,12 @@ .. i18n .. - private - .. .. lib32 dtrace .. i18n .. - private - .. .. libdata gcc Modified: head/lib/libevent/Makefile ============================================================================== --- head/lib/libevent/Makefile Mon May 4 15:04:39 2015 (r282419) +++ head/lib/libevent/Makefile Mon May 4 16:28:54 2015 (r282420) @@ -7,7 +7,6 @@ LIB= event SHLIB_MAJOR= 1 PRIVATELIB= -INTERNALLIB= SRCS= buffer.c evbuffer.c event.c kqueue.c log.c poll.c select.c signal.c HDRS= event.h Modified: head/lib/libucl/Makefile ============================================================================== --- head/lib/libucl/Makefile Mon May 4 15:04:39 2015 (r282419) +++ head/lib/libucl/Makefile Mon May 4 16:28:54 2015 (r282420) @@ -14,8 +14,10 @@ SRCS= ucl_emitter_streamline.c \ ucl_util.c \ xxhash.c -.PATH: ${LIBUCL}/src +.PATH: ${LIBUCL}/src \ + ${LIBUCL}/include +INCS= ucl.h LIBADD= m WARNS= 1 Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Mon May 4 15:04:39 2015 (r282419) +++ head/share/mk/atf.test.mk Mon May 4 16:28:54 2015 (r282420) @@ -72,11 +72,10 @@ MAN.${_T}?= # empty SRCS.${_T}?= ${_T}.c DPADD.${_T}+= ${LIBATF_C} .if empty(LDFLAGS:M-static) && empty(LDFLAGS.${_T}:M-static) -LDADD.${_T}+= ${LDATF_C} +LDADD.${_T}+= ${LDADD_atf_c} .else LDADD.${_T}+= ${LIBATF_C} .endif -USEPRIVATELIB+= atf-c TEST_INTERFACE.${_T}= atf .endfor .endif @@ -90,11 +89,10 @@ MAN.${_T}?= # empty SRCS.${_T}?= ${_T}${CXX_SUFFIX:U.cc} DPADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} .if empty(LDFLAGS:M-static) && empty(LDFLAGS.${_T}:M-static) -LDADD.${_T}+= ${LDATF_CXX} ${LDATF_C} +LDADD.${_T}+= ${LDADD_atf_cxx} ${LDADD_atf_c} .else LDADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} .endif -USEPRIVATELIB+= atf-c++ TEST_INTERFACE.${_T}= atf .endfor .endif Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Mon May 4 15:04:39 2015 (r282419) +++ head/share/mk/bsd.incs.mk Mon May 4 16:28:54 2015 (r282420) @@ -23,7 +23,7 @@ all: buildincludes ${group}OWN?= ${BINOWN} ${group}GRP?= ${BINGRP} ${group}MODE?= ${NOBINMODE} -${group}DIR?= ${INCLUDEDIR} +${group}DIR?= ${INCLUDEDIR}${PRIVATELIB:D/private/${LIB}} _${group}INCS= .for header in ${${group}} Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Mon May 4 15:04:39 2015 (r282419) +++ head/share/mk/bsd.lib.mk Mon May 4 16:28:54 2015 (r282420) @@ -11,6 +11,7 @@ _LD= ${CXX} _LD= ${CC} .endif +LIB_PRIVATE= ${PRIVATELIB:Dprivate} # Set up the variables controlling shared libraries. After this section, # SHLIB_NAME will be defined only if we are to create a shared library. # SHLIB_LINK will be defined only if we are to create a link to it. @@ -23,7 +24,7 @@ _LD= ${CC} SHLIB= ${LIB} .endif .if !defined(SHLIB_NAME) && defined(SHLIB) && defined(SHLIB_MAJOR) -SHLIB_NAME= lib${SHLIB}.so.${SHLIB_MAJOR} +SHLIB_NAME= lib${LIB_PRIVATE}${SHLIB}.so.${SHLIB_MAJOR} .endif .if defined(SHLIB_NAME) && !empty(SHLIB_NAME:M*.so.*) SHLIB_LINK?= ${SHLIB_NAME:R} @@ -128,13 +129,8 @@ PO_FLAG=-pg all: beforebuild .WAIT beforebuild: objwarn -.if defined(PRIVATELIB) -_LIBDIR:=${LIBPRIVATEDIR} -_SHLIBDIR:=${LIBPRIVATEDIR} -.else _LIBDIR:=${LIBDIR} _SHLIBDIR:=${SHLIBDIR} -.endif .if defined(SHLIB_NAME) .if ${MK_DEBUG_FILES} != "no" @@ -162,19 +158,15 @@ ${SHLIB_NAME_FULL}: ${VERSION_MAP} LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .endif -.if defined(USEPRIVATELIB) -LDFLAGS+= -rpath ${LIBPRIVATEDIR} -.endif - .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) OBJS+= ${SRCS:N*.h:R:S/$/.o/} NOPATH_FILES+= ${OBJS} .endif .if defined(LIB) && !empty(LIB) -_LIBS= lib${LIB}.a +_LIBS= lib${LIB_PRIVATE}${LIB}.a -lib${LIB}.a: ${OBJS} ${STATICOBJS} +lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} @@ -184,11 +176,11 @@ lib${LIB}.a: ${OBJS} ${STATICOBJS} .if !defined(INTERNALLIB) .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) -_LIBS+= lib${LIB}_p.a +_LIBS+= lib${LIB_PRIVATE}${LIB}_p.a POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} NOPATH_FILES+= ${POBJS} -lib${LIB}_p.a: ${POBJS} +lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD} @@ -243,9 +235,9 @@ ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} .endif #defined(SHLIB_NAME) .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" -_LIBS+= lib${LIB}_pic.a +_LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a -lib${LIB}_pic.a: ${SOBJS} +lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} @@ -305,13 +297,13 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${i realinstall: _libinstall .ORDER: beforeinstall _libinstall _libinstall: -.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" && !defined(PRIVATELIB) +.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${_LIBDIR} + ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR} .endif -.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) && !defined(PRIVATELIB) +.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${_LIBDIR} + ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR} .endif .if defined(SHLIB_NAME) ${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ @@ -325,7 +317,7 @@ _libinstall: ${_INSTALLFLAGS} \ ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR} .endif -.if defined(SHLIB_LINK) && !defined(PRIVATELIB) +.if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory # prefix where shared objects will be installed by the install target. @@ -366,7 +358,7 @@ _libinstall: .endif # SHLIB_LDSCRIPT .endif # SHLIB_LINK .endif # SHIB_NAME -.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" && !defined(PRIVATELIB) +.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR} .endif Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Mon May 4 15:04:39 2015 (r282419) +++ head/share/mk/bsd.prog.mk Mon May 4 16:28:54 2015 (r282420) @@ -51,10 +51,6 @@ STRIP?= -s LDFLAGS+= -static .endif -.if defined(USEPRIVATELIB) -LDFLAGS+= -L${_SHLIBDIRPREFIX}${LIBPRIVATEDIR} -rpath ${LIBPRIVATEDIR} -.endif - .if ${MK_DEBUG_FILES} != "no" PROG_FULL=${PROG}.full # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Mon May 4 15:04:39 2015 (r282419) +++ head/share/mk/src.libnames.mk Mon May 4 16:28:54 2015 (r282420) @@ -15,6 +15,7 @@ _PRIVATELIBS= \ atf_c \ atf_cxx \ bsdstat \ + event \ heimipcc \ heimipcs \ ldns \ @@ -28,7 +29,6 @@ _INTERNALIBS= \ bsnmptools \ cron \ elftc \ - event \ fifolog \ ipf \ lpr \ @@ -233,18 +233,25 @@ _DP_vmmapi= util # Define spacial cases LDADD_supcplusplus= -lsupc++ -LDADD_atf_c= -L${LIBATF_CDIR} -latf-c -LDADD_atf_cxx= -L${LIBATF_CXXDIR} -latf-c++ +LIBATF_C= $(DESTDIR)$(LIBDIR)/libprivateatf-c.a +LIBATF_CXX= $(DESTDIR)$(LIBDIR)/libprivateatf-c++.a +LDADD_atf_c= -lprivateatf-c +LDADD_atf_cxx= -lprivateatf-c++ + +.for _l in ${_PRIVATELIBS} +LIB${_l:tu}?= ${DESTDIR}${LIBDIR}/libprivate${_l}.a +.endfor .for _l in ${_LIBRARIES} -.if ${_PRIVATELIBS:M${_l}} -LDADD_${_l}_L+= -L${LIB${_l:tu}DIR} -.endif .if ${_INTERNALIBS:M${_l}} LDADD_${_l}_L+= -L${LIB${_l:tu}DIR} .endif DPADD_${_l}?= ${LIB${_l:tu}} +.if ${_PRIVATELIBS:M${_l}} +LDADD_${_l}?= -lprivate${_l} +.else LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l} +.endif .if defined(_DP_${_l}) && defined(NO_SHARED) .for _d in ${_DP_${_l}} DPADD_${_l}+= ${DPADD_${_d}} @@ -253,12 +260,12 @@ LDADD_${_l}+= ${LDADD_${_d}} .endif .endfor -DPADD_sqlite3+= ${DPADD_pthread} -LDADD_sqlite3+= ${LDADD_pthread} - DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} +DPADD_sqlite3+= ${DPADD_pthread} +LDADD_sqlite3+= ${LDADD_pthread} + DPADD_fifolog+= ${DPADD_z} LDADD_fifolog+= ${LDADD_z} @@ -290,55 +297,15 @@ LDADD+= ${LDADD_${_l}} .error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". .endif -.if defined(USEPRIVATELIB) -LDFLAGS+= -rpath ${LIBPRIVATEDIR} -.endif - -LIBATF_CDIR= ${ROOTOBJDIR}/lib/atf/libatf-c -LDATF_C?= ${LIBATF_CDIR}/libatf-c.so -LIBATF_C?= ${LIBATF_CDIR}/libatf-c.a - -LIBATF_CXXDIR= ${ROOTOBJDIR}/lib/atf/libatf-c++ -LDATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.so -LIBATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.a - -LIBBSDSTATDIR= ${ROOTOBJDIR}/lib/libbsdstat -LIBBSDSTAT?= ${LIBBSDSTATDIR}/libbsdstat.a - LIBELFTCDIR= ${ROOTOBJDIR}/lib/libelftc -LDELFTC?= ${LIBELFTCDIR}/libelftc.a LIBELFTC?= ${LIBELFTCDIR}/libelftc.a -LIBEVENTDIR= ${ROOTOBJDIR}/lib/libevent -LIBEVENT?= ${LIBEVENTDIR}/libevent.a - -LIBHEIMIPCCDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcc -LIBHEIMIPCC?= ${LIBHEIMIPCCDIR}/libheimipcc.a - -LIBHEIMIPCSDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcs -LIBHEIMIPCS?= ${LIBHEIMIPCSDIR}/libheimipcs.a - -LIBLDNSDIR= ${ROOTOBJDIR}/lib/libldns -LIBLDNS?= ${LIBLDNSDIR}/libldns.a - -LIBSSHDIR= ${ROOTOBJDIR}/secure/lib/libssh -LIBSSH?= ${LIBSSHDIR}/libssh.a - -LIBUNBOUNDDIR= ${ROOTOBJDIR}/lib/libunbound -LIBUNBOUND?= ${LIBUNBOUNDDIR}/libunbound.a - -LIBUCLDIR= ${ROOTOBJDIR}/lib/libucl -LIBUCL?= ${LIBUCLDIR}/libucl.a - LIBREADLINEDIR= ${ROOTOBJDIR}/gnu/lib/libreadline/readline LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a LIBOHASHDIR= ${ROOTOBJDIR}/lib/libohash LIBOHASH?= ${LIBOHASHDIR}/libohash.a -LIBSQLITE3DIR= ${ROOTOBJDIR}/lib/libsqlite3 -LIBSQLITE3?= ${LIBSQLITE3DIR}/libsqlite3.a - LIBMANDOCDIR= ${ROOTOBJDIR}/lib/libmandoc LIBMANDOC?= ${LIBMANDOCDIR}/libmandoc.a From owner-svn-src-head@FreeBSD.ORG Mon May 4 16:34:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84E758A6; Mon, 4 May 2015 16:34: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 734DA1509; Mon, 4 May 2015 16:34: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 t44GY9X1006743; Mon, 4 May 2015 16:34:09 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44GY9OV006741; Mon, 4 May 2015 16:34:09 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505041634.t44GY9OV006741@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 16:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282421 - in head: . etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 16:34:09 -0000 Author: bapt Date: Mon May 4 16:34:08 2015 New Revision: 282421 URL: https://svnweb.freebsd.org/changeset/base/282421 Log: Remove now unneeded libmap32.conf Deleted: head/etc/libmap32.conf Modified: head/ObsoleteFiles.inc head/etc/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 4 16:28:54 2015 (r282420) +++ head/ObsoleteFiles.inc Mon May 4 16:34:08 2015 (r282421) @@ -39,6 +39,7 @@ # done # 20150504 +OLD_FILES+=etc/libmap32.conf OLD_LIBS+=usr/lib32/private/libatf-c++.so.2 OLD_LIBS+=usr/lib32/private/libbsdstat.so.1 OLD_LIBS+=usr/lib32/private/libheimipcs.so.11 Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon May 4 16:28:54 2015 (r282420) +++ head/etc/Makefile Mon May 4 16:34:08 2015 (r282421) @@ -54,10 +54,6 @@ BIN1= crontab \ syslog.conf \ termcap.small -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" -BIN1+= libmap32.conf -.endif - .if exists(${.CURDIR}/etc.${MACHINE}/ttys) BIN1+= etc.${MACHINE}/ttys .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys) From owner-svn-src-head@FreeBSD.ORG Mon May 4 16:39:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2ED2AA65 for ; Mon, 4 May 2015 16:39:07 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECC481561 for ; Mon, 4 May 2015 16:39:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t44Gd63s089515 for ; Mon, 4 May 2015 16:39:06 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t44Gd6JY089512 for svn-src-head@freebsd.org; Mon, 4 May 2015 16:39:06 GMT (envelope-from bdrewery) Received: (qmail 91156 invoked from network); 4 May 2015 11:39:04 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 4 May 2015 11:39:04 -0500 Message-ID: <5547A0AE.4040809@FreeBSD.org> Date: Mon, 04 May 2015 11:39:10 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282318 - in head: . gnu/usr.bin/groff/src/preproc tools/build/mk usr.bin usr.bin/soelim usr.bin/soeliminate References: <201505012008.t41K8QUk048909@svn.freebsd.org> In-Reply-To: <201505012008.t41K8QUk048909@svn.freebsd.org> OpenPGP: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8vwModu9k2RPcaivpnM4vG8AppfWwKwkU" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 16:39:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8vwModu9k2RPcaivpnM4vG8AppfWwKwkU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/1/2015 3:08 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Fri May 1 20:08:25 2015 > New Revision: 282318 > URL: https://svnweb.freebsd.org/changeset/base/282318 >=20 > Log: > Replace groff's soelim by soeliminate(1) renamed soelim(1) >=20 > Added: > head/usr.bin/soelim/ > - copied from r281993, head/usr.bin/soeliminate/ > head/usr.bin/soelim/soelim.1 > - copied, changed from r281993, head/usr.bin/soeliminate/soelimina= te.1 > head/usr.bin/soelim/soelim.c > - copied, changed from r281993, head/usr.bin/soeliminate/soelimina= te.c > Deleted: > head/usr.bin/soelim/soeliminate.1 > head/usr.bin/soelim/soeliminate.c > head/usr.bin/soeliminate/ > Modified: > head/Makefile.inc1 > head/ObsoleteFiles.inc > head/gnu/usr.bin/groff/src/preproc/Makefile > head/tools/build/mk/OptionalObsoleteFiles.inc > head/usr.bin/Makefile > head/usr.bin/soelim/Makefile >=20 Can you point me to some ports that failed due to this? It is relevant for my arch@ idea about checksumming jails for rebuild. I had not planned to add soelim(1) and related tools but may need to now. --=20 Regards, Bryan Drewery --8vwModu9k2RPcaivpnM4vG8AppfWwKwkU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVR6CyAAoJEDXXcbtuRpfPuG4H/2I5n38Vqo/3seOgJ0hM+v2G UzBzEkH70LU1JT36C4NqwTL/e/co2XYfJgbpJzP6xD9OuKOpw1y8AJh5c9EDrESs SdV/8LqFXem5nVzSDxRChZOOBy0Rvnx16+pwe6ZKCzQOWPgjgbaeUUvc9G8WL4iS I+haJ/ANzkFOoWOReXUrTDTOL0DM5x43tcoJNYLY055c2bs1OrvjNaDUHnyqKhDW L3Os10cpkBFdkmPg47kuP7iGUkpmdcPJVMcO6rtqX2PU2KsLs2Gc7qIUdy4YhYuf ReBBTUvyrpXECWnhTVcBaReLvfxLUCtMBRqwaT8znfqvIXQDfUItE5JVr1jvzYE= =zLcA -----END PGP SIGNATURE----- --8vwModu9k2RPcaivpnM4vG8AppfWwKwkU-- From owner-svn-src-head@FreeBSD.ORG Mon May 4 16:41:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 134A2C88; Mon, 4 May 2015 16:41:49 +0000 (UTC) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A330E1639; Mon, 4 May 2015 16:41:48 +0000 (UTC) Received: by wgyo15 with SMTP id o15so156199394wgy.2; Mon, 04 May 2015 09:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=PpPRTM7JmmcFTFvELa1UT+C6nEIuf5tfltrkzaJWQBs=; b=w2c9m0+BkeppTyR51wyke9E56DL7WtlRr1UgmlxuY8UWAwcUevsWSVohBPLW5leplX suvo4yZEwaLHIq63D7zvLqeP2wt4ORyqdHPLBaNuXW2PMxnPo9Iy2e7dcb3Sm7x9QjNg xPjNk9iTKeIPqj93b6yhwvw8F+f+n6Bd+yEyQsBhvFMs6EB2Rg0bSNYfuHwn46fY8RIE sWsKohqPD9yWMUWzGIKqG3gG5K1BFECregQxV+73T46D8y88MVcJNhkvFX/WYZKhcJQ7 0CbWOlJIRuADl02DeBEwUYmqVcVZUAbRwKatFzmRre5VSIoJ9G4Q/Vy55YOa0BayW1ti YJew== X-Received: by 10.194.248.132 with SMTP id ym4mr44652404wjc.74.1430757707020; Mon, 04 May 2015 09:41:47 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id o5sm11864787wia.0.2015.05.04.09.41.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 09:41:45 -0700 (PDT) Sender: Baptiste Daroussin Date: Mon, 4 May 2015 18:41:44 +0200 From: Baptiste Daroussin To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282318 - in head: . gnu/usr.bin/groff/src/preproc tools/build/mk usr.bin usr.bin/soelim usr.bin/soeliminate Message-ID: <20150504164144.GC80213@ivaldir.etoilebsd.net> References: <201505012008.t41K8QUk048909@svn.freebsd.org> <5547A0AE.4040809@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JWEK1jqKZ6MHAcjA" Content-Disposition: inline In-Reply-To: <5547A0AE.4040809@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 16:41:49 -0000 --JWEK1jqKZ6MHAcjA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 04, 2015 at 11:39:10AM -0500, Bryan Drewery wrote: > On 5/1/2015 3:08 PM, Baptiste Daroussin wrote: > > Author: bapt > > Date: Fri May 1 20:08:25 2015 > > New Revision: 282318 > > URL: https://svnweb.freebsd.org/changeset/base/282318 > >=20 > > Log: > > Replace groff's soelim by soeliminate(1) renamed soelim(1) > >=20 > > Added: > > head/usr.bin/soelim/ > > - copied from r281993, head/usr.bin/soeliminate/ > > head/usr.bin/soelim/soelim.1 > > - copied, changed from r281993, head/usr.bin/soeliminate/soelimina= te.1 > > head/usr.bin/soelim/soelim.c > > - copied, changed from r281993, head/usr.bin/soeliminate/soelimina= te.c > > Deleted: > > head/usr.bin/soelim/soeliminate.1 > > head/usr.bin/soelim/soeliminate.c > > head/usr.bin/soeliminate/ > > Modified: > > head/Makefile.inc1 > > head/ObsoleteFiles.inc > > head/gnu/usr.bin/groff/src/preproc/Makefile > > head/tools/build/mk/OptionalObsoleteFiles.inc > > head/usr.bin/Makefile > > head/usr.bin/soelim/Makefile > >=20 >=20 > Can you point me to some ports that failed due to this? It is relevant > for my arch@ idea about checksumming jails for rebuild. I had not > planned to add soelim(1) and related tools but may need to now. >=20 >=20 > --=20 > Regards, > Bryan Drewery >=20 Only openldap to my knowledge Bapt --JWEK1jqKZ6MHAcjA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVHoUgACgkQ8kTtMUmk6EzA1QCfaMkkXsKNk9AXwPTgptRMEWMg hrMAnR/pzUuquKg4L2hCktbDoAG+3WeX =LuNK -----END PGP SIGNATURE----- --JWEK1jqKZ6MHAcjA-- From owner-svn-src-head@FreeBSD.ORG Mon May 4 16:42:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE6A3DD8 for ; Mon, 4 May 2015 16:42:20 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A97C41641 for ; Mon, 4 May 2015 16:42:20 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t44GgKvc092708 for ; Mon, 4 May 2015 16:42:20 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t44GgKwY092706 for svn-src-head@freebsd.org; Mon, 4 May 2015 16:42:20 GMT (envelope-from bdrewery) Received: (qmail 31105 invoked from network); 4 May 2015 11:42:19 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 4 May 2015 11:42:19 -0500 Message-ID: <5547A175.2010408@FreeBSD.org> Date: Mon, 04 May 2015 11:42:29 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282420 - in head: . etc/mtree lib/libevent lib/libucl share/mk References: <201505041628.t44GStT1002366@svn.freebsd.org> In-Reply-To: <201505041628.t44GStT1002366@svn.freebsd.org> OpenPGP: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fvAxgqvlVQVn51XhMWfgxrPPrLOkIfARS" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 16:42:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fvAxgqvlVQVn51XhMWfgxrPPrLOkIfARS Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/4/2015 11:28 AM, Baptiste Daroussin wrote: > +LIBATF_C=3D $(DESTDIR)$(LIBDIR)/libprivateatf-c.a > +LIBATF_CXX=3D $(DESTDIR)$(LIBDIR)/libprivateatf-c++.a > +LDADD_atf_c=3D -lprivateatf-c > +LDADD_atf_cxx=3D -lprivateatf-c++ > + > +.for _l in ${_PRIVATELIBS} > +LIB${_l:tu}?=3D ${DESTDIR}${LIBDIR}/libprivate${_l}.a Style-wise I see bugs here. Let's stick to () or {}. --=20 Regards, Bryan Drewery --fvAxgqvlVQVn51XhMWfgxrPPrLOkIfARS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVR6F1AAoJEDXXcbtuRpfPdjEIAJVsaWfnzzA1g3UUOZumaPfQ WiviRx/UvfxmlzaDx+xM44X+S3f3Pg65MtIeN7uo/WjINj/xEk/+ZcBDUVv80Z2x FgqB2roLKnMN5SL4LZEbsfaAvEWkgXJZFeVh2mUj+PY6mwd4Bt/R8M0MYjBLyoS0 NXd9f6DeRQpsu8hcz8mcfFJst/UOMsvPTTmmyNlAW7HjKMZT4bQIrvWq4drpqkG/ wqRwHhVDZ2GrrI5iRNjJOM4RNisytMvDWqXXgrckiXPOstmuD8pGuhixFCEwdHwS UHl/F/h+I+iX9tuMXYh3WBIwlQ8iOuwuLPR7DarxiG3sP1SjCGCaq2CD6EFOiFM= =QZwC -----END PGP SIGNATURE----- --fvAxgqvlVQVn51XhMWfgxrPPrLOkIfARS-- From owner-svn-src-head@FreeBSD.ORG Mon May 4 16:51:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C37A3A3 for ; Mon, 4 May 2015 16:51:05 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 278801762 for ; Mon, 4 May 2015 16:51:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t44Gp4vi093151 for ; Mon, 4 May 2015 16:51:04 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t44Gp42U093145 for svn-src-head@freebsd.org; Mon, 4 May 2015 16:51:04 GMT (envelope-from bdrewery) Received: (qmail 40321 invoked from network); 4 May 2015 11:51:03 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 4 May 2015 11:51:03 -0500 Message-ID: <5547A382.6070707@FreeBSD.org> Date: Mon, 04 May 2015 11:51:14 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282421 - in head: . etc References: <201505041634.t44GY9OV006741@svn.freebsd.org> In-Reply-To: <201505041634.t44GY9OV006741@svn.freebsd.org> OpenPGP: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vf1Id4nejvtQlOW8hphsu1POdTKX3Q3vs" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 16:51:05 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vf1Id4nejvtQlOW8hphsu1POdTKX3Q3vs Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/4/2015 11:34 AM, Baptiste Daroussin wrote: > Author: bapt > Date: Mon May 4 16:34:08 2015 > New Revision: 282421 > URL: https://svnweb.freebsd.org/changeset/base/282421 >=20 > Log: > Remove now unneeded libmap32.conf This doesn't explain why; the commit message is useless. "Because r282420 ..." >=20 > Deleted: > head/etc/libmap32.conf > Modified: > head/ObsoleteFiles.inc > head/etc/Makefile >=20 > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/ObsoleteFiles.inc Mon May 4 16:28:54 2015 (r282420) > +++ head/ObsoleteFiles.inc Mon May 4 16:34:08 2015 (r282421) > @@ -39,6 +39,7 @@ > # done > =20 > # 20150504 > +OLD_FILES+=3Detc/libmap32.conf This seems dangerous. I think only files no longer useful in any context should be added here. A user may have their own libmap32.conf that this would remove. Mergemaster/etcupdate might handle this case fine without delete-old. There are several other bugs with libmap32.conf: There's no manpage. There's no default /usr/local/etc/libmap32.d dir or entry. --=20 Regards, Bryan Drewery --vf1Id4nejvtQlOW8hphsu1POdTKX3Q3vs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVR6OCAAoJEDXXcbtuRpfPG+IIAKR287GRU5N+dUK2puz/LYjR l3c/+FSP5SkdO9nj8+cJGHsyWiNSB/xIVUOKAM2aQ9YOFKXVsOrIBGo0Q+/C8RXL kICMsIy24hs8NIpZ7htVDVnZVm5JNViKzppZmiglOJm/En047vzVVJCQjIE9TVfY zlbzD+i2B7AGT6qBS7z1UMw36mQiv7GPzfnn82ppIRHXCIKwSLcMxO8PajYTSD4W 55t18pLccI8pm4H9T9BPqracWNGJ5NlilztpogpLNdX5bnR0RRb82oMqnA0VJZzQ otFXfATfpaB614CJJ3dklwWwCrMc+xUo/2KaLF/0XkN9bjEL2TsDcVKugBF2U4Q= =NRBv -----END PGP SIGNATURE----- --vf1Id4nejvtQlOW8hphsu1POdTKX3Q3vs-- From owner-svn-src-head@FreeBSD.ORG Mon May 4 16:59:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C28CB98C; Mon, 4 May 2015 16:59: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 B0F4A17ED; Mon, 4 May 2015 16:59: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 t44GxAkH017529; Mon, 4 May 2015 16:59:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44GxAQO017528; Mon, 4 May 2015 16:59:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505041659.t44GxAQO017528@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 16:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282422 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 16:59:10 -0000 Author: bapt Date: Mon May 4 16:59:09 2015 New Revision: 282422 URL: https://svnweb.freebsd.org/changeset/base/282422 Log: Style fix Reported by: bdrewery Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Mon May 4 16:34:08 2015 (r282421) +++ head/share/mk/src.libnames.mk Mon May 4 16:59:09 2015 (r282422) @@ -233,8 +233,8 @@ _DP_vmmapi= util # Define spacial cases LDADD_supcplusplus= -lsupc++ -LIBATF_C= $(DESTDIR)$(LIBDIR)/libprivateatf-c.a -LIBATF_CXX= $(DESTDIR)$(LIBDIR)/libprivateatf-c++.a +LIBATF_C= ${DESTDIR}${LIBDIR}/libprivateatf-c.a +LIBATF_CXX= ${DESTDIR}${LIBDIR}/libprivateatf-c++.a LDADD_atf_c= -lprivateatf-c LDADD_atf_cxx= -lprivateatf-c++ From owner-svn-src-head@FreeBSD.ORG Mon May 4 17:01:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27DA5B18; Mon, 4 May 2015 17:01: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 16A8018B5; Mon, 4 May 2015 17:01:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44H1pg8021605; Mon, 4 May 2015 17:01:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44H1p9O021604; Mon, 4 May 2015 17:01:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505041701.t44H1p9O021604@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 17:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282423 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 17:01:52 -0000 Author: bapt Date: Mon May 4 17:01:51 2015 New Revision: 282423 URL: https://svnweb.freebsd.org/changeset/base/282423 Log: Do not remove libmap32.conf in make delete-old as it may remove user modified version by mistake Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 4 16:59:09 2015 (r282422) +++ head/ObsoleteFiles.inc Mon May 4 17:01:51 2015 (r282423) @@ -39,7 +39,6 @@ # done # 20150504 -OLD_FILES+=etc/libmap32.conf OLD_LIBS+=usr/lib32/private/libatf-c++.so.2 OLD_LIBS+=usr/lib32/private/libbsdstat.so.1 OLD_LIBS+=usr/lib32/private/libheimipcs.so.11 From owner-svn-src-head@FreeBSD.ORG Mon May 4 17:14:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09A0DE39; Mon, 4 May 2015 17:14:38 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8D6019D1; Mon, 4 May 2015 17:14:37 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 04467B915; Mon, 4 May 2015 13:14:36 -0400 (EDT) From: John Baldwin To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282423 - head Date: Mon, 04 May 2015 13:14:34 -0400 Message-ID: <1807112.SEIqP93pFp@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201505041701.t44H1p9O021604@svn.freebsd.org> References: <201505041701.t44H1p9O021604@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 May 2015 13:14:36 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 17:14:38 -0000 On Monday, May 04, 2015 05:01:51 PM Baptiste Daroussin wrote: > Author: bapt > Date: Mon May 4 17:01:51 2015 > New Revision: 282423 > URL: https://svnweb.freebsd.org/changeset/base/282423 > > Log: > Do not remove libmap32.conf in make delete-old as it may remove user modified > version by mistake I think etcupdate at least will DTRT and remove it IFF it matches the originally installed version (if it has been modified it will emit a warning but leave the file in place). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon May 4 17:24:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB049384 for ; Mon, 4 May 2015 17:24:32 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8695E1AF6 for ; Mon, 4 May 2015 17:24:32 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t44HOW7I007581 for ; Mon, 4 May 2015 17:24:32 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t44HOW60007578 for svn-src-head@freebsd.org; Mon, 4 May 2015 17:24:32 GMT (envelope-from bdrewery) Received: (qmail 98287 invoked from network); 4 May 2015 12:24:27 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 4 May 2015 12:24:27 -0500 Message-ID: <5547AB55.2090404@FreeBSD.org> Date: Mon, 04 May 2015 12:24:37 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282423 - head References: <201505041701.t44H1p9O021604@svn.freebsd.org> In-Reply-To: <201505041701.t44H1p9O021604@svn.freebsd.org> OpenPGP: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1X7e5dNpGt8Wpl45Sk6XsT52FDGUm95lW" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 17:24:32 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1X7e5dNpGt8Wpl45Sk6XsT52FDGUm95lW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/4/2015 12:01 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Mon May 4 17:01:51 2015 > New Revision: 282423 > URL: https://svnweb.freebsd.org/changeset/base/282423 >=20 > Log: > Do not remove libmap32.conf in make delete-old as it may remove user = modified > version by mistake >=20 > Modified: > head/ObsoleteFiles.inc >=20 > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/ObsoleteFiles.inc Mon May 4 16:59:09 2015 (r282422) > +++ head/ObsoleteFiles.inc Mon May 4 17:01:51 2015 (r282423) > @@ -39,7 +39,6 @@ > # done > =20 > # 20150504 > -OLD_FILES+=3Detc/libmap32.conf > OLD_LIBS+=3Dusr/lib32/private/libatf-c++.so.2 > OLD_LIBS+=3Dusr/lib32/private/libbsdstat.so.1 > OLD_LIBS+=3Dusr/lib32/private/libheimipcs.so.11 >=20 Thanks. If only we had @sample type behavior here ;) --=20 Regards, Bryan Drewery --1X7e5dNpGt8Wpl45Sk6XsT52FDGUm95lW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVR6tVAAoJEDXXcbtuRpfP5w0IAMtMRAarg4eSiWJU9qC6s6Ja tbvlaKYBZ5gE/UpKZ4pCjAZgNi5DTWuNRzQ8GqE9mEJWUE33U3UTPdF0vaUODJk4 27GvFfyWwPHKeCYhxBn0WKgs8dEs7fNfgb0HhyEh8TQsoaC5lHPYsv7gaVJSaSLn l7bteG+kr7SiNj2JPuxXd0ubcPRPEvAR4xU+gf/3CtuLU63wEPUX2WTFyDM6elV3 W8quGGoFWpJNgQ1eLp1zuOLBINn3HjIpV0eFrAIpK6fdpsr0d2/EqCv/POf5GNxp kR9KrFm9YyLtSdGUskGooR1wbebOOnaYTsVTyzKjmA1BDw9hqm4FTLRaaUbQ45o= =26Q1 -----END PGP SIGNATURE----- --1X7e5dNpGt8Wpl45Sk6XsT52FDGUm95lW-- From owner-svn-src-head@FreeBSD.ORG Mon May 4 17:59:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C470A257; Mon, 4 May 2015 17:59:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B239C1EDC; Mon, 4 May 2015 17:59:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44HxehO047808; Mon, 4 May 2015 17:59:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44Hxdu3047805; Mon, 4 May 2015 17:59:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505041759.t44Hxdu3047805@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 4 May 2015 17:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282424 - in head/sys: dev/usb/serial kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 17:59:40 -0000 Author: ian Date: Mon May 4 17:59:39 2015 New Revision: 282424 URL: https://svnweb.freebsd.org/changeset/base/282424 Log: Implement a mechanism for making changes in the kernel<->driver PPS interface without breaking ABI or API compatibility with existing drivers. The existing data structures used to communicate between the kernel and driver portions of PPS processing contain no spare/padding fields and no flags field or other straightforward mechanism for communicating changes in the structures or behaviors of the code. This makes it difficult to MFC new features added to the PPS facility. ABI compatibility is important; out-of-tree drivers in module form are known to exist. (Note that the existing api_version field in the pps_params structure must contain the value mandated by RFC 2783 and any RFCs that come along after.) These changes introduce a pair of abi-version fields which are filled in by the driver and the kernel respectively to indicate the interface version. The driver sets its version field before calling the new pps_init_abi() function. That lets the kernel know how much of the pps_state structure is understood by the driver and it can avoid using newer fields at the end of the structure that it knows about if the driver is a lower version. The kernel fills in its version field during the init call, letting the driver know what features and data the kernel supports. To implement the new version information in a way that is backwards compatible with code from before these changes, the high bit of the lightly-used 'kcmode' field is repurposed as a flag bit that indicates the driver is aware of the abi versioning scheme. Basically if this bit is clear that indicates a "version 0" driver and if it is set the driver_abi field indicates the version. These changes also move the recently-added 'mtx' field of pps_state from the middle to the end of the structure, and make the kernel code that uses this field conditional on the driver being abi version 1 or higher. It changes the only driver currently supplying the mtx field, usb_serial, to use pps_init_abi(). Reviewed by: hselasky@ Modified: head/sys/dev/usb/serial/usb_serial.c head/sys/kern/kern_tc.c head/sys/sys/timepps.h Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Mon May 4 17:01:51 2015 (r282423) +++ head/sys/dev/usb/serial/usb_serial.c Mon May 4 17:59:39 2015 (r282424) @@ -415,8 +415,9 @@ ucom_attach_tty(struct ucom_super_softc sc->sc_tty = tp; sc->sc_pps.ppscap = PPS_CAPTUREBOTH; - sc->sc_pps.mtx = sc->sc_mtx; - pps_init(&sc->sc_pps); + sc->sc_pps.driver_abi = PPS_ABI_VERSION; + sc->sc_pps.driver_mtx = sc->sc_mtx; + pps_init_abi(&sc->sc_pps); DPRINTF("ttycreate: %s\n", buf); Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Mon May 4 17:01:51 2015 (r282423) +++ head/sys/kern/kern_tc.c Mon May 4 17:59:39 2015 (r282424) @@ -1468,6 +1468,17 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, * RFC 2783 PPS-API implementation. */ +/* + * Return true if the driver is aware of the abi version extensions in the + * pps_state structure, and it supports at least the given abi version number. + */ +static inline int +abi_aware(struct pps_state *pps, int vers) +{ + + return ((pps->kcmode & KCMODE_ABIFLAG) && pps->driver_abi >= vers); +} + static int pps_fetch(struct pps_fetch_args *fapi, struct pps_state *pps) { @@ -1497,10 +1508,17 @@ pps_fetch(struct pps_fetch_args *fapi, s cseq = pps->ppsinfo.clear_sequence; while (aseq == pps->ppsinfo.assert_sequence && cseq == pps->ppsinfo.clear_sequence) { - if (pps->mtx != NULL) - err = msleep(pps, pps->mtx, PCATCH, "ppsfch", timo); - else + if (abi_aware(pps, 1) && pps->driver_mtx != NULL) { + if (pps->flags & PPSFLAG_MTX_SPIN) { + err = msleep_spin(pps, pps->driver_mtx, + "ppsfch", timo); + } else { + err = msleep(pps, pps->driver_mtx, PCATCH, + "ppsfch", timo); + } + } else { err = tsleep(pps, PCATCH, "ppsfch", timo); + } if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) { continue; } else if (err != 0) { @@ -1590,7 +1608,8 @@ pps_ioctl(u_long cmd, caddr_t data, stru return (EINVAL); if (kapi->edge & ~pps->ppscap) return (EINVAL); - pps->kcmode = kapi->edge; + pps->kcmode = (kapi->edge & KCMODE_EDGEMASK) | + (pps->kcmode & KCMODE_ABIFLAG); return (0); #else return (EOPNOTSUPP); @@ -1611,6 +1630,18 @@ pps_init(struct pps_state *pps) #ifdef FFCLOCK pps->ppscap |= PPS_TSCLK_MASK; #endif + pps->kcmode &= ~KCMODE_ABIFLAG; +} + +void +pps_init_abi(struct pps_state *pps) +{ + + pps_init(pps); + if (pps->driver_abi > 0) { + pps->kcmode |= KCMODE_ABIFLAG; + pps->kernel_abi = PPS_ABI_VERSION; + } } void Modified: head/sys/sys/timepps.h ============================================================================== --- head/sys/sys/timepps.h Mon May 4 17:01:51 2015 (r282423) +++ head/sys/sys/timepps.h Mon May 4 17:59:39 2015 (r282424) @@ -135,6 +135,13 @@ struct pps_kcbind_args { struct mtx; +#define KCMODE_EDGEMASK 0x03 +#define KCMODE_ABIFLAG 0x80000000 /* Internal use: abi-aware driver. */ + +#define PPS_ABI_VERSION 1 + +#define PPSFLAG_MTX_SPIN 0x01 /* Driver mtx is MTX_SPIN type. */ + struct pps_state { /* Capture information. */ struct timehands *capth; @@ -142,9 +149,6 @@ struct pps_state { unsigned capgen; unsigned capcount; - /* pointer to mutex protecting this state, if any */ - struct mtx *mtx; - /* State information. */ pps_params_t ppsparam; pps_info_t ppsinfo; @@ -153,11 +157,19 @@ struct pps_state { int ppscap; struct timecounter *ppstc; unsigned ppscount[3]; + /* + * The following fields are valid if the driver calls pps_init_abi(). + */ + uint16_t driver_abi; /* Driver sets before pps_init_abi(). */ + uint16_t kernel_abi; /* Kernel sets during pps_init_abi(). */ + struct mtx *driver_mtx; /* Optional, valid if non-NULL. */ + uint32_t flags; }; void pps_capture(struct pps_state *pps); void pps_event(struct pps_state *pps, int event); void pps_init(struct pps_state *pps); +void pps_init_abi(struct pps_state *pps); int pps_ioctl(unsigned long cmd, caddr_t data, struct pps_state *pps); void hardpps(struct timespec *tsp, long nsec); From owner-svn-src-head@FreeBSD.ORG Mon May 4 18:20:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22B5D998; Mon, 4 May 2015 18:20: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 040F1119A; Mon, 4 May 2015 18:20: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 t44IKWYP061216; Mon, 4 May 2015 18:20:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44IKVxp061208; Mon, 4 May 2015 18:20:31 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505041820.t44IKVxp061208@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 18:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282425 - in head/usr.bin/soelim: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 18:20:33 -0000 Author: bapt Date: Mon May 4 18:20:31 2015 New Revision: 282425 URL: https://svnweb.freebsd.org/changeset/base/282425 Log: Parse filename until first space then print the rest of the line after file inclusion This is the same behaviour of heirloom's soelim Added: head/usr.bin/soelim/tests/basic-with-space.in (contents, props changed) head/usr.bin/soelim/tests/basic-with-space.out (contents, props changed) Modified: head/usr.bin/soelim/soelim.c head/usr.bin/soelim/tests/Makefile head/usr.bin/soelim/tests/soelim.sh Modified: head/usr.bin/soelim/soelim.c ============================================================================== --- head/usr.bin/soelim/soelim.c Mon May 4 17:59:39 2015 (r282424) +++ head/usr.bin/soelim/soelim.c Mon May 4 18:20:31 2015 (r282425) @@ -108,11 +108,12 @@ soelim_file(FILE *f, int flag) while (isspace(*walk)) walk++; - cp = walk + strlen(walk) - 1; - while (cp > walk && isspace(*cp)) { - *cp = 0; - cp--; - } + cp = walk; + while (*cp != '\0' && !isspace(*cp)) + cp++; + *cp = 0; + if (cp < line + linelen) + cp++; if (*walk == '\0') { printf("%s", line); @@ -122,6 +123,8 @@ soelim_file(FILE *f, int flag) free(line); return (1); } + if (*cp != '\0') + printf("%s", cp); } free(line); Modified: head/usr.bin/soelim/tests/Makefile ============================================================================== --- head/usr.bin/soelim/tests/Makefile Mon May 4 17:59:39 2015 (r282424) +++ head/usr.bin/soelim/tests/Makefile Mon May 4 18:20:31 2015 (r282425) @@ -7,7 +7,9 @@ ATF_TESTS_SH= soelim FILES= nonexisting.in \ basic.in \ basic \ - basic.out + basic.out \ + basic-with-space.in \ + basic-with-space.out FILESDIR= ${TESTSDIR} .include Added: head/usr.bin/soelim/tests/basic-with-space.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/soelim/tests/basic-with-space.in Mon May 4 18:20:31 2015 (r282425) @@ -0,0 +1,3 @@ +This is a test +.so basic something +end Added: head/usr.bin/soelim/tests/basic-with-space.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/soelim/tests/basic-with-space.out Mon May 4 18:20:31 2015 (r282425) @@ -0,0 +1,4 @@ +This is a test +basic has been included +something +end Modified: head/usr.bin/soelim/tests/soelim.sh ============================================================================== --- head/usr.bin/soelim/tests/soelim.sh Mon May 4 17:59:39 2015 (r282424) +++ head/usr.bin/soelim/tests/soelim.sh Mon May 4 18:20:31 2015 (r282425) @@ -87,6 +87,13 @@ files_body() -e empty \ -s exit:0 \ soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic.in + + atf_check \ + -o file:$(atf_get_srcdir)/basic-with-space.out \ + -e empty \ + -s exit:0 \ + soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic-with-space.in + } atf_init_test_cases() From owner-svn-src-head@FreeBSD.ORG Mon May 4 18:49:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E61A338A; Mon, 4 May 2015 18:49:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D43581537; Mon, 4 May 2015 18:49:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44InPvB073255; Mon, 4 May 2015 18:49:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44InPxC073254; Mon, 4 May 2015 18:49:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201505041849.t44InPxC073254@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 4 May 2015 18:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282426 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 18:49:26 -0000 Author: glebius Date: Mon May 4 18:49:25 2015 New Revision: 282426 URL: https://svnweb.freebsd.org/changeset/base/282426 Log: Fix arithmetical bug in vnode_pager_haspage(). The check against object size should be done not with the number of pages in the first block, but with the overall number of pages. While here, add KASSERT that makes sure that BMAP doesn't return completely irrelevant blocks. Reviewed by: kib Tested by: pho Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Mon May 4 18:20:31 2015 (r282425) +++ head/sys/vm/vnode_pager.c Mon May 4 18:49:25 2015 (r282426) @@ -340,16 +340,21 @@ vnode_pager_haspage(vm_object_t object, *before += poff; } if (after) { - int numafter; + /* + * The BMAP vop can report a partial block in the + * 'after', but must not count blocks after EOF. + * Assert the latter, and truncate 'after' in case + * of the former. + */ + KASSERT(reqblock + *after <= + object->size * pagesperblock, + ("%s: reqblock %jd after %d size %ju", __func__, + (intmax_t )reqblock, *after, + (uintmax_t )object->size)); *after *= pagesperblock; - numafter = pagesperblock - (poff + 1); - if (IDX_TO_OFF(pindex + numafter) > - object->un_pager.vnp.vnp_size) { - numafter = - OFF_TO_IDX(object->un_pager.vnp.vnp_size) - - pindex; - } - *after += numafter; + *after += pagesperblock - (poff + 1); + if (pindex + *after >= object->size) + *after = object->size - 1 - pindex; } } else { if (before) { From owner-svn-src-head@FreeBSD.ORG Mon May 4 18:51:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E873505; Mon, 4 May 2015 18:51:29 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CC8261610; Mon, 4 May 2015 18:51:27 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t44IpPdi044355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 4 May 2015 21:51:25 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t44IpPoi044354; Mon, 4 May 2015 21:51:25 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 4 May 2015 21:51:25 +0300 From: Gleb Smirnoff To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Message-ID: <20150504185125.GL34544@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <2197979.EUYqekgM4M@ralph.baldwin.cx> <20150502191000.GE546@FreeBSD.org> <26088556.xbkUe5VAyp@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26088556.xbkUe5VAyp@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 18:51:29 -0000 John, On Mon, May 04, 2015 at 09:58:49AM -0400, John Baldwin wrote: J> > J> > J> So the importaing thing here is that if_get_counter() is still doing J> > J> > J> per-ifnet stats. The stat you underlined above is per-queue instead. J> > J> > J> We well need more explicitly knowledge of queues outside of drivers J> > J> > J> and in the stack itself to support a generic framework for per-queue J> > J> > J> stats. J> > J> > J> > J> > This depends on how generic we want the API to be. Of course, we can add J> > J> > an extra argument to if_get_counter(). J> > J> > J> > J> > However, if we don't expect the number of queues to exceed a reasonable J> > J> > number of 255 :), we can fit the functionality into existing API. J> > J> > We can keep the queue number in the highest 8 bits of the ift_counter J> > J> > parameter. J> > J> > J> > J> > #define IFCOUNTER_MASK 0x00ffffff J> > J> > #define IFCOUNTER_QUEUE(c) ((c) >> 24) J> > J> J> > J> I'd prefer that expose queues more directly and figure out how to handle J> > J> per-queue stats then (e.g. do we have some sort of driver-independent J> > J> structure that each ifnet has 1 or more of that maps to a queue and has J> > J> driver provided methods, etc. If so you could have a driver method for J> > J> queue stats). Note that I did use if_get_counter to report the J> > J> per-interface stats instead of adding a new sysctl. J> > J> > What do you prefer: an extra argument to the if_get_counter() or a extra J> > ifop? J> J> As I said, I'd prefer we expose queues to the stack more directly complete J> with per-queue ops (e.g. I'd like a per-queue if_transmit thing, though J> probably more like the old if_start). Your answer seems quite orthogonal to my question. I reread it couple of times, but still can't figure out how exactly do you prefet to fetch per-queue stats. Can you please explain in more detail? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon May 4 19:55:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79CCA3C6; Mon, 4 May 2015 19:55: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 4E96D1DBA; Mon, 4 May 2015 19:55: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 t44Jt2HP008534; Mon, 4 May 2015 19:55:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44Jt28d008533; Mon, 4 May 2015 19:55:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505041955.t44Jt28d008533@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 4 May 2015 19:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282429 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 19:55:02 -0000 Author: mav Date: Mon May 4 19:55:01 2015 New Revision: 282429 URL: https://svnweb.freebsd.org/changeset/base/282429 Log: Implement in-order execution of non-NCQ commands. Using status updates in r282364, block queue on BSY, DRQ or ERR bits set. This can be a performance penalization for non-NCQ commands, but it is required for proper error recovery and standard compliance. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Mon May 4 19:34:59 2015 (r282428) +++ head/usr.sbin/bhyve/pci_ahci.c Mon May 4 19:55:01 2015 (r282429) @@ -140,6 +140,7 @@ struct ahci_port { uint8_t err_cfis[20]; uint8_t sense_key; uint8_t asc; + u_int ccs; uint32_t pending; uint32_t clb; @@ -204,6 +205,8 @@ struct pci_ahci_softc { }; #define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) +static void ahci_handle_port(struct ahci_port *p); + static inline void lba_to_msf(uint8_t *buf, int lba) { lba += 150; @@ -406,6 +409,7 @@ ahci_check_stopped(struct ahci_port *p) */ if (!(p->cmd & AHCI_P_CMD_ST)) { if (p->pending == 0) { + p->ccs = 0; p->cmd &= ~(AHCI_P_CMD_CR | AHCI_P_CMD_CCS_MASK); p->ci = 0; p->sact = 0; @@ -783,6 +787,8 @@ next: ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); p->pending &= ~(1 << slot); ahci_check_stopped(p); + if (!first) + ahci_handle_port(p); return; } goto next; @@ -1754,20 +1760,21 @@ ahci_handle_slot(struct ahci_port *p, in static void ahci_handle_port(struct ahci_port *p) { - int i; if (!(p->cmd & AHCI_P_CMD_ST)) return; /* * Search for any new commands to issue ignoring those that - * are already in-flight. + * are already in-flight. Stop if device is busy or in error. */ - for (i = 0; (i < 32) && p->ci; i++) { - if ((p->ci & (1 << i)) && !(p->pending & (1 << i))) { + for (; (p->ci & ~p->pending) != 0; p->ccs = ((p->ccs + 1) & 31)) { + if ((p->tfd & (ATA_S_BUSY | ATA_S_DRQ | ATA_S_ERROR)) != 0) + break; + if ((p->ci & ~p->pending & (1 << p->ccs)) != 0) { p->cmd &= ~AHCI_P_CMD_CCS_MASK; - p->cmd |= i << AHCI_P_CMD_CCS_SHIFT; - ahci_handle_slot(p, i); + p->cmd |= p->ccs << AHCI_P_CMD_CCS_SHIFT; + ahci_handle_slot(p, p->ccs); } } } @@ -1844,6 +1851,7 @@ ata_ioreq_cb(struct blockif_req *br, int p->pending &= ~(1 << slot); ahci_check_stopped(p); + ahci_handle_port(p); out: pthread_mutex_unlock(&sc->mtx); DPRINTF("%s exit\n", __func__); @@ -1905,6 +1913,7 @@ atapi_ioreq_cb(struct blockif_req *br, i p->pending &= ~(1 << slot); ahci_check_stopped(p); + ahci_handle_port(p); out: pthread_mutex_unlock(&sc->mtx); DPRINTF("%s exit\n", __func__); From owner-svn-src-head@FreeBSD.ORG Mon May 4 20:01:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC46359B; Mon, 4 May 2015 20:01:38 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A60AB1E9B; Mon, 4 May 2015 20:01:38 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9EE72B915; Mon, 4 May 2015 16:01:36 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Date: Mon, 04 May 2015 16:01:28 -0400 Message-ID: <2463555.FfYUgqxYi8@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150504185125.GL34544@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <26088556.xbkUe5VAyp@ralph.baldwin.cx> <20150504185125.GL34544@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 May 2015 16:01:36 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 20:01:38 -0000 On Monday, May 04, 2015 09:51:25 PM Gleb Smirnoff wrote: > John, > > On Mon, May 04, 2015 at 09:58:49AM -0400, John Baldwin wrote: > J> > J> > J> So the importaing thing here is that if_get_counter() is still doing > J> > J> > J> per-ifnet stats. The stat you underlined above is per-queue instead. > J> > J> > J> We well need more explicitly knowledge of queues outside of drivers > J> > J> > J> and in the stack itself to support a generic framework for per-queue > J> > J> > J> stats. > J> > J> > > J> > J> > This depends on how generic we want the API to be. Of course, we can add > J> > J> > an extra argument to if_get_counter(). > J> > J> > > J> > J> > However, if we don't expect the number of queues to exceed a reasonable > J> > J> > number of 255 :), we can fit the functionality into existing API. > J> > J> > We can keep the queue number in the highest 8 bits of the ift_counter > J> > J> > parameter. > J> > J> > > J> > J> > #define IFCOUNTER_MASK 0x00ffffff > J> > J> > #define IFCOUNTER_QUEUE(c) ((c) >> 24) > J> > J> > J> > J> I'd prefer that expose queues more directly and figure out how to handle > J> > J> per-queue stats then (e.g. do we have some sort of driver-independent > J> > J> structure that each ifnet has 1 or more of that maps to a queue and has > J> > J> driver provided methods, etc. If so you could have a driver method for > J> > J> queue stats). Note that I did use if_get_counter to report the > J> > J> per-interface stats instead of adding a new sysctl. > J> > > J> > What do you prefer: an extra argument to the if_get_counter() or a extra > J> > ifop? > J> > J> As I said, I'd prefer we expose queues to the stack more directly complete > J> with per-queue ops (e.g. I'd like a per-queue if_transmit thing, though > J> probably more like the old if_start). > > Your answer seems quite orthogonal to my question. I reread it couple of times, > but still can't figure out how exactly do you prefet to fetch per-queue stats. > Can you please explain in more detail? struct if_queue { struct ifnet *ifq_parent; void (*ifq_get_counter)(struct if_queue *, ift_counter); ... }; (Pretend that if_queue is a new object type and that each RX or TX queue on a NIC has one.) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon May 4 20:36:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36F66ECC; Mon, 4 May 2015 20:36: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 182721233; Mon, 4 May 2015 20:36: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 t44Ka0K7028519; Mon, 4 May 2015 20:36:00 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44Ka07O028514; Mon, 4 May 2015 20:36:00 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201505042036.t44Ka07O028514@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 4 May 2015 20:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282430 - in head/sys: conf dev/nand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 20:36:01 -0000 Author: jhibbits Date: Mon May 4 20:36:00 2015 New Revision: 282430 URL: https://svnweb.freebsd.org/changeset/base/282430 Log: Implement a driver for the PowerPC-base RouterBoard (RB333/600/800/1100) Summary: This has been tested on the RB800, but should work on the RB333, RB600, and RB1100 as well. It's currently missing ECC support, but read and write are complete. Reviewers: imp Reviewed By: imp Subscribers: imp Differential Revision: https://reviews.freebsd.org/D2223 Added: head/sys/dev/nand/nfc_rb.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon May 4 19:55:01 2015 (r282429) +++ head/sys/conf/files.powerpc Mon May 4 20:36:00 2015 (r282430) @@ -43,6 +43,7 @@ dev/iicbus/ds1775.c optional ds1775 pow dev/iicbus/max6690.c optional max6690 powermac dev/kbd/kbd.c optional sc | vt dev/nand/nfc_fsl.c optional nand mpc85xx +dev/nand/nfc_rb.c optional nand mpc85xx # ofw can be either aim or fdt: fdt case handled in files. aim only powerpc specific. dev/ofw/openfirm.c optional aim dev/ofw/openfirmio.c optional aim Added: head/sys/dev/nand/nfc_rb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nand/nfc_rb.c Mon May 4 20:36:00 2015 (r282430) @@ -0,0 +1,275 @@ +/*- + * Copyright (C) 2015 Justin Hibbits + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* RouterBoard 600/800 NAND controller driver. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include "nfc_if.h" +#include "gpio_if.h" + +#define RB_NAND_DATA (0x00) + +struct rb_nand_softc { + struct nand_softc nand_dev; + struct resource *sc_mem; + int rid; + device_t sc_gpio; + uint32_t sc_rdy_pin; + uint32_t sc_nce_pin; + uint32_t sc_cle_pin; + uint32_t sc_ale_pin; +}; + +static int rb_nand_attach(device_t); +static int rb_nand_probe(device_t); +static int rb_nand_send_command(device_t, uint8_t); +static int rb_nand_send_address(device_t, uint8_t); +static uint8_t rb_nand_read_byte(device_t); +static void rb_nand_read_buf(device_t, void *, uint32_t); +static void rb_nand_write_buf(device_t, void *, uint32_t); +static int rb_nand_select_cs(device_t, uint8_t); +static int rb_nand_read_rnb(device_t); + +static device_method_t rb_nand_methods[] = { + DEVMETHOD(device_probe, rb_nand_probe), + DEVMETHOD(device_attach, rb_nand_attach), + + DEVMETHOD(nfc_send_command, rb_nand_send_command), + DEVMETHOD(nfc_send_address, rb_nand_send_address), + DEVMETHOD(nfc_read_byte, rb_nand_read_byte), + DEVMETHOD(nfc_read_buf, rb_nand_read_buf), + DEVMETHOD(nfc_write_buf, rb_nand_write_buf), + DEVMETHOD(nfc_select_cs, rb_nand_select_cs), + DEVMETHOD(nfc_read_rnb, rb_nand_read_rnb), + + { 0, 0 }, +}; + +static driver_t rb_nand_driver = { + "nand", + rb_nand_methods, + sizeof(struct rb_nand_softc), +}; + +static devclass_t rb_nand_devclass; +DRIVER_MODULE(rb_nand, ofwbus, rb_nand_driver, rb_nand_devclass, 0, 0); + +#if 0 +static const struct nand_ecc_data rb_ecc = { + .eccsize = 6, + .eccmode = NAND_ECC_SOFT, + .eccbytes = 6, + .eccpositions = { 8, 9, 10, 13, 14, 15 }, +}; +#endif + +static int +rb_nand_probe(device_t dev) +{ + const char *device_type; + + device_type = ofw_bus_get_type(dev); + + if (!device_type || strcmp(device_type, "rb,nand")) + return (ENXIO); + + device_set_desc(dev, "RouterBoard 333/600/800 NAND controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +rb_nand_attach(device_t dev) +{ + struct rb_nand_softc *sc; + phandle_t node; + uint32_t ale[2],cle[2],nce[2],rdy[2]; + int err; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + if (OF_getprop(node, "ale", ale, sizeof(ale)) <= 0) { + return (ENXIO); + } + if (OF_getprop(node, "cle", cle, sizeof(cle)) <= 0) { + return (ENXIO); + } + if (OF_getprop(node, "nce", nce, sizeof(nce)) <= 0) { + return (ENXIO); + } + if (OF_getprop(node, "rdy", rdy, sizeof(rdy)) <= 0) { + return (ENXIO); + } + + if (ale[0] != cle[0] || ale[0] != nce[0] || ale[0] != rdy[0]) { + device_printf(dev, "GPIO handles for signals must match.\n"); + return (ENXIO); + } + sc->sc_ale_pin = ale[1]; + sc->sc_cle_pin = cle[1]; + sc->sc_nce_pin = nce[1]; + sc->sc_rdy_pin = rdy[1]; + + sc->sc_gpio = OF_device_from_xref(ale[0]); + if (sc->sc_gpio == NULL) { + device_printf(dev, "No GPIO resource found!\n"); + return (ENXIO); + } + + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->sc_mem == NULL) { + device_printf(dev, "could not allocate resources!\n"); + return (ENXIO); + } + + nand_init(&sc->nand_dev, dev, NAND_ECC_SOFT, 0, 0, NULL, NULL); + + err = nandbus_create(dev); + + return (err); +} + +static int +rb_nand_send_command(device_t dev, uint8_t command) +{ + struct rb_nand_softc *sc; + + nand_debug(NDBG_DRV,"rb_nand: send command %x", command); + + sc = device_get_softc(dev); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_cle_pin, 1); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_ale_pin, 0); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_nce_pin, 0); + bus_write_1(sc->sc_mem, RB_NAND_DATA, command); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_cle_pin, 0); + return (0); +} + +static int +rb_nand_send_address(device_t dev, uint8_t addr) +{ + struct rb_nand_softc *sc; + + nand_debug(NDBG_DRV,"rb_nand: send address %x", addr); + + sc = device_get_softc(dev); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_cle_pin, 0); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_ale_pin, 1); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_nce_pin, 0); + bus_write_1(sc->sc_mem, RB_NAND_DATA, addr); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_ale_pin, 0); + return (0); +} + +static uint8_t +rb_nand_read_byte(device_t dev) +{ + struct rb_nand_softc *sc; + uint8_t data; + + sc = device_get_softc(dev); + data = bus_read_1(sc->sc_mem, RB_NAND_DATA); + + nand_debug(NDBG_DRV,"rb_nand: read %x", data); + + return (data); +} + +static void +rb_nand_read_buf(device_t dev, void* buf, uint32_t len) +{ + struct rb_nand_softc *sc; + + sc = device_get_softc(dev); + + bus_read_region_1(sc->sc_mem, RB_NAND_DATA, buf, len); +} + +static void +rb_nand_write_buf(device_t dev, void* buf, uint32_t len) +{ + struct rb_nand_softc *sc; + int i; + uint8_t *b = (uint8_t*)buf; + + sc = device_get_softc(dev); + + for (i = 0; i < len; i++) { +#ifdef NAND_DEBUG + if (!(i % 16)) + printf("%s", i == 0 ? "rb_nand:\n" : "\n"); + printf(" %x", b[i]); + if (i == len - 1) + printf("\n"); +#endif + bus_write_1(sc->sc_mem, RB_NAND_DATA, b[i]); + } +} + +static int +rb_nand_select_cs(device_t dev, uint8_t cs) +{ + + if (cs > 0) + return (ENODEV); + + return (0); +} + +static int +rb_nand_read_rnb(device_t dev) +{ + struct rb_nand_softc *sc; + uint32_t rdy_bit; + + sc = device_get_softc(dev); + GPIO_PIN_GET(sc->sc_gpio, sc->sc_rdy_pin, &rdy_bit); + + return (rdy_bit); /* ready */ +} From owner-svn-src-head@FreeBSD.ORG Mon May 4 20:59:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 168EE62A; Mon, 4 May 2015 20:59:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 053C014D2; Mon, 4 May 2015 20:59:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44KxOaW038738; Mon, 4 May 2015 20:59:24 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44KxNBk038733; Mon, 4 May 2015 20:59:23 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505042059.t44KxNBk038733@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 4 May 2015 20:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282433 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 20:59:25 -0000 Author: loos Date: Mon May 4 20:59:23 2015 New Revision: 282433 URL: https://svnweb.freebsd.org/changeset/base/282433 Log: In preparation for the next cycle of official ARM images, add ARM_NEW_PMAP to supported kernels. This is a temporary solution and should be reverted when ARM_NEW_PMAP is enabled by default. Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/PANDABOARD head/sys/arm/conf/RPI-B head/sys/arm/conf/RPI2 head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Mon May 4 20:52:21 2015 (r282432) +++ head/sys/arm/conf/BEAGLEBONE Mon May 4 20:59:23 2015 (r282433) @@ -67,6 +67,7 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Mon May 4 20:52:21 2015 (r282432) +++ head/sys/arm/conf/PANDABOARD Mon May 4 20:59:23 2015 (r282433) @@ -64,6 +64,7 @@ options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options SMP # Enable multiple cores +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Mon May 4 20:52:21 2015 (r282432) +++ head/sys/arm/conf/RPI-B Mon May 4 20:59:23 2015 (r282433) @@ -57,6 +57,7 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Mon May 4 20:52:21 2015 (r282432) +++ head/sys/arm/conf/RPI2 Mon May 4 20:59:23 2015 (r282433) @@ -57,6 +57,7 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Mon May 4 20:52:21 2015 (r282432) +++ head/sys/arm/conf/ZEDBOARD Mon May 4 20:59:23 2015 (r282433) @@ -56,6 +56,7 @@ options KBD_INSTALL_CDEV # install a CD options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options SMP # Enable multiple cores +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols From owner-svn-src-head@FreeBSD.ORG Mon May 4 21:03:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43F7E7F7; Mon, 4 May 2015 21:03:13 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0F6715D4; Mon, 4 May 2015 21:03:12 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YpNW4-000Ete-9M; Tue, 05 May 2015 00:03:04 +0300 Date: Tue, 5 May 2015 00:03:04 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Message-ID: <20150504210304.GA1394@zxy.spb.ru> References: <201504301823.t3UINd74073186@svn.freebsd.org> <26088556.xbkUe5VAyp@ralph.baldwin.cx> <20150504185125.GL34544@FreeBSD.org> <2463555.FfYUgqxYi8@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2463555.FfYUgqxYi8@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 21:03:13 -0000 On Mon, May 04, 2015 at 04:01:28PM -0400, John Baldwin wrote: > On Monday, May 04, 2015 09:51:25 PM Gleb Smirnoff wrote: > > John, > > > > On Mon, May 04, 2015 at 09:58:49AM -0400, John Baldwin wrote: > > J> > J> > J> So the importaing thing here is that if_get_counter() is still doing > > J> > J> > J> per-ifnet stats. The stat you underlined above is per-queue instead. > > J> > J> > J> We well need more explicitly knowledge of queues outside of drivers > > J> > J> > J> and in the stack itself to support a generic framework for per-queue > > J> > J> > J> stats. > > J> > J> > > > J> > J> > This depends on how generic we want the API to be. Of course, we can add > > J> > J> > an extra argument to if_get_counter(). > > J> > J> > > > J> > J> > However, if we don't expect the number of queues to exceed a reasonable > > J> > J> > number of 255 :), we can fit the functionality into existing API. > > J> > J> > We can keep the queue number in the highest 8 bits of the ift_counter > > J> > J> > parameter. > > J> > J> > > > J> > J> > #define IFCOUNTER_MASK 0x00ffffff > > J> > J> > #define IFCOUNTER_QUEUE(c) ((c) >> 24) > > J> > J> > > J> > J> I'd prefer that expose queues more directly and figure out how to handle > > J> > J> per-queue stats then (e.g. do we have some sort of driver-independent > > J> > J> structure that each ifnet has 1 or more of that maps to a queue and has > > J> > J> driver provided methods, etc. If so you could have a driver method for > > J> > J> queue stats). Note that I did use if_get_counter to report the > > J> > J> per-interface stats instead of adding a new sysctl. > > J> > > > J> > What do you prefer: an extra argument to the if_get_counter() or a extra > > J> > ifop? > > J> > > J> As I said, I'd prefer we expose queues to the stack more directly complete > > J> with per-queue ops (e.g. I'd like a per-queue if_transmit thing, though > > J> probably more like the old if_start). > > > > Your answer seems quite orthogonal to my question. I reread it couple of times, > > but still can't figure out how exactly do you prefet to fetch per-queue stats. > > Can you please explain in more detail? > > struct if_queue { > struct ifnet *ifq_parent; > void (*ifq_get_counter)(struct if_queue *, ift_counter); > ... > }; > > (Pretend that if_queue is a new object type and that each RX or TX queue on a > NIC has one.) What about bulk get? One request for 1.5K queues stats. From owner-svn-src-head@FreeBSD.ORG Mon May 4 21:07:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42A4F9CF; Mon, 4 May 2015 21:07:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30432160A; Mon, 4 May 2015 21:07:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44L7ODe043481; Mon, 4 May 2015 21:07:24 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44L7L3I043469; Mon, 4 May 2015 21:07:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505042107.t44L7L3I043469@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 4 May 2015 21:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282434 - in head: contrib/openresolv sbin/resolvconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 21:07:24 -0000 Author: gjb Date: Mon May 4 21:07:20 2015 New Revision: 282434 URL: https://svnweb.freebsd.org/changeset/base/282434 Log: MFV r225523, r282431: r225523 (hrs): Import openresolv-3.4.4. r282431: Import openresolv-3.7.0. PR: 199854 Submitted by: yuri@rawbw.com MFC after: 1 week Relnotes: yes Sponsored by: The FreeBSD Foundation Added: head/contrib/openresolv/GNUmakefile - copied unchanged from r282431, vendor/openresolv/dist/GNUmakefile head/contrib/openresolv/config-null.mk - copied unchanged from r282431, vendor/openresolv/dist/config-null.mk head/contrib/openresolv/pdns_recursor.in - copied unchanged from r282431, vendor/openresolv/dist/pdns_recursor.in Modified: head/contrib/openresolv/Makefile head/contrib/openresolv/configure head/contrib/openresolv/dnsmasq.in head/contrib/openresolv/libc.in head/contrib/openresolv/named.in head/contrib/openresolv/pdnsd.in head/contrib/openresolv/resolvconf.8.in head/contrib/openresolv/resolvconf.conf.5.in head/contrib/openresolv/resolvconf.in head/contrib/openresolv/unbound.in head/sbin/resolvconf/Makefile Directory Properties: head/contrib/openresolv/ (props changed) Copied: head/contrib/openresolv/GNUmakefile (from r282431, vendor/openresolv/dist/GNUmakefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openresolv/GNUmakefile Mon May 4 21:07:20 2015 (r282434, copy of r282431, vendor/openresolv/dist/GNUmakefile) @@ -0,0 +1,4 @@ +# Nasty hack so that make clean works without configure being run +CONFIG_MK?=$(shell test -e config.mk && echo config.mk || echo config-null.mk) + +include Makefile Modified: head/contrib/openresolv/Makefile ============================================================================== --- head/contrib/openresolv/Makefile Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/Makefile Mon May 4 21:07:20 2015 (r282434) @@ -1,8 +1,19 @@ -include config.mk +PKG= openresolv +VERSION= 3.7.0 -NAME= openresolv -VERSION= 3.4.1 -PKG= ${NAME}-${VERSION} +# Nasty hack so that make clean works without configure being run +_CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk +CONFIG_MK?= ${_CONFIG_MK} +include ${CONFIG_MK} + +SBINDIR?= /sbin +SYSCONFDIR?= /etc +LIBEXECDIR?= /libexec/resolvconf +VARDIR?= /var/run/resolvconf +RCDIR?= /etc/rc.d +RESTARTCMD?= if ${RCDIR}/\1 status >/dev/null 2>\&1; then \ + ${RCDIR}/\1 restart; \ + fi INSTALL?= install SED?= sed @@ -17,31 +28,36 @@ TARGET= ${RESOLVCONF} ${SUBSCRIBERS} SRCS= ${TARGET:C,$,.in,} # pmake SRCS:= ${TARGET:=.in} # gmake -SED_PREFIX= -e 's:@PREFIX@:${PREFIX}:g' +SED_SBINDIR= -e 's:@SBINDIR@:${SBINDIR}:g' SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g' SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' SED_RESTARTCMD= -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' +DISTPREFIX?= ${PKG}-${VERSION} +DISTFILEGZ?= ${DISTPREFIX}.tar.gz +DISTFILE?= ${DISTPREFIX}.tar.bz2 +FOSSILID?= current + .SUFFIXES: .in all: ${TARGET} .in: - ${SED} ${SED_PREFIX} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ + ${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ ${SED_VARDIR} ${SED_RCDIR} ${SED_RESTARTCMD} \ $< > $@ clean: - rm -f ${TARGET} openresolv-${VERSION}.tar.bz2 + rm -f ${TARGET} distclean: clean - rm -f config.mk + rm -f config.mk ${DISTFILE} installdirs: -install: ${TARGET} +proginstall: ${TARGET} ${INSTALL} -d ${DESTDIR}${SBINDIR} ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR} ${INSTALL} -d ${DESTDIR}${SYSCONFDIR} @@ -49,18 +65,21 @@ install: ${TARGET} ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR} ${INSTALL} -d ${DESTDIR}${LIBEXECDIR} ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR} + +maninstall: ${INSTALL} -d ${DESTDIR}${MANDIR}/man8 ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8 ${INSTALL} -d ${DESTDIR}${MANDIR}/man5 ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5 +install: proginstall maninstall + import: - rm -rf /tmp/${PKG} - ${INSTALL} -d /tmp/${PKG} - cp README ${SRCS} /tmp/${PKG} - -dist: import - cp configure Makefile resolvconf.conf /tmp/${PKG} - tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} - rm -rf /tmp/${PKG} - ls -l ${PKG}.tar.bz2 + rm -rf /tmp/${DISTPREFIX} + ${INSTALL} -d /tmp/${DISTPREFIX} + cp README ${SRCS} /tmp/${DISPREFIX} + +dist: + fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ} + gunzip -c ${DISTFILEGZ} | bzip2 >${DISTFILE} + rm ${DISTFILEGZ} Copied: head/contrib/openresolv/config-null.mk (from r282431, vendor/openresolv/dist/config-null.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openresolv/config-null.mk Mon May 4 21:07:20 2015 (r282434, copy of r282431, vendor/openresolv/dist/config-null.mk) @@ -0,0 +1 @@ +# This space left intentionally blank Modified: head/contrib/openresolv/configure ============================================================================== --- head/contrib/openresolv/configure Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/configure Mon May 4 21:07:20 2015 (r282434) @@ -9,7 +9,7 @@ TARGET= RESTARTCMD= RCDIR= -for x; do +for x do opt=${x%%=*} var=${x#*=} case "$opt" in @@ -18,7 +18,7 @@ for x; do --debug) DEBUG=$var;; --disable-debug) DEBUG=no;; --enable-debug) DEBUG=yes;; - --prefix) prefix=$var;; + --prefix) PREFIX=$var;; --sysconfdir) SYSCONFDIR=$var;; --bindir|--sbindir) SBINDIR=$var;; --libexecdir) LIBEXECDIR=$var;; @@ -41,68 +41,76 @@ for x; do esac done +if [ -z "$LIBEXECDIR" ]; then + printf "Checking for directory /libexec ... " + if [ -d /libexec ]; then + echo "yes" + LIBEXECDIR=$PREFIX/libexec/resolvconf + else + echo "no" + LIBEXECDIR=$PREFIX/lib/resolvconf + fi +fi +if [ -z "$RUNDIR" ]; then + printf "Checking for directory /run ... " + if [ -d /run ]; then + echo "yes" + RUNDIR=/run + else + echo "no" + RUNDIR=/var/run + fi +fi + : ${SED:=sed} -: ${PREFIX:=$prefix} : ${SYSCONFDIR:=$PREFIX/etc} : ${SBINDIR:=$PREFIX/sbin} -: ${LIBEXECDIR:=$PREFIX/libexec} +: ${LIBEXECDIR:=$PREFIX/libexec/resolvconf} : ${STATEDIR:=/var} : ${RUNDIR:=$STATEDIR/run} : ${MANDIR:=${PREFIX:-/usr}/share/man} eval SYSCONFDIR="$SYSCONFDIR" eval SBINDIR="$SBINDIR" -eval LIBEXECDIR="$LIBEXECDIR/resolvconf" +eval LIBEXECDIR="$LIBEXECDIR" eval VARDIR="$RUNDIR/resolvconf" eval MANDIR="$MANDIR" CONFIG_MK=config.mk if [ -z "$BUILD" ]; then - BUILD=`uname -m`-`uname -s | tr '[:upper:]' '[:lower:]'` -fi -if [ -z "$HOST" ]; then - [ -z "$TARGET" ] && TARGET=$BUILD - HOST=$TARGET -fi -if [ -z "$TARGET" ]; then - [ -z "$HOST" ] && HOST=$BUILD - TARGET=$HOST -fi - -# Debian and Slackware have linux in different places when dealing with -# autoconf, so we deal with that here. -if [ -z "$OS" ]; then - case "$TARGET" in - *-linux-*|linux-*|*-linux|linux) OS=linux;; - esac + # autoconf target triplet: cpu-vendor-os + BUILD=$(uname -m)-unknown-$(uname -s | tr '[:upper:]' '[:lower:]') fi +: ${HOST:=$BUILD} if [ -z "$OS" ]; then - # Derive OS from cpu-manufacturer-os-kernel - CPU=${TARGET%%-*} - REST=${TARGET#*-} + echo "Deriving operating system from ... $HOST" + # Derive OS from cpu-vendor-[kernel-]os + CPU=${HOST%%-*} + REST=${HOST#*-} if [ "$CPU" != "$REST" ]; then - MANU=${REST%%-*} + VENDOR=${REST%%-*} REST=${REST#*-} - if [ "$MANU" != "$REST" ]; then + if [ "$VENDOR" != "$REST" ]; then + # Use kernel if given, otherwise os OS=${REST%%-*} - REST=${REST#*-} - if [ "$OS" != "$REST" ]; then - KERNEL=${REST%%-*} - else - # 3 tupple - KERNEL=$OS - OS=$MANU - MANU= - fi else # 2 tupple - OS=$MANU - MANU= + OS=$VENDOR + VENDOR= fi fi + + # Work with cpu-kernel-os, ie Debian + case "$VENDOR" in + linux*|kfreebsd*) OS=$VENDOR; VENDOR= ;; + esac + # Special case + case "$OS" in + gnu*) OS=hurd;; # No HURD support as yet + esac fi echo "Configuring openresolv for ... $OS" @@ -118,17 +126,36 @@ for x in SYSCONFDIR SBINDIR LIBEXECDIR V echo "$x=$t $v" >>$CONFIG_MK done -if [ -e /etc/arch-release -a -d /etc/rc.d ]; then - echo "Overriding service status check for Arch Linux" - RCDIR=/etc/rc.d - RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart" - echo "yes" +if [ -z "$RESTARTCMD" ]; then + printf "Checking for systemd ... " + if [ -x /bin/systemctl ]; then + RESTARTCMD="/bin/systemctl try-restart \1" + echo "yes" + elif [ -x /usr/bin/systemctl ]; then + RESTARTCMD="/usr/bin/systemctl try-restart \1" + echo "yes" + else + echo "no" + fi +fi + +# Arch upgraded to systemd, so this check has to be just after systemd +# but higher than the others +if [ -z "$RESTARTCMD" ]; then + printf "Checking for Arch ... " + if [ -e /etc/arch-release -a -d /etc/rc.d ]; then + RCDIR=/etc/rc.d + RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart" + echo "yes" + else + echo "no" + fi fi if [ -z "$RESTARTCMD" ]; then printf "Checking for OpenRC ... " if [ -x /sbin/rc-service ]; then - RESTARTCMD="/sbin/rc-service -e \1 \&\& /sbin/rc-service \1 -- -Ds restart" + RESTARTCMD="if /sbin/rc-service -e \1; then /sbin/rc-service \1 -- -Ds restart; fi" echo "yes" else echo "no" @@ -138,7 +165,7 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for invoke-rc.d ... " if [ -x /usr/sbin/invoke-rc.d ]; then RCDIR=/etc/init.d - RESTARTCMD="/usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1 \&\& /usr/sbin/invoke-rc.d \1 restart" + RESTARTCMD="if /usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1; then /usr/sbin/invoke-rc.d \1 restart; fi" echo "yes" else echo "no" @@ -148,7 +175,19 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for service ... " if [ -x /sbin/service ]; then RCDIR=/etc/init.d - RESTARTCMD="/sbin/service \1 \&\& /sbin/service \1 restart" + RESTARTCMD="if /sbin/service \1; then /sbin/service \1 restart; fi" + echo "yes" + else + echo "no" + fi +fi +if [ -z "$RESTARTCMD" ]; then + printf "Checking for runit... " + if [ -x /bin/sv ]; then + RESTARTCMD="/bin/sv try-restart \1" + echo "yes" + elif [ -x /usr/bin/sv ]; then + RESTARTCMD="/usr/bin/sv try-restart \1" echo "yes" else echo "no" @@ -159,7 +198,7 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for $x ... " if [ -d $x ]; then RCDIR=$x - RESTARTCMD="$x/\1 status >/dev/null 2>\&1 \&\& $x/\1 restart" + RESTARTCMD="if $x/\1 status >/dev/null 2>\&1; then $x/\1 restart; fi" echo "yes" break else @@ -169,7 +208,7 @@ if [ -z "$RESTARTCMD" ]; then fi if [ -z "$RESTARTCMD" ]; then - echo "WARNING! No means of interacting with system services detected!" + echo "$0: WARNING: No means of interacting with system services detected!" exit 1 fi Modified: head/contrib/openresolv/dnsmasq.in ============================================================================== --- head/contrib/openresolv/dnsmasq.in Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/dnsmasq.in Mon May 4 21:07:20 2015 (r282434) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2009 Roy Marples +# Copyright (c) 2007-2012 Roy Marples # All rights reserved # dnsmasq subscriber for resolvconf @@ -29,12 +29,13 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$dnsmasq_conf" -a -z "$dnsmasq_resolv" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " : ${dnsmasq_pid:=/var/run/dnsmasq.pid} [ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid +[ -s "$dnsmasq_pid" ] || unset dnsmasq_pid : ${dnsmasq_service:=dnsmasq} : ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@} newconf="# Generated by resolvconf$NL" @@ -46,21 +47,18 @@ newresolv="$newconf" # so we need to validate a few things first. # Check for DBus support in the binary dbus=false -: ${dbus_pid:=/var/run/dbus/dbus.pid} -[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus.pid -[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus/pid -if [ -s "$dbus_pid" -a -s "$dnsmasq_pid" ]; then - if dnsmasq --version 2>/dev/null | \ - grep -q "^Compile time options.*[[:space:]]DBus[[:space:]]" +dbus_ex=false +dbus_introspect=$(dbus-send --print-reply --system \ + --dest=uk.org.thekelleys.dnsmasq \ + /uk/org/thekelleys/dnsmasq \ + org.freedesktop.DBus.Introspectable.Introspect \ + 2>/dev/null) +if [ $? = 0 ]; then + dbus=true + if printf %s "$dbus_introspect" | \ + grep -q '' then - # Sanity - check that dnsmasq and dbus are running - if kill -0 $(cat "$dbus_pid") 2>/dev/null && \ - kill -0 $(cat "$dnsmasq_pid") 2>/dev/null - then - dbus=true - newconf="$newconf$NL# Domain specific servers will" - newconf="$newconf be sent over dbus${NL}enable-dbus$NL" - fi + dbus_ex=true fi fi @@ -69,30 +67,97 @@ for n in $NAMESERVERS; do done dbusdest= +dbusdest_ex= +conf= for d in $DOMAINS; do dn="${d%%:*}" ns="${d#*:}" while [ -n "$ns" ]; do - if $dbus; then - SIFS=${IFS-y} OIFS=$IFS - IFS=. - set -- ${ns%%,*} - num="0x$(printf %02x $1 $2 $3 $4)" - if [ "$SIFS" = yi ]; then - unset IFS - else - IFS=$OIFS - fi - dbusdest="$dbusdest uint32:$(printf %u $num)" - dbusdest="$dbusdest string:$dn" - else - newconf="${newconf}server=/$dn/${ns%%,*}$NL" + n="${ns%%,*}" + if $dbus && ! $dbus_ex; then + case "$n" in + *.*.*.*) + SIFS=${IFS-y} OIFS=$IFS + IFS=. + set -- $n + num="0x$(printf %02x $1 $2 $3 $4)" + if [ "$SIFS" = y ]; then + unset IFS + else + IFS=$OIFS + fi + dbusdest="$dbusdest uint32:$(printf %u $num)" + dbusdest="$dbusdest string:$dn" + ;; + *:*%*) + # This version of dnsmasq won't accept + # scoped IPv6 addresses + dbus=false + ;; + *:*) + SIFS=${IFS-y} OIFS=$IFS bytes= front= back= + empty=false i=0 + IFS=: + set -- $n + while [ -n "$1" -o -n "$2" ]; do + addr="$1" + shift + if [ -z "$addr" ]; then + empty=true + continue + fi + i=$(($i + 1)) + while [ ${#addr} -lt 4 ]; do + addr="0${addr}" + done + byte1="$(printf %d 0x${addr%??})" + byte2="$(printf %d 0x${addr#??})" + if $empty; then + back="$back byte:$byte1 byte:$byte2" + else + front="$front byte:$byte1 byte:$byte2" + fi + done + while [ $i != 8 ]; do + i=$(($i + 1)) + front="$front byte:0 byte:0" + done + front="${front}$back" + if [ "$SIFS" = y ]; then + unset IFS + else + IFS=$OIFS + fi + dbusdest="${dbusdest}$front string:$dn" + ;; + *) + if ! $dbus_ex; then + dbus=false + fi + ;; + esac fi + dbusdest_ex="$dbusdest_ex${dbusdest_ex:+,}/$dn/$n" + conf="${conf}server=/$dn/$n$NL" [ "$ns" = "${ns#*,}" ] && break ns="${ns#*,}" done done +if $dbus; then + newconf="$newconf$NL# Domain specific servers will" + newconf="$newconf be sent over dbus${NL}" +else + newconf="$newconf$conf" +fi + +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$dnsmasq_conf" "$dnsmasq_resolv" +else + @SBINDIR@/resolvconf -D "$dnsmasq_conf" "$dnsmasq_resolv" +fi + changed=false if [ -n "$dnsmasq_conf" ]; then if [ ! -f "$dnsmasq_conf" ] || \ @@ -103,14 +168,13 @@ if [ -n "$dnsmasq_conf" ]; then fi fi if [ -n "$dnsmasq_resolv" ]; then + # dnsmasq polls this file so no need to set changed=true if [ -f "$dnsmasq_resolv" ]; then if [ "$(cat "$dnsmasq_resolv")" != "$(printf %s "$newresolv")" ] then - changed=true printf %s "$newresolv" >"$dnsmasq_resolv" fi else - # dnsmasq polls this file so no need to set changed=true printf %s "$newresolv" >"$dnsmasq_resolv" fi fi @@ -119,9 +183,20 @@ if $changed; then eval $dnsmasq_restart fi if $dbus; then - $changed || kill -HUP $(cat "$dnsmasq_pid") + if [ -s "$dnsmasq_pid" ]; then + $changed || kill -HUP $(cat "$dnsmasq_pid") + fi # Send even if empty so old servers are cleared + if $dbus_ex; then + method=SetDomainServers + if [ -n "$dbusdest_ex" ]; then + dbusdest_ex="array:string:$dbusdest_ex" + fi + dbusdest="$dbusdest_ex" + else + method=SetServers + fi dbus-send --system --dest=uk.org.thekelleys.dnsmasq \ - /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers \ + /uk/org/thekelleys/dnsmasq uk.org.thekelleys.$method \ $dbusdest fi Modified: head/contrib/openresolv/libc.in ============================================================================== --- head/contrib/openresolv/libc.in Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/libc.in Mon May 4 21:07:20 2015 (r282434) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2009 Roy Marples +# Copyright (c) 2007-2014 Roy Marples # All rights reserved # libc subscriber for resolvconf @@ -36,18 +36,18 @@ NL=" # sed may not be available, and this is faster on small files key_get_value() { - local key="$1" value= x= line= + local key="$1" x= line= shift if [ $# -eq 0 ]; then - while read line; do + while read -r line; do case "$line" in "$key"*) echo "${line##$key}";; esac done else - for x; do - while read line; do + for x do + while read -r line; do case "$line" in "$key"*) echo "${line##$key}";; esac @@ -56,6 +56,24 @@ key_get_value() fi } +keys_remove() +{ + local key x line found + + while read -r line; do + found=false + for key do + case "$line" in + "$key"*|"#"*|" "*|" "*|"") found=true;; + esac + $found && break + done + $found || echo "$line" + done +} + +local_nameservers="127.* 0.0.0.0 255.255.255.255 ::1" + # Support original resolvconf configuration layout # as well as the openresolv config file if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then @@ -64,12 +82,11 @@ elif [ -d "$SYSCONFDIR"/resolvconf ]; th SYSCONFDIR="$SYSCONFDIR/resolvconf/resolv.conf.d" base="$SYSCONFDIR/resolv.conf.d/base" if [ -f "$base" ]; then - name_servers="$(key_get_value "nameserver " "$base")" - search_domains="$(key_get_value "search " "$base")" - if [ -z "$search_domains" ]; then - search_domains="$(key_get_value "domain " "$base")" - fi + prepend_nameservers="$(key_get_value "nameserver " "$base")" + domain="$(key_get_value "domain " "$base")" + prepend_search="$(key_get_value "search " "$base")" resolv_conf_options="$(key_get_value "options " "$base")" + resolv_conf_sortlist="$(key_get_value "sortlist " "$base")" fi if [ -f "$SYSCONFDIR"/resolv.conf.d/head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.d/head)" @@ -81,7 +98,7 @@ fi : ${resolv_conf:=/etc/resolv.conf} : ${libc_service:=nscd} : ${libc_restart:=@RESTARTCMD ${libc_service}@} -: ${list_resolv:=@PREFIX@/sbin/resolvconf -l} +: ${list_resolv:=@SBINDIR@/resolvconf -l} if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)" fi @@ -89,6 +106,9 @@ if [ "${resolv_conf_tail-x}" = x -a -f " resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.tail)" fi +backup=true +signature="# Generated by resolvconf" + uniqify() { local result= @@ -104,6 +124,7 @@ uniqify() case "${resolv_conf_passthrough:-NO}" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + backup=false newest= for conf in "$IFACEDIR"/*; do if [ -z "$newest" -o "$conf" -nt "$newest" ]; then @@ -113,31 +134,70 @@ case "${resolv_conf_passthrough:-NO}" in [ -z "$newest" ] && exit 0 newconf="$(cat "$newest")$NL" ;; +/dev/null|[Nn][Uu][Ll][Ll]) + : ${resolv_conf_local_only:=NO} + if [ "$local_nameservers" = "127.* 0.0.0.0 255.255.255.255 ::1" ]; then + local_nameservers= + fi + # Need to overwrite our variables. + eval "$(@SBINDIR@/resolvconf -V)" + ;; + +*) + [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" + ;; +esac +case "${resolv_conf_passthrough:-NO}" in +[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;; *) - [ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" - newsearch="$(uniqify $search_domains $SEARCH $search_domains_append)" + : ${domain:=$DOMAIN} + newsearch="$(uniqify $prepend_search $SEARCH $append_search)" NS="$LOCALNAMESERVERS $NAMESERVERS" - newns="$(uniqify $name_servers $NS $name_servers_append)" + newns= + gotlocal=false + for n in $(uniqify $prepend_nameservers $NS $append_nameservers); do + add=true + islocal=false + for l in $local_nameservers; do + case "$n" in + $l) islocal=true; gotlocal=true; break;; + esac + done + if ! $islocal; then + case "${resolv_conf_local_only:-YES}" in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + $gotlocal && add=false;; + esac + fi + $add && newns="$newns $n" + done # Hold our new resolv.conf in a variable to save on temporary files - newconf="# Generated by resolvconf$NL" + newconf="$signature$NL" if [ -n "$resolv_conf_head" ]; then newconf="$newconf$resolv_conf_head$NL" fi - [ -n "$newsearch" ] && newconf="${newconf}search $newsearch$NL" + + [ -n "$domain" ] && newconf="${newconf}domain $domain$NL" + if [ -n "$newsearch" -a "$newsearch" != "$domain" ]; then + newconf="${newconf}search $newsearch$NL" + fi for n in $newns; do newconf="${newconf}nameserver $n$NL" done - # Now get any configured options - opts="$resolv_conf_options${resolv_conf_options:+ }" - opts="$opts$($list_resolv | key_get_value "options ")" - if [ -n "$opts" ]; then - newconf="${newconf}options" - for opt in $(uniqify $opts); do - newconf="${newconf} $opt" - done - newconf="$newconf$NL" + # Now add anything we don't care about such as sortlist and options + stuff="$($list_resolv | keys_remove nameserver domain search)" + if [ -n "$stuff" ]; then + newconf="$newconf$stuff$NL" + fi + + # Append any user defined ones + if [ -n "$resolv_conf_options" ]; then + newconf="${newconf}options $resolv_conf_options$NL" + fi + if [ -n "$resolv_conf_sortlist" ]; then + newconf="${newconf}sortlist $resolv_conf_sortlist$NL" fi if [ -n "$resolv_conf_tail" ]; then @@ -151,6 +211,22 @@ if [ -e "$resolv_conf" ]; then [ "$(cat "$resolv_conf")" = "$(printf %s "$newconf")" ] && exit 0 fi +# Change is good. +# If the old file does not have our signature, back it up. +# If the new file just has our signature, restore the backup. +if $backup; then + if [ "$newconf" = "$signature$NL" ]; then + if [ -e "$resolv_conf.bak" ]; then + newconf="$(cat "$resolv_conf.bak")" + fi + elif [ -e "$resolv_conf" ]; then + read line <"$resolv_conf" + if [ "$line" != "$signature" ]; then + cp "$resolv_conf" "$resolv_conf.bak" + fi + fi +fi + # Create our resolv.conf now (umask 022; echo "$newconf" >"$resolv_conf") eval $libc_restart @@ -162,7 +238,7 @@ for script in "$LIBEXECDIR"/libc.d/*; do if [ -x "$script" ]; then "$script" "$@" else - (. "$script" "$@") + (. "$script") fi retval=$(($retval + $?)) fi Modified: head/contrib/openresolv/named.in ============================================================================== --- head/contrib/openresolv/named.in Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/named.in Mon May 4 21:07:20 2015 (r282434) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2009 Roy Marples +# Copyright (c) 2007-2012 Roy Marples # All rights reserved # named subscriber for resolvconf @@ -29,7 +29,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$named_zones" -a -z "$named_options" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -40,6 +40,9 @@ then if [ -x "@RCDIR@"/bind9 ]; then # Debian and derivatives named_service=bind9 + elif [ -x "@RCDIR@"/rc.bind ]; then + # Slackware + named_service=rc.bind fi fi : ${named_service:=named} @@ -71,6 +74,13 @@ for d in $DOMAINS; do newzones="$newzones };$NL};$NL" done +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$named_options" "$named_zones" +else + @SBINDIR@/resolvconf -D "$named_options" "$named_zones" +fi + # No point in changing files or reloading bind if the end result has not # changed changed=false Copied: head/contrib/openresolv/pdns_recursor.in (from r282431, vendor/openresolv/dist/pdns_recursor.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openresolv/pdns_recursor.in Mon May 4 21:07:20 2015 (r282434, copy of r282431, vendor/openresolv/dist/pdns_recursor.in) @@ -0,0 +1,72 @@ +#!/bin/sh +# Copyright (c) 2009-2011 Roy Marples +# All rights reserved + +# PowerDNS Recursor subscriber for resolvconf + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +[ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 +. "@SYSCONFDIR@/resolvconf.conf" || exit 1 +[ -z "$pdns_zones" ] && exit 0 +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" +NL=" +" + +: ${pdns_service:=pdns_recursor} +: ${pdns_restart:=@RESTARTCMD ${pdns_service}@} + +newzones= + +# pds_recursor does not present support global forward servers, which +# does limit it's usefulness somewhat. +# If it did, the below code can be enabled, or something like it. +#for n in $NAMESERVERS; do +# newzones="$newzones${newzones:+,}$n" +#done +#[ -n "$newzones" ] && newzones=".=$newzones$NL" + +for d in $DOMAINS; do + newns= + ns="${d#*:}" + while [ -n "$ns" ]; do + newns="$newns${newns:+,}${ns%%,*}" + [ "$ns" = "${ns#*,}" ] && break + ns="${ns#*,}" + done + [ -n "$newns" ] && newzones="$newzones${d%%:*}=$newns$NL" +done + +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$pdnsd_zones" +else + @SBINDIR@/resolvconf -D "$pdnsd_zones" +fi + +if [ ! -f "$pdns_zones" ] || \ + [ "$(cat "$pdns_zones")" != "$(printf %s "$newzones")" ] +then + printf %s "$newzones" >"$pdns_zones" + eval $pdns_restart +fi Modified: head/contrib/openresolv/pdnsd.in ============================================================================== --- head/contrib/openresolv/pdnsd.in Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/pdnsd.in Mon May 4 21:07:20 2015 (r282434) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2010 Roy Marples +# Copyright (c) 2010-2013 Roy Marples # All rights reserved # pdnsd subscriber for resolvconf @@ -29,7 +29,9 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$pdnsd_conf" -a -z "$pdnsd_resolv" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" +NL=" +" : ${pdnsd_restart:=pdnsd-ctl config $pdnsd_conf} signature="# Generated by resolvconf" @@ -46,7 +48,7 @@ remove_markers() sed "/^$m1/,/^$m2/d" $@ else for x; do - while read line; do + while read -r line; do case "$line" in "$m1"*) in_marker=1;; "$m2"*) in_marker=0;; @@ -80,24 +82,32 @@ change_file() return 0 } -newresolv="# Generated by resolvconf\n" +newresolv="# Generated by resolvconf$NL" changed=false +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$pdnsd_resolv" "$pdnsd_conf" +else + @SBINDIR@/resolvconf -D "$pdnsd_resolv" "$pdnsd_conf" +fi + if [ -n "$pdnsd_resolv" ]; then for n in $NAMESERVERS; do - newresolv="${newresolv}nameserver $n\n" + newresolv="${newresolv}nameserver $n$NL" done fi -if [ -n "$pdnsd_conf" ]; then +# Only modify the configuration if it exists and we can write to it +if [ -w "$pdnsd_conf" ]; then cf="$pdnsd_conf.new" newconf= if [ -z "$pdnsd_resolv" ]; then - newconf="${newconf}server {\n" - newconf="${newconf}\tlabel=resolvconf;\n" + newconf="${newconf}server {$NL" + newconf="${newconf} label=resolvconf;$NL" if [ -n "$NAMESERVERS" ]; then - newconf="${newconf}\tip=" + newconf="${newconf} ip=" first=true for n in $NAMESERVERS; do if $first; then @@ -107,16 +117,16 @@ if [ -n "$pdnsd_conf" ]; then fi newconf="$newconf$n" done - newconf="${newconf};\n" + newconf="${newconf};$NL" fi - newconf="${newconf}}\n" + newconf="${newconf}}$NL" fi for d in $DOMAINS; do - newconf="${newconf}server {\n" - newconf="${newconf}\tinclude=.${d%%:*}.;\n" - newconf="${newconf}\tpolicy=excluded;\n" - newconf="${newconf}\tip=" + newconf="${newconf}server {$NL" + newconf="${newconf} include=.${d%%:*}.;$NL" + newconf="${newconf} policy=excluded;$NL" + newconf="${newconf} ip=" ns="${d#*:}" while [ -n "$ns" ]; do newconf="${newconf}${ns%%,*}" @@ -124,7 +134,7 @@ if [ -n "$pdnsd_conf" ]; then ns="${ns#*,}" newconf="${newconf}," done - newconf="${newconf};\n}\n" + newconf="${newconf};$NL}$NL" done rm -f "$cf" @@ -136,7 +146,7 @@ if [ -n "$pdnsd_conf" ]; then fi if change_file "$pdnsd_conf" "$cf"; then changed=true - fi + fi fi if [ -n "$pdnsd_resolv" ]; then Modified: head/contrib/openresolv/resolvconf.8.in ============================================================================== --- head/contrib/openresolv/resolvconf.8.in Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/resolvconf.8.in Mon May 4 21:07:20 2015 (r282434) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2007-2009 Roy Marples +.\" Copyright (c) 2007-2015 Roy Marples .\" All rights reserved .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,8 +22,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 3, 2009 -.Dt RESOLVCONF 8 SMM *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon May 4 21:34:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA953F89; Mon, 4 May 2015 21:34:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D968B1948; Mon, 4 May 2015 21:34:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44LYJ4W057535; Mon, 4 May 2015 21:34:19 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44LYJt0057534; Mon, 4 May 2015 21:34:19 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505042134.t44LYJt0057534@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 4 May 2015 21:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282435 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 21:34:20 -0000 Author: gjb Date: Mon May 4 21:34:19 2015 New Revision: 282435 URL: https://svnweb.freebsd.org/changeset/base/282435 Log: Remove a debugging line that snuck in with r282419. Pointyhat: gjb MFC after: 3 days X-MFC-With: r282419 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Mon May 4 21:07:20 2015 (r282434) +++ head/release/Makefile.ec2 Mon May 4 21:34:19 2015 (r282435) @@ -33,7 +33,6 @@ cw-ec2-portinstall: @touch ${.TARGET} ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} - @false .if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE}) @echo "--------------------------------------------------------------" @echo ">>> AWSKEYFILE must point at AWS keys for EC2 AMI creation" From owner-svn-src-head@FreeBSD.ORG Mon May 4 21:44:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1CA952A; Mon, 4 May 2015 21:44: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 A40441AB7; Mon, 4 May 2015 21:44:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44LiqIj062357; Mon, 4 May 2015 21:44:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44LipTX062354; Mon, 4 May 2015 21:44:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201505042144.t44LipTX062354@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 4 May 2015 21:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282436 - in head: contrib/tcpdump sbin/ping usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 21:44:52 -0000 Author: brooks Date: Mon May 4 21:44:51 2015 New Revision: 282436 URL: https://svnweb.freebsd.org/changeset/base/282436 Log: Remove "capability mode sandbox enabled" messages. These messages serve little purpose and break some consumers. PR: 199855 Differential Revision: https://reviews.freebsd.org/D2440 Reviewed by: rwatson Approved by: pjd MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/contrib/tcpdump/tcpdump.c head/sbin/ping/ping.c head/usr.bin/kdump/kdump.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Mon May 4 21:34:19 2015 (r282435) +++ head/contrib/tcpdump/tcpdump.c Mon May 4 21:44:51 2015 (r282436) @@ -1921,8 +1921,6 @@ main(int argc, char **argv) #endif if (cansandbox && cap_enter() < 0 && errno != ENOSYS) error("unable to enter the capability mode"); - if (cap_sandboxed()) - fprintf(stderr, "capability mode sandbox enabled\n"); #endif /* __FreeBSD__ */ do { Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Mon May 4 21:34:19 2015 (r282435) +++ head/sbin/ping/ping.c Mon May 4 21:44:51 2015 (r282436) @@ -737,9 +737,6 @@ main(int argc, char *const *argv) if (cansandbox && cap_enter() < 0 && errno != ENOSYS) err(1, "cap_enter"); - if (cap_sandboxed()) - fprintf(stderr, "capability mode sandbox enabled\n"); - cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS) err(1, "cap_rights_limit srecv"); Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon May 4 21:34:19 2015 (r282435) +++ head/usr.bin/kdump/kdump.c Mon May 4 21:44:51 2015 (r282436) @@ -352,8 +352,6 @@ main(int argc, char *argv[]) limitfd(STDIN_FILENO); limitfd(STDOUT_FILENO); limitfd(STDERR_FILENO); - if (cap_sandboxed()) - fprintf(stderr, "capability mode sandbox enabled\n"); TAILQ_INIT(&trace_procs); drop_logged = 0; From owner-svn-src-head@FreeBSD.ORG Mon May 4 22:05:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46B29917; Mon, 4 May 2015 22:05: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 283FC1CD5; Mon, 4 May 2015 22:05: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 t44M5Dtj072293; Mon, 4 May 2015 22:05:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44M5DPZ072292; Mon, 4 May 2015 22:05:13 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505042205.t44M5DPZ072292@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 22:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282437 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 22:05:13 -0000 Author: bapt Date: Mon May 4 22:05:12 2015 New Revision: 282437 URL: https://svnweb.freebsd.org/changeset/base/282437 Log: Take from heirloom's doctools version of checknr(1) some cosmetic fixes This helps working on synchronising both tools Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Mon May 4 21:44:51 2015 (r282436) +++ head/usr.bin/checknr/checknr.c Mon May 4 22:05:12 2015 (r282437) @@ -250,7 +250,7 @@ main(int argc, char **argv) nfiles = argc - 1; if (nfiles > 0) { - for (i=1; i=0; i--) { + for (i = stktop; i >= 0; i--) { complain(i); } } @@ -386,7 +386,7 @@ prop(int i) { if (stk[i].pl == 0) printf(".%s", br[stk[i].opno].opbr); - else switch(stk[i].opno) { + else switch (stk[i].opno) { case SZ: printf("\\s%c%d", stk[i].pl, stk[i].parm); break; @@ -395,7 +395,8 @@ prop(int i) break; default: printf("Bug: stk[%d].opno = %d = .%s, .%s", - i, stk[i].opno, br[stk[i].opno].opbr, br[stk[i].opno].clbr); + i, stk[i].opno, br[stk[i].opno].opbr, + br[stk[i].opno].clbr); } } @@ -567,7 +568,9 @@ printf("binsrch(%s) -> %d\n", mac, slot) *loc = strcpy(malloc(3), mac); ncmds++; #ifdef DEBUG -printf("after: %s %s %s %s %s, %d cmds\n", knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], knowncmds[slot+1], knowncmds[slot+2], ncmds); + printf("after: %s %s %s %s %s, %d cmds\n", + knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], + knowncmds[slot+1], knowncmds[slot+2], ncmds); #endif } @@ -592,12 +595,12 @@ binsrch(const char *mac) if (d == 0) d = p[1] - mac[1]; if (d == 0) - return mid; + return (mid); if (d < 0) bot = mid + 1; else top = mid - 1; } slot = bot; /* place it would have gone */ - return -1; + return (-1); } From owner-svn-src-head@FreeBSD.ORG Mon May 4 22:18:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3072BD78; Mon, 4 May 2015 22:18: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 050AD1E5D; Mon, 4 May 2015 22:18: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 t44MIw66077611; Mon, 4 May 2015 22:18:58 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44MIwdT077610; Mon, 4 May 2015 22:18:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505042218.t44MIwdT077610@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 22:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282438 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 22:18:59 -0000 Author: bapt Date: Mon May 4 22:18:58 2015 New Revision: 282438 URL: https://svnweb.freebsd.org/changeset/base/282438 Log: Extend the list of known nroff/troff commands Obtained from: heirloom doctools Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Mon May 4 22:05:12 2015 (r282437) +++ head/usr.bin/checknr/checknr.c Mon May 4 22:18:58 2015 (r282438) @@ -165,18 +165,22 @@ static const char *knowncmds[MAXCMDS] = "WC", "WH", "XA", "XD", "XE", "XF", "XK", "XP", "XS", "[", "[-", "[0", "[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "]", "]-", "]<", "]>", "][", "ab", "ac", "ad", "af", "am", "ar", "as", "b", "ba", "bc", "bd", -"bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", "ce", "cf", "ch", "cs", -"ct", "cu", "da", "de", "di", "dl", "dn", "ds", "dt", "dw", "dy", "ec", -"ef", "eh", "el", "em", "eo", "ep", "ev", "ex", "fc", "fi", "fl", "fo", -"fp", "ft", "fz", "hc", "he", "hl", "hp", "ht", "hw", "hx", "hy", "i", -"ie", "if", "ig", "in", "ip", "it", "ix", "lc", "lg", "li", "ll", "ln", -"lo", "lp", "ls", "lt", "m1", "m2", "m3", "m4", "mc", "mk", "mo", "n1", -"n2", "na", "ne", "nf", "nh", "nl", "nm", "nn", "np", "nr", "ns", "nx", -"of", "oh", "os", "pa", "pc", "pi", "pl", "pm", "pn", "po", "pp", "ps", -"q", "r", "rb", "rd", "re", "rm", "rn", "ro", "rr", "rs", "rt", "sb", -"sc", "sh", "sk", "so", "sp", "ss", "st", "sv", "sz", "ta", "tc", "th", -"ti", "tl", "tm", "tp", "tr", "u", "uf", "uh", "ul", "vs", "wh", "xp", -"yr", 0 +"bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", "ce", "cf", "ch", +"chop", "cs", "ct", "cu", "da", "de", "di", "dl", "dn", "do", "ds", +"dt", "dw", "dy", "ec", "ef", "eh", "el", "em", "eo", "ep", "ev", +"evc", "ex", "fallback", "fc", "feature", "fi", "fl", "flig", "fo", +"fp", "ft", "ftr", "fz", "fzoom", "hc", "he", "hidechar", "hl", "hp", +"ht", "hw", "hx", "hy", "hylang", "i", "ie", "if", "ig", "in", "ip", +"it", "ix", "kern", "kernafter", "kernbefore", "kernpair", "lc", "lg", +"lhang", "lc_ctype", "li", "ll", "ln", "lo", "lp", "ls", "lt", "m1", +"m2", "m3", "m4", "mc", "mk", "mo", "n1", "n2", "na", "ne", "nf", "nh", +"nl", "nm", "nn", "np", "nr", "ns", "nx", "of", "oh", "os", "pa", +"papersize", "pc", "pi", "pl", "pm", "pn", "po", "pp", "ps", "q", +"r", "rb", "rd", "re", "recursionlimit", "return", "rhang", "rm", +"rn", "ro", "rr", "rs", "rt", "sb", "sc", "sh", "shift", "sk", "so", +"sp", "ss", "st", "sv", "sz", "ta", "tc", "th", "ti", "tl", "tm", "tp", +"tr", "track", "u", "uf", "uh", "ul", "vs", "wh", "xflag", "xp", "yr", +0 }; static int lineno; /* current line number in input file */ From owner-svn-src-head@FreeBSD.ORG Mon May 4 22:29:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B246FB5; Mon, 4 May 2015 22:29:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [8.8.178.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F3D51039; Mon, 4 May 2015 22:29: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 t44MRupK082248; Mon, 4 May 2015 22:27:56 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44MRtXD082246; Mon, 4 May 2015 22:27:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505042227.t44MRtXD082246@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 22:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282439 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 22:29:55 -0000 Author: bapt Date: Mon May 4 22:27:55 2015 New Revision: 282439 URL: https://svnweb.freebsd.org/changeset/base/282439 Log: Remove limitation on input lines by using getline(3) Modified: head/usr.bin/checknr/checknr.1 head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.1 ============================================================================== --- head/usr.bin/checknr/checknr.1 Mon May 4 22:18:58 2015 (r282438) +++ head/usr.bin/checknr/checknr.1 Mon May 4 22:27:55 2015 (r282439) @@ -28,7 +28,7 @@ .\" @(#)checknr.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 26, 2005 +.Dd May 5, 2015 .Dt CHECKNR 1 .Os .Sh NAME @@ -157,7 +157,3 @@ There is no way to define a 1 character .Pp Does not correctly recognize certain reasonable constructs, such as conditionals. -.Pp -Input lines are limited to -.Dv LINE_MAX -(2048) bytes in length. Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Mon May 4 22:18:58 2015 (r282438) +++ head/usr.bin/checknr/checknr.c Mon May 4 22:27:55 2015 (r282439) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); * structured typesetting. */ #include +#define _WITH_GETLINE #include #include #include @@ -284,11 +285,14 @@ process(FILE *f) { int i, n; char mac[5]; /* The current macro or nroff command */ + char *line; + size_t linecap; int pl; - static char line[256]; /* the current line */ + line = NULL; + linecap = 0; stktop = -1; - for (lineno = 1; fgets(line, sizeof line, f); lineno++) { + for (lineno = 1; getline(&line, &linecap, f) > 0; lineno++) { if (line[0] == '.') { /* * find and isolate the macro/command name. @@ -367,6 +371,7 @@ process(FILE *f) } } } + free(line); /* * We've hit the end and look at all this stuff that hasn't been * matched yet! Complain, complain. From owner-svn-src-head@FreeBSD.ORG Tue May 5 00:19:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B34894F9; Tue, 5 May 2015 00:19:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A16DF1B31; Tue, 5 May 2015 00:19: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 t450J5SU035417; Tue, 5 May 2015 00:19:05 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t450J56s035416; Tue, 5 May 2015 00:19:05 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505050019.t450J56s035416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 5 May 2015 00:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282440 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 00:19:05 -0000 Author: loos Date: Tue May 5 00:19:04 2015 New Revision: 282440 URL: https://svnweb.freebsd.org/changeset/base/282440 Log: Fix DMA on RPi 2. BCM2836 has a different base address for peripherals. Obtained from: netbsd Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Mon May 4 22:27:55 2015 (r282439) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Tue May 5 00:19:04 2015 (r282440) @@ -37,14 +37,20 @@ #define BCM2835_VCBUS_IO_BASE 0x7E000000 #define BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000 +#ifdef SOC_BCM2836 +#define BCM2835_ARM_IO_BASE 0x3f000000 +#define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED +#else #define BCM2835_ARM_IO_BASE 0x20000000 -#define BCM2835_ARM_IO_SIZE 0x02000000 +#define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_CACHED +#endif +#define BCM2835_ARM_IO_SIZE 0x01000000 /* * Convert physical address to VC bus address. Should be used * when submitting address over mailbox interface */ -#define PHYS_TO_VCBUS(pa) ((pa) + BCM2835_VCBUS_SDRAM_CACHED) +#define PHYS_TO_VCBUS(pa) ((pa) + BCM2835_VCBUS_SDRAM_BASE) /* Check whether pa bellong top IO window */ #define BCM2835_ARM_IS_IO(pa) (((pa) >= BCM2835_ARM_IO_BASE) && \ @@ -61,6 +67,6 @@ * when address is returned by VC over mailbox interface. e.g. * framebuffer base */ -#define VCBUS_TO_PHYS(vca) ((vca) - BCM2835_VCBUS_SDRAM_CACHED) +#define VCBUS_TO_PHYS(vca) ((vca) - BCM2835_VCBUS_SDRAM_BASE) #endif /* _BCM2835_VCBUS_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue May 5 00:27:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8BE6732; Tue, 5 May 2015 00:27: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 976CD1BB7; Tue, 5 May 2015 00:27: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 t450RuLT039994; Tue, 5 May 2015 00:27:56 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t450RuR2039993; Tue, 5 May 2015 00:27:56 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505050027.t450RuR2039993@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 5 May 2015 00:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282441 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 00:27:56 -0000 Author: loos Date: Tue May 5 00:27:55 2015 New Revision: 282441 URL: https://svnweb.freebsd.org/changeset/base/282441 Log: Enable DMA for sdhci on RPi 2 (BCM2836). Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue May 5 00:19:04 2015 (r282440) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue May 5 00:27:55 2015 (r282441) @@ -68,15 +68,8 @@ __FBSDID("$FreeBSD$"); #define dprintf(fmt, args...) #endif -/* DMA doesn't yet work with the bcm3826 */ -#ifdef SOC_BCM2836 -#define PIO_MODE 1 -#else -#define PIO_MODE 0 -#endif - static int bcm2835_sdhci_hs = 1; -static int bcm2835_sdhci_pio_mode = PIO_MODE; +static int bcm2835_sdhci_pio_mode = 0; TUNABLE_INT("hw.bcm2835.sdhci.hs", &bcm2835_sdhci_hs); TUNABLE_INT("hw.bcm2835.sdhci.pio_mode", &bcm2835_sdhci_pio_mode); From owner-svn-src-head@FreeBSD.ORG Tue May 5 01:45:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B296D47F; Tue, 5 May 2015 01:45:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1426137C; Tue, 5 May 2015 01:45:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t451jdXc037630; Tue, 5 May 2015 01:45:39 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t451jdQ9037629; Tue, 5 May 2015 01:45:39 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505050145.t451jdQ9037629@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 5 May 2015 01:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282442 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 01:45:39 -0000 Author: loos Date: Tue May 5 01:45:38 2015 New Revision: 282442 URL: https://svnweb.freebsd.org/changeset/base/282442 Log: Now that DMA works, enable the audio driver on RPi 2. Modified: head/sys/arm/conf/RPI2 Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Tue May 5 00:27:55 2015 (r282441) +++ head/sys/arm/conf/RPI2 Tue May 5 01:45:38 2015 (r282442) @@ -131,8 +131,8 @@ device smsc device spibus device bcm2835_spi -#device vchiq -#device sound +device vchiq +device sound # Flattened Device Tree options FDT # Configure using FDT/DTB data From owner-svn-src-head@FreeBSD.ORG Tue May 5 03:08:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E47E824; Tue, 5 May 2015 03:08: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 0F6CC1D78; Tue, 5 May 2015 03:08: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 t4538nrH077733; Tue, 5 May 2015 03:08:49 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4538n3j077732; Tue, 5 May 2015 03:08:49 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201505050308.t4538n3j077732@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 5 May 2015 03:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282443 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 03:08:50 -0000 Author: allanjude (doc committer) Date: Tue May 5 03:08:49 2015 New Revision: 282443 URL: https://svnweb.freebsd.org/changeset/base/282443 Log: Add a sanity check to the swap size in zfsboot of bsdinstall Loop until the user enters a valid size (>100mb or 0) Differential Revision: https://reviews.freebsd.org/D2299 Reported By: Shawn Webb Reviewed by: roberto Approved by: brd MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Tue May 5 01:45:38 2015 (r282442) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Tue May 5 03:08:49 2015 (r282443) @@ -287,10 +287,12 @@ msg_stripe_desc="Stripe - No Redundancy" msg_stripe_help="[1+ Disks] Striping provides maximum storage but no redundancy" msg_swap_encrypt="Encrypt Swap?" msg_swap_encrypt_help="Encrypt swap partitions with temporary keys, discarded on reboot" +msg_swap_invalid="The selected swap size (%s) is invalid. Enter a number optionally followed by units. Example: 2G" msg_swap_mirror="Mirror Swap?" msg_swap_mirror_help="Mirror swap partitions for redundancy, breaks crash dumps" msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" +msg_swap_toosmall="The selected swap size (%s) is to small. Please enter a value greater than 100MB or enter 0 for no swap" msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." msg_uefi_not_supported="The FreeBSD UEFI loader does not currently support booting root-on-ZFS. Your system will need to boot in legacy (CSM) mode.\nDo you want to continue?" msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" @@ -1557,10 +1559,26 @@ while :; do ;; ?" $msg_swap_size") # Prompt the user to input/change the swap size for each disk - f_dialog_input input \ - "$msg_please_enter_amount_of_swap_space" \ - "$ZFSBOOT_SWAP_SIZE" && - ZFSBOOT_SWAP_SIZE="${input:-0}" + while :; do + f_dialog_input input \ + "$msg_please_enter_amount_of_swap_space" \ + "$ZFSBOOT_SWAP_SIZE" && + ZFSBOOT_SWAP_SIZE="${input:-0}" + if f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize + then + if [ $swapsize -ne 0 -a $swapsize -lt 104857600 ]; then + f_show_err "$msg_swap_toosmall" \ + "$ZFSBOOT_SWAP_SIZE" + continue; + else + break; + fi + else + f_show_err "$msg_swap_invalid" \ + "$ZFSBOOT_SWAP_SIZE" + continue; + fi + done ;; ?" $msg_swap_mirror") # Toggle the variable referenced both by the menu and later From owner-svn-src-head@FreeBSD.ORG Tue May 5 04:13:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1C70459; Tue, 5 May 2015 04:13: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 9642C13B5; Tue, 5 May 2015 04:13: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 t454Dnei011182; Tue, 5 May 2015 04:13:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t454DnPQ011181; Tue, 5 May 2015 04:13:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201505050413.t454DnPQ011181@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 5 May 2015 04:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282446 - head/sys/dev/pccbb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 04:13:49 -0000 Author: imp Date: Tue May 5 04:13:48 2015 New Revision: 282446 URL: https://svnweb.freebsd.org/changeset/base/282446 Log: When dealing with the TI12XX family of parts, we sometimes need to initialize the MFUNC registers. Our old test of assuming that if this register is set at all is not quite right. Many scenarios (including the power-on defaults for chips w/o EEPROMs) land us in trouble. The MFUNC0 pin should be set to signal #INTA and the MFUNC1 pin should be set to signal #INTB of multi-socketed devices. Since my memory recalls issues with blindly clearing the upper bytes of this register, perform the heuristic only when both MFUNC0 and 1 are clear. We won't work well using these pins for GPIO, and the serial interrupts won't save us because we go out of our way to generally disable them. They are needed to support legacy drivers for 16-bit PC Cards that are hard-wired to specific IRQ values. Since FreeBSD never had any of these, we configure the more reliable direct signaling. This was just one small piece of that which had been left out back in the day. Modified: head/sys/dev/pccbb/pccbb_pci.c Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Tue May 5 03:17:32 2015 (r282445) +++ head/sys/dev/pccbb/pccbb_pci.c Tue May 5 04:13:48 2015 (r282446) @@ -502,10 +502,19 @@ cbb_chipinit(struct cbb_softc *sc) * properly initialized. * * The TI125X parts have a different register. + * + * Note: Only the lower two nibbles matter. When set + * to 0, the MFUNC{0,1} pins are GPIO, which isn't + * going to work out too well because we specifically + * program these parts to parallel interrupt signalling + * elsewhere. We preserve the upper bits of this + * register since changing them have subtle side effects + * for different variants of the card and are + * extremely difficult to exaustively test. */ mux = pci_read_config(sc->dev, CBBR_MFUNC, 4); sysctrl = pci_read_config(sc->dev, CBBR_SYSCTRL, 4); - if (mux == 0) { + if ((mux & (CBBM_MFUNC_PIN0 | CBBM_MFUNC_PIN1)) == 0) { mux = (mux & ~CBBM_MFUNC_PIN0) | CBBM_MFUNC_PIN0_INTA; if ((sysctrl & CBBM_SYSCTRL_INTRTIE) == 0) @@ -518,7 +527,8 @@ cbb_chipinit(struct cbb_softc *sc) /* * Disable zoom video. Some machines initialize this * improperly and exerpience has shown that this helps - * prevent strange behavior. + * prevent strange behavior. We don't support zoom + * video anyway, so no harm can come from this. */ pci_write_config(sc->dev, CBBR_MMCTRL, 0, 4); break; From owner-svn-src-head@FreeBSD.ORG Tue May 5 04:23:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC2BF646; Tue, 5 May 2015 04:23: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 BAAD914EA; Tue, 5 May 2015 04:23: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 t454Nufh016085; Tue, 5 May 2015 04:23:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t454NuVH016084; Tue, 5 May 2015 04:23:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201505050423.t454NuVH016084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 5 May 2015 04:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282447 - head/sys/dev/pccbb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 04:23:56 -0000 Author: imp Date: Tue May 5 04:23:55 2015 New Revision: 282447 URL: https://svnweb.freebsd.org/changeset/base/282447 Log: Add some data found in TI's application note "SCPA035: PCI1510 Implementation Guide" about default values. Modified: head/sys/dev/pccbb/pccbb_pci.c Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Tue May 5 04:13:48 2015 (r282446) +++ head/sys/dev/pccbb/pccbb_pci.c Tue May 5 04:23:55 2015 (r282447) @@ -511,6 +511,13 @@ cbb_chipinit(struct cbb_softc *sc) * register since changing them have subtle side effects * for different variants of the card and are * extremely difficult to exaustively test. + * + * Also, the TI 1510/1520 changed the default for the MFUNC + * register from 0x0 to 0x1000 to enable IRQSER by default. + * We want to be careful to avoid overriding that, and the + * below test will do that. Should this check prove to be + * too permissive, we should just check against 0 and 0x1000 + * and not touch it otherwise. */ mux = pci_read_config(sc->dev, CBBR_MFUNC, 4); sysctrl = pci_read_config(sc->dev, CBBR_SYSCTRL, 4); From owner-svn-src-head@FreeBSD.ORG Tue May 5 05:14:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 810FBC76; Tue, 5 May 2015 05:14: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 6EA6219B7; Tue, 5 May 2015 05:14: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 t455EDvS040496; Tue, 5 May 2015 05:14:13 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t455EDtt040495; Tue, 5 May 2015 05:14:13 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201505050514.t455EDtt040495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Tue, 5 May 2015 05:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282448 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 05:14:13 -0000 Author: peter Date: Tue May 5 05:14:12 2015 New Revision: 282448 URL: https://svnweb.freebsd.org/changeset/base/282448 Log: Fix an error in r281551, part of the getfsstat() / kern_getfsstat() rework. The number of entries was supposed to be returned to the user, not used as a scratch variable. This broke RELENG_4 jails starting up on current systems. Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue May 5 04:23:55 2015 (r282447) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue May 5 05:14:12 2015 (r282448) @@ -248,7 +248,7 @@ freebsd4_freebsd32_getfsstat(struct thre { struct statfs *buf, *sp; struct statfs32 stat32; - size_t count, size; + size_t count, size, copycount; int error; count = uap->bufsize / sizeof(struct statfs32); @@ -256,12 +256,13 @@ freebsd4_freebsd32_getfsstat(struct thre error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->flags); if (size > 0) { sp = buf; - while (count > 0 && error == 0) { + copycount = count; + while (copycount > 0 && error == 0) { copy_statfs(sp, &stat32); error = copyout(&stat32, uap->buf, sizeof(stat32)); sp++; uap->buf++; - count--; + copycount--; } free(buf, M_TEMP); } From owner-svn-src-head@FreeBSD.ORG Tue May 5 05:16:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41B9CDD7; Tue, 5 May 2015 05:16:22 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 27DBD19D4; Tue, 5 May 2015 05:16:22 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 4440BAD6; Mon, 4 May 2015 22:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1430802981; bh=SPab1frb7XCjYLXj8bwfC7T9RZq1MRAkASUhnrIV3/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=T9puZF+OSuKuAbxFk+4CiH5mDtn7RMKX5I2bCEnrS80DL+8n1qU57//P/FZordHDV ISpjID62Ong9G0vJ9Bc7VmmCVgekNhIy5QpUfZNL/e41mhQjp1XEiMEjEWlVuJshVh a3zJ0+oP8c9cagRDCIpbH648dLsBmR6GlIxFtXOQ= From: Peter Wemm To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281551 - in head/sys: compat/freebsd32 compat/linprocfs kern sys Date: Mon, 04 May 2015 22:16:15 -0700 Message-ID: <1801676.lkz3AbOCeE@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <201504150913.t3F9DBxe052815@svn.freebsd.org> References: <201504150913.t3F9DBxe052815@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart9141800.SoBmtebVJ0"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 05:16:22 -0000 --nextPart9141800.SoBmtebVJ0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Wednesday, April 15, 2015 09:13:11 AM Edward Tomasz Napierala wrote:= > Author: trasz > Date: Wed Apr 15 09:13:11 2015 > New Revision: 281551 > URL: https://svnweb.freebsd.org/changeset/base/281551 >=20 > Log: > Rewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). Th= is > adds missing jail and MAC checks. >=20 > Differential Revision:=09https://reviews.freebsd.org/D2193 > Reviewed by:=09kib@ > MFC after:=091 month Please don't MFC this without taking care of of the follow-up bug fix. = =20 Something like r282448 is needed to keep old binaries (and old jails) w= orking. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart9141800.SoBmtebVJ0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVSFIfAAoJEDXWlwnsgJ4Em7cH/RwDS3jVblAaZflwtj7HTtsa UU0AF78yj2EDzOK64w4LMfJpxlzJrJCrz7obFg12FNpm8QpdJz7k5NgtBfndSXGr GiE2mdzO2JjK7fqvO7PiO24kvTynYABOk7Cp+b3Z0Gmzju1Ua2BwJgjdWg2fidXC sRQQEh9CN0rJayjttX6jhIgYsQZtCBHp+jLxcwmi/lLJj17UaLiVHZf97PylLotT fAUfQn/PS9ELPWW3Sl5ho2f9WtEDa+CWrKgtxvRIA7kBczxgtMDW947fe1DxwfOj oJY/IYala5iBulSycRn9ftd+RHTBZ5ZBK3+zkT4z1PrDtxKznsFRs/woi88exe4= =24Y8 -----END PGP SIGNATURE----- --nextPart9141800.SoBmtebVJ0-- From owner-svn-src-head@FreeBSD.ORG Tue May 5 06:46:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A758D755; Tue, 5 May 2015 06:46:00 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 32A7E125A; Tue, 5 May 2015 06:45:59 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t456juU7047165 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 May 2015 09:45:56 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t456juL0047164; Tue, 5 May 2015 09:45:56 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 May 2015 09:45:56 +0300 From: Gleb Smirnoff To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Message-ID: <20150505064556.GM34544@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <26088556.xbkUe5VAyp@ralph.baldwin.cx> <20150504185125.GL34544@FreeBSD.org> <2463555.FfYUgqxYi8@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2463555.FfYUgqxYi8@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 06:46:00 -0000 John, On Mon, May 04, 2015 at 04:01:28PM -0400, John Baldwin wrote: J> > Your answer seems quite orthogonal to my question. I reread it couple of times, J> > but still can't figure out how exactly do you prefet to fetch per-queue stats. J> > Can you please explain in more detail? J> J> struct if_queue { J> struct ifnet *ifq_parent; J> void (*ifq_get_counter)(struct if_queue *, ift_counter); J> ... J> }; J> J> (Pretend that if_queue is a new object type and that each RX or TX queue on a J> NIC has one.) This looks like a driver with 1024 queues would carry extra 1024 function pointers per ifnet. Is it really worth? Could it be that queue #0 differs from queue #1? Even, if a rare case when queue #N differs from queue #M do exist, they still can share the pointer and the differentiating logic would be in the function itself. Right now, in the projects/ifnet branch, I'm developing in quite opposite direction - many instances of the same driver share the set of interface options. This is done to shrink struct ifnet. What's wrong with KPI when the queue number is parameter to an ifop? This KPI would also hide the queue pointers from the stack, which are quite driver specific. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue May 5 07:33:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29AE9FF9; Tue, 5 May 2015 07:33:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B1071791; Tue, 5 May 2015 07:33:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t457XdBX008778; Tue, 5 May 2015 07:33:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457Xdum008775; Tue, 5 May 2015 07:33:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050733.t457Xdum008775@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282449 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 07:33:40 -0000 Author: bapt Date: Tue May 5 07:33:38 2015 New Revision: 282449 URL: https://svnweb.freebsd.org/changeset/base/282449 Log: Ansify to allow to work on it later Modified: head/usr.bin/vgrind/regexp.c head/usr.bin/vgrind/vfontedpr.c head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/regexp.c ============================================================================== --- head/usr.bin/vgrind/regexp.c Tue May 5 05:14:12 2015 (r282448) +++ head/usr.bin/vgrind/regexp.c Tue May 5 07:33:38 2015 (r282449) @@ -66,9 +66,7 @@ boolean l_onecase; /* true if upper and */ int -STRNCMP(s1, s2, len) - register char *s1,*s2; - register int len; +STRNCMP(register char *s1, register char *s2, register int len) { if (l_onecase) { do @@ -147,9 +145,9 @@ STRNCMP(s1, s2, len) static char *ccre; /* pointer to current position in converted exp*/ static char *ure; /* pointer current position in unconverted exp */ +/* re: unconverted irregular expression */ char * -convexp(re) - char *re; /* unconverted irregular expression */ +convexp(char *re) { register char *cre; /* pointer to converted regular expression */ @@ -344,11 +342,13 @@ expconv() * character matched. */ +/* + * s: string to check for a match in + * re: a converted irregular expression + * mstring: where to put whatever matches a \p + */ char * -expmatch (s, re, mstring) - register char *s; /* string to check for a match in */ - register char *re; /* a converted irregular expression */ - register char *mstring; /* where to put whatever matches a \p */ +expmatch (register char *s, register char *re, register char *mstring) { register char *cs; /* the current symbol */ register char *ptr,*s1; /* temporary pointer */ Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 05:14:12 2015 (r282448) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 07:33:38 2015 (r282449) @@ -542,11 +542,13 @@ skip: } while (*s); } +/* + * start: start of string to write + * end: end of string to write + * force: true if we should force nokeyw + */ static void -putKcp (start, end, force) - char *start; /* start of string to write */ - char *end; /* end of string to write */ - boolean force; /* true if we should force nokeyw */ +putKcp (char *start, char *end, boolean force) { int i; int xfld = 0; @@ -593,16 +595,14 @@ putKcp (start, end, force) static int -tabs(s, os) - char *s, *os; +tabs(char *s, char *os) { return (width(s, os) / 8); } static int -width(s, os) - register char *s, *os; +width(register char *s, register char *os) { register int i = 0; @@ -690,8 +690,7 @@ putcp(c) * look for a process beginning on this line */ static boolean -isproc(s) - char *s; +isproc(char *s) { pname[0] = '\0'; if (!l_toplex || blklevel == 0) @@ -706,8 +705,7 @@ isproc(s) */ static int -iskw(s) - register char *s; +iskw(register char *s) { register char **ss = l_keywds; register int i = 1; Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Tue May 5 05:14:12 2015 (r282448) +++ head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:33:38 2015 (r282449) @@ -55,18 +55,19 @@ __FBSDID("$FreeBSD$"); static char *tbuf; static char *filename; static int hopcount; /* detect infinite loops in termcap, init 0 */ -char *tskip(); -char *tgetstr(); -char *tdecode(); -char *getenv(); + +static int tnchktc(void); +static int tnamatch(char *); +static char *tskip(register char *); +static char *tdecode(register char *, char **); /* * Get an entry for terminal name in buffer bp, * from the termcap file. Parse is very rudimentary; * we just notice escaped newlines. */ -tgetent(bp, name, file) - char *bp, *name, *file; +int +tgetent(char *bp, char *name, char *file) { register char *cp; register int c; @@ -125,7 +126,8 @@ tgetent(bp, name, file) * entries to say "like an HP2621 but doesn't turn on the labels". * Note that this works because of the left to right scan. */ -tnchktc() +static int +tnchktc(void) { register char *p, *q; char tcname[16]; /* name of similar terminal */ @@ -172,8 +174,8 @@ tnchktc() * against each such name. The normal : terminator after the last * name (before the first field) stops us. */ -tnamatch(np) - char *np; +static int +tnamatch(char *np) { register char *Np, *Bp; @@ -199,8 +201,7 @@ tnamatch(np) * into the termcap file in octal. */ static char * -tskip(bp) - register char *bp; +tskip(register char *bp) { while (*bp && *bp != ':') @@ -251,8 +252,8 @@ tgetnum(id) * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ -tgetflag(id) - char *id; +int +tgetflag(char *id) { register char *bp = tbuf; @@ -278,8 +279,7 @@ tgetflag(id) * No checking on area overflow. */ char * -tgetstr(id, area) - char *id, **area; +tgetstr(char *id, char **area) { register char *bp = tbuf; @@ -303,9 +303,7 @@ tgetstr(id, area) * string capability escapes. */ static char * -tdecode(str, area) - register char *str; - char **area; +tdecode(register char *str, char **area) { register char *cp; register int c; From owner-svn-src-head@FreeBSD.ORG Tue May 5 07:42:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00D9A38B; Tue, 5 May 2015 07:42: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 E401E18CC; Tue, 5 May 2015 07:42: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 t457gADR013476; Tue, 5 May 2015 07:42:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457gAnr013475; Tue, 5 May 2015 07:42:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050742.t457gAnr013475@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282450 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 07:42:11 -0000 Author: bapt Date: Tue May 5 07:42:10 2015 New Revision: 282450 URL: https://svnweb.freebsd.org/changeset/base/282450 Log: Another bit of ansification Modified: head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 07:33:38 2015 (r282449) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 07:42:10 2015 (r282450) @@ -128,9 +128,7 @@ const char *language = "c"; /* the langu #define ps(x) printf("%s", x) int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { const char *fname = ""; struct stat stbuf; From owner-svn-src-head@FreeBSD.ORG Tue May 5 07:42:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F14934CD; Tue, 5 May 2015 07:42:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E061B18D1; Tue, 5 May 2015 07:42:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t457ge4X013583; Tue, 5 May 2015 07:42:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457geg8013582; Tue, 5 May 2015 07:42:40 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050742.t457geg8013582@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282451 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 07:42:41 -0000 Author: bapt Date: Tue May 5 07:42:40 2015 New Revision: 282451 URL: https://svnweb.freebsd.org/changeset/base/282451 Log: upper the warning level to 3 Modified: head/usr.bin/vgrind/Makefile Modified: head/usr.bin/vgrind/Makefile ============================================================================== --- head/usr.bin/vgrind/Makefile Tue May 5 07:42:10 2015 (r282450) +++ head/usr.bin/vgrind/Makefile Tue May 5 07:42:40 2015 (r282451) @@ -11,7 +11,7 @@ FILESDIR= ${SHAREDIR}/misc FILESDIR_tmac.vgrind= ${SHAREDIR}/tmac MAN= vgrind.1 vgrindefs.5 -WARNS?= 2 +WARNS?= 3 BINDIR= /usr/libexec SCRIPTSDIR=/usr/bin From owner-svn-src-head@FreeBSD.ORG Tue May 5 07:47:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B706776F; Tue, 5 May 2015 07:47: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 A5ED4192A; Tue, 5 May 2015 07:47: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 t457lbdu014341; Tue, 5 May 2015 07:47:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457lbrr014340; Tue, 5 May 2015 07:47:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050747.t457lbrr014340@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282452 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 07:47:37 -0000 Author: bapt Date: Tue May 5 07:47:36 2015 New Revision: 282452 URL: https://svnweb.freebsd.org/changeset/base/282452 Log: Use strlcpy(3) instead of strcpy(3) Modified: head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:42:40 2015 (r282451) +++ head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:47:36 2015 (r282452) @@ -145,7 +145,7 @@ tnchktc(void) /* p now points to beginning of last field */ if (p[0] != 't' || p[1] != 'c') return(1); - strcpy(tcname,p+3); + strlcpy(tcname, p+3, 16); q = tcname; while (q && *q != ':') q++; @@ -163,7 +163,7 @@ tnchktc(void) write(STDERR_FILENO, "Vgrind entry too long\n", 23); q[BUFSIZ - (p-tbuf)] = 0; } - strcpy(p, q+1); + strlcpy(p, q+1, BUFSIZ - (p - holdtbuf)); tbuf = holdtbuf; return(1); } From owner-svn-src-head@FreeBSD.ORG Tue May 5 07:49:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F10FA942; Tue, 5 May 2015 07:49: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 E00FB195E; Tue, 5 May 2015 07:49: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 t457nkWw014645; Tue, 5 May 2015 07:49:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457nk7B014644; Tue, 5 May 2015 07:49:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050749.t457nk7B014644@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282453 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 07:49:47 -0000 Author: bapt Date: Tue May 5 07:49:46 2015 New Revision: 282453 URL: https://svnweb.freebsd.org/changeset/base/282453 Log: Explicitly use O_RDONLY instead of 0 Modified: head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:47:36 2015 (r282452) +++ head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:49:46 2015 (r282453) @@ -79,7 +79,7 @@ tgetent(char *bp, char *name, char *file tbuf = bp; tf = 0; filename = file; - tf = open(filename, 0); + tf = open(filename, O_RDONLY); if (tf < 0) return (-1); for (;;) { From owner-svn-src-head@FreeBSD.ORG Tue May 5 07:51:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67211ABB; Tue, 5 May 2015 07:51: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 55F081A29; Tue, 5 May 2015 07:51: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 t457pw0i018529; Tue, 5 May 2015 07:51:58 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457pw0w018528; Tue, 5 May 2015 07:51:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050751.t457pw0w018528@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282454 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 07:51:58 -0000 Author: bapt Date: Tue May 5 07:51:57 2015 New Revision: 282454 URL: https://svnweb.freebsd.org/changeset/base/282454 Log: Remove unused variables Modified: head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:49:46 2015 (r282453) +++ head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:51:57 2015 (r282454) @@ -73,7 +73,6 @@ tgetent(char *bp, char *name, char *file register int c; register int i = 0, cnt = 0; char ibuf[BUFSIZ]; - char *cp2; int tf; tbuf = bp; @@ -307,7 +306,6 @@ tdecode(register char *str, char **area) { register char *cp; register int c; - int i; cp = *area; while (c = *str++) { From owner-svn-src-head@FreeBSD.ORG Tue May 5 07:52:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7004AC07; Tue, 5 May 2015 07:52: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 5ED9D1A39; Tue, 5 May 2015 07:52: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 t457qgB4018680; Tue, 5 May 2015 07:52:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457qgOR018679; Tue, 5 May 2015 07:52:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050752.t457qgOR018679@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282455 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 07:52:42 -0000 Author: bapt Date: Tue May 5 07:52:41 2015 New Revision: 282455 URL: https://svnweb.freebsd.org/changeset/base/282455 Log: Another function to ansify Modified: head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:51:57 2015 (r282454) +++ head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:52:41 2015 (r282455) @@ -218,8 +218,8 @@ tskip(register char *bp) * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ -tgetnum(id) - char *id; +int +tgetnum(char *id) { register int i, base; register char *bp = tbuf; From owner-svn-src-head@FreeBSD.ORG Tue May 5 08:15:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61AF3110; Tue, 5 May 2015 08:15: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 504431CAA; Tue, 5 May 2015 08:15: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 t458FC5w029012; Tue, 5 May 2015 08:15:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t458FBAv029009; Tue, 5 May 2015 08:15:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050815.t458FBAv029009@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 08:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282457 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 08:15:12 -0000 Author: bapt Date: Tue May 5 08:15:10 2015 New Revision: 282457 URL: https://svnweb.freebsd.org/changeset/base/282457 Log: Use stdbool instead of homebrewed boolean Modified: head/usr.bin/vgrind/extern.h head/usr.bin/vgrind/regexp.c head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/extern.h ============================================================================== --- head/usr.bin/vgrind/extern.h Tue May 5 08:12:24 2015 (r282456) +++ head/usr.bin/vgrind/extern.h Tue May 5 08:15:10 2015 (r282457) @@ -31,9 +31,7 @@ * $FreeBSD$ */ -typedef int boolean; - -extern boolean _escaped; /* if last character was an escape */ +extern bool _escaped; /* if last character was an escape */ extern char *s_start; /* start of the current string */ extern char *l_acmbeg; /* string introducing a comment */ extern char *l_acmend; /* string ending a comment */ @@ -45,11 +43,11 @@ extern char *l_combeg; / extern char *l_comend; /* string ending a comment */ extern char l_escape; /* character used to escape characters */ extern char *l_keywds[]; /* keyword table address */ -extern boolean l_onecase; /* upper and lower case are equivalent */ +extern bool l_onecase; /* upper and lower case are equivalent */ extern char *l_prcbeg; /* regular expr for procedure begin */ extern char *l_strbeg; /* delimiter for string constant */ extern char *l_strend; /* delimiter for string constant */ -extern boolean l_toplex; /* procedures only defined at top lex level */ +extern bool l_toplex; /* procedures only defined at top lex level */ extern const char *language; /* the language indicator */ #include Modified: head/usr.bin/vgrind/regexp.c ============================================================================== --- head/usr.bin/vgrind/regexp.c Tue May 5 08:12:24 2015 (r282456) +++ head/usr.bin/vgrind/regexp.c Tue May 5 08:15:10 2015 (r282457) @@ -44,19 +44,18 @@ static const char sccsid[] = "@(#)regexp #include #include +#include #include #include "extern.h" -#define FALSE 0 -#define TRUE !(FALSE) #define NIL 0 static void expconv(void); -boolean _escaped; /* true if we are currently _escaped */ +bool _escaped; /* true if we are currently x_escaped */ char *s_start; /* start of string */ -boolean l_onecase; /* true if upper and lower equivalent */ +bool l_onecase; /* true if upper and lower equivalent */ #define makelower(c) (isupper((c)) ? tolower((c)) : (c)) @@ -352,13 +351,13 @@ expmatch (register char *s, register cha { register char *cs; /* the current symbol */ register char *ptr,*s1; /* temporary pointer */ - boolean matched; /* a temporary boolean */ + bool matched; /* a temporary bool */ /* initial conditions */ if (re == NIL) return (NIL); cs = re; - matched = FALSE; + matched = false; /* loop till expression string is exhausted (or at least pretty tired) */ while (*cs) { @@ -464,12 +463,12 @@ expmatch (register char *s, register cha *s1 == '~' || /* C++ scope operator */ (strlen(s1) > 1 && *s1 == ':' && s1[1] == ':' && - (s1++, TRUE)))) + (s1++, true)))) return (NIL); if (*s1 == '\\') - _escaped = _escaped ? FALSE : TRUE; + _escaped = _escaped ? false : true; else - _escaped = FALSE; + _escaped = false; } while (*s1++); return (NIL); @@ -497,9 +496,9 @@ expmatch (register char *s, register cha return (NIL); } if (*s1 == '\\') - _escaped = _escaped ? FALSE : TRUE; + _escaped = _escaped ? false : true; else - _escaped = FALSE; + _escaped = false; } while (*s1++); return (NIL); Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:12:24 2015 (r282456) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:15:10 2015 (r282457) @@ -47,13 +47,12 @@ static const char sccsid[] = "@(#)vfonte #include #include #include +#include #include #include #include "pathnames.h" #include "extern.h" -#define FALSE 0 -#define TRUE !(FALSE) #define NIL 0 #define STANDARD 0 #define ALTERNATE 1 @@ -70,8 +69,8 @@ static const char sccsid[] = "@(#)vfonte #define PSMAX 20 /* size of procedure name stacking */ static int iskw(char *); -static boolean isproc(char *); -static void putKcp(char *, char *, boolean); +static bool isproc(char *); +static void putKcp(char *, char *, bool); static void putScp(char *); static void putcp(int); static int tabs(char *, char *); @@ -81,13 +80,13 @@ static int width(char *, char *); * The state variables */ -static boolean filter = FALSE; /* act as a filter (like eqn) */ -static boolean inchr; /* in a string constant */ -static boolean incomm; /* in a comment of the primary type */ -static boolean idx = FALSE; /* form an index */ -static boolean instr; /* in a string constant */ -static boolean nokeyw = FALSE; /* no keywords being flagged */ -static boolean pass = FALSE; /* +static bool filter = false; /* act as a filter (like eqn) */ +static bool inchr; /* in a string constant */ +static bool incomm; /* in a comment of the primary type */ +static bool idx = false; /* form an index */ +static bool instr; /* in a string constant */ +static bool nokeyw = false; /* no keywords being flagged */ +static bool pass = false; /* * when acting as a filter, pass indicates * whether we are currently processing * input. @@ -100,7 +99,7 @@ static char * defsfile[2] = { _PATH_VGRI static int margin; static int plstack[PSMAX]; /* the procedure nesting level stack */ static char pname[BUFSIZ+1]; -static boolean prccont; /* continue last procedure */ +static bool prccont; /* continue last procedure */ static int psptr; /* the stack index of the current procedure */ static char pstack[PSMAX][PNAMELEN+1]; /* the procedure name stack */ @@ -122,7 +121,7 @@ char *l_nocom; /* regexp for non-commen char *l_prcbeg; /* regular expr for procedure begin */ char *l_strbeg; /* delimiter for string constant */ char *l_strend; /* delimiter for string constant */ -boolean l_toplex; /* procedures only defined at top lex level */ +bool l_toplex; /* procedures only defined at top lex level */ const char *language = "c"; /* the language indicator */ #define ps(x) printf("%s", x) @@ -158,7 +157,7 @@ main(int argc, char **argv) /* act as a filter like eqn */ if (!strcmp(argv[0], "-f")) { - filter++; + filter = true; argv[0] = argv[argc-1]; argv[argc-1] = strdup("-"); continue; @@ -172,13 +171,13 @@ main(int argc, char **argv) /* build an index */ if (!strcmp(argv[0], "-x")) { - idx++; + idx = true; argv[0] = strdup("-n"); } /* indicate no keywords */ if (!strcmp(argv[0], "-n")) { - nokeyw++; + nokeyw = true; argc--, argv++; continue; } @@ -235,7 +234,7 @@ main(int argc, char **argv) exit(0); } if (cgetustr(defs, "kw", &cp) == -1) - nokeyw = TRUE; + nokeyw = true; else { char **cpp; @@ -280,10 +279,10 @@ main(int argc, char **argv) /* initialize the program */ - incomm = FALSE; - instr = FALSE; - inchr = FALSE; - _escaped = FALSE; + incomm = false; + instr = false; + inchr = false; + _escaped = false; blklevel = 0; for (psptr=0; psptr 0 /* sanity */) blklevel--; @@ -469,7 +468,7 @@ skip: /* see if we should print the last proc name */ if (--psptr >= 0) - prccont = TRUE; + prccont = true; else psptr = -1; } @@ -479,7 +478,7 @@ skip: /* start of a lexical block */ if (blksptr != NIL) { - putKcp (s, blksptr - 1, FALSE); + putKcp(s, blksptr - 1, false); s = blksptr; blklevel++; continue; @@ -492,17 +491,17 @@ skip: if (((comtype == STANDARD) && (comptr != NIL)) || ((comtype == ALTERNATE) && (acmptr != NIL))) { if (comtype == STANDARD) { - putKcp (s, comptr-1, TRUE); + putKcp(s, comptr-1, true); s = comptr; } else { - putKcp (s, acmptr-1, TRUE); + putKcp(s, acmptr-1, true); s = acmptr; } - incomm = FALSE; + incomm = false; ps("\\c\n'-C\n"); continue; } else { - putKcp (s, s + strlen(s) -1, TRUE); + putKcp(s, s + strlen(s) -1, true); s = s + strlen(s); continue; } @@ -510,12 +509,12 @@ skip: /* check for end of string */ } else if (instr) { if ((strptr = expmatch (s, l_strend, dummy)) != NIL) { - putKcp (s, strptr-1, TRUE); + putKcp(s, strptr-1, true); s = strptr; - instr = FALSE; + instr = false; continue; } else { - putKcp (s, s+strlen(s)-1, TRUE); + putKcp(s, s+strlen(s)-1, true); s = s + strlen(s); continue; } @@ -523,19 +522,19 @@ skip: /* check for end of character string */ } else if (inchr) { if ((chrptr = expmatch (s, l_chrend, dummy)) != NIL) { - putKcp (s, chrptr-1, TRUE); + putKcp(s, chrptr-1, true); s = chrptr; - inchr = FALSE; + inchr = false; continue; } else { - putKcp (s, s+strlen(s)-1, TRUE); + putKcp(s, s+strlen(s)-1, true); s = s + strlen(s); continue; } } /* print out the line */ - putKcp (s, s + strlen(s) -1, FALSE); + putKcp(s, s + strlen(s) -1, false); s = s + strlen(s); } while (*s); } @@ -546,7 +545,7 @@ skip: * force: true if we should force nokeyw */ static void -putKcp (char *start, char *end, boolean force) +putKcp(char *start, char *end, bool force) { int i; int xfld = 0; @@ -687,15 +686,15 @@ putcp(c) /* * look for a process beginning on this line */ -static boolean +static bool isproc(char *s) { pname[0] = '\0'; if (!l_toplex || blklevel == 0) if (expmatch (s, l_prcbeg, pname) != NIL) { - return (TRUE); + return (true); } - return (FALSE); + return (false); } @@ -716,4 +715,3 @@ iskw(register char *s) return (i); return (0); } - From owner-svn-src-head@FreeBSD.ORG Tue May 5 08:17:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7CBB3E7; Tue, 5 May 2015 08:17: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 C61D41CD2; Tue, 5 May 2015 08:17: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 t458HfpJ029479; Tue, 5 May 2015 08:17:41 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t458HfR9029477; Tue, 5 May 2015 08:17:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050817.t458HfR9029477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 08:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282459 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 08:17:42 -0000 Author: bapt Date: Tue May 5 08:17:40 2015 New Revision: 282459 URL: https://svnweb.freebsd.org/changeset/base/282459 Log: Replace homebrewed NIL by NULL Modified: head/usr.bin/vgrind/regexp.c head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/regexp.c ============================================================================== --- head/usr.bin/vgrind/regexp.c Tue May 5 08:16:47 2015 (r282458) +++ head/usr.bin/vgrind/regexp.c Tue May 5 08:17:40 2015 (r282459) @@ -49,8 +49,6 @@ static const char sccsid[] = "@(#)regexp #include "extern.h" -#define NIL 0 - static void expconv(void); bool _escaped; /* true if we are currently x_escaped */ @@ -151,10 +149,10 @@ convexp(char *re) register char *cre; /* pointer to converted regular expression */ /* allocate room for the converted expression */ - if (re == NIL) - return (NIL); + if (re == NULL) + return (NULL); if (*re == '\0') - return (NIL); + return (NULL); cre = malloc (4 * strlen(re) + 3); ccre = cre; ure = re; @@ -179,9 +177,9 @@ expconv() register int temp; /* let the conversion begin */ - acs = NIL; - cs = NIL; - while (*ure != NIL) { + acs = NULL; + cs = NULL; + while (*ure) { switch (c = *ure++) { case '\\': @@ -189,7 +187,7 @@ expconv() /* escaped characters are just characters */ default: - if (cs == NIL || (*cs & STR) == 0) { + if (cs == NULL || (*cs & STR) == 0) { cs = ccre; *cs = STR; SCNT(cs) = 1; @@ -204,13 +202,13 @@ expconv() case 'd': case 'e': case 'p': - if (acs != NIL && acs != cs) { + if (acs != NULL && acs != cs) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = META; @@ -223,13 +221,13 @@ expconv() /* just put the symbol in */ case '^': case '$': - if (acs != NIL && acs != cs) { + if (acs != NULL && acs != cs) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = META; @@ -245,13 +243,13 @@ expconv() /* recurse and define a subexpression */ case '(': - if (acs != NIL && acs != cs) { + if (acs != NULL && acs != cs) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = OPER; @@ -263,13 +261,13 @@ expconv() /* return from a recursion */ case ')': - if (acs != NIL) { + if (acs != NULL) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = META; @@ -281,7 +279,7 @@ expconv() /* the third byte will contain an offset to jump over the */ /* alternate match in case the first did not fail */ case '|': - if (acs != NIL && acs != cs) + if (acs != NULL && acs != cs) OCNT(ccre) = ccre - acs; /* make a back pointer */ else OCNT(ccre) = 0; @@ -295,7 +293,7 @@ expconv() /* if its not a metasymbol just build a scharacter string */ default: - if (cs == NIL || (*cs & STR) == 0) { + if (cs == NULL || (*cs & STR) == 0) { cs = ccre; *cs = STR; SCNT(cs) = 1; @@ -306,13 +304,13 @@ expconv() break; } } - if (acs != NIL) { + if (acs != NULL) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } return; } @@ -354,8 +352,8 @@ expmatch (register char *s, register cha bool matched; /* a temporary bool */ /* initial conditions */ - if (re == NIL) - return (NIL); + if (re == NULL) + return (NULL); cs = re; matched = false; @@ -383,7 +381,7 @@ expmatch (register char *s, register cha } else { /* no match, error return */ - return (NIL); + return (NULL); } break; @@ -406,7 +404,7 @@ expmatch (register char *s, register cha /* this is a grouping, recurse */ case '(': ptr = expmatch (s, ONEXT(cs), mstring); - if (ptr != NIL) { + if (ptr != NULL) { /* the subexpression matched */ matched = 1; @@ -422,7 +420,7 @@ expmatch (register char *s, register cha } else { /* no match, error return */ - return (NIL); + return (NULL); } cs = OPTR(cs); break; @@ -443,20 +441,20 @@ expmatch (register char *s, register cha s1 = s; do { ptr = expmatch (s1, MNEXT(cs), mstring); - if (ptr != NIL && s1 != s) { + if (ptr != NULL && s1 != s) { /* we have a match, remember the match */ strncpy (mstring, s, s1 - s); mstring[s1 - s] = '\0'; return (ptr); - } else if (ptr != NIL && (*cs & OPT)) { + } else if (ptr != NULL && (*cs & OPT)) { /* it was aoptional so no match is ok */ return (ptr); - } else if (ptr != NIL) { + } else if (ptr != NULL) { /* not optional and we still matched */ - return (NIL); + return (NULL); } if (!(isalnum(*s1) || *s1 == '_' || /* C++ destructor */ @@ -464,13 +462,13 @@ expmatch (register char *s, register cha /* C++ scope operator */ (strlen(s1) > 1 && *s1 == ':' && s1[1] == ':' && (s1++, true)))) - return (NIL); + return (NULL); if (*s1 == '\\') _escaped = _escaped ? false : true; else _escaped = false; } while (*s1++); - return (NIL); + return (NULL); /* try to match anything */ case 'a': @@ -482,30 +480,30 @@ expmatch (register char *s, register cha s1 = s; do { ptr = expmatch (s1, MNEXT(cs), mstring); - if (ptr != NIL && s1 != s) { + if (ptr != NULL && s1 != s) { /* we have a match */ return (ptr); - } else if (ptr != NIL && (*cs & OPT)) { + } else if (ptr != NULL && (*cs & OPT)) { /* it was aoptional so no match is ok */ return (ptr); - } else if (ptr != NIL) { + } else if (ptr != NULL) { /* not optional and we still matched */ - return (NIL); + return (NULL); } if (*s1 == '\\') _escaped = _escaped ? false : true; else _escaped = false; } while (*s1++); - return (NIL); + return (NULL); /* fail if we are currently _escaped */ case 'e': if (_escaped) - return(NIL); + return(NULL); cs = MNEXT(cs); break; @@ -537,7 +535,7 @@ expmatch (register char *s, register cha } else /* no match, error return */ - return (NIL); + return (NULL); break; /* check for end of line */ @@ -561,7 +559,7 @@ expmatch (register char *s, register cha } else /* no match, error return */ - return (NIL); + return (NULL); break; /* check for start of line */ @@ -584,7 +582,7 @@ expmatch (register char *s, register cha } else /* no match, error return */ - return (NIL); + return (NULL); break; /* end of a subexpression, return success */ Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:16:47 2015 (r282458) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:17:40 2015 (r282459) @@ -53,7 +53,6 @@ static const char sccsid[] = "@(#)vfonte #include "pathnames.h" #include "extern.h" -#define NIL 0 #define STANDARD 0 #define ALTERNATE 1 @@ -247,7 +246,7 @@ main(int argc, char **argv) while (*cp != ' ' && *cp != '\t' && *cp) cp++; } - *cpp = NIL; + *cpp = NULL; } cgetustr(defs, "pb", &cp); l_prcbeg = convexp(cp); @@ -388,9 +387,9 @@ skip: nocomptr = expmatch (s, l_nocom, dummy); /* start of non-comment? */ - if (nocomptr != NIL) - if ((nocomptr <= comptr || comptr == NIL) - && (nocomptr <= acmptr || acmptr == NIL)) { + if (nocomptr != NULL) + if ((nocomptr <= comptr || comptr == NULL) + && (nocomptr <= acmptr || acmptr == NULL)) { /* continue after non-comment */ putKcp (s, nocomptr-1, false); s = nocomptr; @@ -398,12 +397,12 @@ skip: } /* start of a comment? */ - if (comptr != NIL) - if ((comptr < strptr || strptr == NIL) - && (comptr < acmptr || acmptr == NIL) - && (comptr < chrptr || chrptr == NIL) - && (comptr < blksptr || blksptr == NIL) - && (comptr < blkeptr || blkeptr == NIL)) { + if (comptr != NULL) + if ((comptr < strptr || strptr == NULL) + && (comptr < acmptr || acmptr == NULL) + && (comptr < chrptr || chrptr == NULL) + && (comptr < blksptr || blksptr == NULL) + && (comptr < blkeptr || blkeptr == NULL)) { putKcp (s, comptr-1, false); s = comptr; incomm = true; @@ -415,11 +414,11 @@ skip: } /* start of a comment? */ - if (acmptr != NIL) - if ((acmptr < strptr || strptr == NIL) - && (acmptr < chrptr || chrptr == NIL) - && (acmptr < blksptr || blksptr == NIL) - && (acmptr < blkeptr || blkeptr == NIL)) { + if (acmptr != NULL) + if ((acmptr < strptr || strptr == NULL) + && (acmptr < chrptr || chrptr == NULL) + && (acmptr < blksptr || blksptr == NULL) + && (acmptr < blkeptr || blkeptr == NULL)) { putKcp (s, acmptr-1, false); s = acmptr; incomm = true; @@ -431,10 +430,10 @@ skip: } /* start of a string? */ - if (strptr != NIL) - if ((strptr < chrptr || chrptr == NIL) - && (strptr < blksptr || blksptr == NIL) - && (strptr < blkeptr || blkeptr == NIL)) { + if (strptr != NULL) + if ((strptr < chrptr || chrptr == NULL) + && (strptr < blksptr || blksptr == NULL) + && (strptr < blkeptr || blkeptr == NULL)) { putKcp(s, strptr-1, false); s = strptr; instr = true; @@ -442,9 +441,9 @@ skip: } /* start of a character string? */ - if (chrptr != NIL) - if ((chrptr < blksptr || blksptr == NIL) - && (chrptr < blkeptr || blkeptr == NIL)) { + if (chrptr != NULL) + if ((chrptr < blksptr || blksptr == NULL) + && (chrptr < blkeptr || blkeptr == NULL)) { putKcp(s, chrptr-1, false); s = chrptr; inchr = true; @@ -452,8 +451,8 @@ skip: } /* end of a lexical block */ - if (blkeptr != NIL) { - if (blkeptr < blksptr || blksptr == NIL) { + if (blkeptr != NULL) { + if (blkeptr < blksptr || blksptr == NULL) { putKcp(s, blkeptr - 1, false); s = blkeptr; if (blklevel > 0 /* sanity */) @@ -477,7 +476,7 @@ skip: } /* start of a lexical block */ - if (blksptr != NIL) { + if (blksptr != NULL) { putKcp(s, blksptr - 1, false); s = blksptr; blklevel++; @@ -488,8 +487,8 @@ skip: } else if (incomm) { comptr = expmatch (s, l_comend, dummy); acmptr = expmatch (s, l_acmend, dummy); - if (((comtype == STANDARD) && (comptr != NIL)) || - ((comtype == ALTERNATE) && (acmptr != NIL))) { + if (((comtype == STANDARD) && (comptr != NULL)) || + ((comtype == ALTERNATE) && (acmptr != NULL))) { if (comtype == STANDARD) { putKcp(s, comptr-1, true); s = comptr; @@ -508,7 +507,7 @@ skip: /* check for end of string */ } else if (instr) { - if ((strptr = expmatch (s, l_strend, dummy)) != NIL) { + if ((strptr = expmatch (s, l_strend, dummy)) != NULL) { putKcp(s, strptr-1, true); s = strptr; instr = false; @@ -521,7 +520,7 @@ skip: /* check for end of character string */ } else if (inchr) { - if ((chrptr = expmatch (s, l_chrend, dummy)) != NIL) { + if ((chrptr = expmatch (s, l_chrend, dummy)) != NULL) { putKcp(s, chrptr-1, true); s = chrptr; inchr = false; @@ -691,7 +690,7 @@ isproc(char *s) { pname[0] = '\0'; if (!l_toplex || blklevel == 0) - if (expmatch (s, l_prcbeg, pname) != NIL) { + if (expmatch (s, l_prcbeg, pname) != NULL) { return (true); } return (false); From owner-svn-src-head@FreeBSD.ORG Tue May 5 08:25:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C348762F; Tue, 5 May 2015 08:25:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B27AB1DE0; Tue, 5 May 2015 08:25:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t458PQ8n034068; Tue, 5 May 2015 08:25:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t458PQ93034067; Tue, 5 May 2015 08:25:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050825.t458PQ93034067@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 08:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282460 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 08:25:26 -0000 Author: bapt Date: Tue May 5 08:25:25 2015 New Revision: 282460 URL: https://svnweb.freebsd.org/changeset/base/282460 Log: Prevent useless use of strdup(3) Obtained from: NetBSD Modified: head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:17:40 2015 (r282459) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:25:25 2015 (r282460) @@ -124,6 +124,8 @@ bool l_toplex; /* procedures only defi const char *language = "c"; /* the language indicator */ #define ps(x) printf("%s", x) +static char minus[] = "-"; +static char minusn[] = "-n"; int main(int argc, char **argv) @@ -158,7 +160,7 @@ main(int argc, char **argv) if (!strcmp(argv[0], "-f")) { filter = true; argv[0] = argv[argc-1]; - argv[argc-1] = strdup("-"); + argv[argc-1] = minus; continue; } @@ -171,7 +173,7 @@ main(int argc, char **argv) /* build an index */ if (!strcmp(argv[0], "-x")) { idx = true; - argv[0] = strdup("-n"); + argv[0] = minusn; } /* indicate no keywords */ From owner-svn-src-head@FreeBSD.ORG Tue May 5 09:01:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7372FEE4; Tue, 5 May 2015 09:01: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 622441245; Tue, 5 May 2015 09:01: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 t4591h1H053356; Tue, 5 May 2015 09:01:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4591gDV053353; Tue, 5 May 2015 09:01:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050901.t4591gDV053353@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282461 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:01:43 -0000 Author: bapt Date: Tue May 5 09:01:42 2015 New Revision: 282461 URL: https://svnweb.freebsd.org/changeset/base/282461 Log: Apply seom style(9) fixes from NetBSD Obtained from: NetBSD Modified: head/usr.bin/vgrind/regexp.c head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/regexp.c ============================================================================== --- head/usr.bin/vgrind/regexp.c Tue May 5 08:25:25 2015 (r282460) +++ head/usr.bin/vgrind/regexp.c Tue May 5 09:01:42 2015 (r282461) @@ -153,7 +153,7 @@ convexp(char *re) return (NULL); if (*re == '\0') return (NULL); - cre = malloc (4 * strlen(re) + 3); + cre = malloc(4 * strlen(re) + 3); ccre = cre; ure = re; @@ -255,7 +255,7 @@ expconv() *cs = OPER; OSYM(cs) = '('; ccre = ONEXT(cs); - expconv (); + expconv(); OCNT(cs) = ccre - cs; /* offset to next symbol */ break; @@ -403,7 +403,7 @@ expmatch (register char *s, register cha /* this is a grouping, recurse */ case '(': - ptr = expmatch (s, ONEXT(cs), mstring); + ptr = expmatch(s, ONEXT(cs), mstring); if (ptr != NULL) { /* the subexpression matched */ @@ -440,7 +440,7 @@ expmatch (register char *s, register cha */ s1 = s; do { - ptr = expmatch (s1, MNEXT(cs), mstring); + ptr = expmatch(s1, MNEXT(cs), mstring); if (ptr != NULL && s1 != s) { /* we have a match, remember the match */ @@ -479,7 +479,7 @@ expmatch (register char *s, register cha */ s1 = s; do { - ptr = expmatch (s1, MNEXT(cs), mstring); + ptr = expmatch(s1, MNEXT(cs), mstring); if (ptr != NULL && s1 != s) { /* we have a match */ Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:25:25 2015 (r282460) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 09:01:42 2015 (r282461) @@ -225,10 +225,10 @@ main(int argc, char **argv) i = cgetent(&defs, defsfile, language); if (i == -1) { fprintf (stderr, "no entry for language %s\n", language); - exit (0); + exit(0); } else if (i == -2) { fprintf(stderr, "cannot find vgrindefs file %s\n", defsfile[0]); - exit (0); + exit(0); } else if (i == -3) { fprintf(stderr, "potential reference loop detected in vgrindefs file %s\n", defsfile[0]); @@ -347,8 +347,7 @@ main(int argc, char **argv) #define isidchr(c) (isalnum(c) || (c) == '_') static void -putScp(os) - char *os; +putScp(char *os) { register char *s = os; /* pointer to unmatched string */ char dummy[BUFSIZ]; /* dummy to be used by expmatch */ @@ -380,12 +379,12 @@ skip: /* check for string, comment, blockstart, etc */ if (!incomm && !instr && !inchr) { - blkeptr = expmatch (s, l_blkend, dummy); - blksptr = expmatch (s, l_blkbeg, dummy); - comptr = expmatch (s, l_combeg, dummy); - acmptr = expmatch (s, l_acmbeg, dummy); - strptr = expmatch (s, l_strbeg, dummy); - chrptr = expmatch (s, l_chrbeg, dummy); + blkeptr = expmatch(s, l_blkend, dummy); + blksptr = expmatch(s, l_blkbeg, dummy); + comptr = expmatch(s, l_combeg, dummy); + acmptr = expmatch(s, l_acmbeg, dummy); + strptr = expmatch(s, l_strbeg, dummy); + chrptr = expmatch(s, l_chrbeg, dummy); nocomptr = expmatch (s, l_nocom, dummy); /* start of non-comment? */ @@ -405,13 +404,13 @@ skip: && (comptr < chrptr || chrptr == NULL) && (comptr < blksptr || blksptr == NULL) && (comptr < blkeptr || blkeptr == NULL)) { - putKcp (s, comptr-1, false); + putKcp(s, comptr-1, false); s = comptr; incomm = true; comtype = STANDARD; if (s != os) - ps ("\\c"); - ps ("\\c\n'+C\n"); + ps("\\c"); + ps("\\c\n'+C\n"); continue; } @@ -421,13 +420,13 @@ skip: && (acmptr < chrptr || chrptr == NULL) && (acmptr < blksptr || blksptr == NULL) && (acmptr < blkeptr || blkeptr == NULL)) { - putKcp (s, acmptr-1, false); + putKcp(s, acmptr-1, false); s = acmptr; incomm = true; comtype = ALTERNATE; if (s != os) - ps ("\\c"); - ps ("\\c\n'+C\n"); + ps("\\c"); + ps("\\c\n'+C\n"); continue; } @@ -463,8 +462,8 @@ skip: /* end of current procedure */ if (s != os) - ps ("\\c"); - ps ("\\c\n'-F\n"); + ps("\\c"); + ps("\\c\n'-F\n"); blklevel = plstack[psptr]; /* see if we should print the last proc name */ @@ -487,8 +486,8 @@ skip: /* check for end of comment */ } else if (incomm) { - comptr = expmatch (s, l_comend, dummy); - acmptr = expmatch (s, l_acmend, dummy); + comptr = expmatch(s, l_comend, dummy); + acmptr = expmatch(s, l_acmend, dummy); if (((comtype == STANDARD) && (comptr != NULL)) || ((comtype == ALTERNATE) && (acmptr != NULL))) { if (comtype == STANDARD) { @@ -509,7 +508,7 @@ skip: /* check for end of string */ } else if (instr) { - if ((strptr = expmatch (s, l_strend, dummy)) != NULL) { + if ((strptr = expmatch(s, l_strend, dummy)) != NULL) { putKcp(s, strptr-1, true); s = strptr; instr = false; @@ -522,7 +521,7 @@ skip: /* check for end of character string */ } else if (inchr) { - if ((chrptr = expmatch (s, l_chrend, dummy)) != NULL) { + if ((chrptr = expmatch(s, l_chrend, dummy)) != NULL) { putKcp(s, chrptr-1, true); s = chrptr; inchr = false; @@ -587,7 +586,7 @@ putKcp(char *start, char *end, bool forc } } - putcp ((unsigned char)*start++); + putcp((unsigned char)*start++); } } @@ -620,8 +619,7 @@ width(register char *s, register char *o } static void -putcp(c) - register int c; +putcp(register int c) { switch(c) { @@ -692,7 +690,7 @@ isproc(char *s) { pname[0] = '\0'; if (!l_toplex || blklevel == 0) - if (expmatch (s, l_prcbeg, pname) != NULL) { + if (expmatch(s, l_prcbeg, pname) != NULL) { return (true); } return (false); From owner-svn-src-head@FreeBSD.ORG Tue May 5 09:24:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 772E4369; Tue, 5 May 2015 09:24: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 665AC150F; Tue, 5 May 2015 09:24: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 t459OUdA063349; Tue, 5 May 2015 09:24:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459OUZa063348; Tue, 5 May 2015 09:24:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050924.t459OUZa063348@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282462 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:24:30 -0000 Author: bapt Date: Tue May 5 09:24:29 2015 New Revision: 282462 URL: https://svnweb.freebsd.org/changeset/base/282462 Log: cosmetic fixes Obtained from: NetBSD Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:01:42 2015 (r282461) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:24:29 2015 (r282462) @@ -395,7 +395,7 @@ prop(int i) { if (stk[i].pl == 0) printf(".%s", br[stk[i].opno].opbr); - else switch (stk[i].opno) { + else switch(stk[i].opno) { case SZ: printf("\\s%c%d", stk[i].pl, stk[i].parm); break; @@ -567,7 +567,7 @@ addmac(const char *mac) } /* binsrch sets slot as a side effect */ #ifdef DEBUG -printf("binsrch(%s) -> %d\n", mac, slot); + printf("binsrch(%s) -> %d\n", mac, slot); #endif loc = &knowncmds[slot]; src = &knowncmds[ncmds-1]; From owner-svn-src-head@FreeBSD.ORG Tue May 5 09:26:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C78C4BC; Tue, 5 May 2015 09:26: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 6B4431527; Tue, 5 May 2015 09:26: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 t459QXd0063670; Tue, 5 May 2015 09:26:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459QXdL063669; Tue, 5 May 2015 09:26:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050926.t459QXdL063669@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282463 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:26:33 -0000 Author: bapt Date: Tue May 5 09:26:32 2015 New Revision: 282463 URL: https://svnweb.freebsd.org/changeset/base/282463 Log: Use stdup(3) and check its return instead from homebrew version using strcpy(3) and malloc(3) Obtained from: NetBSD Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:24:29 2015 (r282462) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:26:32 2015 (r282463) @@ -574,7 +574,8 @@ addmac(const char *mac) dest = src+1; while (dest > loc) *dest-- = *src--; - *loc = strcpy(malloc(3), mac); + if ((*loc = strdup(mac)) == NULL) + err(1, "strdup"); ncmds++; #ifdef DEBUG printf("after: %s %s %s %s %s, %d cmds\n", From owner-svn-src-head@FreeBSD.ORG Tue May 5 09:29:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6DF5641; Tue, 5 May 2015 09:29: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 B61F3155A; Tue, 5 May 2015 09:29: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 t459TWQ2064071; Tue, 5 May 2015 09:29:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459TWU9064070; Tue, 5 May 2015 09:29:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050929.t459TWU9064070@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282464 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:29:32 -0000 Author: bapt Date: Tue May 5 09:29:32 2015 New Revision: 282464 URL: https://svnweb.freebsd.org/changeset/base/282464 Log: Ensure we read existing values of the stk table Obtained from: NetBSD Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:26:32 2015 (r282463) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:29:32 2015 (r282464) @@ -341,7 +341,8 @@ process(FILE *f) n = 10 * n + line[i] - '0'; i--; if (n == 0) { - if (stk[stktop].opno == SZ) { + if (stktop >= 0 && + stk[stktop].opno == SZ) { stktop--; } else { pe(lineno); @@ -356,7 +357,8 @@ process(FILE *f) } else if (!fflag && line[i] == 'f') { n = line[++i]; if (n == 'P') { - if (stk[stktop].opno == FT) { + if (stktop >= 0 && + stk[stktop].opno == FT) { stktop--; } else { pe(lineno); From owner-svn-src-head@FreeBSD.ORG Tue May 5 09:33:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1413A831; Tue, 5 May 2015 09:33: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 E9EA41636; Tue, 5 May 2015 09:33: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 t459X3Kb068224; Tue, 5 May 2015 09:33:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459X3cs068215; Tue, 5 May 2015 09:33:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201505050933.t459X3cs068215@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 5 May 2015 09:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282465 - in head: sbin/geom/class/part sys/geom/part sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:33:04 -0000 Author: ae Date: Tue May 5 09:33:02 2015 New Revision: 282465 URL: https://svnweb.freebsd.org/changeset/base/282465 Log: Add apple-boot, apple-hfs and apple-ufs aliases to MBR scheme. Sort DOSPTYP_* entries in diskmbr.h by value. Document these scheme-specific types in gpart(8). MFC after: 1 week Modified: head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part_mbr.c head/sys/sys/diskmbr.h Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Tue May 5 09:29:32 2015 (r282464) +++ head/sbin/geom/class/part/gpart.8 Tue May 5 09:33:02 2015 (r282465) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2015 +.Dd May 5, 2015 .Dt GPART 8 .Os .Sh NAME @@ -668,6 +668,8 @@ for GPT. .It Cm apple-hfs An Apple Mac OS X partition that contains a HFS or HFS+ filesystem. The scheme-specific types are +.Qq Li "!175" +for MBR, .Qq Li "!Apple_HFS" for APM and .Qq Li "!48465300-0000-11aa-aa11-00306543ecac" @@ -696,6 +698,8 @@ for GPT. .It Cm apple-ufs An Apple Mac OS X partition that contains a UFS filesystem. The scheme-specific types are +.Qq Li "!168" +for MBR, .Qq Li "!Apple_UNIX_SVR2" for APM and .Qq Li "!55465300-0000-11aa-aa11-00306543ecac" Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue May 5 09:29:32 2015 (r282464) +++ head/sys/geom/part/g_part_mbr.c Tue May 5 09:33:02 2015 (r282465) @@ -138,6 +138,9 @@ static struct g_part_mbr_alias { { DOSPTYP_PPCBOOT, G_PART_ALIAS_PREP_BOOT }, { DOSPTYP_VMFS, G_PART_ALIAS_VMFS }, { DOSPTYP_VMKDIAG, G_PART_ALIAS_VMKDIAG }, + { DOSPTYP_APPLE_UFS, G_PART_ALIAS_APPLE_UFS }, + { DOSPTYP_APPLE_BOOT, G_PART_ALIAS_APPLE_BOOT }, + { DOSPTYP_HFS, G_PART_ALIAS_APPLE_HFS }, }; static int Modified: head/sys/sys/diskmbr.h ============================================================================== --- head/sys/sys/diskmbr.h Tue May 5 09:29:32 2015 (r282464) +++ head/sys/sys/diskmbr.h Tue May 5 09:33:02 2015 (r282465) @@ -51,11 +51,13 @@ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ #define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ #define DOSPTYP_LDM 0x42 /* Win2k dynamic extended partition */ -#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ -#define DOSPTYP_HFS 0xaf /* HFS/HFS+ partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ #define DOSPTYP_LINLVM 0x8e /* Linux LVM partition */ +#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ +#define DOSPTYP_APPLE_UFS 0xa8 /* Apple Mac OS X boot */ +#define DOSPTYP_APPLE_BOOT 0xab /* Apple Mac OS X UFS */ +#define DOSPTYP_HFS 0xaf /* HFS/HFS+ partition type */ #define DOSPTYP_PMBR 0xee /* GPT Protective MBR */ #define DOSPTYP_EFI 0xef /* EFI FAT parition */ #define DOSPTYP_VMFS 0xfb /* VMware VMFS partition */ From owner-svn-src-head@FreeBSD.ORG Tue May 5 09:33:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F087F979; Tue, 5 May 2015 09:33: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 DF4801641; Tue, 5 May 2015 09:33: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 t459XWMK068318; Tue, 5 May 2015 09:33:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459XW2A068317; Tue, 5 May 2015 09:33:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050933.t459XW2A068317@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282466 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:33:33 -0000 Author: bapt Date: Tue May 5 09:33:32 2015 New Revision: 282466 URL: https://svnweb.freebsd.org/changeset/base/282466 Log: Properly assign open and close brackets and checks memory Obtained from: NetBSD Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:33:02 2015 (r282465) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:33:32 2015 (r282466) @@ -215,8 +215,18 @@ main(int argc, char **argv) for (i=0; br[i].opbr; i++) ; for (cp=argv[1]+3; cp[-1]; cp += 6) { - br[i].opbr = strncpy(malloc(3), cp, 2); - br[i].clbr = strncpy(malloc(3), cp+3, 2); + char *tmp; + + if (i >= MAXBR) + errx(1, "too many pairs"); + if ((tmp = malloc(3)) == NULL) + err(1, "malloc"); + strlcpy(tmp, cp, 3); + br[i].opbr = tmp; + if ((tmp = malloc(3)) == NULL) + err(1, "malloc"); + strlcpy(tmp, cp+3, 3); + br[i].clbr = tmp; addmac(br[i].opbr); /* knows pairs are also known cmds */ addmac(br[i].clbr); i++; From owner-svn-src-head@FreeBSD.ORG Tue May 5 09:38:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15CCBC01; Tue, 5 May 2015 09:38:23 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4963167B; Tue, 5 May 2015 09:38:22 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D4210B980; Tue, 5 May 2015 05:38:21 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Date: Tue, 05 May 2015 05:32:11 -0400 Message-ID: <1850166.lcXaWhCA6D@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150505064556.GM34544@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <2463555.FfYUgqxYi8@ralph.baldwin.cx> <20150505064556.GM34544@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 May 2015 05:38:21 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:38:23 -0000 On Tuesday, May 05, 2015 09:45:56 AM Gleb Smirnoff wrote: > John, > > On Mon, May 04, 2015 at 04:01:28PM -0400, John Baldwin wrote: > J> > Your answer seems quite orthogonal to my question. I reread it couple of times, > J> > but still can't figure out how exactly do you prefet to fetch per-queue stats. > J> > Can you please explain in more detail? > J> > J> struct if_queue { > J> struct ifnet *ifq_parent; > J> void (*ifq_get_counter)(struct if_queue *, ift_counter); > J> ... > J> }; > J> > J> (Pretend that if_queue is a new object type and that each RX or TX queue on a > J> NIC has one.) > > This looks like a driver with 1024 queues would carry extra 1024 function pointers > per ifnet. Is it really worth? Could it be that queue #0 differs from queue #1? > Even, if a rare case when queue #N differs from queue #M do exist, they still > can share the pointer and the differentiating logic would be in the function > itself. Drivers with 1024 queues already have several pointers, however, you could have a "class" pointer (something ifnet doesn't have) like 'cdevsw' where you have a single structure containing the ops and the various queues have a pointer to that instead of having N duplicated function pointers. OTOH, you could probably keep this as an ifnet op, but accept a queue pointer as the argument still (that would give a similar effect). If you really want to trim function pointers though, fix ifnet to not duplicate them and use a shared ifnetsw among instances. :) > Right now, in the projects/ifnet branch, I'm developing in quite opposite > direction - many instances of the same driver share the set of interface > options. This is done to shrink struct ifnet. > > What's wrong with KPI when the queue number is parameter to an ifop? This > KPI would also hide the queue pointers from the stack, which are quite > driver specific. I think at some point we will want stack awareness in the stack for more than just stats. For example, the whole buf_ring/if_transmit thing has been non-ideal in terms of requiring drivers to duplicate a lot of code that was previously hidden from them making the drivers more complex (and fragile). Several of us would like to push the knowledge of the software ring (which is per-TX queue) back up out of drivers, but that will require some per-queue state stored outside of drivers. You could certainly do that with parallel arrays instead, but I'm not sure that is better than having a structure (at least I'm not sure that is as easy to reason about when you are working on the stack) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue May 5 09:50:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 768CE1A2; Tue, 5 May 2015 09:50: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 646D217DD; Tue, 5 May 2015 09:50: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 t459oMPN074547; Tue, 5 May 2015 09:50:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459oM9V074546; Tue, 5 May 2015 09:50:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050950.t459oM9V074546@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282467 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:50:22 -0000 Author: bapt Date: Tue May 5 09:50:21 2015 New Revision: 282467 URL: https://svnweb.freebsd.org/changeset/base/282467 Log: Update the list of known roff commands (adding the mdoc package) Obtained from: NetBSD Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:33:32 2015 (r282466) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:50:21 2015 (r282467) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #define MAXSTK 100 /* Stack size */ #define MAXBR 100 /* Max number of bracket pairs known */ -#define MAXCMDS 500 /* Max number of commands known */ +#define MAXCMDS 600 /* Max number of commands known */ static void addcmd(char *); static void addmac(const char *); @@ -134,6 +134,19 @@ static struct brstr { {"(q", ")q"}, {"(x", ")x"}, {"(z", ")z"}, + /* The -mdoc package */ + {"Ao", "Ac"}, + {"Bd", "Ed"}, + {"Bk", "Ek"}, + {"Bo", "Bc"}, + {"Do", "Dc"}, + {"Fo", "Fc"}, + {"Oo", "Oc"}, + {"Po", "Pc"}, + {"Qo", "Qc"}, + {"Rs", "Re"}, + {"So", "Sc"}, + {"Xo", "Xc"}, /* Things needed by preprocessors */ {"EQ", "EN"}, {"TS", "TE"}, @@ -147,40 +160,46 @@ static struct brstr { * Used so we can complain about unrecognized commands. */ static const char *knowncmds[MAXCMDS] = { -"$c", "$f", "$h", "$p", "$s", "(b", "(c", "(d", "(f", "(l", "(q", "(t", -"(x", "(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++", -"+c", "1C", "1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M", -"@c", "@e", "@f", "@h", "@m", "@n", "@o", "@p", "@r", "@t", "@z", "AB", -"AE", "AF", "AI", "AL", "AM", "AS", "AT", "AU", "AX", "B", "B1", "B2", -"BD", "BE", "BG", "BL", "BS", "BT", "BX", "C1", "C2", "CD", "CM", "CT", -"D", "DA", "DE", "DF", "DL", "DS", "DT", "EC", "EF", "EG", "EH", "EM", -"EN", "EQ", "EX", "FA", "FD", "FE", "FG", "FJ", "FK", "FL", "FN", "FO", -"FQ", "FS", "FV", "FX", "H", "HC", "HD", "HM", "HO", "HU", "I", "ID", -"IE", "IH", "IM", "IP", "IX", "IZ", "KD", "KE", "KF", "KQ", "KS", "LB", -"LC", "LD", "LE", "LG", "LI", "LP", "MC", "ME", "MF", "MH", "ML", "MR", -"MT", "ND", "NE", "NH", "NL", "NP", "NS", "OF", "OH", "OK", "OP", "P", -"P1", "PF", "PH", "PP", "PT", "PX", "PY", "QE", "QP", "QS", "R", "RA", -"RC", "RE", "RL", "RP", "RQ", "RS", "RT", "S", "S0", "S2", "S3", "SA", -"SG", "SH", "SK", "SM", "SP", "SY", "T&", "TA", "TB", "TC", "TD", "TE", -"TH", "TL", "TM", "TP", "TQ", "TR", "TS", "TX", "UL", "US", "UX", "VL", -"WC", "WH", "XA", "XD", "XE", "XF", "XK", "XP", "XS", "[", "[-", "[0", -"[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "]", "]-", "]<", "]>", -"][", "ab", "ac", "ad", "af", "am", "ar", "as", "b", "ba", "bc", "bd", -"bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", "ce", "cf", "ch", -"chop", "cs", "ct", "cu", "da", "de", "di", "dl", "dn", "do", "ds", -"dt", "dw", "dy", "ec", "ef", "eh", "el", "em", "eo", "ep", "ev", -"evc", "ex", "fallback", "fc", "feature", "fi", "fl", "flig", "fo", -"fp", "ft", "ftr", "fz", "fzoom", "hc", "he", "hidechar", "hl", "hp", -"ht", "hw", "hx", "hy", "hylang", "i", "ie", "if", "ig", "in", "ip", -"it", "ix", "kern", "kernafter", "kernbefore", "kernpair", "lc", "lg", -"lhang", "lc_ctype", "li", "ll", "ln", "lo", "lp", "ls", "lt", "m1", -"m2", "m3", "m4", "mc", "mk", "mo", "n1", "n2", "na", "ne", "nf", "nh", -"nl", "nm", "nn", "np", "nr", "ns", "nx", "of", "oh", "os", "pa", -"papersize", "pc", "pi", "pl", "pm", "pn", "po", "pp", "ps", "q", -"r", "rb", "rd", "re", "recursionlimit", "return", "rhang", "rm", -"rn", "ro", "rr", "rs", "rt", "sb", "sc", "sh", "shift", "sk", "so", -"sp", "ss", "st", "sv", "sz", "ta", "tc", "th", "ti", "tl", "tm", "tp", -"tr", "track", "u", "uf", "uh", "ul", "vs", "wh", "xflag", "xp", "yr", +"$c", "$f", "$h", "$p", "$s", "%A", "%B", "%C", "%D", "%I", "%J", "%N", "%O", +"%P", "%Q", "%R", "%T", "%V", "(b", "(c", "(d", "(f", "(l", "(q", "(t", "(x", +"(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++", "+c", "1C", +"1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M", "@c", "@e", "@f", +"@h", "@m", "@n", "@o", "@p", "@r", "@t", "@z", "AB", "AE", "AF", "AI", "AL", +"AM", "AS", "AT", "AU", "AX", "Ac", "Ad", "An", "Ao", "Ap", "Aq", "Ar", "At", +"B", "B" , "B1", "B2", "BD", "BE", "BG", "BL", "BS", "BT", "BX", "Bc", "Bd", +"Bf", "Bk", "Bl", "Bo", "Bq", "Bsx", "Bx", "C1", "C2", "CD", "CM", "CT", "Cd", +"Cm", "D", "D" , "D1", "DA", "DE", "DF", "DL", "DS", "DT", "Db", "Dc", "Dd", +"Dl", "Do", "Dq", "Dt", "Dv", "EC", "EF", "EG", "EH", "EM", "EN", "EQ", "EX", +"Ec", "Ed", "Ef", "Ek", "El", "Em", "Eo", "Er", "Ev", "FA", "FD", "FE", "FG", +"FJ", "FK", "FL", "FN", "FO", "FQ", "FS", "FV", "FX", "Fa", "Fc", "Fd", "Fl", +"Fn", "Fo", "Ft", "Fx", "H", "H" , "HC", "HD", "HM", "HO", "HU", "I", "I" , +"ID", "IE", "IH", "IM", "IP", "IX", "IZ", "Ic", "In", "It", "KD", "KE", "KF", +"KQ", "KS", "LB", "LC", "LD", "LE", "LG", "LI", "LP", "Lb", "Li", "MC", "ME", +"MF", "MH", "ML", "MR", "MT", "ND", "NE", "NH", "NL", "NP", "NS", "Nd", "Nm", +"No", "Ns", "Nx", "OF", "OH", "OK", "OP", "Oc", "Oo", "Op", "Os", "Ot", "Ox", +"P", "P" , "P1", "PF", "PH", "PP", "PT", "PX", "PY", "Pa", "Pc", "Pf", "Po", +"Pp", "Pq", "QE", "QP", "QS", "Qc", "Ql", "Qo", "Qq", "R", "R" , "RA", "RC", +"RE", "RL", "RP", "RQ", "RS", "RT", "Re", "Rs", "S", "S" , "S0", "S2", "S3", +"SA", "SG", "SH", "SK", "SM", "SP", "SY", "Sc", "Sh", "Sm", "So", "Sq", "Ss", +"St", "Sx", "Sy", "T&", "TA", "TB", "TC", "TD", "TE", "TH", "TL", "TM", "TP", +"TQ", "TR", "TS", "TX", "Tn", "UL", "US", "UX", "Ud", "Ux", "VL", "Va", "Vt", +"WC", "WH", "XA", "XD", "XE", "XF", "XK", "XP", "XS", "Xc", "Xo", "Xr", "[", +"[" , "[-", "[0", "[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "\\{", "\\}", +"]", "]" , "]-", "]<", "]>", "][", "ab", "ac", "ad", "af", "am", "ar", "as", +"b", "b" , "ba", "bc", "bd", "bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", +"ce", "cf", "ch", "chop", "cs", "ct", "cu", "da", "de", "di", "dl", "dn", "do", +"ds", "dt", "dw", "dy", "ec", "ef", "eh", "el", "em", "eo", "ep", "ev", "evc", +"ex", "fallback", "fc", "feature", "fi", "fl", "flig", "fo", "fp", "ft", "ftr", +"fz", "fzoom", "hc", "he", "hidechar", "hl", "hp", "ht", "hw", "hx", "hy", +"hylang", "i", "i" , "ie", "if", "ig", "in", "ip", "it", "ix", "kern", +"kernafter", "kernbefore", "kernpair", "lc", "lc_ctype", "lg", "lhang", "li", +"ll", "ln", "lo", "lp", "ls", "lt", "m1", "m2", "m3", "m4", "mc", "mk", "mo", +"n1", "n2", "na", "ne", "nf", "nh", "nl", "nm", "nn", "np", "nr", "ns", "nx", +"of", "oh", "os", "pa", "papersize", "pc", "pi", "pl", "pm", "pn", "po", "pp", +"ps", "q", "q" , "r", "r" , "rb", "rd", "re", "recursionlimit", "return", +"rhang", "rm", "rn", "ro", "rr", "rs", "rt", "sb", "sc", "sh", "shift", "sk", +"so", "sp", "ss", "st", "sv", "sz", "ta", "tc", "th", "ti", "tl", "tm", "tp", +"tr", "track", "u", "uf", "uh", "ul", "vs", "wh", "xflag", "xp", "yr", 0 }; From owner-svn-src-head@FreeBSD.ORG Tue May 5 09:54:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F07B4440; Tue, 5 May 2015 09:54: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 DF56118D8; Tue, 5 May 2015 09:54: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 t459slPW078726; Tue, 5 May 2015 09:54:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459slxm078725; Tue, 5 May 2015 09:54:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050954.t459slxm078725@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282468 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:54:48 -0000 Author: bapt Date: Tue May 5 09:54:47 2015 New Revision: 282468 URL: https://svnweb.freebsd.org/changeset/base/282468 Log: Enlarge the buffer for storing macros as some macros can be longer than 5 Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:50:21 2015 (r282467) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:54:47 2015 (r282468) @@ -313,7 +313,7 @@ static void process(FILE *f) { int i, n; - char mac[5]; /* The current macro or nroff command */ + char mac[512]; /* The current macro or nroff command */ char *line; size_t linecap; int pl; From owner-svn-src-head@FreeBSD.ORG Tue May 5 09:59:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D60D95D2; Tue, 5 May 2015 09:59:16 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 740851909; Tue, 5 May 2015 09:59:15 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t459x6iF048389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 May 2015 12:59:06 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t459x6FE048388; Tue, 5 May 2015 12:59:06 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 May 2015 12:59:06 +0300 From: Gleb Smirnoff To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Message-ID: <20150505095906.GO34544@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <2463555.FfYUgqxYi8@ralph.baldwin.cx> <20150505064556.GM34544@FreeBSD.org> <1850166.lcXaWhCA6D@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1850166.lcXaWhCA6D@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:59:17 -0000 On Tue, May 05, 2015 at 05:32:11AM -0400, John Baldwin wrote: J> > On Mon, May 04, 2015 at 04:01:28PM -0400, John Baldwin wrote: J> > J> > Your answer seems quite orthogonal to my question. I reread it couple of times, J> > J> > but still can't figure out how exactly do you prefet to fetch per-queue stats. J> > J> > Can you please explain in more detail? J> > J> J> > J> struct if_queue { J> > J> struct ifnet *ifq_parent; J> > J> void (*ifq_get_counter)(struct if_queue *, ift_counter); J> > J> ... J> > J> }; J> > J> J> > J> (Pretend that if_queue is a new object type and that each RX or TX queue on a J> > J> NIC has one.) J> > J> > This looks like a driver with 1024 queues would carry extra 1024 function pointers J> > per ifnet. Is it really worth? Could it be that queue #0 differs from queue #1? J> > Even, if a rare case when queue #N differs from queue #M do exist, they still J> > can share the pointer and the differentiating logic would be in the function J> > itself. J> J> Drivers with 1024 queues already have several pointers, however, you could J> have a "class" pointer (something ifnet doesn't have) like 'cdevsw' where you J> have a single structure containing the ops and the various queues have a pointer J> to that instead of having N duplicated function pointers. OTOH, you could probably J> keep this as an ifnet op, but accept a queue pointer as the argument still (that J> would give a similar effect). J> J> If you really want to trim function pointers though, fix ifnet to not duplicate J> them and use a shared ifnetsw among instances. :) Note that my own paragraph quoted below states that this is exactly what I did in projects/ifnet. J> > Right now, in the projects/ifnet branch, I'm developing in quite opposite J> > direction - many instances of the same driver share the set of interface J> > options. This is done to shrink struct ifnet. J> > J> > What's wrong with KPI when the queue number is parameter to an ifop? This J> > KPI would also hide the queue pointers from the stack, which are quite J> > driver specific. J> J> I think at some point we will want stack awareness in the stack for more than J> just stats. For example, the whole buf_ring/if_transmit thing has been non-ideal J> in terms of requiring drivers to duplicate a lot of code that was previously J> hidden from them making the drivers more complex (and fragile). Several of us J> would like to push the knowledge of the software ring (which is per-TX queue) J> back up out of drivers, but that will require some per-queue state stored outside J> of drivers. You could certainly do that with parallel arrays instead, but I'm J> not sure that is better than having a structure (at least I'm not sure that is J> as easy to reason about when you are working on the stack) Well, if the drivers access the structure functionally: dequeue, putback, etc., then this isn't a big deal. When the structure is ready, and we got drivers capable of working with it, we can introduce if_transmit_queue. I hope by that time projects/ifnet will be finalized, and expanding functionality of ifnet will be much easier. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue May 5 10:19:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2709BB96; Tue, 5 May 2015 10:19: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 15B451BAC; Tue, 5 May 2015 10:19: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 t45AJhuh089520; Tue, 5 May 2015 10:19:43 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45AJhPV089518; Tue, 5 May 2015 10:19:43 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201505051019.t45AJhPV089518@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 5 May 2015 10:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282469 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 10:19:44 -0000 Author: garga (ports committer) Date: Tue May 5 10:19:43 2015 New Revision: 282469 URL: https://svnweb.freebsd.org/changeset/base/282469 Log: Add support for Sierra MC7354 card Author: Jeremy Porter Differential Revision: https://reviews.freebsd.org/D2444 Reviewed by: gnn, hselasky MFC after: 1 week Sponsored by: Netgate Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Tue May 5 09:54:47 2015 (r282468) +++ head/sys/dev/usb/serial/u3g.c Tue May 5 10:19:43 2015 (r282469) @@ -522,6 +522,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(SIERRA, MC5727, 0), U3G_DEV(SIERRA, MC5727_2, 0), U3G_DEV(SIERRA, MC5728, 0), + U3G_DEV(SIERRA, MC7354, 0), U3G_DEV(SIERRA, MC8700, 0), U3G_DEV(SIERRA, MC8755, 0), U3G_DEV(SIERRA, MC8755_2, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue May 5 09:54:47 2015 (r282468) +++ head/sys/dev/usb/usbdevs Tue May 5 10:19:43 2015 (r282469) @@ -4029,6 +4029,7 @@ product SIERRA C22 0x6891 C22 product SIERRA E6892 0x6892 E6892 product SIERRA E6893 0x6893 E6893 product SIERRA MC8700 0x68A3 MC8700 +product SIERRA MC7354 0x6820 MC7354 product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA product SIERRA AC313U 0x68aa Sierra Wireless AirCard 313U product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer From owner-svn-src-head@FreeBSD.ORG Tue May 5 10:33:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0F4E7E; Tue, 5 May 2015 10:33: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 BF7571DA6; Tue, 5 May 2015 10:33: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 t45AX01G098724; Tue, 5 May 2015 10:33:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45AX07f098723; Tue, 5 May 2015 10:33:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051033.t45AX07f098723@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 10:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282470 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 10:33:00 -0000 Author: andrew Date: Tue May 5 10:32:59 2015 New Revision: 282470 URL: https://svnweb.freebsd.org/changeset/base/282470 Log: When cross-building ${LIBSTAND} may be set to the host copy. Point to the version built with the toolchain. Differential Revision: https://reviews.freebsd.org/D2312 Submitted by: jhb Modified: head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue May 5 10:19:43 2015 (r282469) +++ head/sys/boot/efi/loader/Makefile Tue May 5 10:32:59 2015 (r282470) @@ -38,6 +38,12 @@ CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../i386/libi386 CFLAGS+= -DNO_PCI -DEFI +# make buildenv doesn't set DESTDIR, this means LIBSTAND +# will be wrong when crossbuilding. +.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a) +LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a +.endif + .if ${MK_FORTH} != "no" BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH From owner-svn-src-head@FreeBSD.ORG Tue May 5 10:35:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2610231C; Tue, 5 May 2015 10:35:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1481E1DCE; Tue, 5 May 2015 10:35:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45AZTLb099363; Tue, 5 May 2015 10:35:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45AZTok099362; Tue, 5 May 2015 10:35:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051035.t45AZTok099362@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 10:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282471 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 10:35:30 -0000 Author: andrew Date: Tue May 5 10:35:29 2015 New Revision: 282471 URL: https://svnweb.freebsd.org/changeset/base/282471 Log: Copy new attribute types when linking. bfd will copy attributes as needed, however it will fail to output them if the type is not set correctly. This can happen when it finds an attribute it hasn't seen before, for example when building shared objects it will use the attributes from crti.o, hwever this file has no attributes set. Differential Revision: https://reviews.freebsd.org/D2413 Reviewed by: imp Modified: head/contrib/binutils/bfd/elf32-arm.c Modified: head/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- head/contrib/binutils/bfd/elf32-arm.c Tue May 5 10:32:59 2015 (r282470) +++ head/contrib/binutils/bfd/elf32-arm.c Tue May 5 10:35:29 2015 (r282471) @@ -6816,6 +6816,9 @@ elf32_arm_merge_eabi_attributes (bfd *ib for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) { + if (out_attr[i].type == 0) + out_attr[i].type = in_attr[i].type; + /* Merge this attribute with existing attributes. */ switch (i) { From owner-svn-src-head@FreeBSD.ORG Tue May 5 10:37:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DA6F4A4; Tue, 5 May 2015 10:37:25 +0000 (UTC) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 6A1D11DF8; Tue, 5 May 2015 10:37:25 +0000 (UTC) Received: from bender (host81-149-102-120.in-addr.btopenworld.com [81.149.102.120]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 5C116D7A6E; Tue, 5 May 2015 10:36:47 +0000 (UTC) Date: Tue, 5 May 2015 11:36:43 +0100 From: Andrew Turner To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282470 - head/sys/boot/efi/loader Message-ID: <20150505113643.3e0101ee@bender> In-Reply-To: <201505051033.t45AX07f098723@svn.freebsd.org> References: <201505051033.t45AX07f098723@svn.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 10:37:25 -0000 On Tue, 5 May 2015 10:33:00 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Tue May 5 10:32:59 2015 > New Revision: 282470 > URL: https://svnweb.freebsd.org/changeset/base/282470 > > Log: > When cross-building ${LIBSTAND} may be set to the host copy. Point > to the version built with the toolchain. > > Differential Revision: https://reviews.freebsd.org/D2312 > Submitted by: jhb This should be "Reviewed by: jhb" Andrew From owner-svn-src-head@FreeBSD.ORG Tue May 5 10:44:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B06A6732; Tue, 5 May 2015 10:44: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 9EB451ECB; Tue, 5 May 2015 10:44: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 t45AiIGg004337; Tue, 5 May 2015 10:44:18 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45AiIpL004336; Tue, 5 May 2015 10:44:18 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201505051044.t45AiIpL004336@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Tue, 5 May 2015 10:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282472 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 10:44:18 -0000 Author: pluknet Date: Tue May 5 10:44:17 2015 New Revision: 282472 URL: https://svnweb.freebsd.org/changeset/base/282472 Log: Fix major copy/paste and other style errors. Modified: head/lib/libc/stdlib/reallocarray.3 Modified: head/lib/libc/stdlib/reallocarray.3 ============================================================================== --- head/lib/libc/stdlib/reallocarray.3 Tue May 5 10:35:29 2015 (r282471) +++ head/lib/libc/stdlib/reallocarray.3 Tue May 5 10:44:17 2015 (r282472) @@ -1,6 +1,5 @@ -.\" .\" Copyright (c) 1980, 1991, 1993 -.\">----The Regents of the University of California. All rights reserved. +.\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information @@ -44,6 +43,9 @@ .Sh DESCRIPTION The .Fn reallocarray +function is similar to the +.Fn realloc +function except it operates on .Fa nmemb members of size @@ -53,8 +55,9 @@ and checks for integer overflow in the c * .Fa size . .Sh RETURN VALUES +The .Fn reallocarray -return a pointer to the allocated space; otherwise, a +function returns a pointer to the allocated space; otherwise, a .Dv NULL pointer is returned and .Va errno @@ -132,6 +135,8 @@ if ((newp = reallocarray(p, num, size)) .Xr realloc 3 .Sh HISTORY The -.Fn reallocf +.Fn reallocarray function first appeared in -.Ox 5.6 . +.Ox 5.6 +and +.Fx 11.0 . From owner-svn-src-head@FreeBSD.ORG Tue May 5 10:56:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C22F3B2B; Tue, 5 May 2015 10:56: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 B014C1FF4; Tue, 5 May 2015 10:56: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 t45AuH6u009811; Tue, 5 May 2015 10:56:17 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45AuHmo009810; Tue, 5 May 2015 10:56:17 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505051056.t45AuHmo009810@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 5 May 2015 10:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282473 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 10:56:17 -0000 Author: avg Date: Tue May 5 10:56:16 2015 New Revision: 282473 URL: https://svnweb.freebsd.org/changeset/base/282473 Log: dmu_recv_end_check: don't leak hold if dsl_destroy_snapshot_check_impl fails The leak may happen if !drc_newfs && drc_force and there is an error iterating through snapshots or any of snapshot checks fails. See https://www.illumos.org/issues/5870 See https://reviews.csiden.org/r/206/ Reviewed by: mahrens (as mahrens@delphix.com) MFC after: 15 days Sponsored by: ClusterHQ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue May 5 10:44:17 2015 (r282472) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue May 5 10:56:16 2015 (r282473) @@ -2010,7 +2010,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_dataset_hold_obj(dp, obj, FTAG, &snap); if (error != 0) - return (error); + break; if (snap->ds_dir != origin_head->ds_dir) error = SET_ERROR(EINVAL); if (error == 0) { @@ -2020,7 +2020,11 @@ dmu_recv_end_check(void *arg, dmu_tx_t * obj = dsl_dataset_phys(snap)->ds_prev_snap_obj; dsl_dataset_rele(snap, FTAG); if (error != 0) - return (error); + break; + } + if (error != 0) { + dsl_dataset_rele(origin_head, FTAG); + return (error); } } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, From owner-svn-src-head@FreeBSD.ORG Tue May 5 11:00:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88C90D9C; Tue, 5 May 2015 11:00: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 5CB5D10EA; Tue, 5 May 2015 11:00:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45B0qDo011676; Tue, 5 May 2015 11:00:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45B0p1o011673; Tue, 5 May 2015 11:00:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051100.t45B0p1o011673@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 11:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282474 - in head/sys/boot/efi: boot1 libefi loader/arch/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 11:00:52 -0000 Author: andrew Date: Tue May 5 11:00:50 2015 New Revision: 282474 URL: https://svnweb.freebsd.org/changeset/base/282474 Log: Disable the use of floating-point and vector registers in the loader. They need the vfp unit to be enabled which may not be the case. Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/arch/arm64/Makefile.inc Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Tue May 5 10:56:16 2015 (r282473) +++ head/sys/boot/efi/boot1/Makefile Tue May 5 11:00:50 2015 (r282474) @@ -33,6 +33,9 @@ FILESMODE_boot1.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -msoft-float -mgeneral-regs-only +.endif .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" CFLAGS+= -fPIC LDFLAGS+= -Wl,-znocombreloc Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue May 5 10:56:16 2015 (r282473) +++ head/sys/boot/efi/libefi/Makefile Tue May 5 11:00:50 2015 (r282474) @@ -6,6 +6,9 @@ INTERNALLIB= SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -msoft-float -mgeneral-regs-only +.endif .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone .endif Modified: head/sys/boot/efi/loader/arch/arm64/Makefile.inc ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/Makefile.inc Tue May 5 10:56:16 2015 (r282473) +++ head/sys/boot/efi/loader/arch/arm64/Makefile.inc Tue May 5 11:00:50 2015 (r282474) @@ -7,3 +7,5 @@ SRCS+= exec.c \ .PATH: ${.CURDIR}/../../arm64/libarm64 CFLAGS+=-I${.CURDIR}/../../arm64/libarm64 SRCS+= cache.c + +CFLAGS+= -msoft-float -mgeneral-regs-only From owner-svn-src-head@FreeBSD.ORG Tue May 5 11:01:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B515EDB; Tue, 5 May 2015 11:01:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3952B10EB; Tue, 5 May 2015 11:01: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 t45B17mV012282; Tue, 5 May 2015 11:01:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45B16eD012277; Tue, 5 May 2015 11:01:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505051101.t45B16eD012277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 5 May 2015 11:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282475 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 11:01:07 -0000 Author: avg Date: Tue May 5 11:01:06 2015 New Revision: 282475 URL: https://svnweb.freebsd.org/changeset/base/282475 Log: zfs: do not hold an extra reference on a root vnode while a filesystem is mounted At present zfs_domount() acquires a reference on the filesystem's root vnode and that reference is kept until zfs_umount. The latter calls vflush(rootrefs = 1) to dispose of the extra reference. There is no explanation of why that reference is kept - what problem it solves or what behavior it improves. Also, that logic is FreeBSD specific. There is one real problem with that reference, though. zfs recv -F may receive a full, non-incremental stream to a mounted filesystem. In that case the received root object is likely to have a different z_gen attribute value. Because of that, zfs_rezget will leave the previous root znode and vnode disassociated from the actual object (z_sa_hdl == NULL). Thus, future calls to VFS_ROOT() -> zfs_root() will produce a new vnode-znode pair, while the old one will be kept alive by the outstanding reference. So, the outstanding reference will not actually be for the new root vnode (or, more precisely, vnodes - because a root vnode may be recycled and a newer one can be created). As a result, when vflush(rootrefs = 1) s called there will be two problems: - a leaked reference on the old root vnode preventing a graceful unmount - insufficient references on the actual root vnode leading to a crash upon access to the vnode after it is destroyed by vgone() + vdrop() The second issue will actually override the first one. Differential Revision: https://reviews.freebsd.org/D2353 Reviewed by: delphij, kib, smh MFC after: 17 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue May 5 11:00:50 2015 (r282474) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue May 5 11:01:06 2015 (r282475) @@ -261,10 +261,6 @@ VTOZ(vnode_t *vp) } \ } -/* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ -#define ZFS_ENTER_NOERROR(zfsvfs) \ - rrm_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) - /* Must be called before exiting the vop */ #define ZFS_EXIT(zfsvfs) rrm_exit(&(zfsvfs)->z_teardown_lock, FTAG) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue May 5 11:00:50 2015 (r282474) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue May 5 11:01:06 2015 (r282475) @@ -1239,9 +1239,6 @@ zfs_domount(vfs_t *vfsp, char *osname) } vfs_mountedfrom(vfsp, osname); - /* Grab extra reference. */ - VERIFY(VFS_ROOT(vfsp, LK_EXCLUSIVE, &vp) == 0); - VOP_UNLOCK(vp, 0); if (!zfsvfs->z_issnap) zfsctl_create(zfsvfs); @@ -1819,7 +1816,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t znode_t *rootzp; int error; - ZFS_ENTER_NOERROR(zfsvfs); + ZFS_ENTER(zfsvfs); error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp); if (error == 0) @@ -1994,7 +1991,7 @@ zfs_umount(vfs_t *vfsp, int fflag) /* * Flush all the files. */ - ret = vflush(vfsp, 1, (fflag & MS_FORCE) ? FORCECLOSE : 0, td); + ret = vflush(vfsp, 0, (fflag & MS_FORCE) ? FORCECLOSE : 0, td); if (ret != 0) { if (!zfsvfs->z_issnap) { zfsctl_create(zfsvfs); From owner-svn-src-head@FreeBSD.ORG Tue May 5 11:07:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFEC7335; Tue, 5 May 2015 11:07: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 9E3471159; Tue, 5 May 2015 11:07: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 t45B7iCG015415; Tue, 5 May 2015 11:07:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45B7i2m015412; Tue, 5 May 2015 11:07:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051107.t45B7i2m015412@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 11:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282477 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 11:07:44 -0000 Author: andrew Date: Tue May 5 11:07:43 2015 New Revision: 282477 URL: https://svnweb.freebsd.org/changeset/base/282477 Log: Add FDT to the list of known GUIDs. Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Tue May 5 11:01:31 2015 (r282476) +++ head/sys/boot/efi/loader/main.c Tue May 5 11:07:43 2015 (r282477) @@ -59,6 +59,7 @@ EFI_GUID dxe = DXE_SERVICES_TABLE_GUID; EFI_GUID hoblist = HOB_LIST_TABLE_GUID; EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; +EFI_GUID fdtdtb = FDT_TABLE_GUID; EFI_STATUS main(int argc, CHAR16 *argv[]) @@ -287,6 +288,8 @@ command_configuration(int argc, char *ar printf("Memory Type Information Table"); else if (!memcmp(guid, &debugimg, sizeof(EFI_GUID))) printf("Debug Image Info Table"); + else if (!memcmp(guid, &fdtdtb, sizeof(EFI_GUID))) + printf("FDT Table"); else printf("Unknown Table (%s)", guid_to_string(guid)); printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); From owner-svn-src-head@FreeBSD.ORG Tue May 5 11:12:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D7934DB; Tue, 5 May 2015 11:12: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 01E131227; Tue, 5 May 2015 11:12: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 t45BCKjm019641; Tue, 5 May 2015 11:12:20 GMT (envelope-from osa@FreeBSD.org) Received: (from osa@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45BCKFv019640; Tue, 5 May 2015 11:12:20 GMT (envelope-from osa@FreeBSD.org) Message-Id: <201505051112.t45BCKFv019640@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: osa set sender to osa@FreeBSD.org using -f From: "Sergey A. Osokin" Date: Tue, 5 May 2015 11:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282478 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 11:12:21 -0000 Author: osa (ports committer) Date: Tue May 5 11:12:20 2015 New Revision: 282478 URL: https://svnweb.freebsd.org/changeset/base/282478 Log: Document DragonFly releases 4.0.2 - 4.0.5 and OpenBSD 5.7. Fix typo for NetBSD 6.1.5. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue May 5 11:07:43 2015 (r282477) +++ head/share/misc/bsd-family-tree Tue May 5 11:12:20 2015 (r282478) @@ -321,8 +321,15 @@ FreeBSD 5.2 | | | FreeBSD | | | | | 10.1 | | | DragonFly 4.0.1 | | | | | + | | | | DragonFly 4.0.2 | | | | | + | | | | DragonFly 4.0.3 | | | | | + | | | | DragonFly 4.0.4 + | | | | | + | | | | DragonFly 4.0.5 + | | | | | + | | | OpenBSD 5.7 | | | | | | | | | | | FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current @@ -655,11 +662,16 @@ DragonFly 3.8.1 2014-06-16 [DFB] DragonFly 3.6.3 2014-06-17 [DFB] FreeBSD 9.3 2014-07-05 [FBD] DragonFly 3.8.2 2014-08-08 [DFB] -NetBSD 6.1.5 2014-09-22 [NDB] +NetBSD 6.1.5 2014-09-22 [NBD] Mac OS X 10.10 2014-10-16 [APL] OpenBSD 5.6 2014-11-01 [OBD] FreeBSD 10.1 2014-11-14 [FBD] DragonFly 4.0.1 2014-11-25 [DFB] +DragonFly 4.0.2 2015-01-07 [DFB] +DragonFly 4.0.3 2015-01-21 [DFB] +DragonFly 4.0.4 2015-03-09 [DFB] +DragonFly 4.0.5 2015-01-23 [DFB] +OpenBSD 5.7 2015-05-01 [OBD] Bibliography ------------------------ From owner-svn-src-head@FreeBSD.ORG Tue May 5 11:12:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 483DE618; Tue, 5 May 2015 11:12: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 1D48A122A; Tue, 5 May 2015 11:12: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 t45BCXIu019717; Tue, 5 May 2015 11:12:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45BCXqH019716; Tue, 5 May 2015 11:12:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505051112.t45BCXqH019716@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 5 May 2015 11:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282479 - head/sys/cddl/contrib/opensolaris X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 11:12:34 -0000 Author: avg Date: Tue May 5 11:12:33 2015 New Revision: 282479 URL: https://svnweb.freebsd.org/changeset/base/282479 Log: mergeinfo for commits r282125 and r282126 Those were MFVs: MFV r282124: 5393 spurious failures from dsl_dataset_hold_obj() MFV r282123: 5610 zfs clone from different source and target pools produces coredump Modified: Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) From owner-svn-src-head@FreeBSD.ORG Tue May 5 11:13:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8C7175D; Tue, 5 May 2015 11:13: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 8CF4D1233; Tue, 5 May 2015 11:13: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 t45BDHbI019860; Tue, 5 May 2015 11:13:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45BDHme019858; Tue, 5 May 2015 11:13:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051113.t45BDHme019858@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 11:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282480 - in head/sys: arm64/arm64 dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 11:13:17 -0000 Author: andrew Date: Tue May 5 11:13:16 2015 New Revision: 282480 URL: https://svnweb.freebsd.org/changeset/base/282480 Log: Move the point we attach the ofw driver on arm64 to nexus.c. This will allow us to have a single place to decide to use ofw or acpi. Modified: head/sys/arm64/arm64/nexus.c head/sys/dev/ofw/ofwbus.c Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Tue May 5 11:12:33 2015 (r282479) +++ head/sys/arm64/arm64/nexus.c Tue May 5 11:13:16 2015 (r282480) @@ -148,6 +148,10 @@ nexus_attach(device_t dev) if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0)) panic("nexus_probe mem_rman"); + /* Add the ofwbus device */ + /* ARM64TODO: Alternatively add acpi */ + nexus_add_child(dev, 10, "ofwbus", 0); + /* * First, deal with the children we know about already */ Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Tue May 5 11:12:33 2015 (r282479) +++ head/sys/dev/ofw/ofwbus.c Tue May 5 11:13:16 2015 (r282480) @@ -69,7 +69,9 @@ struct ofwbus_softc { struct rman sc_mem_rman; }; +#ifndef __aarch64__ static device_identify_t ofwbus_identify; +#endif static device_probe_t ofwbus_probe; static device_attach_t ofwbus_attach; static bus_alloc_resource_t ofwbus_alloc_resource; @@ -78,7 +80,9 @@ static bus_release_resource_t ofwbus_rel static device_method_t ofwbus_methods[] = { /* Device interface */ +#ifndef __aarch64__ DEVMETHOD(device_identify, ofwbus_identify), +#endif DEVMETHOD(device_probe, ofwbus_probe), DEVMETHOD(device_attach, ofwbus_attach), @@ -97,6 +101,7 @@ EARLY_DRIVER_MODULE(ofwbus, nexus, ofwbu BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(ofwbus, 1); +#ifndef __aarch64__ static void ofwbus_identify(driver_t *driver, device_t parent) { @@ -108,11 +113,17 @@ ofwbus_identify(driver_t *driver, device if (device_find_child(parent, "ofwbus", -1) == NULL) BUS_ADD_CHILD(parent, 0, "ofwbus", -1); } +#endif static int ofwbus_probe(device_t dev) { +#ifdef __aarch64__ + if (OF_peer(0) == 0) + return (ENXIO); +#endif + device_set_desc(dev, "Open Firmware Device Tree"); return (BUS_PROBE_NOWILDCARD); } From owner-svn-src-head@FreeBSD.ORG Tue May 5 11:39:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 328FA26D; Tue, 5 May 2015 11:39: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 212CF151E; Tue, 5 May 2015 11:39: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 t45BdsWN031233; Tue, 5 May 2015 11:39:54 GMT (envelope-from osa@FreeBSD.org) Received: (from osa@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45BdsxC031232; Tue, 5 May 2015 11:39:54 GMT (envelope-from osa@FreeBSD.org) Message-Id: <201505051139.t45BdsxC031232@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: osa set sender to osa@FreeBSD.org using -f From: "Sergey A. Osokin" Date: Tue, 5 May 2015 11:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282481 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 11:39:55 -0000 Author: osa (ports committer) Date: Tue May 5 11:39:54 2015 New Revision: 282481 URL: https://svnweb.freebsd.org/changeset/base/282481 Log: Add "The Design and Implementation of the FreeBSD OS, 2nd Ed.". Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue May 5 11:13:16 2015 (r282480) +++ head/share/misc/bsd-family-tree Tue May 5 11:39:54 2015 (r282481) @@ -691,6 +691,10 @@ McKusick, Marshall Kirk, George Neville- Implementation of the FreeBSD Operating System. Addison-Wesley Professional, Published: Aug 2, 2004. ISBN 0-201-70245-2 +McKusick, Marshall Kirk, George Neville-Neil, Robert Watson. The +Design and Implementation of the FreeBSD Operating System, 2nd Edition. +Pearson Education, Inc., 2014. ISBN 0-321-96897-2 + Doug McIlroy. Research Unix Reader. Michael G. Brown. The Role of BSD in the Development of Unix. From owner-svn-src-head@FreeBSD.ORG Tue May 5 13:23:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A53A1BF5; Tue, 5 May 2015 13:23: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 793BF11F5; Tue, 5 May 2015 13:23: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 t45DN43i084102; Tue, 5 May 2015 13:23:04 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45DN487084101; Tue, 5 May 2015 13:23:04 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201505051323.t45DN487084101@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 5 May 2015 13:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282482 - head/bin/cp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 13:23:04 -0000 Author: jilles Date: Tue May 5 13:23:03 2015 New Revision: 282482 URL: https://svnweb.freebsd.org/changeset/base/282482 Log: cp: Remove fts sorting. In an attempt to improve performance, cp reordered directories first (although the comment says directories last). This is not effective with new UFS layout policies. The sorting reorders multiple arguments passed to cp, which may be undesirable. Additionally, the comparison function does not induce a total order. Per POSIX, this causes undefined behaviour in qsort(). NetBSD removed the sorting in 2009. On filesystems that return directory entries in hash/btree order, sorting by d_fileno before statting improves performance on large directories. However, this can only be implemented in fts(3). PR: 53475 Reviewed by: bde (in 2004) MFC after: 1 week Modified: head/bin/cp/cp.c Modified: head/bin/cp/cp.c ============================================================================== --- head/bin/cp/cp.c Tue May 5 11:39:54 2015 (r282481) +++ head/bin/cp/cp.c Tue May 5 13:23:03 2015 (r282482) @@ -90,7 +90,6 @@ volatile sig_atomic_t info; enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int); -static int mastercmp(const FTSENT * const *, const FTSENT * const *); static void siginfo(int __unused); int @@ -274,7 +273,7 @@ copy(char *argv[], enum op type, int fts mask = ~umask(0777); umask(~mask); - if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL) + if ((ftsp = fts_open(argv, fts_options, NULL)) == NULL) err(1, "fts_open"); for (badcp = rval = 0; (curr = fts_read(ftsp)) != NULL; badcp = 0) { switch (curr->fts_info) { @@ -488,32 +487,6 @@ copy(char *argv[], enum op type, int fts return (rval); } -/* - * mastercmp -- - * The comparison function for the copy order. The order is to copy - * non-directory files before directory files. The reason for this - * is because files tend to be in the same cylinder group as their - * parent directory, whereas directories tend not to be. Copying the - * files first reduces seeking. - */ -static int -mastercmp(const FTSENT * const *a, const FTSENT * const *b) -{ - int a_info, b_info; - - a_info = (*a)->fts_info; - if (a_info == FTS_ERR || a_info == FTS_NS || a_info == FTS_DNR) - return (0); - b_info = (*b)->fts_info; - if (b_info == FTS_ERR || b_info == FTS_NS || b_info == FTS_DNR) - return (0); - if (a_info == FTS_D) - return (-1); - if (b_info == FTS_D) - return (1); - return (0); -} - static void siginfo(int sig __unused) { From owner-svn-src-head@FreeBSD.ORG Tue May 5 14:17:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3101093C; Tue, 5 May 2015 14:17: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 1F15C194F; Tue, 5 May 2015 14:17: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 t45EHFLM008870; Tue, 5 May 2015 14:17:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45EHFRe008869; Tue, 5 May 2015 14:17:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051417.t45EHFRe008869@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 14:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282483 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 14:17:16 -0000 Author: andrew Date: Tue May 5 14:17:15 2015 New Revision: 282483 URL: https://svnweb.freebsd.org/changeset/base/282483 Log: Update the comment on what CPUs this driver supports. Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Tue May 5 13:23:03 2015 (r282482) +++ head/sys/arm/arm/generic_timer.c Tue May 5 14:17:15 2015 (r282483) @@ -31,7 +31,7 @@ */ /** - * Cortex-A15 (and probably A7) Generic Timer + * Cortex-A7, Cortex-A15, ARMv8 and later Generic Timer */ #include From owner-svn-src-head@FreeBSD.ORG Tue May 5 14:19:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 699B6AB8; Tue, 5 May 2015 14:19: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 581161969; Tue, 5 May 2015 14:19: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 t45EJNKR009157; Tue, 5 May 2015 14:19:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45EJNJ9009156; Tue, 5 May 2015 14:19:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051419.t45EJNJ9009156@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 14:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282484 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 14:19:23 -0000 Author: andrew Date: Tue May 5 14:19:22 2015 New Revision: 282484 URL: https://svnweb.freebsd.org/changeset/base/282484 Log: Add DEV_ACPI to opt_acpi.h to be used to detect when ACPI is enabled in the kernel. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue May 5 14:17:15 2015 (r282483) +++ head/sys/conf/options Tue May 5 14:19:22 2015 (r282484) @@ -692,6 +692,7 @@ ACPI_DEBUG opt_acpi.h ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h ACPI_DMAR opt_acpi.h +DEV_ACPI opt_acpi.h # ISA support DEV_ISA opt_isa.h From owner-svn-src-head@FreeBSD.ORG Tue May 5 14:34:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9846ADCD; Tue, 5 May 2015 14:34:12 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72FAB1B41; Tue, 5 May 2015 14:34:12 +0000 (UTC) Received: from dhcp-10-2-210-36.hudson-trading.com (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BB3EBB953; Tue, 5 May 2015 10:34:10 -0400 (EDT) Message-ID: <5548D4E4.7070600@FreeBSD.org> Date: Tue, 05 May 2015 10:34:12 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282480 - in head/sys: arm64/arm64 dev/ofw References: <201505051113.t45BDHme019858@svn.freebsd.org> In-Reply-To: <201505051113.t45BDHme019858@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 May 2015 10:34:10 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 14:34:12 -0000 On 5/5/15 7:13 AM, Andrew Turner wrote: > Author: andrew > Date: Tue May 5 11:13:16 2015 > New Revision: 282480 > URL: https://svnweb.freebsd.org/changeset/base/282480 > > Log: > Move the point we attach the ofw driver on arm64 to nexus.c. This will > allow us to have a single place to decide to use ofw or acpi. > > Modified: > head/sys/arm64/arm64/nexus.c > head/sys/dev/ofw/ofwbus.c x86 does this by having an ACPI-specific nexus(4). It checks for ACPI in its nexus_probe() routine and if found returns a higher probe value than the default nexus. The ACPI nexus adds acpi0 whereas the default nexus adds legacy0. For x86 this allowed us to also do other things based on ACPI or not via bus attachments (so pre-ACPI versions of things like PCI interrupt routing, or non-ACPI CPU devices for cpufreq would hang off of legacy0 rather than having to do explicit runtime checks for ACPI). Xen makes use of this to add its own nexus for PVH that overrides the normal ACPI nexus even when ACPI is present, so this approach can work well if you have multiple types of "platforms" you want to support without the various platforms having to be aware of each other (e.g. the PNPBIOS bits don't have to explicitly check for ACPI to disable themselves, instead the PNPBIOS stuff only runs on legacy0). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue May 5 14:52:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63A98330; Tue, 5 May 2015 14:52:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 448B61D8C; Tue, 5 May 2015 14:52:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45EqZDF027619; Tue, 5 May 2015 14:52:35 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45EqXXv027613; Tue, 5 May 2015 14:52:33 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201505051452.t45EqXXv027613@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Tue, 5 May 2015 14:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282485 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 14:52:35 -0000 Author: julian Date: Tue May 5 14:52:33 2015 New Revision: 282485 URL: https://svnweb.freebsd.org/changeset/base/282485 Log: Tweak seekdir, telldir and readdir so that when htere are deletes going on, as seek to teh last location saved will still work. This is needed for Samba to be able to correctly handle delete requests from windows. This does not completely fix seekdir when deletes are present but fixes the worst of the problems. The real solution must involve some changes to the API for eh VFS and getdirentries(2). Obtained from: Panzura inc MFC after: 1 week Modified: head/lib/libc/gen/directory.3 head/lib/libc/gen/readdir.c head/lib/libc/gen/rewinddir.c head/lib/libc/gen/telldir.c head/lib/libc/gen/telldir.h Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Tue May 5 14:19:22 2015 (r282484) +++ head/lib/libc/gen/directory.3 Tue May 5 14:52:33 2015 (r282485) @@ -267,4 +267,27 @@ The invalidation of .Fn telldir tokens when calling .Fn seekdir -is non-standard. +is non-standard. This is a compile time option. +.Pp +The behaviour of +.Fn telldir +and +.Fn seekdir +is likely to be wrong if there are parallel unlinks happening +and the directory is larger than one page. +There is code to ensure that a +.Fn seekdir +to the location given by a +.Fn telldir +immediately before the last +.Fn readdir +will always set the correct location to return the same value as that last +.Fn readdir +performed. +This is enough for some applications which want to "push back the last entry read" E.g. Samba. +Seeks back to any other location, +other than the beginning of the directory, +may result in unexpected behaviour if deletes are present. +It is hoped that this situation will be resolved with changes to +.Fn getdirentries +and the VFS. Modified: head/lib/libc/gen/readdir.c ============================================================================== --- head/lib/libc/gen/readdir.c Tue May 5 14:19:22 2015 (r282484) +++ head/lib/libc/gen/readdir.c Tue May 5 14:52:33 2015 (r282485) @@ -54,19 +54,25 @@ _readdir_unlocked(dirp, skip) int skip; { struct dirent *dp; + long initial_seek; + long initial_loc = 0; for (;;) { if (dirp->dd_loc >= dirp->dd_size) { if (dirp->dd_flags & __DTF_READALL) return (NULL); + initial_loc = dirp->dd_loc; + dirp->dd_flags &= ~__DTF_SKIPREAD; dirp->dd_loc = 0; } if (dirp->dd_loc == 0 && !(dirp->dd_flags & (__DTF_READALL | __DTF_SKIPREAD))) { + initial_seek = dirp->dd_seek; dirp->dd_size = _getdirentries(dirp->dd_fd, dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); if (dirp->dd_size <= 0) return (NULL); + _fixtelldir(dirp, initial_seek, initial_loc); } dirp->dd_flags &= ~__DTF_SKIPREAD; dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); Modified: head/lib/libc/gen/rewinddir.c ============================================================================== --- head/lib/libc/gen/rewinddir.c Tue May 5 14:19:22 2015 (r282484) +++ head/lib/libc/gen/rewinddir.c Tue May 5 14:52:33 2015 (r282485) @@ -51,6 +51,7 @@ rewinddir(dirp) if (__isthreaded) _pthread_mutex_lock(&dirp->dd_lock); + dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */ if (dirp->dd_flags & __DTF_READALL) _filldir(dirp, false); else { Modified: head/lib/libc/gen/telldir.c ============================================================================== --- head/lib/libc/gen/telldir.c Tue May 5 14:19:22 2015 (r282484) +++ head/lib/libc/gen/telldir.c Tue May 5 14:52:33 2015 (r282485) @@ -101,9 +101,21 @@ _seekdir(dirp, loc) return; if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) return; + /* If it's within the same chunk of data, don't bother reloading */ + if (lp->loc_seek == dirp->dd_seek) { + /* + * If we go back to 0 don't make the next readdir + * trigger a call to getdirentries() + */ + if (lp->loc_loc == 0) + dirp->dd_flags |= __DTF_SKIPREAD; + dirp->dd_loc = lp->loc_loc; + return; + } (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); dirp->dd_seek = lp->loc_seek; dirp->dd_loc = 0; + dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */ while (dirp->dd_loc < lp->loc_loc) { dp = _readdir_unlocked(dirp, 0); if (dp == NULL) @@ -112,6 +124,27 @@ _seekdir(dirp, loc) } /* + * when we do a read and cross a boundary, any telldir we + * just did will have wrong information in it. + * We need to move it from "beyond the end of the previous chunk" + * to "the beginning of the new chunk" + */ +void +_fixtelldir(DIR *dirp, long oldseek, long oldloc) +{ + struct ddloc *lp; + + lp = LIST_FIRST(&dirp->dd_td->td_locq); + if (lp != NULL) { + if (lp->loc_loc == oldloc && + lp->loc_seek == oldseek) { + lp->loc_seek = dirp->dd_seek; + lp->loc_loc = dirp->dd_loc; + } + } +} + +/* * Reclaim memory for telldir cookies which weren't used. */ void Modified: head/lib/libc/gen/telldir.h ============================================================================== --- head/lib/libc/gen/telldir.h Tue May 5 14:19:22 2015 (r282484) +++ head/lib/libc/gen/telldir.h Tue May 5 14:52:33 2015 (r282485) @@ -64,5 +64,6 @@ bool _filldir(DIR *, bool); struct dirent *_readdir_unlocked(DIR *, int); void _reclaim_telldir(DIR *); void _seekdir(DIR *, long); +void _fixtelldir(DIR *dirp, long oldseek, long oldloc); #endif From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:16:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CF0B842; Tue, 5 May 2015 15:16: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 3B3DF1FD1; Tue, 5 May 2015 15:16: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 t45FG1ZS037882; Tue, 5 May 2015 15:16:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FG1FF037881; Tue, 5 May 2015 15:16:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FG1FF037881@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282487 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:16:01 -0000 Author: gjb Date: Tue May 5 15:16:00 2015 New Revision: 282487 URL: https://svnweb.freebsd.org/changeset/base/282487 Log: Fix a typo. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:13:59 2015 (r282486) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:00 2015 (r282487) @@ -423,7 +423,7 @@ updated to version 20150410. The &man.wpa.supplicant.8; and - &man.hostapd.8; utilties have been updated to version + &man.hostapd.8; utilities have been updated to version 2.4. bmake has From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:16:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09EAC91F; Tue, 5 May 2015 15:16: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 EC6971FD2; Tue, 5 May 2015 15:16: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 t45FG3j1037938; Tue, 5 May 2015 15:16:03 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FG3eB037935; Tue, 5 May 2015 15:16:03 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FG3eB037935@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282488 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:16:04 -0000 Author: gjb Date: Tue May 5 15:16:02 2015 New Revision: 282488 URL: https://svnweb.freebsd.org/changeset/base/282488 Log: Document r282208, chmod(1), chflags(1), chgrp(1), and chown(8) now affect symbolic links when '-R' is used. Add Multiplay to sponsors.ent. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml head/release/doc/share/xml/sponsor.ent Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:00 2015 (r282487) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:02 2015 (r282488) @@ -334,6 +334,12 @@ ARCHIVE_EXTRACT_SECURE_NODOTDOT to disallow directory traversal when extracting an archive, similar to &man.tar.1;. + + The &man.chflags.1;, &man.chgrp.1;, + &man.chmod.1;, and &man.chown.8; utilities now affect symbolic + links when the -R flag is specified, as + documented in &man.symlink.7;. Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Tue May 5 15:16:00 2015 (r282487) +++ head/release/doc/share/xml/sponsor.ent Tue May 5 15:16:02 2015 (r282488) @@ -31,6 +31,7 @@ + From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:16:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AB0CD78; Tue, 5 May 2015 15:16: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 D89EC1FDF; Tue, 5 May 2015 15:16: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 t45FGFVu038207; Tue, 5 May 2015 15:16:15 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGFbR038206; Tue, 5 May 2015 15:16:15 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGFbR038206@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282493 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:16:16 -0000 Author: gjb Date: Tue May 5 15:16:15 2015 New Revision: 282493 URL: https://svnweb.freebsd.org/changeset/base/282493 Log: Update the svn revision marker. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:12 2015 (r282492) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:15 2015 (r282493) @@ -22,7 +22,7 @@ $FreeBSD$ - + 2015 From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:16:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 009F9A5A; Tue, 5 May 2015 15:16: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 CAB941FD3; Tue, 5 May 2015 15:16:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45FG6mw037990; Tue, 5 May 2015 15:16:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FG6fP037988; Tue, 5 May 2015 15:16:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FG6fP037988@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282489 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:16:07 -0000 Author: gjb Date: Tue May 5 15:16:05 2015 New Revision: 282489 URL: https://svnweb.freebsd.org/changeset/base/282489 Log: Document r282212, several improvements/updates to the HyperV drivers. Add Microsoft OSTC to sponsors.ent. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml head/release/doc/share/xml/sponsor.ent Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:02 2015 (r282488) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:05 2015 (r282489) @@ -920,6 +920,27 @@ Support for the QEMU virt system has been added. + + The + HyperV™ drivers have been updated with several + enhancements: + + + + The &man.hv.vmbus.4; driver now has multi-channel + support. + + + + The &man.hv.storvsc.4; driver now has scatter/gather + support, in addition to performance improvements. + + + + The &man.hv.kvp.4; driver has received several bug + fixes. + + Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Tue May 5 15:16:02 2015 (r282488) +++ head/release/doc/share/xml/sponsor.ent Tue May 5 15:16:05 2015 (r282489) @@ -30,6 +30,7 @@ + From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:16:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9610CD4; Tue, 5 May 2015 15:16: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 98BCC1FDD; Tue, 5 May 2015 15:16: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 t45FGDQH038148; Tue, 5 May 2015 15:16:13 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGDmq038147; Tue, 5 May 2015 15:16:13 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGDmq038147@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282492 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:16:13 -0000 Author: gjb Date: Tue May 5 15:16:12 2015 New Revision: 282492 URL: https://svnweb.freebsd.org/changeset/base/282492 Log: Document r282434, openresolv updated to version 3.7.0. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:10 2015 (r282491) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:12 2015 (r282492) @@ -437,6 +437,10 @@ The &man.unbound.8; utility has been updated to version 1.5.3. + + The + &man.resolvconf.8; utility has been updated to version + 3.7.0. From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:16:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FF9EB38; Tue, 5 May 2015 15:16: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 0ECB61FD9; Tue, 5 May 2015 15:16: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 t45FG8LG038034; Tue, 5 May 2015 15:16:08 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FG8ZU038033; Tue, 5 May 2015 15:16:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FG8ZU038033@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282490 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:16:09 -0000 Author: gjb Date: Tue May 5 15:16:08 2015 New Revision: 282490 URL: https://svnweb.freebsd.org/changeset/base/282490 Log: Document r282213, kern.racct.enable tunable and RACCT_DISABLED kernel configuration option. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:05 2015 (r282489) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:08 2015 (r282490) @@ -687,6 +687,13 @@ vfs.devfs.dotimes has been added, which when set to a non-zero value, enables default precision timestamps for these operations. + + A new + &man.sysctl.8;, kern.racct.enable, has been + added, which when set to a non-zero value allows using + &man.rctl.8; with the GENERIC kernel. A new + kernel configuration option, RACCT_DISABLED + has also been added. From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:16:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64CDDC44; Tue, 5 May 2015 15:16: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 5325E1FDB; Tue, 5 May 2015 15:16: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 t45FGBnn038085; Tue, 5 May 2015 15:16:11 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGBco038084; Tue, 5 May 2015 15:16:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGBco038084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282491 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:16:11 -0000 Author: gjb Date: Tue May 5 15:16:10 2015 New Revision: 282491 URL: https://svnweb.freebsd.org/changeset/base/282491 Log: Document r282274, xen(4) PV domU kernel support removed. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:08 2015 (r282490) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:10 2015 (r282491) @@ -948,6 +948,9 @@ fixes. + + Support for &man.xen.4; para-virtualized + domU kernels has been removed. From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:16:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4900F97; Tue, 5 May 2015 15:16: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 847D11FE5; Tue, 5 May 2015 15:16: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 t45FGM4u038346; Tue, 5 May 2015 15:16:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGMoY038344; Tue, 5 May 2015 15:16:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGMoY038344@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282496 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:16:22 -0000 Author: gjb Date: Tue May 5 15:16:21 2015 New Revision: 282496 URL: https://svnweb.freebsd.org/changeset/base/282496 Log: Document r281617, wc(1) race when receiving SIGINFO fixed. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:19 2015 (r282495) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:21 2015 (r282496) @@ -340,6 +340,11 @@ &man.chmod.1;, and &man.chown.8; utilities now affect symbolic links when the -R flag is specified, as documented in &man.symlink.7;. + + A race condition in &man.wc.1; that + would cause final results to be sent to &man.stderr.4; when + receiving the SIGINFO signal has been + fixed. From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:16:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54760F0C; Tue, 5 May 2015 15:16:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4337F1FE3; Tue, 5 May 2015 15:16:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45FGKA5038294; Tue, 5 May 2015 15:16:20 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGK1G038293; Tue, 5 May 2015 15:16:20 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGK1G038293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282495 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:16:20 -0000 Author: gjb Date: Tue May 5 15:16:19 2015 New Revision: 282495 URL: https://svnweb.freebsd.org/changeset/base/282495 Log: Fix a FDP style nit. Wrap the lines as a result. Found with: textproc/igor Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:17 2015 (r282494) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:19 2015 (r282495) @@ -695,9 +695,9 @@ A new &man.sysctl.8;, kern.racct.enable, has been added, which when set to a non-zero value allows using - &man.rctl.8; with the GENERIC kernel. A new - kernel configuration option, RACCT_DISABLED - has also been added. + &man.rctl.8; with the GENERIC kernel. + A new kernel configuration option, + RACCT_DISABLED has also been added. From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:16:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FBB7E94; Tue, 5 May 2015 15:16: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 F2A341FE0; Tue, 5 May 2015 15:16: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 t45FGHKe038253; Tue, 5 May 2015 15:16:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGH4u038252; Tue, 5 May 2015 15:16:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGH4u038252@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282494 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:16:18 -0000 Author: gjb Date: Tue May 5 15:16:17 2015 New Revision: 282494 URL: https://svnweb.freebsd.org/changeset/base/282494 Log: Document r281802, support added for building FreeBSD/aarch64 virtual machine and memory stick images. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:15 2015 (r282493) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:17 2015 (r282494) @@ -1216,6 +1216,11 @@ been updated to use multi-threaded &man.xz.1;. By default, the number of &man.xz.1; threads is set to the number of cores available. + + The + Release Engineering build tools have been updated to include + support for building &os;/&arch.arm64; virtual machine and + memory stick installation images. From owner-svn-src-head@FreeBSD.ORG Tue May 5 15:43:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B9FEA2B; Tue, 5 May 2015 15:43:59 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C51A3131D; Tue, 5 May 2015 15:43:58 +0000 (UTC) Received: by widdi4 with SMTP id di4so151905632wid.0; Tue, 05 May 2015 08:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=q9Cjm4G+e5LEweQ9mC0A9dJamU7dszszRt8lxonJ2Yw=; b=W5nbHhLa+JoUGOBbRkSOWgXItQ6KZhhLi9ztl9IphUhocMlOaOqT9IG0UJOE2l0YRK F880uDul/kpDzcVwKLxJeNs44EzSTYYDApIg93zJzyUWPXKaOA8ieJtHlJC1Ro24rpfT WRQf1B7f4aaDXoo3FfRQvg6ppH4TFYYNCQfYemex3J84py/JoHU2qoN8GmcJUANxj/bJ apEPwGepqPn8lcQ+KktQ6TIcebnZDDtxpkgKxbuDVLL5wWSMj2nabB9K6Go5Vp7VmD2i tVTZFWzR5HTeXlyzT5q+dCA+XAN5XIyy/LZJbjCbNuGVXAD7MZ/wNEHPx5H3tnNP5HEG 2KtA== MIME-Version: 1.0 X-Received: by 10.180.231.4 with SMTP id tc4mr5299971wic.27.1430840637188; Tue, 05 May 2015 08:43:57 -0700 (PDT) Received: by 10.27.77.201 with HTTP; Tue, 5 May 2015 08:43:56 -0700 (PDT) In-Reply-To: <201505051452.t45EqXXv027613@svn.freebsd.org> References: <201505051452.t45EqXXv027613@svn.freebsd.org> Date: Tue, 5 May 2015 11:43:56 -0400 Message-ID: Subject: Re: svn commit: r282485 - head/lib/libc/gen From: Benjamin Kaduk To: Julian Elischer Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:43:59 -0000 On Tue, May 5, 2015 at 10:52 AM, Julian Elischer wrote: > Author: julian > Date: Tue May 5 14:52:33 2015 > New Revision: 282485 > URL: https://svnweb.freebsd.org/changeset/base/282485 > > Log: > Tweak seekdir, telldir and readdir so that when htere are deletes going > on, > as seek to teh last location saved will still work. This is needed for > Samba > to be able to correctly handle delete requests from windows. This does > not > completely fix seekdir when deletes are present but fixes the worst of > the > problems. The real solution must involve some changes to the API for eh > VFS > and getdirentries(2). > > Would it be so hard to run a spell-checker over commit messages? "teh" is not a word, nor is "htere", and "eh" only is if you're in Canada or Minnesota (not that it's the right word there anyway). > Obtained from: Panzura inc > MFC after: 1 week > > Modified: > head/lib/libc/gen/directory.3 > head/lib/libc/gen/readdir.c > head/lib/libc/gen/rewinddir.c > head/lib/libc/gen/telldir.c > head/lib/libc/gen/telldir.h > > Modified: head/lib/libc/gen/directory.3 > > ============================================================================== > --- head/lib/libc/gen/directory.3 Tue May 5 14:19:22 2015 > (r282484) > +++ head/lib/libc/gen/directory.3 Tue May 5 14:52:33 2015 > (r282485) > @@ -267,4 +267,27 @@ The invalidation of > .Fn telldir > tokens when calling > .Fn seekdir > -is non-standard. > +is non-standard. This is a compile time option. > Man page style puts the start of new sentences on a new line. > +.Pp > +The behaviour of > +.Fn telldir > +and > +.Fn seekdir > +is likely to be wrong if there are parallel unlinks happening > +and the directory is larger than one page. > +There is code to ensure that a > +.Fn seekdir > +to the location given by a > +.Fn telldir > +immediately before the last > +.Fn readdir > +will always set the correct location to return the same value as that last > +.Fn readdir > +performed. > +This is enough for some applications which want to "push back the last > entry read" E.g. Samba. > "e.g." should be offset by commas on both sides, and the capital 'E' is only appropriate at the start of a sentence. > +Seeks back to any other location, > +other than the beginning of the directory, > +may result in unexpected behaviour if deletes are present. > "behaviour" is the British English; we use American unless an entire file is already in British. > +It is hoped that this situation will be resolved with changes to > +.Fn getdirentries > +and the VFS. > > This sort of thing is more appropriate for BUGS or CAVEATS, in my opinion. > Modified: head/lib/libc/gen/readdir.c > > ============================================================================== > --- head/lib/libc/gen/readdir.c Tue May 5 14:19:22 2015 (r282484) > +++ head/lib/libc/gen/readdir.c Tue May 5 14:52:33 2015 (r282485) > @@ -54,19 +54,25 @@ _readdir_unlocked(dirp, skip) > int skip; > { > struct dirent *dp; > + long initial_seek; > + long initial_loc = 0; > > for (;;) { > if (dirp->dd_loc >= dirp->dd_size) { > if (dirp->dd_flags & __DTF_READALL) > return (NULL); > + initial_loc = dirp->dd_loc; > + dirp->dd_flags &= ~__DTF_SKIPREAD; > dirp->dd_loc = 0; > } > if (dirp->dd_loc == 0 && > !(dirp->dd_flags & (__DTF_READALL | __DTF_SKIPREAD))) { > + initial_seek = dirp->dd_seek; > dirp->dd_size = _getdirentries(dirp->dd_fd, > dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); > if (dirp->dd_size <= 0) > return (NULL); > + _fixtelldir(dirp, initial_seek, initial_loc); > } > dirp->dd_flags &= ~__DTF_SKIPREAD; > dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); > > Modified: head/lib/libc/gen/rewinddir.c > > ============================================================================== > --- head/lib/libc/gen/rewinddir.c Tue May 5 14:19:22 2015 > (r282484) > +++ head/lib/libc/gen/rewinddir.c Tue May 5 14:52:33 2015 > (r282485) > @@ -51,6 +51,7 @@ rewinddir(dirp) > > if (__isthreaded) > _pthread_mutex_lock(&dirp->dd_lock); > + dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid > */ > if (dirp->dd_flags & __DTF_READALL) > _filldir(dirp, false); > else { > > Modified: head/lib/libc/gen/telldir.c > > ============================================================================== > --- head/lib/libc/gen/telldir.c Tue May 5 14:19:22 2015 (r282484) > +++ head/lib/libc/gen/telldir.c Tue May 5 14:52:33 2015 (r282485) > @@ -101,9 +101,21 @@ _seekdir(dirp, loc) > return; > if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) > return; > + /* If it's within the same chunk of data, don't bother reloading */ > No stop at the end of the sentence in the comment? > + if (lp->loc_seek == dirp->dd_seek) { > + /* > + * If we go back to 0 don't make the next readdir > + * trigger a call to getdirentries() > nor here > + */ > + if (lp->loc_loc == 0) > + dirp->dd_flags |= __DTF_SKIPREAD; > + dirp->dd_loc = lp->loc_loc; > + return; > + } > (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); > dirp->dd_seek = lp->loc_seek; > dirp->dd_loc = 0; > + dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid > */ > while (dirp->dd_loc < lp->loc_loc) { > dp = _readdir_unlocked(dirp, 0); > if (dp == NULL) > @@ -112,6 +124,27 @@ _seekdir(dirp, loc) > } > > /* > + * when we do a read and cross a boundary, any telldir we > + * just did will have wrong information in it. > No capital letter at start of sentence. Strange line wrapping (in lieu of proper paragraph break with empty line?). -Ben > + * We need to move it from "beyond the end of the previous chunk" > + * to "the beginning of the new chunk" > + */ > +void > +_fixtelldir(DIR *dirp, long oldseek, long oldloc) > +{ > + struct ddloc *lp; > + > + lp = LIST_FIRST(&dirp->dd_td->td_locq); > + if (lp != NULL) { > + if (lp->loc_loc == oldloc && > + lp->loc_seek == oldseek) { > + lp->loc_seek = dirp->dd_seek; > + lp->loc_loc = dirp->dd_loc; > + } > + } > +} > + > +/* > * Reclaim memory for telldir cookies which weren't used. > */ > void > > Modified: head/lib/libc/gen/telldir.h > > ============================================================================== > --- head/lib/libc/gen/telldir.h Tue May 5 14:19:22 2015 (r282484) > +++ head/lib/libc/gen/telldir.h Tue May 5 14:52:33 2015 (r282485) > @@ -64,5 +64,6 @@ bool _filldir(DIR *, bool); > struct dirent *_readdir_unlocked(DIR *, int); > void _reclaim_telldir(DIR *); > void _seekdir(DIR *, long); > +void _fixtelldir(DIR *dirp, long oldseek, long oldloc); > > #endif > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > From owner-svn-src-head@FreeBSD.ORG Tue May 5 16:09:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 447B5115; Tue, 5 May 2015 16:09:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3288C161C; Tue, 5 May 2015 16:09:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45G9eOX063050; Tue, 5 May 2015 16:09:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45G9QVa062972; Tue, 5 May 2015 16:09:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505051609.t45G9QVa062972@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 5 May 2015 16:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282499 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 16:09:40 -0000 Author: ian Date: Tue May 5 16:09:25 2015 New Revision: 282499 URL: https://svnweb.freebsd.org/changeset/base/282499 Log: Create std.arm and std.armv6 config files and include the right one from each of the existing kernel configs. This gives a place to put config that applies to the entire arch. Add the ARM_NEW_PMAP option to std.armv6. This is working well in early testing and it's time for wide exposure, but it's still nice to be able to fall back to the old implementation for testing when a problem comes along. Eventually the option and the old implementation will go away. The opportunity now exists to move a whole lot of boilerplate from all the arm kernel config files into std.arm*, but that's a commit for another day. Added: head/sys/arm/conf/std.arm (contents, props changed) head/sys/arm/conf/std.armv6 (contents, props changed) Modified: head/sys/arm/conf/AML8726 head/sys/arm/conf/ARMADAXP head/sys/arm/conf/ATMEL head/sys/arm/conf/AVILA head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EA3250 head/sys/arm/conf/EB9200 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/EP80219 head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/EXYNOS5.common head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX6 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NSLU head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/RK3188 head/sys/arm/conf/RPI-B head/sys/arm/conf/RPI2 head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/SOCKIT.common head/sys/arm/conf/TS7800 head/sys/arm/conf/VERSATILEPB head/sys/arm/conf/VIRT head/sys/arm/conf/VYBRID head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/AML8726 ============================================================================== --- head/sys/arm/conf/AML8726 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/AML8726 Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,8 @@ # $FreeBSD$ ident AML8726 + +include "std.armv6" include "../amlogic/aml8726/std.aml8726" options HZ=100 Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/ARMADAXP Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,8 @@ # $FreeBSD$ ident MV-88F78XX0 + +include "std.armv6" include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/ATMEL Tue May 5 16:09:25 2015 (r282499) @@ -6,6 +6,7 @@ ident ATMEL +include "std.arm" include "../at91/std.atmel" # Typical values for most SoCs and board configurations. Will not work for Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/AVILA Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident AVILA +include "std.arm" include "../xscale/ixp425/std.ixp425" # NB: memory mapping is defined in std.avila include "../xscale/ixp425/std.avila" Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/BEAGLEBONE Tue May 5 16:09:25 2015 (r282499) @@ -23,6 +23,7 @@ ident BEAGLEBONE +include "std.armv6" include "../ti/am335x/std.am335x" makeoptions MODULES_EXTRA="dtb/am335x" @@ -67,7 +68,6 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/BWCT Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident BWCT +include "std.arm" options VERBOSE_INIT_ARM include "../at91/std.bwct" Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/CAMBRIA Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident CAMBRIA +include "std.arm" include "../xscale/ixp425/std.ixp435" # NB: memory mapping is defined in std.avila include "../xscale/ixp425/std.avila" Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/CNS11XXNAS Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident CNS11XXNAS +include "std.arm" #options PHYSADDR=0x10000000 #options KERNPHYSADDR=0x10200000 #options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/CRB Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ ident CRB +include "std.arm" options PHYSADDR=0x00000000 options KERNPHYSADDR=0x00200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/CUBIEBOARD Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident CUBIEBOARD +include "std.armv6" include "../allwinner/std.a10" options HZ=100 Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/CUBIEBOARD2 Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident CUBIEBOARD2 +include "std.armv6" include "../allwinner/a20/std.a20" options HZ=100 Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/DB-78XXX Tue May 5 16:09:25 2015 (r282499) @@ -5,6 +5,7 @@ # ident DB-88F78XX +include "std.arm" include "../mv/discovery/std.db78xxx" options SOC_MV_DISCOVERY Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/DB-88F5XXX Tue May 5 16:09:25 2015 (r282499) @@ -5,6 +5,7 @@ # ident DB-88F5XXX +include "std.arm" include "../mv/orion/std.db88f5xxx" options SOC_MV_ORION Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/DB-88F6XXX Tue May 5 16:09:25 2015 (r282499) @@ -5,6 +5,7 @@ # ident DB-88F6XXX +include "std.arm" include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/DOCKSTAR Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident DOCKSTAR +include "std.arm" include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dockstar.dts Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/DREAMPLUG-1001 Tue May 5 16:09:25 2015 (r282499) @@ -24,6 +24,7 @@ ident DREAMPLUG-1001 +include "std.arm" include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dreamplug-1001.dts Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/EA3250 Tue May 5 16:09:25 2015 (r282499) @@ -5,6 +5,7 @@ # ident EA3250 +include "std.arm" include "../lpc/std.lpc" hints "EA3250.hints" Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/EB9200 Tue May 5 16:09:25 2015 (r282499) @@ -16,6 +16,7 @@ ident EB9200 +include "std.arm" include "../at91/std.eb9200" # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/EFIKA_MX Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident EFIKA_MX +include "std.armv6" include "../freescale/imx/std.imx51" makeoptions WITHOUT_MODULES="ahc" Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/EP80219 Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ ident EP80219 +include "std.arm" options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/ETHERNUT5 Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident ETHERNUT5 +include "std.arm" include "../at91/std.ethernut5" # To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/EXYNOS5.common Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ makeoptions WERROR="-Werror" +include "std.armv6" options HZ=100 options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/GUMSTIX Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ # $FreeBSD$ ident GUMSTIX +include "std.arm" cpu CPU_XSCALE_PXA2X0 # This probably wants to move somewhere else. Maybe we can create a basic Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/HL200 Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident HL200 +include "std.arm" include "../at91/std.hl200" #To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/HL201 Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident HL201 +include "std.arm" include "../at91/std.hl201" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/IMX53 Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident IMX53 +include "std.armv6" include "../freescale/imx/std.imx53" options SOC_IMX53 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/IMX6 Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ # $FreeBSD$ ident IMX6 +include "std.armv6" include "../freescale/imx/std.imx6" options SOC_IMX6 Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/IQ31244 Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ ident IQ31244 +include "std.arm" options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/KB920X Tue May 5 16:09:25 2015 (r282499) @@ -22,6 +22,7 @@ ident KB920X +include "std.arm" include "../at91/std.kb920x" # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/LN2410SBC Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ ident LN2410SBC +include "std.arm" include "../samsung/s3c2xx0/std.ln2410sbc" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/NSLU Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident NSLU +include "std.arm" # XXX What is defined in std.avila does not exactly match the following: #options PHYSADDR=0x10000000 #options KERNPHYSADDR=0x10200000 Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/PANDABOARD Tue May 5 16:09:25 2015 (r282499) @@ -27,6 +27,7 @@ ident PANDABOARD hints "PANDABOARD.hints" +include "std.armv6" include "../ti/omap4/pandaboard/std.pandaboard" options HZ=100 @@ -64,7 +65,6 @@ options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options SMP # Enable multiple cores -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/QILA9G20 Tue May 5 16:09:25 2015 (r282499) @@ -22,6 +22,7 @@ ident QILA9G20 +include "std.arm" include "../at91/std.qila9g20" #To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/RK3188 Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident RK3188 +include "std.armv6" include "../rockchip/std.rk30xx" options HZ=100 Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/RPI-B Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident RPI-B +include "std.armv6" include "../broadcom/bcm2835/std.rpi" include "../broadcom/bcm2835/std.bcm2835" @@ -57,7 +58,6 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/RPI2 Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident RPI2 +include "std.armv6" include "../broadcom/bcm2835/std.rpi" include "../broadcom/bcm2835/std.bcm2836" @@ -57,7 +58,6 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SAM9260EK Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident SAM9260EK +include "std.arm" include "../at91/std.sam9260ek" # To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SAM9G20EK Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ ident SAM9G20EK +include "std.arm" include "../at91/std.sam9g20ek" #To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SAM9X25EK Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident SAM9X25EK +include "std.arm" include "../at91/std.sam9x25ek" #To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SHEEVAPLUG Tue May 5 16:09:25 2015 (r282499) @@ -6,6 +6,7 @@ #NO_UNIVERSE ident SHEEVAPLUG +include "std.arm" include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SN9G45 Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident SN9G45 +include "std.arm" include "../at91/std.sn9g45" #To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/SOCKIT.common ============================================================================== --- head/sys/arm/conf/SOCKIT.common Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SOCKIT.common Tue May 5 16:09:25 2015 (r282499) @@ -18,6 +18,7 @@ # # $FreeBSD$ +include "std.armv6" include "../altera/socfpga/std.socfpga" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/TS7800 Tue May 5 16:09:25 2015 (r282499) @@ -5,6 +5,7 @@ # ident TS7800 +include "std.arm" include "../mv/orion/std.ts7800" options SOC_MV_ORION Modified: head/sys/arm/conf/VERSATILEPB ============================================================================== --- head/sys/arm/conf/VERSATILEPB Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/VERSATILEPB Tue May 5 16:09:25 2015 (r282499) @@ -22,6 +22,7 @@ ident VERSATILEPB machine arm armv6 cpu CPU_ARM1176 +include "std.armv6" files "../versatile/files.versatile" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/VIRT ============================================================================== --- head/sys/arm/conf/VIRT Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/VIRT Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident VIRT +include "std.arm" include "../qemu/std.virt" options HZ=100 @@ -57,7 +58,6 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/VYBRID Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ # $FreeBSD$ ident VYBRID +include "std.armv6" include "../freescale/vybrid/std.vybrid" makeoptions WERROR="-Werror" Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/ZEDBOARD Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident ZEDBOARD +include "std.armv6" include "../xilinx/zedboard/std.zedboard" options SCHED_ULE # ULE scheduler @@ -56,7 +57,6 @@ options KBD_INSTALL_CDEV # install a CD options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options SMP # Enable multiple cores -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Added: head/sys/arm/conf/std.arm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/std.arm Tue May 5 16:09:25 2015 (r282499) @@ -0,0 +1,5 @@ +# Standard kernel config items for all ARMv4/v5 systems. +# +# $FreeBSD$ + + Added: head/sys/arm/conf/std.armv6 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/std.armv6 Tue May 5 16:09:25 2015 (r282499) @@ -0,0 +1,6 @@ +# Standard kernel config items for all ARMv6/v7 systems. +# +# $FreeBSD$ + +options ARM_NEW_PMAP # Use new pmap code. + From owner-svn-src-head@FreeBSD.ORG Tue May 5 16:28:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D657ABF; Tue, 5 May 2015 16:28: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 1C7041901; Tue, 5 May 2015 16:28:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45GS5j4073054; Tue, 5 May 2015 16:28:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45GS5h9073051; Tue, 5 May 2015 16:28:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051628.t45GS5h9073051@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 16:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282500 - in head/release: . arm tools/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 16:28:06 -0000 Author: gjb Date: Tue May 5 16:28:04 2015 New Revision: 282500 URL: https://svnweb.freebsd.org/changeset/base/282500 Log: Add initial support for building RPI2 images. In release.sh, allow overriding buildenv_setup() before the handoff to arm/release.sh. Copy arm/RPI-B.conf -> arm/RPI2.conf, set UBOOT_PORT and the correct KERNEL, and add the buildenv_setup() override to install the sysutils/u-boot-rpi2 port/package. Copy tools/arm/crochet-RPI-B.conf -> tools/arm/crochet-RPI2.conf, and set the correct entries for the RaspberryPi2 board. Thanks to: loos@ Sponsored by: The FreeBSD Foundation Added: head/release/arm/RPI2.conf - copied, changed from r282497, head/release/arm/RPI-B.conf head/release/tools/arm/crochet-RPI2.conf - copied, changed from r282497, head/release/tools/arm/crochet-RPI-B.conf Modified: head/release/release.sh Copied and modified: head/release/arm/RPI2.conf (from r282497, head/release/arm/RPI-B.conf) ============================================================================== --- head/release/arm/RPI-B.conf Tue May 5 15:16:38 2015 (r282497, copy source) +++ head/release/arm/RPI2.conf Tue May 5 16:28:04 2015 (r282500) @@ -13,7 +13,7 @@ export WORLD_FLAGS="-j $(sysctl -n hw.nc export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" export CHROOTDIR="/scratch" export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="lang/python textproc/gsed" +export UBOOT_PORT="sysutils/u-boot-rpi2" # Build chroot configuration load_chroot_env() { @@ -31,10 +31,23 @@ load_target_env() { export XDEV_ARCH="armv6" export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="RPI-B" + export KERNEL="RPI2" export CROCHETSRC="https://github.com/freebsd/crochet" export CROCHETBRANCH="trunk@rHEAD" - export UBOOTSRC="https://github.com/gonzoua/u-boot-pi" - export UBOOTBRANCH="trunk" - export UBOOTDIR="/tmp/crochet/u-boot-rpi" } + +# Build environment setup +buildenv_setup() { + if [ ! -d ${CHROOTDIR}/usr/ports/${UBOOT_PORT} ]; then + chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg bootstrap -y + chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg install -y ${UBOOT_PORT} + else + chroot ${CHROOTDIR} env BATCH=1 \ + make -C /usr/ports/${UBOOT_PORT} \ + all install clean + fi + return 0 +} + Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Tue May 5 16:09:25 2015 (r282499) +++ head/release/release.sh Tue May 5 16:28:04 2015 (r282500) @@ -238,6 +238,7 @@ fi # Embedded builds do not use the 'make release' target. if [ -n "${EMBEDDEDBUILD}" ]; then + buildenv_setup # If a crochet configuration file exists in *this* checkout of # release/, copy it to the /tmp/external directory within the chroot. # This allows building embedded releases without relying on updated Copied and modified: head/release/tools/arm/crochet-RPI2.conf (from r282497, head/release/tools/arm/crochet-RPI-B.conf) ============================================================================== --- head/release/tools/arm/crochet-RPI-B.conf Tue May 5 15:16:38 2015 (r282497, copy source) +++ head/release/tools/arm/crochet-RPI2.conf Tue May 5 16:28:04 2015 (r282500) @@ -3,9 +3,9 @@ # # This is the configuration file for use with crochet to produce -# FreeBSD Raspberry Pi images. +# FreeBSD Raspberry Pi 2 images. -board_setup RaspberryPi +board_setup RaspberryPi2 option ImageSize 1gb option Growfs @@ -16,7 +16,7 @@ SRCCONF=/dev/null WORKDIR=/usr/obj _BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) _REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) -KERNCONF=RPI-B +KERNCONF=RPI2 TARGET=arm TARGET_ARCH=armv6 FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" From owner-svn-src-head@FreeBSD.ORG Tue May 5 16:38:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C23C8E16; Tue, 5 May 2015 16:38: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 B15E51A79; Tue, 5 May 2015 16:38: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 t45Gc00Z077948; Tue, 5 May 2015 16:38:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45Gc0da077947; Tue, 5 May 2015 16:38:00 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051638.t45Gc0da077947@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 16:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282501 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 16:38:00 -0000 Author: gjb Date: Tue May 5 16:37:59 2015 New Revision: 282501 URL: https://svnweb.freebsd.org/changeset/base/282501 Log: Remove buildenv_setup(), and set EMBEDDEDPORTS to the sysutils/u-boot-rpi2 port, since these cases are already handled by arm/release.sh. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/RPI2.conf Modified: head/release/arm/RPI2.conf ============================================================================== --- head/release/arm/RPI2.conf Tue May 5 16:28:04 2015 (r282500) +++ head/release/arm/RPI2.conf Tue May 5 16:37:59 2015 (r282501) @@ -13,7 +13,7 @@ export WORLD_FLAGS="-j $(sysctl -n hw.nc export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" export CHROOTDIR="/scratch" export EMBEDDEDBUILD=1 -export UBOOT_PORT="sysutils/u-boot-rpi2" +export EMBEDDEDPORTS="sysutils/u-boot-rpi2" # Build chroot configuration load_chroot_env() { @@ -36,18 +36,3 @@ load_target_env() { export CROCHETBRANCH="trunk@rHEAD" } -# Build environment setup -buildenv_setup() { - if [ ! -d ${CHROOTDIR}/usr/ports/${UBOOT_PORT} ]; then - chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ - /usr/sbin/pkg bootstrap -y - chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ - /usr/sbin/pkg install -y ${UBOOT_PORT} - else - chroot ${CHROOTDIR} env BATCH=1 \ - make -C /usr/ports/${UBOOT_PORT} \ - all install clean - fi - return 0 -} - From owner-svn-src-head@FreeBSD.ORG Tue May 5 17:59:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C2EF1F8; Tue, 5 May 2015 17:59: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 39BDB1576; Tue, 5 May 2015 17:59: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 t45Hx8Jv017186; Tue, 5 May 2015 17:59:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45Hx3pp017160; Tue, 5 May 2015 17:59:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051759.t45Hx3pp017160@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 17:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282502 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 17:59:08 -0000 Author: andrew Date: Tue May 5 17:59:02 2015 New Revision: 282502 URL: https://svnweb.freebsd.org/changeset/base/282502 Log: Move the first batch of common armv6 options to std.armv6. Modified: head/sys/arm/conf/AML8726 head/sys/arm/conf/ARMADAXP head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX6 head/sys/arm/conf/PANDABOARD head/sys/arm/conf/RK3188 head/sys/arm/conf/RPI-B head/sys/arm/conf/RPI2 head/sys/arm/conf/SOCKIT.common head/sys/arm/conf/VERSATILEPB head/sys/arm/conf/VYBRID head/sys/arm/conf/ZEDBOARD head/sys/arm/conf/std.armv6 Modified: head/sys/arm/conf/AML8726 ============================================================================== --- head/sys/arm/conf/AML8726 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/AML8726 Tue May 5 17:59:02 2015 (r282502) @@ -25,39 +25,8 @@ include "../amlogic/aml8726/std.aml8726 options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options LINUX_BOOT_ABI -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/ARMADAXP Tue May 5 17:59:02 2015 (r282502) @@ -28,36 +28,7 @@ options SOC_MV_ARMADAXP makeoptions WERROR="-Werror" options HZ=1000 -#options SCHED_ULE # ULE scheduler options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/BEAGLEBONE Tue May 5 17:59:02 2015 (r282502) @@ -36,38 +36,7 @@ makeoptions MODULES_EXTRA+="opensolaris options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/CUBIEBOARD Tue May 5 17:59:02 2015 (r282502) @@ -26,37 +26,6 @@ include "../allwinner/std.a10" options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/CUBIEBOARD2 Tue May 5 17:59:02 2015 (r282502) @@ -26,37 +26,6 @@ include "../allwinner/a20/std.a20" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/EFIKA_MX Tue May 5 17:59:02 2015 (r282502) @@ -28,43 +28,13 @@ makeoptions WITHOUT_MODULES="ahc" options SOC_IMX51 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS #options MD_ROOT # MD is a potential root device -options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 #options COMPAT_FREEBSD6 # Compatible with FreeBSD6 #options COMPAT_FREEBSD7 # Compatible with FreeBSD7 -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/IMX53 Tue May 5 17:59:02 2015 (r282502) @@ -26,42 +26,12 @@ include "../freescale/imx/std.imx53" options SOC_IMX53 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 #options COMPAT_FREEBSD6 # Compatible with FreeBSD6 #options COMPAT_FREEBSD7 # Compatible with FreeBSD7 -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/IMX6 Tue May 5 17:59:02 2015 (r282502) @@ -26,39 +26,9 @@ options SOC_IMX6 options HZ=500 # Scheduling quantum is 2 milliseconds. options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options INCLUDE_CONFIG_FILE # Include this file in kernel options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/PANDABOARD Tue May 5 17:59:02 2015 (r282502) @@ -32,38 +32,7 @@ include "../ti/omap4/pandaboard/std.pan options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/RK3188 Tue May 5 17:59:02 2015 (r282502) @@ -25,37 +25,6 @@ include "../rockchip/std.rk30xx" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/RPI-B Tue May 5 17:59:02 2015 (r282502) @@ -26,38 +26,7 @@ include "../broadcom/bcm2835/std.bcm283 options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/RPI2 Tue May 5 17:59:02 2015 (r282502) @@ -26,38 +26,7 @@ include "../broadcom/bcm2835/std.bcm283 options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/SOCKIT.common ============================================================================== --- head/sys/arm/conf/SOCKIT.common Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/SOCKIT.common Tue May 5 17:59:02 2015 (r282502) @@ -27,37 +27,6 @@ makeoptions WERROR="-Werror" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/VERSATILEPB ============================================================================== --- head/sys/arm/conf/VERSATILEPB Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/VERSATILEPB Tue May 5 17:59:02 2015 (r282502) @@ -34,38 +34,7 @@ options PHYSADDR=0x00000000 options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options LINUX_BOOT_ABI # Process metadata passed from Linux boot loaders -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/VYBRID Tue May 5 17:59:02 2015 (r282502) @@ -26,38 +26,7 @@ makeoptions WERROR="-Werror" options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem #options NANDFS # NAND Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support #options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/ZEDBOARD Tue May 5 17:59:02 2015 (r282502) @@ -25,37 +25,7 @@ include "std.armv6" include "../xilinx/zedboard/std.zedboard" options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client #options NFSSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/std.armv6 Tue May 5 17:59:02 2015 (r282502) @@ -2,5 +2,37 @@ # # $FreeBSD$ -options ARM_NEW_PMAP # Use new pmap code. +options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # Efficient memory filesystem +options GEOM_PART_GPT # GUID Partition Tables +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options GEOM_LABEL # Provides labelization +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) +options VFP # Enable floating point hardware support +options ARM_NEW_PMAP # Use new pmap code. From owner-svn-src-head@FreeBSD.ORG Tue May 5 18:04:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1066453; Tue, 5 May 2015 18:04: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 84CB2167C; Tue, 5 May 2015 18:04: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 t45I4mpw021646; Tue, 5 May 2015 18:04:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45I4mUM021645; Tue, 5 May 2015 18:04:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051804.t45I4mUM021645@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 18:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282503 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 18:04:48 -0000 Author: andrew Date: Tue May 5 18:04:47 2015 New Revision: 282503 URL: https://svnweb.freebsd.org/changeset/base/282503 Log: The VIRT kernel config targets armv6. Modified: head/sys/arm/conf/VIRT Modified: head/sys/arm/conf/VIRT ============================================================================== --- head/sys/arm/conf/VIRT Tue May 5 17:59:02 2015 (r282502) +++ head/sys/arm/conf/VIRT Tue May 5 18:04:47 2015 (r282503) @@ -20,44 +20,12 @@ ident VIRT -include "std.arm" +include "std.armv6" include "../qemu/std.virt" options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols From owner-svn-src-head@FreeBSD.ORG Tue May 5 18:29:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB3129E3; Tue, 5 May 2015 18:29: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 BC0831916; Tue, 5 May 2015 18:29:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45ITqYo031934; Tue, 5 May 2015 18:29:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45ITqeY031928; Tue, 5 May 2015 18:29:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051829.t45ITqeY031928@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 18:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282504 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 18:29:53 -0000 Author: andrew Date: Tue May 5 18:29:51 2015 New Revision: 282504 URL: https://svnweb.freebsd.org/changeset/base/282504 Log: Start to reduce the diff between the Atmel kernel configs. Modified: head/sys/arm/conf/ATMEL head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Tue May 5 18:04:47 2015 (r282503) +++ head/sys/arm/conf/ATMEL Tue May 5 18:29:51 2015 (r282504) @@ -78,10 +78,24 @@ options PRINTF_BUFR_SIZE=128 # Prevent #options MAC # TrustedBSD MAC Framework #options INCLUDE_CONFIG_FILE # Include this file in kernel -# required for netbooting +# Debugging support. Always need this: +options KDB # Enable kernel debugger support +# For minimum debugger support (stable branch) use: +options KDB_TRACE # Print a stack trace for a panic +# For full debugger support use this instead: +options DDB # Enable the kernel debugger +options GDB # Support remote GDB +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +# NFS root from boopt/dhcp options BOOTP -options BOOTP_COMPAT options BOOTP_NFSROOT +options BOOTP_COMPAT options BOOTP_NFSV3 options BOOTP_WIRED_TO=ate0 @@ -95,20 +109,6 @@ options NO_SWAPPING options NO_SYSCTL_DESCR options RWLOCK_NOINLINE -# Debugging support. Always need this: -options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: -options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: -options DDB # Support DDB. -options GDB # Support remote GDB. -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. @@ -116,7 +116,7 @@ device bpf # Berkeley packet filter # Ethernet device mii # Minimal MII support -device ate # Atmel AT91 Ethernet friver +device ate # Atmel AT91 Ethernet driver # I2C device at91_twi # Atmel AT91 Two-wire Interface Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Tue May 5 18:04:47 2015 (r282503) +++ head/sys/arm/conf/SAM9260EK Tue May 5 18:29:51 2015 (r282504) @@ -73,10 +73,24 @@ options PRINTF_BUFR_SIZE=128 # Prevent #options MAC # TrustedBSD MAC Framework #options INCLUDE_CONFIG_FILE # Include this file in kernel -# required for netbooting +# Debugging support. Always need this: +#options KDB # Enable kernel debugger support +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic +# For full debugger support use this instead: +#options DDB # Enable the kernel debugger +#options GDB # Support remote GDB +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +# NFS root from boopt/dhcp #options BOOTP -#options BOOTP_COMPAT #options BOOTP_NFSROOT +#options BOOTP_COMPAT #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ate0 @@ -93,20 +107,6 @@ options NO_SWAPPING options NO_SYSCTL_DESCR options RWLOCK_NOINLINE -# Debugging support. Always need this: -#options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: -#options DDB # Support DDB. -#options GDB # Support remote GDB. -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Tue May 5 18:04:47 2015 (r282503) +++ head/sys/arm/conf/SAM9G20EK Tue May 5 18:29:51 2015 (r282504) @@ -27,14 +27,10 @@ hints "SAM9G20EK.hints" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options DDB -options KDB options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support @@ -47,77 +43,80 @@ options NFSCL # Network Filesystem Cl #options NFSD # Network Filesystem Server #options NFSLOCKD # Network Lock Manager #options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ate0 -#options BOOTP_COMPAT - -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" - -options ALT_BREAK_TO_DEBUGGER - #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) #options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI #options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING -# Debugging for use in -current +# Debugging support. Always need this: +options KDB # Enable kernel debugger support +options DDB # Enable the kernel debugger #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC -device random -device loop -device bpf -device ether -device md +# NFS root from boopt/dhcp +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ate0 -device uart # Serial Ports +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" + +# kernel/memory size reduction +options MUTEX_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +options NO_SYSCTL_DESCR +options RWLOCK_NOINLINE + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter # Ethernet -device ate # Ethernet Driver -device mii +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet driver option AT91_ATE_USE_RMII -device at91_twi # TWI: Two Wire Interface (EEPROM) -device at91_wdt # WDT: Watchdog timer +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system +device icee -# NAND Flash - Reference design has Samsung 256MB but others possible -device nand # NAND interface on CS3 +# MMC/SD +device at91_mci # Atmel AT91 Multimedia Card Interface +options AT91_MCI_HAS_4WIRE +options AT91_MCI_SLOT_B +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card +# DataFlash # NOTE: SPI DataFlash and mci/mmc/mmcsd have hardware # confilict on this card. Use one or the other. # see board_sam9g20ek.c - -# SPI: Data Flash -#device at91_spi # SPI: -#device spibus +#device at91_spi # Atmel AT91 Serial Peripheral Interface +#device spibus # SPI bus #device at45d # at45db642 and maybe others -# MMC/SD -device at91_mci -device mmc -device mmcsd -option AT91_MCI_SLOT_B -option AT91_MCI_HAS_4WIRE - -# iic -device iic -device iicbus -device icee +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device md # Memory "disks" # SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) @@ -125,8 +124,12 @@ device da # Direct Access (disks) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) +# Serial (COM) ports +device uart # Multi-uart driver +options ALT_BREAK_TO_DEBUGGER + # USB support -device ohci # OHCI localbus->USB interface +device ohci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da device uhid # "Human Interface Devices" @@ -155,3 +158,9 @@ device uhid # "Human Interface Device #device wlan_ccmp # 802.11 CCMP support #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm + +# watchdog +device at91_wdt # Atmel AT91 Watchdog Timer + +# NAND Flash - Reference design has Samsung 256MB but others possible +device nand # NAND interface on CS3 From owner-svn-src-head@FreeBSD.ORG Tue May 5 19:34:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A55C86C; Tue, 5 May 2015 19:34:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 880E1104B; Tue, 5 May 2015 19:34:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45JYO2f066589; Tue, 5 May 2015 19:34:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45JYORa066587; Tue, 5 May 2015 19:34:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505051934.t45JYORa066587@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 19:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282505 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 19:34:24 -0000 Author: hselasky Date: Tue May 5 19:34:23 2015 New Revision: 282505 URL: https://svnweb.freebsd.org/changeset/base/282505 Log: Add new USB ID. PR: 199843 MFC after: 1 week Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Tue May 5 18:29:51 2015 (r282504) +++ head/sys/dev/usb/serial/uftdi.c Tue May 5 19:34:23 2015 (r282505) @@ -497,6 +497,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, SCS_DEVICE_5, 0), UFTDI_DEV(FTDI, SCS_DEVICE_6, 0), UFTDI_DEV(FTDI, SCS_DEVICE_7, 0), + UFTDI_DEV(FTDI, SCX8_USB_PHOENIX, 0), UFTDI_DEV(FTDI, SDMUSBQSS, 0), UFTDI_DEV(FTDI, SEMC_DSS20, 0), UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_JTAG_CHECK_STRING), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue May 5 18:29:51 2015 (r282504) +++ head/sys/dev/usb/usbdevs Tue May 5 19:34:23 2015 (r282505) @@ -1872,6 +1872,7 @@ product FREECOM HDD 0xfc05 Classic SL H product FSC E5400 0x1009 PrismGT USB 2.0 WLAN /* Future Technology Devices products */ +product FTDI SCX8_USB_PHOENIX 0x5259 SCx8 USB Phoenix interface product FTDI SERIAL_8U100AX 0x8372 8U100AX Serial product FTDI SERIAL_8U232AM 0x6001 8U232AM Serial product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial From owner-svn-src-head@FreeBSD.ORG Tue May 5 21:08:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 369F5A3; Tue, 5 May 2015 21:08: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 0B64E1B19; Tue, 5 May 2015 21:08:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45L8pAF013108; Tue, 5 May 2015 21:08:51 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45L8pFw013105; Tue, 5 May 2015 21:08:51 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505052108.t45L8pFw013105@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 21:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282515 - in head/release: arm tools/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 21:08:52 -0000 Author: gjb Date: Tue May 5 21:08:50 2015 New Revision: 282515 URL: https://svnweb.freebsd.org/changeset/base/282515 Log: Fix building BEAGLEBONE images with Crochet using the sysutils/u-boot-beaglebone port: - In arm/BEAGLEBONE.conf, set EMBEDDEDPORTS to the sysutils/u-boot-beaglebone port. - In arm/release.sh, remove BEAGLEBONE from setting WANT_UBOOT - In tools/arm/crochet-BEAGLEBONE.conf, override the beaglebone_check_uboot(), and set BEAGLEBONE_UBOOT to /tmp/external/u-boot-beaglebone, and create symlinks to the u-boot files in /usr/local/share/u-boot-beaglebone and the uEnv.txt file in crochet/board/Beaglebone/files. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/release.sh head/release/tools/arm/crochet-BEAGLEBONE.conf Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Tue May 5 20:59:43 2015 (r282514) +++ head/release/arm/BEAGLEBONE.conf Tue May 5 21:08:50 2015 (r282515) @@ -13,6 +13,7 @@ export WORLD_FLAGS="-j $(sysctl -n hw.nc export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" export CHROOTDIR="/scratch" export EMBEDDEDBUILD=1 +export EMBEDDEDPORTS="sysutils/u-boot-beaglebone" # Build chroot configuration load_chroot_env() { Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Tue May 5 20:59:43 2015 (r282514) +++ head/release/arm/release.sh Tue May 5 21:08:50 2015 (r282515) @@ -42,11 +42,6 @@ before_build() { KNOWNHASH= UBOOT_VERSION= case ${KERNEL} in - BEAGLEBONE) - WANT_UBOOT=1 - KNOWNHASH="7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31" - UBOOT_VERSION="u-boot-2014.04" - ;; PANDABOARD) WANT_UBOOT=1 KNOWNHASH="e08e20a6979bfca6eebb9a2b0e42aa4416af3d796332fd63a3470495a089d496" Modified: head/release/tools/arm/crochet-BEAGLEBONE.conf ============================================================================== --- head/release/tools/arm/crochet-BEAGLEBONE.conf Tue May 5 20:59:43 2015 (r282514) +++ head/release/tools/arm/crochet-BEAGLEBONE.conf Tue May 5 21:08:50 2015 (r282515) @@ -27,3 +27,14 @@ FREEBSD_WORLD_EXTRA_ARGS="" FREEBSD_KERNEL_EXTRA_ARGS="" FREEBSD_EXTRA_ARGS="" IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img +BEAGLEBONE_UBOOT=/tmp/external/u-boot-beaglebone + +beaglebone_check_uboot() { + mkdir -p "${BEAGLEBONE_UBOOT}" + ln -fs /usr/local/share/u-boot/u-boot-beaglebone/MLO \ + ${BEAGLEBONE_UBOOT}/MLO + ln -fs /usr/local/share/u-boot/u-boot-beaglebone/u-boot.img \ + ${BEAGLEBONE_UBOOT}/bb-uboot.img + ln -fs ${BOARDDIR}/files/uEnv.txt \ + ${BEAGLEBONE_UBOOT}/bb-uenv.txt +} From owner-svn-src-head@FreeBSD.ORG Tue May 5 23:27:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8687D23; Tue, 5 May 2015 23:27:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89D7A1B09; Tue, 5 May 2015 23:27: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 t45NRpgt081281; Tue, 5 May 2015 23:27:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45NRo7t081277; Tue, 5 May 2015 23:27:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505052327.t45NRo7t081277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 5 May 2015 23:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282516 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 23:27:51 -0000 Author: ian Date: Tue May 5 23:27:49 2015 New Revision: 282516 URL: https://svnweb.freebsd.org/changeset/base/282516 Log: Add the code necessary to run the imx6 chip at its lowest clock/power operating point (396MHz/950mV). Modified: head/sys/arm/freescale/imx/imx6_anatop.c head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_ccmreg.h head/sys/arm/freescale/imx/imx_ccmvar.h Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Tue May 5 21:08:50 2015 (r282515) +++ head/sys/arm/freescale/imx/imx6_anatop.c Tue May 5 23:27:49 2015 (r282516) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -116,12 +117,16 @@ static struct imx6_anatop_softc *imx6_an /* * Table of "operating points". * These are combinations of frequency and voltage blessed by Freescale. + * While the datasheet says the ARM voltage can be as low as 925mV at + * 396MHz, it also says that the ARM and SOC voltages can't differ by + * more than 200mV, and the minimum SOC voltage is 1150mV, so that + * dictates the 950mV entry in this table. */ static struct oppt { uint32_t mhz; uint32_t mv; } imx6_oppt_table[] = { -/* { 396, 925}, XXX: need functional ccm code for this speed */ + { 396, 950}, { 792, 1150}, { 852, 1225}, { 996, 1225}, @@ -158,14 +163,15 @@ imx6_anatop_write_4(bus_size_t offset, u static void vdd_set(struct imx6_anatop_softc *sc, int mv) { - int newtarg, oldtarg; + int newtarg, newtargSoc, oldtarg; uint32_t delay, pmureg; static boolean_t init_done = false; /* * The datasheet says VDD_PU and VDD_SOC must be equal, and VDD_ARM - * can't be more than 50mV above or 200mV below them. For now to keep - * things simple we set all three to the same value. + * can't be more than 50mV above or 200mV below them. We keep them the + * same except in the case of the lowest operating point, which is + * handled as a special case below. */ pmureg = imx6_anatop_read_4(IMX6_ANALOG_PMU_REG_CORE); @@ -180,19 +186,29 @@ vdd_set(struct imx6_anatop_softc *sc, in newtarg = (mv - 700) / 25; /* + * The SOC voltage can't go below 1150mV, and thus because of the 200mV + * rule, the ARM voltage can't go below 950mV. The 950 is encoded in + * our oppt table, here we handle the SOC 1150 rule as a special case. + * (1150-700/25=18). + */ + newtargSoc = (newtarg < 18) ? 18 : newtarg; + + /* * The first time through the 3 voltages might not be equal so use a * long conservative delay. After that we need to delay 3uS for every - * 25mV step upward. No need to delay at all when lowering. + * 25mV step upward; we actually delay 6uS because empirically, it works + * and the 3uS per step recommended by the docs doesn't (3uS fails when + * going from 400->1200, but works for smaller changes). */ if (init_done) { if (newtarg == oldtarg) return; else if (newtarg > oldtarg) - delay = (newtarg - oldtarg) * 3; + delay = (newtarg - oldtarg) * 6; else delay = 0; } else { - delay = 700 / 25 * 3; + delay = (700 / 25) * 6; init_done = true; } @@ -205,7 +221,7 @@ vdd_set(struct imx6_anatop_softc *sc, in pmureg |= newtarg << IMX6_ANALOG_PMU_REG0_TARG_SHIFT; pmureg |= newtarg << IMX6_ANALOG_PMU_REG1_TARG_SHIFT; - pmureg |= newtarg << IMX6_ANALOG_PMU_REG2_TARG_SHIFT; + pmureg |= newtargSoc << IMX6_ANALOG_PMU_REG2_TARG_SHIFT; imx6_anatop_write_4(IMX6_ANALOG_PMU_REG_CORE, pmureg); DELAY(delay); @@ -213,24 +229,29 @@ vdd_set(struct imx6_anatop_softc *sc, in } static inline uint32_t -cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t div) +cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t corediv, + uint32_t plldiv) { - return (sc->refosc_mhz * (div / 2)); + return ((sc->refosc_mhz * (plldiv / 2)) / (corediv + 1)); } -static inline uint32_t -cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) +static inline void +cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz, + uint32_t *corediv, uint32_t *plldiv) { - return (cpu_mhz / (sc->refosc_mhz / 2)); + *corediv = (cpu_mhz < 650) ? 1 : 0; + *plldiv = ((*corediv + 1) * cpu_mhz) / (sc->refosc_mhz / 2); } static inline uint32_t cpufreq_actual_mhz(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) { + uint32_t corediv, plldiv; - return (cpufreq_mhz_from_div(sc, cpufreq_mhz_to_div(sc, cpu_mhz))); + cpufreq_mhz_to_div(sc, cpu_mhz, &corediv, &plldiv); + return (cpufreq_mhz_from_div(sc, corediv, plldiv)); } static struct oppt * @@ -256,7 +277,7 @@ cpufreq_nearest_oppt(struct imx6_anatop_ static void cpufreq_set_clock(struct imx6_anatop_softc * sc, struct oppt *op) { - uint32_t timeout, wrk32; + uint32_t corediv, plldiv, timeout, wrk32; /* If increasing the frequency, we must first increase the voltage. */ if (op->mhz > sc->cpu_curmhz) { @@ -272,6 +293,7 @@ cpufreq_set_clock(struct imx6_anatop_sof * - Wait for the LOCK bit to come on; it takes ~50 loop iterations. * - Turn off bypass mode; cpu should now be running at the new speed. */ + cpufreq_mhz_to_div(sc, op->mhz, &corediv, &plldiv); imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK); imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_SET, @@ -279,7 +301,7 @@ cpufreq_set_clock(struct imx6_anatop_sof wrk32 = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM); wrk32 &= ~IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - wrk32 |= cpufreq_mhz_to_div(sc, op->mhz); + wrk32 |= plldiv; imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM, wrk32); timeout = 10000; @@ -290,6 +312,7 @@ cpufreq_set_clock(struct imx6_anatop_sof imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_BYPASS); + imx_ccm_set_cacrr(corediv); /* If lowering the frequency, it is now safe to lower the voltage. */ if (op->mhz < sc->cpu_curmhz) @@ -297,7 +320,7 @@ cpufreq_set_clock(struct imx6_anatop_sof sc->cpu_curmhz = op->mhz; /* Tell the mpcore timer that its frequency has changed. */ - arm_tmr_change_frequency( + arm_tmr_change_frequency( cpufreq_actual_mhz(sc, sc->cpu_curmhz) * 1000000 / 2); } @@ -748,11 +771,12 @@ imx6_anatop_probe(device_t dev) uint32_t imx6_get_cpu_clock() { - uint32_t div; + uint32_t corediv, plldiv; - div = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & + corediv = imx_ccm_get_cacrr(); + plldiv = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - return (cpufreq_mhz_from_div(imx6_anatop_sc, div)); + return (cpufreq_mhz_from_div(imx6_anatop_sc, corediv, plldiv)); } static device_method_t imx6_anatop_methods[] = { Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Tue May 5 21:08:50 2015 (r282515) +++ head/sys/arm/freescale/imx/imx6_ccm.c Tue May 5 23:27:49 2015 (r282516) @@ -320,6 +320,20 @@ imx_ccm_ahb_hz(void) return (132000000); } +uint32_t +imx_ccm_get_cacrr(void) +{ + + return (RD4(ccm_sc, CCM_CACCR)); +} + +void +imx_ccm_set_cacrr(uint32_t divisor) +{ + + WR4(ccm_sc, CCM_CACCR, divisor); +} + static device_method_t ccm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ccm_probe), Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccmreg.h Tue May 5 21:08:50 2015 (r282515) +++ head/sys/arm/freescale/imx/imx6_ccmreg.h Tue May 5 23:27:49 2015 (r282516) @@ -29,6 +29,7 @@ #ifndef IMX6_CCMREG_H #define IMX6_CCMREG_H +#define CCM_CACCR 0x010 #define CCM_CSCMR1 0x01C #define SSI1_CLK_SEL_S 10 #define SSI2_CLK_SEL_S 12 @@ -64,6 +65,5 @@ #define CCM_CCGR5 0x07C #define CCM_CCGR6 0x080 #define CCM_CMEOR 0x088 - #endif Modified: head/sys/arm/freescale/imx/imx_ccmvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx_ccmvar.h Tue May 5 21:08:50 2015 (r282515) +++ head/sys/arm/freescale/imx/imx_ccmvar.h Tue May 5 23:27:49 2015 (r282516) @@ -53,4 +53,8 @@ void imx_ccm_usb_enable(device_t _usbdev void imx_ccm_usbphy_enable(device_t _phydev); void imx_ccm_ssi_configure(device_t _ssidev); +/* Routines to get and set the arm clock root divisor register. */ +uint32_t imx_ccm_get_cacrr(void); +void imx_ccm_set_cacrr(uint32_t _divisor); + #endif From owner-svn-src-head@FreeBSD.ORG Wed May 6 01:08:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15836DB8; Wed, 6 May 2015 01:08:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBE6E157B; Wed, 6 May 2015 01:08: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 t46180jb031264; Wed, 6 May 2015 01:08:00 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46180mi031257; Wed, 6 May 2015 01:08:00 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201505060108.t46180mi031257@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Wed, 6 May 2015 01:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282517 - head/sys/arm/amlogic/aml8726 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 01:08:01 -0000 Author: ganbold Date: Wed May 6 01:07:59 2015 New Revision: 282517 URL: https://svnweb.freebsd.org/changeset/base/282517 Log: This patch adds support for the extended baud rate register available on the aml8726-m6 (and later) SoC which allows for lower speeds. Differential Revision: https://reviews.freebsd.org/D2433 Submitted by: John Wehle Modified: head/sys/arm/amlogic/aml8726/aml8726_uart.h head/sys/arm/amlogic/aml8726/uart_dev_aml8726.c Modified: head/sys/arm/amlogic/aml8726/aml8726_uart.h ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_uart.h Tue May 5 23:27:49 2015 (r282516) +++ head/sys/arm/amlogic/aml8726/aml8726_uart.h Wed May 6 01:07:59 2015 (r282517) @@ -94,4 +94,14 @@ #define AML_UART_MISC_RECV_IRQ_CNT_MASK 0xff #define AML_UART_MISC_RECV_IRQ_CNT_SHIFT 0 +/* + * The new baud rate register is available on the + * aml8726-m6 and later. + */ +#define AML_UART_NEW_BAUD_REG 20 +#define AML_UART_NEW_BAUD_USE_XTAL_CLK (1 << 24) +#define AML_UART_NEW_BAUD_RATE_EN (1 << 23) +#define AML_UART_NEW_BAUD_RATE_MASK (0x7fffff << 0) +#define AML_UART_NEW_BAUD_RATE_SHIFT 0 + #endif /* _ARM_AMLOGIC_AML8726_UART_H */ Modified: head/sys/arm/amlogic/aml8726/uart_dev_aml8726.c ============================================================================== --- head/sys/arm/amlogic/aml8726/uart_dev_aml8726.c Tue May 5 23:27:49 2015 (r282516) +++ head/sys/arm/amlogic/aml8726/uart_dev_aml8726.c Wed May 6 01:07:59 2015 (r282517) @@ -31,8 +31,8 @@ * uarts. For example ... though UART A as a 128 byte FIFO, the * others only have a 64 byte FIFO. * - * Also, it's assumed that register 5 (the new baud rate register - * present on the aml8726-m6) has not been activated. + * Also, it's assumed that the USE_XTAL_CLK feature (available on + * the aml8726-m6 and later) has not been activated. */ #include @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "uart_if.h" @@ -89,7 +90,7 @@ aml8726_uart_divisor(int rclk, int baudr /* integer version of (rclk / baudrate + .5) */ divisor = ((rclk << 1) + baudrate) / (baudrate << 1); - if (divisor == 0 || divisor >= 65536) + if (divisor == 0) return (0); actual_baud = rclk / divisor; @@ -109,6 +110,7 @@ aml8726_uart_param(struct uart_bas *bas, { uint32_t cr; uint32_t mr; + uint32_t nbr; int divisor; cr = uart_getreg(bas, AML_UART_CONTROL_REG); @@ -147,8 +149,29 @@ aml8726_uart_param(struct uart_bas *bas, /* Set baudrate. */ if (baudrate > 0 && bas->rclk != 0) { divisor = aml8726_uart_divisor(bas->rclk / 4, baudrate) - 1; - if (divisor > 0xffff) - return (EINVAL); + + switch (aml8726_soc_hw_rev) { + case AML_SOC_HW_REV_M6: + case AML_SOC_HW_REV_M8: + case AML_SOC_HW_REV_M8B: + if (divisor > (AML_UART_NEW_BAUD_RATE_MASK >> + AML_UART_NEW_BAUD_RATE_SHIFT)) + return (EINVAL); + + nbr = uart_getreg(bas, AML_UART_NEW_BAUD_REG); + nbr &= ~(AML_UART_NEW_BAUD_USE_XTAL_CLK | + AML_UART_NEW_BAUD_RATE_MASK); + nbr |= AML_UART_NEW_BAUD_RATE_EN | + (divisor << AML_UART_NEW_BAUD_RATE_SHIFT); + uart_setreg(bas, AML_UART_NEW_BAUD_REG, nbr); + + divisor = 0; + break; + default: + if (divisor > 0xffff) + return (EINVAL); + break; + } cr &= ~AML_UART_CONTROL_BAUD_MASK; cr |= (divisor & AML_UART_CONTROL_BAUD_MASK); @@ -187,7 +210,7 @@ aml8726_uart_init(struct uart_bas *bas, uint32_t cr; uint32_t mr; - aml8726_uart_param(bas, baudrate, databits, stopbits, parity); + (void)aml8726_uart_param(bas, baudrate, databits, stopbits, parity); cr = uart_getreg(bas, AML_UART_CONTROL_REG); /* Disable all interrupt sources. */ @@ -466,7 +489,7 @@ aml8726_uart_bus_ioctl(struct uart_softc { struct uart_bas *bas; int baudrate, divisor, error; - uint32_t cr, mr; + uint32_t cr, mr, nbr; bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); @@ -483,6 +506,20 @@ aml8726_uart_bus_ioctl(struct uart_softc divisor = ((mr >> AML_UART_MISC_BAUD_EXT_SHIFT) << AML_UART_CONTROL_BAUD_WIDTH) | cr; + switch (aml8726_soc_hw_rev) { + case AML_SOC_HW_REV_M6: + case AML_SOC_HW_REV_M8: + case AML_SOC_HW_REV_M8B: + nbr = uart_getreg(bas, AML_UART_NEW_BAUD_REG); + if ((nbr & AML_UART_NEW_BAUD_RATE_EN) != 0) { + divisor = (nbr & AML_UART_NEW_BAUD_RATE_MASK) >> + AML_UART_NEW_BAUD_RATE_SHIFT; + } + break; + default: + break; + } + baudrate = bas->rclk / 4 / (divisor + 1); if (baudrate > 0) *(int*)data = baudrate; From owner-svn-src-head@FreeBSD.ORG Wed May 6 01:29:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A5313F6; Wed, 6 May 2015 01:29: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 68B99176B; Wed, 6 May 2015 01:29: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 t461TWbu041490; Wed, 6 May 2015 01:29:32 GMT (envelope-from osa@FreeBSD.org) Received: (from osa@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t461TWir041489; Wed, 6 May 2015 01:29:32 GMT (envelope-from osa@FreeBSD.org) Message-Id: <201505060129.t461TWir041489@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: osa set sender to osa@FreeBSD.org using -f From: "Sergey A. Osokin" Date: Wed, 6 May 2015 01:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282518 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 01:29:32 -0000 Author: osa (ports committer) Date: Wed May 6 01:29:31 2015 New Revision: 282518 URL: https://svnweb.freebsd.org/changeset/base/282518 Log: Fix DragonFly 4.0.5 release date. Reported by: vangyzen Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed May 6 01:07:59 2015 (r282517) +++ head/share/misc/bsd-family-tree Wed May 6 01:29:31 2015 (r282518) @@ -670,7 +670,7 @@ DragonFly 4.0.1 2014-11-25 [DFB] DragonFly 4.0.2 2015-01-07 [DFB] DragonFly 4.0.3 2015-01-21 [DFB] DragonFly 4.0.4 2015-03-09 [DFB] -DragonFly 4.0.5 2015-01-23 [DFB] +DragonFly 4.0.5 2015-03-23 [DFB] OpenBSD 5.7 2015-05-01 [OBD] Bibliography From owner-svn-src-head@FreeBSD.ORG Wed May 6 04:57:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 251E57C3; Wed, 6 May 2015 04:57:31 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 150181DCA; Wed, 6 May 2015 04:57:30 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-241-118.lns20.per4.internode.on.net [121.45.241.118]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t464vOq1041460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 5 May 2015 21:57:27 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <55499F2F.2000806@freebsd.org> Date: Wed, 06 May 2015 12:57:19 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282468 - head/usr.bin/checknr References: <201505050954.t459slxm078725@svn.freebsd.org> In-Reply-To: <201505050954.t459slxm078725@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 04:57:31 -0000 On 5/5/15 5:54 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Tue May 5 09:54:47 2015 > New Revision: 282468 > URL: https://svnweb.freebsd.org/changeset/base/282468 > > Log: > Enlarge the buffer for storing macros as some macros can be longer than 5 > > Modified: > head/usr.bin/checknr/checknr.c > > Modified: head/usr.bin/checknr/checknr.c > ============================================================================== > --- head/usr.bin/checknr/checknr.c Tue May 5 09:50:21 2015 (r282467) > +++ head/usr.bin/checknr/checknr.c Tue May 5 09:54:47 2015 (r282468) > @@ -313,7 +313,7 @@ static void > process(FILE *f) > { > int i, n; > - char mac[5]; /* The current macro or nroff command */ > + char mac[512]; /* The current macro or nroff command */ 5 to 512 ?? if 5 was almost enough. why not 64 or 50? > char *line; > size_t linecap; > int pl; > > > From owner-svn-src-head@FreeBSD.ORG Wed May 6 05:04:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24B6298B; Wed, 6 May 2015 05:04:15 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C44541EA4; Wed, 6 May 2015 05:04:14 +0000 (UTC) Received: by wief7 with SMTP id f7so116372697wie.0; Tue, 05 May 2015 22:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4xiSbmAJo/45WNBqAVxbDHYg09ll4dqecUWSlBgc650=; b=v2raEgNt9hM5rurt6kHJEG3x1TLwStS6rGEP25V7ocYaoYALOUnJSLDzTb444ssOqr fuVFHsLmrjJukHXjDYGmfT9UWbefNNwBpDf877lraN+19Nsv/9NKC2awyCpw1wGooLip M3RfnAnOueSOVhN1tymY0+nsM2k3F09EbfJ7RCH6oFigMblBwdxNBcAW7Cd0rAC3sIAl jRezkeqVg5x/wytiPggSEAH2koG09TUSHS4fx1gfm2l375Dciy3sN/E4F6BtpWNFWNeF 9doIPxwtvrqd5RoOgvLtddPiBs2wsTAG9zA296aTidDx8ak/FM2DcBuZFySNdTjFyt6t YBZg== MIME-Version: 1.0 X-Received: by 10.195.11.165 with SMTP id ej5mr12398452wjd.127.1430888652219; Tue, 05 May 2015 22:04:12 -0700 (PDT) Received: by 10.27.52.18 with HTTP; Tue, 5 May 2015 22:04:12 -0700 (PDT) In-Reply-To: <201505041955.t44Jt28d008533@svn.freebsd.org> References: <201505041955.t44Jt28d008533@svn.freebsd.org> Date: Tue, 5 May 2015 22:04:12 -0700 Message-ID: Subject: Re: svn commit: r282429 - head/usr.sbin/bhyve From: Neel Natu To: Alexander Motin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 05:04:15 -0000 Hi Alexander, I am getting the following error(?) messages with an ahci-cd device on Centos 6.4 x86_64: ata1.00: qc timeout (cmd 0xa0) ata1: limiting SATA link speed to 1.5 Gbps ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen ata1.00: irq_stat 0x40000001 sr 0:0:0:0: [sr0] CDB: Get configuration: 46 00 00 00 00 00 00 00 08 00 ata1.00: cmd a0/00:00:00:08:00/00:00:00:00:00/a0 tag 0 pio 16392 in res 41/50:00:03:08:00/00:00:00:00:00/a0 Emask 0x5 (timeout) ata1.00: status: { DRDY ERR } ata1: hard resetting link ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata1.00: configured for UDMA/133 ata1: EH complete I have the boot log for the r282364 (working) and r282429 (not working) here: https://people.freebsd.org/~neel/bhyve/r282364_working.txt https://people.freebsd.org/~neel/bhyve/r282429_not_working.txt Any idea what the problem is? best Neel On Mon, May 4, 2015 at 12:55 PM, Alexander Motin wrote: > Author: mav > Date: Mon May 4 19:55:01 2015 > New Revision: 282429 > URL: https://svnweb.freebsd.org/changeset/base/282429 > > Log: > Implement in-order execution of non-NCQ commands. > > Using status updates in r282364, block queue on BSY, DRQ or ERR bits set. > This can be a performance penalization for non-NCQ commands, but it is > required for proper error recovery and standard compliance. > > MFC after: 2 weeks > > Modified: > head/usr.sbin/bhyve/pci_ahci.c > > Modified: head/usr.sbin/bhyve/pci_ahci.c > ============================================================================== > --- head/usr.sbin/bhyve/pci_ahci.c Mon May 4 19:34:59 2015 (r282428) > +++ head/usr.sbin/bhyve/pci_ahci.c Mon May 4 19:55:01 2015 (r282429) > @@ -140,6 +140,7 @@ struct ahci_port { > uint8_t err_cfis[20]; > uint8_t sense_key; > uint8_t asc; > + u_int ccs; > uint32_t pending; > > uint32_t clb; > @@ -204,6 +205,8 @@ struct pci_ahci_softc { > }; > #define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) > > +static void ahci_handle_port(struct ahci_port *p); > + > static inline void lba_to_msf(uint8_t *buf, int lba) > { > lba += 150; > @@ -406,6 +409,7 @@ ahci_check_stopped(struct ahci_port *p) > */ > if (!(p->cmd & AHCI_P_CMD_ST)) { > if (p->pending == 0) { > + p->ccs = 0; > p->cmd &= ~(AHCI_P_CMD_CR | AHCI_P_CMD_CCS_MASK); > p->ci = 0; > p->sact = 0; > @@ -783,6 +787,8 @@ next: > ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); > p->pending &= ~(1 << slot); > ahci_check_stopped(p); > + if (!first) > + ahci_handle_port(p); > return; > } > goto next; > @@ -1754,20 +1760,21 @@ ahci_handle_slot(struct ahci_port *p, in > static void > ahci_handle_port(struct ahci_port *p) > { > - int i; > > if (!(p->cmd & AHCI_P_CMD_ST)) > return; > > /* > * Search for any new commands to issue ignoring those that > - * are already in-flight. > + * are already in-flight. Stop if device is busy or in error. > */ > - for (i = 0; (i < 32) && p->ci; i++) { > - if ((p->ci & (1 << i)) && !(p->pending & (1 << i))) { > + for (; (p->ci & ~p->pending) != 0; p->ccs = ((p->ccs + 1) & 31)) { > + if ((p->tfd & (ATA_S_BUSY | ATA_S_DRQ | ATA_S_ERROR)) != 0) > + break; > + if ((p->ci & ~p->pending & (1 << p->ccs)) != 0) { > p->cmd &= ~AHCI_P_CMD_CCS_MASK; > - p->cmd |= i << AHCI_P_CMD_CCS_SHIFT; > - ahci_handle_slot(p, i); > + p->cmd |= p->ccs << AHCI_P_CMD_CCS_SHIFT; > + ahci_handle_slot(p, p->ccs); > } > } > } > @@ -1844,6 +1851,7 @@ ata_ioreq_cb(struct blockif_req *br, int > p->pending &= ~(1 << slot); > > ahci_check_stopped(p); > + ahci_handle_port(p); > out: > pthread_mutex_unlock(&sc->mtx); > DPRINTF("%s exit\n", __func__); > @@ -1905,6 +1913,7 @@ atapi_ioreq_cb(struct blockif_req *br, i > p->pending &= ~(1 << slot); > > ahci_check_stopped(p); > + ahci_handle_port(p); > out: > pthread_mutex_unlock(&sc->mtx); > DPRINTF("%s exit\n", __func__); > From owner-svn-src-head@FreeBSD.ORG Wed May 6 05:12:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E1E4BD9; Wed, 6 May 2015 05:12: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 5C7381F79; Wed, 6 May 2015 05:12: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 t465CUIS053375; Wed, 6 May 2015 05:12:30 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t465CU6f053374; Wed, 6 May 2015 05:12:30 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505060512.t465CU6f053374@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 6 May 2015 05:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282519 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 05:12:30 -0000 Author: neel Date: Wed May 6 05:12:29 2015 New Revision: 282519 URL: https://svnweb.freebsd.org/changeset/base/282519 Log: Add macros for AMD-specific bits in MSR_EFER: LMSLE, FFXSR and TCE. AMDID_FFXSR is at bit 25 so correct its value to 0x02000000. MFC after: 1 week Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Wed May 6 01:29:31 2015 (r282518) +++ head/sys/x86/include/specialreg.h Wed May 6 05:12:29 2015 (r282519) @@ -82,6 +82,9 @@ #define EFER_LMA 0x000000400 /* Long mode active (R) */ #define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ #define EFER_SVM 0x000001000 /* SVM enable bit for AMD, reserved for Intel */ +#define EFER_LMSLE 0x000002000 /* Long Mode Segment Limit Enable */ +#define EFER_FFXSR 0x000004000 /* Fast FXSAVE/FSRSTOR */ +#define EFER_TCE 0x000008000 /* Translation Cache Extension */ /* * Intel Extended Features registers @@ -191,7 +194,7 @@ #define AMDID_MP 0x00080000 #define AMDID_NX 0x00100000 #define AMDID_EXT_MMX 0x00400000 -#define AMDID_FFXSR 0x01000000 +#define AMDID_FFXSR 0x02000000 #define AMDID_PAGE1GB 0x04000000 #define AMDID_RDTSCP 0x08000000 #define AMDID_LM 0x20000000 From owner-svn-src-head@FreeBSD.ORG Wed May 6 05:40:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F5AF592; Wed, 6 May 2015 05:40: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 20F0111CC; Wed, 6 May 2015 05:40: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 t465eLTr064088; Wed, 6 May 2015 05:40:21 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t465eLva064083; Wed, 6 May 2015 05:40:21 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505060540.t465eLva064083@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 6 May 2015 05:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282520 - in head/sys/amd64/vmm: . amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 05:40:22 -0000 Author: neel Date: Wed May 6 05:40:20 2015 New Revision: 282520 URL: https://svnweb.freebsd.org/changeset/base/282520 Log: Do a proper emulation of guest writes to MSR_EFER. - Must-Be-Zero bits cannot be set. - EFER_LME and EFER_LMA should respect the long mode consistency checks. - EFER_NXE, EFER_FFXSR, EFER_TCE can be set if allowed by CPUID capabilities. - Flag an error if guest tries to set EFER_LMSLE since bhyve doesn't enforce segment limits in 64-bit mode. MFC after: 2 weeks Modified: head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/x86.c head/sys/amd64/vmm/x86.h Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Wed May 6 05:12:29 2015 (r282519) +++ head/sys/amd64/vmm/amd/svm.c Wed May 6 05:40:20 2015 (r282520) @@ -564,6 +564,19 @@ svm_vminit(struct vm *vm, pmap_t pmap) return (svm_sc); } +/* + * Collateral for a generic SVM VM-exit. + */ +static void +vm_exit_svm(struct vm_exit *vme, uint64_t code, uint64_t info1, uint64_t info2) +{ + + vme->exitcode = VM_EXITCODE_SVM; + vme->u.svm.exitcode = code; + vme->u.svm.exitinfo1 = info1; + vme->u.svm.exitinfo2 = info2; +} + static int svm_cpl(struct vmcb_state *state) { @@ -1080,6 +1093,76 @@ clear_nmi_blocking(struct svm_softc *sc, KASSERT(!error, ("%s: error %d setting intr_shadow", __func__, error)); } +#define EFER_MBZ_BITS 0xFFFFFFFFFFFF0200UL + +static int +svm_write_efer(struct svm_softc *sc, int vcpu, uint64_t newval, bool *retu) +{ + struct vm_exit *vme; + struct vmcb_state *state; + uint64_t changed, lma, oldval; + int error; + + state = svm_get_vmcb_state(sc, vcpu); + + oldval = state->efer; + VCPU_CTR2(sc->vm, vcpu, "wrmsr(efer) %#lx/%#lx", oldval, newval); + + newval &= ~0xFE; /* clear the Read-As-Zero (RAZ) bits */ + changed = oldval ^ newval; + + if (newval & EFER_MBZ_BITS) + goto gpf; + + /* APMv2 Table 14-5 "Long-Mode Consistency Checks" */ + if (changed & EFER_LME) { + if (state->cr0 & CR0_PG) + goto gpf; + } + + /* EFER.LMA = EFER.LME & CR0.PG */ + if ((newval & EFER_LME) != 0 && (state->cr0 & CR0_PG) != 0) + lma = EFER_LMA; + else + lma = 0; + + if ((newval & EFER_LMA) != lma) + goto gpf; + + if (newval & EFER_NXE) { + if (!vm_cpuid_capability(sc->vm, vcpu, VCC_NO_EXECUTE)) + goto gpf; + } + + /* + * XXX bhyve does not enforce segment limits in 64-bit mode. Until + * this is fixed flag guest attempt to set EFER_LMSLE as an error. + */ + if (newval & EFER_LMSLE) { + vme = vm_exitinfo(sc->vm, vcpu); + vm_exit_svm(vme, VMCB_EXIT_MSR, 1, 0); + *retu = true; + return (0); + } + + if (newval & EFER_FFXSR) { + if (!vm_cpuid_capability(sc->vm, vcpu, VCC_FFXSR)) + goto gpf; + } + + if (newval & EFER_TCE) { + if (!vm_cpuid_capability(sc->vm, vcpu, VCC_TCE)) + goto gpf; + } + + error = svm_setreg(sc, vcpu, VM_REG_GUEST_EFER, newval); + KASSERT(error == 0, ("%s: error %d updating efer", __func__, error)); + return (0); +gpf: + vm_inject_gp(sc->vm, vcpu); + return (0); +} + static int emulate_wrmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t val, bool *retu) @@ -1089,7 +1172,7 @@ emulate_wrmsr(struct svm_softc *sc, int if (lapic_msr(num)) error = lapic_wrmsr(sc->vm, vcpu, num, val, retu); else if (num == MSR_EFER) - error = svm_setreg(sc, vcpu, VM_REG_GUEST_EFER, val); + error = svm_write_efer(sc, vcpu, val, retu); else error = svm_wrmsr(sc, vcpu, num, val, retu); @@ -1189,19 +1272,6 @@ nrip_valid(uint64_t exitcode) } } -/* - * Collateral for a generic SVM VM-exit. - */ -static void -vm_exit_svm(struct vm_exit *vme, uint64_t code, uint64_t info1, uint64_t info2) -{ - - vme->exitcode = VM_EXITCODE_SVM; - vme->u.svm.exitcode = code; - vme->u.svm.exitinfo1 = info1; - vme->u.svm.exitinfo2 = info2; -} - static int svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct vm_exit *vmexit) { Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Wed May 6 05:12:29 2015 (r282519) +++ head/sys/amd64/vmm/x86.c Wed May 6 05:40:20 2015 (r282520) @@ -488,3 +488,34 @@ x86_emulate_cpuid(struct vm *vm, int vcp return (1); } + +bool +vm_cpuid_capability(struct vm *vm, int vcpuid, enum vm_cpuid_capability cap) +{ + bool rv; + + KASSERT(cap > 0 && cap < VCC_LAST, ("%s: invalid vm_cpu_capability %d", + __func__, cap)); + + /* + * Simply passthrough the capabilities of the host cpu for now. + */ + rv = false; + switch (cap) { + case VCC_NO_EXECUTE: + if (amd_feature & AMDID_NX) + rv = true; + break; + case VCC_FFXSR: + if (amd_feature & AMDID_FFXSR) + rv = true; + break; + case VCC_TCE: + if (amd_feature2 & AMDID2_TCE) + rv = true; + break; + default: + panic("%s: unknown vm_cpu_capability %d", __func__, cap); + } + return (rv); +} Modified: head/sys/amd64/vmm/x86.h ============================================================================== --- head/sys/amd64/vmm/x86.h Wed May 6 05:12:29 2015 (r282519) +++ head/sys/amd64/vmm/x86.h Wed May 6 05:40:20 2015 (r282520) @@ -62,4 +62,17 @@ int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx); +enum vm_cpuid_capability { + VCC_NONE, + VCC_NO_EXECUTE, + VCC_FFXSR, + VCC_TCE, + VCC_LAST +}; + +/* + * Return 'true' if the capability 'cap' is enabled in this virtual cpu + * and 'false' otherwise. + */ +bool vm_cpuid_capability(struct vm *vm, int vcpuid, enum vm_cpuid_capability); #endif From owner-svn-src-head@FreeBSD.ORG Wed May 6 07:53:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DD50C2B; Wed, 6 May 2015 07:53: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 1CE531048; Wed, 6 May 2015 07:53: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 t467rhq5032817; Wed, 6 May 2015 07:53:43 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t467rh9v032816; Wed, 6 May 2015 07:53:43 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201505060753.t467rh9v032816@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 6 May 2015 07:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282521 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 07:53:44 -0000 Author: melifaro Date: Wed May 6 07:53:43 2015 New Revision: 282521 URL: https://svnweb.freebsd.org/changeset/base/282521 Log: Fix panic when prepare_batch_buffer() returns error. Modified: head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Wed May 6 05:40:20 2015 (r282520) +++ head/sys/netpfil/ipfw/ip_fw_table.c Wed May 6 07:53:43 2015 (r282521) @@ -597,19 +597,21 @@ restart: /* Pass stack buffer by default */ ta_buf_m = ta_buf; error = prepare_batch_buffer(ch, ta, tei, count, OP_ADD, &ta_buf_m); - if (error != 0) - goto cleanup; IPFW_UH_WLOCK(ch); + del_toperation_state(ch, &ts); /* Drop reference we've used in first search */ tc->no.refcnt--; + /* Check prepare_batch_buffer() error */ + if (error != 0) + goto cleanup; + /* * Check if table swap has happened. * (so table algo might be changed). * Restart operation to achieve consistent behavior. */ - del_toperation_state(ch, &ts); if (ts.modified != 0) goto restart; From owner-svn-src-head@FreeBSD.ORG Wed May 6 08:07:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D443AFD1; Wed, 6 May 2015 08:07: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 C2E501188; Wed, 6 May 2015 08:07: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 t4687B60038459; Wed, 6 May 2015 08:07:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4687B52038458; Wed, 6 May 2015 08:07:11 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201505060807.t4687B52038458@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 6 May 2015 08:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282522 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 08:07:11 -0000 Author: glebius Date: Wed May 6 08:07:11 2015 New Revision: 282522 URL: https://svnweb.freebsd.org/changeset/base/282522 Log: Fix the KASSERT and improve wording in r282426. Submitted by: alc Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Wed May 6 07:53:43 2015 (r282521) +++ head/sys/vm/vnode_pager.c Wed May 6 08:07:11 2015 (r282522) @@ -342,12 +342,12 @@ vnode_pager_haspage(vm_object_t object, if (after) { /* * The BMAP vop can report a partial block in the - * 'after', but must not count blocks after EOF. + * 'after', but must not report blocks after EOF. * Assert the latter, and truncate 'after' in case * of the former. */ - KASSERT(reqblock + *after <= - object->size * pagesperblock, + KASSERT((reqblock + *after) * pagesperblock < + roundup2(object->size, pagesperblock), ("%s: reqblock %jd after %d size %ju", __func__, (intmax_t )reqblock, *after, (uintmax_t )object->size)); From owner-svn-src-head@FreeBSD.ORG Wed May 6 09:59:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A5F185F; Wed, 6 May 2015 09:59: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 1F5621E1F; Wed, 6 May 2015 09:59: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 t469xJHo092905; Wed, 6 May 2015 09:59:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t469xJLN092904; Wed, 6 May 2015 09:59:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505060959.t469xJLN092904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 6 May 2015 09:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282524 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 09:59:20 -0000 Author: mav Date: Wed May 6 09:59:19 2015 New Revision: 282524 URL: https://svnweb.freebsd.org/changeset/base/282524 Log: Reimplement queue freeze on error, added in r282429: It is not required to use CLO to recover from task file error, it should be enough to do only stop/start, that does not clear the PxTFD.STS.ERR. MFC after: 13 days Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Wed May 6 09:38:44 2015 (r282523) +++ head/usr.sbin/bhyve/pci_ahci.c Wed May 6 09:59:19 2015 (r282524) @@ -135,6 +135,7 @@ struct ahci_port { char ident[20 + 1]; int atapi; int reset; + int waitforclear; int mult_sectors; uint8_t xfermode; uint8_t err_cfis[20]; @@ -288,8 +289,10 @@ ahci_write_fis(struct ahci_port *p, enum WPRINTF("unsupported fis type %d\n", ft); return; } - if (fis[2] & ATA_S_ERROR) + if (fis[2] & ATA_S_ERROR) { + p->waitforclear = 1; irq |= AHCI_P_IX_TFE; + } memcpy(p->rfis + offset, fis, len); if (irq) { p->is |= irq; @@ -413,6 +416,7 @@ ahci_check_stopped(struct ahci_port *p) p->cmd &= ~(AHCI_P_CMD_CR | AHCI_P_CMD_CCS_MASK); p->ci = 0; p->sact = 0; + p->waitforclear = 0; } } } @@ -1769,7 +1773,9 @@ ahci_handle_port(struct ahci_port *p) * are already in-flight. Stop if device is busy or in error. */ for (; (p->ci & ~p->pending) != 0; p->ccs = ((p->ccs + 1) & 31)) { - if ((p->tfd & (ATA_S_BUSY | ATA_S_DRQ | ATA_S_ERROR)) != 0) + if ((p->tfd & (ATA_S_BUSY | ATA_S_DRQ)) != 0) + break; + if (p->waitforclear) break; if ((p->ci & ~p->pending & (1 << p->ccs)) != 0) { p->cmd &= ~AHCI_P_CMD_CCS_MASK; @@ -2010,7 +2016,7 @@ pci_ahci_port_write(struct pci_ahci_soft } if (value & AHCI_P_CMD_CLO) { - p->tfd = 0; + p->tfd &= ~(ATA_S_BUSY | ATA_S_DRQ); p->cmd &= ~AHCI_P_CMD_CLO; } From owner-svn-src-head@FreeBSD.ORG Wed May 6 10:00:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26BD59C0; Wed, 6 May 2015 10:00:21 +0000 (UTC) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com [IPv6:2a00:1450:4010:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A546F1E2D; Wed, 6 May 2015 10:00:20 +0000 (UTC) Received: by labbd9 with SMTP id bd9so3497677lab.2; Wed, 06 May 2015 03:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=4wvECfF+R9GUGKjipOuYyLdFCpf/5wUKjZKt5H0jooI=; b=PhE9Ph6Meyb1uzCmaghIvCB3kb3QLwYPw67a+W25hTuguZWaoJN6GyQOasJmlnrtp9 17nBxG7S/VidBRHkdfTbnt8/WdKeGemzMrRgpZMX6umSneeGQETePoztHtcXw1hClN5Y ZMl33LENmNYbVkOWsvmg2PhC8StR7Mm315NFJaylLGvbDpKjpS/ykjYrIsqLQKX7/Xib ykVaGnmuu2Smn9WHu5+WMBN+pIS6CzH+P7KwLQrxH7E4c8zda7VgVjYWJ43FsX2+j8dS EZXKbNfWKO2KreaxGxc2xSXaTpb+cUf+cOZNRJg75de3SJa5Znxc5OIAhUKazHYbwg1q twdA== X-Received: by 10.152.224.164 with SMTP id rd4mr4961835lac.77.1430906418707; Wed, 06 May 2015 03:00:18 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([91.198.175.1]) by mx.google.com with ESMTPSA id xx2sm261304lbb.13.2015.05.06.03.00.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 May 2015 03:00:17 -0700 (PDT) Sender: Alexander Motin Message-ID: <5549E62F.8000508@FreeBSD.org> Date: Wed, 06 May 2015 13:00:15 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Neel Natu CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r282429 - head/usr.sbin/bhyve References: <201505041955.t44Jt28d008533@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:00:21 -0000 On 06.05.2015 08:04, Neel Natu wrote: > Hi Alexander, > > I am getting the following error(?) messages with an ahci-cd device on > Centos 6.4 x86_64: Thanks for the report, r282524 should fix the issue. > On Mon, May 4, 2015 at 12:55 PM, Alexander Motin wrote: >> Author: mav >> Date: Mon May 4 19:55:01 2015 >> New Revision: 282429 >> URL: https://svnweb.freebsd.org/changeset/base/282429 >> >> Log: >> Implement in-order execution of non-NCQ commands. >> >> Using status updates in r282364, block queue on BSY, DRQ or ERR bits set. >> This can be a performance penalization for non-NCQ commands, but it is >> required for proper error recovery and standard compliance. >> >> MFC after: 2 weeks >> >> Modified: >> head/usr.sbin/bhyve/pci_ahci.c -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Wed May 6 10:32:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8CDDF21; Wed, 6 May 2015 10:32: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 A6B5E1246; Wed, 6 May 2015 10:32: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 t46AWSpv011711; Wed, 6 May 2015 10:32:28 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AWRDS011708; Wed, 6 May 2015 10:32:27 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061032.t46AWRDS011708@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282525 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:32:28 -0000 Author: kadesai Date: Wed May 6 10:32:27 2015 New Revision: 282525 URL: https://svnweb.freebsd.org/changeset/base/282525 Log: This patch adds the feature to provide PCI information via IOCTL query. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_ioctl.h Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 09:59:19 2015 (r282524) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:32:27 2015 (r282525) @@ -87,6 +87,8 @@ mrsas_get_ctrl_info(struct mrsas_softc * static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd_to_abort); +static struct mrsas_softc *mrsas_get_softc_instance(struct cdev *dev, + u_long cmd, caddr_t arg); u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset); u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, @@ -1231,6 +1233,39 @@ mrsas_resume(device_t dev) return (0); } +/** + * mrsas_get_softc_instance: Find softc instance based on cmd type + * + * This function will return softc instance based on cmd type. + * In some case, application fire ioctl on required management instance and + * do not provide host_no. Use cdev->si_drv1 to get softc instance for those + * case, else get the softc instance from host_no provided by application in + * user data. + */ + +static struct mrsas_softc * +mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg) +{ + struct mrsas_softc *sc = NULL; + struct mrsas_iocpacket *user_ioc = (struct mrsas_iocpacket *)arg; + if (cmd == MRSAS_IOC_GET_PCI_INFO){ + sc = dev->si_drv1; + } else { + /* get the Host number & the softc from data sent by the Application */ + sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; + if ((user_ioc->host_no >= mrsas_mgmt_info.max_index) || (sc == NULL)) { + if (sc == NULL) + mrsas_dprint(sc, MRSAS_FAULT, + "There is no Controller number %d .\n", user_ioc->host_no); + else + mrsas_dprint(sc, MRSAS_FAULT, + "Invalid Controller number %d .\n", user_ioc->host_no); + } + } + + return sc; +} + /* * mrsas_ioctl: IOCtl commands entry point. * @@ -1243,19 +1278,12 @@ mrsas_ioctl(struct cdev *dev, u_long cmd { struct mrsas_softc *sc; int ret = 0, i = 0; + MRSAS_DRV_PCI_INFORMATION *pciDrvInfo; - struct mrsas_iocpacket *user_ioc = (struct mrsas_iocpacket *)arg; - - /* get the Host number & the softc from data sent by the Application */ - sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; - - if ((mrsas_mgmt_info.max_index == user_ioc->host_no) || (sc == NULL)) { - printf("Please check the controller number\n"); - if (sc == NULL) - printf("There is NO such Host no. %d\n", user_ioc->host_no); - + sc = mrsas_get_softc_instance(dev, cmd, arg); + if (!sc) return ENOENT; - } + if (sc->remove_in_progress) { mrsas_dprint(sc, MRSAS_INFO, "Driver remove or shutdown called.\n"); @@ -1299,6 +1327,22 @@ do_ioctl: case MRSAS_IOC_SCAN_BUS: ret = mrsas_bus_scan(sc); break; + + case MRSAS_IOC_GET_PCI_INFO: + pciDrvInfo = (MRSAS_DRV_PCI_INFORMATION *)arg; + memset (pciDrvInfo, 0, sizeof(MRSAS_DRV_PCI_INFORMATION)); + pciDrvInfo->busNumber = pci_get_bus(sc->mrsas_dev); + pciDrvInfo->deviceNumber = pci_get_slot(sc->mrsas_dev); + pciDrvInfo->functionNumber = pci_get_function(sc->mrsas_dev); + pciDrvInfo->domainID = pci_get_domain(sc->mrsas_dev); + mrsas_dprint (sc, MRSAS_INFO, "pci bus no: %d," + "pci device no: %d, pci function no: %d," + "pci domain ID: %d\n", + pciDrvInfo->busNumber, pciDrvInfo->deviceNumber, + pciDrvInfo->functionNumber, pciDrvInfo->domainID); + ret = 0; + break; + default: mrsas_dprint(sc, MRSAS_TRACE, "IOCTL command 0x%lx is not handled\n", cmd); ret = ENOENT; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 09:59:19 2015 (r282524) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:32:27 2015 (r282525) @@ -2413,6 +2413,167 @@ struct mrsas_mgmt_info { int max_index; }; +#define PCI_TYPE0_ADDRESSES 6 +#define PCI_TYPE1_ADDRESSES 2 +#define PCI_TYPE2_ADDRESSES 5 + +typedef struct _MRSAS_DRV_PCI_COMMON_HEADER +{ + u_int16_t vendorID; // (ro) + u_int16_t deviceID; // (ro) + u_int16_t command; // Device control + u_int16_t status; + u_int8_t revisionID; // (ro) + u_int8_t progIf; // (ro) + u_int8_t subClass; // (ro) + u_int8_t baseClass; // (ro) + u_int8_t cacheLineSize; // (ro+) + u_int8_t latencyTimer; // (ro+) + u_int8_t headerType; // (ro) + u_int8_t bist; // Built in self test + + union + { + struct _MRSAS_DRV_PCI_HEADER_TYPE_0 + { + u_int32_t baseAddresses[PCI_TYPE0_ADDRESSES]; + u_int32_t cis; + u_int16_t subVendorID; + u_int16_t subSystemID; + u_int32_t romBaseAddress; + u_int8_t capabilitiesPtr; + u_int8_t reserved1[3]; + u_int32_t reserved2; + u_int8_t interruptLine; + u_int8_t interruptPin; // (ro) + u_int8_t minimumGrant; // (ro) + u_int8_t maximumLatency; // (ro) + } type0; + + /* + * PCI to PCI Bridge + */ + + struct _MRSAS_DRV_PCI_HEADER_TYPE_1 + { + u_int32_t baseAddresses[PCI_TYPE1_ADDRESSES]; + u_int8_t primaryBus; + u_int8_t secondaryBus; + u_int8_t subordinateBus; + u_int8_t secondaryLatency; + u_int8_t ioBase; + u_int8_t ioLimit; + u_int16_t secondaryStatus; + u_int16_t memoryBase; + u_int16_t memoryLimit; + u_int16_t prefetchBase; + u_int16_t prefetchLimit; + u_int32_t prefetchBaseUpper32; + u_int32_t prefetchLimitUpper32; + u_int16_t ioBaseUpper16; + u_int16_t ioLimitUpper16; + u_int8_t capabilitiesPtr; + u_int8_t reserved1[3]; + u_int32_t romBaseAddress; + u_int8_t interruptLine; + u_int8_t interruptPin; + u_int16_t bridgeControl; + } type1; + + /* + * PCI to CARDBUS Bridge + */ + + struct _MRSAS_DRV_PCI_HEADER_TYPE_2 + { + u_int32_t socketRegistersBaseAddress; + u_int8_t capabilitiesPtr; + u_int8_t reserved; + u_int16_t secondaryStatus; + u_int8_t primaryBus; + u_int8_t secondaryBus; + u_int8_t subordinateBus; + u_int8_t secondaryLatency; + struct + { + u_int32_t base; + u_int32_t limit; + } range[PCI_TYPE2_ADDRESSES-1]; + u_int8_t interruptLine; + u_int8_t interruptPin; + u_int16_t bridgeControl; + } type2; + } u; + +} MRSAS_DRV_PCI_COMMON_HEADER, *PMRSAS_DRV_PCI_COMMON_HEADER; + +#define MRSAS_DRV_PCI_COMMON_HEADER_SIZE sizeof(MRSAS_DRV_PCI_COMMON_HEADER) //64 bytes + +typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY +{ + union + { + struct + { + u_int32_t linkSpeed :4; + u_int32_t linkWidth :6; + u_int32_t aspmSupport :2; + u_int32_t losExitLatency :3; + u_int32_t l1ExitLatency :3; + u_int32_t rsvdp :6; + u_int32_t portNumber :8; + }bits; + + u_int32_t asUlong; + }u; +}MRSAS_DRV_PCI_LINK_CAPABILITY, *PMRSAS_DRV_PCI_LINK_CAPABILITY; + +#define MRSAS_DRV_PCI_LINK_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_CAPABILITY) + +typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY +{ + union + { + struct + { + u_int16_t linkSpeed :4; + u_int16_t negotiatedLinkWidth :6; + u_int16_t linkTrainingError :1; + u_int16_t linkTraning :1; + u_int16_t slotClockConfig :1; + u_int16_t rsvdZ :3; + }bits; + + u_int16_t asUshort; + }u; + u_int16_t reserved; +} MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY, *PMRSAS_DRV_PCI_LINK_STATUS_CAPABILITY; + +#define MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY) + + +typedef struct _MRSAS_DRV_PCI_CAPABILITIES +{ + MRSAS_DRV_PCI_LINK_CAPABILITY linkCapability; + MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY linkStatusCapability; +}MRSAS_DRV_PCI_CAPABILITIES, *PMRSAS_DRV_PCI_CAPABILITIES; + +#define MRSAS_DRV_PCI_CAPABILITIES_SIZE sizeof(MRSAS_DRV_PCI_CAPABILITIES) + +/* PCI information */ +typedef struct _MRSAS_DRV_PCI_INFORMATION +{ + u_int32_t busNumber; + u_int8_t deviceNumber; + u_int8_t functionNumber; + u_int8_t interruptVector; + u_int8_t reserved1; + MRSAS_DRV_PCI_COMMON_HEADER pciHeaderInfo; + MRSAS_DRV_PCI_CAPABILITIES capability; + u_int32_t domainID; + u_int8_t reserved2[28]; +}MRSAS_DRV_PCI_INFORMATION, *PMRSAS_DRV_PCI_INFORMATION; + /******************************************************************* * per-instance data ********************************************************************/ Modified: head/sys/dev/mrsas/mrsas_ioctl.h ============================================================================== --- head/sys/dev/mrsas/mrsas_ioctl.h Wed May 6 09:59:19 2015 (r282524) +++ head/sys/dev/mrsas/mrsas_ioctl.h Wed May 6 10:32:27 2015 (r282525) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); * into a somewhat unique, 32-bit value. */ +#define MRSAS_IOC_GET_PCI_INFO _IOR('M', 7, MRSAS_DRV_PCI_INFORMATION) #define MRSAS_IOC_FIRMWARE_PASS_THROUGH64 _IOWR('M', 1, struct mrsas_iocpacket) #ifdef COMPAT_FREEBSD32 #define MRSAS_IOC_FIRMWARE_PASS_THROUGH32 _IOWR('M', 1, struct mrsas_iocpacket32) From owner-svn-src-head@FreeBSD.ORG Wed May 6 10:36:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 996151DF; Wed, 6 May 2015 10:36: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 86F761280; Wed, 6 May 2015 10:36: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 t46AasKt012361; Wed, 6 May 2015 10:36:54 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46Aar4o012358; Wed, 6 May 2015 10:36:53 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061036.t46Aar4o012358@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282526 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:36:54 -0000 Author: kadesai Date: Wed May 6 10:36:53 2015 New Revision: 282526 URL: https://svnweb.freebsd.org/changeset/base/282526 Log: Now Driver expose Secure Jbod Support via driver_operations in MFI INIT Frame. FW expose Secure Jbod support via Controller properity. Firmware expect IOs to be received from different IO path than conventional fast path queue, in case of SED drives. To have Secure jbod support user need driver and firmware support. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:32:27 2015 (r282525) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:36:53 2015 (r282526) @@ -2095,6 +2095,12 @@ mrsas_init_fw(struct mrsas_softc *sc) if (mrsas_get_ctrl_info(sc, ctrl_info)) { device_printf(sc->mrsas_dev, "Unable to get FW ctrl_info.\n"); } + sc->secure_jbod_support = + (u_int8_t) ctrl_info->adapterOperations3.supportSecurityonJBOD; + + if (sc->secure_jbod_support) + device_printf(sc->mrsas_dev, "FW supports SED \n"); + sc->max256vdSupport = (u_int8_t)ctrl_info->adapterOperations3.supportMaxExtLDs; @@ -2326,6 +2332,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->driver_ver_hi = 0; } init_frame->driver_operations.mfi_capabilities.support_max_255lds = 1; + init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; init_frame->queue_info_new_phys_addr_lo = phys_addr; init_frame->data_xfer_len = sizeof(Mpi2IOCInitRequest_t); Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:32:27 2015 (r282525) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:36:53 2015 (r282526) @@ -1315,6 +1315,13 @@ typedef enum _REGION_TYPE { #define MRSAS_REQ_STATE_TRAN 2 #define MRSAS_REQ_STATE_COMPLETE 3 +typedef enum _MR_SCSI_CMD_TYPE { + READ_WRITE_LDIO = 0, + NON_READ_WRITE_LDIO = 1, + READ_WRITE_SYSPDIO = 2, + NON_READ_WRITE_SYSPDIO = 3, +} MR_SCSI_CMD_TYPE; + enum mrsas_req_flags { MRSAS_DIR_UNKNOWN = 0x1, MRSAS_DIR_IN = 0x2, @@ -1897,10 +1904,27 @@ struct mrsas_ctrl_info { char reserved6[4]; /* 0x7E4 RESERVED FOR IOV */ struct { /* 0x7E8 */ - u_int32_t resrved:5; - u_int32_t supportMaxExtLDs:1; - u_int32_t reserved1:26; - } adapterOperations3; + u_int32_t supportPersonalityChange:2; + u_int32_t supportThermalPollInterval:1; + u_int32_t supportDisableImmediateIO:1; + u_int32_t supportT10RebuildAssist:1; + u_int32_t supportMaxExtLDs:1; + u_int32_t supportCrashDump:1; + u_int32_t supportSwZone:1; + u_int32_t supportDebugQueue:1; + u_int32_t supportNVCacheErase:1; + u_int32_t supportForceTo512e:1; + u_int32_t supportHOQRebuild:1; + u_int32_t supportAllowedOpsforDrvRemoval:1; + u_int32_t supportDrvActivityLEDSetting:1; + u_int32_t supportNVDRAM:1; + u_int32_t supportForceFlash:1; + u_int32_t supportDisableSESMonitoring:1; + u_int32_t supportCacheBypassModes:1; + u_int32_t supportSecurityonJBOD:1; + u_int32_t discardCacheDuringLDDelete:1; + u_int32_t reserved:12; + } adapterOperations3; u_int8_t pad[0x800 - 0x7EC]; /* 0x7EC */ } __packed; @@ -1970,8 +1994,11 @@ typedef union _MFI_CAPABILITIES { u_int32_t support_additional_msix:1; u_int32_t support_fastpath_wb:1; u_int32_t support_max_255lds:1; - u_int32_t reserved:28; - } mfi_capabilities; + u_int32_t support_ndrive_r1_lb:1; + u_int32_t support_core_affinity:1; + u_int32_t security_protocol_cmds_fw:1; + u_int32_t reserved:25; + } mfi_capabilities; u_int32_t reg; } MFI_CAPABILITIES; @@ -2710,6 +2737,7 @@ struct mrsas_softc { LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES_EXT]; LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; + u_int8_t secure_jbod_support; u_int8_t max256vdSupport; u_int16_t fw_supported_vd_count; u_int16_t fw_supported_pd_count; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:32:27 2015 (r282525) +++ head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:36:53 2015 (r282526) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); * Function prototypes */ int mrsas_cam_attach(struct mrsas_softc *sc); -int mrsas_ldio_inq(struct cam_sim *sim, union ccb *ccb); +int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb); int mrsas_bus_scan(struct mrsas_softc *sc); int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); int mrsas_map_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); @@ -499,7 +499,9 @@ mrsas_startio(struct mrsas_softc *sc, st bcopy(csio->cdb_io.cdb_bytes, cmd->io_request->CDB.CDB32, csio->cdb_len); mtx_lock(&sc->raidmap_lock); - if (mrsas_ldio_inq(sim, ccb)) { + /* Check for IO type READ-WRITE targeted for Logical Volume */ + if (mrsas_find_io_type(sim, ccb) == READ_WRITE_LDIO) { + /* Build READ-WRITE IO for Logical Volume */ if (mrsas_build_ldio(sc, cmd, ccb)) { device_printf(sc->mrsas_dev, "Build LDIO failed.\n"); mtx_unlock(&sc->raidmap_lock); @@ -546,20 +548,16 @@ done: } /* - * mrsas_ldio_inq: Determines if IO is read/write or inquiry + * mrsas_find_io_type: Determines if IO is read/write or inquiry * input: pointer to CAM Control Block * * This function determines if the IO is read/write or inquiry. It returns a 1 * if the IO is read/write and 0 if it is inquiry. */ -int -mrsas_ldio_inq(struct cam_sim *sim, union ccb *ccb) +int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb) { struct ccb_scsiio *csio = &(ccb->csio); - if (cam_sim_bus(sim) == 1) - return (0); - switch (csio->cdb_io.cdb_bytes[0]) { case READ_10: case WRITE_10: @@ -569,9 +567,11 @@ mrsas_ldio_inq(struct cam_sim *sim, unio case WRITE_6: case READ_16: case WRITE_16: - return 1; + return (cam_sim_bus(sim) ? + READ_WRITE_SYSPDIO : READ_WRITE_LDIO); default: - return 0; + return (cam_sim_bus(sim) ? + NON_READ_WRITE_SYSPDIO : NON_READ_WRITE_LDIO); } } @@ -876,35 +876,54 @@ mrsas_build_dcdb(struct mrsas_softc *sc, device_id = ccb_h->target_id; map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; - /* Check if this is for system PD */ + /* + * Check if this is RW for system PD or + * it's a NON RW for sys PD and there is NO secure jbod FW support + */ if (cam_sim_bus(sim) == 1 && - sc->pd_list[device_id].driveState == MR_PD_STATE_SYSTEM) { - io_request->Function = 0; - io_request->DevHandle = map_ptr->raidMap.devHndlInfo[device_id]. - curDevHdl; - io_request->RaidContext.timeoutValue = map_ptr->raidMap.fpPdIoTimeoutSec; - io_request->RaidContext.regLockFlags = 0; - io_request->RaidContext.regLockRowLBA = 0; - io_request->RaidContext.regLockLength = 0; + sc->pd_list[device_id].driveState == MR_PD_STATE_SYSTEM){ - io_request->RaidContext.RAIDFlags = MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD - << MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) - io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; - cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << - MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - cmd->request_desc->SCSIIO.DevHandle = - map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; + io_request->DevHandle = + map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; + io_request->RaidContext.RAIDFlags = + MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD << + MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; + cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; cmd->request_desc->SCSIIO.MSIxIndex = - sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; + sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; + + if(sc->secure_jbod_support && (mrsas_find_io_type(sim, ccb) == NON_READ_WRITE_SYSPDIO)) { + /* system pd firmware path */ + io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; + cmd->request_desc->SCSIIO.RequestFlags = + (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + } else { + /* system pd fast path */ + io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; + io_request->RaidContext.timeoutValue = map_ptr->raidMap.fpPdIoTimeoutSec; + io_request->RaidContext.regLockFlags = 0; + io_request->RaidContext.regLockRowLBA = 0; + io_request->RaidContext.regLockLength = 0; + + cmd->request_desc->SCSIIO.RequestFlags = + (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + /* + * NOTE - For system pd RW cmds only IoFlags will be FAST_PATH + * Because the NON RW cmds will now go via FW Queue + * and not the Exception queue + */ + if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) + io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; + } } else { - io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; + /* FW path for SysPD or LD Non-RW (SCSI management commands)*/ + io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; io_request->DevHandle = device_id; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << - MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); } io_request->RaidContext.VirtualDiskTgtId = device_id; From owner-svn-src-head@FreeBSD.ORG Wed May 6 10:41:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A362D3B7; Wed, 6 May 2015 10:41: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 9113C1362; Wed, 6 May 2015 10:41: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 t46AfTre015896; Wed, 6 May 2015 10:41:29 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AfSHm015890; Wed, 6 May 2015 10:41:28 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061041.t46AfSHm015890@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282527 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:41:29 -0000 Author: kadesai Date: Wed May 6 10:41:27 2015 New Revision: 282527 URL: https://svnweb.freebsd.org/changeset/base/282527 Log: Current driver does fast path read load balancing between arm and mirror disk for two Drive Raid-1 configuration only. Now, Driver support fast path read load balancing for all (any number of disk) Raid-1 configuration. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:36:53 2015 (r282526) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:41:27 2015 (r282527) @@ -462,6 +462,11 @@ mrsas_get_tunables(struct mrsas_softc *s */ TUNABLE_INT_FETCH("hw.mrsas.debug_level", &sc->mrsas_debug); + /* + * Grab the global variables. + */ + TUNABLE_INT_FETCH("hw.mrsas.lb_pending_cmds", &sc->lb_pending_cmds); + /* Grab the unit-instance variables */ snprintf(tmpstr, sizeof(tmpstr), "dev.mrsas.%d.debug_level", device_get_unit(sc->mrsas_dev)); @@ -1468,7 +1473,7 @@ mrsas_complete_cmd(struct mrsas_softc *s MRSAS_RAID_SCSI_IO_REQUEST *scsi_io_req; struct mrsas_mpt_cmd *cmd_mpt; struct mrsas_mfi_cmd *cmd_mfi; - u_int8_t arm, reply_descript_type; + u_int8_t reply_descript_type; u_int16_t smid, num_completed; u_int8_t status, extStatus; union desc_value desc_val; @@ -1506,8 +1511,7 @@ mrsas_complete_cmd(struct mrsas_softc *s device_id = cmd_mpt->ccb_ptr->ccb_h.target_id; lbinfo = &sc->load_balance_info[device_id]; if (cmd_mpt->load_balance == MRSAS_LOAD_BALANCE_FLAG) { - arm = lbinfo->raid1DevHandle[0] == scsi_io_req->DevHandle ? 0 : 1; - mrsas_atomic_dec(&lbinfo->scsi_pending_cmds[arm]); + mrsas_atomic_dec(&lbinfo->scsi_pending_cmds[cmd_mpt->pd_r1_lb]); cmd_mpt->load_balance &= ~MRSAS_LOAD_BALANCE_FLAG; } /* Fall thru and complete IO */ @@ -2331,6 +2335,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->driver_ver_lo = (bus_addr_t)sc->verbuf_phys_addr; init_frame->driver_ver_hi = 0; } + init_frame->driver_operations.mfi_capabilities.support_ndrive_r1_lb = 1; init_frame->driver_operations.mfi_capabilities.support_max_255lds = 1; init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:36:53 2015 (r282526) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:41:27 2015 (r282527) @@ -813,9 +813,8 @@ typedef struct _MR_DRV_RAID_MAP_ALL { typedef struct _LD_LOAD_BALANCE_INFO { u_int8_t loadBalanceFlag; u_int8_t reserved1; - u_int16_t raid1DevHandle[2]; - mrsas_atomic_t scsi_pending_cmds[2]; - u_int64_t last_accessed_block[2]; + mrsas_atomic_t scsi_pending_cmds[MAX_PHYSICAL_DEVICES]; + u_int64_t last_accessed_block[MAX_PHYSICAL_DEVICES]; } LD_LOAD_BALANCE_INFO, *PLD_LOAD_BALANCE_INFO; /* SPAN_SET is info caclulated from span info from Raid map per ld */ @@ -858,6 +857,9 @@ struct IO_REQUEST_INFO { u_int8_t start_span; u_int8_t reserved; u_int64_t start_row; + /* span[7:5], arm[4:0] */ + u_int8_t span_arm; + u_int8_t pd_after_lb; }; typedef struct _MR_LD_TARGET_SYNC { @@ -1357,6 +1359,7 @@ struct mrsas_mpt_cmd { u_int32_t sync_cmd_idx; u_int32_t index; u_int8_t flags; + u_int8_t pd_r1_lb; u_int8_t load_balance; bus_size_t length; u_int32_t error_code; @@ -2734,6 +2737,7 @@ struct mrsas_softc { struct task ev_task; u_int32_t CurLdCount; u_int64_t reset_flags; + int lb_pending_cmds; LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES_EXT]; LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:36:53 2015 (r282526) +++ head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:41:27 2015 (r282527) @@ -112,9 +112,8 @@ MR_BuildRaidContext(struct mrsas_softc * extern u_int16_t MR_LdSpanArrayGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); -extern u_int16_t -mrsas_get_updated_dev_handle(PLD_LOAD_BALANCE_INFO lbInfo, - struct IO_REQUEST_INFO *io_info); +extern u_int16_t mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); extern u_int8_t megasas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, u_int64_t block, u_int32_t count); @@ -824,9 +823,10 @@ mrsas_setup_io(struct mrsas_softc *sc, s if ((sc->load_balance_info[device_id].loadBalanceFlag) && (io_info.isRead)) { io_info.devHandle = - mrsas_get_updated_dev_handle(&sc->load_balance_info[device_id], - &io_info); + mrsas_get_updated_dev_handle(sc, + &sc->load_balance_info[device_id], &io_info); cmd->load_balance = MRSAS_LOAD_BALANCE_FLAG; + cmd->pd_r1_lb = io_info.pd_after_lb; } else cmd->load_balance = 0; cmd->request_desc->SCSIIO.DevHandle = io_info.devHandle; Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:36:53 2015 (r282526) +++ head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:41:27 2015 (r282527) @@ -54,9 +54,8 @@ __FBSDID("$FreeBSD$"); * Function prototypes */ u_int8_t MR_ValidateMapInfo(struct mrsas_softc *sc); -u_int8_t -mrsas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, - u_int64_t block, u_int32_t count); +u_int8_t mrsas_get_best_arm_pd(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); u_int8_t MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_REQUEST_INFO *io_info, @@ -69,17 +68,15 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int16_t MR_TargetIdToLdGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); u_int32_t MR_LdBlockSizeGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); u_int16_t MR_GetLDTgtId(u_int32_t ld, MR_DRV_RAID_MAP_ALL * map); -u_int16_t -mrsas_get_updated_dev_handle(PLD_LOAD_BALANCE_INFO lbInfo, - struct IO_REQUEST_INFO *io_info); +u_int16_t mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); u_int32_t mega_mod64(u_int64_t dividend, u_int32_t divisor); u_int32_t MR_GetSpanBlock(u_int32_t ld, u_int64_t row, u_int64_t *span_blk, MR_DRV_RAID_MAP_ALL * map, int *div_error); u_int64_t mega_div64_32(u_int64_t dividend, u_int32_t divisor); -void -mrsas_update_load_balance_params(MR_DRV_RAID_MAP_ALL * map, - PLD_LOAD_BALANCE_INFO lbInfo); +void mrsas_update_load_balance_params(struct mrsas_softc *sc, + MR_DRV_RAID_MAP_ALL *map, PLD_LOAD_BALANCE_INFO lbInfo); void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, struct IO_REQUEST_INFO *io_info, union ccb *ccb, @@ -146,6 +143,8 @@ typedef u_int32_t REGION_LEN; #define FALSE 0 #define TRUE 1 +#define LB_PENDING_CMDS_DEFAULT 4 + /* * Related Macros @@ -379,7 +378,7 @@ MR_ValidateMapInfo(struct mrsas_softc *s printf("Updating span set\n\n"); mr_update_span_set(drv_map, ldSpanInfo); } - mrsas_update_load_balance_params(drv_map, sc->load_balance_info); + mrsas_update_load_balance_params(sc, drv_map, sc->load_balance_info); return 0; } @@ -723,9 +722,11 @@ get_arm(struct mrsas_softc *sc, u_int32_ * This routine calculates the arm, span and block for the specified stripe and * reference in stripe using spanset * - * Inputs : Logical drive number - * stripRow: Stripe number - * stripRef: Reference in stripe + * Inputs : + * sc - HBA instance + * ld - Logical drive number + * stripRow: Stripe number + * stripRef: Reference in stripe * * Outputs : span - Span number block - Absolute Block * number in the physical disk @@ -785,6 +786,7 @@ mr_spanset_get_phy_params(struct mrsas_s *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; pRAID_Context->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; + io_info->span_arm = pRAID_Context->spanArm; return retval; } @@ -1097,46 +1099,39 @@ mr_update_span_set(MR_DRV_RAID_MAP_ALL * /* * mrsas_update_load_balance_params: Update load balance parmas - * Inputs: map pointer - * Load balance info + * Inputs: + * sc - driver softc instance + * drv_map - driver RAID map + * lbInfo - Load balance info * * This function updates the load balance parameters for the LD config of a two * drive optimal RAID-1. */ void -mrsas_update_load_balance_params(MR_DRV_RAID_MAP_ALL * map, - PLD_LOAD_BALANCE_INFO lbInfo) +mrsas_update_load_balance_params(struct mrsas_softc *sc, + MR_DRV_RAID_MAP_ALL * drv_map, PLD_LOAD_BALANCE_INFO lbInfo) { int ldCount; u_int16_t ld; - u_int32_t pd, arRef; MR_LD_RAID *raid; - for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES; ldCount++) { - ld = MR_TargetIdToLdGet(ldCount, map); - if (ld >= MAX_LOGICAL_DRIVES) { + if(sc->lb_pending_cmds > 128 || sc->lb_pending_cmds < 1) + sc-> lb_pending_cmds = LB_PENDING_CMDS_DEFAULT; + + for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES_EXT; ldCount++) { + ld = MR_TargetIdToLdGet(ldCount, drv_map); + if (ld >= MAX_LOGICAL_DRIVES_EXT) { lbInfo[ldCount].loadBalanceFlag = 0; continue; } - raid = MR_LdRaidGet(ld, map); - /* Two drive Optimal RAID 1 */ - if ((raid->level == 1) && (raid->rowSize == 2) && - (raid->spanDepth == 1) - && raid->ldState == MR_LD_STATE_OPTIMAL) { - lbInfo[ldCount].loadBalanceFlag = 1; - - /* Get the array on which this span is present */ - arRef = MR_LdSpanArrayGet(ld, 0, map); - - /* Get the PD */ - pd = MR_ArPdGet(arRef, 0, map); - /* Get dev handle from PD */ - lbInfo[ldCount].raid1DevHandle[0] = MR_PdDevHandleGet(pd, map); - pd = MR_ArPdGet(arRef, 1, map); - lbInfo[ldCount].raid1DevHandle[1] = MR_PdDevHandleGet(pd, map); - } else + raid = MR_LdRaidGet(ld, drv_map); + if ((raid->level != 1) || + (raid->ldState != MR_LD_STATE_OPTIMAL)) { lbInfo[ldCount].loadBalanceFlag = 0; + continue; + } + lbInfo[ldCount].loadBalanceFlag = 1; } } @@ -1332,57 +1327,92 @@ mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQU } /* - * mrsas_get_best_arm: Determine the best spindle arm - * Inputs: Load balance info + * mrsas_get_best_arm_pd: Determine the best spindle arm + * Inputs: + * sc - HBA instance + * lbInfo - Load balance info + * io_info - IO request info * * This function determines and returns the best arm by looking at the * parameters of the last PD access. */ -u_int8_t -mrsas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, - u_int64_t block, u_int32_t count) +u_int8_t mrsas_get_best_arm_pd(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info) { - u_int16_t pend0, pend1; + MR_LD_RAID *raid; + MR_DRV_RAID_MAP_ALL *drv_map; + u_int16_t pend0, pend1, ld; u_int64_t diff0, diff1; - u_int8_t bestArm; + u_int8_t bestArm, pd0, pd1, span, arm; + u_int32_t arRef, span_row_size; + + u_int64_t block = io_info->ldStartBlock; + u_int32_t count = io_info->numBlocks; + + span = ((io_info->span_arm & RAID_CTX_SPANARM_SPAN_MASK) + >> RAID_CTX_SPANARM_SPAN_SHIFT); + arm = (io_info->span_arm & RAID_CTX_SPANARM_ARM_MASK); + + drv_map = sc->ld_drv_map[(sc->map_id & 1)]; + ld = MR_TargetIdToLdGet(io_info->ldTgtId, drv_map); + raid = MR_LdRaidGet(ld, drv_map); + span_row_size = sc->UnevenSpanSupport ? + SPAN_ROW_SIZE(drv_map, ld, span) : raid->rowSize; + + arRef = MR_LdSpanArrayGet(ld, span, drv_map); + pd0 = MR_ArPdGet(arRef, arm, drv_map); + pd1 = MR_ArPdGet(arRef, (arm + 1) >= span_row_size ? + (arm + 1 - span_row_size): arm + 1, drv_map); /* get the pending cmds for the data and mirror arms */ - pend0 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[0]); - pend1 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[1]); + pend0 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[pd0]); + pend1 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[pd1]); /* Determine the disk whose head is nearer to the req. block */ - diff0 = ABS_DIFF(block, lbInfo->last_accessed_block[0]); - diff1 = ABS_DIFF(block, lbInfo->last_accessed_block[1]); - bestArm = (diff0 <= diff1 ? 0 : 1); + diff0 = ABS_DIFF(block, lbInfo->last_accessed_block[pd0]); + diff1 = ABS_DIFF(block, lbInfo->last_accessed_block[pd1]); + bestArm = (diff0 <= diff1 ? arm : arm ^ 1); - if ((bestArm == arm && pend0 > pend1 + 16) || (bestArm != arm && pend1 > pend0 + 16)) + if ((bestArm == arm && pend0 > pend1 + sc->lb_pending_cmds) || + (bestArm != arm && pend1 > pend0 + sc->lb_pending_cmds)) bestArm ^= 1; /* Update the last accessed block on the correct pd */ - lbInfo->last_accessed_block[bestArm] = block + count - 1; + lbInfo->last_accessed_block[bestArm==arm ? pd0 : pd1] = block + count - 1; + io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | bestArm; + io_info->pd_after_lb = (bestArm == arm) ? pd0:pd1; +#if SPAN_DEBUG + if(arm != bestArm) + printf("LSI Debug R1 Load balance occur - span 0x%x arm 0x%x bestArm 0x%x " + "io_info->span_arm 0x%x\n", + span, arm, bestArm, io_info->span_arm); +#endif - return bestArm; + return io_info->pd_after_lb; } /* * mrsas_get_updated_dev_handle: Get the update dev handle - * Inputs: Load balance info io_info pointer + * Inputs: + * sc - Adapter instance soft state + * lbInfo - Load balance info + * io_info - io_info pointer * * This function determines and returns the updated dev handle. */ -u_int16_t -mrsas_get_updated_dev_handle(PLD_LOAD_BALANCE_INFO lbInfo, - struct IO_REQUEST_INFO *io_info) +u_int16_t mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info) { - u_int8_t arm, old_arm; + u_int8_t arm_pd; u_int16_t devHandle; + MR_DRV_RAID_MAP_ALL *drv_map; - old_arm = lbInfo->raid1DevHandle[0] == io_info->devHandle ? 0 : 1; + drv_map = sc->ld_drv_map[(sc->map_id & 1)]; /* get best new arm */ - arm = mrsas_get_best_arm(lbInfo, old_arm, io_info->ldStartBlock, io_info->numBlocks); - devHandle = lbInfo->raid1DevHandle[arm]; - mrsas_atomic_inc(&lbInfo->scsi_pending_cmds[arm]); + arm_pd = mrsas_get_best_arm_pd(sc, lbInfo, io_info); + devHandle = MR_PdDevHandleGet(arm_pd, drv_map); + mrsas_atomic_inc(&lbInfo->scsi_pending_cmds[arm_pd]); return devHandle; } @@ -1471,6 +1501,7 @@ MR_GetPhyParams(struct mrsas_softc *sc, *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; pRAID_Context->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; + io_info->span_arm = pRAID_Context->spanArm; return retval; } From owner-svn-src-head@FreeBSD.ORG Wed May 6 10:42:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3D07517; Wed, 6 May 2015 10:42:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1B4C136E; Wed, 6 May 2015 10:42:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t46AgjNQ016760; Wed, 6 May 2015 10:42:45 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46Agjxr016757; Wed, 6 May 2015 10:42:45 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061042.t46Agjxr016757@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282528 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:42:46 -0000 Author: kadesai Date: Wed May 6 10:42:44 2015 New Revision: 282528 URL: https://svnweb.freebsd.org/changeset/base/282528 Log: In OCR(Online Controller Reset) path, driver sets adapter state to MEGASAS_HBA_OPERATIONAL before getting new RAID map. There will be a small window where IO will come from OS with old RAID map. This patch will update adapter state to MEGASAS_HBA_OPERATIONAL, only after driver has new RAID map to avoid any IOs getting build using old RAID map. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:41:27 2015 (r282527) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:42:44 2015 (r282528) @@ -81,9 +81,8 @@ static int mrsas_init_fw(struct mrsas_so static int mrsas_setup_raidmap(struct mrsas_softc *sc); static int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); static int mrsas_clear_intr(struct mrsas_softc *sc); -static int -mrsas_get_ctrl_info(struct mrsas_softc *sc, - struct mrsas_ctrl_info *ctrl_info); +static int mrsas_get_ctrl_info(struct mrsas_softc *sc); +static void mrsas_update_ext_vd_details(struct mrsas_softc *sc); static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd_to_abort); @@ -1170,6 +1169,12 @@ mrsas_free_mem(struct mrsas_softc *sc) */ if (sc->mrsas_parent_tag != NULL) bus_dma_tag_destroy(sc->mrsas_parent_tag); + + /* + * Free ctrl_info memory + */ + if (sc->ctrl_info != NULL) + free(sc->ctrl_info, M_MRSAS); } /* @@ -1909,34 +1914,6 @@ mrsas_setup_raidmap(struct mrsas_softc * { int i; - sc->drv_supported_vd_count = - MRSAS_MAX_LD_CHANNELS * MRSAS_MAX_DEV_PER_CHANNEL; - sc->drv_supported_pd_count = - MRSAS_MAX_PD_CHANNELS * MRSAS_MAX_DEV_PER_CHANNEL; - - if (sc->max256vdSupport) { - sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES_EXT; - sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; - } else { - sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES; - sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; - } - -#if VD_EXT_DEBUG - device_printf(sc->mrsas_dev, "FW supports: max256vdSupport = %s\n", - sc->max256vdSupport ? "YES" : "NO"); - device_printf(sc->mrsas_dev, "FW supports %dVDs %dPDs\n" - "DRIVER supports %dVDs %dPDs \n", - sc->fw_supported_vd_count, sc->fw_supported_pd_count, - sc->drv_supported_vd_count, sc->drv_supported_pd_count); -#endif - - sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * (sc->fw_supported_vd_count - 1)); - sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); - sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * (sc->drv_supported_vd_count - 1)); - for (i = 0; i < 2; i++) { sc->ld_drv_map[i] = (void *)malloc(sc->drv_map_sz, M_MRSAS, M_NOWAIT); @@ -1951,14 +1928,6 @@ mrsas_setup_raidmap(struct mrsas_softc * } } - sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); - - if (sc->max256vdSupport) - sc->current_map_sz = sc->new_map_sz; - else - sc->current_map_sz = sc->old_map_sz; - - for (int i = 0; i < 2; i++) { if (bus_dma_tag_create(sc->mrsas_parent_tag, 4, 0, @@ -2026,7 +1995,6 @@ mrsas_init_fw(struct mrsas_softc *sc) u_int32_t max_sectors_1; u_int32_t max_sectors_2; u_int32_t tmp_sectors; - struct mrsas_ctrl_info *ctrl_info; u_int32_t scratch_pad_2; int msix_enable = 0; int fw_msix_count = 0; @@ -2088,29 +2056,26 @@ mrsas_init_fw(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Allocate MFI cmd failed.\n"); return (1); } + + sc->ctrl_info = malloc(sizeof(struct mrsas_ctrl_info), M_MRSAS, M_NOWAIT); + if (!sc->ctrl_info) { + device_printf(sc->mrsas_dev, "Malloc for ctrl_info failed.\n"); + return(1); + } /* * Get the controller info from FW, so that the MAX VD support * availability can be decided. */ - ctrl_info = malloc(sizeof(struct mrsas_ctrl_info), M_MRSAS, M_NOWAIT); - if (!ctrl_info) - device_printf(sc->mrsas_dev, "Malloc for ctrl_info failed.\n"); - - if (mrsas_get_ctrl_info(sc, ctrl_info)) { + if (mrsas_get_ctrl_info(sc)) { device_printf(sc->mrsas_dev, "Unable to get FW ctrl_info.\n"); + return(1); } sc->secure_jbod_support = - (u_int8_t) ctrl_info->adapterOperations3.supportSecurityonJBOD; + (u_int8_t) sc->ctrl_info->adapterOperations3.supportSecurityonJBOD; if (sc->secure_jbod_support) device_printf(sc->mrsas_dev, "FW supports SED \n"); - sc->max256vdSupport = - (u_int8_t)ctrl_info->adapterOperations3.supportMaxExtLDs; - - if (ctrl_info->max_lds > 64) { - sc->max256vdSupport = 1; - } if (mrsas_setup_raidmap(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Set up RAID map failed.\n"); return (1); @@ -2134,9 +2099,9 @@ mrsas_init_fw(struct mrsas_softc *sc) * calculate max_sectors_1. So the number ended up as zero always. */ tmp_sectors = 0; - max_sectors_1 = (1 << ctrl_info->stripe_sz_ops.min) * - ctrl_info->max_strips_per_io; - max_sectors_2 = ctrl_info->max_request_size; + max_sectors_1 = (1 << sc->ctrl_info->stripe_sz_ops.min) * + sc->ctrl_info->max_strips_per_io; + max_sectors_2 = sc->ctrl_info->max_request_size; tmp_sectors = min(max_sectors_1, max_sectors_2); sc->max_sectors_per_req = sc->max_num_sge * MRSAS_PAGE_SIZE / 512; @@ -2144,9 +2109,9 @@ mrsas_init_fw(struct mrsas_softc *sc) sc->max_sectors_per_req = tmp_sectors; sc->disableOnlineCtrlReset = - ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; + sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; sc->UnevenSpanSupport = - ctrl_info->adapterOperations2.supportUnevenSpans; + sc->ctrl_info->adapterOperations2.supportUnevenSpans; if (sc->UnevenSpanSupport) { device_printf(sc->mrsas_dev, "FW supports: UnevenSpanSupport=%x\n\n", sc->UnevenSpanSupport); @@ -2156,8 +2121,6 @@ mrsas_init_fw(struct mrsas_softc *sc) else sc->fast_path_io = 0; } - if (ctrl_info) - free(ctrl_info, M_MRSAS); return (0); } @@ -2877,6 +2840,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) memset(sc->load_balance_info, 0, sizeof(LD_LOAD_BALANCE_INFO) * MAX_LOGICAL_DRIVES_EXT); + if (mrsas_get_ctrl_info(sc)) { + sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; + mrsas_kill_hba(sc); + retval = -1; + } + if (!mrsas_get_map_info(sc)) mrsas_sync_map_info(sc); @@ -3001,8 +2970,7 @@ mrsas_release_mfi_cmd(struct mrsas_mfi_c * supported by the FW. */ static int -mrsas_get_ctrl_info(struct mrsas_softc *sc, - struct mrsas_ctrl_info *ctrl_info) +mrsas_get_ctrl_info(struct mrsas_softc *sc) { int retcode = 0; struct mrsas_mfi_cmd *cmd; @@ -3035,16 +3003,59 @@ mrsas_get_ctrl_info(struct mrsas_softc * dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); if (!mrsas_issue_polled(sc, cmd)) - memcpy(ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); + memcpy(sc->ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); else retcode = 1; + mrsas_update_ext_vd_details(sc); + mrsas_free_ctlr_info_cmd(sc); mrsas_release_mfi_cmd(cmd); return (retcode); } /* + * mrsas_update_ext_vd_details : Update details w.r.t Extended VD + * input: + * sc - Controller's softc +*/ +static void mrsas_update_ext_vd_details(struct mrsas_softc *sc) +{ + sc->max256vdSupport = + sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + /* Below is additional check to address future FW enhancement */ + if (sc->ctrl_info->max_lds > 64) + sc->max256vdSupport = 1; + + sc->drv_supported_vd_count = MRSAS_MAX_LD_CHANNELS + * MRSAS_MAX_DEV_PER_CHANNEL; + sc->drv_supported_pd_count = MRSAS_MAX_PD_CHANNELS + * MRSAS_MAX_DEV_PER_CHANNEL; + if (sc->max256vdSupport) { + sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES_EXT; + sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; + } else { + sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES; + sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; + } + + sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * + (sc->fw_supported_vd_count - 1)); + sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); + sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * + (sc->drv_supported_vd_count - 1)); + + sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); + + if (sc->max256vdSupport) + sc->current_map_sz = sc->new_map_sz; + else + sc->current_map_sz = sc->old_map_sz; +} + +/* * mrsas_alloc_ctlr_info_cmd: Allocates memory for controller info command * input: Adapter soft state * Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:41:27 2015 (r282527) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:42:44 2015 (r282528) @@ -2710,6 +2710,7 @@ struct mrsas_softc { bus_dmamap_t evt_detail_dmamap; struct mrsas_evt_detail *evt_detail_mem; bus_addr_t evt_detail_phys_addr; + struct mrsas_ctrl_info *ctrl_info; bus_dma_tag_t ctlr_info_tag; bus_dmamap_t ctlr_info_dmamap; void *ctlr_info_mem; From owner-svn-src-head@FreeBSD.ORG Wed May 6 10:43:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB9A065A; Wed, 6 May 2015 10:43: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 AD0131371; Wed, 6 May 2015 10:43: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 t46AhK27016895; Wed, 6 May 2015 10:43:20 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AhKkB016894; Wed, 6 May 2015 10:43:20 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061043.t46AhKkB016894@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282529 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:43:21 -0000 Author: kadesai Date: Wed May 6 10:43:19 2015 New Revision: 282529 URL: https://svnweb.freebsd.org/changeset/base/282529 Log: Driver calls mrsas_complete_cmd() to call mrsas_wakeup() for each MFI frame that was issued through the ioctl() interface prior to the kill adapter. This ensures userspace ioctl() system calls issued just before a kill adapter don't get stuck in wait state and IOCTLs are returned to application. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:42:44 2015 (r282528) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:43:19 2015 (r282529) @@ -92,6 +92,7 @@ u_int32_t mrsas_read_reg(struct mrsas_so u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cmd); +void mrsas_complete_outstanding_ioctls (struct mrsas_softc *sc); int mrsas_transition_to_ready(struct mrsas_softc *sc, int ocr); int mrsas_init_adapter(struct mrsas_softc *sc); int mrsas_alloc_mpt_cmds(struct mrsas_softc *sc); @@ -2722,7 +2723,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) /* Reset not supported, kill adapter */ mrsas_dprint(sc, MRSAS_OCR, "Reset not supported, killing adapter.\n"); mrsas_kill_hba(sc); - sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; retval = FAIL; goto out; } @@ -2841,7 +2841,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) sizeof(LD_LOAD_BALANCE_INFO) * MAX_LOGICAL_DRIVES_EXT); if (mrsas_get_ctrl_info(sc)) { - sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; mrsas_kill_hba(sc); retval = -1; } @@ -2879,11 +2878,41 @@ out: void mrsas_kill_hba(struct mrsas_softc *sc) { + sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; + pause("mrsas_kill_hba", 1000); mrsas_dprint(sc, MRSAS_OCR, "%s\n", __func__); mrsas_write_reg(sc, offsetof(mrsas_reg_set, doorbell), MFI_STOP_ADP); /* Flush */ mrsas_read_reg(sc, offsetof(mrsas_reg_set, doorbell)); + mrsas_complete_outstanding_ioctls (sc); +} + +/** + * mrsas_complete_outstanding_ioctls Complete pending IOCTLS after kill_hba + * input: Controller softc + * + * Returns void + */ +void mrsas_complete_outstanding_ioctls (struct mrsas_softc *sc){ + int i; + struct mrsas_mpt_cmd *cmd_mpt; + struct mrsas_mfi_cmd *cmd_mfi; + u_int32_t count, MSIxIndex; + + count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + for (i=0; imax_fw_cmds; i++){ + cmd_mpt = sc->mpt_cmd_list[i]; + + if (cmd_mpt->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX){ + cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; + if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT){ + for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) + mrsas_complete_mptmfi_passthru(sc, cmd_mfi, + cmd_mpt->io_request->RaidContext.status); + } + } + } } /* From owner-svn-src-head@FreeBSD.ORG Wed May 6 10:44:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EF787A7; Wed, 6 May 2015 10:44: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 4CEFE1376; Wed, 6 May 2015 10:44: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 t46Ai9Q3017082; Wed, 6 May 2015 10:44:09 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46Ai80e017077; Wed, 6 May 2015 10:44:08 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061044.t46Ai80e017077@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282530 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:44:09 -0000 Author: kadesai Date: Wed May 6 10:44:08 2015 New Revision: 282530 URL: https://svnweb.freebsd.org/changeset/base/282530 Log: Bug fixes found internally as detailed below: 1. While disabling interrupt the FW disables interrupts for only 16 vectors. In case of Invader which supports 96 MSI-x vectors, some spurious interrupts may come on other vectors even after interrupt disable. So, driver uses a flag and ignores the spurious interrupts. 2. Reply queue depth is made double the number of commands supported by FW. 3. Misplaced interrupt enable code is now moved down in the OCR path. 4. Updated error handling code in OCR path. 5. Removed un-necessary print. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_fp.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:43:19 2015 (r282529) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:44:08 2015 (r282530) @@ -274,6 +274,7 @@ mrsas_disable_intr(struct mrsas_softc *s u_int32_t mask = 0xFFFFFFFF; u_int32_t status; + sc->mask_interrupts=1; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask), mask); /* Dummy read to force pci flush */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); @@ -285,6 +286,7 @@ mrsas_enable_intr(struct mrsas_softc *sc u_int32_t mask = MFI_FUSION_ENABLE_INTERRUPT_MASK; u_int32_t status; + sc->mask_interrupts=0; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), ~0); status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); @@ -1442,6 +1444,9 @@ mrsas_isr(void *arg) struct mrsas_softc *sc = irq_context->sc; int status = 0; + if (sc->mask_interrupts) + return; + if (!sc->msix_vectors) { status = mrsas_clear_intr(sc); if (!status) @@ -2154,7 +2159,7 @@ mrsas_init_adapter(struct mrsas_softc *s max_cmd = sc->max_fw_cmds; /* Determine allocation size of command frames */ - sc->reply_q_depth = ((max_cmd + 1 + 15) / 16 * 16); + sc->reply_q_depth = ((max_cmd + 1 + 15) / 16 * 16) * 2; sc->request_alloc_sz = sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION) * max_cmd; sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (max_cmd + 1)); @@ -2807,9 +2812,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) mrsas_dprint(sc, MRSAS_OCR, "mrsas_ioc_init() failed!\n"); continue; } - mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); - mrsas_enable_intr(sc); - sc->adprecovery = MRSAS_HBA_OPERATIONAL; /* Re-fire management commands */ for (j = 0; j < sc->max_fw_cmds; j++) { @@ -2842,12 +2844,17 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) if (mrsas_get_ctrl_info(sc)) { mrsas_kill_hba(sc); - retval = -1; + retval = FAIL; + goto out; } if (!mrsas_get_map_info(sc)) mrsas_sync_map_info(sc); + mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); + mrsas_enable_intr(sc); + sc->adprecovery = MRSAS_HBA_OPERATIONAL; + /* Adapter reset completed successfully */ device_printf(sc->mrsas_dev, "Reset successful\n"); retval = SUCCESS; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:43:19 2015 (r282529) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:44:08 2015 (r282530) @@ -2667,6 +2667,7 @@ struct mrsas_softc { int msix_vectors; int msix_enable; uint32_t msix_reg_offset[16]; + uint8_t mask_interrupts; struct mrsas_mpt_cmd **mpt_cmd_list; struct mrsas_mfi_cmd **mfi_cmd_list; TAILQ_HEAD(, mrsas_mpt_cmd) mrsas_mpt_cmd_list_head; Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:43:19 2015 (r282529) +++ head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:44:08 2015 (r282530) @@ -375,7 +375,6 @@ MR_ValidateMapInfo(struct mrsas_softc *s return 1; } if (sc->UnevenSpanSupport) { - printf("Updating span set\n\n"); mr_update_span_set(drv_map, ldSpanInfo); } mrsas_update_load_balance_params(sc, drv_map, sc->load_balance_info); From owner-svn-src-head@FreeBSD.ORG Wed May 6 10:45:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EB51900; Wed, 6 May 2015 10:45: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 0B9A91381; Wed, 6 May 2015 10:45: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 t46AjGkZ017321; Wed, 6 May 2015 10:45:16 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AjEWo017314; Wed, 6 May 2015 10:45:14 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061045.t46AjEWo017314@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282531 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:45:16 -0000 Author: kadesai Date: Wed May 6 10:45:13 2015 New Revision: 282531 URL: https://svnweb.freebsd.org/changeset/base/282531 Log: 1. All LSI namings are converted to AVAGO Tech. 2. Fix in AEN path(suggested by John Baldwin). 3. Fix IOCTL path w.r.t Sense key handling Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c head/sys/dev/mrsas/mrsas_ioctl.c head/sys/dev/mrsas/mrsas_ioctl.h head/sys/dev/mrsas/mrsas_linux.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -177,9 +178,9 @@ typedef struct mrsas_ident { } MRSAS_CTLR_ID; MRSAS_CTLR_ID device_table[] = { - {0x1000, MRSAS_TBOLT, 0xffff, 0xffff, "LSI Thunderbolt SAS Controller"}, - {0x1000, MRSAS_INVADER, 0xffff, 0xffff, "LSI Invader SAS Controller"}, - {0x1000, MRSAS_FURY, 0xffff, 0xffff, "LSI Fury SAS Controller"}, + {0x1000, MRSAS_TBOLT, 0xffff, 0xffff, "AVAGO Thunderbolt SAS Controller"}, + {0x1000, MRSAS_INVADER, 0xffff, 0xffff, "AVAGO Invader SAS Controller"}, + {0x1000, MRSAS_FURY, 0xffff, 0xffff, "AVAGO Fury SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -356,7 +357,7 @@ mrsas_probe(device_t dev) if ((id = mrsas_find_ident(dev)) != NULL) { if (first_ctrl) { - printf("LSI MegaRAID SAS FreeBSD mrsas driver version: %s\n", + printf("AVAGO MegaRAID SAS FreeBSD mrsas driver version: %s\n", MRSAS_VERSION); first_ctrl = 0; } @@ -1385,8 +1386,10 @@ mrsas_poll(struct cdev *dev, int poll_ev } if (revents == 0) { if (poll_events & (POLLIN | POLLRDNORM)) { + mtx_lock(&sc->aen_lock); sc->mrsas_poll_waiting = 1; selrecord(td, &sc->mrsas_select); + mtx_unlock(&sc->aen_lock); } } return revents; @@ -4099,10 +4102,12 @@ mrsas_complete_aen(struct mrsas_softc *s */ if ((!cmd->abort_aen) && (sc->remove_in_progress == 0)) { sc->mrsas_aen_triggered = 1; + mtx_lock(&sc->aen_lock); if (sc->mrsas_poll_waiting) { sc->mrsas_poll_waiting = 0; selwakeup(&sc->mrsas_select); } + mtx_unlock(&sc->aen_lock); } else cmd->abort_aen = 0; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Authors: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Authors: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -322,7 +323,7 @@ mrsas_action(struct cam_sim *sim, union ccb->cpi.initiator_id = MRSAS_SCSI_INITIATOR_ID; ccb->cpi.base_transfer_speed = 150000; strncpy(ccb->cpi.sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(ccb->cpi.hba_vid, "LSI", HBA_IDLEN); + strncpy(ccb->cpi.hba_vid, "AVAGO", HBA_IDLEN); strncpy(ccb->cpi.dev_name, cam_sim_name(sim), DEV_IDLEN); ccb->cpi.transport = XPORT_SPI; ccb->cpi.transport_version = 2; Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -564,12 +565,12 @@ get_row_from_strip(struct mrsas_softc *s else break; } - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : Strip 0x%llx, span_set_Strip 0x%llx, span_set_Row 0x%llx " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : Strip 0x%llx, span_set_Strip 0x%llx, span_set_Row 0x%llx " "data width 0x%llx span offset 0x%llx\n", (unsigned long long)strip, (unsigned long long)span_set_Strip, (unsigned long long)span_set_Row, (unsigned long long)span_set->span_row_data_width, (unsigned long long)span_offset); - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : For strip 0x%llx row is 0x%llx\n", (unsigned long long)strip, + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : For strip 0x%llx row is 0x%llx\n", (unsigned long long)strip, (unsigned long long)span_set->data_row_start + (unsigned long long)span_set_Row + (span_offset - 1)); return (span_set->data_row_start + span_set_Row + (span_offset - 1)); @@ -629,7 +630,7 @@ get_strip_from_row(struct mrsas_softc *s } } } - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug - get_strip_from_row: returns invalid " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug - get_strip_from_row: returns invalid " "strip for ld=%x, row=%lx\n", ld, (long unsigned int)row); return -1; } @@ -677,13 +678,13 @@ get_arm_from_strip(struct mrsas_softc *s else break; } - mrsas_dprint(sc, MRSAS_PRL11, "LSI PRL11: get_arm_from_strip: " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO PRL11: get_arm_from_strip: " "for ld=0x%x strip=0x%lx arm is 0x%x\n", ld, (long unsigned int)strip, (strip_offset - span_offset)); return (strip_offset - span_offset); } - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: - get_arm_from_strip: returns invalid arm" + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: - get_arm_from_strip: returns invalid arm" " for ld=%x strip=%lx\n", ld, (long unsigned int)strip); return -1; @@ -832,7 +833,7 @@ MR_BuildRaidContext(struct mrsas_softc * else if (sc->UnevenSpanSupport) { io_info->IoforUnevenSpan = 1; } else { - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: raid->rowDataSize is 0, but has SPAN[0] rowDataSize = 0x%0x," + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: raid->rowDataSize is 0, but has SPAN[0] rowDataSize = 0x%0x," " but there is _NO_ UnevenSpanSupport\n", MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize); return FALSE; @@ -859,13 +860,13 @@ MR_BuildRaidContext(struct mrsas_softc * startlba_span = (u_int8_t)mr_spanset_get_span_block(sc, ld, start_row, pdBlock, map, &error_code); if (error_code == 1) { - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: return from %s %d. Send IO w/o region lock.\n", + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: return from %s %d. Send IO w/o region lock.\n", __func__, __LINE__); return FALSE; } } if (startlba_span == SPAN_INVALID) { - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: return from %s %d for row 0x%llx," + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: return from %s %d for row 0x%llx," "start strip %llx endSrip %llx\n", __func__, __LINE__, (unsigned long long)start_row, (unsigned long long)start_strip, @@ -874,12 +875,12 @@ MR_BuildRaidContext(struct mrsas_softc * } io_info->start_span = startlba_span; io_info->start_row = start_row; - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: Check Span number from %s %d for row 0x%llx, " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: Check Span number from %s %d for row 0x%llx, " " start strip 0x%llx endSrip 0x%llx span 0x%x\n", __func__, __LINE__, (unsigned long long)start_row, (unsigned long long)start_strip, (unsigned long long)endStrip, startlba_span); - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : 1. start_row 0x%llx endRow 0x%llx Start span 0x%x\n", + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : 1. start_row 0x%llx endRow 0x%llx Start span 0x%x\n", (unsigned long long)start_row, (unsigned long long)endRow, startlba_span); } else { start_row = mega_div64_32(start_strip, raid->rowDataSize); @@ -1043,7 +1044,7 @@ mr_update_span_set(MR_DRV_RAID_MAP_ALL * span_row_width += MR_LdSpanPtrGet(ld, count, map)->spanRowDataSize; #if SPAN_DEBUG - printf("LSI Debug span %x rowDataSize %x\n", count, + printf("AVAGO Debug span %x rowDataSize %x\n", count, MR_LdSpanPtrGet(ld, count, map)->spanRowDataSize); #endif } @@ -1382,7 +1383,7 @@ u_int8_t mrsas_get_best_arm_pd(struct mr io_info->pd_after_lb = (bestArm == arm) ? pd0:pd1; #if SPAN_DEBUG if(arm != bestArm) - printf("LSI Debug R1 Load balance occur - span 0x%x arm 0x%x bestArm 0x%x " + printf("AVAGO Debug R1 Load balance occur - span 0x%x arm 0x%x bestArm 0x%x " "io_info->span_arm 0x%x\n", span, arm, bestArm, io_info->span_arm); #endif Modified: head/sys/dev/mrsas/mrsas_ioctl.c ============================================================================== --- head/sys/dev/mrsas/mrsas_ioctl.c Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas_ioctl.c Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -238,7 +239,7 @@ mrsas_passthru(struct mrsas_softc *sc, v } sense_ptr = (unsigned long *)((unsigned long)cmd->frame + user_ioc->sense_off); - sense_ptr = ioctl_sense_mem; + *sense_ptr = ioctl_sense_phys_addr; } /* * Set the sync_cmd flag so that the ISR knows not to complete this @@ -296,12 +297,14 @@ out: /* * Release sense buffer */ - if (ioctl_sense_phys_addr) - bus_dmamap_unload(ioctl_sense_tag, ioctl_sense_dmamap); - if (ioctl_sense_mem != NULL) - bus_dmamem_free(ioctl_sense_tag, ioctl_sense_mem, ioctl_sense_dmamap); - if (ioctl_sense_tag != NULL) - bus_dma_tag_destroy(ioctl_sense_tag); + if (user_ioc->sense_len) { + if (ioctl_sense_phys_addr) + bus_dmamap_unload(ioctl_sense_tag, ioctl_sense_dmamap); + if (ioctl_sense_mem != NULL) + bus_dmamem_free(ioctl_sense_tag, ioctl_sense_mem, ioctl_sense_dmamap); + if (ioctl_sense_tag != NULL) + bus_dma_tag_destroy(ioctl_sense_tag); + } /* * Release data buffers Modified: head/sys/dev/mrsas/mrsas_ioctl.h ============================================================================== --- head/sys/dev/mrsas/mrsas_ioctl.h Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas_ioctl.h Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ Modified: head/sys/dev/mrsas/mrsas_linux.c ============================================================================== --- head/sys/dev/mrsas/mrsas_linux.c Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas_linux.c Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Kashyap Desai, * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Kashyap Desai, - * Sibananda Sahu Support: freebsdraid@lsi.com + * Sibananda Sahu Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ From owner-svn-src-head@FreeBSD.ORG Wed May 6 10:45:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71887A5A; Wed, 6 May 2015 10: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 52D6E138C; Wed, 6 May 2015 10: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 t46AjvPt017463; Wed, 6 May 2015 10:45:57 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AjuEd017461; Wed, 6 May 2015 10:45:56 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061045.t46AjuEd017461@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282532 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:45:57 -0000 Author: kadesai Date: Wed May 6 10:45:56 2015 New Revision: 282532 URL: https://svnweb.freebsd.org/changeset/base/282532 Log: Configured the mrsas(4) driver to support UNMAPPED I/O and updated driver version. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:45:13 2015 (r282531) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:45:56 2015 (r282532) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "06.705.10.02-fbsd" +#define MRSAS_VERSION "06.707.04.03-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:45:13 2015 (r282531) +++ head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:45:56 2015 (r282532) @@ -61,7 +61,8 @@ int mrsas_cam_attach(struct mrsas_softc int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb); int mrsas_bus_scan(struct mrsas_softc *sc); int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); -int mrsas_map_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); +int mrsas_map_request(struct mrsas_softc *sc, + struct mrsas_mpt_cmd *cmd, union ccb *ccb); int mrsas_build_ldio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb); @@ -315,7 +316,11 @@ mrsas_action(struct cam_sim *sim, union ccb->cpi.version_num = 1; ccb->cpi.hba_inquiry = 0; ccb->cpi.target_sprt = 0; +#if (__FreeBSD_version >= 902001) + ccb->cpi.hba_misc = PIM_UNMAPPED; +#else ccb->cpi.hba_misc = 0; +#endif ccb->cpi.hba_eng_cnt = 0; ccb->cpi.max_lun = MRSAS_SCSI_MAX_LUNS; ccb->cpi.unit_number = cam_sim_unit(sim); @@ -378,8 +383,13 @@ mrsas_scsiio_timeout(void *data) * on OCR enable/disable property of Controller from ocr_thread * context. */ +#if (__FreeBSD_version >= 1000510) callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, - mrsas_scsiio_timeout, cmd, 0); + mrsas_scsiio_timeout, cmd, 0); +#else + callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + mrsas_scsiio_timeout, cmd); +#endif sc->do_timedout_reset = 1; if (sc->ocr_thread_active) wakeup(&sc->ocr_chan); @@ -425,8 +435,8 @@ mrsas_startio(struct mrsas_softc *sc, st } else cmd->flags = MRSAS_DIR_NONE; /* no data */ - /* For FreeBSD 10.0 and higher */ -#if (__FreeBSD_version >= 1000000) +/* For FreeBSD 9.2 and higher */ +#if (__FreeBSD_version >= 902001) /* * XXX We don't yet support physical addresses here. */ @@ -455,6 +465,11 @@ mrsas_startio(struct mrsas_softc *sc, st if (cmd->length) cmd->data = csio->data_ptr; break; + case CAM_DATA_BIO: + cmd->length = csio->dxfer_len; + if (cmd->length) + cmd->data = csio->data_ptr; + break; default: ccb->ccb_h.status = CAM_REQ_INVALID; goto done; @@ -532,8 +547,13 @@ mrsas_startio(struct mrsas_softc *sc, st /* * Start timer for IO timeout. Default timeout value is 90 second. */ - callout_reset_sbt(&cmd->cm_callout, SBT_1MS * sc->mrsas_io_timeout, 0, - mrsas_scsiio_timeout, cmd, 0); +#if (__FreeBSD_version >= 1000510) + callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, + mrsas_scsiio_timeout, cmd, 0); +#else + callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + mrsas_scsiio_timeout, cmd); +#endif mrsas_atomic_inc(&sc->fw_outstanding); if (mrsas_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater) @@ -677,7 +697,7 @@ mrsas_build_ldio(struct mrsas_softc *sc, io_request->DataLength = cmd->length; - if (mrsas_map_request(sc, cmd) == SUCCESS) { + if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { if (cmd->sge_count > MRSAS_MAX_SGL) { device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); @@ -931,7 +951,7 @@ mrsas_build_dcdb(struct mrsas_softc *sc, io_request->LUN[1] = ccb_h->target_lun & 0xF; io_request->DataLength = cmd->length; - if (mrsas_map_request(sc, cmd) == SUCCESS) { + if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { if (cmd->sge_count > sc->max_num_sge) { device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); @@ -954,20 +974,24 @@ mrsas_build_dcdb(struct mrsas_softc *sc, * is built in the callback. If the bus dmamap load is not successful, * cmd->error_code will contain the error code and a 1 is returned. */ -int -mrsas_map_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd) +int mrsas_map_request(struct mrsas_softc *sc, + struct mrsas_mpt_cmd *cmd, union ccb *ccb) { u_int32_t retcode = 0; struct cam_sim *sim; - int flag = BUS_DMA_NOWAIT; sim = xpt_path_sim(cmd->ccb_ptr->ccb_h.path); if (cmd->data != NULL) { - mtx_lock(&sc->io_lock); /* Map data buffer into bus space */ + mtx_lock(&sc->io_lock); +#if (__FreeBSD_version >= 902001) + retcode = bus_dmamap_load_ccb(sc->data_tag, cmd->data_dmamap, ccb, + mrsas_data_load_cb, cmd, 0); +#else retcode = bus_dmamap_load(sc->data_tag, cmd->data_dmamap, cmd->data, - cmd->length, mrsas_data_load_cb, cmd, flag); + cmd->length, mrsas_data_load_cb, cmd, BUS_DMA_NOWAIT); +#endif mtx_unlock(&sc->io_lock); if (retcode) device_printf(sc->mrsas_dev, "bus_dmamap_load(): retcode = %d\n", retcode); From owner-svn-src-head@FreeBSD.ORG Wed May 6 10:46:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96EC0BA7; Wed, 6 May 2015 10:46: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 84B481398; Wed, 6 May 2015 10:46: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 t46AkU2Q017614; Wed, 6 May 2015 10:46:30 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AkTIg017605; Wed, 6 May 2015 10:46:29 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061046.t46AkTIg017605@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282533 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:46:30 -0000 Author: kadesai Date: Wed May 6 10:46:28 2015 New Revision: 282533 URL: https://svnweb.freebsd.org/changeset/base/282533 Log: Corrected indentation on conflicted source files. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c head/sys/dev/mrsas/mrsas_ioctl.c head/sys/dev/mrsas/mrsas_ioctl.h Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:45:56 2015 (r282532) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:46:28 2015 (r282533) @@ -84,16 +84,17 @@ static int mrsas_complete_cmd(struct mrs static int mrsas_clear_intr(struct mrsas_softc *sc); static int mrsas_get_ctrl_info(struct mrsas_softc *sc); static void mrsas_update_ext_vd_details(struct mrsas_softc *sc); -static int +static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd_to_abort); -static struct mrsas_softc *mrsas_get_softc_instance(struct cdev *dev, - u_long cmd, caddr_t arg); +static struct mrsas_softc * +mrsas_get_softc_instance(struct cdev *dev, + u_long cmd, caddr_t arg); u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset); -u_int8_t +u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cmd); -void mrsas_complete_outstanding_ioctls (struct mrsas_softc *sc); +void mrsas_complete_outstanding_ioctls(struct mrsas_softc *sc); int mrsas_transition_to_ready(struct mrsas_softc *sc, int ocr); int mrsas_init_adapter(struct mrsas_softc *sc); int mrsas_alloc_mpt_cmds(struct mrsas_softc *sc); @@ -105,10 +106,10 @@ int mrsas_issue_dcmd(struct mrsas_softc int mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); int mrsas_reset_ctrl(struct mrsas_softc *sc); int mrsas_wait_for_outstanding(struct mrsas_softc *sc); -int +int mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); -int +int mrsas_alloc_tmp_dcmd(struct mrsas_softc *sc, struct mrsas_tmp_dcmd *tcmd, int size); void mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd); @@ -125,17 +126,17 @@ void mrsas_teardown_intr(struct mrsas_so void mrsas_addr_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error); void mrsas_kill_hba(struct mrsas_softc *sc); void mrsas_aen_handler(struct mrsas_softc *sc); -void +void mrsas_write_reg(struct mrsas_softc *sc, int offset, u_int32_t value); -void +void mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi); void mrsas_free_ctlr_info_cmd(struct mrsas_softc *sc); -void +void mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd, u_int8_t status); -void +void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, u_int8_t extStatus); struct mrsas_mfi_cmd *mrsas_get_mfi_cmd(struct mrsas_softc *sc); @@ -275,7 +276,7 @@ mrsas_disable_intr(struct mrsas_softc *s u_int32_t mask = 0xFFFFFFFF; u_int32_t status; - sc->mask_interrupts=1; + sc->mask_interrupts = 1; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask), mask); /* Dummy read to force pci flush */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); @@ -287,7 +288,7 @@ mrsas_enable_intr(struct mrsas_softc *sc u_int32_t mask = MFI_FUSION_ENABLE_INTERRUPT_MASK; u_int32_t status; - sc->mask_interrupts=0; + sc->mask_interrupts = 0; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), ~0); status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); @@ -1262,18 +1263,22 @@ mrsas_get_softc_instance(struct cdev *de { struct mrsas_softc *sc = NULL; struct mrsas_iocpacket *user_ioc = (struct mrsas_iocpacket *)arg; - if (cmd == MRSAS_IOC_GET_PCI_INFO){ - sc = dev->si_drv1; + + if (cmd == MRSAS_IOC_GET_PCI_INFO) { + sc = dev->si_drv1; } else { - /* get the Host number & the softc from data sent by the Application */ - sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; + /* + * get the Host number & the softc from data sent by the + * Application + */ + sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; if ((user_ioc->host_no >= mrsas_mgmt_info.max_index) || (sc == NULL)) { if (sc == NULL) mrsas_dprint(sc, MRSAS_FAULT, - "There is no Controller number %d .\n", user_ioc->host_no); + "There is no Controller number %d .\n", user_ioc->host_no); else mrsas_dprint(sc, MRSAS_FAULT, - "Invalid Controller number %d .\n", user_ioc->host_no); + "Invalid Controller number %d .\n", user_ioc->host_no); } } @@ -1343,17 +1348,17 @@ do_ioctl: break; case MRSAS_IOC_GET_PCI_INFO: - pciDrvInfo = (MRSAS_DRV_PCI_INFORMATION *)arg; - memset (pciDrvInfo, 0, sizeof(MRSAS_DRV_PCI_INFORMATION)); + pciDrvInfo = (MRSAS_DRV_PCI_INFORMATION *) arg; + memset(pciDrvInfo, 0, sizeof(MRSAS_DRV_PCI_INFORMATION)); pciDrvInfo->busNumber = pci_get_bus(sc->mrsas_dev); pciDrvInfo->deviceNumber = pci_get_slot(sc->mrsas_dev); pciDrvInfo->functionNumber = pci_get_function(sc->mrsas_dev); pciDrvInfo->domainID = pci_get_domain(sc->mrsas_dev); - mrsas_dprint (sc, MRSAS_INFO, "pci bus no: %d," - "pci device no: %d, pci function no: %d," - "pci domain ID: %d\n", - pciDrvInfo->busNumber, pciDrvInfo->deviceNumber, - pciDrvInfo->functionNumber, pciDrvInfo->domainID); + mrsas_dprint(sc, MRSAS_INFO, "pci bus no: %d," + "pci device no: %d, pci function no: %d," + "pci domain ID: %d\n", + pciDrvInfo->busNumber, pciDrvInfo->deviceNumber, + pciDrvInfo->functionNumber, pciDrvInfo->domainID); ret = 0; break; @@ -1670,8 +1675,8 @@ mrsas_map_mpt_cmd_status(struct mrsas_mp static int mrsas_alloc_mem(struct mrsas_softc *sc) { - u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, chain_frame_size, - evt_detail_size, count; + u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, + chain_frame_size, evt_detail_size, count; /* * Allocate parent DMA tag @@ -1996,7 +2001,7 @@ ABORT: * get_pdlist, get_ld_list and max_sectors are currently not being used, it * is left here as placeholder. */ -static int +static int mrsas_init_fw(struct mrsas_softc *sc) { @@ -2065,11 +2070,10 @@ mrsas_init_fw(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Allocate MFI cmd failed.\n"); return (1); } - sc->ctrl_info = malloc(sizeof(struct mrsas_ctrl_info), M_MRSAS, M_NOWAIT); if (!sc->ctrl_info) { device_printf(sc->mrsas_dev, "Malloc for ctrl_info failed.\n"); - return(1); + return (1); } /* * Get the controller info from FW, so that the MAX VD support @@ -2077,10 +2081,10 @@ mrsas_init_fw(struct mrsas_softc *sc) */ if (mrsas_get_ctrl_info(sc)) { device_printf(sc->mrsas_dev, "Unable to get FW ctrl_info.\n"); - return(1); + return (1); } sc->secure_jbod_support = - (u_int8_t) sc->ctrl_info->adapterOperations3.supportSecurityonJBOD; + (u_int8_t)sc->ctrl_info->adapterOperations3.supportSecurityonJBOD; if (sc->secure_jbod_support) device_printf(sc->mrsas_dev, "FW supports SED \n"); @@ -2109,7 +2113,7 @@ mrsas_init_fw(struct mrsas_softc *sc) */ tmp_sectors = 0; max_sectors_1 = (1 << sc->ctrl_info->stripe_sz_ops.min) * - sc->ctrl_info->max_strips_per_io; + sc->ctrl_info->max_strips_per_io; max_sectors_2 = sc->ctrl_info->max_request_size; tmp_sectors = min(max_sectors_1, max_sectors_2); sc->max_sectors_per_req = sc->max_num_sge * MRSAS_PAGE_SIZE / 512; @@ -2118,9 +2122,9 @@ mrsas_init_fw(struct mrsas_softc *sc) sc->max_sectors_per_req = tmp_sectors; sc->disableOnlineCtrlReset = - sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; + sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; sc->UnevenSpanSupport = - sc->ctrl_info->adapterOperations2.supportUnevenSpans; + sc->ctrl_info->adapterOperations2.supportUnevenSpans; if (sc->UnevenSpanSupport) { device_printf(sc->mrsas_dev, "FW supports: UnevenSpanSupport=%x\n\n", sc->UnevenSpanSupport); @@ -2130,7 +2134,6 @@ mrsas_init_fw(struct mrsas_softc *sc) else sc->fast_path_io = 0; } - return (0); } @@ -2451,7 +2454,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc * This functions fires the command to Firmware by writing to the * inbound_low_queue_port and inbound_high_queue_port. */ -void +void mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi) { @@ -2815,7 +2818,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) mrsas_dprint(sc, MRSAS_OCR, "mrsas_ioc_init() failed!\n"); continue; } - /* Re-fire management commands */ for (j = 0; j < sc->max_fw_cmds; j++) { mpt_cmd = sc->mpt_cmd_list[j]; @@ -2850,7 +2852,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) retval = FAIL; goto out; } - if (!mrsas_get_map_info(sc)) mrsas_sync_map_info(sc); @@ -2895,7 +2896,7 @@ mrsas_kill_hba(struct mrsas_softc *sc) MFI_STOP_ADP); /* Flush */ mrsas_read_reg(sc, offsetof(mrsas_reg_set, doorbell)); - mrsas_complete_outstanding_ioctls (sc); + mrsas_complete_outstanding_ioctls(sc); } /** @@ -2904,22 +2905,24 @@ mrsas_kill_hba(struct mrsas_softc *sc) * * Returns void */ -void mrsas_complete_outstanding_ioctls (struct mrsas_softc *sc){ +void +mrsas_complete_outstanding_ioctls(struct mrsas_softc *sc) +{ int i; - struct mrsas_mpt_cmd *cmd_mpt; - struct mrsas_mfi_cmd *cmd_mfi; - u_int32_t count, MSIxIndex; + struct mrsas_mpt_cmd *cmd_mpt; + struct mrsas_mfi_cmd *cmd_mfi; + u_int32_t count, MSIxIndex; count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; - for (i=0; imax_fw_cmds; i++){ + for (i = 0; i < sc->max_fw_cmds; i++) { cmd_mpt = sc->mpt_cmd_list[i]; - if (cmd_mpt->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX){ + if (cmd_mpt->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX) { cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; - if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT){ - for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) + if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT) { + for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) mrsas_complete_mptmfi_passthru(sc, cmd_mfi, - cmd_mpt->io_request->RaidContext.status); + cmd_mpt->io_request->RaidContext.status); } } } @@ -3058,18 +3061,19 @@ mrsas_get_ctrl_info(struct mrsas_softc * * input: * sc - Controller's softc */ -static void mrsas_update_ext_vd_details(struct mrsas_softc *sc) +static void +mrsas_update_ext_vd_details(struct mrsas_softc *sc) { sc->max256vdSupport = - sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + sc->ctrl_info->adapterOperations3.supportMaxExtLDs; /* Below is additional check to address future FW enhancement */ if (sc->ctrl_info->max_lds > 64) sc->max256vdSupport = 1; sc->drv_supported_vd_count = MRSAS_MAX_LD_CHANNELS - * MRSAS_MAX_DEV_PER_CHANNEL; + * MRSAS_MAX_DEV_PER_CHANNEL; sc->drv_supported_pd_count = MRSAS_MAX_PD_CHANNELS - * MRSAS_MAX_DEV_PER_CHANNEL; + * MRSAS_MAX_DEV_PER_CHANNEL; if (sc->max256vdSupport) { sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES_EXT; sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; @@ -3078,13 +3082,13 @@ static void mrsas_update_ext_vd_details( sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; } - sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * - (sc->fw_supported_vd_count - 1)); - sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); - sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * - (sc->drv_supported_vd_count - 1)); + sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * + (sc->fw_supported_vd_count - 1)); + sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); + sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * + (sc->drv_supported_vd_count - 1)); sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); @@ -3869,7 +3873,7 @@ mrsas_get_ld_list(struct mrsas_softc *sc * memory is initialized to all zeros upon successful loading of the dma * mapped memory. */ -int +int mrsas_alloc_tmp_dcmd(struct mrsas_softc *sc, struct mrsas_tmp_dcmd *tcmd, int size) { Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:45:56 2015 (r282532) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:46:28 2015 (r282533) @@ -1323,7 +1323,7 @@ typedef enum _MR_SCSI_CMD_TYPE { NON_READ_WRITE_LDIO = 1, READ_WRITE_SYSPDIO = 2, NON_READ_WRITE_SYSPDIO = 3, -} MR_SCSI_CMD_TYPE; +} MR_SCSI_CMD_TYPE; enum mrsas_req_flags { MRSAS_DIR_UNKNOWN = 0x1, @@ -1908,27 +1908,27 @@ struct mrsas_ctrl_info { char reserved6[4]; /* 0x7E4 RESERVED FOR IOV */ struct { /* 0x7E8 */ - u_int32_t supportPersonalityChange:2; - u_int32_t supportThermalPollInterval:1; - u_int32_t supportDisableImmediateIO:1; - u_int32_t supportT10RebuildAssist:1; - u_int32_t supportMaxExtLDs:1; - u_int32_t supportCrashDump:1; - u_int32_t supportSwZone:1; - u_int32_t supportDebugQueue:1; - u_int32_t supportNVCacheErase:1; - u_int32_t supportForceTo512e:1; - u_int32_t supportHOQRebuild:1; - u_int32_t supportAllowedOpsforDrvRemoval:1; - u_int32_t supportDrvActivityLEDSetting:1; - u_int32_t supportNVDRAM:1; - u_int32_t supportForceFlash:1; - u_int32_t supportDisableSESMonitoring:1; - u_int32_t supportCacheBypassModes:1; - u_int32_t supportSecurityonJBOD:1; - u_int32_t discardCacheDuringLDDelete:1; - u_int32_t reserved:12; - } adapterOperations3; + u_int32_t supportPersonalityChange:2; + u_int32_t supportThermalPollInterval:1; + u_int32_t supportDisableImmediateIO:1; + u_int32_t supportT10RebuildAssist:1; + u_int32_t supportMaxExtLDs:1; + u_int32_t supportCrashDump:1; + u_int32_t supportSwZone:1; + u_int32_t supportDebugQueue:1; + u_int32_t supportNVCacheErase:1; + u_int32_t supportForceTo512e:1; + u_int32_t supportHOQRebuild:1; + u_int32_t supportAllowedOpsforDrvRemoval:1; + u_int32_t supportDrvActivityLEDSetting:1; + u_int32_t supportNVDRAM:1; + u_int32_t supportForceFlash:1; + u_int32_t supportDisableSESMonitoring:1; + u_int32_t supportCacheBypassModes:1; + u_int32_t supportSecurityonJBOD:1; + u_int32_t discardCacheDuringLDDelete:1; + u_int32_t reserved:12; + } adapterOperations3; u_int8_t pad[0x800 - 0x7EC]; /* 0x7EC */ } __packed; @@ -2002,7 +2002,7 @@ typedef union _MFI_CAPABILITIES { u_int32_t support_core_affinity:1; u_int32_t security_protocol_cmds_fw:1; u_int32_t reserved:25; - } mfi_capabilities; + } mfi_capabilities; u_int32_t reg; } MFI_CAPABILITIES; @@ -2444,29 +2444,37 @@ struct mrsas_mgmt_info { int max_index; }; -#define PCI_TYPE0_ADDRESSES 6 -#define PCI_TYPE1_ADDRESSES 2 -#define PCI_TYPE2_ADDRESSES 5 - -typedef struct _MRSAS_DRV_PCI_COMMON_HEADER -{ - u_int16_t vendorID; // (ro) - u_int16_t deviceID; // (ro) - u_int16_t command; // Device control +#define PCI_TYPE0_ADDRESSES 6 +#define PCI_TYPE1_ADDRESSES 2 +#define PCI_TYPE2_ADDRESSES 5 + +typedef struct _MRSAS_DRV_PCI_COMMON_HEADER { + u_int16_t vendorID; + //(ro) + u_int16_t deviceID; + //(ro) + u_int16_t command; + //Device control u_int16_t status; - u_int8_t revisionID; // (ro) - u_int8_t progIf; // (ro) - u_int8_t subClass; // (ro) - u_int8_t baseClass; // (ro) - u_int8_t cacheLineSize; // (ro+) - u_int8_t latencyTimer; // (ro+) - u_int8_t headerType; // (ro) - u_int8_t bist; // Built in self test - - union - { - struct _MRSAS_DRV_PCI_HEADER_TYPE_0 - { + u_int8_t revisionID; + //(ro) + u_int8_t progIf; + //(ro) + u_int8_t subClass; + //(ro) + u_int8_t baseClass; + //(ro) + u_int8_t cacheLineSize; + //(ro +) + u_int8_t latencyTimer; + //(ro +) + u_int8_t headerType; + //(ro) + u_int8_t bist; + //Built in self test + + union { + struct _MRSAS_DRV_PCI_HEADER_TYPE_0 { u_int32_t baseAddresses[PCI_TYPE0_ADDRESSES]; u_int32_t cis; u_int16_t subVendorID; @@ -2476,134 +2484,126 @@ typedef struct _MRSAS_DRV_PCI_COMMON_HEA u_int8_t reserved1[3]; u_int32_t reserved2; u_int8_t interruptLine; - u_int8_t interruptPin; // (ro) - u_int8_t minimumGrant; // (ro) - u_int8_t maximumLatency; // (ro) - } type0; - - /* - * PCI to PCI Bridge - */ - - struct _MRSAS_DRV_PCI_HEADER_TYPE_1 - { - u_int32_t baseAddresses[PCI_TYPE1_ADDRESSES]; - u_int8_t primaryBus; - u_int8_t secondaryBus; - u_int8_t subordinateBus; - u_int8_t secondaryLatency; - u_int8_t ioBase; - u_int8_t ioLimit; - u_int16_t secondaryStatus; - u_int16_t memoryBase; - u_int16_t memoryLimit; - u_int16_t prefetchBase; - u_int16_t prefetchLimit; - u_int32_t prefetchBaseUpper32; - u_int32_t prefetchLimitUpper32; - u_int16_t ioBaseUpper16; - u_int16_t ioLimitUpper16; - u_int8_t capabilitiesPtr; - u_int8_t reserved1[3]; - u_int32_t romBaseAddress; - u_int8_t interruptLine; - u_int8_t interruptPin; - u_int16_t bridgeControl; - } type1; - - /* - * PCI to CARDBUS Bridge - */ - - struct _MRSAS_DRV_PCI_HEADER_TYPE_2 - { - u_int32_t socketRegistersBaseAddress; - u_int8_t capabilitiesPtr; - u_int8_t reserved; - u_int16_t secondaryStatus; - u_int8_t primaryBus; - u_int8_t secondaryBus; - u_int8_t subordinateBus; - u_int8_t secondaryLatency; - struct - { - u_int32_t base; - u_int32_t limit; - } range[PCI_TYPE2_ADDRESSES-1]; - u_int8_t interruptLine; - u_int8_t interruptPin; - u_int16_t bridgeControl; - } type2; - } u; + u_int8_t interruptPin; + //(ro) + u_int8_t minimumGrant; + //(ro) + u_int8_t maximumLatency; + //(ro) + } type0; + + /* + * PCI to PCI Bridge + */ + + struct _MRSAS_DRV_PCI_HEADER_TYPE_1 { + u_int32_t baseAddresses[PCI_TYPE1_ADDRESSES]; + u_int8_t primaryBus; + u_int8_t secondaryBus; + u_int8_t subordinateBus; + u_int8_t secondaryLatency; + u_int8_t ioBase; + u_int8_t ioLimit; + u_int16_t secondaryStatus; + u_int16_t memoryBase; + u_int16_t memoryLimit; + u_int16_t prefetchBase; + u_int16_t prefetchLimit; + u_int32_t prefetchBaseUpper32; + u_int32_t prefetchLimitUpper32; + u_int16_t ioBaseUpper16; + u_int16_t ioLimitUpper16; + u_int8_t capabilitiesPtr; + u_int8_t reserved1[3]; + u_int32_t romBaseAddress; + u_int8_t interruptLine; + u_int8_t interruptPin; + u_int16_t bridgeControl; + } type1; + + /* + * PCI to CARDBUS Bridge + */ -} MRSAS_DRV_PCI_COMMON_HEADER, *PMRSAS_DRV_PCI_COMMON_HEADER; + struct _MRSAS_DRV_PCI_HEADER_TYPE_2 { + u_int32_t socketRegistersBaseAddress; + u_int8_t capabilitiesPtr; + u_int8_t reserved; + u_int16_t secondaryStatus; + u_int8_t primaryBus; + u_int8_t secondaryBus; + u_int8_t subordinateBus; + u_int8_t secondaryLatency; + struct { + u_int32_t base; + u_int32_t limit; + } range [PCI_TYPE2_ADDRESSES - 1]; + u_int8_t interruptLine; + u_int8_t interruptPin; + u_int16_t bridgeControl; + } type2; + } u; -#define MRSAS_DRV_PCI_COMMON_HEADER_SIZE sizeof(MRSAS_DRV_PCI_COMMON_HEADER) //64 bytes +} MRSAS_DRV_PCI_COMMON_HEADER, *PMRSAS_DRV_PCI_COMMON_HEADER; -typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY -{ - union - { - struct - { - u_int32_t linkSpeed :4; - u_int32_t linkWidth :6; - u_int32_t aspmSupport :2; - u_int32_t losExitLatency :3; - u_int32_t l1ExitLatency :3; - u_int32_t rsvdp :6; - u_int32_t portNumber :8; - }bits; +#define MRSAS_DRV_PCI_COMMON_HEADER_SIZE sizeof(MRSAS_DRV_PCI_COMMON_HEADER) //64 bytes + +typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { + union { + struct { + u_int32_t linkSpeed:4; + u_int32_t linkWidth:6; + u_int32_t aspmSupport:2; + u_int32_t losExitLatency:3; + u_int32_t l1ExitLatency:3; + u_int32_t rsvdp:6; + u_int32_t portNumber:8; + } bits; u_int32_t asUlong; - }u; -}MRSAS_DRV_PCI_LINK_CAPABILITY, *PMRSAS_DRV_PCI_LINK_CAPABILITY; + } u; +} MRSAS_DRV_PCI_LINK_CAPABILITY, *PMRSAS_DRV_PCI_LINK_CAPABILITY; -#define MRSAS_DRV_PCI_LINK_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_CAPABILITY) +#define MRSAS_DRV_PCI_LINK_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_CAPABILITY) -typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY -{ - union - { - struct - { - u_int16_t linkSpeed :4; - u_int16_t negotiatedLinkWidth :6; - u_int16_t linkTrainingError :1; - u_int16_t linkTraning :1; - u_int16_t slotClockConfig :1; - u_int16_t rsvdZ :3; - }bits; +typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY { + union { + struct { + u_int16_t linkSpeed:4; + u_int16_t negotiatedLinkWidth:6; + u_int16_t linkTrainingError:1; + u_int16_t linkTraning:1; + u_int16_t slotClockConfig:1; + u_int16_t rsvdZ:3; + } bits; u_int16_t asUshort; - }u; + } u; u_int16_t reserved; -} MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY, *PMRSAS_DRV_PCI_LINK_STATUS_CAPABILITY; +} MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY, *PMRSAS_DRV_PCI_LINK_STATUS_CAPABILITY; -#define MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY) +#define MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY) -typedef struct _MRSAS_DRV_PCI_CAPABILITIES -{ - MRSAS_DRV_PCI_LINK_CAPABILITY linkCapability; - MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY linkStatusCapability; -}MRSAS_DRV_PCI_CAPABILITIES, *PMRSAS_DRV_PCI_CAPABILITIES; +typedef struct _MRSAS_DRV_PCI_CAPABILITIES { + MRSAS_DRV_PCI_LINK_CAPABILITY linkCapability; + MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY linkStatusCapability; +} MRSAS_DRV_PCI_CAPABILITIES, *PMRSAS_DRV_PCI_CAPABILITIES; -#define MRSAS_DRV_PCI_CAPABILITIES_SIZE sizeof(MRSAS_DRV_PCI_CAPABILITIES) +#define MRSAS_DRV_PCI_CAPABILITIES_SIZE sizeof(MRSAS_DRV_PCI_CAPABILITIES) /* PCI information */ -typedef struct _MRSAS_DRV_PCI_INFORMATION -{ - u_int32_t busNumber; - u_int8_t deviceNumber; - u_int8_t functionNumber; - u_int8_t interruptVector; - u_int8_t reserved1; - MRSAS_DRV_PCI_COMMON_HEADER pciHeaderInfo; - MRSAS_DRV_PCI_CAPABILITIES capability; - u_int32_t domainID; - u_int8_t reserved2[28]; -}MRSAS_DRV_PCI_INFORMATION, *PMRSAS_DRV_PCI_INFORMATION; +typedef struct _MRSAS_DRV_PCI_INFORMATION { + u_int32_t busNumber; + u_int8_t deviceNumber; + u_int8_t functionNumber; + u_int8_t interruptVector; + u_int8_t reserved1; + MRSAS_DRV_PCI_COMMON_HEADER pciHeaderInfo; + MRSAS_DRV_PCI_CAPABILITIES capability; + u_int32_t domainID; + u_int8_t reserved2[28]; +} MRSAS_DRV_PCI_INFORMATION, *PMRSAS_DRV_PCI_INFORMATION; /******************************************************************* * per-instance data @@ -2668,7 +2668,7 @@ struct mrsas_softc { int msix_vectors; int msix_enable; uint32_t msix_reg_offset[16]; - uint8_t mask_interrupts; + uint8_t mask_interrupts; struct mrsas_mpt_cmd **mpt_cmd_list; struct mrsas_mfi_cmd **mfi_cmd_list; TAILQ_HEAD(, mrsas_mpt_cmd) mrsas_mpt_cmd_list_head; @@ -2740,7 +2740,7 @@ struct mrsas_softc { struct task ev_task; u_int32_t CurLdCount; u_int64_t reset_flags; - int lb_pending_cmds; + int lb_pending_cmds; LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES_EXT]; LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:45:56 2015 (r282532) +++ head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:46:28 2015 (r282533) @@ -58,18 +58,19 @@ __FBSDID("$FreeBSD$"); * Function prototypes */ int mrsas_cam_attach(struct mrsas_softc *sc); -int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb); +int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb); int mrsas_bus_scan(struct mrsas_softc *sc); int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); -int mrsas_map_request(struct mrsas_softc *sc, - struct mrsas_mpt_cmd *cmd, union ccb *ccb); int +mrsas_map_request(struct mrsas_softc *sc, + struct mrsas_mpt_cmd *cmd, union ccb *ccb); +int mrsas_build_ldio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb); -int +int mrsas_build_dcdb(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb, struct cam_sim *sim); -int +int mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb, u_int32_t device_id, MRSAS_RAID_SCSI_IO_REQUEST * io_request); @@ -79,10 +80,10 @@ void mrsas_cam_detach(struct mrsas_softc void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); void mrsas_unmap_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); -void +void mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi); -void +void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, struct IO_REQUEST_INFO *io_info, union ccb *ccb, MR_DRV_RAID_MAP_ALL * local_map_ptr, u_int32_t ref_tag, @@ -91,10 +92,10 @@ static void mrsas_freeze_simq(struct mrs static void mrsas_cam_poll(struct cam_sim *sim); static void mrsas_action(struct cam_sim *sim, union ccb *ccb); static void mrsas_scsiio_timeout(void *data); -static void +static void mrsas_data_load_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error); -static int32_t +static int32_t mrsas_startio(struct mrsas_softc *sc, struct cam_sim *sim, union ccb *ccb); struct mrsas_mpt_cmd *mrsas_get_mpt_cmd(struct mrsas_softc *sc); @@ -114,8 +115,9 @@ MR_BuildRaidContext(struct mrsas_softc * extern u_int16_t MR_LdSpanArrayGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); -extern u_int16_t mrsas_get_updated_dev_handle(struct mrsas_softc *sc, - PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); +extern u_int16_t +mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); extern u_int8_t megasas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, u_int64_t block, u_int32_t count); @@ -385,10 +387,10 @@ mrsas_scsiio_timeout(void *data) */ #if (__FreeBSD_version >= 1000510) callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, - mrsas_scsiio_timeout, cmd, 0); + mrsas_scsiio_timeout, cmd, 0); #else callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, - mrsas_scsiio_timeout, cmd); + mrsas_scsiio_timeout, cmd); #endif sc->do_timedout_reset = 1; if (sc->ocr_thread_active) @@ -549,10 +551,10 @@ mrsas_startio(struct mrsas_softc *sc, st */ #if (__FreeBSD_version >= 1000510) callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, - mrsas_scsiio_timeout, cmd, 0); + mrsas_scsiio_timeout, cmd, 0); #else callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, - mrsas_scsiio_timeout, cmd); + mrsas_scsiio_timeout, cmd); #endif mrsas_atomic_inc(&sc->fw_outstanding); @@ -574,7 +576,8 @@ done: * This function determines if the IO is read/write or inquiry. It returns a 1 * if the IO is read/write and 0 if it is inquiry. */ -int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb) +int +mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb) { struct ccb_scsiio *csio = &(ccb->csio); @@ -588,10 +591,10 @@ int mrsas_find_io_type(struct cam_sim *s case READ_16: case WRITE_16: return (cam_sim_bus(sim) ? - READ_WRITE_SYSPDIO : READ_WRITE_LDIO); + READ_WRITE_SYSPDIO : READ_WRITE_LDIO); default: return (cam_sim_bus(sim) ? - NON_READ_WRITE_SYSPDIO : NON_READ_WRITE_LDIO); + NON_READ_WRITE_SYSPDIO : NON_READ_WRITE_LDIO); } } @@ -844,8 +847,8 @@ mrsas_setup_io(struct mrsas_softc *sc, s if ((sc->load_balance_info[device_id].loadBalanceFlag) && (io_info.isRead)) { io_info.devHandle = - mrsas_get_updated_dev_handle(sc, - &sc->load_balance_info[device_id], &io_info); + mrsas_get_updated_dev_handle(sc, + &sc->load_balance_info[device_id], &io_info); cmd->load_balance = MRSAS_LOAD_BALANCE_FLAG; cmd->pd_r1_lb = io_info.pd_after_lb; } else @@ -897,27 +900,27 @@ mrsas_build_dcdb(struct mrsas_softc *sc, device_id = ccb_h->target_id; map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; - /* - * Check if this is RW for system PD or - * it's a NON RW for sys PD and there is NO secure jbod FW support - */ + /* + * Check if this is RW for system PD or + * it's a NON RW for sys PD and there is NO secure jbod FW support + */ if (cam_sim_bus(sim) == 1 && - sc->pd_list[device_id].driveState == MR_PD_STATE_SYSTEM){ + sc->pd_list[device_id].driveState == MR_PD_STATE_SYSTEM) { io_request->DevHandle = - map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; + map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; io_request->RaidContext.RAIDFlags = - MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD << - MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; + MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD << + MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; cmd->request_desc->SCSIIO.MSIxIndex = - sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; + sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; - if(sc->secure_jbod_support && (mrsas_find_io_type(sim, ccb) == NON_READ_WRITE_SYSPDIO)) { + if (sc->secure_jbod_support && (mrsas_find_io_type(sim, ccb) == NON_READ_WRITE_SYSPDIO)) { /* system pd firmware path */ - io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; + io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); } else { /* system pd fast path */ io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; @@ -927,8 +930,8 @@ mrsas_build_dcdb(struct mrsas_softc *sc, io_request->RaidContext.regLockLength = 0; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << - MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); /* * NOTE - For system pd RW cmds only IoFlags will be FAST_PATH @@ -937,14 +940,14 @@ mrsas_build_dcdb(struct mrsas_softc *sc, */ if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; - } + } } else { - /* FW path for SysPD or LD Non-RW (SCSI management commands)*/ - io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; + /* FW path for SysPD or LD Non-RW (SCSI management commands) */ + io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; io_request->DevHandle = device_id; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << - MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); } io_request->RaidContext.VirtualDiskTgtId = device_id; @@ -974,8 +977,9 @@ mrsas_build_dcdb(struct mrsas_softc *sc, * is built in the callback. If the bus dmamap load is not successful, * cmd->error_code will contain the error code and a 1 is returned. */ -int mrsas_map_request(struct mrsas_softc *sc, - struct mrsas_mpt_cmd *cmd, union ccb *ccb) +int +mrsas_map_request(struct mrsas_softc *sc, + struct mrsas_mpt_cmd *cmd, union ccb *ccb) { u_int32_t retcode = 0; struct cam_sim *sim; @@ -987,10 +991,10 @@ int mrsas_map_request(struct mrsas_softc mtx_lock(&sc->io_lock); #if (__FreeBSD_version >= 902001) retcode = bus_dmamap_load_ccb(sc->data_tag, cmd->data_dmamap, ccb, - mrsas_data_load_cb, cmd, 0); + mrsas_data_load_cb, cmd, 0); #else retcode = bus_dmamap_load(sc->data_tag, cmd->data_dmamap, cmd->data, - cmd->length, mrsas_data_load_cb, cmd, BUS_DMA_NOWAIT); + cmd->length, mrsas_data_load_cb, cmd, BUS_DMA_NOWAIT); #endif mtx_unlock(&sc->io_lock); if (retcode) Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:45:56 2015 (r282532) +++ head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:46:28 2015 (r282533) @@ -55,13 +55,14 @@ __FBSDID("$FreeBSD$"); * Function prototypes */ u_int8_t MR_ValidateMapInfo(struct mrsas_softc *sc); -u_int8_t mrsas_get_best_arm_pd(struct mrsas_softc *sc, - PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); u_int8_t +mrsas_get_best_arm_pd(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); +u_int8_t MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_REQUEST_INFO *io_info, RAID_CONTEXT * pRAID_Context, MR_DRV_RAID_MAP_ALL * map); -u_int8_t +u_int8_t MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t ld, u_int64_t stripRow, u_int16_t stripRef, struct IO_REQUEST_INFO *io_info, RAID_CONTEXT * pRAID_Context, @@ -69,31 +70,33 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int16_t MR_TargetIdToLdGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); u_int32_t MR_LdBlockSizeGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); u_int16_t MR_GetLDTgtId(u_int32_t ld, MR_DRV_RAID_MAP_ALL * map); -u_int16_t mrsas_get_updated_dev_handle(struct mrsas_softc *sc, - PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); +u_int16_t +mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); u_int32_t mega_mod64(u_int64_t dividend, u_int32_t divisor); -u_int32_t +u_int32_t MR_GetSpanBlock(u_int32_t ld, u_int64_t row, u_int64_t *span_blk, MR_DRV_RAID_MAP_ALL * map, int *div_error); u_int64_t mega_div64_32(u_int64_t dividend, u_int32_t divisor); -void mrsas_update_load_balance_params(struct mrsas_softc *sc, - MR_DRV_RAID_MAP_ALL *map, PLD_LOAD_BALANCE_INFO lbInfo); void +mrsas_update_load_balance_params(struct mrsas_softc *sc, + MR_DRV_RAID_MAP_ALL * map, PLD_LOAD_BALANCE_INFO lbInfo); +void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, struct IO_REQUEST_INFO *io_info, union ccb *ccb, MR_DRV_RAID_MAP_ALL * local_map_ptr, u_int32_t ref_tag, u_int32_t ld_block_size); -static u_int16_t +static u_int16_t MR_LdSpanArrayGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); static u_int16_t MR_PdDevHandleGet(u_int32_t pd, MR_DRV_RAID_MAP_ALL * map); -static u_int16_t +static u_int16_t MR_ArPdGet(u_int32_t ar, u_int32_t arm, MR_DRV_RAID_MAP_ALL * map); static MR_LD_SPAN * MR_LdSpanPtrGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); -static u_int8_t +static u_int8_t MR_LdDataArmGet(u_int32_t ld, u_int32_t armIdx, MR_DRV_RAID_MAP_ALL * map); static MR_SPAN_BLOCK_INFO * @@ -144,7 +147,7 @@ typedef u_int32_t REGION_LEN; #define FALSE 0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed May 6 11:23:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B567FD; Wed, 6 May 2015 11:23: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 ED76217B3; Wed, 6 May 2015 11:23: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 t46BNERf036454; Wed, 6 May 2015 11:23:14 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46BNEd6036453; Wed, 6 May 2015 11:23:14 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201505061123.t46BNEd6036453@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 6 May 2015 11:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282534 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 11:23:15 -0000 Author: melifaro Date: Wed May 6 11:23:14 2015 New Revision: 282534 URL: https://svnweb.freebsd.org/changeset/base/282534 Log: Correctly print valtype for empty bitmask. Modified: head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Wed May 6 10:46:28 2015 (r282533) +++ head/sbin/ipfw/tables.c Wed May 6 11:23:14 2015 (r282534) @@ -715,6 +715,7 @@ table_print_valheader(char *buf, size_t return; } + memset(buf, 0, bufsize); print_flags_buffer(buf, bufsize, tablevaltypes, vmask); } From owner-svn-src-head@FreeBSD.ORG Wed May 6 14:02:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15097491; Wed, 6 May 2015 14:02: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 041AF1A8C; Wed, 6 May 2015 14:02: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 t46E2vOt015908; Wed, 6 May 2015 14:02:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46E2vuA015907; Wed, 6 May 2015 14:02:57 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201505061402.t46E2vuA015907@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 6 May 2015 14:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282536 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 14:02:58 -0000 Author: ae Date: Wed May 6 14:02:57 2015 New Revision: 282536 URL: https://svnweb.freebsd.org/changeset/base/282536 Log: Pass mtag argument into m_tag_locate() to continue the search from the last found mtag. Modified: head/sys/net/if_me.c Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Wed May 6 11:50:30 2015 (r282535) +++ head/sys/net/if_me.c Wed May 6 14:02:57 2015 (r282536) @@ -477,7 +477,7 @@ me_check_nesting(struct ifnet *ifp, stru count = 1; mtag = NULL; - while ((mtag = m_tag_locate(m, MTAG_ME, 0, NULL)) != NULL) { + while ((mtag = m_tag_locate(m, MTAG_ME, 0, mtag)) != NULL) { if (*(struct ifnet **)(mtag + 1) == ifp) { log(LOG_NOTICE, "%s: loop detected\n", ifp->if_xname); return (EIO); From owner-svn-src-head@FreeBSD.ORG Wed May 6 14:09:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70C896CB; Wed, 6 May 2015 14:09: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 5E5AE1AFA; Wed, 6 May 2015 14:09: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 t46E9trw016821; Wed, 6 May 2015 14:09:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46E9tGQ016820; Wed, 6 May 2015 14:09:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505061409.t46E9tGQ016820@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 6 May 2015 14:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282537 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 14:09:55 -0000 Author: andrew Date: Wed May 6 14:09:54 2015 New Revision: 282537 URL: https://svnweb.freebsd.org/changeset/base/282537 Log: If the power management timer is unsupported the PmTimerLength value will be zero. Modified: head/sys/dev/acpica/acpi_timer.c Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Wed May 6 14:02:57 2015 (r282536) +++ head/sys/dev/acpica/acpi_timer.c Wed May 6 14:09:54 2015 (r282537) @@ -128,7 +128,8 @@ acpi_timer_identify(driver_t *driver, de ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); if (acpi_disabled("timer") || (acpi_quirks & ACPI_Q_TIMER) || - acpi_timer_dev || acpi_timer_disabled) + acpi_timer_dev || acpi_timer_disabled || + AcpiGbl_FADT.PmTimerLength == 0) return_VOID; if ((dev = BUS_ADD_CHILD(parent, 2, "acpi_timer", 0)) == NULL) { From owner-svn-src-head@FreeBSD.ORG Wed May 6 14:14:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8853595E; Wed, 6 May 2015 14:14: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 74E1C1C13; Wed, 6 May 2015 14:14: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 t46EEFSx021018; Wed, 6 May 2015 14:14:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46EEFCh021017; Wed, 6 May 2015 14:14:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505061414.t46EEFCh021017@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 6 May 2015 14:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282538 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 14:14:15 -0000 Author: andrew Date: Wed May 6 14:14:14 2015 New Revision: 282538 URL: https://svnweb.freebsd.org/changeset/base/282538 Log: AcpiGbl_FACS will not be defined when building using the reduced hardware model. This may be the case on ARM. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed May 6 14:09:54 2015 (r282537) +++ head/sys/dev/acpica/acpi.c Wed May 6 14:14:14 2015 (r282538) @@ -605,9 +605,11 @@ acpi_attach(device_t dev) if (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) sc->acpi_handle_reboot = 1; +#if !ACPI_REDUCED_HARDWARE /* Only enable S4BIOS by default if the FACS says it is available. */ if (AcpiGbl_FACS != NULL && AcpiGbl_FACS->Flags & ACPI_FACS_S4_BIOS_PRESENT) sc->acpi_s4bios = 1; +#endif /* Probe all supported sleep states. */ acpi_sleep_states[ACPI_STATE_S0] = TRUE; From owner-svn-src-head@FreeBSD.ORG Wed May 6 15:17:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6AA3F21; Wed, 6 May 2015 15:17: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 C51921376; Wed, 6 May 2015 15:17: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 t46FHT2G055503; Wed, 6 May 2015 15:17:29 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46FHSb1055497; Wed, 6 May 2015 15:17:28 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201505061517.t46FHSb1055497@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 6 May 2015 15:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282547 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 15:17:30 -0000 Author: zbb Date: Wed May 6 15:17:28 2015 New Revision: 282547 URL: https://svnweb.freebsd.org/changeset/base/282547 Log: Add new CP15 operations and DB_SHOW_COMMAND to print CP15 registers Submitted by: Wojciech Macek Reviewed by: imp, Michal Meloun Obtained from: Semihalf Modified: head/sys/arm/arm/machdep.c head/sys/arm/include/armreg.h head/sys/arm/include/cpu-v6.h head/sys/arm/include/sysreg.h Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed May 6 15:10:50 2015 (r282546) +++ head/sys/arm/arm/machdep.c Wed May 6 15:17:28 2015 (r282547) @@ -114,7 +114,57 @@ __FBSDID("$FreeBSD$"); #ifdef DDB #include -#endif + +#if __ARM_ARCH >= 6 +#include + +DB_SHOW_COMMAND(cp15, db_show_cp15) +{ + u_int reg; + + reg = cp15_midr_get(); + db_printf("Cpu ID: 0x%08x\n", reg); + reg = cp15_ctr_get(); + db_printf("Current Cache Lvl ID: 0x%08x\n",reg); + + reg = cp15_sctlr_get(); + db_printf("Ctrl: 0x%08x\n",reg); + reg = cp15_actlr_get(); + db_printf("Aux Ctrl: 0x%08x\n",reg); + + reg = cp15_id_pfr0_get(); + db_printf("Processor Feat 0: 0x%08x\n", reg); + reg = cp15_id_pfr1_get(); + db_printf("Processor Feat 1: 0x%08x\n", reg); + reg = cp15_id_dfr0_get(); + db_printf("Debug Feat 0: 0x%08x\n", reg); + reg = cp15_id_afr0_get(); + db_printf("Auxiliary Feat 0: 0x%08x\n", reg); + reg = cp15_id_mmfr0_get(); + db_printf("Memory Model Feat 0: 0x%08x\n", reg); + reg = cp15_id_mmfr1_get(); + db_printf("Memory Model Feat 1: 0x%08x\n", reg); + reg = cp15_id_mmfr2_get(); + db_printf("Memory Model Feat 2: 0x%08x\n", reg); + reg = cp15_id_mmfr3_get(); + db_printf("Memory Model Feat 3: 0x%08x\n", reg); + reg = cp15_ttbr_get(); + db_printf("TTB0: 0x%08x\n", reg); +} + +DB_SHOW_COMMAND(vtop, db_show_vtop) +{ + u_int reg; + + if (have_addr) { + cp15_ats1cpr_set(addr); + reg = cp15_par_get(); + db_printf("Physical address reg: 0x%08x\n",reg); + } else + db_printf("show vtop \n"); +} +#endif /* __ARM_ARCH >= 6 */ +#endif /* DDB */ #ifdef DEBUG #define debugf(fmt, args...) printf(fmt, ##args) Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Wed May 6 15:10:50 2015 (r282546) +++ head/sys/arm/include/armreg.h Wed May 6 15:17:28 2015 (r282547) @@ -346,6 +346,9 @@ #define CPUV7_CT_xSIZE_ASSOC(x) (((x) >> 3) & 0x3ff) /* associativity */ #define CPUV7_CT_xSIZE_SET(x) (((x) >> 13) & 0x7fff) /* num sets */ +#define CPUV7_L2CTLR_NPROC_SHIFT 24 +#define CPUV7_L2CTLR_NPROC(r) ((((r) >> CPUV7_L2CTLR_NPROC_SHIFT) & 3) + 1) + #define CPU_CLIDR_CTYPE(reg,x) (((reg) >> ((x) * 3)) & 0x7) #define CPU_CLIDR_LOUIS(reg) (((reg) >> 21) & 0x7) #define CPU_CLIDR_LOC(reg) (((reg) >> 24) & 0x7) Modified: head/sys/arm/include/cpu-v6.h ============================================================================== --- head/sys/arm/include/cpu-v6.h Wed May 6 15:10:50 2015 (r282546) +++ head/sys/arm/include/cpu-v6.h Wed May 6 15:17:28 2015 (r282547) @@ -143,6 +143,13 @@ _RF0(cp15_ttbr_get, CP15_TTBR0(%0)) _RF0(cp15_dfar_get, CP15_DFAR(%0)) #if __ARM_ARCH >= 7 _RF0(cp15_ifar_get, CP15_IFAR(%0)) +_RF0(cp15_l2ctlr_get, CP15_L2CTLR(%0)) +#endif +#if __ARM_ARCH >= 6 +_RF0(cp15_actlr_get, CP15_ACTLR(%0)) +_WF1(cp15_ats1cpr_set, CP15_ATS1CPR(%0)); +_RF0(cp15_par_get, CP15_PAR); +_RF0(cp15_sctlr_get, CP15_SCTLR(%0)) #endif /*CPU id registers */ Modified: head/sys/arm/include/sysreg.h ============================================================================== --- head/sys/arm/include/sysreg.h Wed May 6 15:10:50 2015 (r282546) +++ head/sys/arm/include/sysreg.h Wed May 6 15:17:28 2015 (r282547) @@ -212,6 +212,7 @@ #if __ARM_ARCH == 6 && defined(CPU_ARM1176) #define CP15_PMCCNTR(rr) p15, 0, rr, c15, c12, 1 /* PM Cycle Count Register */ #elif __ARM_ARCH > 6 +#define CP15_L2CTLR(rr) p15, 1, rr, c9, c0, 2 /* L2 Control Register */ #define CP15_PMCR(rr) p15, 0, rr, c9, c12, 0 /* Performance Monitor Control Register */ #define CP15_PMCNTENSET(rr) p15, 0, rr, c9, c12, 1 /* PM Count Enable Set Register */ #define CP15_PMCNTENCLR(rr) p15, 0, rr, c9, c12, 2 /* PM Count Enable Clear Register */ From owner-svn-src-head@FreeBSD.ORG Wed May 6 15:20:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A443922B; Wed, 6 May 2015 15:20:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78635139E; Wed, 6 May 2015 15:20: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 t46FKpd9056091; Wed, 6 May 2015 15:20:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46FKpKo056088; Wed, 6 May 2015 15:20:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201505061520.t46FKpKo056088@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 May 2015 15:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282549 - in head: . tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 15:20:51 -0000 Author: emaste Date: Wed May 6 15:20:50 2015 New Revision: 282549 URL: https://svnweb.freebsd.org/changeset/base/282549 Log: Fix make delete-old for gperf and GCC/CXX options - Optional components go in OptionalObsoleteFiles - Move gperf removal to be based on MK_GCC only, not MK_CXX and MK_GCC Reviewed by: imp, sbruno Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2421 Modified: head/ObsoleteFiles.inc head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed May 6 15:20:29 2015 (r282548) +++ head/ObsoleteFiles.inc Wed May 6 15:20:50 2015 (r282549) @@ -430,10 +430,6 @@ OLD_FILES+=usr/lib/debug/usr/lib32/i18n OLD_FILES+=usr/lib/debug/usr/lib32/private # 20141015: OpenSSL 1.0.1j import OLD_FILES+=usr/share/openssl/man/man3/CMS_sign_add1_signer.3.gz -.if ${MK_GCC} == "no" -# 20141009: gperf disabled by default -OLD_FILES+=usr/bin/gperf -.endif # 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed May 6 15:20:29 2015 (r282548) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed May 6 15:20:50 2015 (r282549) @@ -1009,12 +1009,6 @@ OLD_FILES+=usr/bin/c++filt .endif OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/libexec/cc1plus -.if ${MK_GCC} == no -OLD_FILES+=usr/bin/gperf -OLD_FILES+=usr/share/info/gperf.info.gz -OLD_FILES+=usr/share/man/man1/gperf.1.gz -OLD_FILES+=usr/share/man/man1/gperf.7.gz -.endif .endif .if ${MK_FMTREE} == no @@ -1729,6 +1723,7 @@ OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/bin/gcc OLD_FILES+=usr/bin/gcov OLD_FILES+=usr/bin/gcpp +OLD_FILES+=usr/bin/gperf .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/gcc/4.2/__wmmintrin_aes.h OLD_FILES+=usr/include/gcc/4.2/__wmmintrin_pclmul.h @@ -1754,10 +1749,13 @@ OLD_FILES+=usr/share/info/cpp.info.gz OLD_FILES+=usr/share/info/cppinternals.info.gz OLD_FILES+=usr/share/info/gcc.info.gz OLD_FILES+=usr/share/info/gccint.info.gz +OLD_FILES+=usr/share/info/gperf.info.gz OLD_FILES+=usr/share/man/man1/g++.1.gz OLD_FILES+=usr/share/man/man1/gcc.1.gz OLD_FILES+=usr/share/man/man1/gcov.1.gz OLD_FILES+=usr/share/man/man1/gcpp.1.gz +OLD_FILES+=usr/share/man/man1/gperf.1.gz +OLD_FILES+=usr/share/man/man1/gperf.7.gz .endif .if ${MK_GCOV} == no From owner-svn-src-head@FreeBSD.ORG Wed May 6 15:25:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DF56467; Wed, 6 May 2015 15:25:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0C7E14DC; Wed, 6 May 2015 15:25: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 t46FPK4h060262; Wed, 6 May 2015 15:25:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46FPKlE060261; Wed, 6 May 2015 15:25:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505061525.t46FPKlE060261@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 6 May 2015 15:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282550 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 15:25:21 -0000 Author: jhb Date: Wed May 6 15:25:20 2015 New Revision: 282550 URL: https://svnweb.freebsd.org/changeset/base/282550 Log: A few style fixes and expand the comment a bit on what _fixtelldir() is doing. Modified: head/lib/libc/gen/telldir.c Modified: head/lib/libc/gen/telldir.c ============================================================================== --- head/lib/libc/gen/telldir.c Wed May 6 15:20:50 2015 (r282549) +++ head/lib/libc/gen/telldir.c Wed May 6 15:25:20 2015 (r282550) @@ -101,11 +101,12 @@ _seekdir(dirp, loc) return; if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) return; - /* If it's within the same chunk of data, don't bother reloading */ + + /* If it's within the same chunk of data, don't bother reloading. */ if (lp->loc_seek == dirp->dd_seek) { /* * If we go back to 0 don't make the next readdir - * trigger a call to getdirentries() + * trigger a call to getdirentries(). */ if (lp->loc_loc == 0) dirp->dd_flags |= __DTF_SKIPREAD; @@ -124,10 +125,13 @@ _seekdir(dirp, loc) } /* - * when we do a read and cross a boundary, any telldir we - * just did will have wrong information in it. - * We need to move it from "beyond the end of the previous chunk" - * to "the beginning of the new chunk" + * A call to telldir after readdir returns the last entry in a block + * returns a location that is after the end of the last entry in that + * block. However, that location doesn't refer to a valid directory + * entry. Instead, these locations should refer to the first entry in + * the next block. That location is not known until the next block is + * read, so readdir calls this function after fetching a new block to + * fix any such telldir locations. */ void _fixtelldir(DIR *dirp, long oldseek, long oldloc) From owner-svn-src-head@FreeBSD.ORG Wed May 6 15:29:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BDDF72E; Wed, 6 May 2015 15:29: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 4A08D1529; Wed, 6 May 2015 15:29: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 t46FTChP061062; Wed, 6 May 2015 15:29:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46FTB1v061059; Wed, 6 May 2015 15:29:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201505061529.t46FTB1v061059@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 May 2015 15:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282551 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 15:29:12 -0000 Author: emaste Date: Wed May 6 15:29:11 2015 New Revision: 282551 URL: https://svnweb.freebsd.org/changeset/base/282551 Log: Remove historical GNUC test The requirement is for a GCC-compatible compiler and not necessarily GCC itself. However, we currently expect any compiler used for building the whole of FreeBSD to be GCC-compatible and many things will break if not; there's no longer a need to have an explicit test for this in rtld. Reviewed by: imp, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2422 Modified: head/libexec/rtld-elf/debug.h head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/debug.h ============================================================================== --- head/libexec/rtld-elf/debug.h Wed May 6 15:25:20 2015 (r282550) +++ head/libexec/rtld-elf/debug.h Wed May 6 15:29:11 2015 (r282551) @@ -32,10 +32,6 @@ #ifndef DEBUG_H #define DEBUG_H 1 -#ifndef __GNUC__ -#error "This file must be compiled with GCC" -#endif - #include #include Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed May 6 15:25:20 2015 (r282550) +++ head/libexec/rtld-elf/rtld.c Wed May 6 15:29:11 2015 (r282551) @@ -34,10 +34,6 @@ * John Polstra . */ -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif - #include #include #include From owner-svn-src-head@FreeBSD.ORG Wed May 6 15:30:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D01488F; Wed, 6 May 2015 15:30: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 3C12C1535; Wed, 6 May 2015 15:30:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t46FU68C061318; Wed, 6 May 2015 15:30:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46FU6CA061317; Wed, 6 May 2015 15:30:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505061530.t46FU6CA061317@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 6 May 2015 15:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282552 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 15:30:06 -0000 Author: jhb Date: Wed May 6 15:30:05 2015 New Revision: 282552 URL: https://svnweb.freebsd.org/changeset/base/282552 Log: Remove the note about seekdir() removing telldir() cookies. That was removed back in r269204. MFC after: 3 days Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Wed May 6 15:29:11 2015 (r282551) +++ head/lib/libc/gen/directory.3 Wed May 6 15:30:05 2015 (r282552) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 28, 2014 +.Dd May 6, 2015 .Dt DIRECTORY 3 .Os .Sh NAME @@ -263,12 +263,6 @@ function appeared in function appeared in .Fx 10.0 . .Sh BUGS -The invalidation of -.Fn telldir -tokens when calling -.Fn seekdir -is non-standard. This is a compile time option. -.Pp The behaviour of .Fn telldir and From owner-svn-src-head@FreeBSD.ORG Wed May 6 16:25:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 400039E8; Wed, 6 May 2015 16:25:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C4791C1F; Wed, 6 May 2015 16:25:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t46GPN7R091149; Wed, 6 May 2015 16:25:23 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46GPKoN091132; Wed, 6 May 2015 16:25:20 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505061625.t46GPKoN091132@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 6 May 2015 16:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282558 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 16:25:23 -0000 Author: neel Date: Wed May 6 16:25:20 2015 New Revision: 282558 URL: https://svnweb.freebsd.org/changeset/base/282558 Log: Deprecate the 3-way return values from vm_gla2gpa() and vm_copy_setup(). Prior to this change both functions returned 0 for success, -1 for failure and +1 to indicate that an exception was injected into the guest. The numerical value of ERESTART also happens to be -1 so when these functions returned -1 it had to be translated to a positive errno value to prevent the VM_RUN ioctl from being inadvertently restarted. This made it easy to introduce bugs when writing emulation code. Fix this by adding an 'int *guest_fault' parameter and setting it to '1' if an exception was delivered to the guest. The return value is 0 or EFAULT so no additional translation is needed. Reviewed by: tychon MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D2428 Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_instruction_emul.c head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/task_switch.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Wed May 6 16:21:12 2015 (r282557) +++ head/lib/libvmmapi/vmmapi.c Wed May 6 16:25:20 2015 (r282558) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -958,9 +959,9 @@ vm_get_hpet_capabilities(struct vmctx *c return (error); } -static int -gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla, int prot, int *fault, uint64_t *gpa) +int +vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa, int *fault) { struct vm_gla2gpa gg; int error; @@ -979,29 +980,18 @@ gla2gpa(struct vmctx *ctx, int vcpu, str return (error); } -int -vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa) -{ - int error, fault; - - error = gla2gpa(ctx, vcpu, paging, gla, prot, &fault, gpa); - if (fault) - error = fault; - return (error); -} - #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt) + uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt, + int *fault) { void *va; uint64_t gpa; - int error, fault, i, n, off; + int error, i, n, off; for (i = 0; i < iovcnt; i++) { iov[i].iov_base = 0; @@ -1010,18 +1000,16 @@ vm_copy_setup(struct vmctx *ctx, int vcp while (len) { assert(iovcnt > 0); - error = gla2gpa(ctx, vcpu, paging, gla, prot, &fault, &gpa); - if (error) - return (-1); - if (fault) - return (1); + error = vm_gla2gpa(ctx, vcpu, paging, gla, prot, &gpa, fault); + if (error || *fault) + return (error); off = gpa & PAGE_MASK; n = min(len, PAGE_SIZE - off); va = vm_map_gpa(ctx, gpa, n); if (va == NULL) - return (-1); + return (EFAULT); iov->iov_base = va; iov->iov_len = n; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Wed May 6 16:21:12 2015 (r282557) +++ head/lib/libvmmapi/vmmapi.h Wed May 6 16:25:20 2015 (r282558) @@ -64,7 +64,7 @@ int vm_setup_memory(struct vmctx *ctx, s void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa); + uint64_t gla, int prot, uint64_t *gpa, int *fault); uint32_t vm_get_lowmem_limit(struct vmctx *ctx); void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); void vm_set_memflags(struct vmctx *ctx, int flags); @@ -131,10 +131,15 @@ int vm_get_hpet_capabilities(struct vmct /* * Translate the GLA range [gla,gla+len) into GPA segments in 'iov'. * The 'iovcnt' should be big enough to accomodate all GPA segments. - * Returns 0 on success, 1 on a guest fault condition and -1 otherwise. + * + * retval fault Interpretation + * 0 0 Success + * 0 1 An exception was injected into the guest + * EFAULT N/A Error */ int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *pg, - uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt); + uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt, + int *fault); void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov, void *host_dst, size_t len); void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed May 6 16:21:12 2015 (r282557) +++ head/sys/amd64/include/vmm.h Wed May 6 16:25:20 2015 (r282558) @@ -345,9 +345,10 @@ struct vm_copyinfo { * at 'gla' and 'len' bytes long. The 'prot' should be set to PROT_READ for * a copyin or PROT_WRITE for a copyout. * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. + * retval is_fault Intepretation + * 0 0 Success + * 0 1 An exception was injected into the guest + * EFAULT N/A Unrecoverable error * * The 'copyinfo[]' can be passed to 'vm_copyin()' or 'vm_copyout()' only if * the return value is 0. The 'copyinfo[]' resources should be freed by calling @@ -355,7 +356,7 @@ struct vm_copyinfo { */ int vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo, - int num_copyinfo); + int num_copyinfo, int *is_fault); void vm_copy_teardown(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, int num_copyinfo); void vm_copyin(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Wed May 6 16:21:12 2015 (r282557) +++ head/sys/amd64/include/vmm_instruction_emul.h Wed May 6 16:25:20 2015 (r282558) @@ -81,17 +81,19 @@ int vie_calculate_gla(enum vm_cpu_mode c */ int vmm_fetch_instruction(struct vm *vm, int cpuid, struct vm_guest_paging *guest_paging, - uint64_t rip, int inst_length, struct vie *vie); + uint64_t rip, int inst_length, struct vie *vie, + int *is_fault); /* * Translate the guest linear address 'gla' to a guest physical address. * - * Returns 0 on success and '*gpa' contains the result of the translation. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. + * retval is_fault Interpretation + * 0 0 'gpa' contains result of the translation + * 0 1 An exception was injected into the guest + * EFAULT N/A An unrecoverable hypervisor error occurred */ int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa); + uint64_t gla, int prot, uint64_t *gpa, int *is_fault); void vie_init(struct vie *vie, const char *inst_bytes, int inst_length); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Wed May 6 16:21:12 2015 (r282557) +++ head/sys/amd64/vmm/vmm.c Wed May 6 16:25:20 2015 (r282558) @@ -1256,7 +1256,7 @@ vm_handle_inst_emul(struct vm *vm, int v mem_region_read_t mread; mem_region_write_t mwrite; enum vm_cpu_mode cpu_mode; - int cs_d, error, length; + int cs_d, error, fault, length; vcpu = &vm->vcpu[vcpuid]; vme = &vcpu->exitinfo; @@ -1279,19 +1279,15 @@ vm_handle_inst_emul(struct vm *vm, int v */ length = vme->inst_length ? vme->inst_length : VIE_INST_SIZE; error = vmm_fetch_instruction(vm, vcpuid, paging, vme->rip + - cs_base, length, vie); + cs_base, length, vie, &fault); } else { /* * The instruction bytes have already been copied into 'vie' */ - error = 0; + error = fault = 0; } - if (error == 1) - return (0); /* Resume guest to handle page fault */ - else if (error == -1) - return (EFAULT); - else if (error != 0) - panic("%s: vmm_fetch_instruction error %d", __func__, error); + if (error || fault) + return (error); if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, cs_d, vie) != 0) { VCPU_CTR1(vm, vcpuid, "Error decoding instruction at %#lx", @@ -2323,7 +2319,7 @@ vm_copy_teardown(struct vm *vm, int vcpu int vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo, - int num_copyinfo) + int num_copyinfo, int *fault) { int error, idx, nused; size_t n, off, remaining; @@ -2336,8 +2332,8 @@ vm_copy_setup(struct vm *vm, int vcpuid, remaining = len; while (remaining > 0) { KASSERT(nused < num_copyinfo, ("insufficient vm_copyinfo")); - error = vm_gla2gpa(vm, vcpuid, paging, gla, prot, &gpa); - if (error) + error = vm_gla2gpa(vm, vcpuid, paging, gla, prot, &gpa, fault); + if (error || *fault) return (error); off = gpa & PAGE_MASK; n = min(remaining, PAGE_SIZE - off); @@ -2359,8 +2355,9 @@ vm_copy_setup(struct vm *vm, int vcpuid, if (idx != nused) { vm_copy_teardown(vm, vcpuid, copyinfo, num_copyinfo); - return (-1); + return (EFAULT); } else { + *fault = 0; return (0); } } Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Wed May 6 16:21:12 2015 (r282557) +++ head/sys/amd64/vmm/vmm_dev.c Wed May 6 16:25:20 2015 (r282558) @@ -441,19 +441,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long c CTASSERT(PROT_EXEC == VM_PROT_EXECUTE); gg = (struct vm_gla2gpa *)data; error = vm_gla2gpa(sc->vm, gg->vcpuid, &gg->paging, gg->gla, - gg->prot, &gg->gpa); - KASSERT(error == 0 || error == 1 || error == -1, + gg->prot, &gg->gpa, &gg->fault); + KASSERT(error == 0 || error == EFAULT, ("%s: vm_gla2gpa unknown error %d", __func__, error)); - if (error >= 0) { - /* - * error = 0: the translation was successful - * error = 1: a fault was injected into the guest - */ - gg->fault = error; - error = 0; - } else { - error = EFAULT; - } break; } case VM_ACTIVATE_CPU: Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Wed May 6 16:21:12 2015 (r282557) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Wed May 6 16:25:20 2015 (r282558) @@ -597,13 +597,11 @@ emulate_movx(void *vm, int vcpuid, uint6 /* * Helper function to calculate and validate a linear address. - * - * Returns 0 on success and 1 if an exception was injected into the guest. */ static int get_gla(void *vm, int vcpuid, struct vie *vie, struct vm_guest_paging *paging, int opsize, int addrsize, int prot, enum vm_reg_name seg, - enum vm_reg_name gpr, uint64_t *gla) + enum vm_reg_name gpr, uint64_t *gla, int *fault) { struct seg_desc desc; uint64_t cr0, val, rflags; @@ -629,7 +627,7 @@ get_gla(void *vm, int vcpuid, struct vie vm_inject_ss(vm, vcpuid, 0); else vm_inject_gp(vm, vcpuid); - return (1); + goto guest_fault; } if (vie_canonical_check(paging->cpu_mode, *gla)) { @@ -637,14 +635,19 @@ get_gla(void *vm, int vcpuid, struct vie vm_inject_ss(vm, vcpuid, 0); else vm_inject_gp(vm, vcpuid); - return (1); + goto guest_fault; } if (vie_alignment_check(paging->cpl, opsize, cr0, rflags, *gla)) { vm_inject_ac(vm, vcpuid, 0); - return (1); + goto guest_fault; } + *fault = 0; + return (0); + +guest_fault: + *fault = 1; return (0); } @@ -660,7 +663,7 @@ emulate_movs(void *vm, int vcpuid, uint6 #endif uint64_t dstaddr, srcaddr, dstgpa, srcgpa, val; uint64_t rcx, rdi, rsi, rflags; - int error, opsize, seg, repeat; + int error, fault, opsize, seg, repeat; opsize = (vie->op.op_byte == 0xA4) ? 1 : vie->opsize; val = 0; @@ -683,8 +686,10 @@ emulate_movs(void *vm, int vcpuid, uint6 * The count register is %rcx, %ecx or %cx depending on the * address size of the instruction. */ - if ((rcx & vie_size2mask(vie->addrsize)) == 0) - return (0); + if ((rcx & vie_size2mask(vie->addrsize)) == 0) { + error = 0; + goto done; + } } /* @@ -705,13 +710,16 @@ emulate_movs(void *vm, int vcpuid, uint6 seg = vie->segment_override ? vie->segment_register : VM_REG_GUEST_DS; error = get_gla(vm, vcpuid, vie, paging, opsize, vie->addrsize, - PROT_READ, seg, VM_REG_GUEST_RSI, &srcaddr); - if (error) + PROT_READ, seg, VM_REG_GUEST_RSI, &srcaddr, &fault); + if (error || fault) goto done; error = vm_copy_setup(vm, vcpuid, paging, srcaddr, opsize, PROT_READ, - copyinfo, nitems(copyinfo)); + copyinfo, nitems(copyinfo), &fault); if (error == 0) { + if (fault) + goto done; /* Resume guest to handle fault */ + /* * case (2): read from system memory and write to mmio. */ @@ -720,11 +728,6 @@ emulate_movs(void *vm, int vcpuid, uint6 error = memwrite(vm, vcpuid, gpa, val, opsize, arg); if (error) goto done; - } else if (error > 0) { - /* - * Resume guest execution to handle fault. - */ - goto done; } else { /* * 'vm_copy_setup()' is expected to fail for cases (3) and (4) @@ -732,13 +735,17 @@ emulate_movs(void *vm, int vcpuid, uint6 */ error = get_gla(vm, vcpuid, vie, paging, opsize, vie->addrsize, - PROT_WRITE, VM_REG_GUEST_ES, VM_REG_GUEST_RDI, &dstaddr); - if (error) + PROT_WRITE, VM_REG_GUEST_ES, VM_REG_GUEST_RDI, &dstaddr, + &fault); + if (error || fault) goto done; error = vm_copy_setup(vm, vcpuid, paging, dstaddr, opsize, - PROT_WRITE, copyinfo, nitems(copyinfo)); + PROT_WRITE, copyinfo, nitems(copyinfo), &fault); if (error == 0) { + if (fault) + goto done; /* Resume guest to handle fault */ + /* * case (3): read from MMIO and write to system memory. * @@ -754,27 +761,29 @@ emulate_movs(void *vm, int vcpuid, uint6 vm_copyout(vm, vcpuid, &val, copyinfo, opsize); vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); - } else if (error > 0) { - /* - * Resume guest execution to handle fault. - */ - goto done; } else { /* * Case (4): read from and write to mmio. + * + * Commit to the MMIO read/write (with potential + * side-effects) only after we are sure that the + * instruction is not going to be restarted due + * to address translation faults. */ error = vm_gla2gpa(vm, vcpuid, paging, srcaddr, - PROT_READ, &srcgpa); - if (error) - goto done; - error = memread(vm, vcpuid, srcgpa, &val, opsize, arg); - if (error) + PROT_READ, &srcgpa, &fault); + if (error || fault) goto done; error = vm_gla2gpa(vm, vcpuid, paging, dstaddr, - PROT_WRITE, &dstgpa); + PROT_WRITE, &dstgpa, &fault); + if (error || fault) + goto done; + + error = memread(vm, vcpuid, srcgpa, &val, opsize, arg); if (error) goto done; + error = memwrite(vm, vcpuid, dstgpa, val, opsize, arg); if (error) goto done; @@ -819,10 +828,9 @@ emulate_movs(void *vm, int vcpuid, uint6 vm_restart_instruction(vm, vcpuid); } done: - if (error < 0) - return (EFAULT); - else - return (0); + KASSERT(error == 0 || error == EFAULT, ("%s: unexpected error %d", + __func__, error)); + return (error); } static int @@ -1185,7 +1193,7 @@ emulate_stack_op(void *vm, int vcpuid, u #endif struct seg_desc ss_desc; uint64_t cr0, rflags, rsp, stack_gla, val; - int error, size, stackaddrsize, pushop; + int error, fault, size, stackaddrsize, pushop; val = 0; size = vie->opsize; @@ -1251,18 +1259,10 @@ emulate_stack_op(void *vm, int vcpuid, u } error = vm_copy_setup(vm, vcpuid, paging, stack_gla, size, - pushop ? PROT_WRITE : PROT_READ, copyinfo, nitems(copyinfo)); - if (error == -1) { - /* - * XXX cannot return a negative error value here because it - * ends up being the return value of the VM_RUN() ioctl and - * is interpreted as a pseudo-error (for e.g. ERESTART). - */ - return (EFAULT); - } else if (error == 1) { - /* Resume guest execution to handle page fault */ - return (0); - } + pushop ? PROT_WRITE : PROT_READ, copyinfo, nitems(copyinfo), + &fault); + if (error || fault) + return (error); if (pushop) { error = memread(vm, vcpuid, mmio_gpa, &val, size, arg); @@ -1672,7 +1672,7 @@ ptp_hold(struct vm *vm, vm_paddr_t ptpph int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa) + uint64_t gla, int prot, uint64_t *gpa, int *guest_fault) { int nlevels, pfcode, ptpshift, ptpindex, retval, usermode, writable; u_int retries; @@ -1680,6 +1680,8 @@ vm_gla2gpa(struct vm *vm, int vcpuid, st uint32_t *ptpbase32, pte32; void *cookie; + *guest_fault = 0; + usermode = (paging->cpl == 3 ? 1 : 0); writable = prot & VM_PROT_WRITE; cookie = NULL; @@ -1842,18 +1844,20 @@ restart: *gpa = pte | (gla & (pgsize - 1)); done: ptp_release(&cookie); + KASSERT(retval == 0 || retval == EFAULT, ("%s: unexpected retval %d", + __func__, retval)); return (retval); error: - retval = -1; + retval = EFAULT; goto done; fault: - retval = 1; + *guest_fault = 1; goto done; } int vmm_fetch_instruction(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, - uint64_t rip, int inst_length, struct vie *vie) + uint64_t rip, int inst_length, struct vie *vie, int *faultptr) { struct vm_copyinfo copyinfo[2]; int error, prot; @@ -1863,13 +1867,14 @@ vmm_fetch_instruction(struct vm *vm, int prot = PROT_READ | PROT_EXEC; error = vm_copy_setup(vm, vcpuid, paging, rip, inst_length, prot, - copyinfo, nitems(copyinfo)); - if (error == 0) { - vm_copyin(vm, vcpuid, copyinfo, vie->inst, inst_length); - vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); - vie->num_valid = inst_length; - } - return (error); + copyinfo, nitems(copyinfo), faultptr); + if (error || *faultptr) + return (error); + + vm_copyin(vm, vcpuid, copyinfo, vie->inst, inst_length); + vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); + vie->num_valid = inst_length; + return (0); } static int Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Wed May 6 16:21:12 2015 (r282557) +++ head/usr.sbin/bhyve/inout.c Wed May 6 16:25:20 2015 (r282558) @@ -107,7 +107,7 @@ emulate_inout(struct vmctx *ctx, int vcp uint32_t eax, val; inout_func_t handler; void *arg; - int error, retval; + int error, fault, retval; enum vm_reg_name idxreg; uint64_t gla, index, iterations, count; struct vm_inout_str *vis; @@ -163,11 +163,11 @@ emulate_inout(struct vmctx *ctx, int vcp } error = vm_copy_setup(ctx, vcpu, &vis->paging, gla, - bytes, prot, iov, nitems(iov)); - if (error == -1) { + bytes, prot, iov, nitems(iov), &fault); + if (error) { retval = -1; /* Unrecoverable error */ break; - } else if (error == 1) { + } else if (fault) { retval = 0; /* Resume guest to handle fault */ break; } Modified: head/usr.sbin/bhyve/task_switch.c ============================================================================== --- head/usr.sbin/bhyve/task_switch.c Wed May 6 16:21:12 2015 (r282557) +++ head/usr.sbin/bhyve/task_switch.c Wed May 6 16:25:20 2015 (r282558) @@ -202,7 +202,8 @@ desc_table_limit_check(struct vmctx *ctx */ static int desc_table_rw(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint16_t sel, struct user_segment_descriptor *desc, bool doread) + uint16_t sel, struct user_segment_descriptor *desc, bool doread, + int *faultptr) { struct iovec iov[2]; uint64_t base; @@ -215,28 +216,30 @@ desc_table_rw(struct vmctx *ctx, int vcp assert(limit >= SEL_LIMIT(sel)); error = vm_copy_setup(ctx, vcpu, paging, base + SEL_START(sel), - sizeof(*desc), doread ? PROT_READ : PROT_WRITE, iov, nitems(iov)); - if (error == 0) { - if (doread) - vm_copyin(ctx, vcpu, iov, desc, sizeof(*desc)); - else - vm_copyout(ctx, vcpu, desc, iov, sizeof(*desc)); - } - return (error); + sizeof(*desc), doread ? PROT_READ : PROT_WRITE, iov, nitems(iov), + faultptr); + if (error || *faultptr) + return (error); + + if (doread) + vm_copyin(ctx, vcpu, iov, desc, sizeof(*desc)); + else + vm_copyout(ctx, vcpu, desc, iov, sizeof(*desc)); + return (0); } static int desc_table_read(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint16_t sel, struct user_segment_descriptor *desc) + uint16_t sel, struct user_segment_descriptor *desc, int *faultptr) { - return (desc_table_rw(ctx, vcpu, paging, sel, desc, true)); + return (desc_table_rw(ctx, vcpu, paging, sel, desc, true, faultptr)); } static int desc_table_write(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint16_t sel, struct user_segment_descriptor *desc) + uint16_t sel, struct user_segment_descriptor *desc, int *faultptr) { - return (desc_table_rw(ctx, vcpu, paging, sel, desc, false)); + return (desc_table_rw(ctx, vcpu, paging, sel, desc, false, faultptr)); } /* @@ -248,7 +251,7 @@ desc_table_write(struct vmctx *ctx, int */ static int read_tss_descriptor(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, - uint16_t sel, struct user_segment_descriptor *desc) + uint16_t sel, struct user_segment_descriptor *desc, int *faultptr) { struct vm_guest_paging sup_paging; int error; @@ -267,7 +270,7 @@ read_tss_descriptor(struct vmctx *ctx, i sup_paging = ts->paging; sup_paging.cpl = 0; /* implicit supervisor mode */ - error = desc_table_read(ctx, vcpu, &sup_paging, sel, desc); + error = desc_table_read(ctx, vcpu, &sup_paging, sel, desc, faultptr); return (error); } @@ -301,14 +304,10 @@ ldt_desc(int sd_type) /* * Validate the descriptor 'seg_desc' associated with 'segment'. - * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. */ static int validate_seg_desc(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, - int segment, struct seg_desc *seg_desc) + int segment, struct seg_desc *seg_desc, int *faultptr) { struct vm_guest_paging sup_paging; struct user_segment_descriptor usd; @@ -369,8 +368,8 @@ validate_seg_desc(struct vmctx *ctx, int /* Read the descriptor from the GDT/LDT */ sup_paging = ts->paging; sup_paging.cpl = 0; /* implicit supervisor mode */ - error = desc_table_read(ctx, vcpu, &sup_paging, sel, &usd); - if (error) + error = desc_table_read(ctx, vcpu, &sup_paging, sel, &usd, faultptr); + if (error || *faultptr) return (error); /* Verify that the descriptor type is compatible with the segment */ @@ -476,14 +475,10 @@ update_seg_desc(struct vmctx *ctx, int v /* * Update the vcpu registers to reflect the state of the new task. - * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. */ static int tss32_restore(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, - uint16_t ot_sel, struct tss32 *tss, struct iovec *iov) + uint16_t ot_sel, struct tss32 *tss, struct iovec *iov, int *faultptr) { struct seg_desc seg_desc, seg_desc2; uint64_t *pdpte, maxphyaddr, reserved; @@ -565,8 +560,9 @@ tss32_restore(struct vmctx *ctx, int vcp vm_copyout(ctx, vcpu, tss, iov, sizeof(*tss)); /* Validate segment descriptors */ - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_LDTR, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_LDTR, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_LDTR, &seg_desc); @@ -579,33 +575,40 @@ tss32_restore(struct vmctx *ctx, int vcp * VM-entry checks so the guest can handle any exception injected * during task switch emulation. */ - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_CS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_CS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_SS, &seg_desc2); - if (error) + + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_SS, &seg_desc2, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_CS, &seg_desc); update_seg_desc(ctx, vcpu, VM_REG_GUEST_SS, &seg_desc2); ts->paging.cpl = tss->tss_cs & SEL_RPL_MASK; - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_DS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_DS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_DS, &seg_desc); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_ES, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_ES, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_ES, &seg_desc); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_FS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_FS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_FS, &seg_desc); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_GS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_GS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_GS, &seg_desc); @@ -616,14 +619,10 @@ tss32_restore(struct vmctx *ctx, int vcp * Push an error code on the stack of the new task. This is needed if the * task switch was triggered by a hardware exception that causes an error * code to be saved (e.g. #PF). - * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. */ static int push_errcode(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - int task_type, uint32_t errcode) + int task_type, uint32_t errcode, int *faultptr) { struct iovec iov[2]; struct seg_desc seg_desc; @@ -632,6 +631,8 @@ push_errcode(struct vmctx *ctx, int vcpu uint32_t esp; uint16_t stacksel; + *faultptr = 0; + cr0 = GETREG(ctx, vcpu, VM_REG_GUEST_CR0); rflags = GETREG(ctx, vcpu, VM_REG_GUEST_RFLAGS); stacksel = GETREG(ctx, vcpu, VM_REG_GUEST_SS); @@ -666,17 +667,19 @@ push_errcode(struct vmctx *ctx, int vcpu if (vie_calculate_gla(paging->cpu_mode, VM_REG_GUEST_SS, &seg_desc, esp, bytes, stacksize, PROT_WRITE, &gla)) { sel_exception(ctx, vcpu, IDT_SS, stacksel, 1); - return (1); + *faultptr = 1; + return (0); } if (vie_alignment_check(paging->cpl, bytes, cr0, rflags, gla)) { vm_inject_ac(ctx, vcpu, 1); - return (1); + *faultptr = 1; + return (0); } error = vm_copy_setup(ctx, vcpu, paging, gla, bytes, PROT_WRITE, - iov, nitems(iov)); - if (error) + iov, nitems(iov), faultptr); + if (error || *faultptr) return (error); vm_copyout(ctx, vcpu, &errcode, iov, bytes); @@ -687,16 +690,13 @@ push_errcode(struct vmctx *ctx, int vcpu /* * Evaluate return value from helper functions and potentially return to * the VM run loop. - * 0: success - * +1: an exception was injected into the guest vcpu - * -1: unrecoverable/programming error */ -#define CHKERR(x) \ +#define CHKERR(error,fault) \ do { \ - assert(((x) == 0) || ((x) == 1) || ((x) == -1)); \ - if ((x) == -1) \ + assert((error == 0) || (error == EFAULT)); \ + if (error) \ return (VMEXIT_ABORT); \ - else if ((x) == 1) \ + else if (fault) \ return (VMEXIT_CONTINUE); \ } while (0) @@ -711,7 +711,7 @@ vmexit_task_switch(struct vmctx *ctx, st struct iovec nt_iov[2], ot_iov[2]; uint64_t cr0, ot_base; uint32_t eip, ot_lim, access; - int error, ext, minlimit, nt_type, ot_type, vcpu; + int error, ext, fault, minlimit, nt_type, ot_type, vcpu; enum task_switch_reason reason; uint16_t nt_sel, ot_sel; @@ -739,8 +739,9 @@ vmexit_task_switch(struct vmctx *ctx, st sup_paging.cpl = 0; /* implicit supervisor mode */ /* Fetch the new TSS descriptor */ - error = read_tss_descriptor(ctx, vcpu, task_switch, nt_sel, &nt_desc); - CHKERR(error); + error = read_tss_descriptor(ctx, vcpu, task_switch, nt_sel, &nt_desc, + &fault); + CHKERR(error, fault); nt = usd_to_seg_desc(&nt_desc); @@ -792,8 +793,8 @@ vmexit_task_switch(struct vmctx *ctx, st /* Fetch the new TSS */ error = vm_copy_setup(ctx, vcpu, &sup_paging, nt.base, minlimit + 1, - PROT_READ | PROT_WRITE, nt_iov, nitems(nt_iov)); - CHKERR(error); + PROT_READ | PROT_WRITE, nt_iov, nitems(nt_iov), &fault); + CHKERR(error, fault); vm_copyin(ctx, vcpu, nt_iov, &newtss, minlimit + 1); /* Get the old TSS selector from the guest's task register */ @@ -818,13 +819,14 @@ vmexit_task_switch(struct vmctx *ctx, st assert(ot_type == SDT_SYS386BSY || ot_type == SDT_SYS286BSY); /* Fetch the old TSS descriptor */ - error = read_tss_descriptor(ctx, vcpu, task_switch, ot_sel, &ot_desc); - CHKERR(error); + error = read_tss_descriptor(ctx, vcpu, task_switch, ot_sel, &ot_desc, + &fault); + CHKERR(error, fault); /* Get the old TSS */ error = vm_copy_setup(ctx, vcpu, &sup_paging, ot_base, minlimit + 1, - PROT_READ | PROT_WRITE, ot_iov, nitems(ot_iov)); - CHKERR(error); + PROT_READ | PROT_WRITE, ot_iov, nitems(ot_iov), &fault); + CHKERR(error, fault); vm_copyin(ctx, vcpu, ot_iov, &oldtss, minlimit + 1); /* @@ -834,8 +836,8 @@ vmexit_task_switch(struct vmctx *ctx, st if (reason == TSR_IRET || reason == TSR_JMP) { ot_desc.sd_type &= ~0x2; error = desc_table_write(ctx, vcpu, &sup_paging, ot_sel, - &ot_desc); - CHKERR(error); + &ot_desc, &fault); + CHKERR(error, fault); } if (nt_type == SDT_SYS286BSY || nt_type == SDT_SYS286TSS) { @@ -853,8 +855,8 @@ vmexit_task_switch(struct vmctx *ctx, st if (reason != TSR_IRET) { nt_desc.sd_type |= 0x2; error = desc_table_write(ctx, vcpu, &sup_paging, nt_sel, - &nt_desc); - CHKERR(error); + &nt_desc, &fault); + CHKERR(error, fault); } /* Update task register to point at the new TSS */ @@ -877,8 +879,9 @@ vmexit_task_switch(struct vmctx *ctx, st assert(error == 0); /* Load processor state from new TSS */ - error = tss32_restore(ctx, vcpu, task_switch, ot_sel, &newtss, nt_iov); - CHKERR(error); + error = tss32_restore(ctx, vcpu, task_switch, ot_sel, &newtss, nt_iov, + &fault); + CHKERR(error, fault); /* * Section "Interrupt Tasks" in Intel SDM, Vol 3: if an exception @@ -889,8 +892,8 @@ vmexit_task_switch(struct vmctx *ctx, st assert(task_switch->ext); assert(task_switch->reason == TSR_IDT_GATE); error = push_errcode(ctx, vcpu, &task_switch->paging, nt_type, - task_switch->errcode); - CHKERR(error); + task_switch->errcode, &fault); + CHKERR(error, fault); } /* From owner-svn-src-head@FreeBSD.ORG Wed May 6 16:43:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 977ADDFD; Wed, 6 May 2015 16:43:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85CBB1E3B; Wed, 6 May 2015 16:43:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t46GhjIL000720; Wed, 6 May 2015 16:43:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46GhjFE000719; Wed, 6 May 2015 16:43:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201505061643.t46GhjFE000719@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 6 May 2015 16:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282559 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 16:43:45 -0000 Author: glebius Date: Wed May 6 16:43:44 2015 New Revision: 282559 URL: https://svnweb.freebsd.org/changeset/base/282559 Log: Printing interface names: o Restore historical behaviour of appending '*' if interface is down, and we have enough space to print it (usually we don't). [1] o Do not truncate interface names when printing in encoded format. o Report interface flags into encoded format. PR: 199873 [1] Sponsored by: Nginx, Inc. Modified: head/usr.bin/netstat/if.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Wed May 6 16:25:20 2015 (r282558) +++ head/usr.bin/netstat/if.c Wed May 6 16:43:44 2015 (r282559) @@ -315,7 +315,7 @@ intpr(int interval, void (*pfunc)(char * for (ifa = ifap; ifa; ifa = ifa->ifa_next) { bool network = false, link = false; - char *name; + char *name, *xname, buf[IFNAMSIZ+1]; if (interface != NULL && strcmp(ifa->ifa_name, interface) != 0) continue; @@ -341,10 +341,20 @@ intpr(int interval, void (*pfunc)(char * xo_open_instance("interface"); + if ((ifa->ifa_flags & IFF_UP) == 0) { + xname = stpcpy(buf, name); + *xname++ = '*'; + *xname = '\0'; + xname = buf; + } else + xname = name; + if (Wflag) - xo_emit("{tk:name/%-7.7s}", name); + xo_emit("{etk:name/%s}{e:flags/0x%x}{d:/%7.7s}", + name, ifa->ifa_flags, xname); else - xo_emit("{tk:name/%-5.5s}", name); + xo_emit("{etk:name/%s}{e:flags/0x%x}{d:/%5.5s}", + name, ifa->ifa_flags, xname); #define IFA_MTU(ifa) (((struct if_data *)(ifa)->ifa_data)->ifi_mtu) show_stat("lu", 6, "mtu", IFA_MTU(ifa), IFA_MTU(ifa)); From owner-svn-src-head@FreeBSD.ORG Wed May 6 16:45:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62908FFD; Wed, 6 May 2015 16:45:45 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BE9F01E5C; Wed, 6 May 2015 16:45:43 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t46GjdQ3057470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 May 2015 19:45:39 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t46Gjd8S057469; Wed, 6 May 2015 19:45:39 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 6 May 2015 19:45:39 +0300 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282559 - head/usr.bin/netstat Message-ID: <20150506164539.GD56147@FreeBSD.org> References: <201505061643.t46GhjFE000719@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201505061643.t46GhjFE000719@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 16:45:45 -0000 On Wed, May 06, 2015 at 04:43:45PM +0000, Gleb Smirnoff wrote: T> Printing interface names: T> T> o Do not truncate interface names when printing in encoded format. Note: now most of xo_emits in netstat(1) truncate in encoded format, which definitely isn't correct. Allan Jude promised to work on this. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed May 6 16:49:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06C1F309; Wed, 6 May 2015 16:49:41 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6F0D1E90; Wed, 6 May 2015 16:49:40 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CAE0BB9C3; Wed, 6 May 2015 12:49:39 -0400 (EDT) From: John Baldwin To: Julian Elischer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282485 - head/lib/libc/gen Date: Wed, 06 May 2015 11:41:22 -0400 Message-ID: <5998599.4tGHN4C7ck@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201505051452.t45EqXXv027613@svn.freebsd.org> References: <201505051452.t45EqXXv027613@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 06 May 2015 12:49:39 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 16:49:41 -0000 On Tuesday, May 05, 2015 02:52:33 PM Julian Elischer wrote: > Author: julian > Date: Tue May 5 14:52:33 2015 > New Revision: 282485 > URL: https://svnweb.freebsd.org/changeset/base/282485 > > Log: > Tweak seekdir, telldir and readdir so that when htere are deletes going on, > as seek to teh last location saved will still work. This is needed for Samba > to be able to correctly handle delete requests from windows. This does not > completely fix seekdir when deletes are present but fixes the worst of the > problems. The real solution must involve some changes to the API for eh VFS > and getdirentries(2). You really shouldn't be documenting Samba in this page. Also, your claim is wrong as it will still do the wrong thing if some _other_ process removes a file entry out from under you. I think it's fine to fix the implementation to cater to samba. I think it's very wrong to document it and encourage other people to rely on non-POSIX behavior. I would rather remove this entire block from BUGS and use much simpler language in IMPLEMENTATION NOTES to note that it is undefined if you will see or not see directory entries that are added or removed while scanning a directory. The language from here: http://pubs.opengroup.org/onlinepubs/009695399/functions/readdir.html Would work great, namely: If a file is removed from or added to the directory after the most recent call to opendir() or rewinddir(), whether a subsequent call to readdir() returns an entry for that file is unspecified. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed May 6 17:23:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A801D178; Wed, 6 May 2015 17:23: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 96C00134C; Wed, 6 May 2015 17:23: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 t46HNhr1020937; Wed, 6 May 2015 17:23:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46HNhQZ020935; Wed, 6 May 2015 17:23:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505061723.t46HNhQZ020935@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 6 May 2015 17:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282560 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 17:23:43 -0000 Author: jhb Date: Wed May 6 17:23:42 2015 New Revision: 282560 URL: https://svnweb.freebsd.org/changeset/base/282560 Log: Tweak the comment here some more. In particular, the previous opening sentence was a bit confusing. Noted by: kib Modified: head/lib/libc/gen/telldir.c Modified: head/lib/libc/gen/telldir.c ============================================================================== --- head/lib/libc/gen/telldir.c Wed May 6 16:43:44 2015 (r282559) +++ head/lib/libc/gen/telldir.c Wed May 6 17:23:42 2015 (r282560) @@ -125,13 +125,13 @@ _seekdir(dirp, loc) } /* - * A call to telldir after readdir returns the last entry in a block - * returns a location that is after the end of the last entry in that - * block. However, that location doesn't refer to a valid directory - * entry. Instead, these locations should refer to the first entry in - * the next block. That location is not known until the next block is - * read, so readdir calls this function after fetching a new block to - * fix any such telldir locations. + * After readdir returns the last entry in a block, a call to telldir + * returns a location that is after the end of that last entry. + * However, that location doesn't refer to a valid directory entry. + * Ideally, the call to telldir would return a location that refers to + * the first entry in the next block. That location is not known + * until the next block is read, so readdir calls this function after + * fetching a new block to fix any such telldir locations. */ void _fixtelldir(DIR *dirp, long oldseek, long oldloc) From owner-svn-src-head@FreeBSD.ORG Wed May 6 18:04:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DE9B32A; Wed, 6 May 2015 18:04: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 5BD3F187E; Wed, 6 May 2015 18:04: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 t46I4WIl042185; Wed, 6 May 2015 18:04:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46I4Wa1042184; Wed, 6 May 2015 18:04:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505061804.t46I4Wa1042184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 6 May 2015 18:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282563 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 18:04:32 -0000 Author: mav Date: Wed May 6 18:04:31 2015 New Revision: 282563 URL: https://svnweb.freebsd.org/changeset/base/282563 Log: Add memory barrier to r281764. While race at this point may cause only a single packet delay and so was not really reproduced, it is better to not have it at all. MFC after: 1 week Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Wed May 6 17:44:42 2015 (r282562) +++ head/usr.sbin/bhyve/pci_virtio_net.c Wed May 6 18:04:31 2015 (r282563) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -453,7 +454,7 @@ pci_vtnet_tx_thread(void *param) { struct pci_vtnet_softc *sc = param; struct vqueue_info *vq; - int have_work, error; + int error; vq = &sc->vsc_queues[VTNET_TXQ]; @@ -467,20 +468,16 @@ pci_vtnet_tx_thread(void *param) for (;;) { /* note - tx mutex is locked here */ - do { + while (sc->resetting || !vq_has_descs(vq)) { vq->vq_used->vu_flags &= ~VRING_USED_F_NO_NOTIFY; - if (sc->resetting) - have_work = 0; - else - have_work = vq_has_descs(vq); - - if (!have_work) { - sc->tx_in_progress = 0; - error = pthread_cond_wait(&sc->tx_cond, - &sc->tx_mtx); - assert(error == 0); - } - } while (!have_work); + mb(); + if (!sc->resetting && vq_has_descs(vq)) + break; + + sc->tx_in_progress = 0; + error = pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx); + assert(error == 0); + } vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; sc->tx_in_progress = 1; pthread_mutex_unlock(&sc->tx_mtx); From owner-svn-src-head@FreeBSD.ORG Wed May 6 19:47:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B3176AC; Wed, 6 May 2015 19:47: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 59C9F1456; Wed, 6 May 2015 19:47: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 t46JlWt6093811; Wed, 6 May 2015 19:47:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46JlWdr093810; Wed, 6 May 2015 19:47:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505061947.t46JlWdr093810@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 6 May 2015 19:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282565 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 19:47:32 -0000 Author: mav Date: Wed May 6 19:47:31 2015 New Revision: 282565 URL: https://svnweb.freebsd.org/changeset/base/282565 Log: Handle EDQUOT backend storage errors same as ENOSPC. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed May 6 18:16:27 2015 (r282564) +++ head/sys/cam/ctl/ctl_backend_block.c Wed May 6 19:47:31 2015 (r282565) @@ -521,7 +521,7 @@ ctl_be_block_biodone(struct bio *bio) if (beio->num_errors > 0) { if (error == EOPNOTSUPP) { ctl_set_invalid_opcode(&io->scsiio); - } else if (error == ENOSPC) { + } else if (error == ENOSPC || error == EDQUOT) { ctl_set_space_alloc_fail(&io->scsiio); } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ @@ -738,7 +738,7 @@ ctl_be_block_dispatch_file(struct ctl_be ctl_scsi_path_string(io, path_str, sizeof(path_str)); printf("%s%s command returned errno %d\n", path_str, (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", error); - if (error == ENOSPC) { + if (error == ENOSPC || error == EDQUOT) { ctl_set_space_alloc_fail(&io->scsiio); } else ctl_set_medium_error(&io->scsiio); @@ -895,7 +895,7 @@ ctl_be_block_dispatch_zvol(struct ctl_be * return the I/O to the user. */ if (error != 0) { - if (error == ENOSPC) { + if (error == ENOSPC || error == EDQUOT) { ctl_set_space_alloc_fail(&io->scsiio); } else ctl_set_medium_error(&io->scsiio); From owner-svn-src-head@FreeBSD.ORG Wed May 6 21:03:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD30BB5B; Wed, 6 May 2015 21:03: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 BC4331D8D; Wed, 6 May 2015 21:03: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 t46L3K7V035410; Wed, 6 May 2015 21:03:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46L3KdM035409; Wed, 6 May 2015 21:03:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201505062103.t46L3KdM035409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 6 May 2015 21:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282567 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 21:03:20 -0000 Author: mjg Date: Wed May 6 21:03:19 2015 New Revision: 282567 URL: https://svnweb.freebsd.org/changeset/base/282567 Log: Fix up panics when fork fails due to hitting proc limit The function clearning credentials on failure asserts the process is a zombie, which is not true when fork fails. Changing creds to NULL is unnecessary, but is still being done for consistency with other code. Pointy hat: mjg Reported by: pho Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed May 6 19:58:12 2015 (r282566) +++ head/sys/kern/kern_fork.c Wed May 6 21:03:19 2015 (r282567) @@ -943,7 +943,8 @@ fail: #endif racct_proc_exit(newproc); fail1: - crfree(proc_set_cred(newproc, NULL)); + crfree(newproc->p_ucred); + newproc->p_ucred = NULL; fail2: if (vm2 != NULL) vmspace_free(vm2); From owner-svn-src-head@FreeBSD.ORG Wed May 6 23:40:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4BA08AD; Wed, 6 May 2015 23:40:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A36521033; Wed, 6 May 2015 23:40:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t46NePLf014378; Wed, 6 May 2015 23:40:25 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46NePe1014377; Wed, 6 May 2015 23:40:25 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505062340.t46NePe1014377@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 6 May 2015 23:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282571 - head/sys/amd64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 23:40:25 -0000 Author: neel Date: Wed May 6 23:40:24 2015 New Revision: 282571 URL: https://svnweb.freebsd.org/changeset/base/282571 Log: Check 'td_owepreempt' and yield the vcpu thread if it is set. This is done explicitly because a vcpu thread can be in a critical section for the entire time slice alloted to it. This in turn can delay the handling of the 'td_owepreempt'. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D2430 Modified: head/sys/amd64/include/vmm.h Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed May 6 23:26:51 2015 (r282570) +++ head/sys/amd64/include/vmm.h Wed May 6 23:40:24 2015 (r282571) @@ -276,7 +276,13 @@ vcpu_is_running(struct vm *vm, int vcpu, static int __inline vcpu_should_yield(struct vm *vm, int vcpu) { - return (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)); + + if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) + return (1); + else if (curthread->td_owepreempt) + return (1); + else + return (0); } #endif From owner-svn-src-head@FreeBSD.ORG Thu May 7 01:55:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 676F187B; Thu, 7 May 2015 01:55: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 3CE441EA5; Thu, 7 May 2015 01:55: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 t471tfah083682; Thu, 7 May 2015 01:55:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t471teQJ083676; Thu, 7 May 2015 01:55:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201505070155.t471teQJ083676@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 May 2015 01:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282574 - in head: . share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 01:55:41 -0000 Author: bdrewery Date: Thu May 7 01:55:39 2015 New Revision: 282574 URL: https://svnweb.freebsd.org/changeset/base/282574 Log: Remove references to Giant in namei(9). This was removed in r241896. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/namei.9 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu May 7 00:27:28 2015 (r282573) +++ head/ObsoleteFiles.inc Thu May 7 01:55:39 2015 (r282574) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20150506 +OLD_FILES+=usr/share/man/man9/NDHASGIANT.9.gz # 20150504 OLD_LIBS+=usr/lib32/private/libatf-c++.so.2 OLD_LIBS+=usr/lib32/private/libbsdstat.so.1 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu May 7 00:27:28 2015 (r282573) +++ head/share/man/man9/Makefile Thu May 7 01:55:39 2015 (r282574) @@ -1113,7 +1113,6 @@ MLINKS+=mutex.9 mtx_assert.9 \ mutex.9 mtx_unlock_spin.9 \ mutex.9 mtx_unlock_spin_flags.9 MLINKS+=namei.9 NDFREE.9 \ - namei.9 NDHASGIANT.9 \ namei.9 NDINIT.9 MLINKS+=netisr.9 netisr_clearqdrops.9 \ netisr.9 netisr_default_flow2cpu.9 \ Modified: head/share/man/man9/namei.9 ============================================================================== --- head/share/man/man9/namei.9 Thu May 7 00:27:28 2015 (r282573) +++ head/share/man/man9/namei.9 Thu May 7 01:55:39 2015 (r282574) @@ -33,14 +33,13 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2012 +.Dd May 6, 2015 .Dt NAMEI 9 .Os .Sh NAME .Nm namei , .Nm NDINIT , .Nm NDFREE , -.Nm NDHASGIANT .Nd pathname translation and lookup operations .Sh SYNOPSIS .In sys/param.h @@ -55,8 +54,6 @@ .Fc .Ft void .Fn NDFREE "struct nameidata *ndp" "const uint flags" -.Ft int -.Fn NDHASGIANT "struct nameidata *ndp" .Sh DESCRIPTION The .Nm @@ -73,16 +70,6 @@ or depending on whether the .Dv LOCKLEAF flag was specified or not. -If the -.Va Giant -lock is required, -.Nm -will acquire it if the caller indicates it is -.Dv MPSAFE , -in which case the caller must later release -.Va Giant -based on the results of -.Fn NDHASGIANT . .Pp The .Fn NDINIT @@ -362,6 +349,3 @@ In order to solve this for the cases whe and .Dv LOCKLEAF are used, it is necessary to resort to recursive locking. -.Pp -Non-MPSAFE file systems exist, requiring callers to conditionally unlock -.Va Giant . From owner-svn-src-head@FreeBSD.ORG Thu May 7 05:22:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A7665FE; Thu, 7 May 2015 05:22:36 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1661566; Thu, 7 May 2015 05:22:36 +0000 (UTC) Received: by wgyo15 with SMTP id o15so31930040wgy.2; Wed, 06 May 2015 22:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4vR8Sk9bqfZI5BV1mpuhEoD/R7LKhYZI8fe4nleVZzo=; b=HKgf2rUHPRigIcLSonqq9KJWfngpf5mnpnB6VoxTaCPNBiqZeFoZWFsisTy2liEyNS SPx7TQ5mvcPIy79zmb37zMasGokDgV2ad8P6C1jT2pQ2fPwijm4VfwEq5iJosS+NkeTu aFFJyADFlOZ3+VckK6a+AXLxvo4cjRCvlJbwxM7t4/3B1S+BBvcRH/IGUJjbHFENd7v+ i4nnqeCiGhWA5+kjxMXznpd0v8wl4UiF3NIWhFbFCJNRTtjfsjZuq4HoTeYlcE3REAmW huJQL7MN/8DuMUgz4nVxKgnqE0lwGpsKvYuWPuATcYjLA+t5jcStYguiNntusE/5d573 yImw== MIME-Version: 1.0 X-Received: by 10.180.91.137 with SMTP id ce9mr3180410wib.76.1430976153359; Wed, 06 May 2015 22:22:33 -0700 (PDT) Received: by 10.27.52.18 with HTTP; Wed, 6 May 2015 22:22:33 -0700 (PDT) In-Reply-To: <5549E62F.8000508@FreeBSD.org> References: <201505041955.t44Jt28d008533@svn.freebsd.org> <5549E62F.8000508@FreeBSD.org> Date: Wed, 6 May 2015 22:22:33 -0700 Message-ID: Subject: Re: svn commit: r282429 - head/usr.sbin/bhyve From: Neel Natu To: Alexander Motin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 05:22:36 -0000 Hi Alexander, On Wed, May 6, 2015 at 3:00 AM, Alexander Motin wrote: > On 06.05.2015 08:04, Neel Natu wrote: >> Hi Alexander, >> >> I am getting the following error(?) messages with an ahci-cd device on >> Centos 6.4 x86_64: > > Thanks for the report, r282524 should fix the issue. > Thanks, that does fix the issue. best Neel >> On Mon, May 4, 2015 at 12:55 PM, Alexander Motin wrote: >>> Author: mav >>> Date: Mon May 4 19:55:01 2015 >>> New Revision: 282429 >>> URL: https://svnweb.freebsd.org/changeset/base/282429 >>> >>> Log: >>> Implement in-order execution of non-NCQ commands. >>> >>> Using status updates in r282364, block queue on BSY, DRQ or ERR bits set. >>> This can be a performance penalization for non-NCQ commands, but it is >>> required for proper error recovery and standard compliance. >>> >>> MFC after: 2 weeks >>> >>> Modified: >>> head/usr.sbin/bhyve/pci_ahci.c > > -- > Alexander Motin From owner-svn-src-head@FreeBSD.ORG Thu May 7 12:15:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FC69B82; Thu, 7 May 2015 12:15: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 009921D1B; Thu, 7 May 2015 12:15: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 t47CFjh7087576; Thu, 7 May 2015 12:15:45 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47CFjdf087575; Thu, 7 May 2015 12:15:45 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201505071215.t47CFjdf087575@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 7 May 2015 12:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282575 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 12:15:46 -0000 Author: ae Date: Thu May 7 12:15:45 2015 New Revision: 282575 URL: https://svnweb.freebsd.org/changeset/base/282575 Log: Remove unneded #ifdef INET6 and IPSEC. This file compiled only when both options are defined. Include opt_sctp.h and sctp_crc32.h to enable #ifdef SCTP code block and delayed checksum calculation for SCTP. Modified: head/sys/netinet6/ip6_ipsec.c Modified: head/sys/netinet6/ip6_ipsec.c ============================================================================== --- head/sys/netinet6/ip6_ipsec.c Thu May 7 01:55:39 2015 (r282574) +++ head/sys/netinet6/ip6_ipsec.c Thu May 7 12:15:45 2015 (r282575) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" -#include "opt_inet6.h" +#include "opt_sctp.h" #include "opt_ipsec.h" #include @@ -58,10 +58,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SCTP +#include +#endif #include -#ifdef IPSEC #include #include #include @@ -71,16 +73,12 @@ __FBSDID("$FreeBSD$"); #else #define KEYDEBUG(lev,arg) #endif -#endif /*IPSEC*/ #include #include extern struct protosw inet6sw[]; - -#ifdef INET6 -#ifdef IPSEC #ifdef IPSEC_FILTERTUNNEL static VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 1; #else @@ -92,8 +90,6 @@ SYSCTL_DECL(_net_inet6_ipsec6); SYSCTL_INT(_net_inet6_ipsec6, OID_AUTO, filtertunnel, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_ipsec6_filtertunnel), 0, "If set filter packets from an IPsec tunnel."); -#endif /* IPSEC */ -#endif /* INET6 */ /* * Check if we have to jump over firewall processing for this packet. @@ -103,16 +99,14 @@ SYSCTL_INT(_net_inet6_ipsec6, OID_AUTO, int ip6_ipsec_filtertunnel(struct mbuf *m) { -#ifdef IPSEC /* * Bypass packet filtering for packets previously handled by IPsec. */ if (!V_ip6_ipsec6_filtertunnel && m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) - return 1; -#endif - return 0; + return (1); + return (0); } /* @@ -125,11 +119,7 @@ int ip6_ipsec_fwd(struct mbuf *m) { -#ifdef IPSEC return (ipsec6_in_reject(m, NULL)); -#else - return (0); -#endif /* !IPSEC */ } /* @@ -143,7 +133,6 @@ int ip6_ipsec_input(struct mbuf *m, int nxt) { -#ifdef IPSEC /* * enforce IPsec policy checking if we are seeing last header. * note that we do not visit this with protocols with pcb layer @@ -151,7 +140,6 @@ ip6_ipsec_input(struct mbuf *m, int nxt) */ if ((inet6sw[ip6_protox[nxt]].pr_flags & PR_LASTHDR) != 0) return (ipsec6_in_reject(m, NULL)); -#endif /* IPSEC */ return (0); } @@ -164,7 +152,6 @@ ip6_ipsec_input(struct mbuf *m, int nxt) int ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *error) { -#ifdef IPSEC struct secpolicy *sp; /* @@ -257,9 +244,7 @@ reinjected: bad: if (sp != NULL) KEY_FREESP(&sp); - return 1; -#endif /* IPSEC */ - return 0; + return (1); } #if 0 From owner-svn-src-head@FreeBSD.ORG Thu May 7 12:38:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C4571C5; Thu, 7 May 2015 12:38: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 8971F1F78; Thu, 7 May 2015 12:38: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 t47Cchbr097863; Thu, 7 May 2015 12:38:43 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47CcOYZ097753; Thu, 7 May 2015 12:38:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505071238.t47CcOYZ097753@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 May 2015 12:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282576 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 12:38:43 -0000 Author: andrew Date: Thu May 7 12:38:23 2015 New Revision: 282576 URL: https://svnweb.freebsd.org/changeset/base/282576 Log: Clean up the ARM kernel configs to use 'include"file"'. Modified: head/sys/arm/conf/AML8726 head/sys/arm/conf/APALIS-IMX6 head/sys/arm/conf/ARMADAXP head/sys/arm/conf/ARNDALE head/sys/arm/conf/ARNDALE-OCTA head/sys/arm/conf/ATMEL head/sys/arm/conf/AVILA head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CHROMEBOOK head/sys/arm/conf/CHROMEBOOK-PEACH-PIT head/sys/arm/conf/CHROMEBOOK-SNOW head/sys/arm/conf/CHROMEBOOK-SPRING head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/COLIBRI-VF50 head/sys/arm/conf/COSMIC head/sys/arm/conf/CRB head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EA3250 head/sys/arm/conf/EB9200 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/EP80219 head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/EXYNOS5.common head/sys/arm/conf/EXYNOS5250 head/sys/arm/conf/EXYNOS5420 head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/IMX6 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NSLU head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/QUARTZ head/sys/arm/conf/RADXA head/sys/arm/conf/RADXA-LITE head/sys/arm/conf/RK3188 head/sys/arm/conf/RPI-B head/sys/arm/conf/RPI2 head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/SOCKIT.common head/sys/arm/conf/TS7800 head/sys/arm/conf/VERSATILEPB head/sys/arm/conf/VIRT head/sys/arm/conf/VYBRID head/sys/arm/conf/WANDBOARD-DUAL head/sys/arm/conf/WANDBOARD-QUAD head/sys/arm/conf/WANDBOARD-SOLO head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/AML8726 ============================================================================== --- head/sys/arm/conf/AML8726 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/AML8726 Thu May 7 12:38:23 2015 (r282576) @@ -20,7 +20,7 @@ ident AML8726 -include "std.armv6" +include "std.armv6" include "../amlogic/aml8726/std.aml8726" options HZ=100 Modified: head/sys/arm/conf/APALIS-IMX6 ============================================================================== --- head/sys/arm/conf/APALIS-IMX6 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/APALIS-IMX6 Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "IMX6" +include "IMX6" ident APALIS-IMX6 makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/ARMADAXP Thu May 7 12:38:23 2015 (r282576) @@ -20,8 +20,8 @@ ident MV-88F78XX0 -include "std.armv6" -include "../mv/armadaxp/std.mv78x60" +include "std.armv6" +include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/ARNDALE Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "EXYNOS5250" +include "EXYNOS5250" ident ARNDALE #FDT Modified: head/sys/arm/conf/ARNDALE-OCTA ============================================================================== --- head/sys/arm/conf/ARNDALE-OCTA Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/ARNDALE-OCTA Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "EXYNOS5420" +include "EXYNOS5420" ident ARNDALE-OCTA #FDT Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/ATMEL Thu May 7 12:38:23 2015 (r282576) @@ -6,8 +6,8 @@ ident ATMEL -include "std.arm" -include "../at91/std.atmel" +include "std.arm" +include "../at91/std.atmel" # Typical values for most SoCs and board configurations. Will not work for # at91sam9g45 or on some boards with non u-boot boot loaders. Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/AVILA Thu May 7 12:38:23 2015 (r282576) @@ -20,10 +20,10 @@ ident AVILA -include "std.arm" -include "../xscale/ixp425/std.ixp425" +include "std.arm" +include "../xscale/ixp425/std.ixp425" # NB: memory mapping is defined in std.avila -include "../xscale/ixp425/std.avila" +include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE #To statically compile in device wiring instead of /boot/device.hints hints "AVILA.hints" # Default places to look for devices. Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/BEAGLEBONE Thu May 7 12:38:23 2015 (r282576) @@ -23,8 +23,8 @@ ident BEAGLEBONE -include "std.armv6" -include "../ti/am335x/std.am335x" +include "std.armv6" +include "../ti/am335x/std.am335x" makeoptions MODULES_EXTRA="dtb/am335x" Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/BWCT Thu May 7 12:38:23 2015 (r282576) @@ -21,10 +21,10 @@ ident BWCT -include "std.arm" +include "std.arm" options VERBOSE_INIT_ARM -include "../at91/std.bwct" +include "../at91/std.bwct" #To statically compile in device wiring instead of /boot/device.hints hints "BWCT.hints" Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/CAMBRIA Thu May 7 12:38:23 2015 (r282576) @@ -20,10 +20,10 @@ ident CAMBRIA -include "std.arm" -include "../xscale/ixp425/std.ixp435" +include "std.arm" +include "../xscale/ixp425/std.ixp435" # NB: memory mapping is defined in std.avila -include "../xscale/ixp425/std.avila" +include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE #To statically compile in device wiring instead of /boot/device.hints hints "CAMBRIA.hints" # Default places to look for devices. Modified: head/sys/arm/conf/CHROMEBOOK ============================================================================== --- head/sys/arm/conf/CHROMEBOOK Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/CHROMEBOOK Thu May 7 12:38:23 2015 (r282576) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "EXYNOS5250" +include "EXYNOS5250" ident CHROMEBOOK hints "CHROMEBOOK.hints" Modified: head/sys/arm/conf/CHROMEBOOK-PEACH-PIT ============================================================================== --- head/sys/arm/conf/CHROMEBOOK-PEACH-PIT Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/CHROMEBOOK-PEACH-PIT Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "EXYNOS5420" +include "EXYNOS5420" ident CHROMEBOOK-PEACH-PIT hints "CHROMEBOOK-PEACH-PIT.hints" Modified: head/sys/arm/conf/CHROMEBOOK-SNOW ============================================================================== --- head/sys/arm/conf/CHROMEBOOK-SNOW Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/CHROMEBOOK-SNOW Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "CHROMEBOOK" +include "CHROMEBOOK" ident CHROMEBOOK-SNOW #FDT Modified: head/sys/arm/conf/CHROMEBOOK-SPRING ============================================================================== --- head/sys/arm/conf/CHROMEBOOK-SPRING Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/CHROMEBOOK-SPRING Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "CHROMEBOOK" +include "CHROMEBOOK" ident CHROMEBOOK-SPRING #FDT Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/CNS11XXNAS Thu May 7 12:38:23 2015 (r282576) @@ -20,14 +20,14 @@ ident CNS11XXNAS -include "std.arm" +include "std.arm" #options PHYSADDR=0x10000000 #options KERNPHYSADDR=0x10200000 #options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 -include "../cavium/cns11xx/std.econa" +include "../cavium/cns11xx/std.econa" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/COLIBRI-VF50 ============================================================================== --- head/sys/arm/conf/COLIBRI-VF50 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/COLIBRI-VF50 Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "VYBRID" +include "VYBRID" ident COLIBRI-VF50 #FDT Modified: head/sys/arm/conf/COSMIC ============================================================================== --- head/sys/arm/conf/COSMIC Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/COSMIC Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "VYBRID" +include "VYBRID" ident COSMIC #FDT Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/CRB Thu May 7 12:38:23 2015 (r282576) @@ -19,13 +19,13 @@ ident CRB -include "std.arm" +include "std.arm" options PHYSADDR=0x00000000 options KERNPHYSADDR=0x00200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm options COUNTS_PER_SEC=400000000 -include "../xscale/i8134x/std.crb" +include "../xscale/i8134x/std.crb" makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/CUBIEBOARD Thu May 7 12:38:23 2015 (r282576) @@ -21,8 +21,8 @@ ident CUBIEBOARD -include "std.armv6" -include "../allwinner/std.a10" +include "std.armv6" +include "../allwinner/std.a10" options HZ=100 options SCHED_4BSD # 4BSD scheduler Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/CUBIEBOARD2 Thu May 7 12:38:23 2015 (r282576) @@ -21,8 +21,8 @@ ident CUBIEBOARD2 -include "std.armv6" -include "../allwinner/a20/std.a20" +include "std.armv6" +include "../allwinner/a20/std.a20" options HZ=100 options SCHED_ULE # ULE scheduler Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/DB-78XXX Thu May 7 12:38:23 2015 (r282576) @@ -5,8 +5,8 @@ # ident DB-88F78XX -include "std.arm" -include "../mv/discovery/std.db78xxx" +include "std.arm" +include "../mv/discovery/std.db78xxx" options SOC_MV_DISCOVERY Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/DB-88F5XXX Thu May 7 12:38:23 2015 (r282576) @@ -5,8 +5,8 @@ # ident DB-88F5XXX -include "std.arm" -include "../mv/orion/std.db88f5xxx" +include "std.arm" +include "../mv/orion/std.db88f5xxx" options SOC_MV_ORION Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/DB-88F6XXX Thu May 7 12:38:23 2015 (r282576) @@ -5,8 +5,8 @@ # ident DB-88F6XXX -include "std.arm" -include "../mv/kirkwood/std.db88f6xxx" +include "std.arm" +include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/DIGI-CCWMX53 Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "IMX53" +include "IMX53" ident DIGI-CCWMX53 makeoptions WITHOUT_MODULES="ahc" Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/DOCKSTAR Thu May 7 12:38:23 2015 (r282576) @@ -21,8 +21,8 @@ ident DOCKSTAR -include "std.arm" -include "../mv/kirkwood/std.db88f6xxx" +include "std.arm" +include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dockstar.dts Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/DREAMPLUG-1001 Thu May 7 12:38:23 2015 (r282576) @@ -24,8 +24,8 @@ ident DREAMPLUG-1001 -include "std.arm" -include "../mv/kirkwood/std.db88f6xxx" +include "std.arm" +include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dreamplug-1001.dts Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/EA3250 Thu May 7 12:38:23 2015 (r282576) @@ -5,8 +5,8 @@ # ident EA3250 -include "std.arm" -include "../lpc/std.lpc" +include "std.arm" +include "../lpc/std.lpc" hints "EA3250.hints" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/EB9200 Thu May 7 12:38:23 2015 (r282576) @@ -16,8 +16,8 @@ ident EB9200 -include "std.arm" -include "../at91/std.eb9200" +include "std.arm" +include "../at91/std.eb9200" # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. hints "EB9200.hints" Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/EFIKA_MX Thu May 7 12:38:23 2015 (r282576) @@ -20,7 +20,7 @@ ident EFIKA_MX -include "std.armv6" +include "std.armv6" include "../freescale/imx/std.imx51" makeoptions WITHOUT_MODULES="ahc" Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/EP80219 Thu May 7 12:38:23 2015 (r282576) @@ -19,13 +19,13 @@ ident EP80219 -include "std.arm" +include "std.arm" options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm #options ARM32_NEW_VM_LAYOUT -include "../xscale/i80321/std.ep80219" +include "../xscale/i80321/std.ep80219" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/ETHERNUT5 Thu May 7 12:38:23 2015 (r282576) @@ -21,8 +21,8 @@ ident ETHERNUT5 -include "std.arm" -include "../at91/std.ethernut5" +include "std.arm" +include "../at91/std.ethernut5" # To statically compile in device wiring instead of /boot/device.hints hints "ETHERNUT5.hints" Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/EXYNOS5.common Thu May 7 12:38:23 2015 (r282576) @@ -20,7 +20,7 @@ makeoptions WERROR="-Werror" -include "std.armv6" +include "std.armv6" options HZ=100 options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/arm/conf/EXYNOS5250 ============================================================================== --- head/sys/arm/conf/EXYNOS5250 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/EXYNOS5250 Thu May 7 12:38:23 2015 (r282576) @@ -18,8 +18,8 @@ # $FreeBSD$ ident EXYNOS5250 -include "EXYNOS5.common" -include "../samsung/exynos/std.exynos5250" +include "EXYNOS5.common" +include "../samsung/exynos/std.exynos5250" #FDT options FDT Modified: head/sys/arm/conf/EXYNOS5420 ============================================================================== --- head/sys/arm/conf/EXYNOS5420 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/EXYNOS5420 Thu May 7 12:38:23 2015 (r282576) @@ -18,8 +18,8 @@ # $FreeBSD$ ident EXYNOS5420 -include "EXYNOS5.common" -include "../samsung/exynos/std.exynos5420" +include "EXYNOS5.common" +include "../samsung/exynos/std.exynos5420" #FDT options FDT Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/GUMSTIX Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ # $FreeBSD$ ident GUMSTIX -include "std.arm" +include "std.arm" cpu CPU_XSCALE_PXA2X0 # This probably wants to move somewhere else. Maybe we can create a basic @@ -31,7 +31,7 @@ options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm -include "../xscale/pxa/std.pxa" +include "../xscale/pxa/std.pxa" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/HL200 Thu May 7 12:38:23 2015 (r282576) @@ -21,8 +21,8 @@ ident HL200 -include "std.arm" -include "../at91/std.hl200" +include "std.arm" +include "../at91/std.hl200" #To statically compile in device wiring instead of /boot/device.hints hints "KB920X.hints" Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/HL201 Thu May 7 12:38:23 2015 (r282576) @@ -21,8 +21,8 @@ ident HL201 -include "std.arm" -include "../at91/std.hl201" +include "std.arm" +include "../at91/std.hl201" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/IMX53 Thu May 7 12:38:23 2015 (r282576) @@ -20,7 +20,7 @@ ident IMX53 -include "std.armv6" +include "std.armv6" include "../freescale/imx/std.imx53" options SOC_IMX53 Modified: head/sys/arm/conf/IMX53-QSB ============================================================================== --- head/sys/arm/conf/IMX53-QSB Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/IMX53-QSB Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "IMX53" +include "IMX53" ident IMX53-QSB options HZ=250 # 4ms scheduling quantum Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/IMX6 Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ # $FreeBSD$ ident IMX6 -include "std.armv6" +include "std.armv6" include "../freescale/imx/std.imx6" options SOC_IMX6 Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/IQ31244 Thu May 7 12:38:23 2015 (r282576) @@ -19,14 +19,14 @@ ident IQ31244 -include "std.arm" +include "std.arm" options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm options FLASHADDR=0xf0000000 options LOADERRAMADDR=0x00000000 -include "../xscale/i80321/std.iq31244" +include "../xscale/i80321/std.iq31244" makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/KB920X Thu May 7 12:38:23 2015 (r282576) @@ -22,8 +22,8 @@ ident KB920X -include "std.arm" -include "../at91/std.kb920x" +include "std.arm" +include "../at91/std.kb920x" # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. hints "KB920X.hints" Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/LN2410SBC Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ ident LN2410SBC -include "std.arm" +include "std.arm" include "../samsung/s3c2xx0/std.ln2410sbc" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/NSLU Thu May 7 12:38:23 2015 (r282576) @@ -21,7 +21,7 @@ ident NSLU -include "std.arm" +include "std.arm" # XXX What is defined in std.avila does not exactly match the following: #options PHYSADDR=0x10000000 #options KERNPHYSADDR=0x10200000 @@ -29,9 +29,9 @@ include "std.arm" #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 -include "../xscale/ixp425/std.ixp425" +include "../xscale/ixp425/std.ixp425" # NB: memory mapping is defined in std.avila (see also comment above) -include "../xscale/ixp425/std.avila" +include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE #To statically compile in device wiring instead of /boot/device.hints hints "NSLU.hints" # Default places to look for devices. Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/PANDABOARD Thu May 7 12:38:23 2015 (r282576) @@ -27,7 +27,7 @@ ident PANDABOARD hints "PANDABOARD.hints" -include "std.armv6" +include "std.armv6" include "../ti/omap4/pandaboard/std.pandaboard" options HZ=100 Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/QILA9G20 Thu May 7 12:38:23 2015 (r282576) @@ -22,8 +22,8 @@ ident QILA9G20 -include "std.arm" -include "../at91/std.qila9g20" +include "std.arm" +include "../at91/std.qila9g20" #To statically compile in device wiring instead of /boot/device.hints hints "QILA9G20.hints" Modified: head/sys/arm/conf/QUARTZ ============================================================================== --- head/sys/arm/conf/QUARTZ Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/QUARTZ Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "VYBRID" +include "VYBRID" ident QUARTZ #FDT Modified: head/sys/arm/conf/RADXA ============================================================================== --- head/sys/arm/conf/RADXA Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/RADXA Thu May 7 12:38:23 2015 (r282576) @@ -20,7 +20,7 @@ #NO_UNIVERSE -include "RK3188" +include "RK3188" ident RADXA # Flattened Device Tree Modified: head/sys/arm/conf/RADXA-LITE ============================================================================== --- head/sys/arm/conf/RADXA-LITE Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/RADXA-LITE Thu May 7 12:38:23 2015 (r282576) @@ -20,7 +20,7 @@ #NO_UNIVERSE -include "RK3188" +include "RK3188" ident RADXA-LITE # Flattened Device Tree Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/RK3188 Thu May 7 12:38:23 2015 (r282576) @@ -20,8 +20,8 @@ ident RK3188 -include "std.armv6" -include "../rockchip/std.rk30xx" +include "std.armv6" +include "../rockchip/std.rk30xx" options HZ=100 options SCHED_ULE # ULE scheduler Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/RPI-B Thu May 7 12:38:23 2015 (r282576) @@ -20,9 +20,9 @@ ident RPI-B -include "std.armv6" -include "../broadcom/bcm2835/std.rpi" -include "../broadcom/bcm2835/std.bcm2835" +include "std.armv6" +include "../broadcom/bcm2835/std.rpi" +include "../broadcom/bcm2835/std.bcm2835" options HZ=100 options SCHED_4BSD # 4BSD scheduler Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/RPI2 Thu May 7 12:38:23 2015 (r282576) @@ -20,9 +20,9 @@ ident RPI2 -include "std.armv6" -include "../broadcom/bcm2835/std.rpi" -include "../broadcom/bcm2835/std.bcm2836" +include "std.armv6" +include "../broadcom/bcm2835/std.rpi" +include "../broadcom/bcm2835/std.bcm2836" options HZ=100 options SCHED_4BSD # 4BSD scheduler Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/SAM9260EK Thu May 7 12:38:23 2015 (r282576) @@ -21,8 +21,8 @@ ident SAM9260EK -include "std.arm" -include "../at91/std.sam9260ek" +include "std.arm" +include "../at91/std.sam9260ek" # To statically compile in device wiring instead of /boot/device.hints hints "SAM9260EK.hints" Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/SAM9G20EK Thu May 7 12:38:23 2015 (r282576) @@ -19,8 +19,8 @@ ident SAM9G20EK -include "std.arm" -include "../at91/std.sam9g20ek" +include "std.arm" +include "../at91/std.sam9g20ek" #To statically compile in device wiring instead of /boot/device.hints hints "SAM9G20EK.hints" Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/SAM9X25EK Thu May 7 12:38:23 2015 (r282576) @@ -21,8 +21,8 @@ ident SAM9X25EK -include "std.arm" -include "../at91/std.sam9x25ek" +include "std.arm" +include "../at91/std.sam9x25ek" #To statically compile in device wiring instead of /boot/device.hints hints "SAM9G20EK.hints" Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/SHEEVAPLUG Thu May 7 12:38:23 2015 (r282576) @@ -6,8 +6,8 @@ #NO_UNIVERSE ident SHEEVAPLUG -include "std.arm" -include "../mv/kirkwood/std.db88f6xxx" +include "std.arm" +include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/SN9G45 Thu May 7 12:38:23 2015 (r282576) @@ -21,8 +21,8 @@ ident SN9G45 -include "std.arm" -include "../at91/std.sn9g45" +include "std.arm" +include "../at91/std.sn9g45" #To statically compile in device wiring instead of /boot/device.hints #hints "SN9G45.hints" Modified: head/sys/arm/conf/SOCKIT.common ============================================================================== --- head/sys/arm/conf/SOCKIT.common Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/SOCKIT.common Thu May 7 12:38:23 2015 (r282576) @@ -18,7 +18,7 @@ # # $FreeBSD$ -include "std.armv6" +include "std.armv6" include "../altera/socfpga/std.socfpga" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/TS7800 Thu May 7 12:38:23 2015 (r282576) @@ -5,8 +5,8 @@ # ident TS7800 -include "std.arm" -include "../mv/orion/std.ts7800" +include "std.arm" +include "../mv/orion/std.ts7800" options SOC_MV_ORION Modified: head/sys/arm/conf/VERSATILEPB ============================================================================== --- head/sys/arm/conf/VERSATILEPB Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/VERSATILEPB Thu May 7 12:38:23 2015 (r282576) @@ -22,7 +22,7 @@ ident VERSATILEPB machine arm armv6 cpu CPU_ARM1176 -include "std.armv6" +include "std.armv6" files "../versatile/files.versatile" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/VIRT ============================================================================== --- head/sys/arm/conf/VIRT Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/VIRT Thu May 7 12:38:23 2015 (r282576) @@ -20,8 +20,8 @@ ident VIRT -include "std.armv6" -include "../qemu/std.virt" +include "std.armv6" +include "../qemu/std.virt" options HZ=100 options SCHED_4BSD # 4BSD scheduler Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/VYBRID Thu May 7 12:38:23 2015 (r282576) @@ -19,8 +19,8 @@ # $FreeBSD$ ident VYBRID -include "std.armv6" -include "../freescale/vybrid/std.vybrid" +include "std.armv6" +include "../freescale/vybrid/std.vybrid" makeoptions WERROR="-Werror" Modified: head/sys/arm/conf/WANDBOARD-DUAL ============================================================================== --- head/sys/arm/conf/WANDBOARD-DUAL Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/WANDBOARD-DUAL Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "IMX6" +include "IMX6" ident WANDBOARD-DUAL # Flattened Device Tree Modified: head/sys/arm/conf/WANDBOARD-QUAD ============================================================================== --- head/sys/arm/conf/WANDBOARD-QUAD Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/WANDBOARD-QUAD Thu May 7 12:38:23 2015 (r282576) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "IMX6" +include "IMX6" ident WANDBOARD-QUAD # Flattened Device Tree Modified: head/sys/arm/conf/WANDBOARD-SOLO ============================================================================== --- head/sys/arm/conf/WANDBOARD-SOLO Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/WANDBOARD-SOLO Thu May 7 12:38:23 2015 (r282576) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "IMX6" +include "IMX6" ident WANDBOARD-SOLO nooptions SMP Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Thu May 7 12:15:45 2015 (r282575) +++ head/sys/arm/conf/ZEDBOARD Thu May 7 12:38:23 2015 (r282576) @@ -21,7 +21,7 @@ ident ZEDBOARD -include "std.armv6" +include "std.armv6" include "../xilinx/zedboard/std.zedboard" options SCHED_ULE # ULE scheduler From owner-svn-src-head@FreeBSD.ORG Thu May 7 12:54:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28AAFA09; Thu, 7 May 2015 12:54:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 098B911D3; Thu, 7 May 2015 12:54:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t47CsTOE007438; Thu, 7 May 2015 12:54:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47CsS90007426; Thu, 7 May 2015 12:54:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505071254.t47CsS90007426@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 May 2015 12:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282577 - in head: share/man/man4 sys/dev/usb sys/dev/usb/quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 12:54:30 -0000 Author: hselasky Date: Thu May 7 12:54:27 2015 New Revision: 282577 URL: https://svnweb.freebsd.org/changeset/base/282577 Log: Add support for DYMO LabelWriter PnP. MFC after: 2 weeks Modified: head/share/man/man4/usb_quirk.4 head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/quirk/usb_quirk.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_msctest.h head/sys/dev/usb/usbdevs Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Thu May 7 12:38:23 2015 (r282576) +++ head/share/man/man4/usb_quirk.4 Thu May 7 12:54:27 2015 (r282577) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2013 +.Dd May 7, 2015 .Dt USB_QUIRK 4 .Os .Sh NAME @@ -170,6 +170,9 @@ ejects after Huawei SCSI command .It UQ_MSC_EJECT_TCT ejects after TCT SCSI command .Dv 0x06f504025270 +.It UQ_MSC_DYMO_EJECT +ejects after HID command +.Dv 0x1b5a01 .El .Pp See Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Thu May 7 12:38:23 2015 (r282576) +++ head/sys/dev/usb/quirk/usb_quirk.c Thu May 7 12:54:27 2015 (r282577) @@ -523,6 +523,9 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(FEIYA, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(REALTEK, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(INITIO, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), + + /* DYMO LabelManager Pnp */ + USB_QUIRK(DYMO, LABELMANAGERPNP, 0x0000, 0xffff, UQ_MSC_DYMO_EJECT), }; #undef USB_QUIRK_VP #undef USB_QUIRK @@ -592,6 +595,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_BAD_MIDI] = "UQ_BAD_MIDI", [UQ_AU_VENDOR_CLASS] = "UQ_AU_VENDOR_CLASS", [UQ_SINGLE_CMD_MIDI] = "UQ_SINGLE_CMD_MIDI", + [UQ_MSC_DYMO_EJECT] = "UQ_MSC_DYMO_EJECT", }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Thu May 7 12:38:23 2015 (r282576) +++ head/sys/dev/usb/quirk/usb_quirk.h Thu May 7 12:54:27 2015 (r282577) @@ -108,6 +108,7 @@ enum { UQ_BAD_MIDI, /* device claims MIDI class, but isn't */ UQ_AU_VENDOR_CLASS, /* audio device uses vendor and not audio class */ UQ_SINGLE_CMD_MIDI, /* at most one command per USB packet */ + UQ_MSC_DYMO_EJECT, /* ejects Dymo MSC device */ USB_QUIRK_MAX }; Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Thu May 7 12:38:23 2015 (r282576) +++ head/sys/dev/usb/usb_device.c Thu May 7 12:54:27 2015 (r282577) @@ -1343,6 +1343,12 @@ usb_probe_and_attach(struct usb_device * */ if (iface_index == USB_IFACE_INDEX_ANY) { + if (usb_test_quirk(&uaa, UQ_MSC_DYMO_EJECT) != 0 && + usb_dymo_eject(udev, 0) == 0) { + /* success, mark the udev as disappearing */ + uaa.dev_state = UAA_DEV_EJECTING; + } + EVENTHANDLER_INVOKE(usb_dev_configured, udev, &uaa); if (uaa.dev_state != UAA_DEV_READY) { Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Thu May 7 12:38:23 2015 (r282576) +++ head/sys/dev/usb/usb_msctest.c Thu May 7 12:54:27 2015 (r282577) @@ -181,6 +181,7 @@ static usb_callback_t bbb_data_rd_cs_cal static usb_callback_t bbb_data_write_callback; static usb_callback_t bbb_data_wr_cs_callback; static usb_callback_t bbb_status_callback; +static usb_callback_t bbb_raw_write_callback; static void bbb_done(struct bbb_transfer *, int); static void bbb_transfer_start(struct bbb_transfer *, uint8_t); @@ -188,7 +189,7 @@ static void bbb_data_clear_stall_callbac uint8_t); static int bbb_command_start(struct bbb_transfer *, uint8_t, uint8_t, void *, size_t, void *, size_t, usb_timeout_t); -static struct bbb_transfer *bbb_attach(struct usb_device *, uint8_t); +static struct bbb_transfer *bbb_attach(struct usb_device *, uint8_t, uint8_t); static void bbb_detach(struct bbb_transfer *); static const struct usb_config bbb_config[ST_MAX] = { @@ -251,6 +252,19 @@ static const struct usb_config bbb_confi }, }; +static const struct usb_config bbb_raw_config[1] = { + + [0] = { + .type = UE_BULK_INTR, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = SCSI_MAX_LEN, + .flags = {.ext_buffer = 1,.proxy_buffer = 1,}, + .callback = &bbb_raw_write_callback, + .timeout = 1 * USB_MS_HZ, /* 1 second */ + }, +}; + static void bbb_done(struct bbb_transfer *sc, int error) { @@ -471,6 +485,47 @@ bbb_status_callback(struct usb_xfer *xfe } } +static void +bbb_raw_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct bbb_transfer *sc = usbd_xfer_softc(xfer); + usb_frlength_t max_bulk = usbd_xfer_max_len(xfer); + int actlen, sumlen; + + usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + sc->data_rem -= actlen; + sc->data_ptr += actlen; + sc->actlen += actlen; + + if (actlen < sumlen) { + /* short transfer */ + sc->data_rem = 0; + } + case USB_ST_SETUP: + DPRINTF("max_bulk=%d, data_rem=%d\n", + max_bulk, sc->data_rem); + + if (sc->data_rem == 0) { + bbb_done(sc, 0); + break; + } + if (max_bulk > sc->data_rem) { + max_bulk = sc->data_rem; + } + usbd_xfer_set_timeout(xfer, sc->data_timeout); + usbd_xfer_set_frame_data(xfer, 0, sc->data_ptr, max_bulk); + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + bbb_done(sc, error); + break; + } +} + /*------------------------------------------------------------------------* * bbb_command_start - execute a SCSI command synchronously * @@ -506,13 +561,45 @@ bbb_command_start(struct bbb_transfer *s return (sc->error); } +/*------------------------------------------------------------------------* + * bbb_raw_write - write a raw BULK message synchronously + * + * Return values + * 0: Success + * Else: Failure + *------------------------------------------------------------------------*/ +static int +bbb_raw_write(struct bbb_transfer *sc, const void *data_ptr, size_t data_len, + usb_timeout_t data_timeout) +{ + sc->data_ptr = __DECONST(void *, data_ptr); + sc->data_len = data_len; + sc->data_rem = data_len; + sc->data_timeout = (data_timeout + USB_MS_HZ); + sc->actlen = 0; + sc->error = 0; + + DPRINTFN(1, "BULK DATA = %*D\n", (int)data_len, + (const char *)data_ptr, ":"); + + mtx_lock(&sc->mtx); + usbd_transfer_start(sc->xfer[0]); + while (usbd_transfer_pending(sc->xfer[0])) + cv_wait(&sc->cv, &sc->mtx); + mtx_unlock(&sc->mtx); + return (sc->error); +} + static struct bbb_transfer * -bbb_attach(struct usb_device *udev, uint8_t iface_index) +bbb_attach(struct usb_device *udev, uint8_t iface_index, + uint8_t bInterfaceClass) { struct usb_interface *iface; struct usb_interface_descriptor *id; + const struct usb_config *pconfig; struct bbb_transfer *sc; usb_error_t err; + int nconfig; #if USB_HAVE_MSCTEST_DETACH uint8_t do_unlock; @@ -535,22 +622,39 @@ bbb_attach(struct usb_device *udev, uint return (NULL); id = iface->idesc; - if (id == NULL || id->bInterfaceClass != UICLASS_MASS) + if (id == NULL || id->bInterfaceClass != bInterfaceClass) return (NULL); - switch (id->bInterfaceSubClass) { - case UISUBCLASS_SCSI: - case UISUBCLASS_UFI: - case UISUBCLASS_SFF8020I: - case UISUBCLASS_SFF8070I: + switch (id->bInterfaceClass) { + case UICLASS_MASS: + switch (id->bInterfaceSubClass) { + case UISUBCLASS_SCSI: + case UISUBCLASS_UFI: + case UISUBCLASS_SFF8020I: + case UISUBCLASS_SFF8070I: + break; + default: + return (NULL); + } + switch (id->bInterfaceProtocol) { + case UIPROTO_MASS_BBB_OLD: + case UIPROTO_MASS_BBB: + break; + default: + return (NULL); + } + pconfig = bbb_config; + nconfig = ST_MAX; break; - default: - return (NULL); - } - - switch (id->bInterfaceProtocol) { - case UIPROTO_MASS_BBB_OLD: - case UIPROTO_MASS_BBB: + case UICLASS_HID: + switch (id->bInterfaceSubClass) { + case 0: + break; + default: + return (NULL); + } + pconfig = bbb_raw_config; + nconfig = 1; break; default: return (NULL); @@ -560,22 +664,27 @@ bbb_attach(struct usb_device *udev, uint mtx_init(&sc->mtx, "USB autoinstall", NULL, MTX_DEF); cv_init(&sc->cv, "WBBB"); - err = usbd_transfer_setup(udev, &iface_index, sc->xfer, bbb_config, - ST_MAX, sc, &sc->mtx); + err = usbd_transfer_setup(udev, &iface_index, sc->xfer, pconfig, + nconfig, sc, &sc->mtx); if (err) { bbb_detach(sc); return (NULL); } - /* store pointer to DMA buffers */ - sc->buffer = usbd_xfer_get_frame_buffer( - sc->xfer[ST_DATA_RD], 0); - sc->buffer_size = - usbd_xfer_max_len(sc->xfer[ST_DATA_RD]); - sc->cbw = usbd_xfer_get_frame_buffer( - sc->xfer[ST_COMMAND], 0); - sc->csw = usbd_xfer_get_frame_buffer( - sc->xfer[ST_STATUS], 0); - + switch (id->bInterfaceClass) { + case UICLASS_MASS: + /* store pointer to DMA buffers */ + sc->buffer = usbd_xfer_get_frame_buffer( + sc->xfer[ST_DATA_RD], 0); + sc->buffer_size = + usbd_xfer_max_len(sc->xfer[ST_DATA_RD]); + sc->cbw = usbd_xfer_get_frame_buffer( + sc->xfer[ST_COMMAND], 0); + sc->csw = usbd_xfer_get_frame_buffer( + sc->xfer[ST_STATUS], 0); + break; + default: + break; + } return (sc); } @@ -604,7 +713,7 @@ usb_iface_is_cdrom(struct usb_device *ud uint8_t sid_type; int err; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (0); @@ -660,7 +769,7 @@ usb_msc_auto_quirk(struct usb_device *ud uint8_t sid_type; int err; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (0); @@ -829,7 +938,7 @@ usb_msc_eject(struct usb_device *udev, u struct bbb_transfer *sc; usb_error_t err; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (USB_ERR_INVAL); @@ -890,6 +999,21 @@ usb_msc_eject(struct usb_device *udev, u } usb_error_t +usb_dymo_eject(struct usb_device *udev, uint8_t iface_index) +{ + static const uint8_t data[3] = { 0x1b, 0x5a, 0x01 }; + struct bbb_transfer *sc; + usb_error_t err; + + sc = bbb_attach(udev, iface_index, UICLASS_HID); + if (sc == NULL) + return (USB_ERR_INVAL); + err = bbb_raw_write(sc, data, sizeof(data), USB_MS_HZ); + bbb_detach(sc); + return (err); +} + +usb_error_t usb_msc_read_10(struct usb_device *udev, uint8_t iface_index, uint32_t lba, uint32_t blocks, void *buffer) { @@ -908,7 +1032,7 @@ usb_msc_read_10(struct usb_device *udev, cmd[8] = blocks; cmd[9] = 0; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (USB_ERR_INVAL); @@ -939,7 +1063,7 @@ usb_msc_write_10(struct usb_device *udev cmd[8] = blocks; cmd[9] = 0; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (USB_ERR_INVAL); @@ -958,7 +1082,7 @@ usb_msc_read_capacity(struct usb_device struct bbb_transfer *sc; usb_error_t err; - sc = bbb_attach(udev, iface_index); + sc = bbb_attach(udev, iface_index, UICLASS_MASS); if (sc == NULL) return (USB_ERR_INVAL); Modified: head/sys/dev/usb/usb_msctest.h ============================================================================== --- head/sys/dev/usb/usb_msctest.h Thu May 7 12:38:23 2015 (r282576) +++ head/sys/dev/usb/usb_msctest.h Thu May 7 12:54:27 2015 (r282577) @@ -52,5 +52,7 @@ usb_error_t usb_msc_write_10(struct usb_ usb_error_t usb_msc_read_capacity(struct usb_device *udev, uint8_t iface_index, uint32_t *lba_last, uint32_t *block_size); +usb_error_t usb_dymo_eject(struct usb_device *udev, + uint8_t iface_index); #endif /* _USB_MSCTEST_H_ */ Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu May 7 12:38:23 2015 (r282576) +++ head/sys/dev/usb/usbdevs Thu May 7 12:54:27 2015 (r282577) @@ -452,6 +452,7 @@ vendor GLOBESPAN 0x0915 Globespan vendor CONCORDCAMERA 0x0919 Concord Camera vendor GARMIN 0x091e Garmin International vendor GOHUBS 0x0921 GoHubs +vendor DYMO 0x0922 DYMO vendor XEROX 0x0924 Xerox vendor BIOMETRIC 0x0929 American Biometric Company vendor TOSHIBA 0x0930 Toshiba @@ -1694,6 +1695,9 @@ product DRESDENELEKTRONIK WIRELESSHANDHE product DRESDENELEKTRONIK DE_RFNODE 0x001c deRFnode product DRESDENELEKTRONIK LEVELSHIFTERSTICKLOWCOST 0x0022 Levelshifter Stick Low Cost +/* DYMO */ +product DYMO LABELMANAGERPNP 0x1001 DYMO LabelManager PnP + /* Dynastream Innovations */ product DYNASTREAM ANTDEVBOARD 0x1003 ANT dev board product DYNASTREAM ANT2USB 0x1004 ANT2USB From owner-svn-src-head@FreeBSD.ORG Thu May 7 14:17:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2150F351; Thu, 7 May 2015 14:17: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 0F82A1C1E; Thu, 7 May 2015 14:17: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 t47EHhjl047809; Thu, 7 May 2015 14:17:43 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47EHh0W047808; Thu, 7 May 2015 14:17:43 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201505071417.t47EHh0W047808@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 7 May 2015 14:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282578 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 14:17:44 -0000 Author: ae Date: Thu May 7 14:17:43 2015 New Revision: 282578 URL: https://svnweb.freebsd.org/changeset/base/282578 Log: Mark data checksum as valid for multicast packets, that we send back to myself via simloop. Also remove duplicate check under #ifdef DIAGNOSTIC. PR: 180065 MFC after: 1 week Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu May 7 12:54:27 2015 (r282577) +++ head/sys/netinet6/ip6_output.c Thu May 7 14:17:43 2015 (r282578) @@ -2900,14 +2900,6 @@ ip6_mloopback(struct ifnet *ifp, struct if (copym == NULL) return; } - -#ifdef DIAGNOSTIC - if (copym->m_len < sizeof(*ip6)) { - m_freem(copym); - return; - } -#endif - ip6 = mtod(copym, struct ip6_hdr *); /* * clear embedded scope identifiers if necessary. @@ -2915,7 +2907,11 @@ ip6_mloopback(struct ifnet *ifp, struct */ in6_clearscope(&ip6->ip6_src); in6_clearscope(&ip6->ip6_dst); - + if (copym->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + copym->m_pkthdr.csum_flags |= CSUM_DATA_VALID_IPV6 | + CSUM_PSEUDO_HDR; + copym->m_pkthdr.csum_data = 0xffff; + } (void)if_simloop(ifp, copym, dst->sin6_family, 0); } From owner-svn-src-head@FreeBSD.ORG Thu May 7 16:56:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19E809BA; Thu, 7 May 2015 16:56: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 085221FEE; Thu, 7 May 2015 16:56: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 t47GuKAq030768; Thu, 7 May 2015 16:56:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47GuK4A030767; Thu, 7 May 2015 16:56:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201505071656.t47GuK4A030767@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 May 2015 16:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282586 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 16:56:21 -0000 Author: emaste Date: Thu May 7 16:56:20 2015 New Revision: 282586 URL: https://svnweb.freebsd.org/changeset/base/282586 Log: Correct PL310_POWER_CTRL offset Offet for the power control register was specified incorrectly (it had the same value as the prefetch control register.) This change corrects the offset value to 0xF80, per the ARM PL310 documentation. Submitted by: Steve Kiernan Obtained from: Juniper Networks, Inc. Modified: head/sys/arm/include/pl310.h Modified: head/sys/arm/include/pl310.h ============================================================================== --- head/sys/arm/include/pl310.h Thu May 7 15:31:21 2015 (r282585) +++ head/sys/arm/include/pl310.h Thu May 7 16:56:20 2015 (r282586) @@ -133,7 +133,7 @@ #define PREFETCH_CTRL_DATA_PREFETCH (1 << 28) #define PREFETCH_CTRL_INSTR_PREFETCH (1 << 29) #define PREFETCH_CTRL_DL (1 << 30) -#define PL310_POWER_CTRL 0xF60 +#define PL310_POWER_CTRL 0xF80 #define POWER_CTRL_ENABLE_GATING (1 << 0) #define POWER_CTRL_ENABLE_STANDBY (1 << 1) From owner-svn-src-head@FreeBSD.ORG Thu May 7 18:35:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF1ADD63; Thu, 7 May 2015 18:35: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 9D9771CD2; Thu, 7 May 2015 18:35: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 t47IZ22l087270; Thu, 7 May 2015 18:35:02 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47IZ2BB087269; Thu, 7 May 2015 18:35:02 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201505071835.t47IZ2BB087269@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 7 May 2015 18:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282594 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 18:35:02 -0000 Author: ae Date: Thu May 7 18:35:01 2015 New Revision: 282594 URL: https://svnweb.freebsd.org/changeset/base/282594 Log: m_dup() is supposed to give a writable copy of an mbuf chain. It uses m_dup_pkthdr(), that uses M_COPYFLAGS mask to copy m_flags field. If original mbuf chain has M_RDONLY flag, its copy also will have it. Reset this flag explicitly. MFC after: 2 weeks Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu May 7 18:32:11 2015 (r282593) +++ head/sys/kern/uipc_mbuf.c Thu May 7 18:35:01 2015 (r282594) @@ -813,6 +813,7 @@ m_dup(struct mbuf *m, int how) } if ((n->m_flags & M_EXT) == 0) nsize = MHLEN; + n->m_flags &= ~M_RDONLY; } n->m_len = 0; From owner-svn-src-head@FreeBSD.ORG Thu May 7 18:35:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21577EA3; Thu, 7 May 2015 18:35: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 E9CEA1CD7; Thu, 7 May 2015 18:35: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 t47IZFGA087377; Thu, 7 May 2015 18:35:15 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47IZFEn087376; Thu, 7 May 2015 18:35:15 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505071835.t47IZFEn087376@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Thu, 7 May 2015 18:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282595 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 18:35:16 -0000 Author: neel Date: Thu May 7 18:35:15 2015 New Revision: 282595 URL: https://svnweb.freebsd.org/changeset/base/282595 Log: Allow byte reads of AHCI registers. This is needed to support Windows guests that use byte reads to access certain AHCI registers (e.g. PxTFD.Status and PxTFD.Error). Reviewed by: grehan, mav Reported by: Leon Dang (ldang@nahannisys.com) Differential Revision: https://reviews.freebsd.org/D2469 MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Thu May 7 18:35:01 2015 (r282594) +++ head/usr.sbin/bhyve/pci_ahci.c Thu May 7 18:35:15 2015 (r282595) @@ -2093,7 +2093,7 @@ pci_ahci_write(struct vmctx *ctx, int vc struct pci_ahci_softc *sc = pi->pi_arg; assert(baridx == 5); - assert(size == 4); + assert((offset % 4) == 0 && size == 4); pthread_mutex_lock(&sc->mtx); @@ -2182,24 +2182,29 @@ pci_ahci_port_read(struct pci_ahci_softc static uint64_t pci_ahci_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx, - uint64_t offset, int size) + uint64_t regoff, int size) { struct pci_ahci_softc *sc = pi->pi_arg; + uint64_t offset; uint32_t value; assert(baridx == 5); - assert(size == 4); + assert(size == 1 || size == 2 || size == 4); + assert((regoff & (size - 1)) == 0); pthread_mutex_lock(&sc->mtx); + offset = regoff & ~0x3; /* round down to a multiple of 4 bytes */ if (offset < AHCI_OFFSET) value = pci_ahci_host_read(sc, offset); else if (offset < AHCI_OFFSET + sc->ports * AHCI_STEP) value = pci_ahci_port_read(sc, offset); else { value = 0; - WPRINTF("pci_ahci: unknown i/o read offset 0x%"PRIx64"\n", offset); + WPRINTF("pci_ahci: unknown i/o read offset 0x%"PRIx64"\n", + regoff); } + value >>= 8 * (regoff & 0x3); pthread_mutex_unlock(&sc->mtx); From owner-svn-src-head@FreeBSD.ORG Thu May 7 20:54:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C8E5184; Thu, 7 May 2015 20:54:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 629B51D13; Thu, 7 May 2015 20:54:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t47KsdMM065941; Thu, 7 May 2015 20:54:39 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47Kscmh065939; Thu, 7 May 2015 20:54:38 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201505072054.t47Kscmh065939@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 7 May 2015 20:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282608 - head/bin/date X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 20:54:39 -0000 Author: delphij Date: Thu May 7 20:54:38 2015 New Revision: 282608 URL: https://svnweb.freebsd.org/changeset/base/282608 Log: date(1): Make -r behave like GNU's version when the option can not be interpreted as a number, which checks the file's modification time and use that as the date/time value. This improves compatibility with GNU coreutils's version of time(1). MFC after: 2 weeks Modified: head/bin/date/date.1 head/bin/date/date.c Modified: head/bin/date/date.1 ============================================================================== --- head/bin/date/date.1 Thu May 7 20:25:17 2015 (r282607) +++ head/bin/date/date.1 Thu May 7 20:54:38 2015 (r282608) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 26, 2014 +.Dd May 7, 2015 .Dt DATE 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .Op Fl jRu -.Op Fl r Ar seconds +.Op Fl r Ar seconds | Ar filename .Oo .Fl v .Sm off @@ -150,6 +150,9 @@ is the number of seconds since the Epoch see .Xr time 3 ) , and can be specified in decimal, octal, or hex. +.It Fl r Ar filename +Print the date and time of the last modification of +.Ar filename . .It Fl t Ar minutes_west Set the system's value for minutes west of .Tn GMT . Modified: head/bin/date/date.c ============================================================================== --- head/bin/date/date.c Thu May 7 20:25:17 2015 (r282607) +++ head/bin/date/date.c Thu May 7 20:54:38 2015 (r282608) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -85,6 +86,7 @@ main(int argc, char *argv[]) struct vary *v; const struct vary *badv; struct tm lt; + struct stat sb; v = NULL; fmt = NULL; @@ -116,8 +118,12 @@ main(int argc, char *argv[]) case 'r': /* user specified seconds */ rflag = 1; tval = strtoq(optarg, &tmp, 0); - if (*tmp != 0) - usage(); + if (*tmp != 0) { + if (stat(optarg, &sb) == 0) + tval = sb.st_mtim.tv_sec; + else + usage(); + } break; case 't': /* minutes west of UTC */ /* error check; don't allow "PST" */ From owner-svn-src-head@FreeBSD.ORG Thu May 7 21:30:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FFF6828; Thu, 7 May 2015 21: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 1EFCD106E; Thu, 7 May 2015 21: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 t47LUT97082181; Thu, 7 May 2015 21:30:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47LUT9M082180; Thu, 7 May 2015 21:30:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505072130.t47LUT9M082180@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 7 May 2015 21:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282609 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 21:30:30 -0000 Author: bapt Date: Thu May 7 21:30:29 2015 New Revision: 282609 URL: https://svnweb.freebsd.org/changeset/base/282609 Log: Reduce the size to 64 for the commands, 512 was way too large for the purpose Noticed by: julian Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Thu May 7 20:54:38 2015 (r282608) +++ head/usr.bin/checknr/checknr.c Thu May 7 21:30:29 2015 (r282609) @@ -313,7 +313,7 @@ static void process(FILE *f) { int i, n; - char mac[512]; /* The current macro or nroff command */ + char mac[64]; /* The current macro or nroff command */ char *line; size_t linecap; int pl; From owner-svn-src-head@FreeBSD.ORG Thu May 7 22:11:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77E78751; Thu, 7 May 2015 22:11: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 599361586; Thu, 7 May 2015 22:11: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 t47MBkoJ008185; Thu, 7 May 2015 22:11:46 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47MBjQ8008175; Thu, 7 May 2015 22:11:45 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505072211.t47MBjQ8008175@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 7 May 2015 22:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282610 - in head/sys: arm/broadcom/bcm2835 arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 22:11:47 -0000 Author: loos Date: Thu May 7 22:11:44 2015 New Revision: 282610 URL: https://svnweb.freebsd.org/changeset/base/282610 Log: Add the SMP support for Raspberry Pi 2 (BCM2836). Tested with the build of some ports and a buildworld. Submitted by: Daisuke Aoyama Added: head/sys/arm/broadcom/bcm2835/bcm2836_mp.c (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c head/sys/arm/broadcom/bcm2835/bcm2836.c head/sys/arm/broadcom/bcm2835/files.bcm2836 head/sys/arm/broadcom/bcm2835/std.bcm2836 head/sys/arm/conf/RPI2 head/sys/boot/fdt/dts/arm/rpi2.dts Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Thu May 7 21:30:29 2015 (r282609) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Thu May 7 22:11:44 2015 (r282610) @@ -1425,7 +1425,10 @@ static int bcm2835_cpufreq_probe(device_t dev) { + if (device_get_unit(dev) != 0) + return (ENXIO); device_set_desc(dev, "CPU Frequency Control"); + return (0); } Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836.c Thu May 7 21:30:29 2015 (r282609) +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Thu May 7 22:11:44 2015 (r282610) @@ -52,7 +52,9 @@ __FBSDID("$FreeBSD$"); #define ARM_LOCAL_INT_TIMER(n) (0x40 + (n) * 4) #define ARM_LOCAL_INT_MAILBOX(n) (0x50 + (n) * 4) #define ARM_LOCAL_INT_PENDING(n) (0x60 + (n) * 4) -#define INT_PENDING_MASK 0x0f +#define INT_PENDING_MASK 0x01f +#define MAILBOX0_IRQ 4 +#define MAILBOX0_IRQEN (1 << 0) /* * A driver for features of the bcm2836. @@ -141,12 +143,27 @@ void bcm2836_mask_irq(uintptr_t irq) { uint32_t reg; +#ifdef SMP + int cpu; +#endif int i; - for (i = 0; i < 4; i++) { - reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i)); - reg &= ~(1 << irq); - bus_write_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i), reg); + if (irq < MAILBOX0_IRQ) { + for (i = 0; i < 4; i++) { + reg = bus_read_4(softc->sc_mem, + ARM_LOCAL_INT_TIMER(i)); + reg &= ~(1 << irq); + bus_write_4(softc->sc_mem, + ARM_LOCAL_INT_TIMER(i), reg); + } +#ifdef SMP + } else if (irq == MAILBOX0_IRQ) { + /* Mailbox 0 for IPI */ + cpu = PCPU_GET(cpuid); + reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu)); + reg &= ~MAILBOX0_IRQEN; + bus_write_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu), reg); +#endif } } @@ -154,12 +171,27 @@ void bcm2836_unmask_irq(uintptr_t irq) { uint32_t reg; +#ifdef SMP + int cpu; +#endif int i; - for (i = 0; i < 4; i++) { - reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i)); - reg |= (1 << irq); - bus_write_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i), reg); + if (irq < MAILBOX0_IRQ) { + for (i = 0; i < 4; i++) { + reg = bus_read_4(softc->sc_mem, + ARM_LOCAL_INT_TIMER(i)); + reg |= (1 << irq); + bus_write_4(softc->sc_mem, + ARM_LOCAL_INT_TIMER(i), reg); + } +#ifdef SMP + } else if (irq == MAILBOX0_IRQ) { + /* Mailbox 0 for IPI */ + cpu = PCPU_GET(cpuid); + reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu)); + reg |= MAILBOX0_IRQEN; + bus_write_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu), reg); +#endif } } Added: head/sys/arm/broadcom/bcm2835/bcm2836_mp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2836_mp.c Thu May 7 22:11:44 2015 (r282610) @@ -0,0 +1,207 @@ +/*- + * Copyright (C) 2015 Daisuke Aoyama + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#ifdef DEBUG +#define DPRINTF(fmt, ...) do { \ + printf("%s:%u: ", __func__, __LINE__); \ + printf(fmt, ##__VA_ARGS__); \ +} while (0) +#else +#define DPRINTF(fmt, ...) +#endif + +#define ARM_LOCAL_BASE 0x40000000 +#define ARM_LOCAL_SIZE 0x00001000 + +/* mailbox registers */ +#define MBOXINTRCTRL_CORE(n) (0x00000050 + (0x04 * (n))) +#define MBOX0SET_CORE(n) (0x00000080 + (0x10 * (n))) +#define MBOX1SET_CORE(n) (0x00000084 + (0x10 * (n))) +#define MBOX2SET_CORE(n) (0x00000088 + (0x10 * (n))) +#define MBOX3SET_CORE(n) (0x0000008C + (0x10 * (n))) +#define MBOX0CLR_CORE(n) (0x000000C0 + (0x10 * (n))) +#define MBOX1CLR_CORE(n) (0x000000C4 + (0x10 * (n))) +#define MBOX2CLR_CORE(n) (0x000000C8 + (0x10 * (n))) +#define MBOX3CLR_CORE(n) (0x000000CC + (0x10 * (n))) + +static bus_space_handle_t bs_periph; + +#define BSRD4(addr) \ + bus_space_read_4(fdtbus_bs_tag, bs_periph, (addr)) +#define BSWR4(addr, val) \ + bus_space_write_4(fdtbus_bs_tag, bs_periph, (addr), (val)) + +void +platform_mp_init_secondary(void) +{ + +} + +void +platform_mp_setmaxid(void) +{ + + DPRINTF("platform_mp_setmaxid\n"); + if (mp_ncpus != 0) + return; + + mp_ncpus = 4; + mp_maxid = mp_ncpus - 1; + DPRINTF("mp_maxid=%d\n", mp_maxid); +} + +int +platform_mp_probe(void) +{ + + DPRINTF("platform_mp_probe\n"); + CPU_SETOF(0, &all_cpus); + if (mp_ncpus == 0) + platform_mp_setmaxid(); + return (mp_ncpus > 1); +} + +void +platform_mp_start_ap(void) +{ + uint32_t val; + int i, retry; + + DPRINTF("platform_mp_start_ap\n"); + + /* initialize */ + if (bus_space_map(fdtbus_bs_tag, ARM_LOCAL_BASE, ARM_LOCAL_SIZE, + 0, &bs_periph) != 0) + panic("can't map local peripheral\n"); + for (i = 0; i < mp_ncpus; i++) { + /* clear mailbox 0/3 */ + BSWR4(MBOX0CLR_CORE(i), 0xffffffff); + BSWR4(MBOX3CLR_CORE(i), 0xffffffff); + } + wmb(); + + /* boot secondary CPUs */ + for (i = 1; i < mp_ncpus; i++) { + /* set entry point to mailbox 3 */ + BSWR4(MBOX3SET_CORE(i), + (uint32_t)pmap_kextract((vm_offset_t)mpentry)); + wmb(); + + /* wait for bootup */ + retry = 1000; + do { + /* check entry point */ + val = BSRD4(MBOX3CLR_CORE(i)); + if (val == 0) + break; + DELAY(100); + retry--; + if (retry <= 0) { + printf("can't start for CPU%d\n", i); + break; + } + } while (1); + + /* dsb and sev */ + armv7_sev(); + + /* recode AP in CPU map */ + CPU_SET(i, &all_cpus); + } + + cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); +} + +void +pic_ipi_send(cpuset_t cpus, u_int ipi) +{ + int i; + + dsb(); + for (i = 0; i < mp_ncpus; i++) { + if (CPU_ISSET(i, &cpus)) + BSWR4(MBOX0SET_CORE(i), 1 << ipi); + } + wmb(); +} + +int +pic_ipi_read(int i) +{ + uint32_t val; + int cpu, ipi; + + cpu = PCPU_GET(cpuid); + dsb(); + if (i != -1) { + val = BSRD4(MBOX0CLR_CORE(cpu)); + if (val == 0) + return (0); + ipi = ffs(val) - 1; + return (ipi); + } + return (0x3ff); +} + +void +pic_ipi_clear(int ipi) +{ + int cpu; + + cpu = PCPU_GET(cpuid); + dsb(); + BSWR4(MBOX0CLR_CORE(cpu), 1 << ipi); + wmb(); +} + +void +platform_ipi_send(cpuset_t cpus, u_int ipi) +{ + + pic_ipi_send(cpus, ipi); +} Modified: head/sys/arm/broadcom/bcm2835/files.bcm2836 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2836 Thu May 7 21:30:29 2015 (r282609) +++ head/sys/arm/broadcom/bcm2835/files.bcm2836 Thu May 7 22:11:44 2015 (r282610) @@ -3,3 +3,4 @@ arm/arm/generic_timer.c standard arm/broadcom/bcm2835/bcm2836.c standard +arm/broadcom/bcm2835/bcm2836_mp.c optional smp Modified: head/sys/arm/broadcom/bcm2835/std.bcm2836 ============================================================================== --- head/sys/arm/broadcom/bcm2835/std.bcm2836 Thu May 7 21:30:29 2015 (r282609) +++ head/sys/arm/broadcom/bcm2835/std.bcm2836 Thu May 7 22:11:44 2015 (r282610) @@ -6,6 +6,7 @@ makeoptions CONF_CFLAGS="-march=armv7a" options SOC_BCM2836 options ARM_L2_PIPT +options IPI_IRQ_START=76 files "../broadcom/bcm2835/files.bcm2836" files "../broadcom/bcm2835/files.bcm283x" Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Thu May 7 21:30:29 2015 (r282609) +++ head/sys/arm/conf/RPI2 Thu May 7 22:11:44 2015 (r282610) @@ -25,7 +25,8 @@ include "../broadcom/bcm2835/std.rpi" include "../broadcom/bcm2835/std.bcm2836" options HZ=100 -options SCHED_4BSD # 4BSD scheduler +options SCHED_ULE # ULE scheduler +options SMP # Enable multiple cores options PLATFORM # Debugging for use in -current Modified: head/sys/boot/fdt/dts/arm/rpi2.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/rpi2.dts Thu May 7 21:30:29 2015 (r282609) +++ head/sys/boot/fdt/dts/arm/rpi2.dts Thu May 7 22:11:44 2015 (r282610) @@ -43,6 +43,24 @@ reg = <0xf00>; /* CPU ID=0xf00 */ clock-frequency = <800000000>; /* 800MHz */ }; + cpu@1 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0xf01>; /* CPU ID=0xf01 */ + clock-frequency = <800000000>; /* 800MHz */ + }; + cpu@2 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0xf02>; /* CPU ID=0xf02 */ + clock-frequency = <800000000>; /* 800MHz */ + }; + cpu@3 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0xf03>; /* CPU ID=0xf03 */ + clock-frequency = <800000000>; /* 800MHz */ + }; }; memory { From owner-svn-src-head@FreeBSD.ORG Thu May 7 22:54:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3747DEA; Thu, 7 May 2015 22:54: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 A49D319C8; Thu, 7 May 2015 22:54: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 t47MsWOZ030188; Thu, 7 May 2015 22:54:32 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47MsWpO030187; Thu, 7 May 2015 22:54:32 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201505072254.t47MsWpO030187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 7 May 2015 22:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282613 - head/contrib/netcat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 22:54:32 -0000 Author: delphij Date: Thu May 7 22:54:31 2015 New Revision: 282613 URL: https://svnweb.freebsd.org/changeset/base/282613 Log: MFV r282611: netcat from OpenBSD 5.7. MFC after: 2 weeks Modified: head/contrib/netcat/netcat.c Directory Properties: head/contrib/netcat/ (props changed) Modified: head/contrib/netcat/netcat.c ============================================================================== --- head/contrib/netcat/netcat.c Thu May 7 22:48:13 2015 (r282612) +++ head/contrib/netcat/netcat.c Thu May 7 22:54:31 2015 (r282613) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.122 2014/07/20 01:38:40 guenther Exp $ */ +/* $OpenBSD: netcat.c,v 1.127 2015/02/14 22:40:22 jca Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -42,7 +42,6 @@ #include #include -#include #ifdef IPSEC #include #endif @@ -73,6 +72,12 @@ #define PORT_MAX_LEN 6 #define UNIX_DG_TMP_SOCKET_SIZE 19 +#define POLL_STDIN 0 +#define POLL_NETOUT 1 +#define POLL_NETIN 2 +#define POLL_STDOUT 3 +#define BUFSIZE 16384 + /* Command Line Options */ int dflag; /* detached, no stdin */ int Fflag; /* fdpass sock to stdout */ @@ -117,10 +122,12 @@ int udptest(int); int unix_bind(char *); int unix_connect(char *); int unix_listen(char *); -void set_common_sockopts(int); +void set_common_sockopts(int, int); int map_tos(char *, int *); void report_connect(const struct sockaddr *, socklen_t); void usage(int); +ssize_t drainbuf(int, unsigned char *, size_t *); +ssize_t fillbuf(int, unsigned char *, size_t *); #ifdef IPSEC void add_ipsec_policy(int, char *); @@ -436,7 +443,7 @@ main(int argc, char *argv[]) &len); if (connfd == -1) { /* For now, all errnos are fatal */ - err(1, "accept"); + err(1, "accept"); } if (vflag) report_connect((struct sockaddr *)&cliaddr, len); @@ -663,7 +670,7 @@ remote_connect(const char *host, const c freeaddrinfo(ares); } - set_common_sockopts(s); + set_common_sockopts(s, res0->ai_family); if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0) break; @@ -767,6 +774,8 @@ local_listen(char *host, char *port, str err(1, "disable TCP options"); } + set_common_sockopts(s, res0->ai_family); + if (bind(s, (struct sockaddr *)res0->ai_addr, res0->ai_addrlen) == 0) break; @@ -790,68 +799,224 @@ local_listen(char *host, char *port, str * Loop that polls on the network file descriptor and stdin. */ void -readwrite(int nfd) +readwrite(int net_fd) { - struct pollfd pfd[2]; - unsigned char buf[16 * 1024]; - int n, wfd = fileno(stdin); - int lfd = fileno(stdout); - int plen; - - plen = sizeof(buf); - - /* Setup Network FD */ - pfd[0].fd = nfd; - pfd[0].events = POLLIN; - - /* Set up STDIN FD. */ - pfd[1].fd = wfd; - pfd[1].events = POLLIN; + struct pollfd pfd[4]; + int stdin_fd = STDIN_FILENO; + int stdout_fd = STDOUT_FILENO; + unsigned char netinbuf[BUFSIZE]; + size_t netinbufpos = 0; + unsigned char stdinbuf[BUFSIZE]; + size_t stdinbufpos = 0; + int n, num_fds; + ssize_t ret; + + /* don't read from stdin if requested */ + if (dflag) + stdin_fd = -1; + + /* stdin */ + pfd[POLL_STDIN].fd = stdin_fd; + pfd[POLL_STDIN].events = POLLIN; + + /* network out */ + pfd[POLL_NETOUT].fd = net_fd; + pfd[POLL_NETOUT].events = 0; + + /* network in */ + pfd[POLL_NETIN].fd = net_fd; + pfd[POLL_NETIN].events = POLLIN; + + /* stdout */ + pfd[POLL_STDOUT].fd = stdout_fd; + pfd[POLL_STDOUT].events = 0; + + while (1) { + /* both inputs are gone, buffers are empty, we are done */ + if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1 + && stdinbufpos == 0 && netinbufpos == 0) { + close(net_fd); + return; + } + /* both outputs are gone, we can't continue */ + if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1) { + close(net_fd); + return; + } + /* listen and net in gone, queues empty, done */ + if (lflag && pfd[POLL_NETIN].fd == -1 + && stdinbufpos == 0 && netinbufpos == 0) { + close(net_fd); + return; + } - while (pfd[0].fd != -1) { + /* help says -i is for "wait between lines sent". We read and + * write arbitrary amounts of data, and we don't want to start + * scanning for newlines, so this is as good as it gets */ if (iflag) sleep(iflag); - if ((n = poll(pfd, 2 - dflag, timeout)) < 0) { - int saved_errno = errno; - close(nfd); - errc(1, saved_errno, "Polling Error"); + /* poll */ + num_fds = poll(pfd, 4, timeout); + + /* treat poll errors */ + if (num_fds == -1) { + close(net_fd); + err(1, "polling error"); } - if (n == 0) + /* timeout happened */ + if (num_fds == 0) return; - if (pfd[0].revents & POLLIN) { - if ((n = read(nfd, buf, plen)) < 0) - return; - else if (n == 0) { - shutdown(nfd, SHUT_RD); - pfd[0].fd = -1; - pfd[0].events = 0; - } else { - if (tflag) - atelnet(nfd, buf, n); - if (atomicio(vwrite, lfd, buf, n) != n) - return; + /* treat socket error conditions */ + for (n = 0; n < 4; n++) { + if (pfd[n].revents & (POLLERR|POLLNVAL)) { + pfd[n].fd = -1; } } + /* reading is possible after HUP */ + if (pfd[POLL_STDIN].events & POLLIN && + pfd[POLL_STDIN].revents & POLLHUP && + ! (pfd[POLL_STDIN].revents & POLLIN)) + pfd[POLL_STDIN].fd = -1; + + if (pfd[POLL_NETIN].events & POLLIN && + pfd[POLL_NETIN].revents & POLLHUP && + ! (pfd[POLL_NETIN].revents & POLLIN)) + pfd[POLL_NETIN].fd = -1; + + if (pfd[POLL_NETOUT].revents & POLLHUP) { + if (Nflag) + shutdown(pfd[POLL_NETOUT].fd, SHUT_WR); + pfd[POLL_NETOUT].fd = -1; + } + /* if HUP, stop watching stdout */ + if (pfd[POLL_STDOUT].revents & POLLHUP) + pfd[POLL_STDOUT].fd = -1; + /* if no net out, stop watching stdin */ + if (pfd[POLL_NETOUT].fd == -1) + pfd[POLL_STDIN].fd = -1; + /* if no stdout, stop watching net in */ + if (pfd[POLL_STDOUT].fd == -1) { + if (pfd[POLL_NETIN].fd != -1) + shutdown(pfd[POLL_NETIN].fd, SHUT_RD); + pfd[POLL_NETIN].fd = -1; + } - if (!dflag && pfd[1].revents & POLLIN) { - if ((n = read(wfd, buf, plen)) < 0) - return; - else if (n == 0) { - if (Nflag) - shutdown(nfd, SHUT_WR); - pfd[1].fd = -1; - pfd[1].events = 0; - } else { - if (atomicio(vwrite, nfd, buf, n) != n) - return; + /* try to read from stdin */ + if (pfd[POLL_STDIN].revents & POLLIN && stdinbufpos < BUFSIZE) { + ret = fillbuf(pfd[POLL_STDIN].fd, stdinbuf, + &stdinbufpos); + /* error or eof on stdin - remove from pfd */ + if (ret == 0 || ret == -1) + pfd[POLL_STDIN].fd = -1; + /* read something - poll net out */ + if (stdinbufpos > 0) + pfd[POLL_NETOUT].events = POLLOUT; + /* filled buffer - remove self from polling */ + if (stdinbufpos == BUFSIZE) + pfd[POLL_STDIN].events = 0; + } + /* try to write to network */ + if (pfd[POLL_NETOUT].revents & POLLOUT && stdinbufpos > 0) { + ret = drainbuf(pfd[POLL_NETOUT].fd, stdinbuf, + &stdinbufpos); + if (ret == -1) + pfd[POLL_NETOUT].fd = -1; + /* buffer empty - remove self from polling */ + if (stdinbufpos == 0) + pfd[POLL_NETOUT].events = 0; + /* buffer no longer full - poll stdin again */ + if (stdinbufpos < BUFSIZE) + pfd[POLL_STDIN].events = POLLIN; + } + /* try to read from network */ + if (pfd[POLL_NETIN].revents & POLLIN && netinbufpos < BUFSIZE) { + ret = fillbuf(pfd[POLL_NETIN].fd, netinbuf, + &netinbufpos); + if (ret == -1) + pfd[POLL_NETIN].fd = -1; + /* eof on net in - remove from pfd */ + if (ret == 0) { + shutdown(pfd[POLL_NETIN].fd, SHUT_RD); + pfd[POLL_NETIN].fd = -1; } + /* read something - poll stdout */ + if (netinbufpos > 0) + pfd[POLL_STDOUT].events = POLLOUT; + /* filled buffer - remove self from polling */ + if (netinbufpos == BUFSIZE) + pfd[POLL_NETIN].events = 0; + /* handle telnet */ + if (tflag) + atelnet(pfd[POLL_NETIN].fd, netinbuf, + netinbufpos); + } + /* try to write to stdout */ + if (pfd[POLL_STDOUT].revents & POLLOUT && netinbufpos > 0) { + ret = drainbuf(pfd[POLL_STDOUT].fd, netinbuf, + &netinbufpos); + if (ret == -1) + pfd[POLL_STDOUT].fd = -1; + /* buffer empty - remove self from polling */ + if (netinbufpos == 0) + pfd[POLL_STDOUT].events = 0; + /* buffer no longer full - poll net in again */ + if (netinbufpos < BUFSIZE) + pfd[POLL_NETIN].events = POLLIN; + } + + /* stdin gone and queue empty? */ + if (pfd[POLL_STDIN].fd == -1 && stdinbufpos == 0) { + if (pfd[POLL_NETOUT].fd != -1 && Nflag) + shutdown(pfd[POLL_NETOUT].fd, SHUT_WR); + pfd[POLL_NETOUT].fd = -1; + } + /* net in gone and queue empty? */ + if (pfd[POLL_NETIN].fd == -1 && netinbufpos == 0) { + pfd[POLL_STDOUT].fd = -1; } } } +ssize_t +drainbuf(int fd, unsigned char *buf, size_t *bufpos) +{ + ssize_t n; + ssize_t adjust; + + n = write(fd, buf, *bufpos); + /* don't treat EAGAIN, EINTR as error */ + if (n == -1 && (errno == EAGAIN || errno == EINTR)) + n = -2; + if (n <= 0) + return n; + /* adjust buffer */ + adjust = *bufpos - n; + if (adjust > 0) + memmove(buf, buf + n, adjust); + *bufpos -= n; + return n; +} + + +ssize_t +fillbuf(int fd, unsigned char *buf, size_t *bufpos) +{ + size_t num = BUFSIZE - *bufpos; + ssize_t n; + + n = read(fd, buf + *bufpos, num); + /* don't treat EAGAIN, EINTR as error */ + if (n == -1 && (errno == EAGAIN || errno == EINTR)) + n = -2; + if (n <= 0) + return n; + *bufpos += n; + return n; +} + /* * fdpass() * Pass the connected file descriptor to stdout and exit. @@ -1025,7 +1190,7 @@ udptest(int s) } void -set_common_sockopts(int s) +set_common_sockopts(int s, int af) { int x = 1; @@ -1040,8 +1205,17 @@ set_common_sockopts(int s) err(1, NULL); } if (Tflag != -1) { - if (setsockopt(s, IPPROTO_IP, IP_TOS, - &Tflag, sizeof(Tflag)) == -1) + int proto, option; + + if (af == AF_INET6) { + proto = IPPROTO_IPV6; + option = IPV6_TCLASS; + } else { + proto = IPPROTO_IP; + option = IP_TOS; + } + + if (setsockopt(s, proto, option, &Tflag, sizeof(Tflag)) == -1) err(1, "set IP ToS"); } if (Iflag) { From owner-svn-src-head@FreeBSD.ORG Fri May 8 00:56:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFFD3A5C; Fri, 8 May 2015 00:56: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 DDE1016CF; Fri, 8 May 2015 00:56: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 t480uvW3091715; Fri, 8 May 2015 00:56:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t480uvP4091712; Fri, 8 May 2015 00:56:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505080056.t480uvP4091712@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 8 May 2015 00:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282617 - in head/sys: vm x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 00:56:58 -0000 Author: adrian Date: Fri May 8 00:56:56 2015 New Revision: 282617 URL: https://svnweb.freebsd.org/changeset/base/282617 Log: Add initial memory locality cost awareness to the VM, and include a basic ACPI SLIT table parser. For now this just exports the map via sysctl; it'll eventually be useful to userland when there's more useful NUMA support in -HEAD. * Add an optional mem_locality map; * add a mapping function taking from/to domain and returning the relative cost, or -1 if it's not available; * Add a very basic SLIT parser to x86 ACPI. Differential Revision: https://reviews.freebsd.org/D2460 Reviewed by: rpaulo, stas, jhb Sponsored by: Norse Corp, Inc (hardware, coding); Dell (hardware) Modified: head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/x86/acpica/srat.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Thu May 7 23:49:48 2015 (r282616) +++ head/sys/vm/vm_phys.c Fri May 8 00:56:56 2015 (r282617) @@ -71,6 +71,7 @@ _Static_assert(sizeof(long) * NBBY >= VM "Too many physsegs."); struct mem_affinity *mem_affinity; +int *mem_locality; int vm_ndomains = 1; @@ -140,6 +141,10 @@ static int sysctl_vm_phys_segs(SYSCTL_HA SYSCTL_OID(_vm, OID_AUTO, phys_segs, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_vm_phys_segs, "A", "Phys Seg Info"); +static int sysctl_vm_phys_locality(SYSCTL_HANDLER_ARGS); +SYSCTL_OID(_vm, OID_AUTO, phys_locality, CTLTYPE_STRING | CTLFLAG_RD, + NULL, 0, sysctl_vm_phys_locality, "A", "Phys Locality Info"); + SYSCTL_INT(_vm, OID_AUTO, ndomains, CTLFLAG_RD, &vm_ndomains, 0, "Number of physical memory domains available."); @@ -297,6 +302,48 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) return (error); } +/* + * Return affinity, or -1 if there's no affinity information. + */ +static int +vm_phys_mem_affinity(int f, int t) +{ + + if (mem_locality == NULL) + return (-1); + if (f >= vm_ndomains || t >= vm_ndomains) + return (-1); + return (mem_locality[f * vm_ndomains + t]); +} + +/* + * Outputs the VM locality table. + */ +static int +sysctl_vm_phys_locality(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sbuf; + int error, i, j; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + + sbuf_printf(&sbuf, "\n"); + + for (i = 0; i < vm_ndomains; i++) { + sbuf_printf(&sbuf, "%d: ", i); + for (j = 0; j < vm_ndomains; j++) { + sbuf_printf(&sbuf, "%d ", vm_phys_mem_affinity(i, j)); + } + sbuf_printf(&sbuf, "\n"); + } + error = sbuf_finish(&sbuf); + sbuf_delete(&sbuf); + return (error); +} + static void vm_freelist_add(struct vm_freelist *fl, vm_page_t m, int order, int tail) { Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Thu May 7 23:49:48 2015 (r282616) +++ head/sys/vm/vm_phys.h Fri May 8 00:56:56 2015 (r282617) @@ -61,6 +61,7 @@ struct vm_phys_seg { }; extern struct mem_affinity *mem_affinity; +int *mem_locality; extern int vm_ndomains; extern struct vm_phys_seg vm_phys_segs[]; extern int vm_phys_nsegs; Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Thu May 7 23:49:48 2015 (r282616) +++ head/sys/x86/acpica/srat.c Fri May 8 00:56:56 2015 (r282617) @@ -64,9 +64,97 @@ static vm_paddr_t srat_physaddr; static int vm_domains[VM_PHYSSEG_MAX]; +static ACPI_TABLE_SLIT *slit; +static vm_paddr_t slit_physaddr; +static int vm_locality_table[MAXMEMDOM * MAXMEMDOM]; + static void srat_walk_table(acpi_subtable_handler *handler, void *arg); /* + * SLIT parsing. + */ + +static void +slit_parse_table(ACPI_TABLE_SLIT *s) +{ + int i, j; + int i_domain, j_domain; + int offset = 0; + uint8_t e; + + /* + * This maps the SLIT data into the VM-domain centric view. + * There may be sparse entries in the PXM namespace, so + * remap them to a VM-domain ID and if it doesn't exist, + * skip it. + * + * It should result in a packed 2d array of VM-domain + * locality information entries. + */ + + if (bootverbose) + printf("SLIT.Localities: %d\n", (int) s->LocalityCount); + for (i = 0; i < s->LocalityCount; i++) { + i_domain = acpi_map_pxm_to_vm_domainid(i); + if (i_domain < 0) + continue; + + if (bootverbose) + printf("%d: ", i); + for (j = 0; j < s->LocalityCount; j++) { + j_domain = acpi_map_pxm_to_vm_domainid(j); + if (j_domain < 0) + continue; + e = s->Entry[i * s->LocalityCount + j]; + if (bootverbose) + printf("%d ", (int) e); + /* 255 == "no locality information" */ + if (e == 255) + vm_locality_table[offset] = -1; + else + vm_locality_table[offset] = e; + offset++; + } + if (bootverbose) + printf("\n"); + } +} + +/* + * Look for an ACPI System Locality Distance Information Table ("SLIT") + */ +static int +parse_slit(void) +{ + + if (resource_disabled("slit", 0)) { + return (-1); + } + + slit_physaddr = acpi_find_table(ACPI_SIG_SLIT); + if (slit_physaddr == 0) { + return (-1); + } + + /* + * Make a pass over the table to populate the cpus[] and + * mem_info[] tables. + */ + slit = acpi_map_table(slit_physaddr, ACPI_SIG_SLIT); + slit_parse_table(slit); + acpi_unmap_table(slit); + slit = NULL; + + /* Tell the VM about it! */ + mem_locality = vm_locality_table; + return (0); +} + +/* + * SRAT parsing. + */ + +/* * Returns true if a memory range overlaps with at least one range in * phys_avail[]. */ @@ -301,17 +389,17 @@ renumber_domains(void) /* * Look for an ACPI System Resource Affinity Table ("SRAT") */ -static void -parse_srat(void *dummy) +static int +parse_srat(void) { int error; if (resource_disabled("srat", 0)) - return; + return (-1); srat_physaddr = acpi_find_table(ACPI_SIG_SRAT); if (srat_physaddr == 0) - return; + return (-1); /* * Make a pass over the table to populate the cpus[] and @@ -325,13 +413,39 @@ parse_srat(void *dummy) if (error || check_domains() != 0 || check_phys_avail() != 0 || renumber_domains() != 0) { srat_physaddr = 0; - return; + return (-1); } /* Point vm_phys at our memory affinity table. */ mem_affinity = mem_info; + + return (0); +} + +static void +init_mem_locality(void) +{ + int i; + + /* + * For now, assume 255 == "no locality information for + * this pairing. + */ + for (i = 0; i < MAXMEMDOM * MAXMEMDOM; i++) + vm_locality_table[i] = -1; +} + +static void +parse_acpi_tables(void *dummy) +{ + + if (parse_srat() < 0) + return; + init_mem_locality(); + (void) parse_slit(); } -SYSINIT(parse_srat, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_srat, NULL); +SYSINIT(parse_acpi_tables, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_acpi_tables, + NULL); static void srat_walk_table(acpi_subtable_handler *handler, void *arg) From owner-svn-src-head@FreeBSD.ORG Fri May 8 04:22:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55739941; Fri, 8 May 2015 04:22: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 4472B1C81; Fri, 8 May 2015 04:22: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 t484MCrp095302; Fri, 8 May 2015 04:22:12 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t484MBCe095300; Fri, 8 May 2015 04:22:11 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201505080422.t484MBCe095300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Fri, 8 May 2015 04:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282619 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 04:22:12 -0000 Author: ganbold Date: Fri May 8 04:22:11 2015 New Revision: 282619 URL: https://svnweb.freebsd.org/changeset/base/282619 Log: The interrupt-parent is set globally so it's unnecessary to also set it at each node. Differential Revision: https://reviews.freebsd.org/D2471 Submitted by: John Wehle Modified: head/sys/boot/fdt/dts/arm/odroidc1.dts head/sys/boot/fdt/dts/arm/vsatv102-m6.dts Modified: head/sys/boot/fdt/dts/arm/odroidc1.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/odroidc1.dts Fri May 8 02:21:29 2015 (r282618) +++ head/sys/boot/fdt/dts/arm/odroidc1.dts Fri May 8 04:22:11 2015 (r282619) @@ -194,7 +194,6 @@ compatible = "amlogic,aml8726-rtc"; reg = <0xc8100740 20>; /* aobus 0x1d0 */ interrupts = <0 72 1>; - interrupt-parent = <&gic>; init-always = "false"; xo-init = <0x180a>; @@ -246,7 +245,6 @@ compatible = "amlogic,aml8726-mmc"; reg = <0xc1108c20 32>; /* cbus 0x2308 */ interrupts = <0 28 1>; - interrupt-parent = <&gic>; clocks = <&clk81>; @@ -274,7 +272,6 @@ clock-frequency = <1275000000>; reg = <0xc1108e00 60>; /* cbus 0x2380 */ interrupts = <0 78 1>; - interrupt-parent = <&gic>; pinctrl-names = "default"; pinctrl-0 = <&pins_sdxc_c>; @@ -311,7 +308,6 @@ compatible = "synopsys,designware-hs-otg2"; reg = <0xc9040000 0x40000>; /* ahbbus 0x40000*/ interrupts = <0 30 4>; - interrupt-parent = <&gic>; #address-cells = <1>; #size-cells = <0>; @@ -323,7 +319,6 @@ compatible = "synopsys,designware-hs-otg2"; reg = <0xc90c0000 0x40000>; /* ahbbus 0xc0000 */ interrupts = <0 31 4>; - interrupt-parent = <&gic>; #address-cells = <1>; #size-cells = <0>; @@ -335,7 +330,6 @@ compatible = "snps,dwmac"; reg = <0xc9410000 0x2000>; /* ahbbus 0x410000 */ interrupts = <0 8 1>; - interrupt-parent = <&gic>; #address-cells = <1>; #size-cells = <0>; @@ -352,7 +346,6 @@ <0 3 1>, <0 12 1>, <0 13 1>; - interrupt-parent = <&gic>; address = <0x7900000>; /* match memreserve */ width = <720>; Modified: head/sys/boot/fdt/dts/arm/vsatv102-m6.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/vsatv102-m6.dts Fri May 8 02:21:29 2015 (r282618) +++ head/sys/boot/fdt/dts/arm/vsatv102-m6.dts Fri May 8 04:22:11 2015 (r282619) @@ -153,7 +153,6 @@ compatible = "amlogic,aml8726-rtc"; reg = <0xda004340 20>; /* secbus2 0xd0 */ interrupts = <0 72 1>; /* AM_IRQ2(8) */ - interrupt-parent = <&gic>; init-always = "false"; xo-init = <0x180a>; @@ -205,7 +204,6 @@ compatible = "amlogic,aml8726-mmc"; reg = <0xc1108c20 32>; /* cbus 0x2308 */ interrupts = <0 28 1>; /* AM_IRQ0(28) */ - interrupt-parent = <&gic>; clocks = <&clk81>; @@ -243,7 +241,6 @@ compatible = "synopsys,designware-hs-otg2"; reg = <0xc9040000 0x40000>; /* ahbbus 0x40000*/ interrupts = <0 30 4>; /* AM_IRQ0(30) */ - interrupt-parent = <&gic>; #address-cells = <1>; #size-cells = <0>; }; @@ -253,7 +250,6 @@ compatible = "synopsys,designware-hs-otg2"; reg = <0xc90c0000 0x40000>; /* ahbbus 0xc0000 */ interrupts = <0 31 4>; /* AM_IRQ0(31) */ - interrupt-parent = <&gic>; #address-cells = <1>; #size-cells = <0>; @@ -265,7 +261,6 @@ compatible = "snps,dwmac"; reg = <0xc9410000 0x2000>; /* ahbbus 0x410000 */ interrupts = <0 8 1>; /* AM_IRQ0(8) */ - interrupt-parent = <&gic>; #address-cells = <1>; #size-cells = <0>; @@ -282,7 +277,6 @@ <0 3 1>, /* AM_IRQ0(3) */ <0 12 1>, /* AM_IRQ0(12) */ <0 13 1>; /* AM_IRQ0(13) */ - interrupt-parent = <&gic>; address = <0x84900000>; /* match memreserve */ width = <720>; From owner-svn-src-head@FreeBSD.ORG Fri May 8 04:38:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 369F8EE1; Fri, 8 May 2015 04:38: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 263C11DCF; Fri, 8 May 2015 04:38: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 t484c2p9001210; Fri, 8 May 2015 04:38:02 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t484c2RO001209; Fri, 8 May 2015 04:38:02 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201505080438.t484c2RO001209@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Fri, 8 May 2015 04:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282620 - head/sys/arm/amlogic/aml8726 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 04:38:02 -0000 Author: ganbold Date: Fri May 8 04:38:01 2015 New Revision: 282620 URL: https://svnweb.freebsd.org/changeset/base/282620 Log: This follows the gic and ti/aintc code by adding additional barriers to the Amlogic pic driver. Differential Revision: https://reviews.freebsd.org/D2472 Submitted by: John Wehle Modified: head/sys/arm/amlogic/aml8726/aml8726_pic.c Modified: head/sys/arm/amlogic/aml8726/aml8726_pic.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_pic.c Fri May 8 04:22:11 2015 (r282619) +++ head/sys/arm/amlogic/aml8726/aml8726_pic.c Fri May 8 04:38:01 2015 (r282620) @@ -121,6 +121,8 @@ aml8726_pic_eoi(void *arg) if (nb >= AML_PIC_NIRQS) return; + arm_irq_memory_barrier(nb); + CSR_WRITE_4(aml8726_pic_sc, AML_PIC_STAT_CLR_REG(nb), AML_PIC_BIT(nb)); CSR_BARRIER(aml8726_pic_sc, AML_PIC_STAT_CLR_REG(nb)); @@ -265,8 +267,12 @@ arm_unmask_irq(uintptr_t nb) if (nb >= AML_PIC_NIRQS) return; + arm_irq_memory_barrier(nb); + mask = CSR_READ_4(aml8726_pic_sc, AML_PIC_MASK_REG(nb)); mask |= AML_PIC_BIT(nb); CSR_WRITE_4(aml8726_pic_sc, AML_PIC_MASK_REG(nb), mask); + + CSR_BARRIER(aml8726_pic_sc, AML_PIC_MASK_REG(nb)); } #endif From owner-svn-src-head@FreeBSD.ORG Fri May 8 06:02:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEFCDD75; Fri, 8 May 2015 06:02: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 CA869165D; Fri, 8 May 2015 06:02: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 t4862Nwm044513; Fri, 8 May 2015 06:02:23 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4862NgV044512; Fri, 8 May 2015 06:02:23 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505080602.t4862NgV044512@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 8 May 2015 06:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282621 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 06:02:24 -0000 Author: adrian Date: Fri May 8 06:02:23 2015 New Revision: 282621 URL: https://svnweb.freebsd.org/changeset/base/282621 Log: oops - how'd i miss this. Sorry! Modified: head/sys/vm/vm_phys.h Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Fri May 8 04:38:01 2015 (r282620) +++ head/sys/vm/vm_phys.h Fri May 8 06:02:23 2015 (r282621) @@ -61,7 +61,7 @@ struct vm_phys_seg { }; extern struct mem_affinity *mem_affinity; -int *mem_locality; +extern int *mem_locality; extern int vm_ndomains; extern struct vm_phys_seg vm_phys_segs[]; extern int vm_phys_nsegs; From owner-svn-src-head@FreeBSD.ORG Fri May 8 09:01:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C657273D; Fri, 8 May 2015 09:01: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 B47A01808; Fri, 8 May 2015 09:01: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 t48911At029481; Fri, 8 May 2015 09:01:01 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48911Rn029476; Fri, 8 May 2015 09:01:01 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201505080901.t48911Rn029476@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 8 May 2015 09:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282623 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 09:01:02 -0000 Author: kevlo Date: Fri May 8 09:01:00 2015 New Revision: 282623 URL: https://svnweb.freebsd.org/changeset/base/282623 Log: - Fix a wrong R92C_USTIME_TSF register definition - Fix intitial transmit rate to an 11g rate for the RTL8188EU - Add a comment about response rate settings Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Fri May 8 08:35:06 2015 (r282622) +++ head/sys/dev/usb/wlan/if_urtwn.c Fri May 8 09:01:00 2015 (r282623) @@ -1195,7 +1195,7 @@ urtwn_efuse_read(struct urtwn_softc *sc) uint8_t *rom = (uint8_t *)&sc->rom; uint16_t addr = 0; uint32_t reg; - uint8_t off, msk, vol; + uint8_t off, msk; int i; urtwn_efuse_switch_power(sc); @@ -1228,18 +1228,15 @@ urtwn_efuse_read(struct urtwn_softc *sc) printf("\n"); } #endif - /* Disable LDO 2.5V. */ - vol = urtwn_read_1(sc, R92C_EFUSE_TEST + 3); - urtwn_write_1(sc, R92C_EFUSE_TEST + 3, vol & ~(0x80)); - + urtwn_write_1(sc, R92C_EFUSE_ACCESS, R92C_EFUSE_ACCESS_OFF); } + static void urtwn_efuse_switch_power(struct urtwn_softc *sc) { uint32_t reg; - if (sc->chip & URTWN_CHIP_88E) - urtwn_write_1(sc, R92C_EFUSE_ACCESS, R92C_EFUSE_ACCESS_ON); + urtwn_write_1(sc, R92C_EFUSE_ACCESS, R92C_EFUSE_ACCESS_ON); reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL); if (!(reg & R92C_SYS_ISO_CTRL_PWC_EV12V)) { @@ -1257,16 +1254,6 @@ urtwn_efuse_switch_power(struct urtwn_so urtwn_write_2(sc, R92C_SYS_CLKR, reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M); } - - if (!(sc->chip & URTWN_CHIP_88E)) { - uint8_t vol; - - /* Enable LDO 2.5V. */ - vol = urtwn_read_1(sc, R92C_EFUSE_TEST + 3); - vol &= 0x0f; - vol |= 0x30; - urtwn_write_1(sc, R92C_EFUSE_TEST + 3, (vol | 0x80)); - } } static int @@ -1905,10 +1892,7 @@ urtwn_tx_start(struct urtwn_softc *sc, s txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, 8)); txd->txdw5 |= htole32(0x0001ff00); /* Send data at OFDM54. */ - if (sc->chip & URTWN_CHIP_88E) - txd->txdw5 |= htole32(0x13 & 0x3f); - else - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 11)); + txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 11)); } else { txd->txdw1 |= htole32( SM(R92C_TXDW1_MACID, 0) | @@ -3364,6 +3348,7 @@ urtwn_init_locked(void *arg) urtwn_rxfilter_init(sc); + /* Set response rate. */ reg = urtwn_read_4(sc, R92C_RRSR); reg = RW(reg, R92C_RRSR_RATE_BITMAP, R92C_RRSR_RATE_CCK_ONLY_1M); urtwn_write_4(sc, R92C_RRSR, reg); Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Fri May 8 08:35:06 2015 (r282622) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Fri May 8 09:01:00 2015 (r282623) @@ -177,13 +177,13 @@ #define R92C_RD_NAV_NXT 0x544 #define R92C_NAV_PROT_LEN 0x546 #define R92C_BCN_CTRL 0x550 -#define R92C_USTIME_TSF 0x551 #define R92C_MBID_NUM 0x552 #define R92C_DUAL_TSF_RST 0x553 #define R92C_BCN_INTERVAL 0x554 #define R92C_DRVERLYINT 0x558 #define R92C_BCNDMATIM 0x559 #define R92C_ATIMWND 0x55a +#define R92C_USTIME_TSF 0x55c #define R92C_BCN_MAX_ERR 0x55d #define R92C_RXTSF_OFFSET_CCK 0x55e #define R92C_RXTSF_OFFSET_OFDM 0x55f From owner-svn-src-head@FreeBSD.ORG Fri May 8 14:03:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E0CD464; Fri, 8 May 2015 14:03: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 5C8101D2A; Fri, 8 May 2015 14:03: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 t48E3F66086470; Fri, 8 May 2015 14:03:15 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48E3FCK086469; Fri, 8 May 2015 14:03:15 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505081403.t48E3FCK086469@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 8 May 2015 14:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282632 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 14:03:15 -0000 Author: avg Date: Fri May 8 14:03:14 2015 New Revision: 282632 URL: https://svnweb.freebsd.org/changeset/base/282632 Log: MFV r282630: 5809 Blowaway full receive in v1 pool causes kernel panic MFC after: 5 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri May 8 13:55:27 2015 (r282631) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri May 8 14:03:14 2015 (r282632) @@ -1142,7 +1142,8 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t } dsobj = dsl_dataset_create_sync(ds->ds_dir, recv_clone_name, snap, crflags, drba->drba_cred, tx); - dsl_dataset_rele(snap, FTAG); + if (drba->drba_snapobj != 0) + dsl_dataset_rele(snap, FTAG); dsl_dataset_rele(ds, FTAG); } else { dsl_dir_t *dd; From owner-svn-src-head@FreeBSD.ORG Fri May 8 14:48:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D3CB693; Fri, 8 May 2015 14:48: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 08C9D125D; Fri, 8 May 2015 14:48: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 t48EmgOK008109; Fri, 8 May 2015 14:48:42 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48EmedR008097; Fri, 8 May 2015 14:48:40 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201505081448.t48EmedR008097@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Fri, 8 May 2015 14:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282634 - in head/sys: conf dev/xen/blkback dev/xen/grant_table dev/xen/netback dev/xen/privcmd x86/xen xen xen/xenmem X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 14:48:43 -0000 Author: royger Date: Fri May 8 14:48:40 2015 New Revision: 282634 URL: https://svnweb.freebsd.org/changeset/base/282634 Log: xen: introduce a newbus function to allocate unused memory In order to map memory from other domains when running on Xen FreeBSD uses unused physical memory regions. Until now this memory has been allocated using bus_alloc_resource, but this is not completely safe as we can end up using unreclaimed MMIO or ACPI regions. Fix this by introducing a new newbus method that can be used by Xen drivers to request for unused memory regions. On amd64 we make sure this memory comes from regions above 4GB in order to prevent clashes with MMIO/ACPI regions. On i386 there's nothing we can do, so just fall back to the previous mechanism. Sponsored by: Citrix Systems R&D Tested by: Gustau Pérez Added: head/sys/xen/xenmem/ head/sys/xen/xenmem/xenmem_if.m (contents, props changed) Modified: head/sys/conf/files head/sys/dev/xen/blkback/blkback.c head/sys/dev/xen/grant_table/grant_table.c head/sys/dev/xen/netback/netback.c head/sys/dev/xen/privcmd/privcmd.c head/sys/x86/xen/xenpv.c head/sys/xen/xen-os.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 8 14:13:19 2015 (r282633) +++ head/sys/conf/files Fri May 8 14:48:40 2015 (r282634) @@ -4052,6 +4052,7 @@ xen/xenbus/xenbusb_if.m optional xenhvm xen/xenbus/xenbusb.c optional xenhvm xen/xenbus/xenbusb_front.c optional xenhvm xen/xenbus/xenbusb_back.c optional xenhvm +xen/xenmem/xenmem_if.m optional xenhvm xdr/xdr.c optional krpc | nfslockd | nfscl | nfsd xdr/xdr_array.c optional krpc | nfslockd | nfscl | nfsd xdr/xdr_mbuf.c optional krpc | nfslockd | nfscl | nfsd Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Fri May 8 14:13:19 2015 (r282633) +++ head/sys/dev/xen/blkback/blkback.c Fri May 8 14:48:40 2015 (r282634) @@ -2817,9 +2817,8 @@ xbb_free_communication_mem(struct xbb_so { if (xbb->kva != 0) { if (xbb->pseudo_phys_res != NULL) { - bus_release_resource(xbb->dev, SYS_RES_MEMORY, - xbb->pseudo_phys_res_id, - xbb->pseudo_phys_res); + xenmem_free(xbb->dev, xbb->pseudo_phys_res_id, + xbb->pseudo_phys_res); xbb->pseudo_phys_res = NULL; } } @@ -3056,10 +3055,8 @@ xbb_alloc_communication_mem(struct xbb_s * via grant table operations. */ xbb->pseudo_phys_res_id = 0; - xbb->pseudo_phys_res = bus_alloc_resource(xbb->dev, SYS_RES_MEMORY, - &xbb->pseudo_phys_res_id, - 0, ~0, xbb->kva_size, - RF_ACTIVE); + xbb->pseudo_phys_res = xenmem_alloc(xbb->dev, &xbb->pseudo_phys_res_id, + xbb->kva_size); if (xbb->pseudo_phys_res == NULL) { xbb->kva = 0; return (ENOMEM); Modified: head/sys/dev/xen/grant_table/grant_table.c ============================================================================== --- head/sys/dev/xen/grant_table/grant_table.c Fri May 8 14:13:19 2015 (r282633) +++ head/sys/dev/xen/grant_table/grant_table.c Fri May 8 14:48:40 2015 (r282634) @@ -559,9 +559,8 @@ gnttab_resume(device_t dev) KASSERT(dev != NULL, ("No resume frames and no device provided")); - gnttab_pseudo_phys_res = bus_alloc_resource(dev, - SYS_RES_MEMORY, &gnttab_pseudo_phys_res_id, 0, ~0, - PAGE_SIZE * max_nr_gframes, RF_ACTIVE); + gnttab_pseudo_phys_res = xenmem_alloc(dev, + &gnttab_pseudo_phys_res_id, PAGE_SIZE * max_nr_gframes); if (gnttab_pseudo_phys_res == NULL) panic("Unable to reserve physical memory for gnttab"); resume_frames = rman_get_start(gnttab_pseudo_phys_res); Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Fri May 8 14:13:19 2015 (r282633) +++ head/sys/dev/xen/netback/netback.c Fri May 8 14:48:40 2015 (r282634) @@ -625,8 +625,7 @@ xnb_free_communication_mem(struct xnb_so { if (xnb->kva != 0) { if (xnb->pseudo_phys_res != NULL) { - bus_release_resource(xnb->dev, SYS_RES_MEMORY, - xnb->pseudo_phys_res_id, + xenmem_free(xnb->dev, xnb->pseudo_phys_res_id, xnb->pseudo_phys_res); xnb->pseudo_phys_res = NULL; } @@ -819,10 +818,8 @@ xnb_alloc_communication_mem(struct xnb_s * into this space. */ xnb->pseudo_phys_res_id = 0; - xnb->pseudo_phys_res = bus_alloc_resource(xnb->dev, SYS_RES_MEMORY, - &xnb->pseudo_phys_res_id, - 0, ~0, xnb->kva_size, - RF_ACTIVE); + xnb->pseudo_phys_res = xenmem_alloc(xnb->dev, &xnb->pseudo_phys_res_id, + xnb->kva_size); if (xnb->pseudo_phys_res == NULL) { xnb->kva = 0; return (ENOMEM); Modified: head/sys/dev/xen/privcmd/privcmd.c ============================================================================== --- head/sys/dev/xen/privcmd/privcmd.c Fri May 8 14:13:19 2015 (r282633) +++ head/sys/dev/xen/privcmd/privcmd.c Fri May 8 14:48:40 2015 (r282634) @@ -141,11 +141,8 @@ retry: free(map->errs, M_PRIVCMD); } - vm_phys_fictitious_unreg_range(map->phys_base_addr, - map->phys_base_addr + map->size * PAGE_SIZE); - - error = bus_release_resource(privcmd_dev, SYS_RES_MEMORY, - map->pseudo_phys_res_id, map->pseudo_phys_res); + error = xenmem_free(privcmd_dev, map->pseudo_phys_res_id, + map->pseudo_phys_res); KASSERT(error == 0, ("Unable to release memory resource: %d", error)); free(map, M_PRIVCMD); @@ -196,36 +193,25 @@ privcmd_mmap_single(struct cdev *cdev, v vm_object_t *object, int nprot) { struct privcmd_map *map; - int error; map = malloc(sizeof(*map), M_PRIVCMD, M_WAITOK | M_ZERO); map->size = OFF_TO_IDX(size); map->pseudo_phys_res_id = 0; - map->pseudo_phys_res = bus_alloc_resource(privcmd_dev, SYS_RES_MEMORY, - &map->pseudo_phys_res_id, 0, ~0, size, RF_ACTIVE); + map->pseudo_phys_res = xenmem_alloc(privcmd_dev, + &map->pseudo_phys_res_id, size); if (map->pseudo_phys_res == NULL) { free(map, M_PRIVCMD); return (ENOMEM); } map->phys_base_addr = rman_get_start(map->pseudo_phys_res); - - error = vm_phys_fictitious_reg_range(map->phys_base_addr, - map->phys_base_addr + size, VM_MEMATTR_DEFAULT); - if (error) { - bus_release_resource(privcmd_dev, SYS_RES_MEMORY, - map->pseudo_phys_res_id, map->pseudo_phys_res); - free(map, M_PRIVCMD); - return (error); - } - map->mem = cdev_pager_allocate(map, OBJT_MGTDEVICE, &privcmd_pg_ops, size, nprot, *offset, NULL); if (map->mem == NULL) { - bus_release_resource(privcmd_dev, SYS_RES_MEMORY, - map->pseudo_phys_res_id, map->pseudo_phys_res); + xenmem_free(privcmd_dev, map->pseudo_phys_res_id, + map->pseudo_phys_res); free(map, M_PRIVCMD); return (ENOMEM); } Modified: head/sys/x86/xen/xenpv.c ============================================================================== --- head/sys/x86/xen/xenpv.c Fri May 8 14:13:19 2015 (r282633) +++ head/sys/x86/xen/xenpv.c Fri May 8 14:48:40 2015 (r282634) @@ -33,11 +33,33 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include +#include +#include + #include #include +#include "xenmem_if.h" + +/* + * Allocate unused physical memory above 4GB in order to map memory + * from foreign domains. We use memory starting at 4GB in order to + * prevent clashes with MMIO/ACPI regions. + * + * Since this is not possible on i386 just use any available memory + * chunk and hope we don't clash with anything else. + */ +#ifdef __amd64__ +#define LOW_MEM_LIMIT 0x100000000ul +#else +#define LOW_MEM_LIMIT 0 +#endif + static devclass_t xenpv_devclass; static void @@ -85,6 +107,42 @@ xenpv_attach(device_t dev) return (0); } +static struct resource * +xenpv_alloc_physmem(device_t dev, device_t child, int *res_id, size_t size) +{ + struct resource *res; + vm_paddr_t phys_addr; + int error; + + res = bus_alloc_resource(child, SYS_RES_MEMORY, res_id, LOW_MEM_LIMIT, + ~0ul, size, RF_ACTIVE); + if (res == NULL) + return (NULL); + + phys_addr = rman_get_start(res); + error = vm_phys_fictitious_reg_range(phys_addr, phys_addr + size, + VM_MEMATTR_DEFAULT); + if (error) { + bus_release_resource(child, SYS_RES_MEMORY, *res_id, res); + return (NULL); + } + + return (res); +} + +static int +xenpv_free_physmem(device_t dev, device_t child, int res_id, struct resource *res) +{ + vm_paddr_t phys_addr; + size_t size; + + phys_addr = rman_get_start(res); + size = rman_get_size(res); + + vm_phys_fictitious_unreg_range(phys_addr, phys_addr + size); + return (bus_release_resource(child, SYS_RES_MEMORY, res_id, res)); +} + static device_method_t xenpv_methods[] = { /* Device interface */ DEVMETHOD(device_identify, xenpv_identify), @@ -100,6 +158,10 @@ static device_method_t xenpv_methods[] = DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + /* Interface to allocate memory for foreign mappings */ + DEVMETHOD(xenmem_alloc, xenpv_alloc_physmem), + DEVMETHOD(xenmem_free, xenpv_free_physmem), + DEVMETHOD_END }; @@ -110,3 +172,25 @@ static driver_t xenpv_driver = { }; DRIVER_MODULE(xenpv, nexus, xenpv_driver, xenpv_devclass, 0, 0); + +struct resource * +xenmem_alloc(device_t dev, int *res_id, size_t size) +{ + device_t parent; + + parent = device_get_parent(dev); + if (parent == NULL) + return (NULL); + return (XENMEM_ALLOC(parent, dev, res_id, size)); +} + +int +xenmem_free(device_t dev, int res_id, struct resource *res) +{ + device_t parent; + + parent = device_get_parent(dev); + if (parent == NULL) + return (ENXIO); + return (XENMEM_FREE(parent, dev, res_id, res)); +} Modified: head/sys/xen/xen-os.h ============================================================================== --- head/sys/xen/xen-os.h Fri May 8 14:13:19 2015 (r282633) +++ head/sys/xen/xen-os.h Fri May 8 14:48:40 2015 (r282634) @@ -89,6 +89,13 @@ xen_initial_domain(void) (HYPERVISOR_start_info->flags & SIF_INITDOMAIN) != 0); } +/* + * Functions to allocate/free unused memory in order + * to map memory from other domains. + */ +struct resource *xenmem_alloc(device_t dev, int *res_id, size_t size); +int xenmem_free(device_t dev, int res_id, struct resource *res); + /* Debug/emergency function, prints directly to hypervisor console */ void xc_printf(const char *, ...) __printflike(1, 2); Added: head/sys/xen/xenmem/xenmem_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/xen/xenmem/xenmem_if.m Fri May 8 14:48:40 2015 (r282634) @@ -0,0 +1,95 @@ +#- +# Copyright (c) 2015 Roger Pau Monné +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#include + +INTERFACE xenmem; + +# +# Default implementations of some methods. +# +CODE { + static struct resource * + xenmem_generic_alloc(device_t dev, device_t child, int *res_id, + size_t size) + { + device_t parent; + + parent = device_get_parent(dev); + if (parent == NULL) + return (NULL); + return (XENMEM_ALLOC(parent, child, res_id, size)); + } + + static int + xenmem_generic_free(device_t dev, device_t child, int res_id, + struct resource *res) + { + device_t parent; + + parent = device_get_parent(dev); + if (parent == NULL) + return (ENXIO); + return (XENMEM_FREE(parent, child, res_id, res)); + } +}; + +/** + * @brief Request for unused physical memory regions. + * + * @param _dev the device whose child was being probed. + * @param _child the child device which failed to probe. + * @param _res_id a pointer to the resource identifier. + * @param _size size of the required memory region. + * + * @returns the resource which was allocated or @c NULL if no + * resource could be allocated. + */ +METHOD struct resource * alloc { + device_t _dev; + device_t _child; + int *_res_id; + size_t _size; +} DEFAULT xenmem_generic_alloc; + +/** + * @brief Free physical memory regions. + * + * @param _dev the device whose child was being probed. + * @param _child the child device which failed to probe. + * @param _res_id the resource identifier. + * @param _res the resource. + * + * @returns 0 on success, otherwise an error code. + */ +METHOD int free { + device_t _dev; + device_t _child; + int _res_id; + struct resource *_res; +} DEFAULT xenmem_generic_free; From owner-svn-src-head@FreeBSD.ORG Fri May 8 15:57:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EA3E211; Fri, 8 May 2015 15:57:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB211AF1; Fri, 8 May 2015 15:57:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t48FvQ52043265; Fri, 8 May 2015 15:57:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48FvOE8043257; Fri, 8 May 2015 15:57:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505081557.t48FvOE8043257@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 8 May 2015 15:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282641 - in head/sys: conf dev/hwpmc sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 15:57:26 -0000 Author: jhb Date: Fri May 8 15:57:23 2015 New Revision: 282641 URL: https://svnweb.freebsd.org/changeset/base/282641 Log: Move hwpmc(4) debugging code under a new HWPMC_DEBUG option instead of the broader DEBUG option. Reviewed by: emaste MFC after: 2 weeks Sponsored by: Norse Corp, Inc. Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/hwpmc/hwpmc_amd.c head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/sys/pmc.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 8 15:23:21 2015 (r282640) +++ head/sys/conf/NOTES Fri May 8 15:57:23 2015 (r282641) @@ -576,6 +576,7 @@ options STACK # please see hwpmc(4). device hwpmc # Driver (also a loadable module) +options HWPMC_DEBUG options HWPMC_HOOKS # Other necessary kernel hooks Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri May 8 15:23:21 2015 (r282640) +++ head/sys/conf/options Fri May 8 15:57:23 2015 (r282641) @@ -861,6 +861,7 @@ DCONS_FORCE_CONSOLE opt_dcons.h DCONS_FORCE_GDB opt_dcons.h # HWPMC options +HWPMC_DEBUG opt_global.h HWPMC_HOOKS HWPMC_MIPS_BACKTRACE opt_hwpmc_hooks.h Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Fri May 8 15:23:21 2015 (r282640) +++ head/sys/dev/hwpmc/hwpmc_amd.c Fri May 8 15:57:23 2015 (r282641) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef DEBUG +#ifdef HWPMC_DEBUG enum pmc_class amd_pmc_class; #endif @@ -284,7 +284,7 @@ amd_read_pmc(int cpu, int ri, pmc_value_ PMCDBG(MDP,REA,1,"amd-read id=%d class=%d", ri, pd->pm_descr.pd_class); -#ifdef DEBUG +#ifdef HWPMC_DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, ("[amd,%d] unknown PMC class (%d)", __LINE__, pd->pm_descr.pd_class)); @@ -329,7 +329,7 @@ amd_write_pmc(int cpu, int ri, pmc_value mode = PMC_TO_MODE(pm); -#ifdef DEBUG +#ifdef HWPMC_DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, ("[amd,%d] unknown PMC class (%d)", __LINE__, pd->pm_descr.pd_class)); @@ -515,7 +515,7 @@ amd_allocate_pmc(int cpu, int ri, struct static int amd_release_pmc(int cpu, int ri, struct pmc *pmc) { -#ifdef DEBUG +#ifdef HWPMC_DEBUG const struct amd_descr *pd; #endif struct pmc_hw *phw; @@ -532,7 +532,7 @@ amd_release_pmc(int cpu, int ri, struct KASSERT(phw->phw_pmc == NULL, ("[amd,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); -#ifdef DEBUG +#ifdef HWPMC_DEBUG pd = &amd_pmcdesc[ri]; if (pd->pm_descr.pd_class == amd_pmc_class) KASSERT(AMD_PMC_IS_STOPPED(pd->pm_evsel), @@ -835,7 +835,7 @@ amd_pcpu_fini(struct pmc_mdep *md, int c amd_pcpu[cpu] = NULL; -#ifdef DEBUG +#ifdef HWPMC_DEBUG for (i = 0; i < AMD_NPMCS; i++) { KASSERT(pac->pc_amdpmcs[i].phw_pmc == NULL, ("[amd,%d] CPU%d/PMC%d in use", __LINE__, cpu, i)); @@ -912,7 +912,7 @@ pmc_amd_initialize(void) return NULL; } -#ifdef DEBUG +#ifdef HWPMC_DEBUG amd_pmc_class = class; #endif Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Fri May 8 15:23:21 2015 (r282640) +++ head/sys/dev/hwpmc/hwpmc_logging.c Fri May 8 15:57:23 2015 (r282641) @@ -213,7 +213,7 @@ pmclog_get_buffer(struct pmc_owner *po) PMCDBG(LOG,GTB,1, "po=%p plb=%p", po, plb); -#ifdef DEBUG +#ifdef HWPMC_DEBUG if (plb) KASSERT(plb->plb_ptr == plb->plb_base && plb->plb_base < plb->plb_fence, Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Fri May 8 15:23:21 2015 (r282640) +++ head/sys/dev/hwpmc/hwpmc_mod.c Fri May 8 15:57:23 2015 (r282641) @@ -173,7 +173,7 @@ static struct pmc_classdep **pmc_rowinde * Prototypes */ -#ifdef DEBUG +#ifdef HWPMC_DEBUG static int pmc_debugflags_sysctl_handler(SYSCTL_HANDLER_ARGS); static int pmc_debugflags_parse(char *newstr, char *fence); #endif @@ -238,7 +238,7 @@ static int pmc_callchaindepth = PMC_CALL SYSCTL_INT(_kern_hwpmc, OID_AUTO, callchaindepth, CTLFLAG_RDTUN, &pmc_callchaindepth, 0, "depth of call chain records"); -#ifdef DEBUG +#ifdef HWPMC_DEBUG struct pmc_debugflags pmc_debugflags = PMC_DEBUG_DEFAULT_FLAGS; char pmc_debugstr[PMC_DEBUG_STRSIZE]; TUNABLE_STR(PMC_SYSCTL_NAME_PREFIX "debugflags", pmc_debugstr, @@ -337,7 +337,7 @@ static moduledata_t pmc_mod = { DECLARE_MODULE(pmc, pmc_mod, SI_SUB_SMP, SI_ORDER_ANY); MODULE_VERSION(pmc, PMC_VERSION); -#ifdef DEBUG +#ifdef HWPMC_DEBUG enum pmc_dbgparse_state { PMCDS_WS, /* in whitespace */ PMCDS_MAJOR, /* seen a major keyword */ @@ -816,7 +816,7 @@ pmc_link_target_process(struct pmc *pm, PMCDBG(PRC,TLK,1, "link-target pmc=%p ri=%d pmc-process=%p", pm, ri, pp); -#ifdef DEBUG +#ifdef HWPMC_DEBUG LIST_FOREACH(pt, &pm->pm_targets, pt_next) if (pt->pt_process == pp) KASSERT(0, ("[pmc,%d] pp %p already in pmc %p targets", @@ -1784,7 +1784,7 @@ pmc_log_all_process_mappings(struct pmc_ */ -#ifdef DEBUG +#ifdef HWPMC_DEBUG const char *pmc_hooknames[] = { /* these strings correspond to PMC_FN_* in */ "", @@ -2002,7 +2002,7 @@ pmc_hook_handler(struct thread *td, int break; default: -#ifdef DEBUG +#ifdef HWPMC_DEBUG KASSERT(0, ("[pmc,%d] unknown hook %d\n", __LINE__, function)); #endif break; @@ -2185,7 +2185,7 @@ pmc_destroy_pmc_descriptor(struct pmc *p static void pmc_wait_for_pmc_idle(struct pmc *pm) { -#ifdef DEBUG +#ifdef HWPMC_DEBUG volatile int maxloop; maxloop = 100 * pmc_cpu_max(); @@ -2195,7 +2195,7 @@ pmc_wait_for_pmc_idle(struct pmc *pm) * comes down to zero. */ while (atomic_load_acq_32(&pm->pm_runcount) > 0) { -#ifdef DEBUG +#ifdef HWPMC_DEBUG maxloop--; KASSERT(maxloop > 0, ("[pmc,%d] (ri%d, rc%d) waiting too long for " @@ -2759,7 +2759,7 @@ pmc_stop(struct pmc *pm) } -#ifdef DEBUG +#ifdef HWPMC_DEBUG static const char *pmc_op_to_name[] = { #undef __PMC_OP #define __PMC_OP(N, D) #N , @@ -3798,7 +3798,7 @@ pmc_syscall_handler(struct thread *td, v pprw = (struct pmc_op_pmcrw *) arg; -#ifdef DEBUG +#ifdef HWPMC_DEBUG if (prw.pm_flags & PMC_F_NEWVALUE) PMCDBG(PMC,OPS,2, "rw id=%d new %jx -> old %jx", ri, prw.pm_value, oldvalue); @@ -4712,7 +4712,7 @@ pmc_initialize(void) md = NULL; error = 0; -#ifdef DEBUG +#ifdef HWPMC_DEBUG /* parse debug flags first */ if (TUNABLE_STR_FETCH(PMC_SYSCTL_NAME_PREFIX "debugflags", pmc_debugstr, sizeof(pmc_debugstr))) @@ -4933,7 +4933,7 @@ pmc_cleanup(void) struct pmc_ownerhash *ph; struct pmc_owner *po, *tmp; struct pmc_binding pb; -#ifdef DEBUG +#ifdef HWPMC_DEBUG struct pmc_processhash *prh; #endif @@ -4985,7 +4985,7 @@ pmc_cleanup(void) mtx_destroy(&pmc_processhash_mtx); if (pmc_processhash) { -#ifdef DEBUG +#ifdef HWPMC_DEBUG struct pmc_process *pp; PMCDBG(MOD,INI,3, "%s", "destroy process hash"); Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Fri May 8 15:23:21 2015 (r282640) +++ head/sys/sys/pmc.h Fri May 8 15:57:23 2015 (r282641) @@ -998,7 +998,7 @@ extern struct pmc_cpu **pmc_pcpu; /* driver statistics */ extern struct pmc_op_getdriverstats pmc_stats; -#if defined(DEBUG) +#if defined(HWPMC_DEBUG) /* debug flags, major flag groups */ struct pmc_debugflags { From owner-svn-src-head@FreeBSD.ORG Fri May 8 16:02:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD32A7C4; Fri, 8 May 2015 16:02: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 9E6D41C14; Fri, 8 May 2015 16:02: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 t48G2W0v047882; Fri, 8 May 2015 16:02:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48G2WUW047879; Fri, 8 May 2015 16:02:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505081602.t48G2WUW047879@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 8 May 2015 16:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282643 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 16:02:32 -0000 Author: jhb Date: Fri May 8 16:02:31 2015 New Revision: 282643 URL: https://svnweb.freebsd.org/changeset/base/282643 Log: Use the kern.bootfile sysctl to set the default kernel path rather than hardcoding /boot/kernel. This allows pmcstat(8) to work without -k when using nextboot -k or 'boot foo' at the loader to boot alternate kernels. Differential Revision: https://reviews.freebsd.org/D2425 Reviewed by: adrian, emaste, gnn MFC after: 2 weeks Sponsored by: Norse Corp, Inc. Modified: head/usr.sbin/pmcstat/pmcstat.8 head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Fri May 8 16:00:06 2015 (r282642) +++ head/usr.sbin/pmcstat/pmcstat.8 Fri May 8 16:02:31 2015 (r282643) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2015 +.Dd May 8, 2015 .Dt PMCSTAT 8 .Os .Sh NAME @@ -279,8 +279,9 @@ Set the pathname of the kernel directory This directory specifies where .Nm should look for the kernel and its modules. -The default is -.Pa /boot/kernel . +The default is to use the path of the running kernel obtained from the +.Va kern.bootfile +sysctl. .It Fl l Ar secs Set system-wide performance measurement duration for .Ar secs Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Fri May 8 16:00:06 2015 (r282642) +++ head/usr.sbin/pmcstat/pmcstat.c Fri May 8 16:02:31 2015 (r282643) @@ -557,7 +557,7 @@ main(int argc, char **argv) int c, check_driver_stats, current_sampling_count; int do_callchain, do_descendants, do_logproccsw, do_logprocexit; int do_print, do_read; - size_t dummy; + size_t len; int graphdepth; int pipefd[2], rfd; int use_cumulative_counts; @@ -586,7 +586,6 @@ main(int argc, char **argv) args.pa_verbosity = 1; args.pa_logfd = -1; args.pa_fsroot = ""; - args.pa_kernel = strdup("/boot/kernel"); args.pa_samplesdir = "."; args.pa_printfile = stderr; args.pa_graphdepth = DEFAULT_CALLGRAPH_DEPTH; @@ -610,12 +609,20 @@ main(int argc, char **argv) ev = NULL; CPU_ZERO(&cpumask); + /* Default to using the running system kernel. */ + len = 0; + if (sysctlbyname("kern.bootfile", NULL, &len, NULL, 0) == -1) + err(EX_OSERR, "ERROR: Cannot determine path of running kernel"); + args.pa_kernel = malloc(len + 1); + if (sysctlbyname("kern.bootfile", args.pa_kernel, &len, NULL, 0) == -1) + err(EX_OSERR, "ERROR: Cannot determine path of running kernel"); + /* * The initial CPU mask specifies all non-halted CPUS in the * system. */ - dummy = sizeof(int); - if (sysctlbyname("hw.ncpu", &ncpu, &dummy, NULL, 0) < 0) + len = sizeof(int); + if (sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0) < 0) err(EX_OSERR, "ERROR: Cannot determine the number of CPUs"); for (hcpu = 0; hcpu < ncpu; hcpu++) CPU_SET(hcpu, &cpumask); @@ -1061,33 +1068,31 @@ main(int argc, char **argv) ); /* - * Check if "-k kerneldir" was specified, and if whether - * 'kerneldir' actually refers to a file. If so, use - * `dirname path` to determine the kernel directory. - */ - if (args.pa_flags & FLAG_HAS_KERNELPATH) { - (void) snprintf(buffer, sizeof(buffer), "%s%s", args.pa_fsroot, - args.pa_kernel); + * Check if 'kerneldir' refers to a file rather than a + * directory. If so, use `dirname path` to determine the + * kernel directory. + */ + (void) snprintf(buffer, sizeof(buffer), "%s%s", args.pa_fsroot, + args.pa_kernel); + if (stat(buffer, &sb) < 0) + err(EX_OSERR, "ERROR: Cannot locate kernel \"%s\"", + buffer); + if (!S_ISREG(sb.st_mode) && !S_ISDIR(sb.st_mode)) + errx(EX_USAGE, "ERROR: \"%s\": Unsupported file type.", + buffer); + if (!S_ISDIR(sb.st_mode)) { + tmp = args.pa_kernel; + args.pa_kernel = strdup(dirname(args.pa_kernel)); + free(tmp); + (void) snprintf(buffer, sizeof(buffer), "%s%s", + args.pa_fsroot, args.pa_kernel); if (stat(buffer, &sb) < 0) - err(EX_OSERR, "ERROR: Cannot locate kernel \"%s\"", + err(EX_OSERR, "ERROR: Cannot stat \"%s\"", buffer); - if (!S_ISREG(sb.st_mode) && !S_ISDIR(sb.st_mode)) - errx(EX_USAGE, "ERROR: \"%s\": Unsupported file type.", + if (!S_ISDIR(sb.st_mode)) + errx(EX_USAGE, + "ERROR: \"%s\" is not a directory.", buffer); - if (!S_ISDIR(sb.st_mode)) { - tmp = args.pa_kernel; - args.pa_kernel = strdup(dirname(args.pa_kernel)); - free(tmp); - (void) snprintf(buffer, sizeof(buffer), "%s%s", - args.pa_fsroot, args.pa_kernel); - if (stat(buffer, &sb) < 0) - err(EX_OSERR, "ERROR: Cannot stat \"%s\"", - buffer); - if (!S_ISDIR(sb.st_mode)) - errx(EX_USAGE, - "ERROR: \"%s\" is not a directory.", - buffer); - } } /* From owner-svn-src-head@FreeBSD.ORG Fri May 8 16:19:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40A89F14; Fri, 8 May 2015 16:19: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 2E4C91DAD; Fri, 8 May 2015 16:19: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 t48GJ2YY054062; Fri, 8 May 2015 16:19:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48GJ239054061; Fri, 8 May 2015 16:19:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505081619.t48GJ239054061@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 8 May 2015 16:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282645 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 16:19:02 -0000 Author: hselasky Date: Fri May 8 16:19:01 2015 New Revision: 282645 URL: https://svnweb.freebsd.org/changeset/base/282645 Log: Prevent switching to NULL or own window in the "vt_proc_window_switch" function. This fixes an issue where X11 keyboard input can appear stuck. The cause of the problem is a duplicate TTY device window switch IOCTL during boot, which leaves the "vt_switch_timer" running, because the current window is already selected. While at it factor out some NULL checks. PR: 200032 Differential Revision: https://reviews.freebsd.org/D2480 Reported by: several people MFC after: 1 week Reviewed by: emaste Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri May 8 16:18:11 2015 (r282644) +++ head/sys/dev/vt/vt_core.c Fri May 8 16:19:01 2015 (r282645) @@ -451,12 +451,35 @@ vt_proc_window_switch(struct vt_window * struct vt_device *vd; int ret; + /* Prevent switching to NULL */ + if (vw == NULL) { + DPRINTF(30, "%s: Cannot switch: vw is NULL.", __func__); + return (EINVAL); + } vd = vw->vw_device; curvw = vd->vd_curwindow; + /* Check if virtual terminal is locked */ if (curvw->vw_flags & VWF_VTYLOCK) return (EBUSY); + /* Check if switch already in progress */ + if (curvw->vw_flags & VWF_SWWAIT_REL) { + /* Check if switching to same window */ + if (curvw->vw_switch_to == vw) { + DPRINTF(30, "%s: Switch in progress to same vw.", __func__); + return (0); /* success */ + } + DPRINTF(30, "%s: Switch in progress to different vw.", __func__); + return (EBUSY); + } + + /* Avoid switching to already selected window */ + if (vw == curvw) { + DPRINTF(30, "%s: Cannot switch: vw == curvw.", __func__); + return (0); /* success */ + } + /* Ask current process permission to switch away. */ if (curvw->vw_smode.mode == VT_PROCESS) { DPRINTF(30, "%s: VT_PROCESS ", __func__); @@ -664,8 +687,7 @@ vt_scrollmode_kbdevent(struct vt_window if (console == 0) { if (c >= F_SCR && c <= MIN(L_SCR, F_SCR + VT_MAXWINDOWS - 1)) { vw = vd->vd_windows[c - F_SCR]; - if (vw != NULL) - vt_proc_window_switch(vw); + vt_proc_window_switch(vw); return; } VT_LOCK(vd); @@ -750,8 +772,7 @@ vt_processkey(keyboard_t *kbd, struct vt if (c >= F_SCR && c <= MIN(L_SCR, F_SCR + VT_MAXWINDOWS - 1)) { vw = vd->vd_windows[c - F_SCR]; - if (vw != NULL) - vt_proc_window_switch(vw); + vt_proc_window_switch(vw); return (0); } @@ -760,15 +781,13 @@ vt_processkey(keyboard_t *kbd, struct vt /* Switch to next VT. */ c = (vw->vw_number + 1) % VT_MAXWINDOWS; vw = vd->vd_windows[c]; - if (vw != NULL) - vt_proc_window_switch(vw); + vt_proc_window_switch(vw); return (0); case PREV: /* Switch to previous VT. */ c = (vw->vw_number - 1) % VT_MAXWINDOWS; vw = vd->vd_windows[c]; - if (vw != NULL) - vt_proc_window_switch(vw); + vt_proc_window_switch(vw); return (0); case SLK: { vt_save_kbd_state(vw, kbd); @@ -2774,8 +2793,7 @@ vt_resume(struct vt_device *vd) if (vt_suspendswitch == 0) return; - /* Switch back to saved window */ - if (vd->vd_savedwindow != NULL) - vt_proc_window_switch(vd->vd_savedwindow); + /* Switch back to saved window, if any */ + vt_proc_window_switch(vd->vd_savedwindow); vd->vd_savedwindow = NULL; } From owner-svn-src-head@FreeBSD.ORG Fri May 8 16:37:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77C603EC; Fri, 8 May 2015 16:37: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 6549A1FAE; Fri, 8 May 2015 16:37: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 t48GbfI7065546; Fri, 8 May 2015 16:37:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48GbfMS065545; Fri, 8 May 2015 16:37:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505081637.t48GbfMS065545@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 8 May 2015 16:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282646 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 16:37:41 -0000 Author: hselasky Date: Fri May 8 16:37:40 2015 New Revision: 282646 URL: https://svnweb.freebsd.org/changeset/base/282646 Log: The "SYSCTL_INT()" default value is only used for read only SYSCTLs and is not applicable unless the integer pointer is NULL. Set it to zero to avoid confusion. While at it remove extra semicolon at the end of the "VT_SYSCTL_INT()" macro. MFC after: 1 week Modified: head/sys/dev/vt/vt.h Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Fri May 8 16:19:01 2015 (r282645) +++ head/sys/dev/vt/vt.h Fri May 8 16:37:40 2015 (r282646) @@ -83,9 +83,8 @@ #define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG) #define VT_SYSCTL_INT(_name, _default, _descr) \ -static int vt_##_name = _default; \ -SYSCTL_INT(_kern_vt, OID_AUTO, _name, CTLFLAG_RWTUN, &vt_##_name, _default,\ - _descr); +static int vt_##_name = (_default); \ +SYSCTL_INT(_kern_vt, OID_AUTO, _name, CTLFLAG_RWTUN, &vt_##_name, 0, _descr) struct vt_driver; From owner-svn-src-head@FreeBSD.ORG Fri May 8 16:43:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 845BA8B1; Fri, 8 May 2015 16:43: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 7218C10E2; Fri, 8 May 2015 16:43: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 t48Gh2LA070684; Fri, 8 May 2015 16:43:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48Gh2ET070683; Fri, 8 May 2015 16:43:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201505081643.t48Gh2ET070683@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 8 May 2015 16:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282649 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 16:43:02 -0000 Author: bdrewery Date: Fri May 8 16:43:01 2015 New Revision: 282649 URL: https://svnweb.freebsd.org/changeset/base/282649 Log: Fix spelling of INTERNALLIBS Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Fri May 8 16:41:21 2015 (r282648) +++ head/share/mk/src.libnames.mk Fri May 8 16:43:01 2015 (r282649) @@ -24,7 +24,7 @@ _PRIVATELIBS= \ ucl \ unbound -_INTERNALIBS= \ +_INTERNALLIBS= \ amu \ bsnmptools \ cron \ @@ -49,7 +49,7 @@ _INTERNALIBS= \ _LIBRARIES= \ ${_PRIVATELIBS} \ - ${_INTERNALIBS} \ + ${_INTERNALLIBS} \ alias \ archive \ asn1 \ @@ -243,7 +243,7 @@ LIB${_l:tu}?= ${DESTDIR}${LIBDIR}/libpri .endfor .for _l in ${_LIBRARIES} -.if ${_INTERNALIBS:M${_l}} +.if ${_INTERNALLIBS:M${_l}} LDADD_${_l}_L+= -L${LIB${_l:tu}DIR} .endif DPADD_${_l}?= ${LIB${_l:tu}} From owner-svn-src-head@FreeBSD.ORG Fri May 8 17:00:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F24E7E73; Fri, 8 May 2015 17:00:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEE6E122B; Fri, 8 May 2015 17:00:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t48H0ZVN077754; Fri, 8 May 2015 17:00:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48H0Y6q077749; Fri, 8 May 2015 17:00:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505081700.t48H0Y6q077749@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 8 May 2015 17:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282650 - in head/sys: dev/sound/pcm sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 17:00:36 -0000 Author: hselasky Date: Fri May 8 17:00:33 2015 New Revision: 282650 URL: https://svnweb.freebsd.org/changeset/base/282650 Log: Extend the maximum number of allowed PCM channels in a PCM stream to 127 and decrease the maximum number of sub-channels to 1. These definitions are only used inside the kernel and can be changed later if more than one sub-channel is desired. This has been done to allow so-called USB audio rack modules to work with FreeBSD. Bump the FreeBSD version to force recompiling all external modules. MFC after: 2 weeks Reviewed by: mav Modified: head/sys/dev/sound/pcm/channel.c head/sys/dev/sound/pcm/channel.h head/sys/dev/sound/pcm/feeder_chain.c head/sys/dev/sound/pcm/sound.h head/sys/sys/param.h Modified: head/sys/dev/sound/pcm/channel.c ============================================================================== --- head/sys/dev/sound/pcm/channel.c Fri May 8 16:43:01 2015 (r282649) +++ head/sys/dev/sound/pcm/channel.c Fri May 8 17:00:33 2015 (r282650) @@ -1020,32 +1020,17 @@ static const struct { { NULL, NULL, NULL, 0 } }; -static const struct { - char *name, *alias1, *alias2; - int matrix_id; -} matrix_id_tab[] = { - { "1.0", "1", "mono", SND_CHN_MATRIX_1_0 }, - { "2.0", "2", "stereo", SND_CHN_MATRIX_2_0 }, - { "2.1", NULL, NULL, SND_CHN_MATRIX_2_1 }, - { "3.0", "3", NULL, SND_CHN_MATRIX_3_0 }, - { "3.1", NULL, NULL, SND_CHN_MATRIX_3_1 }, - { "4.0", "4", "quad", SND_CHN_MATRIX_4_0 }, - { "4.1", NULL, NULL, SND_CHN_MATRIX_4_1 }, - { "5.0", "5", NULL, SND_CHN_MATRIX_5_0 }, - { "5.1", "6", NULL, SND_CHN_MATRIX_5_1 }, - { "6.0", NULL, NULL, SND_CHN_MATRIX_6_0 }, - { "6.1", "7", NULL, SND_CHN_MATRIX_6_1 }, - { "7.0", NULL, NULL, SND_CHN_MATRIX_7_0 }, - { "7.1", "8", NULL, SND_CHN_MATRIX_7_1 }, - { NULL, NULL, NULL, SND_CHN_MATRIX_UNKNOWN } -}; - uint32_t snd_str2afmt(const char *req) { - uint32_t i, afmt; - int matrix_id; - char b1[8], b2[8]; + int ext; + int ch; + int i; + char b1[8]; + char b2[8]; + + memset(b1, 0, sizeof(b1)); + memset(b2, 0, sizeof(b2)); i = sscanf(req, "%5[^:]:%6s", b1, b2); @@ -1059,88 +1044,78 @@ snd_str2afmt(const char *req) } else return (0); - afmt = 0; - matrix_id = SND_CHN_MATRIX_UNKNOWN; - - for (i = 0; afmt == 0 && afmt_tab[i].name != NULL; i++) { - if (strcasecmp(afmt_tab[i].name, b1) == 0 || - (afmt_tab[i].alias1 != NULL && - strcasecmp(afmt_tab[i].alias1, b1) == 0) || - (afmt_tab[i].alias2 != NULL && - strcasecmp(afmt_tab[i].alias2, b1) == 0)) { - afmt = afmt_tab[i].afmt; - strlcpy(b1, afmt_tab[i].name, sizeof(b1)); - } - } + i = sscanf(b2, "%d.%d", &ch, &ext); - if (afmt == 0) + if (i == 0) { + if (strcasecmp(b2, "mono") == 0) { + ch = 1; + ext = 0; + } else if (strcasecmp(b2, "stereo") == 0) { + ch = 2; + ext = 0; + } else if (strcasecmp(b2, "quad") == 0) { + ch = 4; + ext = 0; + } else + return (0); + } else if (i == 1) { + if (ch < 1 || ch > AFMT_CHANNEL_MAX) + return (0); + ext = 0; + } else if (i == 2) { + if (ext < 0 || ext > AFMT_EXTCHANNEL_MAX) + return (0); + if (ch < 1 || (ch + ext) > AFMT_CHANNEL_MAX) + return (0); + } else return (0); - for (i = 0; matrix_id == SND_CHN_MATRIX_UNKNOWN && - matrix_id_tab[i].name != NULL; i++) { - if (strcmp(matrix_id_tab[i].name, b2) == 0 || - (matrix_id_tab[i].alias1 != NULL && - strcmp(matrix_id_tab[i].alias1, b2) == 0) || - (matrix_id_tab[i].alias2 != NULL && - strcasecmp(matrix_id_tab[i].alias2, b2) == 0)) { - matrix_id = matrix_id_tab[i].matrix_id; - strlcpy(b2, matrix_id_tab[i].name, sizeof(b2)); + for (i = 0; afmt_tab[i].name != NULL; i++) { + if (strcasecmp(afmt_tab[i].name, b1) != 0) { + if (afmt_tab[i].alias1 == NULL) + continue; + if (strcasecmp(afmt_tab[i].alias1, b1) != 0) { + if (afmt_tab[i].alias2 == NULL) + continue; + if (strcasecmp(afmt_tab[i].alias2, b1) != 0) + continue; + } } + /* found a match */ + return (SND_FORMAT(afmt_tab[i].afmt, ch + ext, ext)); } - - if (matrix_id == SND_CHN_MATRIX_UNKNOWN) - return (0); - -#ifndef _KERNEL - printf("Parse OK: '%s' -> '%s:%s' %d\n", req, b1, b2, - (int)(b2[0]) - '0' + (int)(b2[2]) - '0'); -#endif - - return (SND_FORMAT(afmt, b2[0] - '0' + b2[2] - '0', b2[2] - '0')); + /* not a valid format */ + return (0); } uint32_t snd_afmt2str(uint32_t afmt, char *buf, size_t len) { - uint32_t i, enc, ch, ext; - char tmp[AFMTSTR_LEN]; + uint32_t enc; + uint32_t ext; + uint32_t ch; + int i; if (buf == NULL || len < AFMTSTR_LEN) return (0); - - bzero(tmp, sizeof(tmp)); + memset(buf, 0, len); enc = AFMT_ENCODING(afmt); ch = AFMT_CHANNEL(afmt); ext = AFMT_EXTCHANNEL(afmt); - - for (i = 0; afmt_tab[i].name != NULL; i++) { - if (enc == afmt_tab[i].afmt) { - strlcpy(tmp, afmt_tab[i].name, sizeof(tmp)); - strlcat(tmp, ":", sizeof(tmp)); - break; - } - } - - if (strlen(tmp) == 0) + /* check there is at least one channel */ + if (ch <= ext) return (0); - - for (i = 0; matrix_id_tab[i].name != NULL; i++) { - if (ch == (matrix_id_tab[i].name[0] - '0' + - matrix_id_tab[i].name[2] - '0') && - ext == (matrix_id_tab[i].name[2] - '0')) { - strlcat(tmp, matrix_id_tab[i].name, sizeof(tmp)); - break; - } + for (i = 0; afmt_tab[i].name != NULL; i++) { + if (enc != afmt_tab[i].afmt) + continue; + /* found a match */ + snprintf(buf, len, "%s:%d.%d", + afmt_tab[i].name, ch - ext, ext); + return (SND_FORMAT(enc, ch, ext)); } - - if (strlen(tmp) == 0) - return (0); - - strlcpy(buf, tmp, len); - - return (snd_str2afmt(buf)); + return (0); } int Modified: head/sys/dev/sound/pcm/channel.h ============================================================================== --- head/sys/dev/sound/pcm/channel.h Fri May 8 16:43:01 2015 (r282649) +++ head/sys/dev/sound/pcm/channel.h Fri May 8 17:00:33 2015 (r282650) @@ -162,6 +162,7 @@ struct pcm_channel { } channels; struct pcmchan_matrix matrix; + struct pcmchan_matrix matrix_scratch; int volume[SND_VOL_C_MAX][SND_CHN_T_VOL_MAX]; Modified: head/sys/dev/sound/pcm/feeder_chain.c ============================================================================== --- head/sys/dev/sound/pcm/feeder_chain.c Fri May 8 16:43:01 2015 (r282649) +++ head/sys/dev/sound/pcm/feeder_chain.c Fri May 8 17:00:33 2015 (r282650) @@ -561,6 +561,20 @@ feeder_build_mixer(struct pcm_channel *c ((c)->mode == FEEDER_CHAIN_LEAN && \ !((c)->current.afmt & (AFMT_S16_NE | AFMT_S32_NE))))) +static void +feeder_default_matrix(struct pcmchan_matrix *m, uint32_t fmt, int id) +{ + int x; + + memset(m, 0, sizeof(*m)); + + m->id = id; + m->channels = AFMT_CHANNEL(fmt); + m->ext = AFMT_EXTCHANNEL(fmt); + for (x = 0; x != SND_CHN_T_MAX; x++) + m->offset[x] = -1; +} + int feeder_chain(struct pcm_channel *c) { @@ -641,10 +655,10 @@ feeder_chain(struct pcm_channel *c) */ hwmatrix = CHANNEL_GETMATRIX(c->methods, c->devinfo, hwfmt); if (hwmatrix == NULL) { - device_printf(c->dev, - "%s(): failed to acquire hw matrix [0x%08x]\n", - __func__, hwfmt); - return (ENODEV); + /* setup a default matrix */ + hwmatrix = &c->matrix_scratch; + feeder_default_matrix(hwmatrix, hwfmt, + SND_CHN_MATRIX_UNKNOWN); } /* ..... and rebuild hwfmt. */ hwfmt = SND_FORMAT(hwfmt, hwmatrix->channels, hwmatrix->ext); @@ -656,13 +670,14 @@ feeder_chain(struct pcm_channel *c) softmatrix->ext != AFMT_EXTCHANNEL(softfmt)) { softmatrix = feeder_matrix_format_map(softfmt); if (softmatrix == NULL) { - device_printf(c->dev, - "%s(): failed to acquire soft matrix [0x%08x]\n", - __func__, softfmt); - return (ENODEV); + /* setup a default matrix */ + softmatrix = &c->matrix; + feeder_default_matrix(softmatrix, softfmt, + SND_CHN_MATRIX_PCMCHANNEL); + } else { + c->matrix = *softmatrix; + c->matrix.id = SND_CHN_MATRIX_PCMCHANNEL; } - c->matrix = *softmatrix; - c->matrix.id = SND_CHN_MATRIX_PCMCHANNEL; } softfmt = SND_FORMAT(softfmt, softmatrix->channels, softmatrix->ext); if (softfmt != c->format) Modified: head/sys/dev/sound/pcm/sound.h ============================================================================== --- head/sys/dev/sound/pcm/sound.h Fri May 8 16:43:01 2015 (r282649) +++ head/sys/dev/sound/pcm/sound.h Fri May 8 17:00:33 2015 (r282650) @@ -213,10 +213,12 @@ struct snd_mixer; * ~(0xb00ff7ff) */ #define AFMT_ENCODING_MASK 0xf00fffff -#define AFMT_CHANNEL_MASK 0x01f00000 +#define AFMT_CHANNEL_MASK 0x07f00000 #define AFMT_CHANNEL_SHIFT 20 -#define AFMT_EXTCHANNEL_MASK 0x0e000000 -#define AFMT_EXTCHANNEL_SHIFT 25 +#define AFMT_CHANNEL_MAX 0x7f +#define AFMT_EXTCHANNEL_MASK 0x08000000 +#define AFMT_EXTCHANNEL_SHIFT 27 +#define AFMT_EXTCHANNEL_MAX 1 #define AFMT_ENCODING(v) ((v) & AFMT_ENCODING_MASK) Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri May 8 16:43:01 2015 (r282649) +++ head/sys/sys/param.h Fri May 8 17:00:33 2015 (r282650) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100072 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100073 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Fri May 8 17:07:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2198D409; Fri, 8 May 2015 17:07: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 0EF691323; Fri, 8 May 2015 17:07: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 t48H7BqZ081827; Fri, 8 May 2015 17:07:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48H7BSI081826; Fri, 8 May 2015 17:07:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505081707.t48H7BSI081826@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 8 May 2015 17:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282651 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 17:07:12 -0000 Author: hselasky Date: Fri May 8 17:07:11 2015 New Revision: 282651 URL: https://svnweb.freebsd.org/changeset/base/282651 Log: Add support for more than 8 audio channels per PCM stream for USB audio class compliant devices under FreeBSD. Tested using 16 recording and 16 playback audio channels simultaneously. MFC after: 2 weeks Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Fri May 8 17:00:33 2015 (r282650) +++ head/sys/dev/sound/usb/uaudio.c Fri May 8 17:07:11 2015 (r282651) @@ -115,6 +115,8 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ #define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ #define UAUDIO_RECURSE_LIMIT 255 /* rounds */ +#define UAUDIO_CHANNELS_MAX MIN(64, AFMT_CHANNEL_MAX) +#define UAUDIO_MATRIX_MAX 8 /* channels */ #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) @@ -346,6 +348,7 @@ struct uaudio_softc { uint8_t sc_uq_au_no_xu:1; uint8_t sc_uq_bad_adc:1; uint8_t sc_uq_au_vendor_class:1; + uint8_t sc_pcm_bitperfect:1; }; struct uaudio_terminal_node { @@ -1062,6 +1065,10 @@ uaudio_attach_sub(device_t dev, kobj_cla */ uaudio_pcm_setflags(dev, SD_F_SOFTPCMVOL); } + if (sc->sc_pcm_bitperfect) { + DPRINTF("device needs bitperfect by default\n"); + uaudio_pcm_setflags(dev, SD_F_BITPERFECT); + } if (mixer_init(dev, mixer_class, sc)) goto detach; sc->sc_mixer_init = 1; @@ -1826,19 +1833,21 @@ uaudio_chan_fill_info_sub(struct uaudio_ format = chan_alt->p_fmt->freebsd_fmt; + /* get default SND_FORMAT() */ + format = SND_FORMAT(format, chan_alt->channels, 0); + switch (chan_alt->channels) { - case 2: - /* stereo */ - format = SND_FORMAT(format, 2, 0); - break; + uint32_t temp_fmt; case 1: - /* mono */ - format = SND_FORMAT(format, 1, 0); + case 2: + /* mono and stereo */ break; default: /* surround and more */ - format = feeder_matrix_default_format( - SND_FORMAT(format, chan_alt->channels, 0)); + temp_fmt = feeder_matrix_default_format(format); + /* if multichannel, then format can be zero */ + if (temp_fmt != 0) + format = temp_fmt; break; } @@ -1865,6 +1874,10 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan->pcm_cap.fmtlist = chan->pcm_format; chan->pcm_cap.fmtlist[0] = format; + /* check if device needs bitperfect */ + if (chan_alt->channels > UAUDIO_MATRIX_MAX) + sc->sc_pcm_bitperfect = 1; + if (rate < chan->pcm_cap.minspeed || chan->pcm_cap.minspeed == 0) chan->pcm_cap.minspeed = rate; if (rate > chan->pcm_cap.maxspeed || chan->pcm_cap.maxspeed == 0) @@ -1939,15 +1952,15 @@ uaudio_chan_fill_info(struct uaudio_soft channels = 4; break; default: - channels = 16; + channels = UAUDIO_CHANNELS_MAX; break; } - } else if (channels > 16) { - channels = 16; - } - if (sbuf_new(&sc->sc_sndstat, NULL, 4096, SBUF_AUTOEXTEND)) { + } else if (channels > UAUDIO_CHANNELS_MAX) + channels = UAUDIO_CHANNELS_MAX; + + if (sbuf_new(&sc->sc_sndstat, NULL, 4096, SBUF_AUTOEXTEND)) sc->sc_sndstat_valid = 1; - } + /* try to search for a valid config */ for (x = channels; x; x--) { From owner-svn-src-head@FreeBSD.ORG Fri May 8 17:48:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25659760; Fri, 8 May 2015 17:48: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 133AB1A16; Fri, 8 May 2015 17:48: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 t48Hmm76002836; Fri, 8 May 2015 17:48:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48HmmHJ002835; Fri, 8 May 2015 17:48:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505081748.t48HmmHJ002835@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 8 May 2015 17:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282652 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 17:48:49 -0000 Author: hselasky Date: Fri May 8 17:48:48 2015 New Revision: 282652 URL: https://svnweb.freebsd.org/changeset/base/282652 Log: Ensure the USB audio driver doesn't attach twice on the same USB device by grabbing all the USB audio device interfaces. MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Fri May 8 17:07:11 2015 (r282651) +++ head/sys/dev/sound/usb/uaudio.c Fri May 8 17:48:48 2015 (r282652) @@ -1575,6 +1575,19 @@ uaudio_chan_fill_info_sub(struct uaudio_ asf1d.v1 = NULL; ed1 = NULL; sed.v1 = NULL; + + /* + * There can only be one USB audio instance + * per USB device. Grab all USB audio + * interfaces on this USB device so that we + * don't attach USB audio twice: + */ + if (alt_index == 0 && curidx != sc->sc_mixer_iface_index && + (id->bInterfaceClass == UICLASS_AUDIO || audio_if != 0 || + midi_if != 0)) { + usbd_set_parent_iface(sc->sc_udev, curidx, + sc->sc_mixer_iface_index); + } } if (audio_if == 0) { @@ -1810,9 +1823,6 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; - usbd_set_parent_iface(sc->sc_udev, curidx, - sc->sc_mixer_iface_index); - if (ep_dir == UE_DIR_IN) chan_alt->usb_cfg = uaudio_cfg_record; else From owner-svn-src-head@FreeBSD.ORG Fri May 8 18:47:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1CA3E41; Fri, 8 May 2015 18:47:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF3141173; Fri, 8 May 2015 18:47:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t48IlJnE034183; Fri, 8 May 2015 18:47:19 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48IlJE8034181; Fri, 8 May 2015 18:47:19 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201505081847.t48IlJE8034181@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 8 May 2015 18:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282655 - in head/sys: arm64/arm64 arm64/include conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 18:47:20 -0000 Author: zbb Date: Fri May 8 18:47:19 2015 New Revision: 282655 URL: https://svnweb.freebsd.org/changeset/base/282655 Log: Port x86 busdma to ARM64 The x86 busdma subsystem allows using multiple implementations. By default the classic bounce buffer approach is used, however on systems with IOMMU it could be in runtime switched to more efficient hardware accelerated implementation. This commit adds ARM64 port of the x86 busdma framework and bounce buffer backend. It is ready to use on IO coherent systems. If the IO coherency cannot be guaranteed, the cache management operations have to be added to this code in places marked by /* XXX ARM64TODO (...) */ comments. Also IOMMU support might be added by registering another busdma implementation like it is already done on the x86. Reviewed by: andrew, emaste Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Added: head/sys/arm64/arm64/busdma_bounce.c (contents, props changed) head/sys/arm64/include/bus_dma_impl.h (contents, props changed) Modified: head/sys/arm64/arm64/busdma_machdep.c head/sys/conf/files.arm64 Added: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/busdma_bounce.c Fri May 8 18:47:19 2015 (r282655) @@ -0,0 +1,1080 @@ +/*- + * Copyright (c) 1997, 1998 Justin T. Gibbs. + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Semihalf + * under sponsorship of the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define MAX_BPAGES 4096 + +enum { + BUS_DMA_COULD_BOUNCE = 0x01, + BUS_DMA_MIN_ALLOC_COMP = 0x02, + BUS_DMA_KMEM_ALLOC = 0x04, +}; + +struct bounce_zone; + +struct bus_dma_tag { + struct bus_dma_tag_common common; + int map_count; + int bounce_flags; + bus_dma_segment_t *segments; + struct bounce_zone *bounce_zone; +}; + +struct bounce_page { + vm_offset_t vaddr; /* kva of bounce buffer */ + bus_addr_t busaddr; /* Physical address */ + vm_offset_t datavaddr; /* kva of client data */ + bus_addr_t dataaddr; /* client physical address */ + bus_size_t datacount; /* client data count */ + STAILQ_ENTRY(bounce_page) links; +}; + +int busdma_swi_pending; + +struct bounce_zone { + STAILQ_ENTRY(bounce_zone) links; + STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; + int total_bpages; + int free_bpages; + int reserved_bpages; + int active_bpages; + int total_bounced; + int total_deferred; + int map_count; + bus_size_t alignment; + bus_addr_t lowaddr; + char zoneid[8]; + char lowaddrid[20]; + struct sysctl_ctx_list sysctl_tree; + struct sysctl_oid *sysctl_tree_top; +}; + +static struct mtx bounce_lock; +static int total_bpages; +static int busdma_zonecount; +static STAILQ_HEAD(, bounce_zone) bounce_zone_list; + +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, + "Total bounce pages"); + +struct bus_dmamap { + struct bp_list bpages; + int pagesneeded; + int pagesreserved; + bus_dma_tag_t dmat; + struct memdesc mem; + bus_dmamap_callback_t *callback; + void *callback_arg; + STAILQ_ENTRY(bus_dmamap) links; +}; + +static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; +static struct bus_dmamap nobounce_dmamap; + +static void init_bounce_pages(void *dummy); +static int alloc_bounce_zone(bus_dma_tag_t dmat); +static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); +static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int commit); +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_offset_t vaddr, bus_addr_t addr, bus_size_t size); +static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); +int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); +static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + pmap_t pmap, void *buf, bus_size_t buflen, int flags); +static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags); +static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int flags); + +/* + * Allocate a device specific dma_tag. + */ +static int +bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat) +{ + bus_dma_tag_t newtag; + int error; + + *dmat = NULL; + error = common_bus_dma_tag_create(parent != NULL ? &parent->common : + NULL, alignment, boundary, lowaddr, highaddr, filter, filterarg, + maxsize, nsegments, maxsegsz, flags, lockfunc, lockfuncarg, + sizeof (struct bus_dma_tag), (void **)&newtag); + if (error != 0) + return (error); + + newtag->common.impl = &bus_dma_bounce_impl; + newtag->map_count = 0; + newtag->segments = NULL; + + if (parent != NULL && ((newtag->common.filter != NULL) || + ((parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0))) + newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; + + if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || + newtag->common.alignment > 1) + newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; + + if (((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + (flags & BUS_DMA_ALLOCNOW) != 0) { + struct bounce_zone *bz; + + /* Must bounce */ + if ((error = alloc_bounce_zone(newtag)) != 0) { + free(newtag, M_DEVBUF); + return (error); + } + bz = newtag->bounce_zone; + + if (ptoa(bz->total_bpages) < maxsize) { + int pages; + + pages = atop(maxsize) - bz->total_bpages; + + /* Add pages to our bounce pool */ + if (alloc_bounce_pages(newtag, pages) < pages) + error = ENOMEM; + } + /* Performed initial allocation */ + newtag->bounce_flags |= BUS_DMA_MIN_ALLOC_COMP; + } else + error = 0; + + if (error != 0) + free(newtag, M_DEVBUF); + else + *dmat = newtag; + CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", + __func__, newtag, (newtag != NULL ? newtag->common.flags : 0), + error); + return (error); +} + +static int +bounce_bus_dma_tag_destroy(bus_dma_tag_t dmat) +{ + bus_dma_tag_t dmat_copy, parent; + int error; + + error = 0; + dmat_copy = dmat; + + if (dmat != NULL) { + if (dmat->map_count != 0) { + error = EBUSY; + goto out; + } + while (dmat != NULL) { + parent = (bus_dma_tag_t)dmat->common.parent; + atomic_subtract_int(&dmat->common.ref_count, 1); + if (dmat->common.ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); + free(dmat, M_DEVBUF); + /* + * Last reference count, so + * release our reference + * count on our parent. + */ + dmat = parent; + } else + dmat = NULL; + } + } +out: + CTR3(KTR_BUSDMA, "%s tag %p error %d", __func__, dmat_copy, error); + return (error); +} + +/* + * Allocate a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static int +bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) +{ + struct bounce_zone *bz; + int error, maxpages, pages; + + error = 0; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->common.nsegments, + M_DEVBUF, M_NOWAIT); + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + } + + /* + * Bouncing might be required if the driver asks for an active + * exclusion region, a data alignment that is stricter than 1, and/or + * an active address boundary. + */ + if (dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) { + /* Must bounce */ + if (dmat->bounce_zone == NULL) { + if ((error = alloc_bounce_zone(dmat)) != 0) + return (error); + } + bz = dmat->bounce_zone; + + *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (*mapp == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + + /* Initialize the new map */ + STAILQ_INIT(&((*mapp)->bpages)); + + /* + * Attempt to add pages to our pool on a per-instance + * basis up to a sane limit. + */ + if (dmat->common.alignment > 1) + maxpages = MAX_BPAGES; + else + maxpages = MIN(MAX_BPAGES, Maxmem - + atop(dmat->common.lowaddr)); + if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || + (bz->map_count > 0 && bz->total_bpages < maxpages)) { + pages = MAX(atop(dmat->common.maxsize), 1); + pages = MIN(maxpages - bz->total_bpages, pages); + pages = MAX(pages, 1); + if (alloc_bounce_pages(dmat, pages) < pages) + error = ENOMEM; + if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) + == 0) { + if (error == 0) { + dmat->bounce_flags |= + BUS_DMA_MIN_ALLOC_COMP; + } + } else + error = 0; + } + bz->map_count++; + } else { + *mapp = NULL; + } + if (error == 0) + dmat->map_count++; + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, error); + return (error); +} + +/* + * Destroy a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static int +bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + + if (map != NULL && map != &nobounce_dmamap) { + if (STAILQ_FIRST(&map->bpages) != NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, EBUSY); + return (EBUSY); + } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; + free(map, M_DEVBUF); + } + dmat->map_count--; + CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); + return (0); +} + + +/* + * Allocate a piece of memory that can be efficiently mapped into + * bus device space based on the constraints lited in the dma tag. + * A dmamap to for use with dmamap_load is also allocated. + */ +static int +bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp) +{ + /* + * XXX ARM64TODO: + * This bus_dma implementation requires IO-Coherent architecutre. + * If IO-Coherency is not guaranteed, the BUS_DMA_COHERENT flag has + * to be implented using non-cacheable memory. + */ + + vm_memattr_t attr; + int mflags; + + if (flags & BUS_DMA_NOWAIT) + mflags = M_NOWAIT; + else + mflags = M_WAITOK; + + /* If we succeed, no mapping/bouncing will be required */ + *mapp = NULL; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->common.nsegments, + M_DEVBUF, mflags); + if (dmat->segments == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + return (ENOMEM); + } + } + if (flags & BUS_DMA_ZERO) + mflags |= M_ZERO; + if (flags & BUS_DMA_NOCACHE) + attr = VM_MEMATTR_UNCACHEABLE; + else + attr = VM_MEMATTR_DEFAULT; + + /* + * XXX: + * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact + * alignment guarantees of malloc need to be nailed down, and the + * code below should be rewritten to take that into account. + * + * In the meantime, we'll warn the user if malloc gets it wrong. + */ + if ((dmat->common.maxsize <= PAGE_SIZE) && + (dmat->common.alignment < dmat->common.maxsize) && + dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && + attr == VM_MEMATTR_DEFAULT) { + *vaddr = malloc(dmat->common.maxsize, M_DEVBUF, mflags); + } else if (dmat->common.nsegments >= btoc(dmat->common.maxsize) && + dmat->common.alignment <= PAGE_SIZE && + (dmat->common.boundary == 0 || + dmat->common.boundary >= dmat->common.lowaddr)) { + /* Page-based multi-segment allocations allowed */ + *vaddr = (void *)kmem_alloc_attr(kernel_arena, + dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, + attr); + dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; + } else { + *vaddr = (void *)kmem_alloc_contig(kernel_arena, + dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, + dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, + dmat->common.boundary, attr); + dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; + } + if (*vaddr == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + return (ENOMEM); + } else if (vtophys(*vaddr) & (dmat->common.alignment - 1)) { + printf("bus_dmamem_alloc failed to align memory properly.\n"); + } + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, 0); + return (0); +} + +/* + * Free a piece of memory and it's allociated dmamap, that was allocated + * via bus_dmamem_alloc. Make the same choice for free/contigfree. + */ +static void +bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) +{ + /* + * dmamem does not need to be bounced, so the map should be + * NULL and the BUS_DMA_KMEM_ALLOC flag cleared if malloc() + * was used and set if kmem_alloc_contig() was used. + */ + if (map != NULL) + panic("bus_dmamem_free: Invalid map freed\n"); + if ((dmat->bounce_flags & BUS_DMA_KMEM_ALLOC) == 0) + free(vaddr, M_DEVBUF); + else + kmem_free(kernel_arena, (vm_offset_t)vaddr, + dmat->common.maxsize); + CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, + dmat->bounce_flags); +} + +static void +_bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, + bus_size_t buflen, int flags) +{ + bus_addr_t curaddr; + bus_size_t sgsize; + + if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + curaddr = buf; + while (buflen != 0) { + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = MIN(sgsize, PAGE_SIZE); + map->pagesneeded++; + } + curaddr += sgsize; + buflen -= sgsize; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + +static void +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags) +{ + vm_offset_t vaddr; + vm_offset_t vendaddr; + bus_addr_t paddr; + bus_size_t sg_len; + + if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " + "alignment= %d", dmat->common.lowaddr, + ptoa((vm_paddr_t)Maxmem), + dmat->common.boundary, dmat->common.alignment); + CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d", + map, &nobounce_dmamap, map->pagesneeded); + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + vaddr = (vm_offset_t)buf; + vendaddr = (vm_offset_t)buf + buflen; + + while (vaddr < vendaddr) { + sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK); + if (pmap == kernel_pmap) + paddr = pmap_kextract(vaddr); + else + paddr = pmap_extract(pmap, vaddr); + if (bus_dma_run_filter(&dmat->common, paddr) != 0) { + sg_len = roundup2(sg_len, + dmat->common.alignment); + map->pagesneeded++; + } + vaddr += sg_len; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + +static int +_bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags) +{ + + /* Reserve Necessary Bounce Pages */ + mtx_lock(&bounce_lock); + if (flags & BUS_DMA_NOWAIT) { + if (reserve_bounce_pages(dmat, map, 0) != 0) { + mtx_unlock(&bounce_lock); + return (ENOMEM); + } + } else { + if (reserve_bounce_pages(dmat, map, 1) != 0) { + /* Queue us for resources */ + STAILQ_INSERT_TAIL(&bounce_map_waitinglist, map, links); + mtx_unlock(&bounce_lock); + return (EINPROGRESS); + } + } + mtx_unlock(&bounce_lock); + + return (0); +} + +/* + * Add a single contiguous physical range to the segment list. + */ +static int +_bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, + bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) +{ + bus_addr_t baddr, bmask; + int seg; + + /* + * Make sure we don't cross any boundaries. + */ + bmask = ~(dmat->common.boundary - 1); + if (dmat->common.boundary > 0) { + baddr = (curaddr + dmat->common.boundary) & bmask; + if (sgsize > (baddr - curaddr)) + sgsize = (baddr - curaddr); + } + + /* + * Insert chunk into a segment, coalescing with + * previous segment if possible. + */ + seg = *segp; + if (seg == -1) { + seg = 0; + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } else { + if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && + (segs[seg].ds_len + sgsize) <= dmat->common.maxsegsz && + (dmat->common.boundary == 0 || + (segs[seg].ds_addr & bmask) == (curaddr & bmask))) + segs[seg].ds_len += sgsize; + else { + if (++seg >= dmat->common.nsegments) + return (0); + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } + } + *segp = seg; + return (sgsize); +} + +/* + * Utility function to load a physical buffer. segp contains + * the starting segment on entrace, and the ending segment on exit. + */ +static int +bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags, bus_dma_segment_t *segs, + int *segp) +{ + bus_size_t sgsize; + bus_addr_t curaddr; + int error; + + if (map == NULL) + map = &nobounce_dmamap; + + if (segs == NULL) + segs = dmat->segments; + + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { + _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); + if (map->pagesneeded != 0) { + error = _bus_dmamap_reserve_pages(dmat, map, flags); + if (error) + return (error); + } + } + + while (buflen > 0) { + curaddr = buf; + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && + bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = MIN(sgsize, PAGE_SIZE); + curaddr = add_bounce_page(dmat, map, 0, curaddr, + sgsize); + } + sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, + segp); + if (sgsize == 0) + break; + buf += sgsize; + buflen -= sgsize; + } + + /* + * Did we fit? + */ + return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ +} + +/* + * Utility function to load a linear buffer. segp contains + * the starting segment on entrace, and the ending segment on exit. + */ +static int +bounce_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, + bus_size_t buflen, pmap_t pmap, int flags, bus_dma_segment_t *segs, + int *segp) +{ + bus_size_t sgsize, max_sgsize; + bus_addr_t curaddr; + vm_offset_t vaddr; + int error; + + if (map == NULL) + map = &nobounce_dmamap; + + if (segs == NULL) + segs = dmat->segments; + + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { + _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags); + if (map->pagesneeded != 0) { + error = _bus_dmamap_reserve_pages(dmat, map, flags); + if (error) + return (error); + } + } + + vaddr = (vm_offset_t)buf; + while (buflen > 0) { + /* + * Get the physical address for this segment. + */ + if (pmap == kernel_pmap) + curaddr = pmap_kextract(vaddr); + else + curaddr = pmap_extract(pmap, vaddr); + + /* + * Compute the segment size, and adjust counts. + */ + max_sgsize = MIN(buflen, dmat->common.maxsegsz); + sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); + if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && + bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = roundup2(sgsize, dmat->common.alignment); + sgsize = MIN(sgsize, max_sgsize); + curaddr = add_bounce_page(dmat, map, vaddr, curaddr, + sgsize); + } else { + sgsize = MIN(sgsize, max_sgsize); + } + sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, + segp); + if (sgsize == 0) + break; + vaddr += sgsize; + buflen -= sgsize; + } + + /* + * Did we fit? + */ + return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ +} + +static void +bounce_bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg) +{ + + if (map == NULL) + return; + map->mem = *mem; + map->dmat = dmat; + map->callback = callback; + map->callback_arg = callback_arg; +} + +static bus_dma_segment_t * +bounce_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error) +{ + + if (segs == NULL) + segs = dmat->segments; + return (segs); +} + +/* + * Release the mapping held by map. + */ +static void +bounce_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + struct bounce_page *bpage; + + while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { + STAILQ_REMOVE_HEAD(&map->bpages, links); + free_bounce_page(dmat, bpage); + } +} + +static void +bounce_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dmasync_op_t op) +{ + struct bounce_page *bpage; + + /* + * XXX ARM64TODO: + * This bus_dma implementation requires IO-Coherent architecutre. + * If IO-Coherency is not guaranteed, cache operations have to be + * added to this function. + */ + + if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { + /* + * Handle data bouncing. We might also + * want to add support for invalidating + * the caches on broken hardware + */ + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " + "performing bounce", __func__, dmat, + dmat->common.flags, op); + + if ((op & BUS_DMASYNC_PREWRITE) != 0) { + while (bpage != NULL) { + if (bpage->datavaddr != 0) { + bcopy((void *)bpage->datavaddr, + (void *)bpage->vaddr, + bpage->datacount); + } else { + physcopyout(bpage->dataaddr, + (void *)bpage->vaddr, + bpage->datacount); + } + bpage = STAILQ_NEXT(bpage, links); + } + dmat->bounce_zone->total_bounced++; + } + + if ((op & BUS_DMASYNC_POSTREAD) != 0) { + while (bpage != NULL) { + if (bpage->datavaddr != 0) { + bcopy((void *)bpage->vaddr, + (void *)bpage->datavaddr, + bpage->datacount); + } else { + physcopyin((void *)bpage->vaddr, + bpage->dataaddr, + bpage->datacount); + } + bpage = STAILQ_NEXT(bpage, links); + } + dmat->bounce_zone->total_bounced++; + } + } +} + +static void +init_bounce_pages(void *dummy __unused) +{ + + total_bpages = 0; + STAILQ_INIT(&bounce_zone_list); + STAILQ_INIT(&bounce_map_waitinglist); + STAILQ_INIT(&bounce_map_callbacklist); + mtx_init(&bounce_lock, "bounce pages lock", NULL, MTX_DEF); +} +SYSINIT(bpages, SI_SUB_LOCK, SI_ORDER_ANY, init_bounce_pages, NULL); + +static struct sysctl_ctx_list * +busdma_sysctl_tree(struct bounce_zone *bz) +{ + return (&bz->sysctl_tree); +} + +static struct sysctl_oid * +busdma_sysctl_tree_top(struct bounce_zone *bz) +{ + return (bz->sysctl_tree_top); +} + +static int +alloc_bounce_zone(bus_dma_tag_t dmat) +{ + struct bounce_zone *bz; + + /* Check to see if we already have a suitable zone */ + STAILQ_FOREACH(bz, &bounce_zone_list, links) { + if ((dmat->common.alignment <= bz->alignment) && + (dmat->common.lowaddr >= bz->lowaddr)) { + dmat->bounce_zone = bz; + return (0); + } + } + + if ((bz = (struct bounce_zone *)malloc(sizeof(*bz), M_DEVBUF, + M_NOWAIT | M_ZERO)) == NULL) + return (ENOMEM); + + STAILQ_INIT(&bz->bounce_page_list); + bz->free_bpages = 0; + bz->reserved_bpages = 0; + bz->active_bpages = 0; + bz->lowaddr = dmat->common.lowaddr; + bz->alignment = MAX(dmat->common.alignment, PAGE_SIZE); + bz->map_count = 0; + snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); + busdma_zonecount++; + snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); + STAILQ_INSERT_TAIL(&bounce_zone_list, bz, links); + dmat->bounce_zone = bz; + + sysctl_ctx_init(&bz->sysctl_tree); + bz->sysctl_tree_top = SYSCTL_ADD_NODE(&bz->sysctl_tree, + SYSCTL_STATIC_CHILDREN(_hw_busdma), OID_AUTO, bz->zoneid, + CTLFLAG_RD, 0, ""); + if (bz->sysctl_tree_top == NULL) { + sysctl_ctx_free(&bz->sysctl_tree); + return (0); /* XXX error code? */ + } + + SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, + "total_bpages", CTLFLAG_RD, &bz->total_bpages, 0, + "Total bounce pages"); + SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, + "free_bpages", CTLFLAG_RD, &bz->free_bpages, 0, + "Free bounce pages"); + SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, + "reserved_bpages", CTLFLAG_RD, &bz->reserved_bpages, 0, + "Reserved bounce pages"); + SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, + "active_bpages", CTLFLAG_RD, &bz->active_bpages, 0, + "Active bounce pages"); + SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, + "total_bounced", CTLFLAG_RD, &bz->total_bounced, 0, + "Total bounce requests"); + SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, + "total_deferred", CTLFLAG_RD, &bz->total_deferred, 0, + "Total bounce requests that were deferred"); + SYSCTL_ADD_STRING(busdma_sysctl_tree(bz), + SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, + "lowaddr", CTLFLAG_RD, bz->lowaddrid, 0, ""); + SYSCTL_ADD_UAUTO(busdma_sysctl_tree(bz), + SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, + "alignment", CTLFLAG_RD, &bz->alignment, ""); + + return (0); +} + +static int +alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) +{ + struct bounce_zone *bz; + int count; + + bz = dmat->bounce_zone; + count = 0; + while (numpages > 0) { + struct bounce_page *bpage; + + bpage = (struct bounce_page *)malloc(sizeof(*bpage), M_DEVBUF, + M_NOWAIT | M_ZERO); + + if (bpage == NULL) + break; + bpage->vaddr = (vm_offset_t)contigmalloc(PAGE_SIZE, M_DEVBUF, + M_NOWAIT, 0ul, bz->lowaddr, PAGE_SIZE, 0); + if (bpage->vaddr == 0) { + free(bpage, M_DEVBUF); + break; + } + bpage->busaddr = pmap_kextract(bpage->vaddr); + mtx_lock(&bounce_lock); + STAILQ_INSERT_TAIL(&bz->bounce_page_list, bpage, links); + total_bpages++; + bz->total_bpages++; + bz->free_bpages++; + mtx_unlock(&bounce_lock); + count++; + numpages--; + } + return (count); +} + +static int +reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int commit) +{ + struct bounce_zone *bz; + int pages; + + mtx_assert(&bounce_lock, MA_OWNED); + bz = dmat->bounce_zone; + pages = MIN(bz->free_bpages, map->pagesneeded - map->pagesreserved); + if (commit == 0 && map->pagesneeded > (map->pagesreserved + pages)) + return (map->pagesneeded - (map->pagesreserved + pages)); + bz->free_bpages -= pages; + bz->reserved_bpages += pages; + map->pagesreserved += pages; + pages = map->pagesneeded - map->pagesreserved; + + return (pages); +} + +static bus_addr_t +add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, + bus_addr_t addr, bus_size_t size) +{ + struct bounce_zone *bz; + struct bounce_page *bpage; + + KASSERT(dmat->bounce_zone != NULL, ("no bounce zone in dma tag")); + KASSERT(map != NULL && map != &nobounce_dmamap, + ("add_bounce_page: bad map %p", map)); + + bz = dmat->bounce_zone; + if (map->pagesneeded == 0) + panic("add_bounce_page: map doesn't need any pages"); + map->pagesneeded--; + + if (map->pagesreserved == 0) + panic("add_bounce_page: map doesn't need any pages"); + map->pagesreserved--; + + mtx_lock(&bounce_lock); + bpage = STAILQ_FIRST(&bz->bounce_page_list); + if (bpage == NULL) + panic("add_bounce_page: free page list is empty"); + + STAILQ_REMOVE_HEAD(&bz->bounce_page_list, links); + bz->reserved_bpages--; + bz->active_bpages++; + mtx_unlock(&bounce_lock); + + if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 8 19:40:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D5618A5; Fri, 8 May 2015 19:40: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 1B7381726; Fri, 8 May 2015 19:40: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 t48Je3u9059118; Fri, 8 May 2015 19:40:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48Je1Pq059102; Fri, 8 May 2015 19:40:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505081940.t48Je1Pq059102@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 8 May 2015 19:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282658 - in head/sys: dev/hwpmc sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 19:40:03 -0000 Author: jhb Date: Fri May 8 19:40:00 2015 New Revision: 282658 URL: https://svnweb.freebsd.org/changeset/base/282658 Log: Convert hwpmc(4) debug printfs over to KTR. Differential Revision: https://reviews.freebsd.org/D2487 Reviewed by: davide, emaste MFC after: 2 weeks Sponsored by: Norse Corp, Inc. Modified: head/sys/dev/hwpmc/hwpmc_amd.c head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_intel.c head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/hwpmc/hwpmc_mips.c head/sys/dev/hwpmc/hwpmc_mips24k.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/hwpmc/hwpmc_mpc7xxx.c head/sys/dev/hwpmc/hwpmc_octeon.c head/sys/dev/hwpmc/hwpmc_piv.c head/sys/dev/hwpmc/hwpmc_ppc970.c head/sys/dev/hwpmc/hwpmc_ppro.c head/sys/dev/hwpmc/hwpmc_soft.c head/sys/dev/hwpmc/hwpmc_tsc.c head/sys/dev/hwpmc/hwpmc_uncore.c head/sys/dev/hwpmc/hwpmc_xscale.c head/sys/sys/pmc.h Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Fri May 8 19:17:38 2015 (r282657) +++ head/sys/dev/hwpmc/hwpmc_amd.c Fri May 8 19:40:00 2015 (r282658) @@ -282,7 +282,7 @@ amd_read_pmc(int cpu, int ri, pmc_value_ mode = PMC_TO_MODE(pm); - PMCDBG(MDP,REA,1,"amd-read id=%d class=%d", ri, pd->pm_descr.pd_class); + PMCDBG2(MDP,REA,1,"amd-read id=%d class=%d", ri, pd->pm_descr.pd_class); #ifdef HWPMC_DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, @@ -291,7 +291,7 @@ amd_read_pmc(int cpu, int ri, pmc_value_ #endif tmp = rdmsr(pd->pm_perfctr); /* RDMSR serializes */ - PMCDBG(MDP,REA,2,"amd-read (pre-munge) id=%d -> %jd", ri, tmp); + PMCDBG2(MDP,REA,2,"amd-read (pre-munge) id=%d -> %jd", ri, tmp); if (PMC_IS_SAMPLING_MODE(mode)) { /* Sign extend 48 bit value to 64 bits. */ tmp = (pmc_value_t) (((int64_t) tmp << 16) >> 16); @@ -299,7 +299,7 @@ amd_read_pmc(int cpu, int ri, pmc_value_ } *v = tmp; - PMCDBG(MDP,REA,2,"amd-read (post-munge) id=%d -> %jd", ri, *v); + PMCDBG2(MDP,REA,2,"amd-read (post-munge) id=%d -> %jd", ri, *v); return 0; } @@ -339,7 +339,7 @@ amd_write_pmc(int cpu, int ri, pmc_value if (PMC_IS_SAMPLING_MODE(mode)) v = AMD_RELOAD_COUNT_TO_PERFCTR_VALUE(v); - PMCDBG(MDP,WRI,1,"amd-write cpu=%d ri=%d v=%jx", cpu, ri, v); + PMCDBG3(MDP,WRI,1,"amd-write cpu=%d ri=%d v=%jx", cpu, ri, v); /* write the PMC value */ wrmsr(pd->pm_perfctr, v); @@ -356,7 +356,7 @@ amd_config_pmc(int cpu, int ri, struct p { struct pmc_hw *phw; - PMCDBG(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); + PMCDBG3(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] illegal CPU value %d", __LINE__, cpu)); @@ -395,7 +395,7 @@ amd_switch_in(struct pmc_cpu *pc, struct { (void) pc; - PMCDBG(MDP,SWI,1, "pc=%p pp=%p enable-msr=%d", pc, pp, + PMCDBG3(MDP,SWI,1, "pc=%p pp=%p enable-msr=%d", pc, pp, (pp->pp_flags & PMC_PP_ENABLE_MSR_ACCESS) != 0); /* enable the RDPMC instruction if needed */ @@ -416,7 +416,7 @@ amd_switch_out(struct pmc_cpu *pc, struc (void) pc; (void) pp; /* can be NULL */ - PMCDBG(MDP,SWO,1, "pc=%p pp=%p enable-msr=%d", pc, pp, pp ? + PMCDBG3(MDP,SWO,1, "pc=%p pp=%p enable-msr=%d", pc, pp, pp ? (pp->pp_flags & PMC_PP_ENABLE_MSR_ACCESS) == 1 : 0); /* always turn off the RDPMC instruction */ @@ -453,7 +453,7 @@ amd_allocate_pmc(int cpu, int ri, struct caps = pm->pm_caps; - PMCDBG(MDP,ALL,1,"amd-allocate ri=%d caps=0x%x", ri, caps); + PMCDBG2(MDP,ALL,1,"amd-allocate ri=%d caps=0x%x", ri, caps); if ((pd->pd_caps & caps) != caps) return EPERM; @@ -500,7 +500,7 @@ amd_allocate_pmc(int cpu, int ri, struct pm->pm_md.pm_amd.pm_amd_evsel = config; /* save config value */ - PMCDBG(MDP,ALL,2,"amd-allocate ri=%d -> config=0x%x", ri, config); + PMCDBG2(MDP,ALL,2,"amd-allocate ri=%d -> config=0x%x", ri, config); return 0; } @@ -567,7 +567,7 @@ amd_start_pmc(int cpu, int ri) ("[amd,%d] starting cpu%d,pmc%d with null pmc record", __LINE__, cpu, ri)); - PMCDBG(MDP,STA,1,"amd-start cpu=%d ri=%d", cpu, ri); + PMCDBG2(MDP,STA,1,"amd-start cpu=%d ri=%d", cpu, ri); KASSERT(AMD_PMC_IS_STOPPED(pd->pm_evsel), ("[amd,%d] pmc%d,cpu%d: Starting active PMC \"%s\"", __LINE__, @@ -576,7 +576,7 @@ amd_start_pmc(int cpu, int ri) /* turn on the PMC ENABLE bit */ config = pm->pm_md.pm_amd.pm_amd_evsel | AMD_PMC_ENABLE; - PMCDBG(MDP,STA,2,"amd-start config=0x%x", config); + PMCDBG1(MDP,STA,2,"amd-start config=0x%x", config); wrmsr(pd->pm_evsel, config); return 0; @@ -610,7 +610,7 @@ amd_stop_pmc(int cpu, int ri) ("[amd,%d] PMC%d, CPU%d \"%s\" already stopped", __LINE__, ri, cpu, pd->pm_descr.pd_name)); - PMCDBG(MDP,STO,1,"amd-stop ri=%d", ri); + PMCDBG1(MDP,STO,1,"amd-stop ri=%d", ri); /* turn off the PMC ENABLE bit */ config = pm->pm_md.pm_amd.pm_amd_evsel & ~AMD_PMC_ENABLE; @@ -637,7 +637,7 @@ amd_intr(int cpu, struct trapframe *tf) KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] out of range CPU %d", __LINE__, cpu)); - PMCDBG(MDP,INT,1, "cpu=%d tf=%p um=%d", cpu, (void *) tf, + PMCDBG3(MDP,INT,1, "cpu=%d tf=%p um=%d", cpu, (void *) tf, TRAPF_USERMODE(tf)); retval = 0; @@ -769,7 +769,7 @@ amd_pcpu_init(struct pmc_mdep *md, int c KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] insane cpu number %d", __LINE__, cpu)); - PMCDBG(MDP,INI,1,"amd-init cpu=%d", cpu); + PMCDBG1(MDP,INI,1,"amd-init cpu=%d", cpu); amd_pcpu[cpu] = pac = malloc(sizeof(struct amd_cpu), M_PMC, M_WAITOK|M_ZERO); @@ -816,7 +816,7 @@ amd_pcpu_fini(struct pmc_mdep *md, int c KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] insane cpu number (%d)", __LINE__, cpu)); - PMCDBG(MDP,INI,1,"amd-cleanup cpu=%d", cpu); + PMCDBG1(MDP,INI,1,"amd-cleanup cpu=%d", cpu); /* * First, turn off all PMCs on this CPU. @@ -976,7 +976,7 @@ pmc_amd_initialize(void) pmc_mdep->pmd_npmc += AMD_NPMCS; - PMCDBG(MDP,INI,0,"%s","amd-initialize"); + PMCDBG0(MDP,INI,0,"amd-initialize"); return (pmc_mdep); Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri May 8 19:17:38 2015 (r282657) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri May 8 19:40:00 2015 (r282658) @@ -123,7 +123,7 @@ core_pcpu_init(struct pmc_mdep *md, int KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[iaf,%d] insane cpu number %d", __LINE__, cpu)); - PMCDBG(MDP,INI,1,"core-init cpu=%d", cpu); + PMCDBG1(MDP,INI,1,"core-init cpu=%d", cpu); core_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_IAP].pcd_ri; npmc = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_IAP].pcd_num; @@ -162,7 +162,7 @@ core_pcpu_fini(struct pmc_mdep *md, int KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] insane cpu number (%d)", __LINE__, cpu)); - PMCDBG(MDP,INI,1,"core-pcpu-fini cpu=%d", cpu); + PMCDBG1(MDP,INI,1,"core-pcpu-fini cpu=%d", cpu); if ((cc = core_pcpu[cpu]) == NULL) return (0); @@ -223,7 +223,7 @@ iaf_allocate_pmc(int cpu, int ri, struct KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] illegal CPU %d", __LINE__, cpu)); - PMCDBG(MDP,ALL,1, "iaf-allocate ri=%d reqcaps=0x%x", ri, pm->pm_caps); + PMCDBG2(MDP,ALL,1, "iaf-allocate ri=%d reqcaps=0x%x", ri, pm->pm_caps); if (ri < 0 || ri > core_iaf_npmc) return (EINVAL); @@ -267,7 +267,7 @@ iaf_allocate_pmc(int cpu, int ri, struct pm->pm_md.pm_iaf.pm_iaf_ctrl = (flags << (ri * 4)); - PMCDBG(MDP,ALL,2, "iaf-allocate config=0x%jx", + PMCDBG1(MDP,ALL,2, "iaf-allocate config=0x%jx", (uintmax_t) pm->pm_md.pm_iaf.pm_iaf_ctrl); return (0); @@ -282,7 +282,7 @@ iaf_config_pmc(int cpu, int ri, struct p KASSERT(ri >= 0 && ri < core_iaf_npmc, ("[core,%d] illegal row-index %d", __LINE__, ri)); - PMCDBG(MDP,CFG,1, "iaf-config cpu=%d ri=%d pm=%p", cpu, ri, pm); + PMCDBG3(MDP,CFG,1, "iaf-config cpu=%d ri=%d pm=%p", cpu, ri, pm); KASSERT(core_pcpu[cpu] != NULL, ("[core,%d] null per-cpu %d", __LINE__, cpu)); @@ -362,7 +362,7 @@ iaf_read_pmc(int cpu, int ri, pmc_value_ else *v = tmp; - PMCDBG(MDP,REA,1, "iaf-read cpu=%d ri=%d msr=0x%x -> v=%jx", cpu, ri, + PMCDBG4(MDP,REA,1, "iaf-read cpu=%d ri=%d msr=0x%x -> v=%jx", cpu, ri, IAF_RI_TO_MSR(ri), *v); return (0); @@ -371,7 +371,7 @@ iaf_read_pmc(int cpu, int ri, pmc_value_ static int iaf_release_pmc(int cpu, int ri, struct pmc *pmc) { - PMCDBG(MDP,REL,1, "iaf-release cpu=%d ri=%d pm=%p", cpu, ri, pmc); + PMCDBG3(MDP,REL,1, "iaf-release cpu=%d ri=%d pm=%p", cpu, ri, pmc); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] illegal CPU value %d", __LINE__, cpu)); @@ -396,7 +396,7 @@ iaf_start_pmc(int cpu, int ri) KASSERT(ri >= 0 && ri < core_iaf_npmc, ("[core,%d] illegal row-index %d", __LINE__, ri)); - PMCDBG(MDP,STA,1,"iaf-start cpu=%d ri=%d", cpu, ri); + PMCDBG2(MDP,STA,1,"iaf-start cpu=%d ri=%d", cpu, ri); iafc = core_pcpu[cpu]; pm = iafc->pc_corepmcs[ri + core_iaf_ri].phw_pmc; @@ -414,7 +414,7 @@ iaf_start_pmc(int cpu, int ri) IAF_GLOBAL_CTRL_MASK)); } while (iafc->pc_resync != 0); - PMCDBG(MDP,STA,1,"iafctrl=%x(%x) globalctrl=%jx(%jx)", + PMCDBG4(MDP,STA,1,"iafctrl=%x(%x) globalctrl=%jx(%jx)", iafc->pc_iafctrl, (uint32_t) rdmsr(IAF_CTRL), iafc->pc_globalctrl, rdmsr(IA_GLOBAL_CTRL)); @@ -428,7 +428,7 @@ iaf_stop_pmc(int cpu, int ri) struct core_cpu *iafc; uint64_t msr = 0; - PMCDBG(MDP,STO,1,"iaf-stop cpu=%d ri=%d", cpu, ri); + PMCDBG2(MDP,STO,1,"iaf-stop cpu=%d ri=%d", cpu, ri); iafc = core_pcpu[cpu]; @@ -445,7 +445,7 @@ iaf_stop_pmc(int cpu, int ri) iafc->pc_iafctrl &= ~fc; - PMCDBG(MDP,STO,1,"iaf-stop iafctrl=%x", iafc->pc_iafctrl); + PMCDBG1(MDP,STO,1,"iaf-stop iafctrl=%x", iafc->pc_iafctrl); msr = rdmsr(IAF_CTRL) & ~IAF_CTRL_MASK; wrmsr(IAF_CTRL, msr | (iafc->pc_iafctrl & IAF_CTRL_MASK)); @@ -457,7 +457,7 @@ iaf_stop_pmc(int cpu, int ri) IAF_GLOBAL_CTRL_MASK)); } while (iafc->pc_resync != 0); - PMCDBG(MDP,STO,1,"iafctrl=%x(%x) globalctrl=%jx(%jx)", + PMCDBG4(MDP,STO,1,"iafctrl=%x(%x) globalctrl=%jx(%jx)", iafc->pc_iafctrl, (uint32_t) rdmsr(IAF_CTRL), iafc->pc_globalctrl, rdmsr(IA_GLOBAL_CTRL)); @@ -495,7 +495,7 @@ iaf_write_pmc(int cpu, int ri, pmc_value msr = rdmsr(IAF_CTRL) & ~IAF_CTRL_MASK; wrmsr(IAF_CTRL, msr | (cc->pc_iafctrl & IAF_CTRL_MASK)); - PMCDBG(MDP,WRI,1, "iaf-write cpu=%d ri=%d msr=0x%x v=%jx iafctrl=%jx " + PMCDBG6(MDP,WRI,1, "iaf-write cpu=%d ri=%d msr=0x%x v=%jx iafctrl=%jx " "pmc=%jx", cpu, ri, IAF_RI_TO_MSR(ri), v, (uintmax_t) rdmsr(IAF_CTRL), (uintmax_t) rdpmc(IAF_RI_TO_MSR(ri))); @@ -511,7 +511,7 @@ iaf_initialize(struct pmc_mdep *md, int KASSERT(md != NULL, ("[iaf,%d] md is NULL", __LINE__)); - PMCDBG(MDP,INI,1, "%s", "iaf-initialize"); + PMCDBG0(MDP,INI,1, "iaf-initialize"); pcd = &md->pmd_classdep[PMC_MDEP_CLASS_INDEX_IAF]; @@ -2289,7 +2289,7 @@ iap_config_pmc(int cpu, int ri, struct p KASSERT(ri >= 0 && ri < core_iap_npmc, ("[core,%d] illegal row-index %d", __LINE__, ri)); - PMCDBG(MDP,CFG,1, "iap-config cpu=%d ri=%d pm=%p", cpu, ri, pm); + PMCDBG3(MDP,CFG,1, "iap-config cpu=%d ri=%d pm=%p", cpu, ri, pm); KASSERT(core_pcpu[cpu] != NULL, ("[core,%d] null per-cpu %d", __LINE__, cpu)); @@ -2368,7 +2368,7 @@ iap_read_pmc(int cpu, int ri, pmc_value_ else *v = tmp & ((1ULL << core_iap_width) - 1); - PMCDBG(MDP,REA,1, "iap-read cpu=%d ri=%d msr=0x%x -> v=%jx", cpu, ri, + PMCDBG4(MDP,REA,1, "iap-read cpu=%d ri=%d msr=0x%x -> v=%jx", cpu, ri, ri, *v); return (0); @@ -2379,7 +2379,7 @@ iap_release_pmc(int cpu, int ri, struct { (void) pm; - PMCDBG(MDP,REL,1, "iap-release cpu=%d ri=%d pm=%p", cpu, ri, + PMCDBG3(MDP,REL,1, "iap-release cpu=%d ri=%d pm=%p", cpu, ri, pm); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -2412,11 +2412,11 @@ iap_start_pmc(int cpu, int ri) ("[core,%d] starting cpu%d,ri%d with no pmc configured", __LINE__, cpu, ri)); - PMCDBG(MDP,STA,1, "iap-start cpu=%d ri=%d", cpu, ri); + PMCDBG2(MDP,STA,1, "iap-start cpu=%d ri=%d", cpu, ri); evsel = pm->pm_md.pm_iap.pm_iap_evsel; - PMCDBG(MDP,STA,2, "iap-start/2 cpu=%d ri=%d evselmsr=0x%x evsel=0x%x", + PMCDBG4(MDP,STA,2, "iap-start/2 cpu=%d ri=%d evselmsr=0x%x evsel=0x%x", cpu, ri, IAP_EVSEL0 + ri, evsel); /* Event specific configuration. */ @@ -2464,7 +2464,7 @@ iap_stop_pmc(int cpu, int ri) ("[core,%d] cpu%d ri%d no configured PMC to stop", __LINE__, cpu, ri)); - PMCDBG(MDP,STO,1, "iap-stop cpu=%d ri=%d", cpu, ri); + PMCDBG2(MDP,STO,1, "iap-stop cpu=%d ri=%d", cpu, ri); msr = rdmsr(IAP_EVSEL0 + ri) & ~IAP_EVSEL_MASK; wrmsr(IAP_EVSEL0 + ri, msr); /* stop hw */ @@ -2501,7 +2501,7 @@ iap_write_pmc(int cpu, int ri, pmc_value ("[core,%d] cpu%d ri%d no configured PMC to stop", __LINE__, cpu, ri)); - PMCDBG(MDP,WRI,1, "iap-write cpu=%d ri=%d msr=0x%x v=%jx", cpu, ri, + PMCDBG4(MDP,WRI,1, "iap-write cpu=%d ri=%d msr=0x%x v=%jx", cpu, ri, IAP_PMC0 + ri, v); if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) @@ -2526,7 +2526,7 @@ iap_initialize(struct pmc_mdep *md, int KASSERT(md != NULL, ("[iap,%d] md is NULL", __LINE__)); - PMCDBG(MDP,INI,1, "%s", "iap-initialize"); + PMCDBG0(MDP,INI,1, "iap-initialize"); /* Remember the set of architectural events supported. */ core_architectural_events = ~flags; @@ -2564,7 +2564,7 @@ core_intr(int cpu, struct trapframe *tf) int error, found_interrupt, ri; uint64_t msr; - PMCDBG(MDP,INT, 1, "cpu=%d tf=0x%p um=%d", cpu, (void *) tf, + PMCDBG3(MDP,INT, 1, "cpu=%d tf=0x%p um=%d", cpu, (void *) tf, TRAPF_USERMODE(tf)); found_interrupt = 0; @@ -2623,7 +2623,7 @@ core2_intr(int cpu, struct trapframe *tf struct core_cpu *cc; pmc_value_t v; - PMCDBG(MDP,INT, 1, "cpu=%d tf=0x%p um=%d", cpu, (void *) tf, + PMCDBG3(MDP,INT, 1, "cpu=%d tf=0x%p um=%d", cpu, (void *) tf, TRAPF_USERMODE(tf)); /* @@ -2635,7 +2635,7 @@ core2_intr(int cpu, struct trapframe *tf intrstatus = rdmsr(IA_GLOBAL_STATUS); intrenable = intrstatus & core_pmcmask; - PMCDBG(MDP,INT, 1, "cpu=%d intrstatus=%jx", cpu, + PMCDBG2(MDP,INT, 1, "cpu=%d intrstatus=%jx", cpu, (uintmax_t) intrstatus); found_interrupt = 0; @@ -2681,7 +2681,7 @@ core2_intr(int cpu, struct trapframe *tf /* Reload sampling count. */ wrmsr(IAF_CTR0 + n, v); - PMCDBG(MDP,INT, 1, "iaf-intr cpu=%d error=%d v=%jx(%jx)", cpu, + PMCDBG4(MDP,INT, 1, "iaf-intr cpu=%d error=%d v=%jx(%jx)", cpu, error, (uintmax_t) v, (uintmax_t) rdpmc(IAF_RI_TO_MSR(n))); } @@ -2706,7 +2706,7 @@ core2_intr(int cpu, struct trapframe *tf v = iap_reload_count_to_perfctr_value(pm->pm_sc.pm_reloadcount); - PMCDBG(MDP,INT, 1, "iap-intr cpu=%d error=%d v=%jx", cpu, error, + PMCDBG3(MDP,INT, 1, "iap-intr cpu=%d error=%d v=%jx", cpu, error, (uintmax_t) v); /* Reload sampling count. */ @@ -2716,14 +2716,14 @@ core2_intr(int cpu, struct trapframe *tf /* * Reenable all non-stalled PMCs. */ - PMCDBG(MDP,INT, 1, "cpu=%d intrenable=%jx", cpu, + PMCDBG2(MDP,INT, 1, "cpu=%d intrenable=%jx", cpu, (uintmax_t) intrenable); cc->pc_globalctrl |= intrenable; wrmsr(IA_GLOBAL_CTRL, cc->pc_globalctrl & IA_GLOBAL_CTRL_MASK); - PMCDBG(MDP,INT, 1, "cpu=%d fixedctrl=%jx globalctrl=%jx status=%jx " + PMCDBG5(MDP,INT, 1, "cpu=%d fixedctrl=%jx globalctrl=%jx status=%jx " "ovf=%jx", cpu, (uintmax_t) rdmsr(IAF_CTRL), (uintmax_t) rdmsr(IA_GLOBAL_CTRL), (uintmax_t) rdmsr(IA_GLOBAL_STATUS), @@ -2750,7 +2750,7 @@ pmc_core_initialize(struct pmc_mdep *md, cpuid[CORE_CPUID_EAX] & 0xFF; core_cputype = md->pmd_cputype; - PMCDBG(MDP,INI,1,"core-init cputype=%d ncpu=%d ipa-version=%d", + PMCDBG3(MDP,INI,1,"core-init cputype=%d ncpu=%d ipa-version=%d", core_cputype, maxcpu, ipa_version); if (ipa_version < 1 || ipa_version > 3 || @@ -2788,7 +2788,7 @@ pmc_core_initialize(struct pmc_mdep *md, core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) << IAF_OFFSET; } - PMCDBG(MDP,INI,1,"core-init pmcmask=0x%jx iafri=%d", core_pmcmask, + PMCDBG2(MDP,INI,1,"core-init pmcmask=0x%jx iafri=%d", core_pmcmask, core_iaf_ri); core_pcpu = malloc(sizeof(*core_pcpu) * maxcpu, M_PMC, @@ -2811,7 +2811,7 @@ pmc_core_initialize(struct pmc_mdep *md, void pmc_core_finalize(struct pmc_mdep *md) { - PMCDBG(MDP,INI,1, "%s", "core-finalize"); + PMCDBG0(MDP,INI,1, "core-finalize"); free(core_pcpu, M_PMC); core_pcpu = NULL; Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Fri May 8 19:17:38 2015 (r282657) +++ head/sys/dev/hwpmc/hwpmc_intel.c Fri May 8 19:40:00 2015 (r282658) @@ -46,14 +46,14 @@ intel_switch_in(struct pmc_cpu *pc, stru { (void) pc; - PMCDBG(MDP,SWI,1, "pc=%p pp=%p enable-msr=%d", pc, pp, + PMCDBG3(MDP,SWI,1, "pc=%p pp=%p enable-msr=%d", pc, pp, pp->pp_flags & PMC_PP_ENABLE_MSR_ACCESS); /* allow the RDPMC instruction if needed */ if (pp->pp_flags & PMC_PP_ENABLE_MSR_ACCESS) load_cr4(rcr4() | CR4_PCE); - PMCDBG(MDP,SWI,1, "cr4=0x%jx", (uintmax_t) rcr4()); + PMCDBG1(MDP,SWI,1, "cr4=0x%jx", (uintmax_t) rcr4()); return 0; } @@ -64,7 +64,7 @@ intel_switch_out(struct pmc_cpu *pc, str (void) pc; (void) pp; /* can be NULL */ - PMCDBG(MDP,SWO,1, "pc=%p pp=%p cr4=0x%jx", pc, pp, + PMCDBG3(MDP,SWO,1, "pc=%p pp=%p cr4=0x%jx", pc, pp, (uintmax_t) rcr4()); /* always turn off the RDPMC instruction */ @@ -83,7 +83,7 @@ pmc_intel_initialize(void) KASSERT(cpu_vendor_id == CPU_VENDOR_INTEL, ("[intel,%d] Initializing non-intel processor", __LINE__)); - PMCDBG(MDP,INI,0, "intel-initialize cpuid=0x%x", cpu_id); + PMCDBG1(MDP,INI,0, "intel-initialize cpuid=0x%x", cpu_id); cputype = -1; nclasses = 2; Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Fri May 8 19:17:38 2015 (r282657) +++ head/sys/dev/hwpmc/hwpmc_logging.c Fri May 8 19:40:00 2015 (r282658) @@ -211,7 +211,7 @@ pmclog_get_buffer(struct pmc_owner *po) TAILQ_REMOVE(&pmc_bufferlist, plb, plb_next); mtx_unlock_spin(&pmc_bufferlist_mtx); - PMCDBG(LOG,GTB,1, "po=%p plb=%p", po, plb); + PMCDBG2(LOG,GTB,1, "po=%p plb=%p", po, plb); #ifdef HWPMC_DEBUG if (plb) @@ -261,7 +261,7 @@ pmclog_loop(void *arg) ownercred = crhold(p->p_ucred); PROC_UNLOCK(p); - PMCDBG(LOG,INI,1, "po=%p kt=%p", po, po->po_kthread); + PMCDBG2(LOG,INI,1, "po=%p kt=%p", po, po->po_kthread); KASSERT(po->po_kthread == curthread->td_proc, ("[pmclog,%d] proc mismatch po=%p po/kt=%p curproc=%p", __LINE__, po, po->po_kthread, curthread->td_proc)); @@ -312,7 +312,7 @@ pmclog_loop(void *arg) mtx_unlock(&pmc_kthread_mtx); /* process the request */ - PMCDBG(LOG,WRI,2, "po=%p base=%p ptr=%p", po, + PMCDBG3(LOG,WRI,2, "po=%p base=%p ptr=%p", po, lb->plb_base, lb->plb_ptr); /* change our thread's credentials before issuing the I/O */ @@ -343,7 +343,7 @@ pmclog_loop(void *arg) po->po_error = error; /* save for flush log */ - PMCDBG(LOG,WRI,2, "po=%p error=%d", po, error); + PMCDBG2(LOG,WRI,2, "po=%p error=%d", po, error); break; } @@ -403,7 +403,7 @@ pmclog_release(struct pmc_owner *po) mtx_unlock_spin(&po->po_mtx); - PMCDBG(LOG,REL,1, "po=%p", po); + PMCDBG1(LOG,REL,1, "po=%p", po); } @@ -423,7 +423,7 @@ pmclog_reserve(struct pmc_owner *po, int uint32_t *lh; struct timespec ts; - PMCDBG(LOG,ALL,1, "po=%p len=%d", po, length); + PMCDBG2(LOG,ALL,1, "po=%p len=%d", po, length); KASSERT(length % sizeof(uint32_t) == 0, ("[pmclog,%d] length not a multiple of word size", __LINE__)); @@ -519,7 +519,7 @@ pmclog_schedule_io(struct pmc_owner *po) ("[pmclog,%d] buffer invariants po=%p ptr=%p fenc=%p", __LINE__, po, po->po_curbuf->plb_ptr, po->po_curbuf->plb_fence)); - PMCDBG(LOG,SIO, 1, "po=%p", po); + PMCDBG1(LOG,SIO, 1, "po=%p", po); mtx_assert(&po->po_mtx, MA_OWNED); @@ -579,7 +579,7 @@ pmclog_configure_log(struct pmc_mdep *md * the former is not held here. */ sx_assert(&pmc_sx, SA_UNLOCKED); - PMCDBG(LOG,CFG,1, "config po=%p logfd=%d", po, logfd); + PMCDBG2(LOG,CFG,1, "config po=%p logfd=%d", po, logfd); p = po->po_owner; @@ -649,7 +649,7 @@ pmclog_deconfigure_log(struct pmc_owner int error; struct pmclog_buffer *lb; - PMCDBG(LOG,CFG,1, "de-config po=%p", po); + PMCDBG1(LOG,CFG,1, "de-config po=%p", po); if ((po->po_flags & PMC_PO_OWNS_LOGFILE) == 0) return (EINVAL); @@ -700,7 +700,7 @@ pmclog_flush(struct pmc_owner *po) int error; struct pmclog_buffer *lb; - PMCDBG(LOG,FLS,1, "po=%p", po); + PMCDBG1(LOG,FLS,1, "po=%p", po); /* * If there is a pending error recorded by the logger thread, @@ -741,7 +741,7 @@ int pmclog_close(struct pmc_owner *po) { - PMCDBG(LOG,CLO,1, "po=%p", po); + PMCDBG1(LOG,CLO,1, "po=%p", po); mtx_lock(&pmc_kthread_mtx); @@ -773,7 +773,7 @@ pmclog_process_callchain(struct pmc *pm, uint32_t flags; struct pmc_owner *po; - PMCDBG(LOG,SAM,1,"pm=%p pid=%d n=%d", pm, ps->ps_pid, + PMCDBG3(LOG,SAM,1,"pm=%p pid=%d n=%d", pm, ps->ps_pid, ps->ps_nsamples); recordlen = offsetof(struct pmclog_callchain, pl_pc) + @@ -843,7 +843,7 @@ pmclog_process_pmcallocate(struct pmc *p po = pm->pm_owner; - PMCDBG(LOG,ALL,1, "pm=%p", pm); + PMCDBG1(LOG,ALL,1, "pm=%p", pm); if (PMC_TO_CLASS(pm) == PMC_CLASS_SOFT) { PMCLOG_RESERVE(po, PMCALLOCATEDYN, @@ -874,7 +874,7 @@ pmclog_process_pmcattach(struct pmc *pm, int pathlen, recordlen; struct pmc_owner *po; - PMCDBG(LOG,ATT,1,"pm=%p pid=%d", pm, pid); + PMCDBG2(LOG,ATT,1,"pm=%p pid=%d", pm, pid); po = pm->pm_owner; @@ -893,7 +893,7 @@ pmclog_process_pmcdetach(struct pmc *pm, { struct pmc_owner *po; - PMCDBG(LOG,ATT,1,"!pm=%p pid=%d", pm, pid); + PMCDBG2(LOG,ATT,1,"!pm=%p pid=%d", pm, pid); po = pm->pm_owner; @@ -915,7 +915,7 @@ pmclog_process_proccsw(struct pmc *pm, s KASSERT(pm->pm_flags & PMC_F_LOG_PROCCSW, ("[pmclog,%d] log-process-csw called gratuitously", __LINE__)); - PMCDBG(LOG,SWO,1,"pm=%p pid=%d v=%jx", pm, pp->pp_proc->p_pid, + PMCDBG3(LOG,SWO,1,"pm=%p pid=%d v=%jx", pm, pp->pp_proc->p_pid, v); po = pm->pm_owner; @@ -933,7 +933,7 @@ pmclog_process_procexec(struct pmc_owner { int pathlen, recordlen; - PMCDBG(LOG,EXC,1,"po=%p pid=%d path=\"%s\"", po, pid, path); + PMCDBG3(LOG,EXC,1,"po=%p pid=%d path=\"%s\"", po, pid, path); pathlen = strlen(path) + 1; /* #bytes for the path */ recordlen = offsetof(struct pmclog_procexec, pl_pathname) + pathlen; @@ -957,7 +957,7 @@ pmclog_process_procexit(struct pmc *pm, struct pmc_owner *po; ri = PMC_TO_ROWINDEX(pm); - PMCDBG(LOG,EXT,1,"pm=%p pid=%d v=%jx", pm, pp->pp_proc->p_pid, + PMCDBG3(LOG,EXT,1,"pm=%p pid=%d v=%jx", pm, pp->pp_proc->p_pid, pp->pp_pmcs[ri].pp_pmcval); po = pm->pm_owner; @@ -1003,7 +1003,7 @@ pmclog_process_userlog(struct pmc_owner { int error; - PMCDBG(LOG,WRI,1, "writelog po=%p ud=0x%x", po, wl->pm_userdata); + PMCDBG2(LOG,WRI,1, "writelog po=%p ud=0x%x", po, wl->pm_userdata); error = 0; Modified: head/sys/dev/hwpmc/hwpmc_mips.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips.c Fri May 8 19:17:38 2015 (r282657) +++ head/sys/dev/hwpmc/hwpmc_mips.c Fri May 8 19:40:00 2015 (r282658) @@ -104,7 +104,7 @@ mips_allocate_pmc(int cpu, int ri, struc pm->pm_md.pm_mips_evsel = config; - PMCDBG(MDP,ALL,2,"mips-allocate ri=%d -> config=0x%x", ri, config); + PMCDBG2(MDP,ALL,2,"mips-allocate ri=%d -> config=0x%x", ri, config); return 0; } @@ -123,7 +123,7 @@ mips_read_pmc(int cpu, int ri, pmc_value pm = mips_pcpu[cpu]->pc_mipspmcs[ri].phw_pmc; tmp = mips_pmcn_read(ri); - PMCDBG(MDP,REA,2,"mips-read id=%d -> %jd", ri, tmp); + PMCDBG2(MDP,REA,2,"mips-read id=%d -> %jd", ri, tmp); if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) *v = tmp - (1UL << (mips_pmc_spec.ps_counter_width - 1)); @@ -148,7 +148,7 @@ mips_write_pmc(int cpu, int ri, pmc_valu if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) v = (1UL << (mips_pmc_spec.ps_counter_width - 1)) - v; - PMCDBG(MDP,WRI,1,"mips-write cpu=%d ri=%d v=%jx", cpu, ri, v); + PMCDBG3(MDP,WRI,1,"mips-write cpu=%d ri=%d v=%jx", cpu, ri, v); mips_pmcn_write(ri, v); @@ -160,7 +160,7 @@ mips_config_pmc(int cpu, int ri, struct { struct pmc_hw *phw; - PMCDBG(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); + PMCDBG3(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[mips,%d] illegal CPU value %d", __LINE__, cpu)); @@ -376,7 +376,7 @@ mips_pcpu_init(struct pmc_mdep *md, int KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[mips,%d] wrong cpu number %d", __LINE__, cpu)); - PMCDBG(MDP,INI,1,"mips-init cpu=%d", cpu); + PMCDBG1(MDP,INI,1,"mips-init cpu=%d", cpu); mips_pcpu[cpu] = pac = malloc(sizeof(struct mips_cpu), M_PMC, M_WAITOK|M_ZERO); @@ -421,7 +421,7 @@ pmc_mips_initialize() */ mips_npmcs = 2; - PMCDBG(MDP,INI,1,"mips-init npmcs=%d", mips_npmcs); + PMCDBG1(MDP,INI,1,"mips-init npmcs=%d", mips_npmcs); /* * Allocate space for pointers to PMC HW descriptors and for Modified: head/sys/dev/hwpmc/hwpmc_mips24k.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips24k.c Fri May 8 19:17:38 2015 (r282657) +++ head/sys/dev/hwpmc/hwpmc_mips24k.c Fri May 8 19:40:00 2015 (r282658) @@ -223,7 +223,7 @@ mips_get_perfctl(int cpu, int ri, uint32 if (caps & PMC_CAP_INTERRUPT) config |= MIPS24K_PMC_INTERRUPT_ENABLE; - PMCDBG(MDP,ALL,2,"mips24k-get_perfctl ri=%d -> config=0x%x", ri, config); + PMCDBG2(MDP,ALL,2,"mips24k-get_perfctl ri=%d -> config=0x%x", ri, config); return (config); } Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Fri May 8 19:17:38 2015 (r282657) +++ head/sys/dev/hwpmc/hwpmc_mod.c Fri May 8 19:40:00 2015 (r282658) @@ -651,12 +651,12 @@ pmc_ri_to_classdep(struct pmc_mdep *md, static void pmc_save_cpu_binding(struct pmc_binding *pb) { - PMCDBG(CPU,BND,2, "%s", "save-cpu"); + PMCDBG0(CPU,BND,2, "save-cpu"); thread_lock(curthread); pb->pb_bound = sched_is_bound(curthread); pb->pb_cpu = curthread->td_oncpu; thread_unlock(curthread); - PMCDBG(CPU,BND,2, "save-cpu cpu=%d", pb->pb_cpu); + PMCDBG1(CPU,BND,2, "save-cpu cpu=%d", pb->pb_cpu); } /* @@ -666,7 +666,7 @@ pmc_save_cpu_binding(struct pmc_binding static void pmc_restore_cpu_binding(struct pmc_binding *pb) { - PMCDBG(CPU,BND,2, "restore-cpu curcpu=%d restore=%d", + PMCDBG2(CPU,BND,2, "restore-cpu curcpu=%d restore=%d", curthread->td_oncpu, pb->pb_cpu); thread_lock(curthread); if (pb->pb_bound) @@ -674,7 +674,7 @@ pmc_restore_cpu_binding(struct pmc_bindi else sched_unbind(curthread); thread_unlock(curthread); - PMCDBG(CPU,BND,2, "%s", "restore-cpu done"); + PMCDBG0(CPU,BND,2, "restore-cpu done"); } /* @@ -691,7 +691,7 @@ pmc_select_cpu(int cpu) KASSERT(pmc_cpu_is_active(cpu), ("[pmc,%d] selecting inactive " "CPU %d", __LINE__, cpu)); - PMCDBG(CPU,SEL,2, "select-cpu cpu=%d", cpu); + PMCDBG1(CPU,SEL,2, "select-cpu cpu=%d", cpu); thread_lock(curthread); sched_bind(curthread, cpu); thread_unlock(curthread); @@ -700,7 +700,7 @@ pmc_select_cpu(int cpu) ("[pmc,%d] CPU not bound [cpu=%d, curr=%d]", __LINE__, cpu, curthread->td_oncpu)); - PMCDBG(CPU,SEL,2, "select-cpu cpu=%d ok", cpu); + PMCDBG1(CPU,SEL,2, "select-cpu cpu=%d ok", cpu); } /* @@ -742,14 +742,14 @@ pmc_remove_owner(struct pmc_owner *po) sx_assert(&pmc_sx, SX_XLOCKED); - PMCDBG(OWN,ORM,1, "remove-owner po=%p", po); + PMCDBG1(OWN,ORM,1, "remove-owner po=%p", po); /* Remove descriptor from the owner hash table */ LIST_REMOVE(po, po_next); /* release all owned PMC descriptors */ LIST_FOREACH_SAFE(pm, &po->po_pmcs, pm_next, tmp) { - PMCDBG(OWN,ORM,2, "pmc=%p", pm); + PMCDBG1(OWN,ORM,2, "pmc=%p", pm); KASSERT(pm->pm_owner == po, ("[pmc,%d] owner %p != po %p", __LINE__, pm->pm_owner, po)); @@ -775,7 +775,7 @@ static void pmc_maybe_remove_owner(struct pmc_owner *po) { - PMCDBG(OWN,OMR,1, "maybe-remove-owner po=%p", po); + PMCDBG1(OWN,OMR,1, "maybe-remove-owner po=%p", po); /* * Remove owner record if @@ -813,7 +813,7 @@ pmc_link_target_process(struct pmc *pm, ri = PMC_TO_ROWINDEX(pm); - PMCDBG(PRC,TLK,1, "link-target pmc=%p ri=%d pmc-process=%p", + PMCDBG3(PRC,TLK,1, "link-target pmc=%p ri=%d pmc-process=%p", pm, ri, pp); #ifdef HWPMC_DEBUG @@ -866,7 +866,7 @@ pmc_unlink_target_process(struct pmc *pm ri = PMC_TO_ROWINDEX(pm); - PMCDBG(PRC,TUL,1, "unlink-target pmc=%p ri=%d pmc-process=%p", + PMCDBG3(PRC,TUL,1, "unlink-target pmc=%p ri=%d pmc-process=%p", pm, ri, pp); KASSERT(pp->pp_pmcs[ri].pp_pmc == pm, @@ -902,7 +902,7 @@ pmc_unlink_target_process(struct pmc *pm kern_psignal(p, SIGIO); PROC_UNLOCK(p); - PMCDBG(PRC,SIG,2, "signalling proc=%p signal=%d", p, + PMCDBG2(PRC,SIG,2, "signalling proc=%p signal=%d", p, SIGIO); } } @@ -975,7 +975,7 @@ pmc_attach_one_process(struct proc *p, s sx_assert(&pmc_sx, SX_XLOCKED); - PMCDBG(PRC,ATT,2, "attach-one pm=%p ri=%d proc=%p (%d, %s)", pm, + PMCDBG5(PRC,ATT,2, "attach-one pm=%p ri=%d proc=%p (%d, %s)", pm, PMC_TO_ROWINDEX(pm), p, p->p_pid, p->p_comm); /* @@ -1040,7 +1040,7 @@ pmc_attach_process(struct proc *p, struc sx_assert(&pmc_sx, SX_XLOCKED); - PMCDBG(PRC,ATT,1, "attach pm=%p ri=%d proc=%p (%d, %s)", pm, + PMCDBG5(PRC,ATT,1, "attach pm=%p ri=%d proc=%p (%d, %s)", pm, PMC_TO_ROWINDEX(pm), p, p->p_pid, p->p_comm); @@ -1107,7 +1107,7 @@ pmc_detach_one_process(struct proc *p, s ri = PMC_TO_ROWINDEX(pm); - PMCDBG(PRC,ATT,2, "detach-one pm=%p ri=%d proc=%p (%d, %s) flags=0x%x", + PMCDBG6(PRC,ATT,2, "detach-one pm=%p ri=%d proc=%p (%d, %s) flags=0x%x", pm, ri, p, p->p_pid, p->p_comm, flags); if ((pp = pmc_find_process_descriptor(p, 0)) == NULL) @@ -1157,7 +1157,7 @@ pmc_detach_process(struct proc *p, struc sx_assert(&pmc_sx, SX_XLOCKED); - PMCDBG(PRC,ATT,1, "detach pm=%p ri=%d proc=%p (%d, %s)", pm, + PMCDBG5(PRC,ATT,1, "detach pm=%p ri=%d proc=%p (%d, %s)", pm, PMC_TO_ROWINDEX(pm), p, p->p_pid, p->p_comm); if ((pm->pm_flags & PMC_F_DESCENDANTS) == 0) @@ -1228,7 +1228,7 @@ pmc_process_csw_in(struct thread *td) cpu = PCPU_GET(cpuid); /* td->td_oncpu is invalid */ - PMCDBG(CSW,SWI,1, "cpu=%d proc=%p (%d, %s) pp=%p", cpu, p, + PMCDBG5(CSW,SWI,1, "cpu=%d proc=%p (%d, %s) pp=%p", cpu, p, p->p_pid, p->p_comm, pp); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -1295,7 +1295,7 @@ pmc_process_csw_in(struct thread *td) mtx_pool_unlock_spin(pmc_mtxpool, pm); } - PMCDBG(CSW,SWI,1,"cpu=%d ri=%d new=%jd", cpu, ri, newvalue); + PMCDBG3(CSW,SWI,1,"cpu=%d ri=%d new=%jd", cpu, ri, newvalue); pcd->pcd_write_pmc(cpu, adjri, newvalue); pcd->pcd_start_pmc(cpu, adjri); @@ -1356,7 +1356,7 @@ pmc_process_csw_out(struct thread *td) cpu = PCPU_GET(cpuid); /* td->td_oncpu is invalid */ - PMCDBG(CSW,SWO,1, "cpu=%d proc=%p (%d, %s) pp=%p", cpu, p, + PMCDBG5(CSW,SWO,1, "cpu=%d proc=%p (%d, %s) pp=%p", cpu, p, p->p_pid, p->p_comm, pp); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -1418,7 +1418,7 @@ pmc_process_csw_out(struct thread *td) tmp = newvalue - PMC_PCPU_SAVED(cpu,ri); - PMCDBG(CSW,SWO,1,"cpu=%d ri=%d tmp=%jd", cpu, ri, + PMCDBG3(CSW,SWO,1,"cpu=%d ri=%d tmp=%jd", cpu, ri, tmp); if (mode == PMC_MODE_TS) { @@ -1575,7 +1575,7 @@ pmc_log_kernel_mappings(struct pmc *pm) */ kmbase = linker_hwpmc_list_objects(); for (km = kmbase; km->pm_file != NULL; km++) { - PMCDBG(LOG,REG,1,"%s %p", (char *) km->pm_file, + PMCDBG2(LOG,REG,1,"%s %p", (char *) km->pm_file, (void *) km->pm_address); pmclog_process_map_in(po, (pid_t) -1, km->pm_address, km->pm_file); @@ -1616,7 +1616,7 @@ pmc_log_process_mappings(struct pmc_owne for (entry = map->header.next; entry != &map->header; entry = entry->next) { if (entry == NULL) { - PMCDBG(LOG,OPS,2, "hwpmc: vm_map entry unexpectedly " + PMCDBG2(LOG,OPS,2, "hwpmc: vm_map entry unexpectedly " "NULL! pid=%d vm_map=%p\n", p->p_pid, map); break; } @@ -1649,7 +1649,7 @@ pmc_log_process_mappings(struct pmc_owne * At this point lobj is the base vm_object and it is locked. */ if (lobj == NULL) { - PMCDBG(LOG,OPS,2, "hwpmc: lobj unexpectedly NULL! pid=%d " + PMCDBG3(LOG,OPS,2, "hwpmc: lobj unexpectedly NULL! pid=%d " "vm_map=%p vm_obj=%p\n", p->p_pid, map, obj); VM_OBJECT_RUNLOCK(obj); continue; @@ -1806,7 +1806,7 @@ static int pmc_hook_handler(struct thread *td, int function, void *arg) { - PMCDBG(MOD,PMH,1, "hook td=%p func=%d \"%s\" arg=%p", td, function, + PMCDBG4(MOD,PMH,1, "hook td=%p func=%d \"%s\" arg=%p", td, function, pmc_hooknames[function], arg); switch (function) @@ -1889,7 +1889,7 @@ pmc_hook_handler(struct thread *td, int free(freepath, M_TEMP); - PMCDBG(PRC,EXC,1, "exec proc=%p (%d, %s) cred-changed=%d", + PMCDBG4(PRC,EXC,1, "exec proc=%p (%d, %s) cred-changed=%d", p, p->p_pid, p->p_comm, pk->pm_credentialschanged); if (pk->pm_credentialschanged == 0) /* no change */ @@ -2034,7 +2034,7 @@ pmc_allocate_owner_descriptor(struct pro TAILQ_INIT(&po->po_logbuffers); mtx_init(&po->po_mtx, "pmc-owner-mtx", "pmc-per-proc", MTX_SPIN); - PMCDBG(OWN,ALL,1, "allocate-owner proc=%p (%d, %s) pmc-owner=%p", + PMCDBG4(OWN,ALL,1, "allocate-owner proc=%p (%d, %s) pmc-owner=%p", p, p->p_pid, p->p_comm, po); return po; @@ -2044,7 +2044,7 @@ static void pmc_destroy_owner_descriptor(struct pmc_owner *po) { - PMCDBG(OWN,REL,1, "destroy-owner po=%p proc=%p (%d, %s)", + PMCDBG4(OWN,REL,1, "destroy-owner po=%p proc=%p (%d, %s)", po, po->po_owner, po->po_owner->p_pid, po->po_owner->p_comm); mtx_destroy(&po->po_mtx); @@ -2135,7 +2135,7 @@ pmc_find_owner_descriptor(struct proc *p if (po->po_owner == p) break; - PMCDBG(OWN,FND,1, "find-owner proc=%p (%d, %s) hindex=0x%x -> " + PMCDBG5(OWN,FND,1, "find-owner proc=%p (%d, %s) hindex=0x%x -> " "pmc-owner=%p", p, p->p_pid, p->p_comm, hindex, po); return po; @@ -2155,7 +2155,7 @@ pmc_allocate_pmc_descriptor(void) pmc = malloc(sizeof(struct pmc), M_PMC, M_WAITOK|M_ZERO); - PMCDBG(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc); + PMCDBG1(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc); return pmc; } @@ -2238,7 +2238,7 @@ pmc_release_pmc_descriptor(struct pmc *p pcd = pmc_ri_to_classdep(md, ri, &adjri); mode = PMC_TO_MODE(pm); - PMCDBG(PMC,REL,1, "release-pmc pmc=%p ri=%d mode=%d", pm, ri, + PMCDBG3(PMC,REL,1, "release-pmc pmc=%p ri=%d mode=%d", pm, ri, mode); /* @@ -2266,14 +2266,14 @@ pmc_release_pmc_descriptor(struct pmc *p KASSERT(phw->phw_pmc == pm, ("[pmc, %d] pmc ptr ri(%d) hw(%p) pm(%p)", __LINE__, ri, phw->phw_pmc, pm)); - PMCDBG(PMC,REL,2, "stopping cpu=%d ri=%d", cpu, ri); + PMCDBG2(PMC,REL,2, "stopping cpu=%d ri=%d", cpu, ri); critical_enter(); pcd->pcd_stop_pmc(cpu, adjri); critical_exit(); } - PMCDBG(PMC,REL,2, "decfg cpu=%d ri=%d", cpu, ri); + PMCDBG2(PMC,REL,2, "decfg cpu=%d ri=%d", cpu, ri); critical_enter(); pcd->pcd_config_pmc(cpu, adjri, NULL); @@ -2329,7 +2329,7 @@ pmc_release_pmc_descriptor(struct pmc *p pp = ptgt->pt_process; pmc_unlink_target_process(pm, pp); /* frees 'ptgt' */ - PMCDBG(PMC,REL,3, "pp->refcnt=%d", pp->pp_refcnt); + PMCDBG1(PMC,REL,3, "pp->refcnt=%d", pp->pp_refcnt); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 8 19:43:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F4EFB14; Fri, 8 May 2015 19:43:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 612B51806; Fri, 8 May 2015 19:43:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t48JheKT063215; Fri, 8 May 2015 19:43:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48Jhc6i063205; Fri, 8 May 2015 19:43:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505081943.t48Jhc6i063205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 8 May 2015 19:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282660 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 19:43:40 -0000 Author: jhb Date: Fri May 8 19:43:37 2015 New Revision: 282660 URL: https://svnweb.freebsd.org/changeset/base/282660 Log: Place VM objects on the object list when created and never remove them. This is ok since objects come from a NOFREE zone and allows objects to be locked while traversing the object list without triggering a LOR. Ensure that objects on the list are marked DEAD while free or stillborn, and that they have a refcount of zero. This required updating most of the pagers to explicitly mark an object as dead when deallocating it. (Only the vnode pager did this previously.) Differential Revision: https://reviews.freebsd.org/D2423 Reviewed by: alc, kib (earlier version) MFC after: 2 weeks Sponsored by: Norse Corp, Inc. Modified: head/sys/vm/default_pager.c head/sys/vm/device_pager.c head/sys/vm/phys_pager.c head/sys/vm/sg_pager.c head/sys/vm/swap_pager.c head/sys/vm/vm_meter.c head/sys/vm/vm_object.c Modified: head/sys/vm/default_pager.c ============================================================================== --- head/sys/vm/default_pager.c Fri May 8 19:41:04 2015 (r282659) +++ head/sys/vm/default_pager.c Fri May 8 19:43:37 2015 (r282660) @@ -113,6 +113,7 @@ default_pager_dealloc(object) /* * OBJT_DEFAULT objects have no special resources allocated to them. */ + object->type = OBJT_DEAD; } /* Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Fri May 8 19:41:04 2015 (r282659) +++ head/sys/vm/device_pager.c Fri May 8 19:43:37 2015 (r282660) @@ -254,6 +254,8 @@ dev_pager_dealloc(object) != NULL) dev_pager_free_page(object, m); } + object->handle = NULL; + object->type = OBJT_DEAD; } static int Modified: head/sys/vm/phys_pager.c ============================================================================== --- head/sys/vm/phys_pager.c Fri May 8 19:41:04 2015 (r282659) +++ head/sys/vm/phys_pager.c Fri May 8 19:43:37 2015 (r282660) @@ -131,6 +131,8 @@ phys_pager_dealloc(vm_object_t object) mtx_unlock(&phys_pager_mtx); VM_OBJECT_WLOCK(object); } + object->handle = NULL; + object->type = OBJT_DEAD; } /* Modified: head/sys/vm/sg_pager.c ============================================================================== --- head/sys/vm/sg_pager.c Fri May 8 19:41:04 2015 (r282659) +++ head/sys/vm/sg_pager.c Fri May 8 19:43:37 2015 (r282660) @@ -130,6 +130,8 @@ sg_pager_dealloc(vm_object_t object) sg = object->handle; sglist_free(sg); + object->handle = NULL; + object->type = OBJT_DEAD; } static int Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri May 8 19:41:04 2015 (r282659) +++ head/sys/vm/swap_pager.c Fri May 8 19:43:37 2015 (r282660) @@ -697,6 +697,8 @@ swap_pager_dealloc(vm_object_t object) * if paging is still in progress on some objects. */ swp_pager_meta_free_all(object); + object->handle = NULL; + object->type = OBJT_DEAD; } /************************************************************************ Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Fri May 8 19:41:04 2015 (r282659) +++ head/sys/vm/vm_meter.c Fri May 8 19:43:37 2015 (r282660) @@ -111,14 +111,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) */ mtx_lock(&vm_object_list_mtx); TAILQ_FOREACH(object, &vm_object_list, object_list) { - if (!VM_OBJECT_TRYWLOCK(object)) { - /* - * Avoid a lock-order reversal. Consequently, - * the reported number of active pages may be - * greater than the actual number. - */ - continue; - } + VM_OBJECT_WLOCK(object); vm_object_clear_flag(object, OBJ_ACTIVE); VM_OBJECT_WUNLOCK(object); } @@ -196,10 +189,9 @@ vmtotal(SYSCTL_HANDLER_ARGS) mtx_lock(&vm_object_list_mtx); TAILQ_FOREACH(object, &vm_object_list, object_list) { /* - * Perform unsynchronized reads on the object to avoid - * a lock-order reversal. In this case, the lack of - * synchronization should not impair the accuracy of - * the reported statistics. + * Perform unsynchronized reads on the object. In + * this case, the lack of synchronization should not + * impair the accuracy of the reported statistics. */ if ((object->flags & OBJ_FICTITIOUS) != 0) { /* Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri May 8 19:41:04 2015 (r282659) +++ head/sys/vm/vm_object.c Fri May 8 19:43:37 2015 (r282660) @@ -166,6 +166,8 @@ vm_object_zdtor(void *mem, int size, voi vm_object_t object; object = (vm_object_t)mem; + KASSERT(object->ref_count == 0, + ("object %p ref_count = %d", object, object->ref_count)); KASSERT(TAILQ_EMPTY(&object->memq), ("object %p has resident pages in its memq", object)); KASSERT(vm_radix_is_empty(&object->rtree), @@ -187,6 +189,9 @@ vm_object_zdtor(void *mem, int size, voi KASSERT(object->shadow_count == 0, ("object %p shadow_count = %d", object, object->shadow_count)); + KASSERT(object->type == OBJT_DEAD, + ("object %p has non-dead type %d", + object, object->type)); } #endif @@ -199,6 +204,8 @@ vm_object_zinit(void *mem, int size, int rw_init_flags(&object->lock, "vm object", RW_DUPOK | RW_NEW); /* These are true for any object that has been freed */ + object->type = OBJT_DEAD; + object->ref_count = 0; object->rtree.rt_root = 0; object->rtree.rt_flags = 0; object->paging_in_progress = 0; @@ -206,6 +213,10 @@ vm_object_zinit(void *mem, int size, int object->shadow_count = 0; object->cache.rt_root = 0; object->cache.rt_flags = 0; + + mtx_lock(&vm_object_list_mtx); + TAILQ_INSERT_TAIL(&vm_object_list, object, object_list); + mtx_unlock(&vm_object_list_mtx); return (0); } @@ -252,10 +263,6 @@ _vm_object_allocate(objtype_t type, vm_p #if VM_NRESERVLEVEL > 0 LIST_INIT(&object->rvq); #endif - - mtx_lock(&vm_object_list_mtx); - TAILQ_INSERT_TAIL(&vm_object_list, object, object_list); - mtx_unlock(&vm_object_list_mtx); } /* @@ -671,19 +678,9 @@ vm_object_destroy(vm_object_t object) { /* - * Remove the object from the global object list. - */ - mtx_lock(&vm_object_list_mtx); - TAILQ_REMOVE(&vm_object_list, object, object_list); - mtx_unlock(&vm_object_list_mtx); - - /* * Release the allocation charge. */ if (object->cred != NULL) { - KASSERT(object->type == OBJT_DEFAULT || - object->type == OBJT_SWAP, - ("%s: non-swap obj %p has cred", __func__, object)); swap_release_by_cred(object->charge, object->cred); object->charge = 0; crfree(object->cred); @@ -788,6 +785,10 @@ vm_object_terminate(vm_object_t object) if (__predict_false(!vm_object_cache_is_empty(object))) vm_page_cache_free(object, 0, 0); + KASSERT(object->cred == NULL || object->type == OBJT_DEFAULT || + object->type == OBJT_SWAP, + ("%s: non-swap obj %p has cred", __func__, object)); + /* * Let the pager know object is dead. */ @@ -1803,6 +1804,8 @@ vm_object_collapse(vm_object_t object) KASSERT(backing_object->ref_count == 1, ( "backing_object %p was somehow re-referenced during collapse!", backing_object)); + backing_object->type = OBJT_DEAD; + backing_object->ref_count = 0; VM_OBJECT_WUNLOCK(backing_object); vm_object_destroy(backing_object); From owner-svn-src-head@FreeBSD.ORG Fri May 8 19:43:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A939DC5B; Fri, 8 May 2015 19:43: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 985871811; Fri, 8 May 2015 19:43: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 t48JhspS063294; Fri, 8 May 2015 19:43:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48Jhsg6063293; Fri, 8 May 2015 19:43:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505081943.t48Jhsg6063293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 8 May 2015 19:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282661 - head/sys/boot/arm/uboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 19:43:54 -0000 Author: ian Date: Fri May 8 19:43:53 2015 New Revision: 282661 URL: https://svnweb.freebsd.org/changeset/base/282661 Log: Move the text section to the start of the output file, so that when you create a stripped .bin file from it the entry point is the first byte of the file. (Will allow "load $addr $file ; go $addr" in u-boot.) Modified: head/sys/boot/arm/uboot/ldscript.arm Modified: head/sys/boot/arm/uboot/ldscript.arm ============================================================================== --- head/sys/boot/arm/uboot/ldscript.arm Fri May 8 19:43:37 2015 (r282660) +++ head/sys/boot/arm/uboot/ldscript.arm Fri May 8 19:43:53 2015 (r282661) @@ -6,6 +6,15 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = UBLDR_LOADADDR + SIZEOF_HEADERS; + .text : + { + *(.text) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0 + _etext = .; + PROVIDE (etext = .); .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } @@ -32,15 +41,6 @@ SECTIONS .rela.sbss : { *(.rela.sbss) } .rela.sdata2 : { *(.rela.sdata2) } .rela.sbss2 : { *(.rela.sbss2) } - .text : - { - *(.text) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - } =0 - _etext = .; - PROVIDE (etext = .); .init : { *(.init) } =0 .fini : { *(.fini) } =0 .rodata : { *(.rodata) *(.gnu.linkonce.r*) } From owner-svn-src-head@FreeBSD.ORG Fri May 8 21:51:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF2ADEE3; Fri, 8 May 2015 21:51: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 DDEB8172A; Fri, 8 May 2015 21:51: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 t48Lpbuj029805; Fri, 8 May 2015 21:51:37 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48LpbP8029804; Fri, 8 May 2015 21:51:37 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505082151.t48LpbP8029804@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 8 May 2015 21:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282668 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 21:51:38 -0000 Author: loos Date: Fri May 8 21:51:37 2015 New Revision: 282668 URL: https://svnweb.freebsd.org/changeset/base/282668 Log: Replace spaces with tabs, removes an extra blank line. No functional changes. Modified: head/sys/dev/iicbus/iicbus.c Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Fri May 8 21:46:53 2015 (r282667) +++ head/sys/dev/iicbus/iicbus.c Fri May 8 21:51:37 2015 (r282668) @@ -291,14 +291,14 @@ iicbus_get_frequency(device_t dev, u_cha } static device_method_t iicbus_methods[] = { - /* device interface */ - DEVMETHOD(device_probe, iicbus_probe), - DEVMETHOD(device_attach, iicbus_attach), - DEVMETHOD(device_detach, iicbus_detach), - - /* bus interface */ - DEVMETHOD(bus_add_child, iicbus_add_child), - DEVMETHOD(bus_print_child, iicbus_print_child), + /* device interface */ + DEVMETHOD(device_probe, iicbus_probe), + DEVMETHOD(device_attach, iicbus_attach), + DEVMETHOD(device_detach, iicbus_detach), + + /* bus interface */ + DEVMETHOD(bus_add_child, iicbus_add_child), + DEVMETHOD(bus_print_child, iicbus_print_child), DEVMETHOD(bus_probe_nomatch, iicbus_probe_nomatch), DEVMETHOD(bus_read_ivar, iicbus_read_ivar), DEVMETHOD(bus_child_pnpinfo_str, iicbus_child_pnpinfo_str), @@ -322,4 +322,3 @@ devclass_t iicbus_devclass; MODULE_VERSION(iicbus, IICBUS_MODVER); DRIVER_MODULE(iicbus, iichb, iicbus_driver, iicbus_devclass, 0, 0); - From owner-svn-src-head@FreeBSD.ORG Fri May 8 22:11:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0ED93231; Fri, 8 May 2015 22:11:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1786195C; Fri, 8 May 2015 22:11: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 t48MBsLq040286; Fri, 8 May 2015 22:11:54 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48MBsKF040284; Fri, 8 May 2015 22:11:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505082211.t48MBsKF040284@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 8 May 2015 22:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282669 - head/usr.bin/col X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 22:11:55 -0000 Author: bapt Date: Fri May 8 22:11:54 2015 New Revision: 282669 URL: https://svnweb.freebsd.org/changeset/base/282669 Log: Fix about ten integer overflows and underflows and a handful of logic errors in line number handling. Submitted by: ingo at OpenBSD Discussed with: ingo at OpenBSD Obtained from: OpenBSD Modified: head/usr.bin/col/col.c Modified: head/usr.bin/col/col.c ============================================================================== --- head/usr.bin/col/col.c Fri May 8 21:51:37 2015 (r282668) +++ head/usr.bin/col/col.c Fri May 8 22:11:54 2015 (r282669) @@ -96,6 +96,7 @@ struct line_str { int l_max_col; /* max column in the line */ }; +static void addto_lineno(int *, int); static LINE *alloc_line(void); static void dowarn(int); static void flush_line(LINE *); @@ -108,7 +109,7 @@ static CSET last_set; /* char_set of la static LINE *lines; static int compress_spaces; /* if doing space -> tab conversion */ static int fine; /* if `fine' resolution (half lines) */ -static int max_bufd_lines; /* max # lines to keep in memory */ +static int max_bufd_lines; /* max # of half lines to keep in memory */ static int nblank_lines; /* # blanks after last flushed line */ static int no_backspaces; /* if not to output any backspaces */ static int pass_unknown_seqs; /* pass unknown control sequences */ @@ -133,6 +134,7 @@ main(int argc, char **argv) int this_line; /* line l points to */ int nflushd_lines; /* number of lines that were flushed */ int adjust, opt, warned, width; + const char *errstr; cap_rights_t rights; unsigned long cmd; @@ -151,7 +153,7 @@ main(int argc, char **argv) if (cap_enter() < 0 && errno != ENOSYS) err(1, "unable to enter capability mode"); - max_bufd_lines = 128; + max_bufd_lines = 256; compress_spaces = 1; /* compress spaces into tabs */ while ((opt = getopt(argc, argv, "bfhl:px")) != -1) switch (opt) { @@ -165,8 +167,11 @@ main(int argc, char **argv) compress_spaces = 1; break; case 'l': /* buffered line count */ - if ((max_bufd_lines = atoi(optarg)) <= 0) - errx(1, "bad -l argument %s", optarg); + max_bufd_lines = strtonum(optarg, 1, + (INT_MAX - BUFFER_MARGIN) / 2, &errstr) * 2; + if (errstr != NULL) + errx(1, "bad -l argument, %s: %s", errstr, + optarg); break; case 'p': /* pass unknown control sequences */ pass_unknown_seqs = 1; @@ -182,9 +187,6 @@ main(int argc, char **argv) if (optind != argc) usage(); - /* this value is in half lines */ - max_bufd_lines *= 2; - adjust = cur_col = extra_lines = warned = 0; cur_line = max_line = nflushd_lines = this_line = 0; cur_set = last_set = CS_NORMAL; @@ -204,19 +206,19 @@ main(int argc, char **argv) case ESC: /* just ignore EOF */ switch(getwchar()) { case RLF: - cur_line -= 2; + addto_lineno(&cur_line, -2); break; case RHLF: - cur_line--; + addto_lineno(&cur_line, -1); break; case FHLF: - cur_line++; + addto_lineno(&cur_line, 1); if (cur_line > max_line) max_line = cur_line; } continue; case NL: - cur_line += 2; + addto_lineno(&cur_line, 2); if (cur_line > max_line) max_line = cur_line; cur_col = 0; @@ -235,7 +237,7 @@ main(int argc, char **argv) ++cur_col; continue; case VT: - cur_line -= 2; + addto_lineno(&cur_line, -2); continue; } if (iswspace(ch)) { @@ -248,58 +250,61 @@ main(int argc, char **argv) } /* Must stuff ch in a line - are we at the right one? */ - if (cur_line != this_line - adjust) { + if (cur_line + adjust != this_line) { LINE *lnew; - int nmove; - adjust = 0; - nmove = cur_line - this_line; - if (!fine) { - /* round up to next line */ - if (cur_line & 1) { - adjust = 1; - nmove++; - } - } - if (nmove < 0) { - for (; nmove < 0 && l->l_prev; nmove++) + /* round up to next line */ + adjust = !fine && (cur_line & 1); + + if (cur_line + adjust < this_line) { + while (cur_line + adjust < this_line && + l->l_prev != NULL) { l = l->l_prev; - if (nmove) { + this_line--; + } + if (cur_line + adjust < this_line) { if (nflushd_lines == 0) { /* * Allow backup past first * line if nothing has been * flushed yet. */ - for (; nmove < 0; nmove++) { + while (cur_line + adjust + < this_line) { lnew = alloc_line(); l->l_prev = lnew; lnew->l_next = l; l = lines = lnew; extra_lines++; + this_line--; } } else { if (!warned++) dowarn(cur_line); - cur_line -= nmove; + cur_line = this_line - adjust; } } } else { /* may need to allocate here */ - for (; nmove > 0 && l->l_next; nmove--) + while (cur_line + adjust > this_line) { + if (l->l_next == NULL) { + l->l_next = alloc_line(); + l->l_next->l_prev = l; + } l = l->l_next; - for (; nmove > 0; nmove--) { - lnew = alloc_line(); - lnew->l_prev = l; - l->l_next = lnew; - l = lnew; + this_line++; } } - this_line = cur_line + adjust; - nmove = this_line - nflushd_lines; - if (nmove >= max_bufd_lines + BUFFER_MARGIN) { - nflushd_lines += nmove - max_bufd_lines; - flush_lines(nmove - max_bufd_lines); + if (this_line > nflushd_lines && + this_line - nflushd_lines >= + max_bufd_lines + BUFFER_MARGIN) { + if (extra_lines) { + flush_lines(extra_lines); + extra_lines = 0; + } + flush_lines(this_line - nflushd_lines - + max_bufd_lines); + nflushd_lines = this_line - max_bufd_lines; } } /* grow line's buffer? */ @@ -330,25 +335,23 @@ main(int argc, char **argv) } if (ferror(stdin)) err(1, NULL); - if (max_line == 0) - exit(0); /* no lines, so just exit */ + if (extra_lines) + flush_lines(extra_lines); /* goto the last line that had a character on it */ for (; l->l_next; l = l->l_next) this_line++; - flush_lines(this_line - nflushd_lines + extra_lines + 1); + flush_lines(this_line - nflushd_lines + 1); /* make sure we leave things in a sane state */ if (last_set != CS_NORMAL) PUTC(SI); /* flush out the last few blank lines */ - nblank_lines = max_line - this_line; + if (max_line > this_line) + nblank_lines = max_line - this_line; if (max_line & 1) nblank_lines++; - else if (!nblank_lines) - /* missing a \n on the last line? */ - nblank_lines = 2; flush_blanks(); exit(0); } @@ -365,7 +368,8 @@ flush_lines(int nflush) flush_blanks(); flush_line(l); } - nblank_lines++; + if (l->l_line || l->l_next) + nblank_lines++; if (l->l_line) (void)free(l->l_line); free_line(l); @@ -517,6 +521,23 @@ flush_line(LINE *l) } } +/* + * Increment or decrement a line number, checking for overflow. + * Stop one below INT_MAX such that the adjust variable is safe. + */ +void +addto_lineno(int *lno, int offset) +{ + if (offset > 0) { + if (*lno >= INT_MAX - offset) + errx(1, "too many lines"); + } else { + if (*lno < INT_MIN - offset) + errx(1, "too many reverse line feeds"); + } + *lno += offset; +} + #define NALLOC 64 static LINE *line_freelist; From owner-svn-src-head@FreeBSD.ORG Fri May 8 22:34:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CDA4587; Fri, 8 May 2015 22:34:30 +0000 (UTC) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 307631B8B; Fri, 8 May 2015 22:34:30 +0000 (UTC) Received: by wiun10 with SMTP id n10so41986766wiu.1; Fri, 08 May 2015 15:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=U6xrMCiwFSsTn7WbMpwk5A/Cjv7tTDnmA0Br4dvTIG8=; b=KCJXxgdO46bSyyvqxyr6QnLyPakUjg6GRyh5xuq6TfN8KhKTFTlRWRfBiMy/8OFXwH UOla2I0sidPRRAv81WjTEp2r4Rmz382yNpDh0UYzan+DiLMIdPQhS97c8wGpcU4/sx6p YpQK6vTBhq4lD9iIRhNrCSBEhAiViKKsTypbRAwqDz2c4S7bciHTaBX/LT7iYGEFcEPK eB0afXkp3U3AR6BMilZl3wvJ3SVmmE12qTPx0LNLhuhWmLb4M0ix777CDFfRA8do1vwp QFny/iBidctCGv08I4ThX4SnW6laPO5XoOLsOX9/0kfCuAtSehpX9Q+Z0H+0lVRa4Sey Feqg== X-Received: by 10.180.12.228 with SMTP id b4mr1675468wic.92.1431124468514; Fri, 08 May 2015 15:34:28 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id g8sm10363270wjn.18.2015.05.08.15.34.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 May 2015 15:34:24 -0700 (PDT) Sender: Baptiste Daroussin Date: Sat, 9 May 2015 00:34:22 +0200 From: Baptiste Daroussin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282669 - head/usr.bin/col Message-ID: <20150508223422.GD54347@ivaldir.etoilebsd.net> References: <201505082211.t48MBsKF040284@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FFoLq8A0u+X9iRU8" Content-Disposition: inline In-Reply-To: <201505082211.t48MBsKF040284@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 22:34:30 -0000 --FFoLq8A0u+X9iRU8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 08, 2015 at 10:11:54PM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Fri May 8 22:11:54 2015 > New Revision: 282669 > URL: https://svnweb.freebsd.org/changeset/base/282669 >=20 > Log: > Fix about ten integer overflows and underflows and a handful of logic > errors in line number handling. > =20 > Submitted by: ingo at OpenBSD > Discussed with: ingo at OpenBSD Everyone should have read schwarze at OpenBSD Best regards, Bapt --FFoLq8A0u+X9iRU8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVNOe4ACgkQ8kTtMUmk6ExmaQCeOd6tmRATDuxyXF9dTqnjOzYp UfMAoKVDXhW2kosMZZ8/8ClvDjHc2Ibg =aZTk -----END PGP SIGNATURE----- --FFoLq8A0u+X9iRU8-- From owner-svn-src-head@FreeBSD.ORG Fri May 8 23:36:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 714E5E07; Fri, 8 May 2015 23:36: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 5FA761170; Fri, 8 May 2015 23:36: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 t48NaW8k080409; Fri, 8 May 2015 23:36:32 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48NaWRS080408; Fri, 8 May 2015 23:36:32 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201505082336.t48NaWRS080408@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 8 May 2015 23:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282672 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 23:36:32 -0000 Author: delphij Date: Fri May 8 23:36:31 2015 New Revision: 282672 URL: https://svnweb.freebsd.org/changeset/base/282672 Log: Always convert uuid to lower case. MFC after: 2 weeks Modified: head/etc/rc.d/hostid Modified: head/etc/rc.d/hostid ============================================================================== --- head/etc/rc.d/hostid Fri May 8 23:29:42 2015 (r282671) +++ head/etc/rc.d/hostid Fri May 8 23:36:31 2015 (r282672) @@ -58,7 +58,7 @@ hostid_set() valid_hostid() { - uuid=$1 + uuid=$(echo $1 | tr '[:upper:]' '[:lower:]') x="[0-9a-f]" y=$x$x$x$x From owner-svn-src-head@FreeBSD.ORG Sat May 9 00:48:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87A5558A; Sat, 9 May 2015 00:48:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 741EB1804; Sat, 9 May 2015 00:48:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t490mjrQ015989; Sat, 9 May 2015 00:48:45 GMT (envelope-from stas@FreeBSD.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t490mjjn015988; Sat, 9 May 2015 00:48:45 GMT (envelope-from stas@FreeBSD.org) Message-Id: <201505090048.t490mjjn015988@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: stas set sender to stas@FreeBSD.org using -f From: Stanislav Sedov Date: Sat, 9 May 2015 00:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282673 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 00:48:45 -0000 Author: stas Date: Sat May 9 00:48:44 2015 New Revision: 282673 URL: https://svnweb.freebsd.org/changeset/base/282673 Log: Fix the double space in comment. While here, change the comment style to match the rest of the file. Modified: head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Fri May 8 23:36:31 2015 (r282672) +++ head/usr.sbin/pmcstat/pmcstat_log.c Sat May 9 00:48:44 2015 (r282673) @@ -1531,7 +1531,9 @@ pmcstat_analyze_log(void) free(ppm); } - /* associate this process image */ + /* + * Associate this process image. + */ image_path = pmcstat_string_intern( ev.pl_u.pl_x.pl_pathname); assert(image_path != NULL); From owner-svn-src-head@FreeBSD.ORG Sat May 9 02:40:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EF59BC7; Sat, 9 May 2015 02:40:05 +0000 (UTC) Received: from mail-qg0-x229.google.com (mail-qg0-x229.google.com [IPv6:2607:f8b0:400d:c04::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BCBF11E5; Sat, 9 May 2015 02:40:05 +0000 (UTC) Received: by qgej70 with SMTP id j70so45220974qge.2; Fri, 08 May 2015 19:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9vO7df5oNdrcQpj8ROyyU+9EWPBi9IAycqRWukx5FfY=; b=gyAKYMSC14rNKwvbOU+JaXd0WMipRSaCxbBYyACybEQ+Qro92TbvSXST+rZmrxqEUu y3VPqahh7P9tgJKp7Nw7Jj1fH99VTZp/YBGIoUK8xNkBGywWGsrZhphtba3xCd7j82dW U7pxveuZjHG3kiaraxzwZ8b437m3KI2UcOgJUbv9ZqBxymieeMWGt22/iOSF/WLTUaEV RNpPPT898sG85gtMBsp9j02B47rGKLtW2bZjCONDhv3Y6CXa0nDtW7WMsUlOBa5W0AKC Lq9vBfYuTn6irUnGgvJJXI1y0oLFbNsEG9UaH7vDylQGe1LnpWKVHgEVcmpXdyYN6QhI FsLA== MIME-Version: 1.0 X-Received: by 10.140.19.111 with SMTP id 102mr1122181qgg.83.1431139203371; Fri, 08 May 2015 19:40:03 -0700 (PDT) Received: by 10.140.98.66 with HTTP; Fri, 8 May 2015 19:40:03 -0700 (PDT) In-Reply-To: <201505090048.t490mjjn015988@svn.freebsd.org> References: <201505090048.t490mjjn015988@svn.freebsd.org> Date: Fri, 8 May 2015 19:40:03 -0700 Message-ID: Subject: Re: svn commit: r282673 - head/usr.sbin/pmcstat From: NGie Cooper To: Stanislav Sedov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 02:40:05 -0000 On Fri, May 8, 2015 at 5:48 PM, Stanislav Sedov wrote: > Author: stas > Date: Sat May 9 00:48:44 2015 > New Revision: 282673 > URL: https://svnweb.freebsd.org/changeset/base/282673 > > Log: > Fix the double space in comment. > > While here, change the comment style to match the rest of the file. Too bad the rest of the file isn't style(9) friendly :/.. From owner-svn-src-head@FreeBSD.ORG Sat May 9 03:05:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 195B4264; Sat, 9 May 2015 03:05:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06B3715FA; Sat, 9 May 2015 03:05:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4935j4h086986; Sat, 9 May 2015 03:05:45 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4935jYk086983; Sat, 9 May 2015 03:05:45 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505090305.t4935jYk086983@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 9 May 2015 03:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282674 - in head/sys/dev: iicbus ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 03:05:46 -0000 Author: loos Date: Sat May 9 03:05:44 2015 New Revision: 282674 URL: https://svnweb.freebsd.org/changeset/base/282674 Log: Handle IRQ resources on iicbus and ofw_iicbus. Based on a patch submitted by Michal Meloun . Modified: head/sys/dev/iicbus/iicbus.c head/sys/dev/iicbus/iicbus.h head/sys/dev/ofw/ofw_iicbus.c Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Sat May 9 00:48:44 2015 (r282673) +++ head/sys/dev/iicbus/iicbus.c Sat May 9 03:05:44 2015 (r282674) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -147,6 +148,7 @@ iicbus_print_child(device_t dev, device_ retval += bus_print_child_header(dev, child); if (devi->addr != 0) retval += printf(" at addr %#x", devi->addr); + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); retval += bus_print_child_footer(dev, child); return (retval); @@ -157,9 +159,9 @@ iicbus_probe_nomatch(device_t bus, devic { struct iicbus_ivar *devi = IICBUS_IVAR(child); - device_printf(bus, ""); - printf(" at addr %#x\n", devi->addr); - return; + device_printf(bus, " at addr %#x", devi->addr); + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); + printf("\n"); } static int @@ -209,6 +211,7 @@ iicbus_add_child(device_t dev, u_int ord device_delete_child(dev, child); return (0); } + resource_list_init(&devi->rl); device_set_ivars(child, devi); return (child); } @@ -217,11 +220,77 @@ static void iicbus_hinted_child(device_t bus, const char *dname, int dunit) { device_t child; + int irq; struct iicbus_ivar *devi; child = BUS_ADD_CHILD(bus, 0, dname, dunit); devi = IICBUS_IVAR(child); resource_int_value(dname, dunit, "addr", &devi->addr); + if (resource_int_value(dname, dunit, "irq", &irq) == 0) { + if (bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1) != 0) + device_printf(bus, + "warning: bus_set_resource() failed\n"); + } +} + +static int +iicbus_set_resource(device_t dev, device_t child, int type, int rid, + u_long start, u_long count) +{ + struct iicbus_ivar *devi; + struct resource_list_entry *rle; + + devi = IICBUS_IVAR(child); + rle = resource_list_add(&devi->rl, type, rid, start, + start + count - 1, count); + if (rle == NULL) + return (ENXIO); + + return (0); +} + +static struct resource * +iicbus_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct resource_list *rl; + struct resource_list_entry *rle; + + /* Only IRQ resources are supported. */ + if (type != SYS_RES_IRQ) + return (NULL); + + /* + * Request for the default allocation with a given rid: use resource + * list stored in the local device info. + */ + if ((start == 0UL) && (end == ~0UL)) { + rl = BUS_GET_RESOURCE_LIST(bus, child); + if (rl == NULL) + return (NULL); + rle = resource_list_find(rl, type, *rid); + if (rle == NULL) { + if (bootverbose) + device_printf(bus, "no default resources for " + "rid = %d, type = %d\n", *rid, type); + return (NULL); + } + start = rle->start; + end = rle->end; + count = rle->count; + } + + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, + count, flags)); +} + +static struct resource_list * +iicbus_get_resource_list(device_t bus __unused, device_t child) +{ + struct iicbus_ivar *devi; + + devi = IICBUS_IVAR(child); + return (&devi->rl); } int @@ -297,6 +366,16 @@ static device_method_t iicbus_methods[] DEVMETHOD(device_detach, iicbus_detach), /* bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_alloc_resource, iicbus_alloc_resource), + DEVMETHOD(bus_get_resource_list, iicbus_get_resource_list), + DEVMETHOD(bus_set_resource, iicbus_set_resource), DEVMETHOD(bus_add_child, iicbus_add_child), DEVMETHOD(bus_print_child, iicbus_print_child), DEVMETHOD(bus_probe_nomatch, iicbus_probe_nomatch), Modified: head/sys/dev/iicbus/iicbus.h ============================================================================== --- head/sys/dev/iicbus/iicbus.h Sat May 9 00:48:44 2015 (r282673) +++ head/sys/dev/iicbus/iicbus.h Sat May 9 03:05:44 2015 (r282674) @@ -50,6 +50,7 @@ struct iicbus_softc struct iicbus_ivar { uint32_t addr; + struct resource_list rl; bool nostop; }; Modified: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- head/sys/dev/ofw/ofw_iicbus.c Sat May 9 00:48:44 2015 (r282673) +++ head/sys/dev/ofw/ofw_iicbus.c Sat May 9 03:05:44 2015 (r282674) @@ -50,6 +50,8 @@ static device_t ofw_iicbus_add_child(dev const char *name, int unit); static const struct ofw_bus_devinfo *ofw_iicbus_get_devinfo(device_t bus, device_t dev); +static struct resource_list *ofw_iicbus_get_resource_list(device_t bus, + device_t child); static device_method_t ofw_iicbus_methods[] = { /* Device interface */ @@ -57,6 +59,7 @@ static device_method_t ofw_iicbus_method DEVMETHOD(device_attach, ofw_iicbus_attach), /* Bus interface */ + DEVMETHOD(bus_get_resource_list, ofw_iicbus_get_resource_list), DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), DEVMETHOD(bus_add_child, ofw_iicbus_add_child), @@ -72,7 +75,7 @@ static device_method_t ofw_iicbus_method }; struct ofw_iicbus_devinfo { - struct iicbus_ivar opd_dinfo; + struct iicbus_ivar opd_dinfo; /* Must be the first. */ struct ofw_bus_devinfo opd_obdinfo; }; @@ -153,7 +156,10 @@ ofw_iicbus_attach(device_t dev) free(dinfo, M_DEVBUF); continue; } + childdev = device_add_child(dev, NULL, -1); + resource_list_init(&dinfo->opd_dinfo.rl); + ofw_bus_intr_to_rl(childdev, child, &dinfo->opd_dinfo.rl); device_set_ivars(childdev, dinfo); } @@ -199,3 +205,12 @@ ofw_iicbus_get_devinfo(device_t bus, dev dinfo = device_get_ivars(dev); return (&dinfo->opd_obdinfo); } + +static struct resource_list * +ofw_iicbus_get_resource_list(device_t bus __unused, device_t child) +{ + struct ofw_iicbus_devinfo *devi; + + devi = device_get_ivars(child); + return (&devi->opd_dinfo.rl); +} From owner-svn-src-head@FreeBSD.ORG Sat May 9 03:26:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3802D4D3; Sat, 9 May 2015 03:26:37 +0000 (UTC) Received: from mx0.deglitch.com (unknown [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id E9A8717B6; Sat, 9 May 2015 03:26:36 +0000 (UTC) Received: from dhcp-250-37.sj.pi-coral.com (unknown [12.218.212.178]) by mx0.deglitch.com (Postfix) with ESMTPSA id ED9678FC27; Sat, 9 May 2015 07:26:21 +0400 (MSK) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r282673 - head/usr.sbin/pmcstat From: Stanislav Sedov In-Reply-To: Date: Fri, 8 May 2015 20:26:16 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: <86C6A758-B444-4939-8464-10EC1B00C697@freebsd.org> References: <201505090048.t490mjjn015988@svn.freebsd.org> To: NGie Cooper X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 03:26:37 -0000 > On May 8, 2015, at 7:40 PM, NGie Cooper wrote: > > On Fri, May 8, 2015 at 5:48 PM, Stanislav Sedov wrote: >> Author: stas >> Date: Sat May 9 00:48:44 2015 >> New Revision: 282673 >> URL: https://svnweb.freebsd.org/changeset/base/282673 >> >> Log: >> Fix the double space in comment. >> >> While here, change the comment style to match the rest of the file. > > Too bad the rest of the file isn't style(9) friendly :/.. > Yeah, well, we can address that later. I just wanted to fix the comment which really stood out that I noticed while debugging another issue. -- ST4096-RIPE From owner-svn-src-head@FreeBSD.ORG Sat May 9 03:39:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 625817CB; Sat, 9 May 2015 03:39:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50A9118CA; Sat, 9 May 2015 03:39:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t493dJkZ002115; Sat, 9 May 2015 03:39:19 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t493dJNv002114; Sat, 9 May 2015 03:39:19 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505090339.t493dJNv002114@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 9 May 2015 03:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282675 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 03:39:19 -0000 Author: loos Date: Sat May 9 03:39:18 2015 New Revision: 282675 URL: https://svnweb.freebsd.org/changeset/base/282675 Log: Pass the resources requests to the upper bus. Submitted by: Michal Meloun Modified: head/sys/arm/ti/ti_i2c.c Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Sat May 9 03:05:44 2015 (r282674) +++ head/sys/arm/ti/ti_i2c.c Sat May 9 03:39:18 2015 (r282675) @@ -953,6 +953,17 @@ static device_method_t ti_i2c_methods[] DEVMETHOD(device_attach, ti_i2c_attach), DEVMETHOD(device_detach, ti_i2c_detach), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + /* OFW methods */ DEVMETHOD(ofw_bus_get_node, ti_i2c_get_node), From owner-svn-src-head@FreeBSD.ORG Sat May 9 09:22:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1186C86A; Sat, 9 May 2015 09:22: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 E7B111F5F; Sat, 9 May 2015 09:22: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 t499M0XD071914; Sat, 9 May 2015 09:22:00 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t499M03e071908; Sat, 9 May 2015 09:22:00 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201505090922.t499M03e071908@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 9 May 2015 09:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282676 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 09:22:01 -0000 Author: bz Date: Sat May 9 09:21:59 2015 New Revision: 282676 URL: https://svnweb.freebsd.org/changeset/base/282676 Log: Convert remaining hwpmc(4) debug printfs over to KTR to unbreak the build for at least powerpc kernels. Missed in r282658. MFC after: 10 days Modified: head/sys/dev/hwpmc/hwpmc_armv7.c head/sys/dev/hwpmc/hwpmc_e500.c head/sys/dev/hwpmc/hwpmc_mips74k.c Modified: head/sys/dev/hwpmc/hwpmc_armv7.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_armv7.c Sat May 9 03:39:18 2015 (r282675) +++ head/sys/dev/hwpmc/hwpmc_armv7.c Sat May 9 09:21:59 2015 (r282676) @@ -201,7 +201,7 @@ armv7_allocate_pmc(int cpu, int ri, stru pm->pm_md.pm_armv7.pm_armv7_evsel = config; - PMCDBG(MDP,ALL,2,"armv7-allocate ri=%d -> config=0x%x", ri, config); + PMCDBG2(MDP,ALL,2,"armv7-allocate ri=%d -> config=0x%x", ri, config); return 0; } @@ -225,7 +225,7 @@ armv7_read_pmc(int cpu, int ri, pmc_valu else tmp = armv7_pmcn_read(ri); - PMCDBG(MDP,REA,2,"armv7-read id=%d -> %jd", ri, tmp); + PMCDBG2(MDP,REA,2,"armv7-read id=%d -> %jd", ri, tmp); if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) *v = ARMV7_PERFCTR_VALUE_TO_RELOAD_COUNT(tmp); else @@ -249,7 +249,7 @@ armv7_write_pmc(int cpu, int ri, pmc_val if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) v = ARMV7_RELOAD_COUNT_TO_PERFCTR_VALUE(v); - PMCDBG(MDP,WRI,1,"armv7-write cpu=%d ri=%d v=%jx", cpu, ri, v); + PMCDBG3(MDP,WRI,1,"armv7-write cpu=%d ri=%d v=%jx", cpu, ri, v); if (pm->pm_md.pm_armv7.pm_armv7_evsel == 0xFF) cp15_pmccntr_set(v); @@ -264,7 +264,7 @@ armv7_config_pmc(int cpu, int ri, struct { struct pmc_hw *phw; - PMCDBG(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); + PMCDBG3(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[armv7,%d] illegal CPU value %d", __LINE__, cpu)); @@ -462,7 +462,7 @@ armv7_pcpu_init(struct pmc_mdep *md, int KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[armv7,%d] wrong cpu number %d", __LINE__, cpu)); - PMCDBG(MDP,INI,1,"armv7-init cpu=%d", cpu); + PMCDBG1(MDP,INI,1,"armv7-init cpu=%d", cpu); armv7_pcpu[cpu] = pac = malloc(sizeof(struct armv7_cpu), M_PMC, M_WAITOK|M_ZERO); @@ -516,7 +516,7 @@ pmc_armv7_initialize() armv7_npmcs = (reg >> ARMV7_PMNC_N_SHIFT) & \ ARMV7_PMNC_N_MASK; - PMCDBG(MDP,INI,1,"armv7-init npmcs=%d", armv7_npmcs); + PMCDBG1(MDP,INI,1,"armv7-init npmcs=%d", armv7_npmcs); /* * Allocate space for pointers to PMC HW descriptors and for Modified: head/sys/dev/hwpmc/hwpmc_e500.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_e500.c Sat May 9 03:39:18 2015 (r282675) +++ head/sys/dev/hwpmc/hwpmc_e500.c Sat May 9 09:21:59 2015 (r282676) @@ -304,7 +304,7 @@ e500_read_pmc(int cpu, int ri, pmc_value ri)); tmp = e500_pmcn_read(ri); - PMCDBG(MDP,REA,2,"ppc-read id=%d -> %jd", ri, tmp); + PMCDBG2(MDP,REA,2,"ppc-read id=%d -> %jd", ri, tmp); if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) *v = POWERPC_PERFCTR_VALUE_TO_RELOAD_COUNT(tmp); else @@ -328,7 +328,7 @@ e500_write_pmc(int cpu, int ri, pmc_valu if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) v = POWERPC_RELOAD_COUNT_TO_PERFCTR_VALUE(v); - PMCDBG(MDP,WRI,1,"powerpc-write cpu=%d ri=%d v=%jx", cpu, ri, v); + PMCDBG3(MDP,WRI,1,"powerpc-write cpu=%d ri=%d v=%jx", cpu, ri, v); e500_pmcn_write(ri, v); @@ -340,7 +340,7 @@ e500_config_pmc(int cpu, int ri, struct { struct pmc_hw *phw; - PMCDBG(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); + PMCDBG3(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); @@ -443,7 +443,7 @@ e500_pcpu_init(struct pmc_mdep *md, int KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[powerpc,%d] wrong cpu number %d", __LINE__, cpu)); - PMCDBG(MDP,INI,1,"powerpc-init cpu=%d", cpu); + PMCDBG1(MDP,INI,1,"powerpc-init cpu=%d", cpu); /* Freeze all counters. */ mtpmr(PMR_PMGC0, PMGC_FAC | PMGC_PMIE | PMGC_FCECE); @@ -543,7 +543,7 @@ e500_allocate_pmc(int cpu, int ri, struc pm->pm_md.pm_powerpc.pm_powerpc_evsel = config; - PMCDBG(MDP,ALL,2,"powerpc-allocate ri=%d -> config=0x%x", ri, config); + PMCDBG2(MDP,ALL,2,"powerpc-allocate ri=%d -> config=0x%x", ri, config); return 0; } @@ -576,7 +576,7 @@ e500_intr(int cpu, struct trapframe *tf) KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[powerpc,%d] out of range CPU %d", __LINE__, cpu)); - PMCDBG(MDP,INT,1, "cpu=%d tf=%p um=%d", cpu, (void *) tf, + PMCDBG3(MDP,INT,1, "cpu=%d tf=%p um=%d", cpu, (void *) tf, TRAPF_USERMODE(tf)); retval = 0; Modified: head/sys/dev/hwpmc/hwpmc_mips74k.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips74k.c Sat May 9 03:39:18 2015 (r282675) +++ head/sys/dev/hwpmc/hwpmc_mips74k.c Sat May 9 09:21:59 2015 (r282676) @@ -255,7 +255,7 @@ mips_get_perfctl(int cpu, int ri, uint32 if (caps & PMC_CAP_INTERRUPT) config |= MIPS74K_PMC_INTERRUPT_ENABLE; - PMCDBG(MDP,ALL,2,"mips74k-get_perfctl ri=%d -> config=0x%x", ri, config); + PMCDBG2(MDP,ALL,2,"mips74k-get_perfctl ri=%d -> config=0x%x", ri, config); return (config); } From owner-svn-src-head@FreeBSD.ORG Sat May 9 10:45:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B19071A2; Sat, 9 May 2015 10:45:56 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87BA216E9; Sat, 9 May 2015 10:45:56 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3C697B93B; Sat, 9 May 2015 06:45:55 -0400 (EDT) From: John Baldwin To: Luiz Otavio O Souza Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282674 - in head/sys/dev: iicbus ofw Date: Sat, 09 May 2015 06:45:13 -0400 Message-ID: <2165864.Vg8k3tllF7@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201505090305.t4935jYk086983@svn.freebsd.org> References: <201505090305.t4935jYk086983@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 09 May 2015 06:45:55 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 10:45:56 -0000 On Saturday, May 09, 2015 03:05:45 AM Luiz Otavio O Souza wrote: > Author: loos > Date: Sat May 9 03:05:44 2015 > New Revision: 282674 > URL: https://svnweb.freebsd.org/changeset/base/282674 > > Log: > Handle IRQ resources on iicbus and ofw_iicbus. > > Based on a patch submitted by Michal Meloun . > > Modified: > head/sys/dev/iicbus/iicbus.c > head/sys/dev/iicbus/iicbus.h > head/sys/dev/ofw/ofw_iicbus.c > > Modified: head/sys/dev/iicbus/iicbus.c > ============================================================================== > --- head/sys/dev/iicbus/iicbus.c Sat May 9 00:48:44 2015 (r282673) > +++ head/sys/dev/iicbus/iicbus.c Sat May 9 03:05:44 2015 (r282674) > @@ -157,9 +159,9 @@ iicbus_probe_nomatch(device_t bus, devic > { > struct iicbus_ivar *devi = IICBUS_IVAR(child); > > - device_printf(bus, ""); > - printf(" at addr %#x\n", devi->addr); > - return; > + device_printf(bus, " at addr %#x", devi->addr); > + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); > + printf("\n"); Other bus drivers do not print resources for nomatch devices (or at least PCI doesn't). Given that, I'm not sure it makes sense to do that here? > +static int > +iicbus_set_resource(device_t dev, device_t child, int type, int rid, > + u_long start, u_long count) > +{ > + struct iicbus_ivar *devi; > + struct resource_list_entry *rle; > + > + devi = IICBUS_IVAR(child); > + rle = resource_list_add(&devi->rl, type, rid, start, > + start + count - 1, count); > + if (rle == NULL) > + return (ENXIO); > + > + return (0); > +} Isn't this the same as bus_generic_rl_set_resource()? > + > +static struct resource * > +iicbus_alloc_resource(device_t bus, device_t child, int type, int *rid, > + u_long start, u_long end, u_long count, u_int flags) > +{ > + struct resource_list *rl; > + struct resource_list_entry *rle; > + > + /* Only IRQ resources are supported. */ > + if (type != SYS_RES_IRQ) > + return (NULL); > + > + /* > + * Request for the default allocation with a given rid: use resource > + * list stored in the local device info. > + */ > + if ((start == 0UL) && (end == ~0UL)) { > + rl = BUS_GET_RESOURCE_LIST(bus, child); > + if (rl == NULL) > + return (NULL); > + rle = resource_list_find(rl, type, *rid); > + if (rle == NULL) { > + if (bootverbose) > + device_printf(bus, "no default resources for " > + "rid = %d, type = %d\n", *rid, type); > + return (NULL); > + } > + start = rle->start; > + end = rle->end; > + count = rle->count; > + } > + > + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, > + count, flags)); If you are using a resource list, you should be using resource_list_alloc(). However, I think you can replace this entire method with just bus_generic_rl_alloc_resource(). > @@ -297,6 +366,16 @@ static device_method_t iicbus_methods[] > DEVMETHOD(device_detach, iicbus_detach), > > /* bus interface */ > + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), > + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), > + DEVMETHOD(bus_release_resource, bus_generic_release_resource), After fixing alloc_resource to use resource_list_alloc() (either directly or via the generic method), this should be set to bus_generic_rl_release_resource(). > Modified: head/sys/dev/ofw/ofw_iicbus.c > ============================================================================== > --- head/sys/dev/ofw/ofw_iicbus.c Sat May 9 00:48:44 2015 (r282673) > +++ head/sys/dev/ofw/ofw_iicbus.c Sat May 9 03:05:44 2015 (r282674) > @@ -199,3 +205,12 @@ ofw_iicbus_get_devinfo(device_t bus, dev > dinfo = device_get_ivars(dev); > return (&dinfo->opd_obdinfo); > } > + > +static struct resource_list * > +ofw_iicbus_get_resource_list(device_t bus __unused, device_t child) > +{ > + struct ofw_iicbus_devinfo *devi; > + > + devi = device_get_ivars(child); > + return (&devi->opd_dinfo.rl); > +} I think you don't actually need this since the inherited method should already work. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat May 9 10:45:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 668531A0; Sat, 9 May 2015 10:45:56 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4117316E8; Sat, 9 May 2015 10:45:56 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A0F6DB924; Sat, 9 May 2015 06:45:54 -0400 (EDT) From: John Baldwin To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282676 - head/sys/dev/hwpmc Date: Sat, 09 May 2015 06:45:51 -0400 Message-ID: <10927862.9s3f7gupsN@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201505090922.t499M03e071908@svn.freebsd.org> References: <201505090922.t499M03e071908@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 09 May 2015 06:45:54 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 10:45:56 -0000 On Saturday, May 09, 2015 09:22:00 AM Bjoern A. Zeeb wrote: > Author: bz > Date: Sat May 9 09:21:59 2015 > New Revision: 282676 > URL: https://svnweb.freebsd.org/changeset/base/282676 > > Log: > Convert remaining hwpmc(4) debug printfs over to KTR to unbreak the build > for at least powerpc kernels. Missed in r282658. > > MFC after: 10 days Arg, my fault, sorry. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat May 9 12:28:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B33116FB; Sat, 9 May 2015 12:28:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EF471062; Sat, 9 May 2015 12:28: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 t49CSpFX062473; Sat, 9 May 2015 12:28:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49CSmVv062442; Sat, 9 May 2015 12:28:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505091228.t49CSmVv062442@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 May 2015 12:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282678 - in head: share/man/man4 sys/amd64/acpica sys/amd64/include sys/dev/acpica sys/i386/acpica sys/i386/include sys/x86/include sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 12:28:51 -0000 Author: kib Date: Sat May 9 12:28:48 2015 New Revision: 282678 URL: https://svnweb.freebsd.org/changeset/base/282678 Log: If x86 CPU implementation of the MWAIT instruction reasonably interacts with interrupts, query ACPI and use MWAIT for entrance into Cx sleep states. Support C1 "I/O then halt" mode. See Intel' document 302223-007 "Intelб╝ Processor Vendor-Specific ACPI Interface Specification" for description. Move the acpi_cpu_c1() function into x86/cpu_machdep.c and use it instead of inlining "sti; hlt" sequence in several places. In the acpi(4) man page, besides documenting the dev.cpu.N.cx_methods sysctl, correct the names for dev.cpu.N.{cx_usage,cx_lowest,cx_supported} sysctls. Both jkim and avg have some other patches implementing the mwait functionality; this work is unrelated. Linux does not rely on the ACPI to provide correct tables describing Cx modes. Instead, the driver has pre-defined knowledge of the CPU models, it was supplied by Intel. Tested by: pho (previous versions) Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/acpi.4 head/sys/amd64/acpica/acpi_machdep.c head/sys/amd64/include/md_var.h head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpi_package.c head/sys/dev/acpica/acpivar.h head/sys/i386/acpica/acpi_machdep.c head/sys/i386/include/md_var.h head/sys/x86/include/acpica_machdep.h head/sys/x86/x86/cpu_machdep.c Modified: head/share/man/man4/acpi.4 ============================================================================== --- head/share/man/man4/acpi.4 Sat May 9 12:10:59 2015 (r282677) +++ head/share/man/man4/acpi.4 Sat May 9 12:28:48 2015 (r282678) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2014 +.Dd May 9, 2015 .Dt ACPI 4 .Os .Sh NAME @@ -69,14 +69,12 @@ them (such as Enable dumping Debug objects without .Cd "options ACPI_DEBUG" . Default is 0, ignore Debug objects. -.It Va hw.acpi.acline -AC line state (1 means online, 0 means on battery power). -.It Va hw.acpi.cpu.cx_usage +.It Va dev.cpu.N.cx_usage Debugging information listing the percent of total usage for each sleep state. The values are reset when -.Va hw.acpi.cpu.cx_lowest +.Va dev.cpu.N.cx_lowest is modified. -.It Va hw.acpi.cpu.cx_lowest +.It Va dev.cpu.N.cx_lowest Lowest Cx state to use for idling the CPU. A scheduling algorithm will select states between .Li C1 @@ -111,6 +109,11 @@ semantics as the state. Deeper sleeps provide more power savings but increased transition latency when an interrupt occurs. +.It Va dev.cpu.N.cx_method +List of supported CPU idle states and their transition methods, as +directed by the firmware. +.It Va hw.acpi.acline +AC line state (1 means online, 0 means on battery power). .It Va hw.acpi.disable_on_reboot Disable ACPI during the reboot process. Most systems reboot fine with ACPI still enabled, but some require @@ -374,6 +377,14 @@ typically as a child of a PCI bus. .Pq Vt device Supports an ACPI laptop lid switch, which typically puts a system to sleep. +.It Li mwait +.Pq Vt feature +Do not ask firmware for available x86-vendor specific methods to enter +.Li Cx +sleep states. +Only query and use the generic I/O-based entrance method. +The knob is provided to work around inconsistencies in the tables +filled by firmware. .It Li quirks .Pq Vt feature Do not honor quirks. Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Sat May 9 12:10:59 2015 (r282677) +++ head/sys/amd64/acpica/acpi_machdep.c Sat May 9 12:28:48 2015 (r282678) @@ -87,13 +87,6 @@ acpi_machdep_quirks(int *quirks) return (0); } -void -acpi_cpu_c1() -{ - - __asm __volatile("sti; hlt"); -} - /* * Support for mapping ACPI tables during early boot. Currently this * uses the crashdump map to map each table. However, the crashdump Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Sat May 9 12:10:59 2015 (r282677) +++ head/sys/amd64/include/md_var.h Sat May 9 12:28:48 2015 (r282678) @@ -91,6 +91,7 @@ struct dumperinfo; void *alloc_fpusave(int flags); void amd64_syscall(struct thread *td, int traced); void busdma_swi(void); +bool cpu_mwait_usable(void); void cpu_probe_amdc1e(void); void cpu_setregs(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat May 9 12:10:59 2015 (r282677) +++ head/sys/dev/acpica/acpi_cpu.c Sat May 9 12:28:48 2015 (r282678) @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include #if defined(__amd64__) || defined(__i386__) #include +#include +#include #endif #include @@ -70,6 +72,10 @@ struct acpi_cx { uint32_t power; /* Power consumed (mW). */ int res_type; /* Resource type for p_lvlx. */ int res_rid; /* Resource ID for p_lvlx. */ + bool do_mwait; + uint32_t mwait_hint; + bool mwait_hw_coord; + bool mwait_bm_avoidance; }; #define MAX_CX_STATES 8 @@ -128,6 +134,12 @@ struct acpi_cpu_device { #define PIIX4_STOP_BREAK_MASK (PIIX4_BRLD_EN_IRQ0 | PIIX4_BRLD_EN_IRQ | PIIX4_BRLD_EN_IRQ8) #define PIIX4_PCNTRL_BST_EN (1<<10) +#define CST_FFH_VENDOR_INTEL 1 +#define CST_FFH_INTEL_CL_C1IO 1 +#define CST_FFH_INTEL_CL_MWAIT 2 +#define CST_FFH_MWAIT_HW_COORD 0x0001 +#define CST_FFH_MWAIT_BM_AVOID 0x0002 + /* Allow users to ignore processor orders in MADT. */ static int cpu_unordered; SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_unordered, CTLFLAG_RDTUN, @@ -179,6 +191,9 @@ static int acpi_cpu_usage_counters_sysct static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc); static int acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_cpu_global_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); +#if defined(__i386__) || defined(__amd64__) +static int acpi_cpu_method_sysctl(SYSCTL_HANDLER_ARGS); +#endif static device_method_t acpi_cpu_methods[] = { /* Device interface */ @@ -348,7 +363,18 @@ acpi_cpu_attach(device_t dev) * so advertise this ourselves. Note this is not the same as independent * SMP control where each CPU can have different settings. */ - sc->cpu_features = ACPI_CAP_SMP_SAME | ACPI_CAP_SMP_SAME_C3; + sc->cpu_features = ACPI_CAP_SMP_SAME | ACPI_CAP_SMP_SAME_C3 | + ACPI_CAP_C1_IO_HALT; + +#if defined(__i386__) || defined(__amd64__) + /* + * Ask for MWAIT modes if not disabled and interrupts work + * reasonable with MWAIT. + */ + if (!acpi_disabled("mwait") && cpu_mwait_usable()) + sc->cpu_features |= ACPI_CAP_SMP_C1_NATIVE | ACPI_CAP_SMP_C3_NATIVE; +#endif + if (devclass_get_drivers(acpi_cpu_devclass, &drivers, &drv_count) == 0) { for (i = 0; i < drv_count; i++) { if (ACPI_GET_FEATURES(drivers[i], &features) == 0) @@ -720,6 +746,27 @@ acpi_cpu_generic_cx_probe(struct acpi_cp } } +static void +acpi_cpu_cx_cst_mwait(struct acpi_cx *cx_ptr, uint64_t address, int accsize) +{ + + cx_ptr->do_mwait = true; + cx_ptr->mwait_hint = address & 0xffffffff; + cx_ptr->mwait_hw_coord = (accsize & CST_FFH_MWAIT_HW_COORD) != 0; + cx_ptr->mwait_bm_avoidance = (accsize & CST_FFH_MWAIT_BM_AVOID) != 0; +} + +static void +acpi_cpu_cx_cst_free_plvlx(device_t cpu_dev, struct acpi_cx *cx_ptr) +{ + + if (cx_ptr->p_lvlx == NULL) + return; + bus_release_resource(cpu_dev, cx_ptr->res_type, cx_ptr->res_rid, + cx_ptr->p_lvlx); + cx_ptr->p_lvlx = NULL; +} + /* * Parse a _CST package and set up its Cx states. Since the _CST object * can change dynamically, our notify handler may call this function @@ -734,7 +781,8 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s ACPI_OBJECT *top; ACPI_OBJECT *pkg; uint32_t count; - int i; + uint64_t address; + int i, vendor, class, accsize; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -790,6 +838,30 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s /* Validate the state to see if we should use it. */ switch (cx_ptr->type) { case ACPI_STATE_C1: + acpi_cpu_cx_cst_free_plvlx(sc->cpu_dev, cx_ptr); +#if defined(__i386__) || defined(__amd64__) + if (acpi_PkgFFH_IntelCpu(pkg, 0, &vendor, &class, &address, + &accsize) == 0 && vendor == CST_FFH_VENDOR_INTEL) { + if (class == CST_FFH_INTEL_CL_C1IO) { + /* C1 I/O then Halt */ + cx_ptr->res_rid = sc->cpu_cx_count; + bus_set_resource(sc->cpu_dev, SYS_RES_IOPORT, + cx_ptr->res_rid, address, 1); + cx_ptr->p_lvlx = bus_alloc_resource_any(sc->cpu_dev, + SYS_RES_IOPORT, &cx_ptr->res_rid, RF_ACTIVE | + RF_SHAREABLE); + if (cx_ptr->p_lvlx == NULL) { + bus_delete_resource(sc->cpu_dev, SYS_RES_IOPORT, + cx_ptr->res_rid); + device_printf(sc->cpu_dev, + "C1 I/O failed to allocate port %d, " + "degrading to C1 Halt", (int)address); + } + } else if (class == CST_FFH_INTEL_CL_MWAIT) { + acpi_cpu_cx_cst_mwait(cx_ptr, address, accsize); + } + } +#endif if (sc->cpu_cx_states[0].type == ACPI_STATE_C0) { /* This is the first C1 state. Use the reserved slot. */ sc->cpu_cx_states[0] = *cx_ptr; @@ -818,23 +890,34 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s } /* Free up any previous register. */ - if (cx_ptr->p_lvlx != NULL) { - bus_release_resource(sc->cpu_dev, cx_ptr->res_type, cx_ptr->res_rid, - cx_ptr->p_lvlx); - cx_ptr->p_lvlx = NULL; - } + acpi_cpu_cx_cst_free_plvlx(sc->cpu_dev, cx_ptr); /* Allocate the control register for C2 or C3. */ - cx_ptr->res_rid = sc->cpu_cx_count; - acpi_PkgGas(sc->cpu_dev, pkg, 0, &cx_ptr->res_type, &cx_ptr->res_rid, - &cx_ptr->p_lvlx, RF_SHAREABLE); - if (cx_ptr->p_lvlx) { +#if defined(__i386__) || defined(__amd64__) + if (acpi_PkgFFH_IntelCpu(pkg, 0, &vendor, &class, &address, + &accsize) == 0 && vendor == CST_FFH_VENDOR_INTEL && + class == CST_FFH_INTEL_CL_MWAIT) { + /* Native C State Instruction use (mwait) */ + acpi_cpu_cx_cst_mwait(cx_ptr, address, accsize); ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "acpi_cpu%d: Got C%d - %d latency\n", - device_get_unit(sc->cpu_dev), cx_ptr->type, - cx_ptr->trans_lat)); + "acpi_cpu%d: Got C%d/mwait - %d latency\n", + device_get_unit(sc->cpu_dev), cx_ptr->type, cx_ptr->trans_lat)); cx_ptr++; sc->cpu_cx_count++; + } else +#endif + { + cx_ptr->res_rid = sc->cpu_cx_count; + acpi_PkgGas(sc->cpu_dev, pkg, 0, &cx_ptr->res_type, + &cx_ptr->res_rid, &cx_ptr->p_lvlx, RF_SHAREABLE); + if (cx_ptr->p_lvlx) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "acpi_cpu%d: Got C%d - %d latency\n", + device_get_unit(sc->cpu_dev), cx_ptr->type, + cx_ptr->trans_lat)); + cx_ptr++; + sc->cpu_cx_count++; + } } } AcpiOsFree(buf.Pointer); @@ -956,6 +1039,13 @@ acpi_cpu_startup_cx(struct acpi_cpu_soft OID_AUTO, "cx_usage_counters", CTLTYPE_STRING | CTLFLAG_RD, (void *)sc, 0, acpi_cpu_usage_counters_sysctl, "A", "Cx sleep state counters"); +#if defined(__i386__) || defined(__amd64__) + SYSCTL_ADD_PROC(&sc->cpu_sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), + OID_AUTO, "cx_method", CTLTYPE_STRING | CTLFLAG_RD, + (void *)sc, 0, acpi_cpu_method_sysctl, "A", + "Cx entrance methods"); +#endif /* Signal platform that we can handle _CST notification. */ if (!cpu_cx_generic && cpu_cst_cnt != 0) { @@ -1043,7 +1133,14 @@ acpi_cpu_idle(sbintime_t sbt) */ if (cx_next->type == ACPI_STATE_C1) { cputicks = cpu_ticks(); - acpi_cpu_c1(); + if (cx_next->p_lvlx != NULL) { + /* C1 I/O then Halt */ + CPU_GET_REG(cx_next->p_lvlx, 1); + } + if (cx_next->do_mwait) + acpi_cpu_idle_mwait(cx_next->mwait_hint); + else + acpi_cpu_c1(); end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); if (curthread->td_critnest == 0) end_time = min(end_time, 500000 / hz); @@ -1055,7 +1152,7 @@ acpi_cpu_idle(sbintime_t sbt) * For C3, disable bus master arbitration and enable bus master wake * if BM control is available, otherwise flush the CPU cache. */ - if (cx_next->type == ACPI_STATE_C3) { + if (cx_next->type == ACPI_STATE_C3 || cx_next->mwait_bm_avoidance) { if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { AcpiWriteBitRegister(ACPI_BITREG_ARB_DISABLE, 1); AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 1); @@ -1076,7 +1173,10 @@ acpi_cpu_idle(sbintime_t sbt) start_time = 0; cputicks = cpu_ticks(); } - CPU_GET_REG(cx_next->p_lvlx, 1); + if (cx_next->do_mwait) + acpi_cpu_idle_mwait(cx_next->mwait_hint); + else + CPU_GET_REG(cx_next->p_lvlx, 1); /* * Read the end time twice. Since it may take an arbitrary time @@ -1092,8 +1192,8 @@ acpi_cpu_idle(sbintime_t sbt) end_time = ((cpu_ticks() - cputicks) << 20) / cpu_tickrate(); /* Enable bus master arbitration and disable bus master wakeup. */ - if (cx_next->type == ACPI_STATE_C3 && - (cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { + if ((cx_next->type == ACPI_STATE_C3 || cx_next->mwait_bm_avoidance) && + (cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { AcpiWriteBitRegister(ACPI_BITREG_ARB_DISABLE, 0); AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); } @@ -1286,6 +1386,44 @@ acpi_cpu_usage_counters_sysctl(SYSCTL_HA return (0); } +#if defined(__i386__) || defined(__amd64__) +static int +acpi_cpu_method_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct acpi_cpu_softc *sc; + struct acpi_cx *cx; + struct sbuf sb; + char buf[128]; + int i; + + sc = (struct acpi_cpu_softc *)arg1; + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + for (i = 0; i < sc->cpu_cx_count; i++) { + cx = &sc->cpu_cx_states[i]; + sbuf_printf(&sb, "C%d/", i + 1); + if (cx->do_mwait) { + sbuf_cat(&sb, "mwait"); + if (cx->mwait_hw_coord) + sbuf_cat(&sb, "/hwc"); + if (cx->mwait_bm_avoidance) + sbuf_cat(&sb, "/bma"); + } else if (cx->type == ACPI_STATE_C1) { + sbuf_cat(&sb, "hlt"); + } else { + sbuf_cat(&sb, "io"); + } + if (cx->type == ACPI_STATE_C1 && cx->p_lvlx != NULL) + sbuf_cat(&sb, "/iohlt"); + sbuf_putc(&sb, ' '); + } + sbuf_trim(&sb); + sbuf_finish(&sb); + sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); + sbuf_delete(&sb); + return (0); +} +#endif + static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc) { Modified: head/sys/dev/acpica/acpi_package.c ============================================================================== --- head/sys/dev/acpica/acpi_package.c Sat May 9 12:10:59 2015 (r282677) +++ head/sys/dev/acpica/acpi_package.c Sat May 9 12:28:48 2015 (r282678) @@ -120,6 +120,28 @@ acpi_PkgGas(device_t dev, ACPI_OBJECT *r return (acpi_bus_alloc_gas(dev, type, rid, &gas, dst, flags)); } +int +acpi_PkgFFH_IntelCpu(ACPI_OBJECT *res, int idx, int *vendor, int *class, + uint64_t *address, int *accsize) +{ + ACPI_GENERIC_ADDRESS gas; + ACPI_OBJECT *obj; + + obj = &res->Package.Elements[idx]; + if (obj == NULL || obj->Type != ACPI_TYPE_BUFFER || + obj->Buffer.Length < sizeof(ACPI_GENERIC_ADDRESS) + 3) + return (EINVAL); + + memcpy(&gas, obj->Buffer.Pointer + 3, sizeof(gas)); + if (gas.SpaceId != ACPI_ADR_SPACE_FIXED_HARDWARE) + return (ERESTART); + *vendor = gas.BitWidth; + *class = gas.BitOffset; + *address = gas.Address; + *accsize = gas.AccessWidth; + return (0); +} + ACPI_HANDLE acpi_GetReference(ACPI_HANDLE scope, ACPI_OBJECT *obj) { Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Sat May 9 12:10:59 2015 (r282677) +++ head/sys/dev/acpica/acpivar.h Sat May 9 12:28:48 2015 (r282678) @@ -467,6 +467,8 @@ int acpi_PkgInt32(ACPI_OBJECT *res, int int acpi_PkgStr(ACPI_OBJECT *res, int idx, void *dst, size_t size); int acpi_PkgGas(device_t dev, ACPI_OBJECT *res, int idx, int *type, int *rid, struct resource **dst, u_int flags); +int acpi_PkgFFH_IntelCpu(ACPI_OBJECT *res, int idx, int *vendor, + int *class, uint64_t *address, int *accsize); ACPI_HANDLE acpi_GetReference(ACPI_HANDLE scope, ACPI_OBJECT *obj); /* Modified: head/sys/i386/acpica/acpi_machdep.c ============================================================================== --- head/sys/i386/acpica/acpi_machdep.c Sat May 9 12:10:59 2015 (r282677) +++ head/sys/i386/acpica/acpi_machdep.c Sat May 9 12:28:48 2015 (r282678) @@ -106,13 +106,6 @@ acpi_machdep_quirks(int *quirks) return (0); } -void -acpi_cpu_c1() -{ - - __asm __volatile("sti; hlt"); -} - /* * Support for mapping ACPI tables during early boot. This abuses the * crashdump map because the kernel cannot allocate KVA in Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Sat May 9 12:10:59 2015 (r282677) +++ head/sys/i386/include/md_var.h Sat May 9 12:28:48 2015 (r282678) @@ -97,6 +97,7 @@ struct dumperinfo; void *alloc_fpusave(int flags); void bcopyb(const void *from, void *to, size_t len); void busdma_swi(void); +bool cpu_mwait_usable(void); void cpu_probe_amdc1e(void); void cpu_setregs(void); void cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs)); Modified: head/sys/x86/include/acpica_machdep.h ============================================================================== --- head/sys/x86/include/acpica_machdep.h Sat May 9 12:10:59 2015 (r282677) +++ head/sys/x86/include/acpica_machdep.h Sat May 9 12:28:48 2015 (r282678) @@ -74,6 +74,7 @@ enum intr_polarity; void acpi_SetDefaultIntrModel(int model); void acpi_cpu_c1(void); +void acpi_cpu_idle_mwait(uint32_t mwait_hint); void *acpi_map_table(vm_paddr_t pa, const char *sig); void acpi_unmap_table(void *table); vm_paddr_t acpi_find_table(const char *sig); Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Sat May 9 12:10:59 2015 (r282677) +++ head/sys/x86/x86/cpu_machdep.c Sat May 9 12:28:48 2015 (r282678) @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); #ifdef SMP #include #endif +#include #include #include @@ -121,6 +122,27 @@ cpu_flush_dcache(void *ptr, size_t len) /* Not applicable */ } +void +acpi_cpu_c1(void) +{ + + __asm __volatile("sti; hlt"); +} + +void +acpi_cpu_idle_mwait(uint32_t mwait_hint) +{ + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + /* + * XXXKIB. Software coordination mode should be supported, + * but all Intel CPUs provide hardware coordination. + */ + cpu_monitor(state, 0, 0); + cpu_mwait(MWAIT_INTRBREAK, mwait_hint); +} + /* Get current clock frequency for the given cpu id. */ int cpu_est_clockrate(int cpu_id, uint64_t *rate) @@ -194,6 +216,15 @@ cpu_halt(void) halt(); } +bool +cpu_mwait_usable(void) +{ + + return ((cpu_feature2 & CPUID2_MON) != 0 && ((cpu_mon_mwait_flags & + (CPUID5_MON_MWAIT_EXT | CPUID5_MWAIT_INTRBREAK)) == + (CPUID5_MON_MWAIT_EXT | CPUID5_MWAIT_INTRBREAK))); +} + void (*cpu_idle_hook)(sbintime_t) = NULL; /* ACPI idle hook. */ static int cpu_ident_amdc1e = 0; /* AMD C1E supported. */ static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ @@ -220,7 +251,7 @@ cpu_idle_acpi(sbintime_t sbt) else if (cpu_idle_hook) cpu_idle_hook(sbt); else - __asm __volatile("sti; hlt"); + acpi_cpu_c1(); *state = STATE_RUNNING; } #endif /* !PC98 */ @@ -253,7 +284,7 @@ cpu_idle_hlt(sbintime_t sbt) if (sched_runnable()) enable_intr(); else - __asm __volatile("sti; hlt"); + acpi_cpu_c1(); *state = STATE_RUNNING; } From owner-svn-src-head@FreeBSD.ORG Sat May 9 18:32:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9806637B; Sat, 9 May 2015 18:32: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 8639A149E; Sat, 9 May 2015 18:32: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 t49IWEtd047553; Sat, 9 May 2015 18:32:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49IWEhZ047552; Sat, 9 May 2015 18:32:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505091832.t49IWEhZ047552@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 May 2015 18:32:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282679 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 18:32:14 -0000 Author: kib Date: Sat May 9 18:32:13 2015 New Revision: 282679 URL: https://svnweb.freebsd.org/changeset/base/282679 Log: Do not return from thread_single(SINGLE_BOUNDARY) until all stopped thread are guarenteed to be removed from the processors. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat May 9 12:28:48 2015 (r282678) +++ head/sys/kern/kern_thread.c Sat May 9 18:32:13 2015 (r282679) @@ -759,6 +759,29 @@ stopme: PROC_LOCK(p); PROC_SLOCK(p); } + } else if (mode == SINGLE_BOUNDARY) { + /* + * Wait until all suspended threads are removed from + * the processors. The thread_suspend_check() + * increments p_boundary_count while it is still + * running, which makes it possible for the execve() + * to destroy vmspace while our other threads are + * still using the address space. + * + * We lock the thread, which is only allowed to + * succeed after context switch code finished using + * the address space. + */ + FOREACH_THREAD_IN_PROC(p, td2) { + if (td2 == td) + continue; + thread_lock(td2); + KASSERT((td2->td_flags & TDF_BOUNDARY) != 0, + ("td %p not on boundary", td2)); + KASSERT(TD_IS_SUSPENDED(td2), + ("td %p is not suspended", td2)); + thread_unlock(td2); + } } PROC_SUNLOCK(p); return (0); From owner-svn-src-head@FreeBSD.ORG Sat May 9 18:38:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C997F4D8; Sat, 9 May 2015 18:38: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 B836C14BC; Sat, 9 May 2015 18:38: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 t49IcaOi048489; Sat, 9 May 2015 18:38:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49IcaQ0048488; Sat, 9 May 2015 18:38:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505091838.t49IcaQ0048488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 May 2015 18:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282680 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 18:38:36 -0000 Author: kib Date: Sat May 9 18:38:35 2015 New Revision: 282680 URL: https://svnweb.freebsd.org/changeset/base/282680 Log: Remove unused define. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/apic_vector.S Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Sat May 9 18:32:13 2015 (r282679) +++ head/sys/amd64/amd64/apic_vector.S Sat May 9 18:38:35 2015 (r282680) @@ -196,8 +196,6 @@ IDTVEC(hv_vmbus_callback) */ .text -#define NAKE_INTR_CS 24 - SUPERALIGN_TEXT invltlb_ret: call as_lapic_eoi From owner-svn-src-head@FreeBSD.ORG Sat May 9 19:00:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 426707D4; Sat, 9 May 2015 19: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 3022C169D; Sat, 9 May 2015 19: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 t49J0IwN058740; Sat, 9 May 2015 19:00:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49J0H5O058737; Sat, 9 May 2015 19:00:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505091900.t49J0H5O058737@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 May 2015 19:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282681 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 19:00:18 -0000 Author: bapt Date: Sat May 9 19:00:16 2015 New Revision: 282681 URL: https://svnweb.freebsd.org/changeset/base/282681 Log: Use sbuf(9) instead of homebrewed buffered string Modified: head/usr.sbin/pw/Makefile head/usr.sbin/pw/fileupd.c head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/Makefile ============================================================================== --- head/usr.sbin/pw/Makefile Sat May 9 18:38:35 2015 (r282680) +++ head/usr.sbin/pw/Makefile Sat May 9 19:00:16 2015 (r282681) @@ -8,7 +8,7 @@ SRCS= pw.c pw_conf.c pw_user.c pw_group. WARNS?= 2 -LIBADD= crypt util +LIBADD= crypt util sbuf .include Modified: head/usr.sbin/pw/fileupd.c ============================================================================== --- head/usr.sbin/pw/fileupd.c Sat May 9 18:38:35 2015 (r282680) +++ head/usr.sbin/pw/fileupd.c Sat May 9 19:00:16 2015 (r282681) @@ -42,19 +42,6 @@ static const char rcsid[] = #include "pwupd.h" int -extendline(char **buf, int * buflen, int needed) -{ - if (needed > *buflen) { - char *tmp = realloc(*buf, needed); - if (tmp == NULL) - return -1; - *buf = tmp; - *buflen = needed; - } - return *buflen; -} - -int extendarray(char ***buf, int * buflen, int needed) { if (needed > *buflen) { Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sat May 9 18:38:35 2015 (r282680) +++ head/usr.sbin/pw/pw_conf.c Sat May 9 19:00:16 2015 (r282681) @@ -29,6 +29,8 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include +#include #include #include #include @@ -366,6 +368,7 @@ int write_userconfig(char const * file) { int fd; + struct sbuf *buf; if (file == NULL) file = _PATH_PW_CONF; @@ -376,126 +379,121 @@ write_userconfig(char const * file) if ((fp = fdopen(fd, "w")) == NULL) close(fd); else { - int i, j, k; - int len = LNBUFSZ; - char *buf = malloc(len); - + int i, j; + + buf = sbuf_new_auto(); for (i = _UC_NONE; i < _UC_FIELDS; i++) { int quote = 1; - char const *val = buf; - *buf = '\0'; + sbuf_clear(buf); switch (i) { case _UC_DEFAULTPWD: - val = boolean_str(config.default_password); + sbuf_cat(buf, boolean_str(config.default_password)); break; case _UC_REUSEUID: - val = boolean_str(config.reuse_uids); + sbuf_cat(buf, boolean_str(config.reuse_uids)); break; case _UC_REUSEGID: - val = boolean_str(config.reuse_gids); + sbuf_cat(buf, boolean_str(config.reuse_gids)); break; case _UC_NISPASSWD: - val = config.nispasswd ? config.nispasswd : ""; + sbuf_cat(buf, config.nispasswd ? + config.nispasswd : ""); quote = 0; break; case _UC_DOTDIR: - val = config.dotdir ? config.dotdir : boolean_str(0); + sbuf_cat(buf, config.dotdir ? + config.dotdir : boolean_str(0)); break; case _UC_NEWMAIL: - val = config.newmail ? config.newmail : boolean_str(0); + sbuf_cat(buf, config.newmail ? + config.newmail : boolean_str(0)); break; case _UC_LOGFILE: - val = config.logfile ? config.logfile : boolean_str(0); + sbuf_cat(buf, config.logfile ? + config.logfile : boolean_str(0)); break; case _UC_HOMEROOT: - val = config.home; + sbuf_cat(buf, config.home); break; case _UC_HOMEMODE: - sprintf(buf, "%04o", config.homemode); + sbuf_printf(buf, "%04o", config.homemode); quote = 0; break; case _UC_SHELLPATH: - val = config.shelldir; + sbuf_cat(buf, config.shelldir); break; case _UC_SHELLS: - for (j = k = 0; j < _UC_MAXSHELLS && system_shells[j] != NULL; j++) { - char lbuf[64]; - int l = snprintf(lbuf, sizeof lbuf, "%s\"%s\"", k ? "," : "", system_shells[j]); - if (l < 0) - l = 0; - if (l + k + 1 < len || extendline(&buf, &len, len + LNBUFSZ) != -1) { - strcpy(buf + k, lbuf); - k += l; - } + for (j = 0; j < _UC_MAXSHELLS && + system_shells[j] != NULL; j++) { + sbuf_printf(buf, "%s\"%s\"", j ? + "," : "", system_shells[j]); } quote = 0; break; case _UC_DEFAULTSHELL: - val = config.shell_default ? config.shell_default : bourne_shell; + sbuf_cat(buf, config.shell_default ? + config.shell_default : bourne_shell); break; case _UC_DEFAULTGROUP: - val = config.default_group ? config.default_group : ""; + sbuf_cat(buf, config.default_group ? + config.default_group : ""); break; case _UC_EXTRAGROUPS: extendarray(&config.groups, &config.numgroups, 200); - for (j = k = 0; j < config.numgroups && config.groups[j] != NULL; j++) { - char lbuf[64]; - int l = snprintf(lbuf, sizeof lbuf, "%s\"%s\"", k ? "," : "", config.groups[j]); - if (l < 0) - l = 0; - if (l + k + 1 < len || extendline(&buf, &len, len + 1024) != -1) { - strcpy(buf + k, lbuf); - k += l; - } - } + for (j = 0; j < config.numgroups && + config.groups[j] != NULL; j++) + sbuf_printf(buf, "%s\"%s\"", j ? + "," : "", config.groups[j]); quote = 0; break; case _UC_DEFAULTCLASS: - val = config.default_class ? config.default_class : ""; + sbuf_cat(buf, config.default_class ? + config.default_class : ""); break; case _UC_MINUID: - sprintf(buf, "%lu", (unsigned long) config.min_uid); + sbuf_printf(buf, "%lu", (unsigned long) config.min_uid); quote = 0; break; case _UC_MAXUID: - sprintf(buf, "%lu", (unsigned long) config.max_uid); + sbuf_printf(buf, "%lu", (unsigned long) config.max_uid); quote = 0; break; case _UC_MINGID: - sprintf(buf, "%lu", (unsigned long) config.min_gid); + sbuf_printf(buf, "%lu", (unsigned long) config.min_gid); quote = 0; break; case _UC_MAXGID: - sprintf(buf, "%lu", (unsigned long) config.max_gid); + sbuf_printf(buf, "%lu", (unsigned long) config.max_gid); quote = 0; break; case _UC_EXPIRE: - sprintf(buf, "%d", config.expire_days); + sbuf_printf(buf, "%d", config.expire_days); quote = 0; break; case _UC_PASSWORD: - sprintf(buf, "%d", config.password_days); + sbuf_printf(buf, "%d", config.password_days); quote = 0; break; case _UC_NONE: break; } + sbuf_finish(buf); if (comments[i]) fputs(comments[i], fp); if (*kwds[i]) { if (quote) - fprintf(fp, "%s = \"%s\"\n", kwds[i], val); + fprintf(fp, "%s = \"%s\"\n", kwds[i], sbuf_data(buf)); else - fprintf(fp, "%s = %s\n", kwds[i], val); + fprintf(fp, "%s = %s\n", kwds[i], sbuf_data(buf)); #if debugging - printf("WROTE: %s = %s\n", kwds[i], val); + printf("WROTE: %s = %s\n", kwds[i], sbuf_data(buf)); #endif } } - free(buf); + sbuf_delete(buf); return fclose(fp) != EOF; } } From owner-svn-src-head@FreeBSD.ORG Sat May 9 19:09:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1822B2F; Sat, 9 May 2015 19:09: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 D042F1788; Sat, 9 May 2015 19:09: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 t49J9YL6063643; Sat, 9 May 2015 19:09:34 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49J9YfP063642; Sat, 9 May 2015 19:09:34 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505091909.t49J9YfP063642@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 May 2015 19:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282683 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 19:09:35 -0000 Author: bapt Date: Sat May 9 19:09:34 2015 New Revision: 282683 URL: https://svnweb.freebsd.org/changeset/base/282683 Log: Use snprintf(3) instead of strcpy(3) + strncat(3) Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat May 9 19:00:41 2015 (r282682) +++ head/usr.sbin/pw/pw_user.c Sat May 9 19:09:34 2015 (r282683) @@ -185,8 +185,7 @@ pw_user(struct userconf * cnf, int mode, * But we create a symlink from cnf->home -> "/usr" -> cnf->home */ if (strchr(cnf->home+1, '/') == NULL) { - strcpy(dbuf, "/usr"); - strncat(dbuf, cnf->home, MAXPATHLEN-5); + snprintf(dbuf, MAXPATHLEN, "/usr%s", cnf->home); if (mkdir(dbuf, _DEF_DIRMODE) != -1 || errno == EEXIST) { chown(dbuf, 0, 0); /* From owner-svn-src-head@FreeBSD.ORG Sat May 9 19:11:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8DB5C7D; Sat, 9 May 2015 19:11: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 D58A61791; Sat, 9 May 2015 19:11: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 t49JB3rQ067525; Sat, 9 May 2015 19:11:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49JB2gh067512; Sat, 9 May 2015 19:11:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505091911.t49JB2gh067512@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 May 2015 19:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282684 - in head/sys: amd64/amd64 amd64/include x86/include x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 19:11:04 -0000 Author: kib Date: Sat May 9 19:11:01 2015 New Revision: 282684 URL: https://svnweb.freebsd.org/changeset/base/282684 Log: Rewrite amd64 PCID implementation to follow an algorithm described in the Vahalia' "Unix Internals" section 15.12 "Other TLB Consistency Algorithms". The same algorithm is already utilized by the MIPS pmap to handle ASIDs. The PCID for the address space is now allocated per-cpu during context switch to the thread using pmap, when no PCID on the cpu was ever allocated, or the current PCID is invalidated. If the PCID is reused, bit 63 of %cr3 can be set to avoid TLB flush. Each cpu has PCID' algorithm generation count, which is saved in the pmap pcpu block when pcpu PCID is allocated. On invalidation, the pmap generation count is zeroed, which signals the context switch code that already allocated PCID is no longer valid. The implication is the TLB shootdown for the given cpu/address space, due to the allocation of new PCID. The pm_save mask is no longer has to be tracked, which (significantly) reduces the targets of the TLB shootdown IPIs. Previously, pm_save was reset only on pmap_invalidate_all(), which made it accumulate the cpuids of all processors on which the thread was scheduled between full TLB shootdowns. Besides reducing the amount of TLB shootdowns and removing atomics to update pm_saves in the context switch code, the algorithm is much simpler than the maintanence of pm_save and selection of the right address space in the shootdown IPI handler. Reviewed by: alc Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/include/cpufunc.h head/sys/amd64/include/pcpu.h head/sys/amd64/include/pmap.h head/sys/amd64/include/smp.h head/sys/x86/include/specialreg.h head/sys/x86/xen/xen_apic.c Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Sat May 9 19:09:34 2015 (r282683) +++ head/sys/amd64/amd64/apic_vector.S Sat May 9 19:11:01 2015 (r282684) @@ -203,30 +203,28 @@ invltlb_ret: jmp doreti_iret SUPERALIGN_TEXT +IDTVEC(invltlb) + PUSH_FRAME + + call invltlb_handler + jmp invltlb_ret + IDTVEC(invltlb_pcid) PUSH_FRAME call invltlb_pcid_handler jmp invltlb_ret - - SUPERALIGN_TEXT -IDTVEC(invltlb) +IDTVEC(invltlb_invpcid) PUSH_FRAME - call invltlb_handler + call invltlb_invpcid_handler jmp invltlb_ret /* * Single page TLB shootdown */ .text - SUPERALIGN_TEXT -IDTVEC(invlpg_pcid) - PUSH_FRAME - - call invlpg_pcid_handler - jmp invltlb_ret SUPERALIGN_TEXT IDTVEC(invlpg) Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Sat May 9 19:09:34 2015 (r282683) +++ head/sys/amd64/amd64/cpu_switch.S Sat May 9 19:11:01 2015 (r282684) @@ -69,16 +69,10 @@ * %rsi = newtd */ ENTRY(cpu_throw) - movl PCPU(CPUID),%eax - testq %rdi,%rdi - jz 1f - /* release bit from old pm_active */ - movq PCPU(CURPMAP),%rdx - LK btrl %eax,PM_ACTIVE(%rdx) /* clear old */ -1: - movq TD_PCB(%rsi),%r8 /* newtd->td_pcb */ - movq PCB_CR3(%r8),%rcx /* new address space */ - jmp swact + movq %rsi,%r12 + movq %rsi,%rdi + call pmap_activate_sw + jmp sw1 END(cpu_throw) /* @@ -132,59 +126,20 @@ ctx_switch_xsave: xorl %eax,%eax movq %rax,PCPU(FPCURTHREAD) 3: - /* Save is done. Now fire up new thread. Leave old vmspace. */ - movq TD_PCB(%rsi),%r8 - - /* switch address space */ - movq PCB_CR3(%r8),%rcx - movq %cr3,%rax - cmpq %rcx,%rax /* Same address space? */ - jne swinact - SETLK %rdx, TD_LOCK(%rdi) /* Release the old thread */ - jmp sw1 -swinact: - movl PCPU(CPUID),%eax - /* Release bit from old pmap->pm_active */ - movq PCPU(CURPMAP),%r12 - LK btrl %eax,PM_ACTIVE(%r12) /* clear old */ - SETLK %rdx,TD_LOCK(%rdi) /* Release the old thread */ -swact: - /* Set bit in new pmap->pm_active */ - movq TD_PROC(%rsi),%rdx /* newproc */ - movq P_VMSPACE(%rdx), %rdx - addq $VM_PMAP,%rdx - cmpl $-1,PM_PCID(%rdx) - je 1f - LK btsl %eax,PM_SAVE(%rdx) - jnc 1f - btsq $63,%rcx /* CR3_PCID_SAVE */ - incq PCPU(PM_SAVE_CNT) -1: - movq %rcx,%cr3 /* new address space */ - LK btsl %eax,PM_ACTIVE(%rdx) /* set new */ - movq %rdx,PCPU(CURPMAP) - - /* - * We might lose the race and other CPU might have changed - * the pmap after we set our bit in pmap->pm_save. Recheck. - * Reload %cr3 with CR3_PCID_SAVE bit cleared if pmap was - * modified, causing TLB flush for this pcid. - */ - btrq $63,%rcx - jnc 1f - LK btsl %eax,PM_SAVE(%rdx) - jc 1f - decq PCPU(PM_SAVE_CNT) - movq %rcx,%cr3 -1: - + movq %rsi,%r12 + movq %rdi,%r13 + movq %rdx,%r15 + movq %rsi,%rdi + callq pmap_activate_sw + SETLK %r15,TD_LOCK(%r13) /* Release the old thread */ sw1: + movq TD_PCB(%r12),%r8 #if defined(SCHED_ULE) && defined(SMP) /* Wait for the new thread to become unblocked */ movq $blocked_lock, %rdx 1: - movq TD_LOCK(%rsi),%rcx + movq TD_LOCK(%r12),%rcx cmpq %rcx, %rdx pause je 1b @@ -195,13 +150,13 @@ sw1: */ /* Skip loading user fsbase/gsbase for kthreads */ - testl $TDP_KTHREAD,TD_PFLAGS(%rsi) + testl $TDP_KTHREAD,TD_PFLAGS(%r12) jnz do_kthread /* * Load ldt register */ - movq TD_PROC(%rsi),%rcx + movq TD_PROC(%r12),%rcx cmpq $0, P_MD+MD_LDT(%rcx) jne do_ldt xorl %eax,%eax @@ -238,7 +193,7 @@ done_tss: movq %r8,PCPU(CURPCB) /* Update the TSS_RSP0 pointer for the next interrupt */ movq %r8,COMMON_TSS_RSP0(%rdx) - movq %rsi,PCPU(CURTHREAD) /* into next thread */ + movq %r12,PCPU(CURTHREAD) /* into next thread */ /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%r8) Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Sat May 9 19:09:34 2015 (r282683) +++ head/sys/amd64/amd64/genassym.c Sat May 9 19:11:01 2015 (r282684) @@ -71,8 +71,6 @@ __FBSDID("$FreeBSD$"); ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); -ASSYM(PM_SAVE, offsetof(struct pmap, pm_save)); -ASSYM(PM_PCID, offsetof(struct pmap, pm_pcid)); ASSYM(P_MD, offsetof(struct proc, p_md)); ASSYM(MD_LDT, offsetof(struct mdproc, md_ldt)); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat May 9 19:09:34 2015 (r282683) +++ head/sys/amd64/amd64/machdep.c Sat May 9 19:11:01 2015 (r282684) @@ -1718,7 +1718,6 @@ hammer_time(u_int64_t modulep, u_int64_t /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; - thread0.td_pcb->pcb_cr3 = KPML4phys; /* PCID 0 is reserved for kernel */ thread0.td_frame = &proc0_tf; env = kern_getenv("kernelname"); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sat May 9 19:09:34 2015 (r282683) +++ head/sys/amd64/amd64/mp_machdep.c Sat May 9 19:11:01 2015 (r282684) @@ -88,12 +88,9 @@ char *doublefault_stack; char *nmi_stack; /* Variables needed for SMP tlb shootdown. */ -vm_offset_t smp_tlb_addr2; -struct invpcid_descr smp_tlb_invpcid; +static vm_offset_t smp_tlb_addr1, smp_tlb_addr2; +static pmap_t smp_tlb_pmap; volatile int smp_tlb_wait; -uint64_t pcid_cr3; -pmap_t smp_tlb_pmap; -extern int invpcid_works; extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32); @@ -139,14 +136,17 @@ cpu_mp_start(void) /* Install an inter-CPU IPI for TLB invalidation */ if (pmap_pcid_enabled) { - setidt(IPI_INVLTLB, IDTVEC(invltlb_pcid), SDT_SYSIGT, - SEL_KPL, 0); - setidt(IPI_INVLPG, IDTVEC(invlpg_pcid), SDT_SYSIGT, - SEL_KPL, 0); + if (invpcid_works) { + setidt(IPI_INVLTLB, IDTVEC(invltlb_invpcid), + SDT_SYSIGT, SEL_KPL, 0); + } else { + setidt(IPI_INVLTLB, IDTVEC(invltlb_pcid), SDT_SYSIGT, + SEL_KPL, 0); + } } else { setidt(IPI_INVLTLB, IDTVEC(invltlb), SDT_SYSIGT, SEL_KPL, 0); - setidt(IPI_INVLPG, IDTVEC(invlpg), SDT_SYSIGT, SEL_KPL, 0); } + setidt(IPI_INVLPG, IDTVEC(invlpg), SDT_SYSIGT, SEL_KPL, 0); setidt(IPI_INVLRNG, IDTVEC(invlrng), SDT_SYSIGT, SEL_KPL, 0); /* Install an inter-CPU IPI for cache invalidation. */ @@ -242,6 +242,9 @@ init_secondary(void) pc->pc_gs32p = &gdt[NGDT * cpu + GUGS32_SEL]; pc->pc_ldt = (struct system_segment_descriptor *)&gdt[NGDT * cpu + GUSERLDT_SEL]; + pc->pc_curpmap = kernel_pmap; + pc->pc_pcid_gen = 1; + pc->pc_pcid_next = PMAP_PCID_KERN + 1; /* Save the per-cpu pointer for use by the NMI handler. */ np->np_pcpu = (register_t) pc; @@ -407,35 +410,8 @@ start_ap(int apic_id) } /* - * Flush the TLB on all other CPU's + * Flush the TLB on other CPU's */ -static void -smp_tlb_shootdown(u_int vector, pmap_t pmap, vm_offset_t addr1, - vm_offset_t addr2) -{ - u_int ncpu; - - ncpu = mp_ncpus - 1; /* does not shootdown self */ - if (ncpu < 1) - return; /* no other cpus */ - if (!(read_rflags() & PSL_I)) - panic("%s: interrupts disabled", __func__); - mtx_lock_spin(&smp_ipi_mtx); - smp_tlb_invpcid.addr = addr1; - if (pmap == NULL) { - smp_tlb_invpcid.pcid = 0; - } else { - smp_tlb_invpcid.pcid = pmap->pm_pcid; - pcid_cr3 = pmap->pm_cr3; - } - smp_tlb_addr2 = addr2; - smp_tlb_pmap = pmap; - atomic_store_rel_int(&smp_tlb_wait, 0); - ipi_all_but_self(vector); - while (smp_tlb_wait < ncpu) - ia32_pause(); - mtx_unlock_spin(&smp_ipi_mtx); -} static void smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, pmap_t pmap, @@ -443,7 +419,11 @@ smp_targeted_tlb_shootdown(cpuset_t mask { int cpu, ncpu, othercpus; - othercpus = mp_ncpus - 1; + othercpus = mp_ncpus - 1; /* does not shootdown self */ + + /* + * Check for other cpus. Return if none. + */ if (CPU_ISFULLSET(&mask)) { if (othercpus < 1) return; @@ -452,16 +432,11 @@ smp_targeted_tlb_shootdown(cpuset_t mask if (CPU_EMPTY(&mask)) return; } + if (!(read_rflags() & PSL_I)) panic("%s: interrupts disabled", __func__); mtx_lock_spin(&smp_ipi_mtx); - smp_tlb_invpcid.addr = addr1; - if (pmap == NULL) { - smp_tlb_invpcid.pcid = 0; - } else { - smp_tlb_invpcid.pcid = pmap->pm_pcid; - pcid_cr3 = pmap->pm_cr3; - } + smp_tlb_addr1 = addr1; smp_tlb_addr2 = addr2; smp_tlb_pmap = pmap; atomic_store_rel_int(&smp_tlb_wait, 0); @@ -485,65 +460,39 @@ smp_targeted_tlb_shootdown(cpuset_t mask } void -smp_invlpg(pmap_t pmap, vm_offset_t addr) -{ - - if (smp_started) { - smp_tlb_shootdown(IPI_INVLPG, pmap, addr, 0); -#ifdef COUNT_XINVLTLB_HITS - ipi_page++; -#endif - } -} - -void -smp_invlpg_range(pmap_t pmap, vm_offset_t addr1, vm_offset_t addr2) -{ - - if (smp_started) { - smp_tlb_shootdown(IPI_INVLRNG, pmap, addr1, addr2); -#ifdef COUNT_XINVLTLB_HITS - ipi_range++; - ipi_range_size += (addr2 - addr1) / PAGE_SIZE; -#endif - } -} - -void smp_masked_invltlb(cpuset_t mask, pmap_t pmap) { if (smp_started) { smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, pmap, 0, 0); #ifdef COUNT_XINVLTLB_HITS - ipi_masked_global++; + ipi_global++; #endif } } void -smp_masked_invlpg(cpuset_t mask, pmap_t pmap, vm_offset_t addr) +smp_masked_invlpg(cpuset_t mask, vm_offset_t addr) { if (smp_started) { - smp_targeted_tlb_shootdown(mask, IPI_INVLPG, pmap, addr, 0); + smp_targeted_tlb_shootdown(mask, IPI_INVLPG, NULL, addr, 0); #ifdef COUNT_XINVLTLB_HITS - ipi_masked_page++; + ipi_page++; #endif } } void -smp_masked_invlpg_range(cpuset_t mask, pmap_t pmap, vm_offset_t addr1, - vm_offset_t addr2) +smp_masked_invlpg_range(cpuset_t mask, vm_offset_t addr1, vm_offset_t addr2) { if (smp_started) { - smp_targeted_tlb_shootdown(mask, IPI_INVLRNG, pmap, addr1, - addr2); + smp_targeted_tlb_shootdown(mask, IPI_INVLRNG, NULL, + addr1, addr2); #ifdef COUNT_XINVLTLB_HITS - ipi_masked_range++; - ipi_masked_range_size += (addr2 - addr1) / PAGE_SIZE; + ipi_range++; + ipi_range_size += (addr2 - addr1) / PAGE_SIZE; #endif } } @@ -552,19 +501,9 @@ void smp_cache_flush(void) { - if (smp_started) - smp_tlb_shootdown(IPI_INVLCACHE, NULL, 0, 0); -} - -void -smp_invltlb(pmap_t pmap) -{ - if (smp_started) { - smp_tlb_shootdown(IPI_INVLTLB, pmap, 0, 0); -#ifdef COUNT_XINVLTLB_HITS - ipi_global++; -#endif + smp_targeted_tlb_shootdown(all_cpus, IPI_INVLCACHE, NULL, + 0, 0); } } @@ -586,10 +525,10 @@ invltlb_handler(void) } void -invltlb_pcid_handler(void) +invltlb_invpcid_handler(void) { - uint64_t cr3; - u_int cpuid; + struct invpcid_descr d; + #ifdef COUNT_XINVLTLB_HITS xhits_gbl[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -597,49 +536,45 @@ invltlb_pcid_handler(void) (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ - if (smp_tlb_invpcid.pcid != (uint64_t)-1 && - smp_tlb_invpcid.pcid != 0) { - if (invpcid_works) { - invpcid(&smp_tlb_invpcid, INVPCID_CTX); - } else { - /* Otherwise reload %cr3 twice. */ - cr3 = rcr3(); - if (cr3 != pcid_cr3) { - load_cr3(pcid_cr3); - cr3 |= CR3_PCID_SAVE; - } - load_cr3(cr3); - } - } else { - invltlb_globpcid(); - } - if (smp_tlb_pmap != NULL) { - cpuid = PCPU_GET(cpuid); - if (!CPU_ISSET(cpuid, &smp_tlb_pmap->pm_active)) - CPU_CLR_ATOMIC(cpuid, &smp_tlb_pmap->pm_save); - } - + d.pcid = smp_tlb_pmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid; + d.pad = 0; + d.addr = 0; + invpcid(&d, smp_tlb_pmap == kernel_pmap ? INVPCID_CTXGLOB : + INVPCID_CTX); atomic_add_int(&smp_tlb_wait, 1); } void -invlpg_handler(void) +invltlb_pcid_handler(void) { #ifdef COUNT_XINVLTLB_HITS - xhits_pg[PCPU_GET(cpuid)]++; + xhits_gbl[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ #ifdef COUNT_IPIS - (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; + (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ - invlpg(smp_tlb_invpcid.addr); + if (smp_tlb_pmap == kernel_pmap) { + invltlb_globpcid(); + } else { + /* + * The current pmap might not be equal to + * smp_tlb_pmap. The clearing of the pm_gen in + * pmap_invalidate_all() takes care of TLB + * invalidation when switching to the pmap on this + * CPU. + */ + if (PCPU_GET(curpmap) == smp_tlb_pmap) { + load_cr3(smp_tlb_pmap->pm_cr3 | + smp_tlb_pmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid); + } + } atomic_add_int(&smp_tlb_wait, 1); } void -invlpg_pcid_handler(void) +invlpg_handler(void) { - uint64_t cr3; #ifdef COUNT_XINVLTLB_HITS xhits_pg[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -647,45 +582,15 @@ invlpg_pcid_handler(void) (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ - if (smp_tlb_invpcid.pcid == (uint64_t)-1) { - invltlb_globpcid(); - } else if (smp_tlb_invpcid.pcid == 0) { - invlpg(smp_tlb_invpcid.addr); - } else if (invpcid_works) { - invpcid(&smp_tlb_invpcid, INVPCID_ADDR); - } else { - /* - * PCID supported, but INVPCID is not. - * Temporarily switch to the target address - * space and do INVLPG. - */ - cr3 = rcr3(); - if (cr3 != pcid_cr3) - load_cr3(pcid_cr3 | CR3_PCID_SAVE); - invlpg(smp_tlb_invpcid.addr); - load_cr3(cr3 | CR3_PCID_SAVE); - } - + invlpg(smp_tlb_addr1); atomic_add_int(&smp_tlb_wait, 1); } -static inline void -invlpg_range(vm_offset_t start, vm_offset_t end) -{ - - do { - invlpg(start); - start += PAGE_SIZE; - } while (start < end); -} - void invlrng_handler(void) { - struct invpcid_descr d; vm_offset_t addr; - uint64_t cr3; - u_int cpuid; + #ifdef COUNT_XINVLTLB_HITS xhits_rng[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -693,38 +598,11 @@ invlrng_handler(void) (*ipi_invlrng_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ - addr = smp_tlb_invpcid.addr; - if (pmap_pcid_enabled) { - if (smp_tlb_invpcid.pcid == 0) { - /* - * kernel pmap - use invlpg to invalidate - * global mapping. - */ - invlpg_range(addr, smp_tlb_addr2); - } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { - invltlb_globpcid(); - if (smp_tlb_pmap != NULL) { - cpuid = PCPU_GET(cpuid); - if (!CPU_ISSET(cpuid, &smp_tlb_pmap->pm_active)) - CPU_CLR_ATOMIC(cpuid, - &smp_tlb_pmap->pm_save); - } - } else if (invpcid_works) { - d = smp_tlb_invpcid; - do { - invpcid(&d, INVPCID_ADDR); - d.addr += PAGE_SIZE; - } while (d.addr <= smp_tlb_addr2); - } else { - cr3 = rcr3(); - if (cr3 != pcid_cr3) - load_cr3(pcid_cr3 | CR3_PCID_SAVE); - invlpg_range(addr, smp_tlb_addr2); - load_cr3(cr3 | CR3_PCID_SAVE); - } - } else { - invlpg_range(addr, smp_tlb_addr2); - } + addr = smp_tlb_addr1; + do { + invlpg(addr); + addr += PAGE_SIZE; + } while (addr < smp_tlb_addr2); atomic_add_int(&smp_tlb_wait, 1); } Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat May 9 19:09:34 2015 (r282683) +++ head/sys/amd64/amd64/pmap.c Sat May 9 19:11:01 2015 (r282684) @@ -273,6 +273,8 @@ pmap_modified_bit(pmap_t pmap) return (mask); } +extern struct pcpu __pcpu[]; + #if !defined(DIAGNOSTIC) #ifdef __GNUC_GNU_INLINE__ #define PMAP_INLINE __attribute__((__gnu_inline__)) inline @@ -379,8 +381,6 @@ caddr_t CADDR1 = 0; static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */ -static struct unrhdr pcid_unr; -static struct mtx pcid_mtx; int pmap_pcid_enabled = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?"); @@ -827,6 +827,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) { vm_offset_t va; pt_entry_t *pte; + int i; /* * Create an initial set of page tables to run the kernel in. @@ -861,7 +862,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr) kernel_pmap->pm_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(KPML4phys); kernel_pmap->pm_cr3 = KPML4phys; CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */ - CPU_FILL(&kernel_pmap->pm_save); /* always superset of pm_active */ TAILQ_INIT(&kernel_pmap->pm_pvchunk); kernel_pmap->pm_flags = pmap_flags; @@ -895,18 +895,28 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* Initialize TLB Context Id. */ TUNABLE_INT_FETCH("vm.pmap.pcid_enabled", &pmap_pcid_enabled); if ((cpu_feature2 & CPUID2_PCID) != 0 && pmap_pcid_enabled) { - load_cr4(rcr4() | CR4_PCIDE); - mtx_init(&pcid_mtx, "pcid", NULL, MTX_DEF); - init_unrhdr(&pcid_unr, 1, (1 << 12) - 1, &pcid_mtx); /* Check for INVPCID support */ invpcid_works = (cpu_stdext_feature & CPUID_STDEXT_INVPCID) != 0; - kernel_pmap->pm_pcid = 0; -#ifndef SMP + for (i = 0; i < MAXCPU; i++) { + kernel_pmap->pm_pcids[i].pm_pcid = PMAP_PCID_KERN; + kernel_pmap->pm_pcids[i].pm_gen = 1; + } + __pcpu[0].pc_pcid_next = PMAP_PCID_KERN + 1; + __pcpu[0].pc_pcid_gen = 1; + /* + * pcpu area for APs is zeroed during AP startup. + * pc_pcid_next and pc_pcid_gen are initialized by AP + * during pcpu setup. + */ +#ifdef SMP + load_cr4(rcr4() | CR4_PCIDE); +#else pmap_pcid_enabled = 0; #endif - } else + } else { pmap_pcid_enabled = 0; + } } /* @@ -1277,28 +1287,6 @@ pmap_update_pde_invalidate(pmap_t pmap, } #ifdef SMP -static void -pmap_invalidate_page_pcid(pmap_t pmap, vm_offset_t va) -{ - struct invpcid_descr d; - uint64_t cr3; - - if (invpcid_works) { - d.pcid = pmap->pm_pcid; - d.pad = 0; - d.addr = va; - invpcid(&d, INVPCID_ADDR); - return; - } - - cr3 = rcr3(); - critical_enter(); - load_cr3(pmap->pm_cr3 | CR3_PCID_SAVE); - invlpg(va); - load_cr3(cr3 | CR3_PCID_SAVE); - critical_exit(); -} - /* * For SMP, these functions have to use the IPI mechanism for coherence. * @@ -1361,8 +1349,8 @@ pmap_invalidate_ept(pmap_t pmap) void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - cpuset_t other_cpus; - u_int cpuid; + cpuset_t *mask; + u_int cpuid, i; if (pmap_type_guest(pmap)) { pmap_invalidate_ept(pmap); @@ -1373,74 +1361,33 @@ pmap_invalidate_page(pmap_t pmap, vm_off ("pmap_invalidate_page: invalid type %d", pmap->pm_type)); sched_pin(); - if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { - if (!pmap_pcid_enabled) { - invlpg(va); - } else { - if (pmap->pm_pcid != -1 && pmap->pm_pcid != 0) { - if (pmap == PCPU_GET(curpmap)) - invlpg(va); - else - pmap_invalidate_page_pcid(pmap, va); - } else { - invltlb_globpcid(); - } - } - smp_invlpg(pmap, va); + if (pmap == kernel_pmap) { + invlpg(va); + mask = &all_cpus; } else { cpuid = PCPU_GET(cpuid); - other_cpus = all_cpus; - CPU_CLR(cpuid, &other_cpus); - if (CPU_ISSET(cpuid, &pmap->pm_active)) + if (pmap == PCPU_GET(curpmap)) invlpg(va); - else if (pmap_pcid_enabled) { - if (pmap->pm_pcid != -1 && pmap->pm_pcid != 0) - pmap_invalidate_page_pcid(pmap, va); - else - invltlb_globpcid(); + else if (pmap_pcid_enabled) + pmap->pm_pcids[cpuid].pm_gen = 0; + if (pmap_pcid_enabled) { + CPU_FOREACH(i) { + if (cpuid != i) + pmap->pm_pcids[i].pm_gen = 0; + } } - if (pmap_pcid_enabled) - CPU_AND(&other_cpus, &pmap->pm_save); - else - CPU_AND(&other_cpus, &pmap->pm_active); - if (!CPU_EMPTY(&other_cpus)) - smp_masked_invlpg(other_cpus, pmap, va); + mask = &pmap->pm_active; } + smp_masked_invlpg(*mask, va); sched_unpin(); } -static void -pmap_invalidate_range_pcid(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) -{ - struct invpcid_descr d; - uint64_t cr3; - vm_offset_t addr; - - if (invpcid_works) { - d.pcid = pmap->pm_pcid; - d.pad = 0; - for (addr = sva; addr < eva; addr += PAGE_SIZE) { - d.addr = addr; - invpcid(&d, INVPCID_ADDR); - } - return; - } - - cr3 = rcr3(); - critical_enter(); - load_cr3(pmap->pm_cr3 | CR3_PCID_SAVE); - for (addr = sva; addr < eva; addr += PAGE_SIZE) - invlpg(addr); - load_cr3(cr3 | CR3_PCID_SAVE); - critical_exit(); -} - void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - cpuset_t other_cpus; + cpuset_t *mask; vm_offset_t addr; - u_int cpuid; + u_int cpuid, i; if (pmap_type_guest(pmap)) { pmap_invalidate_ept(pmap); @@ -1451,55 +1398,36 @@ pmap_invalidate_range(pmap_t pmap, vm_of ("pmap_invalidate_range: invalid type %d", pmap->pm_type)); sched_pin(); - if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { - if (!pmap_pcid_enabled) { - for (addr = sva; addr < eva; addr += PAGE_SIZE) - invlpg(addr); - } else { - if (pmap->pm_pcid != -1 && pmap->pm_pcid != 0) { - if (pmap == PCPU_GET(curpmap)) { - for (addr = sva; addr < eva; - addr += PAGE_SIZE) - invlpg(addr); - } else { - pmap_invalidate_range_pcid(pmap, - sva, eva); - } - } else { - invltlb_globpcid(); - } - } - smp_invlpg_range(pmap, sva, eva); + cpuid = PCPU_GET(cpuid); + if (pmap == kernel_pmap) { + for (addr = sva; addr < eva; addr += PAGE_SIZE) + invlpg(addr); + mask = &all_cpus; } else { - cpuid = PCPU_GET(cpuid); - other_cpus = all_cpus; - CPU_CLR(cpuid, &other_cpus); - if (CPU_ISSET(cpuid, &pmap->pm_active)) { + if (pmap == PCPU_GET(curpmap)) { for (addr = sva; addr < eva; addr += PAGE_SIZE) invlpg(addr); } else if (pmap_pcid_enabled) { - if (pmap->pm_pcid != -1 && pmap->pm_pcid != 0) - pmap_invalidate_range_pcid(pmap, sva, eva); - else - invltlb_globpcid(); + pmap->pm_pcids[cpuid].pm_gen = 0; } - if (pmap_pcid_enabled) - CPU_AND(&other_cpus, &pmap->pm_save); - else - CPU_AND(&other_cpus, &pmap->pm_active); - if (!CPU_EMPTY(&other_cpus)) - smp_masked_invlpg_range(other_cpus, pmap, sva, eva); + if (pmap_pcid_enabled) { + CPU_FOREACH(i) { + if (cpuid != i) + pmap->pm_pcids[i].pm_gen = 0; + } + } + mask = &pmap->pm_active; } + smp_masked_invlpg_range(*mask, sva, eva); sched_unpin(); } void pmap_invalidate_all(pmap_t pmap) { - cpuset_t other_cpus; + cpuset_t *mask; struct invpcid_descr d; - uint64_t cr3; - u_int cpuid; + u_int cpuid, i; if (pmap_type_guest(pmap)) { pmap_invalidate_ept(pmap); @@ -1510,60 +1438,42 @@ pmap_invalidate_all(pmap_t pmap) ("pmap_invalidate_all: invalid type %d", pmap->pm_type)); sched_pin(); - cpuid = PCPU_GET(cpuid); - if (pmap == kernel_pmap || - (pmap_pcid_enabled && !CPU_CMP(&pmap->pm_save, &all_cpus)) || - !CPU_CMP(&pmap->pm_active, &all_cpus)) { - if (invpcid_works) { + if (pmap == kernel_pmap) { + if (pmap_pcid_enabled && invpcid_works) { bzero(&d, sizeof(d)); invpcid(&d, INVPCID_CTXGLOB); } else { invltlb_globpcid(); } - if (!CPU_ISSET(cpuid, &pmap->pm_active)) - CPU_CLR_ATOMIC(cpuid, &pmap->pm_save); - smp_invltlb(pmap); + mask = &all_cpus; } else { - other_cpus = all_cpus; - CPU_CLR(cpuid, &other_cpus); - - /* - * This logic is duplicated in the Xinvltlb shootdown - * IPI handler. - */ - if (pmap_pcid_enabled) { - if (pmap->pm_pcid != -1 && pmap->pm_pcid != 0) { + cpuid = PCPU_GET(cpuid); + if (pmap == PCPU_GET(curpmap)) { + if (pmap_pcid_enabled) { if (invpcid_works) { - d.pcid = pmap->pm_pcid; + d.pcid = pmap->pm_pcids[cpuid].pm_pcid; d.pad = 0; d.addr = 0; invpcid(&d, INVPCID_CTX); } else { - cr3 = rcr3(); - critical_enter(); - - /* - * Bit 63 is clear, pcid TLB - * entries are invalidated. - */ - load_cr3(pmap->pm_cr3); - load_cr3(cr3 | CR3_PCID_SAVE); - critical_exit(); + load_cr3(pmap->pm_cr3 | pmap->pm_pcids + [PCPU_GET(cpuid)].pm_pcid); } } else { - invltlb_globpcid(); + invltlb(); } - } else if (CPU_ISSET(cpuid, &pmap->pm_active)) - invltlb(); - if (!CPU_ISSET(cpuid, &pmap->pm_active)) - CPU_CLR_ATOMIC(cpuid, &pmap->pm_save); - if (pmap_pcid_enabled) - CPU_AND(&other_cpus, &pmap->pm_save); - else - CPU_AND(&other_cpus, &pmap->pm_active); - if (!CPU_EMPTY(&other_cpus)) - smp_masked_invltlb(other_cpus, pmap); + } else if (pmap_pcid_enabled) { + pmap->pm_pcids[cpuid].pm_gen = 0; + } + if (pmap_pcid_enabled) { + CPU_FOREACH(i) { + if (cpuid != i) + pmap->pm_pcids[i].pm_gen = 0; + } + } + mask = &pmap->pm_active; } + smp_masked_invltlb(*mask, pmap); sched_unpin(); } @@ -1627,7 +1537,6 @@ pmap_update_pde(pmap_t pmap, vm_offset_t active = all_cpus; else { active = pmap->pm_active; - CPU_AND_ATOMIC(&pmap->pm_save, &active); } if (CPU_OVERLAP(&active, &other_cpus)) { act.store = cpuid; @@ -2205,11 +2114,9 @@ pmap_pinit0(pmap_t pmap) pmap->pm_cr3 = KPML4phys; pmap->pm_root.rt_root = 0; CPU_ZERO(&pmap->pm_active); - CPU_ZERO(&pmap->pm_save); PCPU_SET(curpmap, pmap); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); - pmap->pm_pcid = pmap_pcid_enabled ? 0 : -1; pmap->pm_flags = pmap_flags; } @@ -2233,7 +2140,10 @@ pmap_pinit_type(pmap_t pmap, enum pmap_t pml4phys = VM_PAGE_TO_PHYS(pml4pg); pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(pml4phys); - pmap->pm_pcid = -1; + CPU_FOREACH(i) { + pmap->pm_pcids[i].pm_pcid = PMAP_PCID_NONE; + pmap->pm_pcids[i].pm_gen = 0; + } pmap->pm_cr3 = ~0; /* initialize to an invalid value */ if ((pml4pg->flags & PG_ZERO) == 0) @@ -2260,12 +2170,6 @@ pmap_pinit_type(pmap_t pmap, enum pmap_t /* install self-referential address mapping entry(s) */ pmap->pm_pml4[PML4PML4I] = VM_PAGE_TO_PHYS(pml4pg) | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M; - - if (pmap_pcid_enabled) { - pmap->pm_pcid = alloc_unr(&pcid_unr); - if (pmap->pm_pcid != -1) - pmap->pm_cr3 |= pmap->pm_pcid; - } } pmap->pm_root.rt_root = 0; @@ -2274,7 +2178,6 @@ pmap_pinit_type(pmap_t pmap, enum pmap_t bzero(&pmap->pm_stats, sizeof pmap->pm_stats); pmap->pm_flags = flags; pmap->pm_eptgen = 0; - CPU_ZERO(&pmap->pm_save); return (1); } @@ -2535,14 +2438,6 @@ pmap_release(pmap_t pmap) KASSERT(CPU_EMPTY(&pmap->pm_active), ("releasing active pmap %p", pmap)); - if (pmap_pcid_enabled) { - /* - * Invalidate any left TLB entries, to allow the reuse - * of the pcid. - */ - pmap_invalidate_all(pmap); - } - m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4)); for (i = 0; i < NKPML4E; i++) /* KVA */ @@ -2554,8 +2449,6 @@ pmap_release(pmap_t pmap) m->wire_count--; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat May 9 19:12:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 483C9DC3; Sat, 9 May 2015 19:12: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 36E801851; Sat, 9 May 2015 19:12: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 t49JCHnC067750; Sat, 9 May 2015 19:12:17 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49JCHRf067749; Sat, 9 May 2015 19:12:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505091912.t49JCHRf067749@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 May 2015 19:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282685 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 19:12:17 -0000 Author: bapt Date: Sat May 9 19:12:16 2015 New Revision: 282685 URL: https://svnweb.freebsd.org/changeset/base/282685 Log: Replace malloc(3) + strcpy(3) + strcat(3) by asprintf(3) Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat May 9 19:11:01 2015 (r282684) +++ head/usr.sbin/pw/pw_user.c Sat May 9 19:12:16 2015 (r282685) @@ -363,11 +363,9 @@ pw_user(struct userconf * cnf, int mode, if (mode == M_LOCK) { if (strncmp(pwd->pw_passwd, locked_str, sizeof(locked_str)-1) == 0) errx(EX_DATAERR, "user '%s' is already locked", pwd->pw_name); - passtmp = malloc(strlen(pwd->pw_passwd) + sizeof(locked_str)); + asprintf(&passtmp, "%s%s", locked_str, pwd->pw_passwd); if (passtmp == NULL) /* disaster */ errx(EX_UNAVAILABLE, "out of memory"); - strcpy(passtmp, locked_str); - strcat(passtmp, pwd->pw_passwd); pwd->pw_passwd = passtmp; edited = 1; } else if (mode == M_UNLOCK) { From owner-svn-src-head@FreeBSD.ORG Sat May 9 19:22:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5E56135; Sat, 9 May 2015 19:22: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 A4B981935; Sat, 9 May 2015 19:22: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 t49JMYMY072857; Sat, 9 May 2015 19:22:34 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49JMYi3072856; Sat, 9 May 2015 19:22:34 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505091922.t49JMYi3072856@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 May 2015 19:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282686 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 19:22:34 -0000 Author: bapt Date: Sat May 9 19:22:33 2015 New Revision: 282686 URL: https://svnweb.freebsd.org/changeset/base/282686 Log: Remove unneeded headers Modified: head/usr.sbin/pw/fileupd.c Modified: head/usr.sbin/pw/fileupd.c ============================================================================== --- head/usr.sbin/pw/fileupd.c Sat May 9 19:12:16 2015 (r282685) +++ head/usr.sbin/pw/fileupd.c Sat May 9 19:22:33 2015 (r282686) @@ -29,15 +29,7 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -#include -#include #include -#include -#include -#include -#include -#include -#include #include "pwupd.h" From owner-svn-src-head@FreeBSD.ORG Sat May 9 19:29:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E859447; Sat, 9 May 2015 19:29: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 3DB191970; Sat, 9 May 2015 19:29: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 t49JTveV074360; Sat, 9 May 2015 19:29:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49JTuBg074356; Sat, 9 May 2015 19:29:56 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505091929.t49JTuBg074356@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 May 2015 19:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282687 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 19:29:57 -0000 Author: bapt Date: Sat May 9 19:29:55 2015 New Revision: 282687 URL: https://svnweb.freebsd.org/changeset/base/282687 Log: Remove some uneeded headers Modified: head/usr.sbin/pw/grupd.c head/usr.sbin/pw/pw_nis.c head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/grupd.c ============================================================================== --- head/usr.sbin/pw/grupd.c Sat May 9 19:22:33 2015 (r282686) +++ head/usr.sbin/pw/grupd.c Sat May 9 19:29:55 2015 (r282687) @@ -35,10 +35,6 @@ static const char rcsid[] = #include #include #include -#include -#include -#include -#include #include #include "pwupd.h" Modified: head/usr.sbin/pw/pw_nis.c ============================================================================== --- head/usr.sbin/pw/pw_nis.c Sat May 9 19:22:33 2015 (r282686) +++ head/usr.sbin/pw/pw_nis.c Sat May 9 19:29:55 2015 (r282687) @@ -29,9 +29,6 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -#include -#include -#include #include #include #include Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat May 9 19:22:33 2015 (r282686) +++ head/usr.sbin/pw/pw_user.c Sat May 9 19:29:55 2015 (r282687) @@ -40,7 +40,6 @@ static const char rcsid[] = #include #include #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sat May 9 20:08:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FEECE57; Sat, 9 May 2015 20:08:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F281B1D62; Sat, 9 May 2015 20:08: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 t49K8bbx096503; Sat, 9 May 2015 20:08:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49K8a5B096499; Sat, 9 May 2015 20:08:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505092008.t49K8a5B096499@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 May 2015 20:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282690 - in head/sys: kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 20:08:38 -0000 Author: kib Date: Sat May 9 20:08:36 2015 New Revision: 282690 URL: https://svnweb.freebsd.org/changeset/base/282690 Log: The vmem callback to reclaim kmem arena address space on low or fragmented conditions currently just wakes up the pagedaemon. The kmem arena is significantly smaller then the total available physical memory, which means that there are loads where kmem arena space could be exhausted, while there is a lot of pages available still. The woken up pagedaemon sees vm_pages_needed != 0, verifies the condition vm_paging_needed() which is false, clears the pass and returns back to sleep, not calling neither uma_reclaim() nor lowmem handler. To handle low kmem arena conditions, create additional pagedaemon thread which calls uma_reclaim() directly. The thread sleeps on the dedicated channel and kmem_reclaim() wakes the thread in addition to the pagedaemon. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/kern_malloc.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/vm_pageout.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Sat May 9 19:43:48 2015 (r282689) +++ head/sys/kern/kern_malloc.c Sat May 9 20:08:36 2015 (r282690) @@ -665,13 +665,15 @@ reallocf(void *addr, unsigned long size, } /* - * Wake the page daemon when we exhaust KVA. It will call the lowmem handler - * and uma_reclaim() callbacks in a context that is safe. + * Wake the uma reclamation pagedaemon thread when we exhaust KVA. It + * will call the lowmem handler and uma_reclaim() callbacks in a + * context that is safe. */ static void kmem_reclaim(vmem_t *vm, int flags) { + uma_reclaim_wakeup(); pagedaemon_wakeup(); } Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Sat May 9 19:43:48 2015 (r282689) +++ head/sys/vm/uma.h Sat May 9 20:08:36 2015 (r282690) @@ -690,4 +690,7 @@ struct uma_percpu_stat { uint64_t _ups_reserved[5]; /* Reserved. */ }; +void uma_reclaim_wakeup(void); +void uma_reclaim_worker(void *); + #endif /* _VM_UMA_H_ */ Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat May 9 19:43:48 2015 (r282689) +++ head/sys/vm/uma_core.c Sat May 9 20:08:36 2015 (r282690) @@ -3222,16 +3222,17 @@ uma_find_refcnt(uma_zone_t zone, void *i } /* See uma.h */ -void -uma_reclaim(void) +static void +uma_reclaim_locked(bool kmem_danger) { + #ifdef UMA_DEBUG printf("UMA: vm asked us to release pages!\n"); #endif - sx_xlock(&uma_drain_lock); + sx_assert(&uma_drain_lock, SA_XLOCKED); bucket_enable(); zone_foreach(zone_drain); - if (vm_page_count_min()) { + if (vm_page_count_min() || kmem_danger) { cache_drain_safe(NULL); zone_foreach(zone_drain); } @@ -3243,9 +3244,42 @@ uma_reclaim(void) zone_drain(slabzone); zone_drain(slabrefzone); bucket_zone_drain(); +} + +void +uma_reclaim(void) +{ + + sx_xlock(&uma_drain_lock); + uma_reclaim_locked(false); sx_xunlock(&uma_drain_lock); } +static int uma_reclaim_needed; + +void +uma_reclaim_wakeup(void) +{ + + uma_reclaim_needed = 1; + wakeup(&uma_reclaim_needed); +} + +void +uma_reclaim_worker(void *arg __unused) +{ + + sx_xlock(&uma_drain_lock); + for (;;) { + sx_sleep(&uma_reclaim_needed, &uma_drain_lock, PVM, + "umarcl", 0); + if (uma_reclaim_needed) { + uma_reclaim_needed = 0; + uma_reclaim_locked(true); + } + } +} + /* See uma.h */ int uma_zone_exhausted(uma_zone_t zone) Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sat May 9 19:43:48 2015 (r282689) +++ head/sys/vm/vm_pageout.c Sat May 9 20:08:36 2015 (r282690) @@ -1724,8 +1724,9 @@ vm_pageout_init(void) static void vm_pageout(void) { + int error; #if MAXMEMDOM > 1 - int error, i; + int i; #endif swap_pager_swap_init(); @@ -1739,6 +1740,10 @@ vm_pageout(void) } } #endif + error = kthread_add(uma_reclaim_worker, NULL, curproc, NULL, + 0, 0, "uma"); + if (error != 0) + panic("starting uma_reclaim helper, error %d\n", error); vm_pageout_worker((void *)(uintptr_t)0); } From owner-svn-src-head@FreeBSD.ORG Sat May 9 20:25:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BD5A2E9 for ; Sat, 9 May 2015 20:25:40 +0000 (UTC) Received: from mail-ig0-f172.google.com (mail-ig0-f172.google.com [209.85.213.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FC521F29 for ; Sat, 9 May 2015 20:25:40 +0000 (UTC) Received: by iget9 with SMTP id t9so50258494ige.1 for ; Sat, 09 May 2015 13:25:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=hwbvr7+AZBnnmsj0c99nfNrwrxo842r/dXyVJZe2XTo=; b=enTc8aCn5eDMbWJNC59cifNgB2GJyTMosV/0zDf10NUL+a05K3ROX2EIChIJxNqZqb Uoo4elTZmVleybzLGbnT83ZrTy2aaqnem3R9WMtaM9oQMRy63hjsFduhgm2Ph8D10A08 yrJ63ZiCjIjCwVERCW5SURkUHkxyuRFdwcLNbvvKtkpiRCdL341SkUQ8NP173reakMLZ YuvLxpyqyZT4qkhxMRVtm4x0ffOSSkqp/FS8J/2vwNJLW3cW/0jeLrK4YkZxazi9S88c n/pUxXTeGNm5AVvDJwgn3HISLyHCOvrPi4dsjlZmKKPpT7+qz1syHm5egd5nUnNnLPb4 nBJg== X-Gm-Message-State: ALoCoQkuMA7yAdC+lXXAMzkMvuOGUg7rMKO0XMyogvyRMwCyty8NXvJFOY+1dWZLhXow3c/Teq9j MIME-Version: 1.0 X-Received: by 10.50.136.134 with SMTP id qa6mr6295405igb.26.1431203139462; Sat, 09 May 2015 13:25:39 -0700 (PDT) Received: by 10.79.11.6 with HTTP; Sat, 9 May 2015 13:25:39 -0700 (PDT) In-Reply-To: <201505091911.t49JB2gh067512@svn.freebsd.org> References: <201505091911.t49JB2gh067512@svn.freebsd.org> Date: Sat, 9 May 2015 22:25:39 +0200 Message-ID: Subject: Re: svn commit: r282684 - in head/sys: amd64/amd64 amd64/include x86/include x86/xen From: Oliver Pinter To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 20:25:40 -0000 Hi Konstantin! On 5/9/15, Konstantin Belousov wrote: > Author: kib > Date: Sat May 9 19:11:01 2015 > New Revision: 282684 > URL: https://svnweb.freebsd.org/changeset/base/282684 > > Log: > Rewrite amd64 PCID implementation to follow an algorithm described in > the Vahalia' "Unix Internals" section 15.12 "Other TLB Consistency > Algorithms". The same algorithm is already utilized by the MIPS pmap > to handle ASIDs. > > The PCID for the address space is now allocated per-cpu during context > switch to the thread using pmap, when no PCID on the cpu was ever > allocated, or the current PCID is invalidated. If the PCID is reused, > bit 63 of %cr3 can be set to avoid TLB flush. > > Each cpu has PCID' algorithm generation count, which is saved in the > pmap pcpu block when pcpu PCID is allocated. On invalidation, the > pmap generation count is zeroed, which signals the context switch code > that already allocated PCID is no longer valid. The implication is > the TLB shootdown for the given cpu/address space, due to the > allocation of new PCID. > > The pm_save mask is no longer has to be tracked, which (significantly) > reduces the targets of the TLB shootdown IPIs. Previously, pm_save > was reset only on pmap_invalidate_all(), which made it accumulate the > cpuids of all processors on which the thread was scheduled between > full TLB shootdowns. > > Besides reducing the amount of TLB shootdowns and removing atomics to > update pm_saves in the context switch code, the algorithm is much > simpler than the maintanence of pm_save and selection of the right > address space in the shootdown IPI handler. > > Reviewed by: alc > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 3 weeks > > Modified: > head/sys/amd64/amd64/apic_vector.S > head/sys/amd64/amd64/cpu_switch.S > head/sys/amd64/amd64/genassym.c > head/sys/amd64/amd64/machdep.c > head/sys/amd64/amd64/mp_machdep.c > head/sys/amd64/amd64/pmap.c > head/sys/amd64/amd64/vm_machdep.c > head/sys/amd64/include/cpufunc.h > head/sys/amd64/include/pcpu.h > head/sys/amd64/include/pmap.h > head/sys/amd64/include/smp.h > head/sys/x86/include/specialreg.h > head/sys/x86/xen/xen_apic.c ... The KASSERT should be ```KASSERT(pmap->pm_pcids[cpuid].pm_pcid != PMAP_PCID_KERN || pmap == kernel_pmap,``` instead of the current ```KASSERT(pmap != PMAP_PCID_KERN || pmap == kernel_pmap,```. You compared the pmap against the kernel pmap's PCID, instead of the pmap's pcid. https://github.com/freebsd/freebsd/commit/3fb738761ee4e1438402fd537fc893b44ae9312b#diff-9e67c23e66565ca69fc2e6a06631f43eR6605 From owner-svn-src-head@FreeBSD.ORG Sat May 9 21:08:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 594E2B26; Sat, 9 May 2015 21:08: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 46268130E; Sat, 9 May 2015 21:08: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 t49L8FgX026611; Sat, 9 May 2015 21:08:15 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49L8DTi026601; Sat, 9 May 2015 21:08:13 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505092108.t49L8DTi026601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 9 May 2015 21:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282693 - in head: etc/etc.arm release release/arm release/tools release/tools/arm sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 21:08:15 -0000 Author: gjb Date: Sat May 9 21:08:12 2015 New Revision: 282693 URL: https://svnweb.freebsd.org/changeset/base/282693 Log: Merge ^/projects/release-arm-redux into ^/head. Of note: - This commit adds native FreeBSD/arm release build support without requiring out-of-tree utilities. - Part of this merge removes the WANDBOARD-{SOLO,DUAL,QUAD} kernel configuration files, for which the IMX6 kernel configuration file should be used instead. - The resulting images have a 'freebsd' user (password 'freebsd'), to allow ssh(1) access when console access is not available (VGA or serial). The default 'root' user password is set to 'root'. - The /etc/ttys file for arm images now enable both ttyv0 and ttyu0 by default. Help from: many (boot testing, feedback, etc.) Sponsored by: The FreeBSD Foundation Added: head/release/arm/WANDBOARD.conf - copied, changed from r282656, projects/release-arm-redux/release/arm/WANDBOARD.conf head/release/tools/arm.subr - copied, changed from r282566, projects/release-arm-redux/release/tools/arm.subr Deleted: head/release/arm/WANDBOARD-QUAD.conf head/release/arm/ZEDBOARD.conf head/release/arm/release.sh head/release/tools/arm/ head/sys/arm/conf/WANDBOARD-DUAL head/sys/arm/conf/WANDBOARD-QUAD head/sys/arm/conf/WANDBOARD-SOLO Modified: head/etc/etc.arm/ttys head/release/arm/BEAGLEBONE.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf head/release/arm/RPI2.conf head/release/release.sh Directory Properties: head/ (props changed) Modified: head/etc/etc.arm/ttys ============================================================================== --- head/etc/etc.arm/ttys Sat May 9 20:26:32 2015 (r282692) +++ head/etc/etc.arm/ttys Sat May 9 21:08:12 2015 (r282693) @@ -29,7 +29,7 @@ # when going to single-user mode. console none unknown off secure # -ttyv0 "/usr/libexec/getty Pc" xterm off secure +ttyv0 "/usr/libexec/getty Pc" xterm onifconsole secure # Virtual terminals ttyv1 "/usr/libexec/getty Pc" xterm off secure ttyv2 "/usr/libexec/getty Pc" xterm off secure @@ -41,7 +41,7 @@ ttyv7 "/usr/libexec/getty Pc" xterm off #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 on secure +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure ttyu1 "/usr/libexec/getty std.9600" dialup off secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Sat May 9 20:26:32 2015 (r282692) +++ head/release/arm/BEAGLEBONE.conf Sat May 9 21:08:12 2015 (r282693) @@ -3,36 +3,35 @@ # $FreeBSD$ # -# Global variables. -export SVNROOT="svn://svn.FreeBSD.org/" -export SRCBRANCH="base/head@rHEAD" -export DOCBRANCH="doc/head@rHEAD" -export PORTBRANCH="ports/head@rHEAD" -export NODOC=yes -export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -export CHROOTDIR="/scratch" -export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="sysutils/u-boot-beaglebone" +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-beaglebone" +KERNEL="BEAGLEBONE" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="2m" +FAT_TYPE="12" +MD_ARGS="-x 63 -y 255" +NODOC=1 -# Build chroot configuration -load_chroot_env() { - # Avoid collision with TARGET and XDEV. - unset XDEV XDEV_ARCH KERNEL - export TARGET="amd64" - export TARGET_ARCH="amd64" -} - -# Build target configuration -load_target_env() { - # Avoid collision with TARGET and XDEV. - unset TARGET TARGET_ARCH - export EMBEDDEDPORTS="lang/python textproc/gsed" - export XDEV="arm" - export XDEV_ARCH="armv6" - export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" - export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="BEAGLEBONE" - export CROCHETSRC="https://github.com/freebsd/crochet" - export CROCHETBRANCH="trunk@rHEAD" +arm_install_uboot() { + UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone" + FATMOUNT="${DESTDIR%${KERNEL}}/fat" + UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO + chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img + chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr + chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + chroot ${CHROOTDIR} rmdir ${FATMOUNT} + chroot ${CHROOTDIR} rmdir ${UFSMOUNT} + + return 0 } Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Sat May 9 20:26:32 2015 (r282692) +++ head/release/arm/PANDABOARD.conf Sat May 9 21:08:12 2015 (r282693) @@ -3,35 +3,35 @@ # $FreeBSD$ # -# Global variables. -export SVNROOT="svn://svn.FreeBSD.org/" -export SRCBRANCH="base/head@rHEAD" -export DOCBRANCH="doc/head@rHEAD" -export PORTBRANCH="ports/head@rHEAD" -export NODOC=yes -export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -export CHROOTDIR="/scratch" -export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="lang/python textproc/gsed" +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-pandaboard" +KERNEL="PANDABOARD" +NODOC=1 +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="2m" +FAT_TYPE="12" +MD_ARGS="-x 63 -y 255" -# Build chroot configuration -load_chroot_env() { - # Avoid collision with TARGET and XDEV. - unset XDEV XDEV_ARCH KERNEL - export TARGET="amd64" - export TARGET_ARCH="amd64" -} - -# Build target configuration -load_target_env() { - # Avoid collision with TARGET and XDEV. - unset TARGET TARGET_ARCH - export XDEV="arm" - export XDEV_ARCH="armv6" - export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" - export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="PANDABOARD" - export CROCHETSRC="https://github.com/freebsd/crochet" - export CROCHETBRANCH="trunk@rHEAD" +arm_install_uboot() { + UBOOT_DIR="/usr/local/share/u-boot/u-boot-pandaboard" + FATMOUNT="${DESTDIR%${KERNEL}}/fat" + UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO + chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img + chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr + chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + chroot ${CHROOTDIR} rmdir ${FATMOUNT} + chroot ${CHROOTDIR} rmdir ${UFSMOUNT} + + return 0 } Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Sat May 9 20:26:32 2015 (r282692) +++ head/release/arm/RPI-B.conf Sat May 9 21:08:12 2015 (r282693) @@ -3,38 +3,41 @@ # $FreeBSD$ # -# Global variables. -export SVNROOT="svn://svn.FreeBSD.org/" -export SRCBRANCH="base/head@rHEAD" -export DOCBRANCH="doc/head@rHEAD" -export PORTBRANCH="ports/head@rHEAD" -export NODOC=yes -export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -export CHROOTDIR="/scratch" -export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="lang/python textproc/gsed" +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-rpi" +KERNEL="RPI-B" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="17m" +FAT_TYPE="16" +MD_ARGS="-x 63 -y 255" +NODOC=1 -# Build chroot configuration -load_chroot_env() { - # Avoid collision with TARGET and XDEV. - unset XDEV XDEV_ARCH KERNEL - export TARGET="amd64" - export TARGET_ARCH="amd64" -} - -# Build target configuration -load_target_env() { - # Avoid collision with TARGET and XDEV. - unset TARGET TARGET_ARCH - export XDEV="arm" - export XDEV_ARCH="armv6" - export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" - export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="RPI-B" - export CROCHETSRC="https://github.com/freebsd/crochet" - export CROCHETBRANCH="trunk@rHEAD" - export UBOOTSRC="https://github.com/gonzoua/u-boot-pi" - export UBOOTBRANCH="trunk" - export UBOOTDIR="/tmp/crochet/u-boot-rpi" +arm_install_uboot() { + UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi" + UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ + start.elf start_cd.elf u-boot.img" + FATMOUNT="${DESTDIR%${KERNEL}}/fat" + UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + for _UF in ${UBOOT_FILES}; do + chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ + ${FATMOUNT}/${_UF} + done + chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr + chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi.dtb \ + ${FATMOUNT}/rpi.dtb + chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + chroot ${CHROOTDIR} rmdir ${FATMOUNT} + chroot ${CHROOTDIR} rmdir ${UFSMOUNT} + + return 0 } Modified: head/release/arm/RPI2.conf ============================================================================== --- head/release/arm/RPI2.conf Sat May 9 20:26:32 2015 (r282692) +++ head/release/arm/RPI2.conf Sat May 9 21:08:12 2015 (r282693) @@ -3,36 +3,41 @@ # $FreeBSD$ # -# Global variables. -export SVNROOT="svn://svn.FreeBSD.org/" -export SRCBRANCH="base/head@rHEAD" -export DOCBRANCH="doc/head@rHEAD" -export PORTBRANCH="ports/head@rHEAD" -export NODOC=yes -export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -export CHROOTDIR="/scratch" -export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="sysutils/u-boot-rpi2" +EMBEDDEDBUILD=1 +EMBEDDED_TARGET="arm" +EMBEDDED_TARGET_ARCH="armv6" +EMBEDDEDPORTS="sysutils/u-boot-rpi2" +KERNEL="RPI2" +NODOC=1 +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" +IMAGE_SIZE="1G" +PART_SCHEME="MBR" +FAT_SIZE="50m" +FAT_TYPE="16" +MD_ARGS="-x 63 -y 255" -# Build chroot configuration -load_chroot_env() { - # Avoid collision with TARGET and XDEV. - unset XDEV XDEV_ARCH KERNEL - export TARGET="amd64" - export TARGET_ARCH="amd64" +arm_install_uboot() { + UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2" + UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ + fixup_x.dat start.elf start_cd.elf start_x.elf u-boot.bin" + FATMOUNT="${DESTDIR%${KERNEL}}/fat" + UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + for _UF in ${UBOOT_FILES}; do + chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ + ${FATMOUNT}/${_UF} + done + chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr + chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi2.dtb \ + ${FATMOUNT}/rpi2.dtb + chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + chroot ${CHROOTDIR} rmdir ${FATMOUNT} + chroot ${CHROOTDIR} rmdir ${UFSMOUNT} + + return 0 } - -# Build target configuration -load_target_env() { - # Avoid collision with TARGET and XDEV. - unset TARGET TARGET_ARCH - export XDEV="arm" - export XDEV_ARCH="armv6" - export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" - export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="RPI2" - export CROCHETSRC="https://github.com/freebsd/crochet" - export CROCHETBRANCH="trunk@rHEAD" -} - Copied and modified: head/release/arm/WANDBOARD.conf (from r282656, projects/release-arm-redux/release/arm/WANDBOARD.conf) ============================================================================== --- projects/release-arm-redux/release/arm/WANDBOARD.conf Fri May 8 18:55:09 2015 (r282656, copy source) +++ head/release/arm/WANDBOARD.conf Sat May 9 21:08:12 2015 (r282693) @@ -17,26 +17,25 @@ MD_ARGS="-x 63 -y 255" NODOC=1 arm_install_uboot() { - UBOOT_DIR="${CHROOTDIR}/usr/local/share/u-boot/u-boot-wandboard" + UBOOT_DIR="/usr/local/share/u-boot/u-boot-wandboard" UBOOT_FILES="u-boot.imx" - FATMOUNT="${DESTDIR##${KERNEL}}/fat" - UFSMOUNT="${DESTDIR##${KERNEL}}/ufs" - chroot ${CHROOTDIR} dd if=${UBOOT_DIR##${CHROOTDIR}}/${UBOOT_FILES} \ + FATMOUNT="${DESTDIR%${KERNEL}}/fat" + UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" + chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ of=/dev/${mddev} bs=512 seek=2 chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} - cp -p ${CHROOTDIR}/${UFSMOUNT}/boot/ubldr \ - ${CHROOTDIR}/${FATMOUNT}/ubldr - chroot ${CHROOTDIR} echo \ - 'setenv fdt_file wandboard-quad.dtb; fatload mmc 0:1 11000000 ubldr; bootelf 11000000;' \ - > ${FATMOUNT}/boot.txt - touch ${CHROOTDIR}/${UFSMOUNT}/firstboot + chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr + chroot ${CHROOTDIR} /bin/sh -c 'echo \ + setenv fdt_file wandboard-quad.dtb\; fatload mmc 0:1 11000000 ubldr\; bootelf 11000000\; \ + > ${FATMOUNT}/boot.txt' + chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} umount_loop ${CHROOTDIR}/${UFSMOUNT} - rmdir ${CHROOTDIR}/${FATMOUNT} - rmdir ${CHROOTDIR}/${UFSMOUNT} + chroot ${CHROOTDIR} rmdir ${FATMOUNT} + chroot ${CHROOTDIR} rmdir ${UFSMOUNT} return 0 } Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Sat May 9 20:26:32 2015 (r282692) +++ head/release/release.sh Sat May 9 21:08:12 2015 (r282693) @@ -36,257 +36,359 @@ # $FreeBSD$ # -PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" -export PATH +export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" + +VERSION=2 # Prototypes that can be redefined per-chroot or per-target. load_chroot_env() { } load_target_env() { } buildenv_setup() { } -# The directory within which the release will be built. -CHROOTDIR="/scratch" -RELENGDIR="$(realpath $(dirname $(basename ${0})))" - -# The default version control system command to obtain the sources. -VCSCMD="svn checkout" - -# The default svn checkout server, and svn branches for src/, doc/, -# and ports/. -SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" -DOCBRANCH="doc/head@rHEAD" -PORTBRANCH="ports/head@rHEAD" - -# Set for embedded device builds. -EMBEDDEDBUILD= - -# Sometimes one needs to checkout src with --force svn option. -# If custom kernel configs copied to src tree before checkout, e.g. -SRC_FORCE_CHECKOUT= - -# The default make.conf and src.conf to use. Set to /dev/null -# by default to avoid polluting the chroot(8) environment with -# non-default settings. -MAKE_CONF="/dev/null" -SRC_CONF="/dev/null" - -# The number of make(1) jobs, defaults to the number of CPUs available for -# buildworld, and half of number of CPUs available for buildkernel. -WORLD_FLAGS="-j$(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))" - -MAKE_FLAGS="-s" - -# The name of the kernel to build, defaults to GENERIC. -KERNEL="GENERIC" - -# Set to non-empty value to disable checkout of doc/ and/or ports/. Disabling -# ports/ checkout also forces NODOC to be set. -NODOC= -NOPORTS= - -# Set to non-empty value to build dvd1.iso as part of the release. -WITH_DVD= -WITH_COMPRESSED_IMAGES= - -# Set to non-empty value to build virtual machine images as part of -# the release. -WITH_VMIMAGES= -WITH_COMPRESSED_VMIMAGES= -XZ_THREADS=0 - -# Set to non-empty value to build virtual machine images for various -# cloud providers as part of the release. -WITH_CLOUDWARE= - usage() { echo "Usage: $0 [-c release.conf]" exit 1 } -while getopts c: opt; do - case ${opt} in - c) - RELEASECONF="${OPTARG}" - if [ ! -e "${RELEASECONF}" ]; then - echo "ERROR: Configuration file ${RELEASECONF} does not exist." - exit 1 - fi - # Source the specified configuration file for overrides - . ${RELEASECONF} - ;; - \?) - usage - ;; - esac -done -shift $(($OPTIND - 1)) +# env_setup(): Set up the default build environment variables, such as the +# CHROOTDIR, VCSCMD, SVNROOT, etc. This is called before the release.conf +# file is sourced, if '-c ' is specified. +env_setup() { + # The directory within which the release will be built. + CHROOTDIR="/scratch" + RELENGDIR="$(dirname $(realpath ${0}))" + + # The default version control system command to obtain the sources. + for _dir in /usr/bin /usr/local/bin; do + for _svn in svn svnlite; do + [ -x "${_dir}/${_svn}" ] && VCSCMD="${_dir}/${_svn}" + [ ! -z "${VCSCMD}" ] && break 2 + done + done + VCSCMD="${VCSCMD} checkout" + + # The default svn checkout server, and svn branches for src/, doc/, + # and ports/. + SVNROOT="svn://svn.FreeBSD.org/" + SRCBRANCH="base/head@rHEAD" + DOCBRANCH="doc/head@rHEAD" + PORTBRANCH="ports/head@rHEAD" + + # Set for embedded device builds. + EMBEDDEDBUILD= + + # Sometimes one needs to checkout src with --force svn option. + # If custom kernel configs copied to src tree before checkout, e.g. + SRC_FORCE_CHECKOUT= + + # The default make.conf and src.conf to use. Set to /dev/null + # by default to avoid polluting the chroot(8) environment with + # non-default settings. + MAKE_CONF="/dev/null" + SRC_CONF="/dev/null" + + # The number of make(1) jobs, defaults to the number of CPUs available + # for buildworld, and half of number of CPUs available for buildkernel. + WORLD_FLAGS="-j$(sysctl -n hw.ncpu)" + KERNEL_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))" + + MAKE_FLAGS="-s" + + # The name of the kernel to build, defaults to GENERIC. + KERNEL="GENERIC" + + # Set to non-empty value to disable checkout of doc/ and/or ports/. + # Disabling ports/ checkout also forces NODOC to be set. + NODOC= + NOPORTS= -# Fix for backwards-compatibility with release.conf that does not have the -# trailing '/'. -case ${SVNROOT} in - *svn*) - SVNROOT="${SVNROOT}/" - ;; - *) - ;; -esac - -# Prefix the branches with the SVNROOT for the full checkout URL. -SRCBRANCH="${SVNROOT}${SRCBRANCH}" -DOCBRANCH="${SVNROOT}${DOCBRANCH}" -PORTBRANCH="${SVNROOT}${PORTBRANCH}" - -if [ -n "${EMBEDDEDBUILD}" ]; then + # Set to non-empty value to build dvd1.iso as part of the release. WITH_DVD= WITH_COMPRESSED_IMAGES= - NODOC=yes -fi -# If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree -# is required to build the documentation set. -if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then - echo "*** NOTICE: Setting NODOC=1 since ports tree is required" - echo " and NOPORTS is set." - NODOC=yes -fi - -# If NOPORTS and/or NODOC are unset, they must not pass to make as variables. -# The release makefile verifies definedness of NOPORTS/NODOC variables -# instead of their values. -DOCPORTS= -if [ -n "${NOPORTS}" ]; then - DOCPORTS="NOPORTS=yes " -fi -if [ -n "${NODOC}" ]; then - DOCPORTS="${DOCPORTS}NODOC=yes" -fi - -# The aggregated build-time flags based upon variables defined within -# this file, unless overridden by release.conf. In most cases, these -# will not need to be changed. -CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}" -if [ -n "${TARGET}" ] && [ -n "${TARGET_ARCH}" ]; then - ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" -else - ARCH_FLAGS= -fi -load_chroot_env -CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" -CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" -CHROOT_IMAKEFLAGS="${CONF_FILES}" -CHROOT_DMAKEFLAGS="${CONF_FILES}" -RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" -RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" -RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ - ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ - WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" - -# Force src checkout if configured -FORCE_SRC_KEY= -if [ -n "${SRC_FORCE_CHECKOUT}" ]; then - FORCE_SRC_KEY="--force" -fi + # Set to non-empty value to build virtual machine images as part of + # the release. + WITH_VMIMAGES= + WITH_COMPRESSED_VMIMAGES= + XZ_THREADS=0 + + # Set to non-empty value to build virtual machine images for various + # cloud providers as part of the release. + WITH_CLOUDWARE= + + return 0 +} # env_setup() + +# env_check(): Perform sanity tests on the build environment, such as ensuring +# files/directories exist, as well as adding backwards-compatibility hacks if +# necessary. This is called unconditionally, and overrides the defaults set +# in env_setup() if '-c ' is specified. +env_check() { + chroot_build_release_cmd="chroot_build_release" + # Fix for backwards-compatibility with release.conf that does not have + # the trailing '/'. + case ${SVNROOT} in + *svn*) + SVNROOT="${SVNROOT}/" + ;; + *) + ;; + esac -if [ -z "${CHROOTDIR}" ]; then - echo "Please set CHROOTDIR." - exit 1 -fi + # Prefix the branches with the SVNROOT for the full checkout URL. + SRCBRANCH="${SVNROOT}${SRCBRANCH}" + DOCBRANCH="${SVNROOT}${DOCBRANCH}" + PORTBRANCH="${SVNROOT}${PORTBRANCH}" + + if [ -n "${EMBEDDEDBUILD}" ]; then + WITH_DVD= + WITH_COMPRESSED_IMAGES= + NODOC=yes + case ${EMBEDDED_TARGET}:${EMBEDDED_TARGET_ARCH} in + arm:armv6) + chroot_build_release_cmd="chroot_arm_armv6_build_release" + ;; + *) + esac + fi -if [ $(id -u) -ne 0 ]; then - echo "Needs to be run as root." - exit 1 -fi + # If PORTS is set and NODOC is unset, force NODOC=yes because the ports + # tree is required to build the documentation set. + if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then + echo "*** NOTICE: Setting NODOC=1 since ports tree is required" + echo " and NOPORTS is set." + NODOC=yes + fi -set -e # Everything must succeed + # If NOPORTS and/or NODOC are unset, they must not pass to make as + # variables. The release makefile verifies definedness of the + # NOPORTS/NODOC variables instead of their values. + DOCPORTS= + if [ -n "${NOPORTS}" ]; then + DOCPORTS="NOPORTS=yes " + fi + if [ -n "${NODOC}" ]; then + DOCPORTS="${DOCPORTS}NODOC=yes" + fi -mkdir -p ${CHROOTDIR}/usr + # The aggregated build-time flags based upon variables defined within + # this file, unless overridden by release.conf. In most cases, these + # will not need to be changed. + CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}" + if [ -n "${TARGET}" ] && [ -n "${TARGET_ARCH}" ]; then + ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" + else + ARCH_FLAGS= + fi + # Force src checkout if configured + FORCE_SRC_KEY= + if [ -n "${SRC_FORCE_CHECKOUT}" ]; then + FORCE_SRC_KEY="--force" + fi -if [ -z "${SRC_UPDATE_SKIP}" ]; then - ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src -fi -if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then - ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc -fi -if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then - ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports -fi - -if [ -z "${CHROOTBUILD_SKIP}" ]; then - cd ${CHROOTDIR}/usr/src - env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld - env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \ - DESTDIR=${CHROOTDIR} - env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ - DESTDIR=${CHROOTDIR} -fi -mount -t devfs devfs ${CHROOTDIR}/dev -cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf -trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit - -# If MAKE_CONF and/or SRC_CONF are set and not character devices (/dev/null), -# copy them to the chroot. -if [ -e ${MAKE_CONF} ] && [ ! -c ${MAKE_CONF} ]; then - mkdir -p ${CHROOTDIR}/$(dirname ${MAKE_CONF}) - cp ${MAKE_CONF} ${CHROOTDIR}/${MAKE_CONF} -fi -if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CONF} ]; then - mkdir -p ${CHROOTDIR}/$(dirname ${SRC_CONF}) - cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} -fi + if [ -z "${CHROOTDIR}" ]; then + echo "Please set CHROOTDIR." + exit 1 + fi -# Embedded builds do not use the 'make release' target. -if [ -n "${EMBEDDEDBUILD}" ]; then - buildenv_setup - # If a crochet configuration file exists in *this* checkout of - # release/, copy it to the /tmp/external directory within the chroot. - # This allows building embedded releases without relying on updated - # scripts and/or configurations to exist in the branch being built. - load_target_env - if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \ - [ -e ${RELENGDIR}/${XDEV}/release.sh ]; then - mkdir -p ${CHROOTDIR}/tmp/external/${XDEV}/ - cp ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf \ - ${CHROOTDIR}/tmp/external/${XDEV}/crochet-${KERNEL}.conf - /bin/sh ${RELENGDIR}/${XDEV}/release.sh - fi - # If the script does not exist for this architecture, exit. - # This probably should be checked earlier, but allowing the rest - # of the build process to get this far will at least set up the - # chroot environment for testing. - exit 0 -else - # Not embedded. - continue -fi + if [ $(id -u) -ne 0 ]; then + echo "Needs to be run as root." + exit 1 + fi + + CHROOT_MAKEENV="${CHROOT_MAKEENV} \ + MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" + CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" + CHROOT_IMAKEFLAGS="${CONF_FILES}" + CHROOT_DMAKEFLAGS="${CONF_FILES}" + RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} \ + ${CONF_FILES}" + RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} \ + KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" + RELEASE_RMAKEFLAGS="${ARCH_FLAGS} \ + KERNCONF=\"${KERNEL}\" ${CONF_FILES} ${DOCPORTS} \ + WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ + WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" + + return 0 +} # env_check() + +# chroot_setup(): Prepare the build chroot environment for the release build. +chroot_setup() { + load_chroot_env + mkdir -p ${CHROOTDIR}/usr + + if [ -z "${SRC_UPDATE_SKIP}" ]; then + ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src + fi + if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then + ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc + fi + if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then + ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports + fi + + if [ -z "${CHROOTBUILD_SKIP}" ]; then + cd ${CHROOTDIR}/usr/src + env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld + env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \ + DESTDIR=${CHROOTDIR} + env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ + DESTDIR=${CHROOTDIR} + fi -if [ -d ${CHROOTDIR}/usr/ports ]; then + return 0 +} # chroot_setup() + +# extra_chroot_setup(): Prepare anything additional within the build +# necessary for the release build. +extra_chroot_setup() { + mkdir -p ${CHROOTDIR}/dev + mount -t devfs devfs ${CHROOTDIR}/dev + [ -e /etc/resolv.conf ] && cp /etc/resolv.conf \ + ${CHROOTDIR}/etc/resolv.conf # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints # is created. This is needed by ports-mgmt/pkg. - chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart + eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart + + # If MAKE_CONF and/or SRC_CONF are set and not character devices + # (/dev/null), copy them to the chroot. + if [ -e ${MAKE_CONF} ] && [ ! -c ${MAKE_CONF} ]; then + mkdir -p ${CHROOTDIR}/$(dirname ${MAKE_CONF}) + cp ${MAKE_CONF} ${CHROOTDIR}/${MAKE_CONF} + fi + if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CONF} ]; then + mkdir -p ${CHROOTDIR}/$(dirname ${SRC_CONF}) + cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} + fi + + if [ -d ${CHROOTDIR}/usr/ports ]; then + # Trick the ports 'run-autotools-fixup' target to do the right + # thing. + _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) + REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) + BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) + UNAME_r=${REVISION}-${BRANCH} + if [ -d ${CHROOTDIR}/usr/doc ] && [ -z "${NODOC}" ]; then + PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" + PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}" + PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" + chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ + ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" \ + install clean distclean + fi + fi + + if [ ! -z "${EMBEDDEDPORTS}" ]; then + for _PORT in ${EMBEDDEDPORTS}; do + eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \ + BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean + done + fi + + buildenv_setup + + return 0 +} # extra_chroot_setup() + +# chroot_build_target(): Build the userland and kernel for the build target. +chroot_build_target() { + load_target_env + if [ ! -z "${EMBEDDEDBUILD}" ]; then + RELEASE_WMAKEFLAGS="${RELEASE_WMAKEFLAGS} \ + TARGET=${EMBEDDED_TARGET} \ + TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" + RELEASE_KMAKEFLAGS="${RELEASE_KMAKEFLAGS} \ + TARGET=${EMBEDDED_TARGET} \ + TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" + fi + eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld + eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel + + return 0 +} # chroot_build_target + +# chroot_build_release(): Invoke the 'make release' target. +chroot_build_release() { + load_target_env + eval chroot ${CHROOTDIR} make -C /usr/src/release \ + ${RELEASE_RMAKEFLAGS} release + eval chroot ${CHROOTDIR} make -C /usr/src/release \ + ${RELEASE_RMAKEFLAGS} install DESTDIR=/R \ + WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ + WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} + + return 0 +} # chroot_build_release() + +# chroot_arm_armv6_build_release(): Create arm/armv6 SD card image. +chroot_arm_armv6_build_release() { + load_target_env + eval chroot ${CHROOTDIR} make -C /usr/src/release obj + if [ -e "${RELENGDIR}/tools/${EMBEDDED_TARGET}.subr" ]; then + . "${RELENGDIR}/tools/${EMBEDDED_TARGET}.subr" + fi + [ ! -z "${RELEASECONF}" ] && . "${RELEASECONF}" + WORLDDIR="$(eval chroot ${CHROOTDIR} make -C /usr/src/release -V WORLDDIR)" + OBJDIR="$(eval chroot ${CHROOTDIR} make -C /usr/src/release -V .OBJDIR)" + DESTDIR="${OBJDIR}/${KERNEL}" + IMGBASE="${CHROOTDIR}/${OBJDIR}/${KERNEL}.img" + OSRELEASE="$(eval chroot ${CHROOTDIR} make -C /usr/src/release \ + TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ + -V OSRELEASE)" + chroot ${CHROOTDIR} mkdir -p ${DESTDIR} + chroot ${CHROOTDIR} truncate -s ${IMAGE_SIZE} ${IMGBASE##${CHROOTDIR}} + export mddev=$(chroot ${CHROOTDIR} \ + mdconfig -f ${IMGBASE##${CHROOTDIR}} ${MD_ARGS}) + arm_create_disk + arm_install_base + arm_install_uboot + mdconfig -d -u ${mddev} + chroot ${CHROOTDIR} rmdir ${DESTDIR} + mv ${IMGBASE} ${CHROOTDIR}/${OBJDIR}/${OSRELEASE}-${KERNEL}.img + chroot ${CHROOTDIR} mkdir -p /R + chroot ${CHROOTDIR} cp -p ${OBJDIR}/${OSRELEASE}-${KERNEL}.img \ + /R/${OSRELEASE}-${KERNEL}.img + chroot ${CHROOTDIR} xz -T ${XZ_THREADS} /R/${OSRELEASE}-${KERNEL}.img + cd ${CHROOTDIR}/R && sha256 ${OSRELEASE}* \ + > CHECKSUM.SHA256 + cd ${CHROOTDIR}/R && md5 ${OSRELEASE}* \ + > CHECKSUM.MD5 + + return 0 +} # chroot_arm_armv6_build_release() + +# main(): Start here. +main() { + set -e # Everything must succeed + env_setup + while getopts c: opt; do + case ${opt} in + c) + RELEASECONF="${OPTARG}" + ;; + \?) + usage + ;; + esac + done + shift $(($OPTIND - 1)) + if [ ! -z "${RELEASECONF}" ]; then + if [ -e "${RELEASECONF}" ]; then + . ${RELEASECONF} + else + echo "Nonexistent configuration file: ${RELEASECONF}" + echo "Using default build environment." + fi + fi + env_check + trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit + chroot_setup + extra_chroot_setup + chroot_build_target + ${chroot_build_release_cmd} + + return 0 +} # main() - ## Trick the ports 'run-autotools-fixup' target to do the right thing. - _OSVERSION=$(sysctl -n kern.osreldate) - REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) - BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) - UNAME_r=${REVISION}-${BRANCH} - if [ -d ${CHROOTDIR}/usr/doc ] && [ -z "${NODOC}" ]; then - PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" - PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}" - PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" - chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ - ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" \ - install clean distclean - fi -fi - -buildenv_setup -load_target_env -eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld -eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel -eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - release -eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ - WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} +main "${@}" Copied and modified: head/release/tools/arm.subr (from r282566, projects/release-arm-redux/release/tools/arm.subr) ============================================================================== --- projects/release-arm-redux/release/tools/arm.subr Wed May 6 19:58:12 2015 (r282566, copy source) +++ head/release/tools/arm.subr Sat May 9 21:08:12 2015 (r282693) @@ -64,52 +64,68 @@ umount_loop() { arm_create_disk() { # Create the target raw file and temporary work directory. - gpart create -s ${PART_SCHEME} ${IMGBASE} - gpart add -t '\!12' -a 63 -s ${FAT_SIZE} ${mddev} - gpart set -a active -i 1 ${mddev} - newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 - gpart add -t freebsd ${mddev} - gpart create -s bsd ${mddev}s2 - gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 - newfs -U -L rootfs /dev/${mddev}s2a - tunefs -j enable -N enable /dev/${mddev}s2a + chroot ${CHROOTDIR} gpart create -s ${PART_SCHEME} ${mddev} + chroot ${CHROOTDIR} gpart add -t '!12' -a 63 -s ${FAT_SIZE} ${mddev} + chroot ${CHROOTDIR} gpart set -a active -i 1 ${mddev} + chroot ${CHROOTDIR} newfs_msdos -L msdosboot -F ${FAT_TYPE} /dev/${mddev}s1 + chroot ${CHROOTDIR} gpart add -t freebsd ${mddev} + chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2 + chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2 + chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a + chroot ${CHROOTDIR} tunefs -j enable -N enable /dev/${mddev}s2a + + return 0 +} + +arm_create_user() { + # Create a default user account 'freebsd' with the password 'freebsd', + # and set the default password for the 'root' user to 'root'. + chroot ${CHROOTDIR} /usr/sbin/pw groupadd freebsd -g 1001 + chroot ${CHROOTDIR} /usr/sbin/pw useradd freebsd \ + -m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \ + -c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh' + chroot ${CHROOTDIR} /usr/sbin/pw usermod root -w yes return 0 } arm_install_base() { - mount /dev/${mddev}s2a ${DESTDIR} - cd ${WORLDDIR} && \ - eval make TARGET=${EMBEDDED_TARGET} \ - TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ - DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ - installworld installkernel distribution + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR} + eval chroot ${CHROOTDIR} make -C ${WORLDDIR} \ + TARGET=${EMBEDDED_TARGET} \ + TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ + DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ + installworld installkernel distribution + chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos + + arm_create_user echo '# Custom /etc/fstab for FreeBSD embedded images' \ - > ${DESTDIR}/etc/fstab - echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat May 9 21:24:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B6E6D23; Sat, 9 May 2015 21:24: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 89867151F; Sat, 9 May 2015 21:24: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 t49LOwlq036056; Sat, 9 May 2015 21:24:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49LOuKi036042; Sat, 9 May 2015 21:24:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505092124.t49LOuKi036042@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 9 May 2015 21:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282694 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 21:24:58 -0000 Author: andrew Date: Sat May 9 21:24:55 2015 New Revision: 282694 URL: https://svnweb.freebsd.org/changeset/base/282694 Log: Pass over the at91 kernels to reduce the diff between them. Modified: head/sys/arm/conf/BWCT head/sys/arm/conf/EB9200 head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/KB920X head/sys/arm/conf/QILA9G20 head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SN9G45 Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Sat May 9 21:08:12 2015 (r282693) +++ head/sys/arm/conf/BWCT Sat May 9 21:24:55 2015 (r282694) @@ -31,10 +31,6 @@ hints "BWCT.hints" makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options DDB -options KDB -options BREAK_TO_DEBUGGER -options ALT_BREAK_TO_DEBUGGER options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking @@ -45,43 +41,27 @@ options SOFTUPDATES # Enable FFS soft #options UFS_DIRHASH # Improve performance on big directories #options MD_ROOT # MD is a potential root device #options MD_ROOT_SIZE=4096 # 4MB ram disk -#options ROOTDEVNAME=\"ufs:md0\" -#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server #options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options BOOTP_NFSROOT -options BOOTP - -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI #options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -#options NO_SYSCTL_DESCR -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING -device loop -device random -device ether -device vlan -device uart -device ate -device mii -device rlswitch +options _KPOSIX_PRIORITY_SCHEDULING #POSIX P1003_1B real-time extensions # Debugging for use in -current +options KDB # Enable kernel debugger support +options DDB # Enable the kernel debugger #options DEADLKRES # Enable the deadlock resolver #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS @@ -89,27 +69,64 @@ device rlswitch #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC -device md -device at91_twi # TWI: Two Wire Interface -device at91_spi # SPI: -device at91_ssc -device at91_mci -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards -# iic -device iic -device iicbus +options BOOTP +options BOOTP_NFSROOT + +#options ROOTDEVNAME=\"ufs:md0\" +#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" + +# kernel/memory size reduction +options MUTEX_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +#options NO_SYSCTL_DESCR +options RWLOCK_NOINLINE + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Ethernet +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet driver +device rlswitch + +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system device ds1672 # DS1672 on I2C bus #device iicsmb # smb over i2c bridge #device smbus # Bus support, required for smb below. #device smb -# SPI bus -device spibus -#device at45d # at45db642 and maybe others -device bpf # Berkeley packet filter +# MMC/SD +device at91_mci # Atmel AT91 Multimedia Card Interface +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card + +# DataFlash +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus +#device at45d # Atmel AT45D + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device md # Memory "disks" +# Serial (COM) ports +device uart # Multi-uart driver +options BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER + +# USB support #options USB_DEBUG #device ohci #device usb #device umass # Disks/Mass storage - Requires scbus and da + +device at91_ssc Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Sat May 9 21:08:12 2015 (r282693) +++ head/sys/arm/conf/EB9200 Sat May 9 21:24:55 2015 (r282694) @@ -24,8 +24,6 @@ hints "EB9200.hints" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options DDB -options KDB options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking @@ -41,75 +39,92 @@ options NFSCL # Network Filesystem Cl options NFSD # Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options BOOTP_NFSROOT -options BOOTP - -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI #options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -#options NO_SYSCTL_DESCR +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions + +# Debugging for use in -current +options KDB # Enable kernel debugger support +options DDB # Enable the kernel debugger +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed + +# NFS root from boopt/dhcp +options BOOTP +options BOOTP_NFSROOT + # Disable the inlining of mutex, rwlock and sx locks. These eat up a lot # of space. options MUTEX_NOINLINE -options RWLOCK_NOINLINE options SX_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING -device random -device loop -device ether -device uart -device ate +#options NO_SYSCTL_DESCR +options RWLOCK_NOINLINE + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Ethernet +device ate # Atmel AT91 Ethernet driver device miibus #device lxtphy -device at91_cfata -device ata - -# Debugging for use in -current -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system +device icee -device md -device at91_twi # TWI: Two Wire Interface -device at91_spi # SPI: -device spibus # MMC/SD -device at91_mci -device mmc -device mmcsd -# iic -device iic -device iicbus -device icee +device at91_mci # Atmel AT91 Multimedia Card Interface +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card + +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device md # Memory "disks" -device bpf -# USB support -options USB_DEBUG # enable debug msgs -device ohci # OHCI localbus->USB interface -device usb # USB Bus (required) -device umass # Disks/Mass storage - Requires scbus and da # SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) +# Serial (COM) ports +device uart # Multi-uart driver + +# USB support +options USB_DEBUG # enable debug msgs +device ohci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da + # USB device (gadget) support #device at91_dci # Atmel's usb device #device usfs # emulate a flash #device cdce # emulate an ethernet #device usb_template # Control of the gadget + +device at91_cfata +device ata Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Sat May 9 21:08:12 2015 (r282693) +++ head/sys/arm/conf/ETHERNUT5 Sat May 9 21:24:55 2015 (r282694) @@ -44,13 +44,13 @@ options NFSCL # Network Filesystem Cl #options NFSD # Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) #options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme #options GEOM_PART_GPT # GUID Partition Tables. #options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 @@ -71,10 +71,24 @@ options PRINTF_BUFR_SIZE=128 # Prevent #options MAC # TrustedBSD MAC Framework #options INCLUDE_CONFIG_FILE # Include this file in kernel -# required for netbooting +# Debugging support. Always need this: +#options KDB # Enable kernel debugger support. +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use this instead: +#options DDB # Enable the kernel debugger +#options GDB # Support remote GDB +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +# NFS root from boopt/dhcp options BOOTP -options BOOTP_COMPAT options BOOTP_NFSROOT +options BOOTP_COMPAT options BOOTP_NFSV3 options BOOTP_WIRED_TO=ate0 @@ -88,20 +102,6 @@ options NO_SWAPPING options NO_SYSCTL_DESCR options RWLOCK_NOINLINE -# Debugging support. Always need this: -#options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: -#options DDB # Support DDB. -#options GDB # Support remote GDB. -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Sat May 9 21:08:12 2015 (r282693) +++ head/sys/arm/conf/HL200 Sat May 9 21:24:55 2015 (r282694) @@ -29,8 +29,6 @@ hints "KB920X.hints" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options DDB -options KDB options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking @@ -41,67 +39,92 @@ options FFS # Berkeley Fast Filesyste #options UFS_DIRHASH # Improve performance on big directories #options MD_ROOT # MD is a potential root device #options MD_ROOT_SIZE=4096 # 4MB ram disk -#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server #options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options BOOTP_NFSROOT -options BOOTP -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=ate0 -options BOOTP_COMPAT - -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI #options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -#options NO_SYSCTL_DESCR -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING -device random -device loop -device ether -device uart -device ate -device mii -device lxtphy +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions # Debugging for use in -current +options KDB # Enable kernel debugger support +options DDB # Enable the kernel debugger #options DEADLKRES # Enable the deadlock resolver #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -device md -device at91_twi # TWI: Two Wire Interface -device at91_spi # SPI: -device spibus -# MMC/SD -device at91_mci -device mmc -device mmcsd -# iic -device iic -device iicbus +options BOOTP +options BOOTP_NFSROOT +options BOOTP_COMPAT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=ate0 + +# alternatively, boot from a MMC/SD memory card +#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" + +# kernel/memory size reduction +options MUTEX_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +#options NO_SYSCTL_DESCR +options RWLOCK_NOINLINE + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Ethernet +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet driver +device lxtphy + +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system device icee -device bpf +# MMC/SD +device at91_mci # Atmel AT91 Multimedia Card Interface +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card + +# DataFlash +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device md # Memory "disks" + +# SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) + +# Serial (COM) ports +device uart # Multi-uart driver + # USB support options USB_DEBUG # enable debug msgs -device ohci # OHCI localbus->USB interface +device ohci # OHCI USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices device uhid # "Human Interface Devices" @@ -132,11 +155,7 @@ device rum # Ralink Technology RT2501 device uath # Atheros AR5523 wireless NICs device ural # Ralink Technology RT2500USB wireless NICs device zyd # ZyDAS zd1211/zd1211b wireless NICs -# SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) + # Wireless NIC cards device wlan # 802.11 support device wlan_wep # 802.11 WEP support Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Sat May 9 21:08:12 2015 (r282693) +++ head/sys/arm/conf/HL201 Sat May 9 21:24:55 2015 (r282694) @@ -27,8 +27,6 @@ include "../at91/std.hl201" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options DDB -options KDB options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking @@ -40,62 +38,86 @@ options FFS # Berkeley Fast Filesyste #options MD_ROOT # MD is a potential root device #options MD_ROOT_SIZE=4096 # 4MB ram disk options NANDFS # NAND file system -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server #options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ate0 -#options BOOTP_COMPAT - -options ALT_BREAK_TO_DEBUGGER - -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI #options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING -device random -device loop -device ether -device uart -device ate -device at91_wdt -device mii -device lxtphy - -# I2C -device at91_twi # Atmel AT91 Two-wire Interface -device iic # I2C generic I/O device driver -device iicbus # I2C bus system +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions # Debugging for use in -current +options KDB # Enable kernel debugger support +options DDB # Enable the kernel debugger #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC -device md -device bpf +# NFS root from boopt/dhcp +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ate0 + +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" + +# kernel/memory size reduction +options MUTEX_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +options RWLOCK_NOINLINE + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Ethernet +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet driver +device lxtphy + +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system + +# DataFlash +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus +device at45d # Atmel AT45D + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device md # Memory "disks" + +# SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) + +# Serial (COM) ports +device uart # Multi-uart driver +options ALT_BREAK_TO_DEBUGGER # USB support -device ohci # OHCI localbus->USB interface +device ohci # OHCI USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices device uhid # "Human Interface Devices" @@ -116,11 +138,7 @@ device miibus #device uath # Atheros AR5523 wireless NICs #device ural # Ralink Technology RT2500USB wireless NICs #device zyd # ZyDAS zd1211/zd1211b wireless NICs -# SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) + # Wireless NIC cards #device wlan # 802.11 support #device wlan_wep # 802.11 WEP support @@ -129,15 +147,12 @@ device pass # Passthrough device (dir #device wlan_amrr # AMRR transmit rate control algorithm options ROOTDEVNAME=\"ufs:da0s1a\" +# watchdog +device at91_wdt # Atmel AT91 Watchdog Timer + # NAND Flash - my board as 128MB Samsung part, YMMV. device nand # NAND interface on CS3 -# SPI: Data Flash -device at91_spi # SPI: -device spibus -device at45d # at45db642 and maybe others - - # Coming soon, but not yet options FDT options FDT_DTB_STATIC Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Sat May 9 21:08:12 2015 (r282693) +++ head/sys/arm/conf/KB920X Sat May 9 21:24:55 2015 (r282694) @@ -30,8 +30,6 @@ hints "KB920X.hints" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options DDB -options KDB options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking @@ -42,67 +40,98 @@ options FFS # Berkeley Fast Filesyste #options UFS_DIRHASH # Improve performance on big directories #options MD_ROOT # MD is a potential root device #options MD_ROOT_SIZE=4096 # 4MB ram disk -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server #options NFSLOCKD # Network Lock Manager #options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP - -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI #options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -#options NO_SYSCTL_DESCR -# Disable the inlining of mutex, rwlock and sx locks. These eat up a lot -# of space. -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options SX_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING -device random -device loop -device ether -device uart -device ate -device mii -device lxtphy +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions # Debugging for use in -current +options KDB # Enable kernel debugger support +options DDB # Enable the kernel debugger #options DEADLKRES # Enable the deadlock resolver #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -device md -device at91_twi # TWI: Two Wire Interface -device at91_spi # SPI: -device spibus -# MMC/SD -device at91_mci -device mmc -device mmcsd -# iic -device iic -device iicbus +# NFS root from boopt/dhcp +#options BOOTP +#options BOOTP_NFSROOT + +# alternatively, boot from a MMC/SD memory card +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" + +# kernel/memory size reduction +options MUTEX_NOINLINE +options SX_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +#options NO_SYSCTL_DESCR +options RWLOCK_NOINLINE + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Ethernet +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet driver +device lxtphy + +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system device icee -device bpf +# MMC/SD +device at91_mci # Atmel AT91 Multimedia Card Interface +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card + +# DataFlash +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device md # Memory "disks" + +# SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) + +# Serial (COM) ports +device uart # Multi-uart driver + +# Wireless NIC cards +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_amrr # AMRR transmit rate control algorithm + # USB support options USB_DEBUG # enable debug msgs -device ohci # OHCI localbus->USB interface +device ohci # OHCI USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices device uhid # "Human Interface Devices" @@ -132,17 +161,6 @@ device rum # Ralink Technology RT2501 device uath # Atheros AR5523 wireless NICs device ural # Ralink Technology RT2500USB wireless NICs device zyd # ZyDAS zd1211/zd1211b wireless NICs -# SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) -# Wireless NIC cards -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_amrr # AMRR transmit rate control algorithm # USB device (gadget) support device at91_dci # Atmel's usb device Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Sat May 9 21:08:12 2015 (r282693) +++ head/sys/arm/conf/QILA9G20 Sat May 9 21:24:55 2015 (r282694) @@ -30,8 +30,6 @@ hints "QILA9G20.hints" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options DDB -options KDB options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking @@ -46,76 +44,81 @@ options NFSCL # Network Filesystem Cl #options NFSD # Network Filesystem Server #options NFSLOCKD # Network Lock Manager #options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ate0 -#options BOOTP_COMPAT - -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" - -options ALT_BREAK_TO_DEBUGGER - -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) #options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI #options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions # Debugging for use in -current +options KDB # Enable kernel debugger support +options DDB # Enable the kernel debugger #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC -device random -device loop -device bpf -device ether -device md +# NFS root from boopt/dhcp +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ate0 -device uart # Serial Ports +# alternatively, boot from a MMC/SD memory card +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -# Ethernet -device ate # Ethernet Driver -device mii -option AT91_ATE_USE_RMII +# kernel/memory size reduction +options MUTEX_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +options RWLOCK_NOINLINE + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter -device at91_twi # TWI: Two Wire Interface (EEPROM) -device at91_wdt # WDT: Watchdog timer +# Ethernet +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet driver +options AT91_ATE_USE_RMII + +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system +device icee # NOTE: SPI DataFlash and mci/mmc/mmcsd have hardware # confilict on this card. Use one or the other. # see board_sam9g20ek.c -# SPI: Data Flash -#device at91_spi # SPI: -#device spibus -#device at45d # at45db642 and maybe others - # MMC/SD -device at91_mci -device mmc -device mmcsd -option AT91_MCI_HAS_4WIRE - -# iic -device iic -device iicbus -device icee +device at91_mci # Atmel AT91 Multimedia Card Interface +options AT91_MCI_HAS_4WIRE +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card + +# DataFlash +#device at91_spi # Atmel AT91 Serial Peripheral Interface +#device spibus # SPI bus +#device at45d # Atmel AT45D + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device md # Memory "disks" # SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) @@ -123,8 +126,12 @@ device da # Direct Access (disks) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) +# Serial (COM) ports +device uart # Multi-uart driver +options ALT_BREAK_TO_DEBUGGER + # USB support -device ohci # OHCI localbus->USB interface +device ohci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da device uhid # "Human Interface Devices" @@ -154,3 +161,5 @@ device udav # Davicom DM9601E USB #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm +# watchdog +device at91_wdt # Atmel AT91 Watchdog Timer Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Sat May 9 21:08:12 2015 (r282693) +++ head/sys/arm/conf/SAM9G20EK Sat May 9 21:24:55 2015 (r282694) @@ -89,7 +89,7 @@ device bpf # Berkeley packet filter # Ethernet device mii # Minimal MII support device ate # Atmel AT91 Ethernet driver -option AT91_ATE_USE_RMII +options AT91_ATE_USE_RMII # I2C device at91_twi # Atmel AT91 Two-wire Interface Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Sat May 9 21:08:12 2015 (r282693) +++ head/sys/arm/conf/SAM9X25EK Sat May 9 21:24:55 2015 (r282694) @@ -35,9 +35,6 @@ options KDB options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat May 9 21:36:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87564C5; Sat, 9 May 2015 21:36:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75F68163E; Sat, 9 May 2015 21:36:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t49Laj1s041333; Sat, 9 May 2015 21:36:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49Laj5r041331; Sat, 9 May 2015 21:36:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505092136.t49Laj5r041331@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 May 2015 21:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282696 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 21:36:45 -0000 Author: kib Date: Sat May 9 21:36:44 2015 New Revision: 282696 URL: https://svnweb.freebsd.org/changeset/base/282696 Log: Correct the assertion. We should compare the pmap' curcpu pcid value against 0, not the pmap. Noted by: Oliver Pinter Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat May 9 21:28:06 2015 (r282695) +++ head/sys/amd64/amd64/pmap.c Sat May 9 21:36:44 2015 (r282696) @@ -6602,7 +6602,8 @@ pmap_activate_sw(struct thread *td) pmap->pm_pcids[cpuid].pm_pcid < PMAP_PCID_OVERMAX, ("pmap %p cpu %d pcid %#x", pmap, cpuid, pmap->pm_pcids[cpuid].pm_pcid)); - KASSERT(pmap != PMAP_PCID_KERN || pmap == kernel_pmap, + KASSERT(pmap->pm_pcids[cpuid].pm_pcid != PMAP_PCID_KERN || + pmap == kernel_pmap, ("non-kernel pmap %p cpu %d pcid %#x", pmap, cpuid, pmap->pm_pcids[cpuid].pm_pcid)); if (!cached || (cr3 & ~CR3_PCID_MASK) != pmap->pm_cr3) { From owner-svn-src-head@FreeBSD.ORG Sat May 9 21:38:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3893C20D; Sat, 9 May 2015 21:38:07 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D03F31649; Sat, 9 May 2015 21:38:06 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t49Lc1p1023616 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 10 May 2015 00:38:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t49Lc1p1023616 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t49Lc112023615; Sun, 10 May 2015 00:38:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 10 May 2015 00:38:01 +0300 From: Konstantin Belousov To: Oliver Pinter Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282684 - in head/sys: amd64/amd64 amd64/include x86/include x86/xen Message-ID: <20150509213800.GO2390@kib.kiev.ua> References: <201505091911.t49JB2gh067512@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 21:38:07 -0000 On Sat, May 09, 2015 at 10:25:39PM +0200, Oliver Pinter wrote: > Hi Konstantin! > > On 5/9/15, Konstantin Belousov wrote: > > Author: kib > > Date: Sat May 9 19:11:01 2015 > > New Revision: 282684 > > URL: https://svnweb.freebsd.org/changeset/base/282684 > > > > Log: > > Rewrite amd64 PCID implementation to follow an algorithm described in > > the Vahalia' "Unix Internals" section 15.12 "Other TLB Consistency > > Algorithms". The same algorithm is already utilized by the MIPS pmap > > to handle ASIDs. > > > > The PCID for the address space is now allocated per-cpu during context > > switch to the thread using pmap, when no PCID on the cpu was ever > > allocated, or the current PCID is invalidated. If the PCID is reused, > > bit 63 of %cr3 can be set to avoid TLB flush. > > > > Each cpu has PCID' algorithm generation count, which is saved in the > > pmap pcpu block when pcpu PCID is allocated. On invalidation, the > > pmap generation count is zeroed, which signals the context switch code > > that already allocated PCID is no longer valid. The implication is > > the TLB shootdown for the given cpu/address space, due to the > > allocation of new PCID. > > > > The pm_save mask is no longer has to be tracked, which (significantly) > > reduces the targets of the TLB shootdown IPIs. Previously, pm_save > > was reset only on pmap_invalidate_all(), which made it accumulate the > > cpuids of all processors on which the thread was scheduled between > > full TLB shootdowns. > > > > Besides reducing the amount of TLB shootdowns and removing atomics to > > update pm_saves in the context switch code, the algorithm is much > > simpler than the maintanence of pm_save and selection of the right > > address space in the shootdown IPI handler. > > > > Reviewed by: alc > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > MFC after: 3 weeks > > > > Modified: > > head/sys/amd64/amd64/apic_vector.S > > head/sys/amd64/amd64/cpu_switch.S > > head/sys/amd64/amd64/genassym.c > > head/sys/amd64/amd64/machdep.c > > head/sys/amd64/amd64/mp_machdep.c > > head/sys/amd64/amd64/pmap.c > > head/sys/amd64/amd64/vm_machdep.c > > head/sys/amd64/include/cpufunc.h > > head/sys/amd64/include/pcpu.h > > head/sys/amd64/include/pmap.h > > head/sys/amd64/include/smp.h > > head/sys/x86/include/specialreg.h > > head/sys/x86/xen/xen_apic.c > > ... > > The KASSERT should be ```KASSERT(pmap->pm_pcids[cpuid].pm_pcid != > PMAP_PCID_KERN || pmap == kernel_pmap,``` instead of the current > ```KASSERT(pmap != PMAP_PCID_KERN || pmap == kernel_pmap,```. > > You compared the pmap against the kernel pmap's PCID, instead of the > pmap's pcid. > https://github.com/freebsd/freebsd/commit/3fb738761ee4e1438402fd537fc893b44ae9312b#diff-9e67c23e66565ca69fc2e6a06631f43eR6605 Fixed by r282696, thanks. From owner-svn-src-head@FreeBSD.ORG Sat May 9 21:53:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C466B5F8; Sat, 9 May 2015 21:53: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 B219A17FA; Sat, 9 May 2015 21:53: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 t49LrXub050791; Sat, 9 May 2015 21:53:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49LrXjJ050790; Sat, 9 May 2015 21:53:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505092153.t49LrXjJ050790@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 May 2015 21:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282697 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 21:53:33 -0000 Author: bapt Date: Sat May 9 21:53:33 2015 New Revision: 282697 URL: https://svnweb.freebsd.org/changeset/base/282697 Log: Return from the function as early as possible This reduces the depth of the if statements and improves clarity of the code Modified: head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sat May 9 21:36:44 2015 (r282696) +++ head/usr.sbin/pw/pw_conf.c Sat May 9 21:53:33 2015 (r282697) @@ -368,134 +368,133 @@ int write_userconfig(char const * file) { int fd; + int i, j; struct sbuf *buf; + FILE *fp; if (file == NULL) file = _PATH_PW_CONF; - if ((fd = open(file, O_CREAT | O_RDWR | O_TRUNC | O_EXLOCK, 0644)) != -1) { - FILE *fp; + if ((fd = open(file, O_CREAT|O_RDWR|O_TRUNC|O_EXLOCK, 0644)) == -1) + return (0); - if ((fp = fdopen(fd, "w")) == NULL) - close(fd); - else { - int i, j; + if ((fp = fdopen(fd, "w")) == NULL) { + close(fd); + return (0); + } - buf = sbuf_new_auto(); - for (i = _UC_NONE; i < _UC_FIELDS; i++) { - int quote = 1; - - sbuf_clear(buf); - switch (i) { - case _UC_DEFAULTPWD: - sbuf_cat(buf, boolean_str(config.default_password)); - break; - case _UC_REUSEUID: - sbuf_cat(buf, boolean_str(config.reuse_uids)); - break; - case _UC_REUSEGID: - sbuf_cat(buf, boolean_str(config.reuse_gids)); - break; - case _UC_NISPASSWD: - sbuf_cat(buf, config.nispasswd ? - config.nispasswd : ""); - quote = 0; - break; - case _UC_DOTDIR: - sbuf_cat(buf, config.dotdir ? - config.dotdir : boolean_str(0)); - break; - case _UC_NEWMAIL: - sbuf_cat(buf, config.newmail ? - config.newmail : boolean_str(0)); - break; - case _UC_LOGFILE: - sbuf_cat(buf, config.logfile ? - config.logfile : boolean_str(0)); - break; - case _UC_HOMEROOT: - sbuf_cat(buf, config.home); - break; - case _UC_HOMEMODE: - sbuf_printf(buf, "%04o", config.homemode); - quote = 0; - break; - case _UC_SHELLPATH: - sbuf_cat(buf, config.shelldir); - break; - case _UC_SHELLS: - for (j = 0; j < _UC_MAXSHELLS && - system_shells[j] != NULL; j++) { - sbuf_printf(buf, "%s\"%s\"", j ? - "," : "", system_shells[j]); - } - quote = 0; - break; - case _UC_DEFAULTSHELL: - sbuf_cat(buf, config.shell_default ? - config.shell_default : bourne_shell); - break; - case _UC_DEFAULTGROUP: - sbuf_cat(buf, config.default_group ? - config.default_group : ""); - break; - case _UC_EXTRAGROUPS: - extendarray(&config.groups, &config.numgroups, 200); - for (j = 0; j < config.numgroups && - config.groups[j] != NULL; j++) - sbuf_printf(buf, "%s\"%s\"", j ? - "," : "", config.groups[j]); - quote = 0; - break; - case _UC_DEFAULTCLASS: - sbuf_cat(buf, config.default_class ? - config.default_class : ""); - break; - case _UC_MINUID: - sbuf_printf(buf, "%lu", (unsigned long) config.min_uid); - quote = 0; - break; - case _UC_MAXUID: - sbuf_printf(buf, "%lu", (unsigned long) config.max_uid); - quote = 0; - break; - case _UC_MINGID: - sbuf_printf(buf, "%lu", (unsigned long) config.min_gid); - quote = 0; - break; - case _UC_MAXGID: - sbuf_printf(buf, "%lu", (unsigned long) config.max_gid); - quote = 0; - break; - case _UC_EXPIRE: - sbuf_printf(buf, "%d", config.expire_days); - quote = 0; - break; - case _UC_PASSWORD: - sbuf_printf(buf, "%d", config.password_days); - quote = 0; - break; - case _UC_NONE: - break; - } - sbuf_finish(buf); - - if (comments[i]) - fputs(comments[i], fp); - - if (*kwds[i]) { - if (quote) - fprintf(fp, "%s = \"%s\"\n", kwds[i], sbuf_data(buf)); - else - fprintf(fp, "%s = %s\n", kwds[i], sbuf_data(buf)); + buf = sbuf_new_auto(); + for (i = _UC_NONE; i < _UC_FIELDS; i++) { + int quote = 1; + + sbuf_clear(buf); + switch (i) { + case _UC_DEFAULTPWD: + sbuf_cat(buf, boolean_str(config.default_password)); + break; + case _UC_REUSEUID: + sbuf_cat(buf, boolean_str(config.reuse_uids)); + break; + case _UC_REUSEGID: + sbuf_cat(buf, boolean_str(config.reuse_gids)); + break; + case _UC_NISPASSWD: + sbuf_cat(buf, config.nispasswd ? config.nispasswd : + ""); + quote = 0; + break; + case _UC_DOTDIR: + sbuf_cat(buf, config.dotdir ? config.dotdir : + boolean_str(0)); + break; + case _UC_NEWMAIL: + sbuf_cat(buf, config.newmail ? config.newmail : + boolean_str(0)); + break; + case _UC_LOGFILE: + sbuf_cat(buf, config.logfile ? config.logfile : + boolean_str(0)); + break; + case _UC_HOMEROOT: + sbuf_cat(buf, config.home); + break; + case _UC_HOMEMODE: + sbuf_printf(buf, "%04o", config.homemode); + quote = 0; + break; + case _UC_SHELLPATH: + sbuf_cat(buf, config.shelldir); + break; + case _UC_SHELLS: + for (j = 0; j < _UC_MAXSHELLS && + system_shells[j] != NULL; j++) + sbuf_printf(buf, "%s\"%s\"", j ? + "," : "", system_shells[j]); + quote = 0; + break; + case _UC_DEFAULTSHELL: + sbuf_cat(buf, config.shell_default ? + config.shell_default : bourne_shell); + break; + case _UC_DEFAULTGROUP: + sbuf_cat(buf, config.default_group ? + config.default_group : ""); + break; + case _UC_EXTRAGROUPS: + extendarray(&config.groups, &config.numgroups, 200); + for (j = 0; j < config.numgroups && + config.groups[j] != NULL; j++) + sbuf_printf(buf, "%s\"%s\"", j ? + "," : "", config.groups[j]); + quote = 0; + break; + case _UC_DEFAULTCLASS: + sbuf_cat(buf, config.default_class ? + config.default_class : ""); + break; + case _UC_MINUID: + sbuf_printf(buf, "%lu", (unsigned long) config.min_uid); + quote = 0; + break; + case _UC_MAXUID: + sbuf_printf(buf, "%lu", (unsigned long) config.max_uid); + quote = 0; + break; + case _UC_MINGID: + sbuf_printf(buf, "%lu", (unsigned long) config.min_gid); + quote = 0; + break; + case _UC_MAXGID: + sbuf_printf(buf, "%lu", (unsigned long) config.max_gid); + quote = 0; + break; + case _UC_EXPIRE: + sbuf_printf(buf, "%d", config.expire_days); + quote = 0; + break; + case _UC_PASSWORD: + sbuf_printf(buf, "%d", config.password_days); + quote = 0; + break; + case _UC_NONE: + break; + } + sbuf_finish(buf); + + if (comments[i]) + fputs(comments[i], fp); + + if (*kwds[i]) { + if (quote) + fprintf(fp, "%s = \"%s\"\n", kwds[i], + sbuf_data(buf)); + else + fprintf(fp, "%s = %s\n", kwds[i], sbuf_data(buf)); #if debugging - printf("WROTE: %s = %s\n", kwds[i], sbuf_data(buf)); + printf("WROTE: %s = %s\n", kwds[i], sbuf_data(buf)); #endif - } - } - sbuf_delete(buf); - return fclose(fp) != EOF; } } - return 0; + sbuf_delete(buf); + return (fclose(fp) != EOF); } From owner-svn-src-head@FreeBSD.ORG Sat May 9 22:08:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CBAC9F6; Sat, 9 May 2015 22:08: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 0AF69191B; Sat, 9 May 2015 22:08: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 t49M8UMa056849; Sat, 9 May 2015 22:08:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49M8URQ056848; Sat, 9 May 2015 22:08:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505092208.t49M8URQ056848@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 May 2015 22:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282698 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 22:08:31 -0000 Author: bapt Date: Sat May 9 22:08:30 2015 New Revision: 282698 URL: https://svnweb.freebsd.org/changeset/base/282698 Log: Remove now unused LNBUFSZ buffer size Modified: head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sat May 9 21:53:33 2015 (r282697) +++ head/usr.sbin/pw/pw_conf.c Sat May 9 22:08:30 2015 (r282698) @@ -222,9 +222,6 @@ newstr(char const * p) return q; } -#define LNBUFSZ 1024 - - struct userconf * read_userconfig(char const * file) { From owner-svn-src-head@FreeBSD.ORG Sat May 9 22:43:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C56C137; Sat, 9 May 2015 22:43:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B0EB1D15; Sat, 9 May 2015 22:43:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t49MhjFk076202; Sat, 9 May 2015 22:43:45 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49MhjwS076201; Sat, 9 May 2015 22:43:45 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505092243.t49MhjwS076201@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 May 2015 22:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282699 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 22:43:45 -0000 Author: bapt Date: Sat May 9 22:43:44 2015 New Revision: 282699 URL: https://svnweb.freebsd.org/changeset/base/282699 Log: Use snprintf(3) instead of sprintf(3) Remove useless "else" Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat May 9 22:08:30 2015 (r282698) +++ head/usr.sbin/pw/pw_user.c Sat May 9 22:43:44 2015 (r282699) @@ -1018,17 +1018,16 @@ static char * pw_homepolicy(struct userconf * cnf, struct cargs * args, char const * user) { struct carg *arg = getarg(args, 'd'); + static char home[128]; if (arg) - return arg->val; - else { - static char home[128]; + return (arg->val); - if (cnf->home == NULL || *cnf->home == '\0') - errx(EX_CONFIG, "no base home directory set"); - sprintf(home, "%s/%s", cnf->home, user); - return home; - } + if (cnf->home == NULL || *cnf->home == '\0') + errx(EX_CONFIG, "no base home directory set"); + snprintf(home, sizeof(home), "%s/%s", cnf->home, user); + + return (home); } static char * From owner-svn-src-head@FreeBSD.ORG Sat May 9 22:48:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFEED2CD; Sat, 9 May 2015 22:48: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 A452D1D32; Sat, 9 May 2015 22:48: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 t49MmmcQ076941; Sat, 9 May 2015 22:48:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t49Mmmwb076940; Sat, 9 May 2015 22:48:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505092248.t49Mmmwb076940@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 May 2015 22:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282700 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 22:48:48 -0000 Author: bapt Date: Sat May 9 22:48:48 2015 New Revision: 282700 URL: https://svnweb.freebsd.org/changeset/base/282700 Log: Replace sprintf(3) with snprintf(3) Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat May 9 22:43:44 2015 (r282699) +++ head/usr.sbin/pw/pw_user.c Sat May 9 22:48:48 2015 (r282700) @@ -397,7 +397,7 @@ pw_user(struct userconf * cnf, int mode, */ snprintf(file, sizeof(file), "/var/cron/tabs/%s", pwd->pw_name); if (access(file, F_OK) == 0) { - sprintf(file, "crontab -u %s -r", pwd->pw_name); + snprintf(file, sizeof(file), "crontab -u %s -r", pwd->pw_name); system(file); } } @@ -405,7 +405,7 @@ pw_user(struct userconf * cnf, int mode, * Save these for later, since contents of pwd may be * invalidated by deletion */ - sprintf(file, "%s/%s", _PATH_MAILDIR, pwd->pw_name); + snprintf(file, sizeof(file), "%s/%s", _PATH_MAILDIR, pwd->pw_name); strlcpy(home, pwd->pw_dir, sizeof(home)); gr = GETGRGID(pwd->pw_gid); if (gr != NULL) @@ -811,7 +811,7 @@ pw_user(struct userconf * cnf, int mode, */ if (mode == M_ADD) { if (!PWALTDIR()) { - sprintf(line, "%s/%s", _PATH_MAILDIR, pwd->pw_name); + snprintf(line, sizeof(line), "%s/%s", _PATH_MAILDIR, pwd->pw_name); close(open(line, O_RDWR | O_CREAT, 0600)); /* Preserve contents & * mtime */ chown(line, pwd->pw_uid, pwd->pw_gid); @@ -955,7 +955,7 @@ pw_gidpolicy(struct userconf * cnf, stru * function will happily handle that case for us and exit. */ if (GETGRGID(prefer) == NULL) { - sprintf(tmp, "%lu", (unsigned long) prefer); + snprintf(tmp, sizeof(tmp), "%u", prefer); addarg(&grpargs, 'g', tmp); } if (getarg(args, 'N')) @@ -1048,12 +1048,12 @@ shell_path(char const * path, char *shel static char shellpath[256]; if (sh != NULL) { - sprintf(shellpath, "%s/%s", p, sh); + snprintf(shellpath, sizeof(shellpath), "%s/%s", p, sh); if (access(shellpath, X_OK) == 0) return shellpath; } else for (i = 0; i < _UC_MAXSHELLS && shells[i] != NULL; i++) { - sprintf(shellpath, "%s/%s", p, shells[i]); + snprintf(shellpath, sizeof(shellpath), "%s/%s", p, shells[i]); if (access(shellpath, X_OK) == 0) return shellpath; } @@ -1303,7 +1303,7 @@ rmat(uid_t uid) st.st_uid == uid) { char tmp[MAXPATHLEN]; - sprintf(tmp, "/usr/bin/atrm %s", e->d_name); + snprintf(tmp, sizeof(tmp), "/usr/bin/atrm %s", e->d_name); system(tmp); } } From owner-svn-src-head@FreeBSD.ORG Sat May 9 22:54:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67AE444E; Sat, 9 May 2015 22:54:12 +0000 (UTC) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [IPv6:2607:f8b0:400e:c03::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3720D1DF6; Sat, 9 May 2015 22:54:12 +0000 (UTC) Received: by pacyx8 with SMTP id yx8so79030298pac.1; Sat, 09 May 2015 15:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=GivVWLdvCZj1esIOpkdt/bg9AZ08pdgaoBQevxsDpfs=; b=Dc2e3C4SGi73mThrEhX67S8HCqcHyB11I9n51Istfgd9AsQiSU5yDAoU+aXNBrgOo8 892IVA2J2T4N5Fv/dlRD7S+zPeVHAWcJrjhEHF4JDtBrYLKBUjyIY+HzkKHCtwuhf5z+ Gxw4QP4QP8Vm9Bf7tgE3KC9eYPu7YcgIv7FEBsTWE49NZ6UCrhZNbtYZ4dfUWqXFoiNv n+bMbgfVpjgqbnMD5qXzo2p1oz0Mo0bnGCiog5j6rX7nbf9Y8MG/w8C5H+595tGN7+mn EMdpc71d813r22MboPUd/EeOwCmcm8TkdMo2w+V0g2zMLDE45jAyDy8ct2Vfy827nSqz kqiA== X-Received: by 10.68.94.129 with SMTP id dc1mr7554061pbb.8.1431212051104; Sat, 09 May 2015 15:54:11 -0700 (PDT) Received: from [192.168.20.11] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id nb10sm8891284pdb.76.2015.05.09.15.54.10 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 May 2015 15:54:10 -0700 (PDT) References: <201505091912.t49JCHRf067749@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201505091912.t49JCHRf067749@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <4DE758E7-BE6B-45D6-A184-9443FB21F4A7@gmail.com> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Mailer: iPhone Mail (12F70) From: Garrett Cooper Subject: Re: svn commit: r282685 - head/usr.sbin/pw Date: Sat, 9 May 2015 15:54:09 -0700 To: Baptiste Daroussin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 22:54:12 -0000 > On May 9, 2015, at 12:12, Baptiste Daroussin wrote: >=20 > Author: bapt > Date: Sat May 9 19:12:16 2015 > New Revision: 282685 > URL: https://svnweb.freebsd.org/changeset/base/282685 >=20 > Log: > Replace malloc(3) + strcpy(3) + strcat(3) by asprintf(3) >=20 > Modified: > head/usr.sbin/pw/pw_user.c >=20 > Modified: head/usr.sbin/pw/pw_user.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/usr.sbin/pw/pw_user.c Sat May 9 19:11:01 2015 (r282684) > +++ head/usr.sbin/pw/pw_user.c Sat May 9 19:12:16 2015 (r282685) > @@ -363,11 +363,9 @@ pw_user(struct userconf * cnf, int mode, > if (mode =3D=3D M_LOCK) { > if (strncmp(pwd->pw_passwd, locked_str, sizeof(locked_str)-1) =3D= =3D 0) > errx(EX_DATAERR, "user '%s' is already locked", pwd->pw_nam= e); > - passtmp =3D malloc(strlen(pwd->pw_passwd) + sizeof(locked_str= )); > + asprintf(&passtmp, "%s%s", locked_str, pwd->pw_passwd); > if (passtmp =3D=3D NULL) /* disaster */ > errx(EX_UNAVAILABLE, "out of memory"); > - strcpy(passtmp, locked_str); > - strcat(passtmp, pwd->pw_passwd); > pwd->pw_passwd =3D passtmp; > edited =3D 1; > } else if (mode =3D=3D M_UNLOCK) { Please check the return values from asprintf..= From owner-svn-src-head@FreeBSD.ORG Sat May 9 23:03:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E3E9754; Sat, 9 May 2015 23:03:55 +0000 (UTC) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A72C51ECB; Sat, 9 May 2015 23:03:54 +0000 (UTC) Received: by widdi4 with SMTP id di4so61106540wid.0; Sat, 09 May 2015 16:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=5/ZTR/RuNxhFoC/dw1hPmc2wfSO4TQCFzU7FWFptd1k=; b=E36rDLf/H4qMpXTHGO6u1pnbni/CwD0Y11k2yVBiBPBe/Vz18q74ZTYc9fBRCgEMwd ZSCkubJZjtgH+6get43k0q06UMMFrG90MNLkIjpGMfbrWDH+DrAH0Cjs5NmeciOz2h8O I2jGpCiwhxF17RxxTOvlA/Dj6skw4v31waEd8500lXfg6cZLMvFfjDaDxTYf0kTZ61gJ 9xtbKdYXa3t0JzP4SjVpWcAq2hYh8SizL1i3KFDSq41lDO2hQi2hK1YdLW6SZjkG06VJ /A2xHFnEwv0BfznjwZqjn/5oGvm9WLdEBB+d0v4E+jN8q0bb7e0bX3296Ynczo9aIwIj 6hTw== X-Received: by 10.194.86.101 with SMTP id o5mr8118729wjz.8.1431212632209; Sat, 09 May 2015 16:03:52 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id u9sm15351229wjx.15.2015.05.09.16.03.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 May 2015 16:03:51 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 10 May 2015 01:03:49 +0200 From: Baptiste Daroussin To: Garrett Cooper Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r282685 - head/usr.sbin/pw Message-ID: <20150509230349.GG54347@ivaldir.etoilebsd.net> References: <201505091912.t49JCHRf067749@svn.freebsd.org> <4DE758E7-BE6B-45D6-A184-9443FB21F4A7@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3xoW37o/FfUZJwQG" Content-Disposition: inline In-Reply-To: <4DE758E7-BE6B-45D6-A184-9443FB21F4A7@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 23:03:55 -0000 --3xoW37o/FfUZJwQG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 09, 2015 at 03:54:09PM -0700, Garrett Cooper wrote: >=20 > > On May 9, 2015, at 12:12, Baptiste Daroussin wrote: > >=20 > > Author: bapt > > Date: Sat May 9 19:12:16 2015 > > New Revision: 282685 > > URL: https://svnweb.freebsd.org/changeset/base/282685 > >=20 > > Log: > > Replace malloc(3) + strcpy(3) + strcat(3) by asprintf(3) > >=20 > > Modified: > > head/usr.sbin/pw/pw_user.c > >=20 > > Modified: head/usr.sbin/pw/pw_user.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.sbin/pw/pw_user.c Sat May 9 19:11:01 2015 (r282684) > > +++ head/usr.sbin/pw/pw_user.c Sat May 9 19:12:16 2015 (r282685) > > @@ -363,11 +363,9 @@ pw_user(struct userconf * cnf, int mode, > > if (mode =3D=3D M_LOCK) { > > if (strncmp(pwd->pw_passwd, locked_str, sizeof(locked_str)-1= ) =3D=3D 0) > > errx(EX_DATAERR, "user '%s' is already locked", pwd->pw_= name); > > - passtmp =3D malloc(strlen(pwd->pw_passwd) + sizeof(locked_= str)); > > + asprintf(&passtmp, "%s%s", locked_str, pwd->pw_passwd); > > if (passtmp =3D=3D NULL) /* disaster */ > > errx(EX_UNAVAILABLE, "out of memory"); > > - strcpy(passtmp, locked_str); > > - strcat(passtmp, pwd->pw_passwd); > > pwd->pw_passwd =3D passtmp; > > edited =3D 1; > > } else if (mode =3D=3D M_UNLOCK) { >=20 > Please check the return values from asprintf.. As said in the manpage: If sufficient space cannot be allocated, asprintf() and vasprintf() will return -1 and set ret to be a NULL pointer. hence:=20 if (passtmp =3D=3D NULL) /* disaster */ errx(EX_UNAVAILABLE, "out of memory"); is checking properly asprintf return. Am I missing something? Best regards, Bapt --3xoW37o/FfUZJwQG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVOklUACgkQ8kTtMUmk6EzT1wCfZ5PyvooW1rvAGbyAhEtb5nZZ f0gAoIPwR5ZjjncMVOd6dzc54Q+qGdFs =oWr7 -----END PGP SIGNATURE----- --3xoW37o/FfUZJwQG-- From owner-svn-src-head@FreeBSD.ORG Sat May 9 23:44:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 675B6A8A; Sat, 9 May 2015 23:44:39 +0000 (UTC) Received: from mail-oi0-x22b.google.com (mail-oi0-x22b.google.com [IPv6:2607:f8b0:4003:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 259EE123E; Sat, 9 May 2015 23:44:39 +0000 (UTC) Received: by oica37 with SMTP id a37so82217239oic.0; Sat, 09 May 2015 16:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to; bh=8TpVqXjz2fPzRyXCd8V/noWDHkLx8esV1Yowa0Kv/Rk=; b=dCD90o4yPrAl1/lAoYydYnFDB0xOPQeRMgl+8avjMxupFOQPyxeh+v3I76zTyQ43Sp BT+Ay2Ft83Q2T+OLIKpiSfU8queQDQPN7QQAp9SuriZ1ymjVTjoKe8ML/3b3M+i+XSgA H148zScobwWfjgWSs9kcaq3KK+sWhhKymHMZCRtWFCP9iIw/KHA4A4SnOm5ksQGXKJeo 50/UZk6UwkteJGha8bHs2Tdw5Lcr3S3AYbTNa1dXUxytbFMcZ9P/IsN2gbF88qDOVhxQ siepiYTp/RaXuF6qIPg/OE89bYO34APRuXLlV/VscfU+nDwtgcGkFcKJbZQw/ACIMmN2 1m7A== X-Received: by 10.202.0.75 with SMTP id 72mr3095000oia.131.1431215078309; Sat, 09 May 2015 16:44:38 -0700 (PDT) Received: from ?IPv6:2601:8:ab80:7d6:c4cd:f4f:4d0d:e624? ([2601:8:ab80:7d6:c4cd:f4f:4d0d:e624]) by mx.google.com with ESMTPSA id y139sm6044023oia.17.2015.05.09.16.44.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 May 2015 16:44:37 -0700 (PDT) Subject: Re: svn commit: r282685 - head/usr.sbin/pw Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_A265B449-880F-4493-8566-C147337A6B11"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Garrett Cooper In-Reply-To: <20150509230349.GG54347@ivaldir.etoilebsd.net> Date: Sat, 9 May 2015 16:44:37 -0700 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Message-Id: <1F56EC53-9C20-42CC-BD60-186675F0CDB1@gmail.com> References: <201505091912.t49JCHRf067749@svn.freebsd.org> <4DE758E7-BE6B-45D6-A184-9443FB21F4A7@gmail.com> <20150509230349.GG54347@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1878.6) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2015 23:44:39 -0000 --Apple-Mail=_A265B449-880F-4493-8566-C147337A6B11 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On May 9, 2015, at 16:03, Baptiste Daroussin wrote: > On Sat, May 09, 2015 at 03:54:09PM -0700, Garrett Cooper wrote: >>=20 >>> On May 9, 2015, at 12:12, Baptiste Daroussin = wrote: >>>=20 >>> Author: bapt >>> Date: Sat May 9 19:12:16 2015 >>> New Revision: 282685 >>> URL: https://svnweb.freebsd.org/changeset/base/282685 >>>=20 >>> Log: >>> Replace malloc(3) + strcpy(3) + strcat(3) by asprintf(3) >>>=20 >>> Modified: >>> head/usr.sbin/pw/pw_user.c >>>=20 >>> Modified: head/usr.sbin/pw/pw_user.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/usr.sbin/pw/pw_user.c Sat May 9 19:11:01 2015 = (r282684) >>> +++ head/usr.sbin/pw/pw_user.c Sat May 9 19:12:16 2015 = (r282685) >>> @@ -363,11 +363,9 @@ pw_user(struct userconf * cnf, int mode, >>> if (mode =3D=3D M_LOCK) { >>> if (strncmp(pwd->pw_passwd, locked_str, = sizeof(locked_str)-1) =3D=3D 0) >>> errx(EX_DATAERR, "user '%s' is already locked", = pwd->pw_name); >>> - passtmp =3D malloc(strlen(pwd->pw_passwd) + = sizeof(locked_str)); >>> + asprintf(&passtmp, "%s%s", locked_str, pwd->pw_passwd); >>> if (passtmp =3D=3D NULL) /* disaster */ >>> errx(EX_UNAVAILABLE, "out of memory"); >>> - strcpy(passtmp, locked_str); >>> - strcat(passtmp, pwd->pw_passwd); >>> pwd->pw_passwd =3D passtmp; >>> edited =3D 1; >>> } else if (mode =3D=3D M_UNLOCK) { >>=20 >> Please check the return values from asprintf.. >=20 > As said in the manpage: >=20 > If sufficient space cannot be allocated, asprintf() > and vasprintf() will return -1 and set ret to be a NULL pointer. >=20 > hence: > if (passtmp =3D=3D NULL) /* disaster */ > errx(EX_UNAVAILABLE, "out of memory"); >=20 > is checking properly asprintf return. >=20 > Am I missing something? Nope. Carry on! --Apple-Mail=_A265B449-880F-4493-8566-C147337A6B11 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJVTpvmAAoJEMZr5QU6S73eaRsIAJF1/S9Tn96cEBD7j6OAEpTa d/jwAkB6yAG4Hlrp180yS5ykL/oXUqpRnC0ZFtXqPeEQ+EdEf7K41BcSbjm/P0uN SDIAbxPa0yX/gqkheeS1AOcm3a/4JnVS92kv8DqwSIQeNMpYQSduYhv1xXwRw1ri UPp2M7jTZrmevvFAC/6CLYgUIqGwMc233xedrPRMinQFe5RxmECUqYEg6PBmMVXg rZNF5bW0F1Q1qcVLX1aNrh7XQU6f6SD3Vky5Gppp+V7xUZID9AGFZIzY9qqXUg9F ae1eITB9MAzy+JyhiRrNRHuGN4otFKuRjGQiGffy6UqrtiQ5tFJQifzU4sMu06I= =f79m -----END PGP SIGNATURE----- --Apple-Mail=_A265B449-880F-4493-8566-C147337A6B11--