From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 13 02:20:49 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B21B11065670; Sun, 13 Dec 2009 02:20:49 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by mx1.freebsd.org (Postfix) with ESMTP id 992488FC25; Sun, 13 Dec 2009 02:20:48 +0000 (UTC) Received: by fxm28 with SMTP id 28so468010fxm.13 for ; Sat, 12 Dec 2009 18:20:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=SHdI51NWEUx5dfd3YibMxYoPBJ7SfAl4VxtsUNIhgUk=; b=pAO98V3S2jJvhGefViD/nt98MwW6+MNPGlZ916HAfTIfqY11mBXjj7QZ2y+9gfq2ge C0zPZjiu69+qmb2Lto+uouUKYNQwIG2nc83JvvnNyjGO/9Qlxufr0W2NLbZh+slUxegu LU8IVRO6nvDPQUCdKeLIU7c9wNYbHRZsf7A60= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=uXVpCWXbucrIsU9IcllitTqI/h1p5wu5E9pSAfRjmE9He33ks1V4Sqf0BYScRTOIfS ZTi2udVTh/LAgQHtkdwQCYPpIbkRlAOgeHNT97/H++0XbPhy4htFmGFF5FQd9zU+s3am mFFhPdJfHgrhUS6P1vIy36Kn1VZKmadS+mJVs= Received: by 10.223.14.145 with SMTP id g17mr3577675faa.51.1260670847345; Sat, 12 Dec 2009 18:20:47 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 16sm1126065fxm.0.2009.12.12.18.20.45 (version=SSLv3 cipher=RC4-MD5); Sat, 12 Dec 2009 18:20:46 -0800 (PST) Sender: Alexander Motin Message-ID: <4B244F7C.1070205@FreeBSD.org> Date: Sun, 13 Dec 2009 04:20:44 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Will Andrews References: <200912102351.nBANpOKc078607@svn.freebsd.org> <4B21A4B9.3070005@FreeBSD.org> <20091213015909.GB27552@cephei.firepipe.net> In-Reply-To: <20091213015909.GB27552@cephei.firepipe.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: Maxim Sobolev , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org, svn-src-stable@FreeBSD.org Subject: Re: svn: stable/8/sbin/geom/class/mirror X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 02:20:49 -0000 Will Andrews wrote: > On Thu, Dec 10, 2009 at 05:47:37PM -0800, Maxim Sobolev wrote: >> Alexander Motin wrote: >>> Author: mav >>> Date: Thu Dec 10 23:51:24 2009 >>> New Revision: 200373 >>> URL: http://svn.freebsd.org/changeset/base/200373 >>> >>> Log: >>> MFC r200282, r200290: >>> Change gmirror default balance algorithm from "split" to improved "load". >>> "split" is very ineffective for devices with rotating media as HDDs. >>> To be effective, it needs that transfer time reduction due to block >>> splitting was bigger then access time increase due to non-sequential >>> access. For modern HDDs I was able to reproduce it only with read sizes >>> of 2MB and above, which is almost not applicable in real life. >>> "load" algorithm same time is more universal and effective now. >> The other problem with real hard drives is that they usually read much >> more data than requested. Some suggest that they read as much as one >> track each time the data is not in cache even if one sector has been >> requested, therefore splitting request of any reasonable size is >> meaningless, as it would simply cause both drives to load essentially >> the same data, wasting half of available I/O bandwidth and in addition >> you cause both heads to do seek, which makes it even worse. > > Indeed. I think the benchmarks speak for themselves. The new algorithm > results in much lower average I/O service time, due to the seek time > reduction by dispatching read requests to providers according to the known > distance from the request, and also reduced by taking advantage of the disk > cache. The disk cache size probably affects how close the requests need to > be for optimal selection, so perhaps a sysctl is warranted to allow > administrative adjustment of this value from mav@'s default of 1MB. I've took 1MB not from cache, but from track size. I've divided read speed of modern drive on number of RPMs. I doubt that disk will read more then one track ahead, and same time it is quite probable to read whole current track, as head is already there and caches are quite large now. Sure it can be made tunable, but I think it is not very important, if you won't build mirror of floppy disks. Even in worst case current algorithm will give load disbalance no more then 1 request, as distance is only a hint, not a strict rule. -- Alexander Motin From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 13 02:24:36 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E00CE106566C; Sun, 13 Dec 2009 02:24:36 +0000 (UTC) (envelope-from will@firepipe.net) Received: from mail-yw0-f172.google.com (mail-yw0-f172.google.com [209.85.211.172]) by mx1.freebsd.org (Postfix) with ESMTP id 76C948FC13; Sun, 13 Dec 2009 02:24:36 +0000 (UTC) Received: by ywh2 with SMTP id 2so2121361ywh.27 for ; Sat, 12 Dec 2009 18:24:35 -0800 (PST) Received: by 10.101.6.14 with SMTP id j14mr604952ani.135.1260669497193; Sat, 12 Dec 2009 17:58:17 -0800 (PST) Received: from cephei.firepipe.net (c-98-245-40-5.hsd1.co.comcast.net [98.245.40.5]) by mx.google.com with ESMTPS id 21sm2426751iwn.6.2009.12.12.17.58.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 12 Dec 2009 17:58:16 -0800 (PST) Date: Sat, 12 Dec 2009 18:59:11 -0700 From: Will Andrews To: Maxim Sobolev Message-ID: <20091213015909.GB27552@cephei.firepipe.net> References: <200912102351.nBANpOKc078607@svn.freebsd.org> <4B21A4B9.3070005@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline In-Reply-To: <4B21A4B9.3070005@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@FreeBSD.org, Alexander Motin , src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn: stable/8/sbin/geom/class/mirror X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 02:24:37 -0000 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 10, 2009 at 05:47:37PM -0800, Maxim Sobolev wrote: > Alexander Motin wrote: > > Author: mav > > Date: Thu Dec 10 23:51:24 2009 > > New Revision: 200373 > > URL: http://svn.freebsd.org/changeset/base/200373 > >=20 > > Log: > > MFC r200282, r200290: > > Change gmirror default balance algorithm from "split" to improved "lo= ad". > > "split" is very ineffective for devices with rotating media as HDDs. > > To be effective, it needs that transfer time reduction due to block > > splitting was bigger then access time increase due to non-sequential > > access. For modern HDDs I was able to reproduce it only with read siz= es > > of 2MB and above, which is almost not applicable in real life. > > "load" algorithm same time is more universal and effective now. >=20 > The other problem with real hard drives is that they usually read much=20 > more data than requested. Some suggest that they read as much as one=20 > track each time the data is not in cache even if one sector has been=20 > requested, therefore splitting request of any reasonable size is=20 > meaningless, as it would simply cause both drives to load essentially=20 > the same data, wasting half of available I/O bandwidth and in addition=20 > you cause both heads to do seek, which makes it even worse. Indeed. I think the benchmarks speak for themselves. The new algorithm results in much lower average I/O service time, due to the seek time reduction by dispatching read requests to providers according to the known distance from the request, and also reduced by taking advantage of the disk cache. The disk cache size probably affects how close the requests need to be for optimal selection, so perhaps a sysctl is warranted to allow administrative adjustment of this value from mav@'s default of 1MB. Regards, --=20 wca --/04w6evG8XlLl3ft Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iD8DBQFLJEpsF47idPgWcsURAr+TAJ9w2xTaZbGnaaHgxyU+skbbgO9tJwCeKpQr ezdqYqoywQehKVEpCwuJa2w= =LdnI -----END PGP SIGNATURE----- --/04w6evG8XlLl3ft-- From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 13 14:55:51 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1921065679; Sun, 13 Dec 2009 14:55:51 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B78C8FC18; Sun, 13 Dec 2009 14:55:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDEtp3v089378; Sun, 13 Dec 2009 14:55:51 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDEtpfG089376; Sun, 13 Dec 2009 14:55:51 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200912131455.nBDEtpfG089376@svn.freebsd.org> From: Robert Noland Date: Sun, 13 Dec 2009 14:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200474 - stable/8/sys/dev/drm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 14:55:51 -0000 Author: rnoland Date: Sun Dec 13 14:55:50 2009 New Revision: 200474 URL: http://svn.freebsd.org/changeset/base/200474 Log: MFC 198332 Check pointer for NULL before dereferencing it, not after. Originally committed by: brueffer Modified: stable/8/sys/dev/drm/mach64_state.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/drm/mach64_state.c ============================================================================== --- stable/8/sys/dev/drm/mach64_state.c Sun Dec 13 13:57:32 2009 (r200473) +++ stable/8/sys/dev/drm/mach64_state.c Sun Dec 13 14:55:50 2009 (r200474) @@ -826,7 +826,7 @@ int mach64_dma_vertex(struct drm_device struct drm_file *file_priv) { drm_mach64_private_t *dev_priv = dev->dev_private; - drm_mach64_sarea_t *sarea_priv = dev_priv->sarea_priv; + drm_mach64_sarea_t *sarea_priv; drm_mach64_vertex_t *vertex = data; LOCK_TEST_WITH_RETURN(dev, file_priv); @@ -835,6 +835,7 @@ int mach64_dma_vertex(struct drm_device DRM_ERROR("called with no initialization\n"); return -EINVAL; } + sarea_priv = dev_priv->sarea_priv; DRM_DEBUG("pid=%d buf=%p used=%lu discard=%d\n", DRM_CURRENTPID, From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 13 15:03:54 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE897106566C; Sun, 13 Dec 2009 15:03:54 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C4978FC15; Sun, 13 Dec 2009 15:03:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDF3sB7089631; Sun, 13 Dec 2009 15:03:54 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDF3sFC089629; Sun, 13 Dec 2009 15:03:54 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200912131503.nBDF3sFC089629@svn.freebsd.org> From: Robert Noland Date: Sun, 13 Dec 2009 15:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200475 - stable/8/sys/dev/drm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 15:03:54 -0000 Author: rnoland Date: Sun Dec 13 15:03:54 2009 New Revision: 200475 URL: http://svn.freebsd.org/changeset/base/200475 Log: MFC r198694,r198697 Some general cleanup of scatter/gather memory allocation - We don't need to check malloc return values with M_WAITOK - remove variables that we don't really need - cleanup the error paths by just calling drm_sg_cleanup() - fix drm_sg_cleanup() to be safe to call at any time Modified: stable/8/sys/dev/drm/drm_scatter.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/drm/drm_scatter.c ============================================================================== --- stable/8/sys/dev/drm/drm_scatter.c Sun Dec 13 14:55:50 2009 (r200474) +++ stable/8/sys/dev/drm/drm_scatter.c Sun Dec 13 15:03:54 2009 (r200475) @@ -47,79 +47,50 @@ drm_sg_alloc(struct drm_device *dev, str { struct drm_sg_mem *entry; struct drm_dma_handle *dmah; - unsigned long pages; int ret; if (dev->sg) return EINVAL; entry = malloc(sizeof(*entry), DRM_MEM_SGLISTS, M_WAITOK | M_ZERO); - if (!entry) - return ENOMEM; - - pages = round_page(request->size) / PAGE_SIZE; - DRM_DEBUG("sg size=%ld pages=%ld\n", request->size, pages); - - entry->pages = pages; - - entry->busaddr = malloc(pages * sizeof(*entry->busaddr), DRM_MEM_PAGES, - M_WAITOK | M_ZERO); - if (!entry->busaddr) { - free(entry, DRM_MEM_SGLISTS); - return ENOMEM; - } + entry->pages = round_page(request->size) / PAGE_SIZE; + DRM_DEBUG("sg size=%ld pages=%d\n", request->size, entry->pages); + entry->busaddr = malloc(entry->pages * sizeof(*entry->busaddr), + DRM_MEM_PAGES, M_WAITOK | M_ZERO); dmah = malloc(sizeof(struct drm_dma_handle), DRM_MEM_DMA, - M_ZERO | M_NOWAIT); - if (dmah == NULL) { - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); - return ENOMEM; - } + M_WAITOK | M_ZERO); + entry->dmah = dmah; ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */ BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ NULL, NULL, /* filtfunc, filtfuncargs */ - request->size, pages, /* maxsize, nsegs */ + request->size, entry->pages, /* maxsize, nsegs */ PAGE_SIZE, 0, /* maxsegsize, flags */ NULL, NULL, /* lockfunc, lockfuncargs */ &dmah->tag); if (ret != 0) { - free(dmah, DRM_MEM_DMA); - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); + drm_sg_cleanup(entry); return ENOMEM; } ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map); if (ret != 0) { - bus_dma_tag_destroy(dmah->tag); - free(dmah, DRM_MEM_DMA); - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); + drm_sg_cleanup(entry); return ENOMEM; } + entry->handle = (unsigned long)dmah->vaddr; + entry->virtual = dmah->vaddr; + ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, request->size, drm_sg_alloc_cb, entry, BUS_DMA_NOWAIT); if (ret != 0) { - bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); - bus_dma_tag_destroy(dmah->tag); - free(dmah, DRM_MEM_DMA); - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); + drm_sg_cleanup(entry); return ENOMEM; } - entry->dmah = dmah; - entry->handle = (unsigned long)dmah->vaddr; - - DRM_DEBUG("sg alloc handle = %08lx\n", entry->handle); - - entry->virtual = (void *)entry->handle; - request->handle = entry->handle; - DRM_LOCK(); if (dev->sg) { DRM_UNLOCK(); @@ -129,6 +100,11 @@ drm_sg_alloc(struct drm_device *dev, str dev->sg = entry; DRM_UNLOCK(); + DRM_DEBUG("handle=%08lx, kva=%p, contents=%08lx\n", entry->handle, + entry->virtual, *(unsigned long *)entry->virtual); + + request->handle = entry->handle; + return 0; } @@ -143,6 +119,8 @@ drm_sg_alloc_cb(void *arg, bus_dma_segme for(i = 0 ; i < nsegs ; i++) { entry->busaddr[i] = segs[i].ds_addr; + DRM_DEBUG("segment %d @ 0x%016lx\n", i, + (unsigned long)segs[i].ds_addr); } } @@ -162,9 +140,12 @@ drm_sg_cleanup(struct drm_sg_mem *entry) { struct drm_dma_handle *dmah = entry->dmah; - bus_dmamap_unload(dmah->tag, dmah->map); - bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); - bus_dma_tag_destroy(dmah->tag); + if (dmah->map != NULL) + bus_dmamap_unload(dmah->tag, dmah->map); + if (dmah->vaddr != NULL) + bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); + if (dmah->tag != NULL) + bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); free(entry->busaddr, DRM_MEM_PAGES); free(entry, DRM_MEM_SGLISTS); From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 13 23:56:46 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EDCD106566B; Sun, 13 Dec 2009 23:56:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CC498FC15; Sun, 13 Dec 2009 23:56:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDNuk9l001036; Sun, 13 Dec 2009 23:56:46 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDNukx7001034; Sun, 13 Dec 2009 23:56:46 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912132356.nBDNukx7001034@svn.freebsd.org> From: Doug Barton Date: Sun, 13 Dec 2009 23:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200487 - stable/8/etc/namedb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 23:56:46 -0000 Author: dougb Date: Sun Dec 13 23:56:46 2009 New Revision: 200487 URL: http://svn.freebsd.org/changeset/base/200487 Log: MFC r200377: Update to the December 12, 2008 version of this file. The one substantive change is to add the IPv6 address of L. The other changes are all CAPS LOCK related. Modified: stable/8/etc/namedb/named.root Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/namedb/named.root ============================================================================== --- stable/8/etc/namedb/named.root Sun Dec 13 23:27:08 2009 (r200486) +++ stable/8/etc/namedb/named.root Sun Dec 13 23:56:46 2009 (r200487) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Feb 04, 2008 -; related version of root zone: 2008020400 +; last update: Dec 12, 2008 +; related version of root zone: 2008121200 ; ; formerly NS.INTERNIC.NET ; @@ -22,68 +22,69 @@ A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30 ; -; formerly NS1.ISI.EDU +; FORMERLY NS1.ISI.EDU ; . 3600000 NS B.ROOT-SERVERS.NET. B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 ; -; formerly C.PSI.NET +; FORMERLY C.PSI.NET ; . 3600000 NS C.ROOT-SERVERS.NET. C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 ; -; formerly TERP.UMD.EDU +; FORMERLY TERP.UMD.EDU ; . 3600000 NS D.ROOT-SERVERS.NET. D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 ; -; formerly NS.NASA.GOV +; FORMERLY NS.NASA.GOV ; . 3600000 NS E.ROOT-SERVERS.NET. E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 ; -; formerly NS.ISC.ORG +; FORMERLY NS.ISC.ORG ; . 3600000 NS F.ROOT-SERVERS.NET. F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 -F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f +F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2F::F ; -; formerly NS.NIC.DDN.MIL +; FORMERLY NS.NIC.DDN.MIL ; . 3600000 NS G.ROOT-SERVERS.NET. G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 ; -; formerly AOS.ARL.ARMY.MIL +; FORMERLY AOS.ARL.ARMY.MIL ; . 3600000 NS H.ROOT-SERVERS.NET. H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53 -H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803f:235 +H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803F:235 ; -; formerly NIC.NORDU.NET +; FORMERLY NIC.NORDU.NET ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 ; -; operated by VeriSign, Inc. +; OPERATED BY VERISIGN, INC. ; . 3600000 NS J.ROOT-SERVERS.NET. J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30 ; -; operated by RIPE NCC +; OPERATED BY RIPE NCC ; . 3600000 NS K.ROOT-SERVERS.NET. K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 -K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1 +K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FD::1 ; -; operated by ICANN +; OPERATED BY ICANN ; . 3600000 NS L.ROOT-SERVERS.NET. L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 +L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 ; -; operated by WIDE +; OPERATED BY WIDE ; . 3600000 NS M.ROOT-SERVERS.NET. M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 -M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35 +M.ROOT-SERVERS.NET. 3600000 AAAA 2001:DC3::35 ; End of File From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 00:15:56 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 741E61065670; Mon, 14 Dec 2009 00:15:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 629258FC17; Mon, 14 Dec 2009 00:15:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBE0FufE001687; Mon, 14 Dec 2009 00:15:56 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE0Fups001685; Mon, 14 Dec 2009 00:15:56 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912140015.nBE0Fups001685@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 00:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200490 - stable/8/sys/bsm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 00:15:56 -0000 Author: rwatson Date: Mon Dec 14 00:15:56 2009 New Revision: 200490 URL: http://svn.freebsd.org/changeset/base/200490 Log: Merge r197624 from head to stable/8: Add audit events for process descriptor system calls, which will appear in a future OpenBSM release. Sponsored by: Google Obtained from: TrustedBSD Project Modified: stable/8/sys/bsm/audit_kevents.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/bsm/audit_kevents.h ============================================================================== --- stable/8/sys/bsm/audit_kevents.h Mon Dec 14 00:12:07 2009 (r200489) +++ stable/8/sys/bsm/audit_kevents.h Mon Dec 14 00:15:56 2009 (r200490) @@ -598,6 +598,10 @@ #define AUE_FSCTL 43194 /* Darwin. */ #define AUE_FFSCTL 43195 /* Darwin. */ #define AUE_LPATHCONF 43196 /* FreeBSD. */ +#define AUE_PDFORK 43197 /* FreeBSD. */ +#define AUE_PDKILL 43198 /* FreeBSD. */ +#define AUE_PDGETPID 43199 /* FreeBSD. */ +#define AUE_PDWAIT 43200 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 00:19:31 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E66D71065670; Mon, 14 Dec 2009 00:19:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB0018FC17; Mon, 14 Dec 2009 00:19:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBE0JVv4001798; Mon, 14 Dec 2009 00:19:31 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE0JV2U001795; Mon, 14 Dec 2009 00:19:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912140019.nBE0JV2U001795@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 00:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200491 - in stable/8/sys: compat/freebsd32 kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 00:19:32 -0000 Author: rwatson Date: Mon Dec 14 00:19:31 2009 New Revision: 200491 URL: http://svn.freebsd.org/changeset/base/200491 Log: Merge r197636 from head to stable/8: Reserve system call numbers for Capsicum security framework capabilities, capability mode, and process descriptors: cap_new, cap_getrights, cap_enter, cap_getmode, pdfork, pdkill, pdgetpid, and pdwait. Obtained from: TrustedBSD Project Sponsored by: Google Modified: stable/8/sys/compat/freebsd32/syscalls.master stable/8/sys/kern/syscalls.master Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/8/sys/compat/freebsd32/syscalls.master Mon Dec 14 00:15:56 2009 (r200490) +++ stable/8/sys/compat/freebsd32/syscalls.master Mon Dec 14 00:19:31 2009 (r200491) @@ -905,3 +905,11 @@ 512 AUE_SHMCTL STD { int freebsd32_shmctl(int shmid, int cmd, \ struct shmid_ds32 *buf); } 513 AUE_LPATHCONF NOPROTO { int lpathconf(char *path, int name); } +514 AUE_CAP_NEW UNIMPL cap_new +515 AUE_CAP_GETRIGHTS UNIMPL cap_getrights +516 AUE_CAP_ENTER UNIMPL cap_enter +517 AUE_CAP_GETMODE UNIMPL cap_getmode +518 AUE_PDFORK UNIMPL pdfork +519 AUE_PDKILL UNIMPL pdkill +520 AUE_PDGETPID UNIMPL pdgetpid +521 AUE_PDWAIT UNIMPL pdwait Modified: stable/8/sys/kern/syscalls.master ============================================================================== --- stable/8/sys/kern/syscalls.master Mon Dec 14 00:15:56 2009 (r200490) +++ stable/8/sys/kern/syscalls.master Mon Dec 14 00:19:31 2009 (r200491) @@ -911,5 +911,13 @@ 512 AUE_SHMCTL NOSTD { int shmctl(int shmid, int cmd, \ struct shmid_ds *buf); } 513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } +514 AUE_CAP_NEW UNIMPL cap_new +515 AUE_CAP_GETRIGHTS UNIMPL cap_getrights +516 AUE_CAP_ENTER UNIMPL cap_enter +517 AUE_CAP_GETMODE UNIMPL cap_getmode +518 AUE_PDFORK UNIMPL pdfork +519 AUE_PDKILL UNIMPL pdkill +520 AUE_PDGETPID UNIMPL pdgetpid +521 AUE_PDWAIT UNIMPL pdwait ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 00:20:49 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5791C106566C; Mon, 14 Dec 2009 00:20:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 446D38FC17; Mon, 14 Dec 2009 00:20:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBE0KnYG001880; Mon, 14 Dec 2009 00:20:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE0KmH9001870; Mon, 14 Dec 2009 00:20:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912140020.nBE0KmH9001870@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 00:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200492 - in stable/8/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 00:20:49 -0000 Author: rwatson Date: Mon Dec 14 00:20:48 2009 New Revision: 200492 URL: http://svn.freebsd.org/changeset/base/200492 Log: Regenerate sysent files after r200491. Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h stable/8/sys/compat/freebsd32/freebsd32_syscall.h stable/8/sys/compat/freebsd32/freebsd32_syscalls.c stable/8/sys/compat/freebsd32/freebsd32_sysent.c stable/8/sys/kern/init_sysent.c stable/8/sys/kern/syscalls.c stable/8/sys/sys/syscall.h stable/8/sys/sys/syscall.mk stable/8/sys/sys/sysproto.h Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_proto.h Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/compat/freebsd32/freebsd32_proto.h Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscall.h Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #define FREEBSD32_SYS_syscall 0 @@ -386,4 +386,4 @@ #define FREEBSD32_SYS_freebsd32_msgctl 511 #define FREEBSD32_SYS_freebsd32_shmctl 512 #define FREEBSD32_SYS_lpathconf 513 -#define FREEBSD32_SYS_MAXSYSCALL 514 +#define FREEBSD32_SYS_MAXSYSCALL 522 Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ const char *freebsd32_syscallnames[] = { @@ -521,4 +521,12 @@ const char *freebsd32_syscallnames[] = { "freebsd32_msgctl", /* 511 = freebsd32_msgctl */ "freebsd32_shmctl", /* 512 = freebsd32_shmctl */ "lpathconf", /* 513 = lpathconf */ + "#514", /* 514 = cap_new */ + "#515", /* 515 = cap_getrights */ + "#516", /* 516 = cap_enter */ + "#517", /* 517 = cap_getmode */ + "#518", /* 518 = pdfork */ + "#519", /* 519 = pdkill */ + "#520", /* 520 = pdgetpid */ + "#521", /* 521 = pdwait */ }; Modified: stable/8/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_sysent.c Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/compat/freebsd32/freebsd32_sysent.c Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #include "opt_compat.h" @@ -558,4 +558,12 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_msgctl_args), (sy_call_t *)freebsd32_msgctl, AUE_MSGCTL, NULL, 0, 0, 0 }, /* 511 = freebsd32_msgctl */ { AS(freebsd32_shmctl_args), (sy_call_t *)freebsd32_shmctl, AUE_SHMCTL, NULL, 0, 0, 0 }, /* 512 = freebsd32_shmctl */ { AS(lpathconf_args), (sy_call_t *)lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0 }, /* 513 = lpathconf */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 514 = cap_new */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 515 = cap_getrights */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 516 = cap_enter */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 517 = cap_getmode */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 518 = pdfork */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 519 = pdkill */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ }; Modified: stable/8/sys/kern/init_sysent.c ============================================================================== --- stable/8/sys/kern/init_sysent.c Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/kern/init_sysent.c Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #include "opt_compat.h" @@ -548,4 +548,12 @@ struct sysent sysent[] = { { AS(msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 }, /* 511 = msgctl */ { AS(shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 }, /* 512 = shmctl */ { AS(lpathconf_args), (sy_call_t *)lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0 }, /* 513 = lpathconf */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 514 = cap_new */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 515 = cap_getrights */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 516 = cap_enter */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 517 = cap_getmode */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 518 = pdfork */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 519 = pdkill */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ }; Modified: stable/8/sys/kern/syscalls.c ============================================================================== --- stable/8/sys/kern/syscalls.c Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/kern/syscalls.c Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ const char *syscallnames[] = { @@ -521,4 +521,12 @@ const char *syscallnames[] = { "msgctl", /* 511 = msgctl */ "shmctl", /* 512 = shmctl */ "lpathconf", /* 513 = lpathconf */ + "#514", /* 514 = cap_new */ + "#515", /* 515 = cap_getrights */ + "#516", /* 516 = cap_enter */ + "#517", /* 517 = cap_getmode */ + "#518", /* 518 = pdfork */ + "#519", /* 519 = pdkill */ + "#520", /* 520 = pdgetpid */ + "#521", /* 521 = pdwait */ }; Modified: stable/8/sys/sys/syscall.h ============================================================================== --- stable/8/sys/sys/syscall.h Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/sys/syscall.h Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #define SYS_syscall 0 @@ -428,4 +428,4 @@ #define SYS_msgctl 511 #define SYS_shmctl 512 #define SYS_lpathconf 513 -#define SYS_MAXSYSCALL 514 +#define SYS_MAXSYSCALL 522 Modified: stable/8/sys/sys/syscall.mk ============================================================================== --- stable/8/sys/sys/syscall.mk Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/sys/syscall.mk Mon Dec 14 00:20:48 2009 (r200492) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz +# created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson MIASM = \ syscall.o \ exit.o \ Modified: stable/8/sys/sys/sysproto.h ============================================================================== --- stable/8/sys/sys/sysproto.h Mon Dec 14 00:19:31 2009 (r200491) +++ stable/8/sys/sys/sysproto.h Mon Dec 14 00:20:48 2009 (r200492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson */ #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 01:05:40 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9C1610656A3; Mon, 14 Dec 2009 01:05:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C810D8FC30; Mon, 14 Dec 2009 01:05:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBE15eWM003068; Mon, 14 Dec 2009 01:05:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE15eY3003065; Mon, 14 Dec 2009 01:05:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912140105.nBE15eY3003065@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 01:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200494 - stable/8/contrib/expat/lib X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:05:41 -0000 Author: delphij Date: Mon Dec 14 01:05:40 2009 New Revision: 200494 URL: http://svn.freebsd.org/changeset/base/200494 Log: MFC r200392: Apply two vendor fixes for CVE-2009-3720. Security: CVE-2009-3720 Modified: stable/8/contrib/expat/lib/xmlparse.c stable/8/contrib/expat/lib/xmltok_impl.c Directory Properties: stable/8/contrib/expat/ (props changed) Modified: stable/8/contrib/expat/lib/xmlparse.c ============================================================================== --- stable/8/contrib/expat/lib/xmlparse.c Mon Dec 14 01:04:59 2009 (r200493) +++ stable/8/contrib/expat/lib/xmlparse.c Mon Dec 14 01:05:40 2009 (r200494) @@ -3725,7 +3725,6 @@ doProlog(XML_Parser parser, return XML_ERROR_NO_ELEMENTS; default: tok = -tok; - next = end; break; } } Modified: stable/8/contrib/expat/lib/xmltok_impl.c ============================================================================== --- stable/8/contrib/expat/lib/xmltok_impl.c Mon Dec 14 01:04:59 2009 (r200493) +++ stable/8/contrib/expat/lib/xmltok_impl.c Mon Dec 14 01:05:40 2009 (r200494) @@ -1744,7 +1744,7 @@ PREFIX(updatePosition)(const ENCODING *e const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 01:10:05 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AA51106566C; Mon, 14 Dec 2009 01:10:05 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7872A8FC1D; Mon, 14 Dec 2009 01:10:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBE1A5EK003330; Mon, 14 Dec 2009 01:10:05 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE1A5d3003328; Mon, 14 Dec 2009 01:10:05 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912140110.nBE1A5d3003328@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 14 Dec 2009 01:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200497 - stable/8/contrib/bind9/lib/isc/ia64/include/isc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:10:05 -0000 Author: marcel Date: Mon Dec 14 01:10:05 2009 New Revision: 200497 URL: http://svn.freebsd.org/changeset/base/200497 Log: MFC rev 200202: Fix Read-After-Write (RAW) dependency violation for ar.ccv in isc_atomic_xadd() and isc_atomic_cmpxchg(). Approved by: dougb@ Modified: stable/8/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/lib/isc/ia64/include/isc/atomic.h ============================================================================== --- stable/8/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Mon Dec 14 01:06:55 2009 (r200496) +++ stable/8/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Mon Dec 14 01:10:05 2009 (r200497) @@ -41,7 +41,7 @@ isc_atomic_xadd(isc_int32_t *p, isc_int3 for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { swapped = prev + val; __asm__ volatile( - "mov ar.ccv=%2;" + "mov ar.ccv=%2;;" "cmpxchg4.acq %0=%4,%3,ar.ccv" : "=r" (swapped), "=m" (*p) : "r" (prev), "r" (swapped), "m" (*p) @@ -84,7 +84,7 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_i isc_int32_t ret; __asm__ volatile( - "mov ar.ccv=%2;" + "mov ar.ccv=%2;;" "cmpxchg4.acq %0=%4,%3,ar.ccv" : "=r" (ret), "=m" (*p) : "r" (cmpval), "r" (val), "m" (*p) From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 10:48:20 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48C891065692; Mon, 14 Dec 2009 10:48:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 377D98FC12; Mon, 14 Dec 2009 10:48:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEAmKFs024008; Mon, 14 Dec 2009 10:48:20 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEAmKSH024006; Mon, 14 Dec 2009 10:48:20 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141048.nBEAmKSH024006@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 10:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200504 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 10:48:20 -0000 Author: rwatson Date: Mon Dec 14 10:48:19 2009 New Revision: 200504 URL: http://svn.freebsd.org/changeset/base/200504 Log: Merge r197720 from head to stable/8: Don't comment on stream socket handling in sosend_dgram, since that's not handled. Modified: stable/8/sys/kern/uipc_socket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/uipc_socket.c ============================================================================== --- stable/8/sys/kern/uipc_socket.c Mon Dec 14 07:18:31 2009 (r200503) +++ stable/8/sys/kern/uipc_socket.c Mon Dec 14 10:48:19 2009 (r200504) @@ -961,9 +961,6 @@ sosend_dgram(struct socket *so, struct s * must use a signed comparison of space and resid. On the other * hand, a negative resid causes us to loop sending 0-length * segments to the protocol. - * - * Also check to make sure that MSG_EOR isn't used on SOCK_STREAM - * type sockets since that's an error. */ if (resid < 0) { error = EINVAL; From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 11:15:47 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C88501065670; Mon, 14 Dec 2009 11:15:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B75F18FC16; Mon, 14 Dec 2009 11:15:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEBFllN024691; Mon, 14 Dec 2009 11:15:47 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEBFlMO024689; Mon, 14 Dec 2009 11:15:47 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141115.nBEBFlMO024689@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 11:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200506 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 11:15:47 -0000 Author: rwatson Date: Mon Dec 14 11:15:47 2009 New Revision: 200506 URL: http://svn.freebsd.org/changeset/base/200506 Log: Merge r198393 from head to stable/8: Improve grammar in ip_input comment while attempting to maintain what might be its meaning. (Note, merge of the revision correcting a spelling error in this commit will follow as well!) Modified: stable/8/sys/netinet/ip_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/ip_input.c ============================================================================== --- stable/8/sys/netinet/ip_input.c Mon Dec 14 11:08:21 2009 (r200505) +++ stable/8/sys/netinet/ip_input.c Mon Dec 14 11:15:47 2009 (r200506) @@ -530,8 +530,8 @@ tooshort: } if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) { /* - * Directly ship on the packet. This allows to forward - * packets that were destined for us to some other directly + * Directly ship the packet on. This allows forwarding + * packets originally destined to us to ome other directly * connected host. */ ip_forward(m, dchg); From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 11:45:54 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 474F61065670; Mon, 14 Dec 2009 11:45:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 362698FC17; Mon, 14 Dec 2009 11:45:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEBjsmb025356; Mon, 14 Dec 2009 11:45:54 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEBjsLs025354; Mon, 14 Dec 2009 11:45:54 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141145.nBEBjsLs025354@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 11:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200507 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 11:45:54 -0000 Author: rwatson Date: Mon Dec 14 11:45:53 2009 New Revision: 200507 URL: http://svn.freebsd.org/changeset/base/200507 Log: Merge r198417 from head to stable/8: Remove unneeded blank line from bpf_drvinit(). Modified: stable/8/sys/net/bpf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/bpf.c ============================================================================== --- stable/8/sys/net/bpf.c Mon Dec 14 11:15:47 2009 (r200506) +++ stable/8/sys/net/bpf.c Mon Dec 14 11:45:53 2009 (r200507) @@ -2035,7 +2035,6 @@ bpf_drvinit(void *unused) dev = make_dev(&bpf_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "bpf"); /* For compatibility */ make_dev_alias(dev, "bpf0"); - } /* From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 11:53:02 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D5F106566B; Mon, 14 Dec 2009 11:53:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 917A98FC26; Mon, 14 Dec 2009 11:53:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEBr2oQ025590; Mon, 14 Dec 2009 11:53:02 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEBr2CB025588; Mon, 14 Dec 2009 11:53:02 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141153.nBEBr2CB025588@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 11:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200508 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 11:53:02 -0000 Author: rwatson Date: Mon Dec 14 11:53:02 2009 New Revision: 200508 URL: http://svn.freebsd.org/changeset/base/200508 Log: Merge r198438 from head to stable/8: Correct spelling typo in ip_input comment. Pointed out by: N.J. Mann , John Nielsen , julian (!), lstewart Modified: stable/8/sys/netinet/ip_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/ip_input.c ============================================================================== --- stable/8/sys/netinet/ip_input.c Mon Dec 14 11:45:53 2009 (r200507) +++ stable/8/sys/netinet/ip_input.c Mon Dec 14 11:53:02 2009 (r200508) @@ -531,7 +531,7 @@ tooshort: if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) { /* * Directly ship the packet on. This allows forwarding - * packets originally destined to us to ome other directly + * packets originally destined to us to some other directly * connected host. */ ip_forward(m, dchg); From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 12:19:21 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842FA1065670; Mon, 14 Dec 2009 12:19:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72A538FC20; Mon, 14 Dec 2009 12:19:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBECJLLl026166; Mon, 14 Dec 2009 12:19:21 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBECJLfJ026164; Mon, 14 Dec 2009 12:19:21 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141219.nBECJLfJ026164@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 12:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200509 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 12:19:21 -0000 Author: rwatson Date: Mon Dec 14 12:19:21 2009 New Revision: 200509 URL: http://svn.freebsd.org/changeset/base/200509 Log: Merge r197808 from head to stable/8: In rtld's map_object(), use pread(..., 0) rather than read() to read the ELF header from the front of the file. As all other I/O on the binary is done using mmap(), this avoids the need for seek privileges on the file descriptor during run-time linking. Sponsored by: Google Modified: stable/8/libexec/rtld-elf/map_object.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/map_object.c ============================================================================== --- stable/8/libexec/rtld-elf/map_object.c Mon Dec 14 11:53:02 2009 (r200508) +++ stable/8/libexec/rtld-elf/map_object.c Mon Dec 14 12:19:21 2009 (r200509) @@ -273,7 +273,7 @@ get_elf_header (int fd, const char *path } u; ssize_t nbytes; - if ((nbytes = read(fd, u.buf, PAGE_SIZE)) == -1) { + if ((nbytes = pread(fd, u.buf, PAGE_SIZE, 0)) == -1) { _rtld_error("%s: read error: %s", path, strerror(errno)); return NULL; } From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 13:13:43 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0C171065676; Mon, 14 Dec 2009 13:13:43 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEAA78FC1B; Mon, 14 Dec 2009 13:13:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEDDhYn027410; Mon, 14 Dec 2009 13:13:43 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEDDh8Z027406; Mon, 14 Dec 2009 13:13:43 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141313.nBEDDh8Z027406@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 13:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200511 - in stable/8: lib/libc/gen lib/libc/sys sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 13:13:44 -0000 Author: rwatson Date: Mon Dec 14 13:13:43 2009 New Revision: 200511 URL: http://svn.freebsd.org/changeset/base/200511 Log: Merge r197841 from head to stable/8: Add a new errno, ENOTCAPABLE, to be returned when a process requests an operation on a file descriptor that is not authorized by the descriptor's capability flags. Sponsored by: Google Modified: stable/8/lib/libc/gen/errlst.c stable/8/lib/libc/sys/intro.2 stable/8/sys/sys/errno.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/lib/libc/gen/errlst.c ============================================================================== --- stable/8/lib/libc/gen/errlst.c Mon Dec 14 12:23:46 2009 (r200510) +++ stable/8/lib/libc/gen/errlst.c Mon Dec 14 13:13:43 2009 (r200511) @@ -150,5 +150,6 @@ const char *const sys_errlist[] = { "Multihop attempted", /* 90 - EMULTIHOP */ "Link has been severed", /* 91 - ENOLINK */ "Protocol error", /* 92 - EPROTO */ + "Capabilities insufficient", /* 93 - ENOTCAPABLE */ }; const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); Modified: stable/8/lib/libc/sys/intro.2 ============================================================================== --- stable/8/lib/libc/sys/intro.2 Mon Dec 14 12:23:46 2009 (r200510) +++ stable/8/lib/libc/sys/intro.2 Mon Dec 14 13:13:43 2009 (r200511) @@ -456,6 +456,9 @@ The specified extended attribute does no .It Er 88 EDOOFUS Em "Programming error" . A function or API is being abused in a way which could only be detected at run-time. +.It Er 93 ENOTCAPABLE Em "Capabilities insufficient" . +An operation on a capability file descriptor requires greater privilege than +the capability allows. .El .Sh DEFINITIONS .Bl -tag -width Ds Modified: stable/8/sys/sys/errno.h ============================================================================== --- stable/8/sys/sys/errno.h Mon Dec 14 12:23:46 2009 (r200510) +++ stable/8/sys/sys/errno.h Mon Dec 14 13:13:43 2009 (r200511) @@ -174,7 +174,11 @@ __END_DECLS #define EPROTO 92 /* Protocol error */ #ifndef _POSIX_SOURCE -#define ELAST 92 /* Must be equal largest errno */ +#define ENOTCAPABLE 93 /* Capabilities insufficient */ +#endif /* _POSIX_SOURCE */ + +#ifndef _POSIX_SOURCE +#define ELAST 93 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #ifdef _KERNEL From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 13:16:51 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20B9A1065672; Mon, 14 Dec 2009 13:16:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1888FC0C; Mon, 14 Dec 2009 13:16:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEDGoLF027524; Mon, 14 Dec 2009 13:16:50 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEDGoSp027522; Mon, 14 Dec 2009 13:16:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141316.nBEDGoSp027522@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 13:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200512 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 13:16:51 -0000 Author: rwatson Date: Mon Dec 14 13:16:50 2009 New Revision: 200512 URL: http://svn.freebsd.org/changeset/base/200512 Log: Merge r199270 from head to stable/8: Fix white space in rtld runtime error printf. Modified: stable/8/libexec/rtld-elf/rtld.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Mon Dec 14 13:13:43 2009 (r200511) +++ stable/8/libexec/rtld-elf/rtld.c Mon Dec 14 13:16:50 2009 (r200512) @@ -3425,7 +3425,7 @@ locate_dependency(const Obj_Entry *obj, if (object_match_name(needed->obj, name)) return needed->obj; } - _rtld_error("%s: Unexpected inconsistency: dependency %s not found", + _rtld_error("%s: Unexpected inconsistency: dependency %s not found", obj->path, name); die(); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 13:23:33 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD1AF1065670; Mon, 14 Dec 2009 13:23:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBB328FC1D; Mon, 14 Dec 2009 13:23:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEDNX8u027734; Mon, 14 Dec 2009 13:23:33 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEDNXJe027732; Mon, 14 Dec 2009 13:23:33 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912141323.nBEDNXJe027732@svn.freebsd.org> From: Robert Watson Date: Mon, 14 Dec 2009 13:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200513 - stable/8/sys/dev/fe X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 13:23:34 -0000 Author: rwatson Date: Mon Dec 14 13:23:33 2009 New Revision: 200513 URL: http://svn.freebsd.org/changeset/base/200513 Log: Merge r199798 from head to stable/8: Fix comment typo. Submitted by: Marc Balmer Modified: stable/8/sys/dev/fe/if_fe_pccard.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/fe/if_fe_pccard.c ============================================================================== --- stable/8/sys/dev/fe/if_fe_pccard.c Mon Dec 14 13:16:50 2009 (r200512) +++ stable/8/sys/dev/fe/if_fe_pccard.c Mon Dec 14 13:23:33 2009 (r200513) @@ -306,7 +306,7 @@ fe_pccard_xircom_mac(const struct pccard * Probe and initialization for TDK/CONTEC PCMCIA Ethernet interface. * by MASUI Kenji * - * (Contec uses TDK Ethenet chip -- hosokawa) + * (Contec uses TDK Ethernet chip -- hosokawa) * * This version of fe_probe_tdk has been rewrote to handle * *generic* PC Card implementation of Fujitsu MB8696x family. The From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 16:08:44 2009 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A16C31065670; Mon, 14 Dec 2009 16:08:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 319228FC08; Mon, 14 Dec 2009 16:08:43 +0000 (UTC) Received: from besplex.bde.org (c220-239-235-116.carlnfd3.nsw.optusnet.com.au [220.239.235.116]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nBEG8fhW007959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Dec 2009 03:08:42 +1100 Date: Tue, 15 Dec 2009 03:08:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Robert Watson In-Reply-To: <200912141219.nBECJLfJ026164@svn.freebsd.org> Message-ID: <20091215013718.D984@besplex.bde.org> References: <200912141219.nBECJLfJ026164@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r200509 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 16:08:44 -0000 On Mon, 14 Dec 2009, Robert Watson wrote: > Log: > Merge r197808 from head to stable/8: > > In rtld's map_object(), use pread(..., 0) rather than read() to read the > ELF header from the front of the file. As all other I/O on the binary > is done using mmap(), this avoids the need for seek privileges on the > file descriptor during run-time linking. Doesn't/shouldn't pread() require seek privileges? It certainly uses them. BTW, its man page contradicts and/or is incomplete about what happens for unseekable files: % On objects capable of seeking, the read() starts at a position given by ^^^^^^^^^^^^^^^^^^^^^^ Should say "read() and readv() start at the" % the pointer associated with d (see lseek(2)). Upon return from read(), ... or readv() % the pointer is incremented by the number of bytes actually read. % % Objects that are not capable of seeking always read from the current % position. The value of the pointer associated with such an object is % undefined. The second paragraph applies to all members of the read() family (though perhaps it was only intended intended to apply to read() and readv() like it did before pread() existed), and is wrong for pread() and preadv(). Instead, pread() attemps to determine seekability using the DFLAG_SEEKABLE flag in the same way as lseek(); if this is set, then pread() correctly determines non-seekability and returns ESPIPE, but if this is not set the pread() assumes that the file is seekable even if it isn't, and I think the error is not detected later. (For the corresponding bug in lseek(2), the error is certainly not detected later, since there is no "later". pread() is presumably bug for bug compatible with this and reads from the current non-position for unseekable files when the error is not detected.) % ERRORS % The read(), readv(), pread() and preadv() system calls will succeed % unless: % ... % The pread() and preadv() system calls may also return the following % errors: % % [EINVAL] The offset value was negative. % % [ESPIPE] The file descriptor is associated with a pipe, socket, % or FIFO. This says that pread() may work correctly for some non-seekable files. Since it only says "may", it doesn't quite contradict the above. Also, the list of file types for which it may work correctly is incomplete. It is unclear exactly which file types work correctly, since DFLAG_SEEKABLE is set for all files of type "vnop" (see struct fileops vnops). I think this covers lots of unseekable irregular regular files in weird file systems like procfs. It is also set for all device files, but most devices aren't seekable. It is not set for uipc shm and sem files, so I think ESPIPE can be returned for these file types, contradicting the above and the corresponding list in lseek.2, but this is unimportant since pread[v] would fail with EOPNOTSUPP if it got past the ESPIPE. Similarly for write.2 and lseek.2. Extra for lseek.2: it says "some devices are incapable of seeking" where it should say "some files are incapable of seeking" and/or give more details as above (even current man page for pread gives more details relevant to lseek than does lseek's man page!). Extra for write.2 (unrelated): where read.2 gives some details for short reads (it says that they don't happen for "normal" files, write.2 says less and doesn't mention "normal" files, but it should say more because "normal" operation is more important. Which files are normal is undocumented and unclear. Bruce From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 17:42:41 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C1C5106566C; Mon, 14 Dec 2009 17:42:41 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 191128FC1B; Mon, 14 Dec 2009 17:42:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEHgeHu033133; Mon, 14 Dec 2009 17:42:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEHgeFZ033132; Mon, 14 Dec 2009 17:42:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912141742.nBEHgeFZ033132@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 14 Dec 2009 17:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200517 - stable/8/sys/dev/puc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 17:42:41 -0000 Author: marcel Date: Mon Dec 14 17:42:40 2009 New Revision: 200517 URL: http://svn.freebsd.org/changeset/base/200517 Log: MFC rev 200397: Fix interrupt handling. PR: kern/140947 Modified: stable/8/sys/dev/puc/puc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/puc/puc.c ============================================================================== --- stable/8/sys/dev/puc/puc.c Mon Dec 14 17:04:44 2009 (r200516) +++ stable/8/sys/dev/puc/puc.c Mon Dec 14 17:42:40 2009 (r200517) @@ -129,62 +129,78 @@ puc_intr(void *arg) { struct puc_port *port; struct puc_softc *sc = arg; - u_long dev, devs; - int i, idx, ipend, isrc; + u_long ds, dev, devs; + int i, idx, ipend, isrc, nints; uint8_t ilr; - devs = sc->sc_serdevs; - if (sc->sc_ilr == PUC_ILR_DIGI) { - idx = 0; - while (devs & (0xfful << idx)) { - ilr = ~bus_read_1(sc->sc_port[idx].p_rres, 7); - devs &= ~0ul ^ ((u_long)ilr << idx); - idx += 8; - } - } else if (sc->sc_ilr == PUC_ILR_QUATECH) { + nints = 0; + while (1) { /* - * Don't trust the value if it's the same as the option - * register. It may mean that the ILR is not active and - * we're reading the option register instead. This may - * lead to false positives on 8-port boards. + * Obtain the set of devices with pending interrupts. */ - ilr = bus_read_1(sc->sc_port[0].p_rres, 7); - if (ilr != (sc->sc_cfg_data & 0xff)) - devs &= (u_long)ilr; - } - - ipend = 0; - idx = 0, dev = 1UL; - while (devs != 0UL) { - while ((devs & dev) == 0UL) - idx++, dev <<= 1; - devs &= ~dev; - port = &sc->sc_port[idx]; - port->p_ipend = SERDEV_IPEND(port->p_dev); - ipend |= port->p_ipend; - } + devs = sc->sc_serdevs; + if (sc->sc_ilr == PUC_ILR_DIGI) { + idx = 0; + while (devs & (0xfful << idx)) { + ilr = ~bus_read_1(sc->sc_port[idx].p_rres, 7); + devs &= ~0ul ^ ((u_long)ilr << idx); + idx += 8; + } + } else if (sc->sc_ilr == PUC_ILR_QUATECH) { + /* + * Don't trust the value if it's the same as the option + * register. It may mean that the ILR is not active and + * we're reading the option register instead. This may + * lead to false positives on 8-port boards. + */ + ilr = bus_read_1(sc->sc_port[0].p_rres, 7); + if (ilr != (sc->sc_cfg_data & 0xff)) + devs &= (u_long)ilr; + } + if (devs == 0UL) + break; - i = 0, isrc = SER_INT_OVERRUN; - while (ipend) { - while (i < PUC_ISRCCNT && !(ipend & isrc)) - i++, isrc <<= 1; - KASSERT(i < PUC_ISRCCNT, ("%s", __func__)); - ipend &= ~isrc; + /* + * Obtain the set of interrupt sources from those devices + * that have pending interrupts. + */ + ipend = 0; idx = 0, dev = 1UL; - devs = sc->sc_serdevs; - while (devs != 0UL) { - while ((devs & dev) == 0UL) + ds = devs; + while (ds != 0UL) { + while ((ds & dev) == 0UL) idx++, dev <<= 1; - devs &= ~dev; + ds &= ~dev; port = &sc->sc_port[idx]; - if (!(port->p_ipend & isrc)) - continue; - if (port->p_ihsrc[i] != NULL) - (*port->p_ihsrc[i])(port->p_iharg); + port->p_ipend = SERDEV_IPEND(port->p_dev); + ipend |= port->p_ipend; + } + if (ipend == 0) + break; + + i = 0, isrc = SER_INT_OVERRUN; + while (ipend) { + while (i < PUC_ISRCCNT && !(ipend & isrc)) + i++, isrc <<= 1; + KASSERT(i < PUC_ISRCCNT, ("%s", __func__)); + ipend &= ~isrc; + idx = 0, dev = 1UL; + ds = devs; + while (ds != 0UL) { + while ((ds & dev) == 0UL) + idx++, dev <<= 1; + ds &= ~dev; + port = &sc->sc_port[idx]; + if (!(port->p_ipend & isrc)) + continue; + if (port->p_ihsrc[i] != NULL) + (*port->p_ihsrc[i])(port->p_iharg); + nints++; + } } - return (FILTER_HANDLED); } - return (FILTER_STRAY); + + return ((nints > 0) ? FILTER_HANDLED : FILTER_STRAY); } int From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 21:50:35 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33DF91065672; Mon, 14 Dec 2009 21:50:35 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22AEB8FC14; Mon, 14 Dec 2009 21:50:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBELoZS1039479; Mon, 14 Dec 2009 21:50:35 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBELoZRH039477; Mon, 14 Dec 2009 21:50:35 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912142150.nBELoZRH039477@svn.freebsd.org> From: Doug Barton Date: Mon, 14 Dec 2009 21:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200546 - stable/8/contrib/bind9/bin/dig X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 21:50:35 -0000 Author: dougb Date: Mon Dec 14 21:50:34 2009 New Revision: 200546 URL: http://svn.freebsd.org/changeset/base/200546 Log: Wrap some socket handling code in a !NULL bow This patch or something similar will likely be included in a future BIND release. PR: bin/138061 Submitted by: Michael Baker Original patch submitted by: Volker Patch reviewed and tweaked by: ISC Modified: stable/8/contrib/bind9/bin/dig/dighost.c Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/bin/dig/dighost.c ============================================================================== --- stable/8/contrib/bind9/bin/dig/dighost.c Mon Dec 14 21:16:02 2009 (r200545) +++ stable/8/contrib/bind9/bin/dig/dighost.c Mon Dec 14 21:50:34 2009 (r200546) @@ -2604,10 +2604,12 @@ connect_done(isc_task_t *task, isc_event if (sevent->result == ISC_R_CANCELED) { debug("in cancel handler"); - isc_socket_detach(&query->sock); - sockcount--; - INSIST(sockcount >= 0); - debug("sockcount=%d", sockcount); + if (query->sock != NULL) { + isc_socket_detach(&query->sock); + sockcount--; + INSIST(sockcount >= 0); + debug("sockcount=%d", sockcount); + } query->waiting_connect = ISC_FALSE; isc_event_free(&event); l = query->lookup; From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 14 22:38:52 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 064621065695; Mon, 14 Dec 2009 22:38:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E96A48FC1D; Mon, 14 Dec 2009 22:38:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEMcplP041042; Mon, 14 Dec 2009 22:38:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMcpxF041040; Mon, 14 Dec 2009 22:38:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912142238.nBEMcpxF041040@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 22:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200556 - stable/8/contrib/ee X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:38:52 -0000 Author: delphij Date: Mon Dec 14 22:38:51 2009 New Revision: 200556 URL: http://svn.freebsd.org/changeset/base/200556 Log: MFC r199123: Add a minimal change to prevent NULL deference in ee(1). To repeat the problem, one can press "Ctrl+C" and then enter "0". Submitted by: Alexander Best PR: bin/137707 Modified: stable/8/contrib/ee/ee.c Directory Properties: stable/8/contrib/ee/ (props changed) Modified: stable/8/contrib/ee/ee.c ============================================================================== --- stable/8/contrib/ee/ee.c Mon Dec 14 22:30:07 2009 (r200555) +++ stable/8/contrib/ee/ee.c Mon Dec 14 22:38:51 2009 (r200556) @@ -1993,7 +1993,7 @@ char *cmd_str; int number; int i; char *ptr; - char *direction = NULL; + char *direction = "d"; struct text *t_line; ptr = cmd_str; From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 15 00:26:42 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87811106568B; Tue, 15 Dec 2009 00:26:42 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D4CC8FC0C; Tue, 15 Dec 2009 00:26:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBF0Qgc5043464; Tue, 15 Dec 2009 00:26:42 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF0Qgxp043460; Tue, 15 Dec 2009 00:26:42 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912150026.nBF0Qgxp043460@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 00:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200560 - in stable/8/release/picobsd: bridge build X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 00:26:42 -0000 Author: luigi Date: Tue Dec 15 00:26:42 2009 New Revision: 200560 URL: http://svn.freebsd.org/changeset/base/200560 Log: sync with head Modified: stable/8/release/picobsd/bridge/PICOBSD stable/8/release/picobsd/bridge/crunch.conf stable/8/release/picobsd/build/picobsd Modified: stable/8/release/picobsd/bridge/PICOBSD ============================================================================== --- stable/8/release/picobsd/bridge/PICOBSD Mon Dec 14 23:49:06 2009 (r200559) +++ stable/8/release/picobsd/bridge/PICOBSD Tue Dec 15 00:26:42 2009 (r200560) @@ -11,11 +11,14 @@ hints "PICOBSD.hints" # values accessible through getenv() # env "PICOBSD.env" -cpu I486_CPU +#cpu I486_CPU cpu I586_CPU cpu I686_CPU ident PICOBSD +options SMP +device apic + options SCHED_4BSD # mandatory to have one scheduler #options MATH_EMULATE #Support for x87 emulation options INET #InterNETworking @@ -43,7 +46,7 @@ options IPDIVERT # divert (for natd) # Support for bridging and bandwidth limiting options DUMMYNET device if_bridge -options HZ=1000 +#options HZ=1000 device random # used by ssh device pci Modified: stable/8/release/picobsd/bridge/crunch.conf ============================================================================== --- stable/8/release/picobsd/bridge/crunch.conf Mon Dec 14 23:49:06 2009 (r200559) +++ stable/8/release/picobsd/bridge/crunch.conf Tue Dec 15 00:26:42 2009 (r200560) @@ -98,13 +98,15 @@ progs cat tail tee progs test ln test [ +progs less +ln less more progs mount progs minigzip ln minigzip gzip progs kill progs df progs ps -progs ns # this is the +progs ns # this is the picobsd version ln ns netstat progs vm progs hostname @@ -178,3 +180,4 @@ libs_so -lkvm libs_so -lz libs_so -lbsdxml libs_so -lsbuf +libs_so -ljail # used by ifconfig Modified: stable/8/release/picobsd/build/picobsd ============================================================================== --- stable/8/release/picobsd/build/picobsd Mon Dec 14 23:49:06 2009 (r200559) +++ stable/8/release/picobsd/build/picobsd Tue Dec 15 00:26:42 2009 (r200560) @@ -167,7 +167,7 @@ create_includes_and_libraries2() { # opt local no log "create_includes_and_libraries2() for ${SRC}" if [ ${OSVERSION} -ge 600000 ] ; then - no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" + no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITOUT_CDDL=1" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi @@ -587,8 +587,9 @@ find_progs() { # programs local i u_progs="`find_progs_helper $*`" local o=${o_objdir:-${_SHLIBDIRPREFIX}} + log "looking for libs for $u_progs in $_SHLIBDIRPREFIX" [ -z "${u_progs}" ] && return 1 # not found, error - i="`ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" + i="`LD_LIBRARY_PATH=$o/lib ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" u_libs="`find_progs_helper $i`" return 0 } @@ -719,8 +720,7 @@ populate_mfs_tree() { (cd ${dst}; chown -R root . ) fi - # If we are building a shared 'crunch', take the libraries - # and the dynamic loader as well + log "for a shared 'crunch' take libraries and dynamic loader as well" find_progs ${dst}/stand/crunch if [ -n "${u_libs}" ] ; then mkdir -p ${dst}/lib && cp -p ${u_libs} ${dst}/lib From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 15 01:14:33 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9955106566B; Tue, 15 Dec 2009 01:14:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D898A8FC13; Tue, 15 Dec 2009 01:14:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBF1EXeq044559; Tue, 15 Dec 2009 01:14:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF1EX8T044557; Tue, 15 Dec 2009 01:14:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912150114.nBF1EX8T044557@svn.freebsd.org> From: Xin LI Date: Tue, 15 Dec 2009 01:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200562 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 01:14:34 -0000 Author: delphij Date: Tue Dec 15 01:14:33 2009 New Revision: 200562 URL: http://svn.freebsd.org/changeset/base/200562 Log: MFC r200287: Allow using IPv6 in nfsrvd_sentcache() callback. PR: kern/141289 Submitted by: Petr Lampa Modified: stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Tue Dec 15 00:44:33 2009 (r200561) +++ stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Tue Dec 15 01:14:33 2009 (r200562) @@ -522,8 +522,9 @@ nfsrvd_sentcache(struct nfsrvcache *rp, if (!(rp->rc_flag & RC_LOCKED)) panic("nfsrvd_sentcache not locked"); if (!err) { - if (so->so_proto->pr_domain->dom_family != AF_INET || - so->so_proto->pr_protocol != IPPROTO_TCP) + if ((so->so_proto->pr_domain->dom_family != AF_INET && + so->so_proto->pr_domain->dom_family != AF_INET6) || + so->so_proto->pr_protocol != IPPROTO_TCP) panic("nfs sent cache"); if (nfsrv_getsockseqnum(so, &rp->rc_tcpseq)) rp->rc_flag |= RC_TCPSEQ; From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 15 07:32:09 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4935D10656A5; Tue, 15 Dec 2009 07:32:09 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3766A8FC15; Tue, 15 Dec 2009 07:32:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBF7W93r054075; Tue, 15 Dec 2009 07:32:09 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF7W984054073; Tue, 15 Dec 2009 07:32:09 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912150732.nBF7W984054073@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 07:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200565 - stable/8/sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 07:32:09 -0000 Author: luigi Date: Tue Dec 15 07:32:08 2009 New Revision: 200565 URL: http://svn.freebsd.org/changeset/base/200565 Log: MFC: expose only bio_cmd and bio_flags values to userland Modified: stable/8/sys/sys/bio.h Modified: stable/8/sys/sys/bio.h ============================================================================== --- stable/8/sys/sys/bio.h Tue Dec 15 07:04:20 2009 (r200564) +++ stable/8/sys/sys/bio.h Tue Dec 15 07:32:08 2009 (r200565) @@ -40,6 +40,22 @@ #include +/* bio_cmd */ +#define BIO_READ 0x01 +#define BIO_WRITE 0x02 +#define BIO_DELETE 0x04 +#define BIO_GETATTR 0x08 +#define BIO_FLUSH 0x10 +#define BIO_CMD0 0x20 /* Available for local hacks */ +#define BIO_CMD1 0x40 /* Available for local hacks */ +#define BIO_CMD2 0x80 /* Available for local hacks */ + +/* bio_flags */ +#define BIO_ERROR 0x01 +#define BIO_DONE 0x02 +#define BIO_ONQUEUE 0x04 + +#ifdef _KERNEL struct disk; struct bio; @@ -95,23 +111,6 @@ struct bio { daddr_t bio_pblkno; /* physical block number */ }; -/* bio_cmd */ -#define BIO_READ 0x01 -#define BIO_WRITE 0x02 -#define BIO_DELETE 0x04 -#define BIO_GETATTR 0x08 -#define BIO_FLUSH 0x10 -#define BIO_CMD0 0x20 /* Available for local hacks */ -#define BIO_CMD1 0x40 /* Available for local hacks */ -#define BIO_CMD2 0x80 /* Available for local hacks */ - -/* bio_flags */ -#define BIO_ERROR 0x01 -#define BIO_DONE 0x02 -#define BIO_ONQUEUE 0x04 - -#ifdef _KERNEL - struct uio; struct devstat; From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 15 10:00:00 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE6B1106568D; Tue, 15 Dec 2009 10:00:00 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B703A8FC1D; Tue, 15 Dec 2009 10:00:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFA00iQ057258; Tue, 15 Dec 2009 10:00:00 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFA002F057254; Tue, 15 Dec 2009 10:00:00 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200912151000.nBFA002F057254@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 15 Dec 2009 10:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200568 - in stable/8: share/man/man4 sys/dev/bge X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:00:01 -0000 Author: stas Date: Tue Dec 15 10:00:00 2009 New Revision: 200568 URL: http://svn.freebsd.org/changeset/base/200568 Log: - MFC r197832, r197834, r197837: - Add support for new BGE chips (5761, 5784 and 57780). These chips uses new BGE_PCI_PRODID_ASICREV register to store the chip identifier and its revision. - Add new grouping macro for 7575+ chips (BGE_IS_5755_PLUS). - Add IDs for Fujitsu-branded Broadcom adapters. Modified: stable/8/share/man/man4/bge.4 stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/bge.4 ============================================================================== --- stable/8/share/man/man4/bge.4 Tue Dec 15 09:46:27 2009 (r200567) +++ stable/8/share/man/man4/bge.4 Tue Dec 15 10:00:00 2009 (r200568) @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 21, 2009 +.Dd December 15, 2009 .Dt BGE 4 .Os .Sh NAME .Nm bge -.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5789 PCI Gigabit Ethernet adapter driver" +.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5761/5784/5789/57780 PCI Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -56,8 +56,8 @@ if_bge_load="YES" The .Nm driver provides support for various NICs based on the Broadcom BCM570x, -5714, 5721, 5722, 5750, 5751, 5752 and 5789 families of Gigabit Ethernet -controller chips. +5714, 5721, 5722, 5750, 5751, 5752, 5761, 5784, 5789 and 57780 families +of Gigabit Ethernet controller chips. .Pp All of these NICs are capable of 10, 100 and 1000Mbps speeds over CAT5 copper cable, except for the SysKonnect SK-9D41 which supports only Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Tue Dec 15 09:46:27 2009 (r200567) +++ stable/8/sys/dev/bge/if_bge.c Tue Dec 15 10:00:00 2009 (r200568) @@ -170,6 +170,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5723 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5751 }, @@ -184,12 +185,21 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5754M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755M }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761E }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761S }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761SE }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5764 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5781 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5782 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5784 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5785F }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5785G }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5786 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5787 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5787F }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5787M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5788 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5789 }, @@ -198,11 +208,19 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5903M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5906 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5906M }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57760 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57780 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57788 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57790 }, { SK_VENDORID, SK_DEVICEID_ALTIMA }, { TC_VENDORID, TC_DEVICEID_3C996 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PW008GE4 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PW008GE5 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PP250450 }, + { 0, 0 } }; @@ -216,6 +234,7 @@ static const struct bge_vendor { { BCOM_VENDORID, "Broadcom" }, { SK_VENDORID, "SysKonnect" }, { TC_VENDORID, "3Com" }, + { FJTSU_VENDORID, "Fujitsu" }, { 0, NULL } }; @@ -271,12 +290,18 @@ static const struct bge_revision { { BGE_CHIPID_BCM5755_A1, "BCM5755 A1" }, { BGE_CHIPID_BCM5755_A2, "BCM5755 A2" }, { BGE_CHIPID_BCM5722_A0, "BCM5722 A0" }, + { BGE_CHIPID_BCM5761_A0, "BCM5761 A0" }, + { BGE_CHIPID_BCM5761_A1, "BCM5761 A1" }, + { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, + { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ { BGE_CHIPID_BCM5787_A0, "BCM5754/5787 A0" }, { BGE_CHIPID_BCM5787_A1, "BCM5754/5787 A1" }, { BGE_CHIPID_BCM5787_A2, "BCM5754/5787 A2" }, { BGE_CHIPID_BCM5906_A1, "BCM5906 A1" }, { BGE_CHIPID_BCM5906_A2, "BCM5906 A2" }, + { BGE_CHIPID_BCM57780_A0, "BCM57780 A0" }, + { BGE_CHIPID_BCM57780_A1, "BCM57780 A1" }, { 0, NULL } }; @@ -297,9 +322,13 @@ static const struct bge_revision bge_maj { BGE_ASICREV_BCM5780, "unknown BCM5780" }, { BGE_ASICREV_BCM5714, "unknown BCM5714" }, { BGE_ASICREV_BCM5755, "unknown BCM5755" }, + { BGE_ASICREV_BCM5761, "unknown BCM5761" }, + { BGE_ASICREV_BCM5784, "unknown BCM5784" }, + { BGE_ASICREV_BCM5785, "unknown BCM5785" }, /* 5754 and 5787 share the same ASIC ID */ { BGE_ASICREV_BCM5787, "unknown BCM5754/5787" }, { BGE_ASICREV_BCM5906, "unknown BCM5906" }, + { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { 0, NULL } }; @@ -309,6 +338,7 @@ static const struct bge_revision bge_maj #define BGE_IS_5705_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5705_PLUS) #define BGE_IS_5714_FAMILY(sc) ((sc)->bge_flags & BGE_FLAG_5714_FAMILY) #define BGE_IS_575X_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_575X_PLUS) +#define BGE_IS_5755_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5755_PLUS) const struct bge_revision * bge_lookup_rev(uint32_t); const struct bge_vendor * bge_lookup_vendor(uint16_t); @@ -1758,9 +1788,8 @@ bge_blockinit(struct bge_softc *sc) val = BGE_WDMAMODE_ENABLE | BGE_WDMAMODE_ALL_ATTNS; /* Enable host coalescing bug fix. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) - val |= 1 << 29; + if (BGE_IS_5755_PLUS(sc)) + val |= BGE_WDMAMODE_STATUS_TAG_FIX; /* Turn on write DMA state machine */ CSR_WRITE_4(sc, BGE_WDMA_MODE, val); @@ -1768,6 +1797,12 @@ bge_blockinit(struct bge_softc *sc) /* Turn on read DMA state machine */ val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS; + if (sc->bge_asicrev == BGE_ASICREV_BCM5784 || + sc->bge_asicrev == BGE_ASICREV_BCM5785 || + sc->bge_asicrev == BGE_ASICREV_BCM57780) + val |= BGE_RDMAMODE_BD_SBD_CRPT_ATTN | + BGE_RDMAMODE_MBUF_RBD_CRPT_ATTN | + BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -1790,7 +1825,10 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_SBDC_MODE, BGE_SBDCMODE_ENABLE); /* Turn on send data completion state machine */ - CSR_WRITE_4(sc, BGE_SDC_MODE, BGE_SDCMODE_ENABLE); + val = BGE_SDCMODE_ENABLE; + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + val |= BGE_SDCMODE_CDELAY; + CSR_WRITE_4(sc, BGE_SDC_MODE, val); /* Turn on send data initiator state machine */ CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); @@ -1897,8 +1935,11 @@ bge_probe(device_t dev) const struct bge_vendor *v; uint32_t id; - id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & - BGE_PCIMISCCTL_ASICREV; + id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> + BGE_PCIMISCCTL_ASICREV_SHIFT; + if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) + id = pci_read_config(dev, + BGE_PCI_PRODID_ASICREV, 4); br = bge_lookup_rev(id); v = bge_lookup_vendor(vid); { @@ -1915,8 +1956,8 @@ bge_probe(device_t dev) br != NULL ? br->br_name : "NetXtreme Ethernet Controller"); } - snprintf(buf, 96, "%s, %sASIC rev. %#04x", model, - br != NULL ? "" : "unknown ", id >> 16); + snprintf(buf, 96, "%s, %sASIC rev. %#08x", model, + br != NULL ? "" : "unknown ", id); device_set_desc_copy(dev, buf); if (pci_get_subvendor(dev) == DELL_VENDORID) sc->bge_flags |= BGE_FLAG_NO_3LED; @@ -2411,8 +2452,11 @@ bge_attach(device_t dev) /* Save various chip information. */ sc->bge_chipid = - pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & - BGE_PCIMISCCTL_ASICREV; + pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> + BGE_PCIMISCCTL_ASICREV_SHIFT; + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) + sc->bge_chipid = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, + 4); sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid); sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); @@ -2431,6 +2475,15 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5755: + case BGE_ASICREV_BCM5761: + case BGE_ASICREV_BCM5784: + case BGE_ASICREV_BCM5785: + case BGE_ASICREV_BCM5787: + case BGE_ASICREV_BCM57780: + sc->bge_flags |= BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS | + BGE_FLAG_5705_PLUS; + break; case BGE_ASICREV_BCM5700: case BGE_ASICREV_BCM5701: case BGE_ASICREV_BCM5703: @@ -2444,8 +2497,6 @@ bge_attach(device_t dev) /* FALLTHROUGH */ case BGE_ASICREV_BCM5750: case BGE_ASICREV_BCM5752: - case BGE_ASICREV_BCM5755: - case BGE_ASICREV_BCM5787: case BGE_ASICREV_BCM5906: sc->bge_flags |= BGE_FLAG_575X_PLUS; /* FALLTHROUGH */ @@ -2466,6 +2517,8 @@ bge_attach(device_t dev) if (BGE_IS_5705_PLUS(sc) && !(sc->bge_flags & BGE_FLAG_ADJUST_TRIM)) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5761 || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5787) { if (sc->bge_chipid != BGE_CHIPID_BCM5722_A0) sc->bge_flags |= BGE_FLAG_JITTER_BUG; @@ -2873,8 +2926,7 @@ bge_reset(struct bge_softc *sc) /* Disable fastboot on controllers that support it. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5752 || - sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) { + BGE_IS_5755_PLUS(sc)) { if (bootverbose) device_printf(sc->bge_dev, "Disabling fastboot\n"); CSR_WRITE_4(sc, BGE_FASTBOOT_PC, 0x0); @@ -4689,6 +4741,8 @@ bge_sysctl_debug_info(SYSCTL_HANDLER_ARG } printf("Hardware Flags:\n"); + if (BGE_IS_5755_PLUS(sc)) + printf(" - 5755 Plus\n"); if (BGE_IS_575X_PLUS(sc)) printf(" - 575X Plus\n"); if (BGE_IS_5705_PLUS(sc)) Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Tue Dec 15 09:46:27 2009 (r200567) +++ stable/8/sys/dev/bge/if_bgereg.h Tue Dec 15 10:00:00 2009 (r200568) @@ -218,6 +218,7 @@ #define BGE_PCI_UNDI_TX_BD_PRODIDX_LO 0xAC #define BGE_PCI_ISR_MBX_HI 0xB0 #define BGE_PCI_ISR_MBX_LO 0xB4 +#define BGE_PCI_PRODID_ASICREV 0xBC /* PCI Misc. Host control register */ #define BGE_PCIMISCCTL_CLEAR_INTA 0x00000001 @@ -229,6 +230,7 @@ #define BGE_PCIMISCCTL_REG_WORDSWAP 0x00000040 #define BGE_PCIMISCCTL_INDIRECT_ACCESS 0x00000080 #define BGE_PCIMISCCTL_ASICREV 0xFFFF0000 +#define BGE_PCIMISCCTL_ASICREV_SHIFT 16 #define BGE_HIF_SWAP_OPTIONS (BGE_PCIMISCCTL_ENDIAN_WORDSWAP) #if BYTE_ORDER == LITTLE_ENDIAN @@ -245,66 +247,72 @@ (BGE_HIF_SWAP_OPTIONS|BGE_PCIMISCCTL_CLEAR_INTA| \ BGE_PCIMISCCTL_MASK_PCI_INTR|BGE_PCIMISCCTL_INDIRECT_ACCESS) -#define BGE_CHIPID_TIGON_I 0x40000000 -#define BGE_CHIPID_TIGON_II 0x60000000 -#define BGE_CHIPID_BCM5700_A0 0x70000000 -#define BGE_CHIPID_BCM5700_A1 0x70010000 -#define BGE_CHIPID_BCM5700_B0 0x71000000 -#define BGE_CHIPID_BCM5700_B1 0x71010000 -#define BGE_CHIPID_BCM5700_B2 0x71020000 -#define BGE_CHIPID_BCM5700_B3 0x71030000 -#define BGE_CHIPID_BCM5700_ALTIMA 0x71040000 -#define BGE_CHIPID_BCM5700_C0 0x72000000 -#define BGE_CHIPID_BCM5701_A0 0x00000000 /* grrrr */ -#define BGE_CHIPID_BCM5701_B0 0x01000000 -#define BGE_CHIPID_BCM5701_B2 0x01020000 -#define BGE_CHIPID_BCM5701_B5 0x01050000 -#define BGE_CHIPID_BCM5703_A0 0x10000000 -#define BGE_CHIPID_BCM5703_A1 0x10010000 -#define BGE_CHIPID_BCM5703_A2 0x10020000 -#define BGE_CHIPID_BCM5703_A3 0x10030000 -#define BGE_CHIPID_BCM5703_B0 0x11000000 -#define BGE_CHIPID_BCM5704_A0 0x20000000 -#define BGE_CHIPID_BCM5704_A1 0x20010000 -#define BGE_CHIPID_BCM5704_A2 0x20020000 -#define BGE_CHIPID_BCM5704_A3 0x20030000 -#define BGE_CHIPID_BCM5704_B0 0x21000000 -#define BGE_CHIPID_BCM5705_A0 0x30000000 -#define BGE_CHIPID_BCM5705_A1 0x30010000 -#define BGE_CHIPID_BCM5705_A2 0x30020000 -#define BGE_CHIPID_BCM5705_A3 0x30030000 -#define BGE_CHIPID_BCM5750_A0 0x40000000 -#define BGE_CHIPID_BCM5750_A1 0x40010000 -#define BGE_CHIPID_BCM5750_A3 0x40030000 -#define BGE_CHIPID_BCM5750_B0 0x41000000 -#define BGE_CHIPID_BCM5750_B1 0x41010000 -#define BGE_CHIPID_BCM5750_C0 0x42000000 -#define BGE_CHIPID_BCM5750_C1 0x42010000 -#define BGE_CHIPID_BCM5750_C2 0x42020000 -#define BGE_CHIPID_BCM5714_A0 0x50000000 -#define BGE_CHIPID_BCM5752_A0 0x60000000 -#define BGE_CHIPID_BCM5752_A1 0x60010000 -#define BGE_CHIPID_BCM5752_A2 0x60020000 -#define BGE_CHIPID_BCM5714_B0 0x80000000 -#define BGE_CHIPID_BCM5714_B3 0x80030000 -#define BGE_CHIPID_BCM5715_A0 0x90000000 -#define BGE_CHIPID_BCM5715_A1 0x90010000 -#define BGE_CHIPID_BCM5715_A3 0x90030000 -#define BGE_CHIPID_BCM5755_A0 0xa0000000 -#define BGE_CHIPID_BCM5755_A1 0xa0010000 -#define BGE_CHIPID_BCM5755_A2 0xa0020000 -#define BGE_CHIPID_BCM5722_A0 0xa2000000 -#define BGE_CHIPID_BCM5754_A0 0xb0000000 -#define BGE_CHIPID_BCM5754_A1 0xb0010000 -#define BGE_CHIPID_BCM5754_A2 0xb0020000 -#define BGE_CHIPID_BCM5787_A0 0xb0000000 -#define BGE_CHIPID_BCM5787_A1 0xb0010000 -#define BGE_CHIPID_BCM5787_A2 0xb0020000 -#define BGE_CHIPID_BCM5906_A1 0xc0010000 -#define BGE_CHIPID_BCM5906_A2 0xc0020000 +#define BGE_CHIPID_TIGON_I 0x4000 +#define BGE_CHIPID_TIGON_II 0x6000 +#define BGE_CHIPID_BCM5700_A0 0x7000 +#define BGE_CHIPID_BCM5700_A1 0x7001 +#define BGE_CHIPID_BCM5700_B0 0x7100 +#define BGE_CHIPID_BCM5700_B1 0x7101 +#define BGE_CHIPID_BCM5700_B2 0x7102 +#define BGE_CHIPID_BCM5700_B3 0x7103 +#define BGE_CHIPID_BCM5700_ALTIMA 0x7104 +#define BGE_CHIPID_BCM5700_C0 0x7200 +#define BGE_CHIPID_BCM5701_A0 0x0000 /* grrrr */ +#define BGE_CHIPID_BCM5701_B0 0x0100 +#define BGE_CHIPID_BCM5701_B2 0x0102 +#define BGE_CHIPID_BCM5701_B5 0x0105 +#define BGE_CHIPID_BCM5703_A0 0x1000 +#define BGE_CHIPID_BCM5703_A1 0x1001 +#define BGE_CHIPID_BCM5703_A2 0x1002 +#define BGE_CHIPID_BCM5703_A3 0x1003 +#define BGE_CHIPID_BCM5703_B0 0x1100 +#define BGE_CHIPID_BCM5704_A0 0x2000 +#define BGE_CHIPID_BCM5704_A1 0x2001 +#define BGE_CHIPID_BCM5704_A2 0x2002 +#define BGE_CHIPID_BCM5704_A3 0x2003 +#define BGE_CHIPID_BCM5704_B0 0x2100 +#define BGE_CHIPID_BCM5705_A0 0x3000 +#define BGE_CHIPID_BCM5705_A1 0x3001 +#define BGE_CHIPID_BCM5705_A2 0x3002 +#define BGE_CHIPID_BCM5705_A3 0x3003 +#define BGE_CHIPID_BCM5750_A0 0x4000 +#define BGE_CHIPID_BCM5750_A1 0x4001 +#define BGE_CHIPID_BCM5750_A3 0x4000 +#define BGE_CHIPID_BCM5750_B0 0x4100 +#define BGE_CHIPID_BCM5750_B1 0x4101 +#define BGE_CHIPID_BCM5750_C0 0x4200 +#define BGE_CHIPID_BCM5750_C1 0x4201 +#define BGE_CHIPID_BCM5750_C2 0x4202 +#define BGE_CHIPID_BCM5714_A0 0x5000 +#define BGE_CHIPID_BCM5752_A0 0x6000 +#define BGE_CHIPID_BCM5752_A1 0x6001 +#define BGE_CHIPID_BCM5752_A2 0x6002 +#define BGE_CHIPID_BCM5714_B0 0x8000 +#define BGE_CHIPID_BCM5714_B3 0x8003 +#define BGE_CHIPID_BCM5715_A0 0x9000 +#define BGE_CHIPID_BCM5715_A1 0x9001 +#define BGE_CHIPID_BCM5715_A3 0x9003 +#define BGE_CHIPID_BCM5755_A0 0xa000 +#define BGE_CHIPID_BCM5755_A1 0xa001 +#define BGE_CHIPID_BCM5755_A2 0xa002 +#define BGE_CHIPID_BCM5722_A0 0xa200 +#define BGE_CHIPID_BCM5754_A0 0xb000 +#define BGE_CHIPID_BCM5754_A1 0xb001 +#define BGE_CHIPID_BCM5754_A2 0xb002 +#define BGE_CHIPID_BCM5761_A0 0x5761000 +#define BGE_CHIPID_BCM5761_A1 0x5761100 +#define BGE_CHIPID_BCM5784_A0 0x5784000 +#define BGE_CHIPID_BCM5784_A1 0x5784100 +#define BGE_CHIPID_BCM5787_A0 0xb000 +#define BGE_CHIPID_BCM5787_A1 0xb001 +#define BGE_CHIPID_BCM5787_A2 0xb002 +#define BGE_CHIPID_BCM5906_A1 0xc001 +#define BGE_CHIPID_BCM5906_A2 0xc002 +#define BGE_CHIPID_BCM57780_A0 0x57780000 +#define BGE_CHIPID_BCM57780_A1 0x57780001 /* shorthand one */ -#define BGE_ASICREV(x) ((x) >> 28) +#define BGE_ASICREV(x) ((x) >> 12) #define BGE_ASICREV_BCM5701 0x00 #define BGE_ASICREV_BCM5703 0x01 #define BGE_ASICREV_BCM5704 0x02 @@ -319,9 +327,16 @@ #define BGE_ASICREV_BCM5754 0x0b #define BGE_ASICREV_BCM5787 0x0b #define BGE_ASICREV_BCM5906 0x0c +/* Should consult BGE_PCI_PRODID_ASICREV for ChipID */ +#define BGE_ASICREV_USE_PRODID_REG 0x0f +/* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */ +#define BGE_ASICREV_BCM5761 0x5761 +#define BGE_ASICREV_BCM5784 0x5784 +#define BGE_ASICREV_BCM5785 0x5785 +#define BGE_ASICREV_BCM57780 0x57780 /* chip revisions */ -#define BGE_CHIPREV(x) ((x) >> 24) +#define BGE_CHIPREV(x) ((x) >> 8) #define BGE_CHIPREV_5700_AX 0x70 #define BGE_CHIPREV_5700_BX 0x71 #define BGE_CHIPREV_5700_CX 0x72 @@ -331,6 +346,9 @@ #define BGE_CHIPREV_5704_BX 0x21 #define BGE_CHIPREV_5750_AX 0x40 #define BGE_CHIPREV_5750_BX 0x41 +/* BGE_PCI_PRODID_ASICREV chip rev. identifiers. */ +#define BGE_CHIPREV_5761_AX 0x57611 +#define BGE_CHIPREV_5784_AX 0x57841 /* PCI DMA Read/Write Control register */ #define BGE_PCIDMARWCTL_MINDMA 0x000000FF @@ -861,6 +879,7 @@ #define BGE_SDCMODE_RESET 0x00000001 #define BGE_SDCMODE_ENABLE 0x00000002 #define BGE_SDCMODE_ATTN 0x00000004 +#define BGE_SDCMODE_CDELAY 0x00000010 /* Send Data completion status register */ #define BGE_SDCSTAT_ATTN 0x00000004 @@ -1378,6 +1397,9 @@ #define BGE_RDMAMODE_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_RDMAMODE_LOCWRITE_TOOBIG 0x00000200 #define BGE_RDMAMODE_ALL_ATTNS 0x000003FC +#define BGE_RDMAMODE_BD_SBD_CRPT_ATTN 0x00000800 +#define BGE_RDMAMODE_MBUF_RBD_CRPT_ATTN 0x00001000 +#define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000 @@ -1409,6 +1431,7 @@ #define BGE_WDMAMODE_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_WDMAMODE_LOCREAD_TOOBIG 0x00000200 #define BGE_WDMAMODE_ALL_ATTNS 0x000003FC +#define BGE_WDMAMODE_STATUS_TAG_FIX 0x20000000 /* Write DMA status register */ #define BGE_WDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004 @@ -2101,6 +2124,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5720 0x1658 #define BCOM_DEVICEID_BCM5721 0x1659 #define BCOM_DEVICEID_BCM5722 0x165A +#define BCOM_DEVICEID_BCM5723 0x165B #define BCOM_DEVICEID_BCM5750 0x1676 #define BCOM_DEVICEID_BCM5750M 0x167C #define BCOM_DEVICEID_BCM5751 0x1677 @@ -2115,13 +2139,22 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5754M 0x1672 #define BCOM_DEVICEID_BCM5755 0x167B #define BCOM_DEVICEID_BCM5755M 0x1673 +#define BCOM_DEVICEID_BCM5761 0x1681 +#define BCOM_DEVICEID_BCM5761E 0x1680 +#define BCOM_DEVICEID_BCM5761S 0x1688 +#define BCOM_DEVICEID_BCM5761SE 0x1689 +#define BCOM_DEVICEID_BCM5764 0x1684 #define BCOM_DEVICEID_BCM5780 0x166A #define BCOM_DEVICEID_BCM5780S 0x166B #define BCOM_DEVICEID_BCM5781 0x16DD #define BCOM_DEVICEID_BCM5782 0x1696 +#define BCOM_DEVICEID_BCM5784 0x1698 +#define BCOM_DEVICEID_BCM5785F 0x16a0 +#define BCOM_DEVICEID_BCM5785G 0x1699 #define BCOM_DEVICEID_BCM5786 0x169A #define BCOM_DEVICEID_BCM5787 0x169B #define BCOM_DEVICEID_BCM5787M 0x1693 +#define BCOM_DEVICEID_BCM5787F 0x167f #define BCOM_DEVICEID_BCM5788 0x169C #define BCOM_DEVICEID_BCM5789 0x169D #define BCOM_DEVICEID_BCM5901 0x170D @@ -2129,6 +2162,10 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5903M 0x16FF #define BCOM_DEVICEID_BCM5906 0x1712 #define BCOM_DEVICEID_BCM5906M 0x1713 +#define BCOM_DEVICEID_BCM57760 0x1690 +#define BCOM_DEVICEID_BCM57780 0x1692 +#define BCOM_DEVICEID_BCM57788 0x1691 +#define BCOM_DEVICEID_BCM57790 0x1694 /* * Alteon AceNIC PCI vendor/device ID. @@ -2179,6 +2216,14 @@ struct bge_status_block { #define SUN_VENDORID 0x108e /* + * Fujitsu vendor/device IDs + */ +#define FJTSU_VENDORID 0x10cf +#define FJTSU_DEVICEID_PW008GE5 0x11a1 +#define FJTSU_DEVICEID_PW008GE4 0x11a2 +#define FJTSU_DEVICEID_PP250450 0x11cc /* PRIMEPOWER250/450 LAN */ + +/* * Offset of MAC address inside EEPROM. */ #define BGE_EE_MAC_OFFSET 0x7C @@ -2558,6 +2603,7 @@ struct bge_softc { #define BGE_FLAG_5705_PLUS 0x00002000 #define BGE_FLAG_5714_FAMILY 0x00004000 #define BGE_FLAG_575X_PLUS 0x00008000 +#define BGE_FLAG_5755_PLUS 0x00010000 #define BGE_FLAG_RX_ALIGNBUG 0x00100000 #define BGE_FLAG_NO_3LED 0x00200000 #define BGE_FLAG_ADC_BUG 0x00400000 @@ -2568,8 +2614,8 @@ struct bge_softc { #define BGE_FLAG_CRC_BUG 0x08000000 #define BGE_FLAG_5788 0x20000000 uint32_t bge_chipid; - uint8_t bge_asicrev; - uint8_t bge_chiprev; + uint32_t bge_asicrev; + uint32_t bge_chiprev; uint8_t bge_asf_mode; uint8_t bge_asf_count; struct bge_ring_data bge_ldata; /* rings */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 15 10:16:57 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC3FD1065670; Tue, 15 Dec 2009 10:16:57 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 916BD8FC1A; Tue, 15 Dec 2009 10:16:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFAGvLq057714; Tue, 15 Dec 2009 10:16:57 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFAGvuk057712; Tue, 15 Dec 2009 10:16:57 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200912151016.nBFAGvuk057712@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 15 Dec 2009 10:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200569 - stable/8/sys/dev/bge X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:16:57 -0000 Author: stas Date: Tue Dec 15 10:16:57 2009 New Revision: 200569 URL: http://svn.freebsd.org/changeset/base/200569 Log: MFC r198318: - On entrance to the rx_eof sync RX rings maps with POSTWRITE flag instead of POSTREAD: the hardware do not touch this memory (CPU updates it). It is already synchronized as PREWRITE after the processing is done. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Tue Dec 15 10:00:00 2009 (r200568) +++ stable/8/sys/dev/bge/if_bge.c Tue Dec 15 10:16:57 2009 (r200569) @@ -3122,10 +3122,10 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag, sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_POSTREAD); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, - sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTWRITE); if (BGE_IS_JUMBO_CAPABLE(sc)) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, - sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE); while (rx_cons != rx_prod) { struct bge_rx_bd *cur_rx; @@ -3251,6 +3251,8 @@ bge_rxeof(struct bge_softc *sc) return (rx_npkts); } + bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag, + sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_PREREAD); if (stdcnt > 0) bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); @@ -3423,8 +3425,6 @@ bge_intr(void *xsc) /* Make sure the descriptor ring indexes are coherent. */ bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); - bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 && sc->bge_chipid != BGE_CHIPID_BCM5700_B2) || @@ -3445,6 +3445,9 @@ bge_intr(void *xsc) !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); + BGE_UNLOCK(sc); } From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 15 15:01:52 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B10B7106566B; Tue, 15 Dec 2009 15:01:52 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85E9E8FC28; Tue, 15 Dec 2009 15:01:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFF1qB9066854; Tue, 15 Dec 2009 15:01:52 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFF1qhX066852; Tue, 15 Dec 2009 15:01:52 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912151501.nBFF1qhX066852@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 15 Dec 2009 15:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200578 - stable/8/contrib/ntp/ntpd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 15:01:52 -0000 Author: ume Date: Tue Dec 15 15:01:52 2009 New Revision: 200578 URL: http://svn.freebsd.org/changeset/base/200578 Log: MFC r199995: Don't try to bind to an anycast address. The KAME IPv6 stack doesn't allow bind to an anycast address. It does away with an annoying message. Modified: stable/8/contrib/ntp/ntpd/ntp_io.c Directory Properties: stable/8/contrib/ntp/ (props changed) Modified: stable/8/contrib/ntp/ntpd/ntp_io.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_io.c Tue Dec 15 14:59:58 2009 (r200577) +++ stable/8/contrib/ntp/ntpd/ntp_io.c Tue Dec 15 15:01:52 2009 (r200578) @@ -65,6 +65,12 @@ #endif /* IPV6 Multicast Support */ #endif /* IPv6 Support */ +#ifdef INCLUDE_IPV6_SUPPORT +#include +#include +#include +#endif /* !INCLUDE_IPV6_SUPPORT */ + extern int listen_to_virtual_ips; extern const char *specific_interface; @@ -1137,6 +1143,36 @@ set_wildcard_reuse(int family, int on) } #endif /* OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */ +#ifdef INCLUDE_IPV6_SUPPORT +static isc_boolean_t +is_anycast(struct sockaddr *sa, char *name) +{ +#if defined(SIOCGIFAFLAG_IN6) && defined(IN6_IFF_ANYCAST) + struct in6_ifreq ifr6; + int fd; + u_int32_t flags6; + + if (sa->sa_family != AF_INET6) + return ISC_FALSE; + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) + return ISC_FALSE; + memset(&ifr6, 0, sizeof(ifr6)); + memcpy(&ifr6.ifr_addr, (struct sockaddr_in6 *)sa, + sizeof(struct sockaddr_in6)); + strlcpy(ifr6.ifr_name, name, IF_NAMESIZE); + if (ioctl(fd, SIOCGIFAFLAG_IN6, &ifr6) < 0) { + close(fd); + return ISC_FALSE; + } + close(fd); + flags6 = ifr6.ifr_ifru.ifru_flags6; + if ((flags6 & IN6_IFF_ANYCAST) != 0) + return ISC_TRUE; +#endif /* !SIOCGIFAFLAG_IN6 || !IN6_IFF_ANYCAST */ + return ISC_FALSE; +} +#endif /* !INCLUDE_IPV6_SUPPORT */ + /* * update_interface strategy * @@ -1276,6 +1312,11 @@ update_interfaces( if (is_wildcard_addr(&interface.sin)) continue; +#ifdef INCLUDE_IPV6_SUPPORT + if (is_anycast((struct sockaddr *)&interface.sin, isc_if.name)) + continue; +#endif /* !INCLUDE_IPV6_SUPPORT */ + /* * map to local *address* in order * to map all duplicate interfaces to an interface structure From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 15 20:00:34 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A238D1065693; Tue, 15 Dec 2009 20:00:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90DB58FC1C; Tue, 15 Dec 2009 20:00:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFK0Y7K073631; Tue, 15 Dec 2009 20:00:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFK0YFO073628; Tue, 15 Dec 2009 20:00:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912152000.nBFK0YFO073628@svn.freebsd.org> From: Marius Strobl Date: Tue, 15 Dec 2009 20:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200585 - in stable/8/sys: sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 20:00:34 -0000 Author: marius Date: Tue Dec 15 20:00:34 2009 New Revision: 200585 URL: http://svn.freebsd.org/changeset/base/200585 Log: MFC: r200272 Add additional checks of the kernel stack addresses in order to ensure we don't overrun the beginning of the call chain. Modified: stable/8/sys/sparc64/sparc64/stack_machdep.c stable/8/sys/sun4v/sun4v/stack_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/stack_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/stack_machdep.c Tue Dec 15 19:58:23 2009 (r200584) +++ stable/8/sys/sparc64/sparc64/stack_machdep.c Tue Dec 15 20:00:34 2009 (r200585) @@ -36,15 +36,20 @@ __FBSDID("$FreeBSD$"); #include #include -static void stack_capture(struct stack *st, struct frame *fp); +static void stack_capture(struct stack *st, struct frame *frame); static void -stack_capture(struct stack *st, struct frame *fp) +stack_capture(struct stack *st, struct frame *frame) { + struct frame *fp; vm_offset_t callpc; stack_zero(st); - while (1) { + fp = frame; + for (;;) { + if (!INKERNEL((vm_offset_t)fp) || + !ALIGNED_POINTER(fp, uint64_t)) + break; callpc = fp->fr_pc; if (!INKERNEL(callpc)) break; @@ -56,6 +61,9 @@ stack_capture(struct stack *st, struct f break; if (stack_put(st, callpc) == -1) break; + if (v9next_frame(fp) <= fp || + v9next_frame(fp) >= frame + KSTACK_PAGES * PAGE_SIZE) + break; fp = v9next_frame(fp); } } Modified: stable/8/sys/sun4v/sun4v/stack_machdep.c ============================================================================== --- stable/8/sys/sun4v/sun4v/stack_machdep.c Tue Dec 15 19:58:23 2009 (r200584) +++ stable/8/sys/sun4v/sun4v/stack_machdep.c Tue Dec 15 20:00:34 2009 (r200585) @@ -36,20 +36,28 @@ __FBSDID("$FreeBSD$"); #include #include -static void stack_capture(struct stack *st, struct frame *fp); +static void stack_capture(struct stack *st, struct frame *frame); static void -stack_capture(struct stack *st, struct frame *fp) +stack_capture(struct stack *st, struct frame *frame) { + struct frame *fp; vm_offset_t callpc; stack_zero(st); - while (1) { + fp = frame; + for (;;) { + if (!INKERNEL((vm_offset_t)fp) || + !ALIGNED_POINTER(fp, uint64_t)) + break; callpc = fp->fr_pc; if (!INKERNEL(callpc)) break; if (stack_put(st, callpc) == -1) break; + if (v9next_frame(fp) <= fp || + v9next_frame(fp) >= frame + KSTACK_PAGES * PAGE_SIZE) + break; fp = v9next_frame(fp); } } From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 15 20:47:51 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3F4E106568B; Tue, 15 Dec 2009 20:47:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A28C78FC0C; Tue, 15 Dec 2009 20:47:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFKlpjP074934; Tue, 15 Dec 2009 20:47:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFKlpiE074932; Tue, 15 Dec 2009 20:47:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912152047.nBFKlpiE074932@svn.freebsd.org> From: Xin LI Date: Tue, 15 Dec 2009 20:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200588 - stable/8/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 20:47:51 -0000 Author: delphij Date: Tue Dec 15 20:47:51 2009 New Revision: 200588 URL: http://svn.freebsd.org/changeset/base/200588 Log: Add SA-09:15.ssl, SA-09:16.rtld and SA-09:17.freebsd-update. Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.sgml Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Dec 15 20:44:12 2009 (r200587) +++ stable/8/release/doc/en_US.ISO8859-1/errata/article.sgml Tue Dec 15 20:47:51 2009 (r200588) @@ -16,7 +16,7 @@ %release; - + ]>
@@ -40,12 +40,7 @@ $FreeBSD$ - 2000 - 2001 - 2002 - 2003 - 2004 - 2005 + 2009 The &os; Documentation Project @@ -130,51 +125,59 @@ Security Advisories -No advisories. -]]> - -No advisories. -]]> - -No advisories. -]]> + The following security advisories pertain to &os; &release.bugfix;. + For more information, consult the individual advisories available from + . + + + + + + + + + Advisory + Date + Topic + + + + + + SA-09:17.freebsd-update + 03 December 2009 + Inappropriate directory permissions in freebsd-update(8) + + + SA-09:16.rtld + 03 December 2009 + Improper environment sanitization in rtld(1) + + + SA-09:15.ssl + 03 December 2009 + SSL protocol flaw + + + + Open Issues -No open issues. -]]> - -No open issues. -]]> - -No open issues. -]]> - Late-Breaking News - -No news. -]]> + Late-Breaking News and Corrections -No news. -]]> - -No news. -]]>
From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 15 23:05:16 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBFA91065692; Tue, 15 Dec 2009 23:05:16 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA58F8FC16; Tue, 15 Dec 2009 23:05:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFN5GgL077883; Tue, 15 Dec 2009 23:05:16 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFN5GlW077881; Tue, 15 Dec 2009 23:05:16 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912152305.nBFN5GlW077881@svn.freebsd.org> From: Doug Barton Date: Tue, 15 Dec 2009 23:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200592 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 23:05:17 -0000 Author: dougb Date: Tue Dec 15 23:05:16 2009 New Revision: 200592 URL: http://svn.freebsd.org/changeset/base/200592 Log: Re-apply the fix from r199029 (MFC from r198162) to allow $name_program to override $command. PR: conf//141642 Submitted by: Petr Lampa Modified: stable/8/etc/rc.subr Modified: stable/8/etc/rc.subr ============================================================================== --- stable/8/etc/rc.subr Tue Dec 15 22:44:28 2009 (r200591) +++ stable/8/etc/rc.subr Tue Dec 15 23:05:16 2009 (r200592) @@ -616,7 +616,7 @@ run_rc_command() esac eval _override_command=\$${name}_program - command=${command:-${_override_command}} + command=${_override_command:-$command} _keywords="start stop restart rcvar $extra_commands" rc_pid= From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 15 23:13:34 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3ADEA1065694 for ; Tue, 15 Dec 2009 23:13:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 78B4B8FC15 for ; Tue, 15 Dec 2009 23:13:33 +0000 (UTC) Received: (qmail 9462 invoked by uid 399); 15 Dec 2009 23:13:32 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 15 Dec 2009 23:13:32 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B28181B.5070503@FreeBSD.org> Date: Tue, 15 Dec 2009 15:13:31 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Hiroki Sato References: <200912070625.nB76PJli043796@svn.freebsd.org> In-Reply-To: <200912070625.nB76PJli043796@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200205 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 23:13:34 -0000 Hiroki Sato wrote: > Author: hrs > Date: Mon Dec 7 06:25:19 2009 > New Revision: 200205 > URL: http://svn.freebsd.org/changeset/base/200205 > > Log: > MFC: > > r197144: > - Add an extension of set_rcvar(), a new function set_rcvar_obsolete(), > and $desc. > > The set_rcvar_obsolete() is to mark a variable as obsolete and define > the new one. More specifically, a warning is displayed when > a variable is removed or changed in the source tree and the user > still defines the old one. > @@ -588,7 +616,7 @@ run_rc_command() > esac > > eval _override_command=\$${name}_program > - command=${_override_command:-$command} > + command=${command:-${_override_command}} > > _keywords="start stop restart rcvar $extra_commands" > rc_pid= Hiroki, You apparently merged your change from r197144 without applying my fix for this problem above from r198162, which broke this feature in 8-stable. See http://www.freebsd.org/cgi/query-pr.cgi?pr=141642 In my mind breaking this feature in a -stable branch is a fairly serious error, and adds fuel to my growing discomfort about the changes you've been making in /etc. How do you suggest that we move forward and at the same time lessen the potential for further problems? Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-stable-8@FreeBSD.ORG Wed Dec 16 06:02:38 2009 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01785106566C; Wed, 16 Dec 2009 06:02:37 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1E9EF8FC19; Wed, 16 Dec 2009 06:02:35 +0000 (UTC) Received: from delta.allbsd.org (p3177-ipbf416funabasi.chiba.ocn.ne.jp [123.225.92.177]) (authenticated bits=128) by mail.allbsd.org (8.14.3/8.14.3) with ESMTP id nBG629Bd013631; Wed, 16 Dec 2009 15:02:21 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (alph.allbsd.org [192.168.0.10]) (authenticated bits=0) by delta.allbsd.org (8.13.4/8.13.4) with ESMTP id nBG625T6073065; Wed, 16 Dec 2009 15:02:07 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 16 Dec 2009 15:01:37 +0900 (JST) Message-Id: <20091216.150137.11277993.hrs@allbsd.org> To: dougb@FreeBSD.org, freebsd-rc@FreeBSD.org From: Hiroki Sato In-Reply-To: <4B28181B.5070503@FreeBSD.org> References: <200912070625.nB76PJli043796@svn.freebsd.org> <4B28181B.5070503@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3rc1 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Dec_16_15_01_37_2009_122)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.95.3 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [133.31.130.32]); Wed, 16 Dec 2009 15:02:27 +0900 (JST) X-Spam-Status: No, score=-5.6 required=13.0 tests=AWL,BAYES_00, CONTENT_TYPE_PRESENT, QENCPTR1, SPF_SOFTFAIL, X_MAILER_PRESENT autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gatekeeper.allbsd.org Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r200205 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-rc@FreeBSD.org List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 06:02:38 -0000 ----Security_Multipart(Wed_Dec_16_15_01_37_2009_122)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Doug Barton wrote in <4B28181B.5070503@FreeBSD.org>: do> You apparently merged your change from r197144 without applying my fix do> for this problem above from r198162, which broke this feature in do> 8-stable. See http://www.freebsd.org/cgi/query-pr.cgi?pr=141642 do> do> In my mind breaking this feature in a -stable branch is a fairly do> serious error, and adds fuel to my growing discomfort about the do> changes you've been making in /etc. How do you suggest that we move do> forward and at the same time lessen the potential for further problems? I am really sorry for breaking it again. My intention was to merge only changes of set_rcvar* on a request, but I mistakenly included the line you fixed after I committed the original change. It is totally my fault. Sorry. I think I will add regression tests for checking rc.d functionality before merging other changes I made on -HEAD. The rc.d scripts are used in various ways now and there are some ambiguous definitions and inconsistency such as a way to set the default value to a variable, naming conventions, and so on, so for that we may need to define what are correct/acceptable ones. Anyway, I start trying to do so and this should help to prevent further inappropriate changes (in terms of whether the existing functionality is broken or not) from being added. -- Hiroki ----Security_Multipart(Wed_Dec_16_15_01_37_2009_122)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAksod8EACgkQTyzT2CeTzy3ZTQCdGcpJ/K8xEN2eRsWjYC6hrqh8 okYAn3uzvbOCwS85lwRq18+AZLsnhitO =j2E6 -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Dec_16_15_01_37_2009_122)---- From owner-svn-src-stable-8@FreeBSD.ORG Wed Dec 16 17:48:27 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3EFC1065670; Wed, 16 Dec 2009 17:48:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E23FB8FC08; Wed, 16 Dec 2009 17:48:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGHmQv5006272; Wed, 16 Dec 2009 17:48:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGHmQn1006270; Wed, 16 Dec 2009 17:48:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912161748.nBGHmQn1006270@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 Dec 2009 17:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200608 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 17:48:27 -0000 Author: mav Date: Wed Dec 16 17:48:26 2009 New Revision: 200608 URL: http://svn.freebsd.org/changeset/base/200608 Log: MFC r200607: Large I/Os on Promise controllers reported to cause UDMA ICRC errors and subsequent timeouts. Restore previous limit for now, at least until I will have hardware to experiment. PR: kern/141438 Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-promise.c Wed Dec 16 17:42:02 2009 (r200607) +++ stable/8/sys/dev/ata/chipsets/ata-promise.c Wed Dec 16 17:48:26 2009 (r200608) @@ -957,6 +957,7 @@ ata_promise_mio_dmainit(device_t dev) ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_promise_mio_setprd; + ch->dma.max_iosize = 65536; } From owner-svn-src-stable-8@FreeBSD.ORG Wed Dec 16 18:39:32 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C45CF1065670; Wed, 16 Dec 2009 18:39:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98E7B8FC12; Wed, 16 Dec 2009 18:39:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGIdWsp007457; Wed, 16 Dec 2009 18:39:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGIdW2d007453; Wed, 16 Dec 2009 18:39:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912161839.nBGIdW2d007453@svn.freebsd.org> From: Marius Strobl Date: Wed, 16 Dec 2009 18:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200611 - in stable/8/sys/dev/ata: . chipsets X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 18:39:32 -0000 Author: marius Date: Wed Dec 16 18:39:32 2009 New Revision: 200611 URL: http://svn.freebsd.org/changeset/base/200611 Log: MFC: r200459 Unbreak the ata_atapi() usage. Since r200171 (MFC'ed in r200432) the mode setting functions get a ata_device type device passed instead of a ata_channel one, thus ata_atapi() has to be adjusted accordingly. Reviewed by: mav Modified: stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/ata/ata-all.h stable/8/sys/dev/ata/chipsets/ata-ite.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Wed Dec 16 18:03:35 2009 (r200610) +++ stable/8/sys/dev/ata/ata-all.c Wed Dec 16 18:39:32 2009 (r200611) @@ -1150,12 +1150,11 @@ ata_satarev2str(int rev) } int -ata_atapi(device_t dev) +ata_atapi(device_t dev, int target) { - struct ata_channel *ch = device_get_softc(device_get_parent(dev)); - struct ata_device *atadev = device_get_softc(dev); + struct ata_channel *ch = device_get_softc(dev); - return (ch->devices & (ATA_ATAPI_MASTER << atadev->unit)); + return (ch->devices & (ATA_ATAPI_MASTER << target)); } int Modified: stable/8/sys/dev/ata/ata-all.h ============================================================================== --- stable/8/sys/dev/ata/ata-all.h Wed Dec 16 18:03:35 2009 (r200610) +++ stable/8/sys/dev/ata/ata-all.h Wed Dec 16 18:39:32 2009 (r200611) @@ -622,7 +622,7 @@ void ata_udelay(int interval); char *ata_unit2str(struct ata_device *atadev); const char *ata_mode2str(int mode); const char *ata_satarev2str(int rev); -int ata_atapi(device_t dev); +int ata_atapi(device_t dev, int target); int ata_pmode(struct ata_params *ap); int ata_wmode(struct ata_params *ap); int ata_umode(struct ata_params *ap); Modified: stable/8/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ite.c Wed Dec 16 18:03:35 2009 (r200610) +++ stable/8/sys/dev/ata/chipsets/ata-ite.c Wed Dec 16 18:39:32 2009 (r200611) @@ -212,12 +212,12 @@ ata_ite_8213_setmode(device_t dev, int t reg40 |= 0x4033; /* Set PIO/WDMA timings. */ if (target == 0) { - reg40 |= (ata_atapi(dev) ? 0x04 : 0x00); + reg40 |= (ata_atapi(dev, target) ? 0x04 : 0x00); mask40 = 0x3300; new40 = timings[ata_mode2idx(piomode)] << 8; } else { - reg40 |= (ata_atapi(dev) ? 0x40 : 0x00); + reg40 |= (ata_atapi(dev, target) ? 0x40 : 0x00); mask44 = 0x0f; new44 = ((timings[ata_mode2idx(piomode)] & 0x30) >> 2) | (timings[ata_mode2idx(piomode)] & 0x03); From owner-svn-src-stable-8@FreeBSD.ORG Wed Dec 16 21:48:27 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80B8C106566C; Wed, 16 Dec 2009 21:48:27 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F6CE8FC16; Wed, 16 Dec 2009 21:48:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGLmRs7011700; Wed, 16 Dec 2009 21:48:27 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGLmRoM011698; Wed, 16 Dec 2009 21:48:27 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <200912162148.nBGLmRoM011698@svn.freebsd.org> From: Ivan Voras Date: Wed, 16 Dec 2009 21:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200618 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 21:48:27 -0000 Author: ivoras Date: Wed Dec 16 21:48:27 2009 New Revision: 200618 URL: http://svn.freebsd.org/changeset/base/200618 Log: MFC r199764: Make ULE process usage (%CPU) accounting usable again Approved by: gnn (mentor) (implicitly) Modified: stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Wed Dec 16 20:03:43 2009 (r200617) +++ stable/8/sys/kern/sched_ule.c Wed Dec 16 21:48:27 2009 (r200618) @@ -103,6 +103,7 @@ struct td_sched { u_int ts_slptime; /* Number of ticks we vol. slept */ u_int ts_runtime; /* Number of ticks we were running */ int ts_ltick; /* Last tick that we were running on */ + int ts_incrtick; /* Last tick that we incremented on */ int ts_ftick; /* First tick that we were running on */ int ts_ticks; /* Tick count */ #ifdef KTR @@ -1991,6 +1992,7 @@ sched_fork_thread(struct thread *td, str */ ts2->ts_ticks = ts->ts_ticks; ts2->ts_ltick = ts->ts_ltick; + ts2->ts_incrtick = ts->ts_incrtick; ts2->ts_ftick = ts->ts_ftick; child->td_user_pri = td->td_user_pri; child->td_base_user_pri = td->td_base_user_pri; @@ -2182,11 +2184,12 @@ sched_tick(void) * Ticks is updated asynchronously on a single cpu. Check here to * avoid incrementing ts_ticks multiple times in a single tick. */ - if (ts->ts_ltick == ticks) + if (ts->ts_incrtick == ticks) return; /* Adjust ticks for pctcpu */ ts->ts_ticks += 1 << SCHED_TICK_SHIFT; ts->ts_ltick = ticks; + ts->ts_incrtick = ticks; /* * Update if we've exceeded our desired tick threshhold by over one * second. From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 17 02:06:07 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FAE51065676; Thu, 17 Dec 2009 02:06:07 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E21C8FC0A; Thu, 17 Dec 2009 02:06:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBH267EN017401; Thu, 17 Dec 2009 02:06:07 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH267ma017399; Thu, 17 Dec 2009 02:06:07 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912170206.nBH267ma017399@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 17 Dec 2009 02:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200622 - stable/8/lib/libthr/thread X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 02:06:07 -0000 Author: marcel Date: Thu Dec 17 02:06:07 2009 New Revision: 200622 URL: http://svn.freebsd.org/changeset/base/200622 Log: MFC rev 200498: Work-around a race condition on ia64 while unlocking a contested lock. Modified: stable/8/lib/libthr/thread/thr_umtx.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_umtx.c ============================================================================== --- stable/8/lib/libthr/thread/thr_umtx.c Thu Dec 17 00:22:56 2009 (r200621) +++ stable/8/lib/libthr/thread/thr_umtx.c Thu Dec 17 02:06:07 2009 (r200622) @@ -112,10 +112,13 @@ __thr_umutex_timedlock(struct umutex *mt int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) { +#ifndef __ia64__ + /* XXX this logic has a race-condition on ia64. */ if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) { atomic_cmpset_rel_32(&mtx->m_owner, id | UMUTEX_CONTESTED, UMUTEX_CONTESTED); return _umtx_op_err(mtx, UMTX_OP_MUTEX_WAKE, 0, 0, 0); } +#endif /* __ia64__ */ return _umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 17 18:43:34 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFFCB106566B; Thu, 17 Dec 2009 18:43:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 853918FC17; Thu, 17 Dec 2009 18:43:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHIhYsp045588; Thu, 17 Dec 2009 18:43:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHIhYad045585; Thu, 17 Dec 2009 18:43:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912171843.nBHIhYad045585@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 Dec 2009 18:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200642 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:43:34 -0000 Author: kib Date: Thu Dec 17 18:43:34 2009 New Revision: 200642 URL: http://svn.freebsd.org/changeset/base/200642 Log: MFC r200450: Document PBDRY and SLEEPQ_STOP_ON_BDRY. Modified: stable/8/share/man/man9/sleep.9 stable/8/share/man/man9/sleepqueue.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/sleep.9 ============================================================================== --- stable/8/share/man/man9/sleep.9 Thu Dec 17 18:37:11 2009 (r200641) +++ stable/8/share/man/man9/sleep.9 Thu Dec 17 18:43:34 2009 (r200642) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2008 +.Dd December 12, 2009 .Os .Dt SLEEP 9 .Sh NAME @@ -97,6 +97,7 @@ when it resumes. should never be used, as it is for compatibility only. A new priority of 0 means to use the thread's current priority when it is made runnable again. +.Pp If .Fa priority includes the @@ -113,6 +114,17 @@ possible, and is returned if the system call should be interrupted by the signal (return .Er EINTR ) . +If +.Dv PBDRY +flag is specified in addition to +.Dv PCATCH , +then the sleeping thread is not stopped while sleeping upon delivery of +.Dv SIGSTOP +or other stop action. +Instead, it is waken up, assuming that stop occurs on reaching a stop +point when returning to usermode. +The flag should be used when sleeping thread owns resources, for instance +vnode locks, that should be freed timely. .Pp The parameter .Fa wmesg Modified: stable/8/share/man/man9/sleepqueue.9 ============================================================================== --- stable/8/share/man/man9/sleepqueue.9 Thu Dec 17 18:37:11 2009 (r200641) +++ stable/8/share/man/man9/sleepqueue.9 Thu Dec 17 18:43:34 2009 (r200642) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2007 +.Dd December 12, 2009 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -195,12 +195,19 @@ A sleep queue used to implement .Xr pause 9 . .El .Pp -There is currently only one optional flag: +There are currently two optional flag: .Pp .Bl -tag -width ".Dv SLEEPQ_INTERRUPTIBLE" -compact .It Dv SLEEPQ_INTERRUPTIBLE The current thread is entering an interruptible sleep. .El +.Bl -tag -width ".Dv SLEEPQ_STOP_ON_BDRY" -compact +.It Dv SLEEPQ_STOP_ON_BDRY +When thread is entering an interruptible sleep, do not stop it upon +arrival of stop action, like +.Dv SIGSTOP . +Wake it up instead. +.El .Pp A timeout on the sleep may be specified by calling .Fn sleepq_set_timeout From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 17 18:56:52 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B3A2106566B; Thu, 17 Dec 2009 18:56:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49F958FC0C; Thu, 17 Dec 2009 18:56:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHIuqU8046161; Thu, 17 Dec 2009 18:56:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHIuqDA046159; Thu, 17 Dec 2009 18:56:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912171856.nBHIuqDA046159@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 Dec 2009 18:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200643 - stable/8/lib/libutil X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:56:52 -0000 Author: kib Date: Thu Dec 17 18:56:52 2009 New Revision: 200643 URL: http://svn.freebsd.org/changeset/base/200643 Log: MFC r199826: sigset() is the name of function specified by SUSv4. Replace it to avoid conflict. Modified: stable/8/lib/libutil/pw_util.c Directory Properties: stable/8/lib/libutil/ (props changed) Modified: stable/8/lib/libutil/pw_util.c ============================================================================== --- stable/8/lib/libutil/pw_util.c Thu Dec 17 18:43:34 2009 (r200642) +++ stable/8/lib/libutil/pw_util.c Thu Dec 17 18:56:52 2009 (r200643) @@ -289,7 +289,7 @@ int pw_edit(int notsetuid) { struct sigaction sa, sa_int, sa_quit; - sigset_t oldsigset, sigset; + sigset_t oldsigset, nsigset; struct stat st1, st2; const char *editor; int pstat; @@ -303,9 +303,9 @@ pw_edit(int notsetuid) sa.sa_flags = 0; sigaction(SIGINT, &sa, &sa_int); sigaction(SIGQUIT, &sa, &sa_quit); - sigemptyset(&sigset); - sigaddset(&sigset, SIGCHLD); - sigprocmask(SIG_BLOCK, &sigset, &oldsigset); + sigemptyset(&nsigset); + sigaddset(&nsigset, SIGCHLD); + sigprocmask(SIG_BLOCK, &nsigset, &oldsigset); switch ((editpid = fork())) { case -1: return (-1); From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 17 19:53:16 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD95D1065694; Thu, 17 Dec 2009 19:53:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB8FC8FC13; Thu, 17 Dec 2009 19:53:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHJrGxw048180; Thu, 17 Dec 2009 19:53:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHJrGbw048176; Thu, 17 Dec 2009 19:53:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912171953.nBHJrGbw048176@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 Dec 2009 19:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200645 - in stable/8: libexec/rtld-elf sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 19:53:17 -0000 Author: kib Date: Thu Dec 17 19:53:16 2009 New Revision: 200645 URL: http://svn.freebsd.org/changeset/base/200645 Log: MFC r199829: Implement rtld part of the support for -z nodlopen (see ld(1)). MFC r199877: Allow to load not-openable dso when tracing. This fixes ldd on such dso or dso linked to non-openable object. Remove '\n' at the end of error message. End comments with dot. Modified: stable/8/libexec/rtld-elf/rtld.c stable/8/libexec/rtld-elf/rtld.h stable/8/sys/sys/elf_common.h Directory Properties: stable/8/libexec/rtld-elf/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Thu Dec 17 19:48:54 2009 (r200644) +++ stable/8/libexec/rtld-elf/rtld.c Thu Dec 17 19:53:16 2009 (r200645) @@ -87,7 +87,7 @@ static void die(void) __dead2; static void digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static Obj_Entry *dlcheck(void *); -static Obj_Entry *do_load_object(int, const char *, char *, struct stat *); +static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); static bool donelist_check(DoneList *, const Obj_Entry *); static void errmsg_restore(char *); @@ -103,7 +103,7 @@ static void initlist_add_objects(Obj_Ent static bool is_exported(const Elf_Sym *); static void linkmap_add(Obj_Entry *); static void linkmap_delete(Obj_Entry *); -static int load_needed_objects(Obj_Entry *); +static int load_needed_objects(Obj_Entry *, int); static int load_preload_objects(void); static Obj_Entry *load_object(const char *, const Obj_Entry *, int); static Obj_Entry *obj_from_addr(const void *); @@ -485,7 +485,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ preload_tail = obj_tail; dbg("loading needed objects"); - if (load_needed_objects(obj_main) == -1) + if (load_needed_objects(obj_main, 0) == -1) die(); /* Make a list of all objects loaded at startup. */ @@ -932,6 +932,8 @@ digest_dynamic(Obj_Entry *obj, int early #endif case DT_FLAGS_1: + if (dynp->d_un.d_val & DF_1_NOOPEN) + obj->z_noopen = true; if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust) obj->z_origin = true; if (dynp->d_un.d_val & DF_1_GLOBAL) @@ -1425,7 +1427,7 @@ is_exported(const Elf_Sym *def) * returns -1 on failure. */ static int -load_needed_objects(Obj_Entry *first) +load_needed_objects(Obj_Entry *first, int flags) { Obj_Entry *obj, *obj1; @@ -1434,7 +1436,7 @@ load_needed_objects(Obj_Entry *first) for (needed = obj->needed; needed != NULL; needed = needed->next) { obj1 = needed->obj = load_object(obj->strtab + needed->name, obj, - false); + flags & ~RTLD_LO_NOLOAD); if (obj1 == NULL && !ld_tracing) return -1; if (obj1 != NULL && obj1->z_nodelete && !obj1->ref_nodel) { @@ -1465,7 +1467,7 @@ load_preload_objects(void) savech = p[len]; p[len] = '\0'; - if (load_object(p, NULL, false) == NULL) + if (load_object(p, NULL, 0) == NULL) return -1; /* XXX - cleanup */ p[len] = savech; p += len; @@ -1482,7 +1484,7 @@ load_preload_objects(void) * on failure. */ static Obj_Entry * -load_object(const char *name, const Obj_Entry *refobj, int noload) +load_object(const char *name, const Obj_Entry *refobj, int flags) { Obj_Entry *obj; int fd = -1; @@ -1528,11 +1530,11 @@ load_object(const char *name, const Obj_ close(fd); return obj; } - if (noload) + if (flags & RTLD_LO_NOLOAD) return (NULL); /* First use of this object, so we must map it in */ - obj = do_load_object(fd, name, path, &sb); + obj = do_load_object(fd, name, path, &sb, flags); if (obj == NULL) free(path); close(fd); @@ -1541,7 +1543,8 @@ load_object(const char *name, const Obj_ } static Obj_Entry * -do_load_object(int fd, const char *name, char *path, struct stat *sbp) +do_load_object(int fd, const char *name, char *path, struct stat *sbp, + int flags) { Obj_Entry *obj; struct statfs fs; @@ -1568,6 +1571,14 @@ do_load_object(int fd, const char *name, object_add_name(obj, name); obj->path = path; digest_dynamic(obj, 0); + if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) == + RTLD_LO_DLOPEN) { + dbg("refusing to load non-loadable \"%s\"", obj->path); + _rtld_error("Cannot dlopen non-loadable %s", obj->path); + munmap(obj->mapbase, obj->mapsize); + obj_free(obj); + return (NULL); + } *obj_tail = obj; obj_tail = &obj->next; @@ -1986,14 +1997,18 @@ dlopen(const char *name, int mode) Obj_Entry **old_obj_tail; Obj_Entry *obj; Objlist initlist; - int result, lockstate, nodelete, noload; + int result, lockstate, nodelete, lo_flags; LD_UTRACE(UTRACE_DLOPEN_START, NULL, NULL, 0, mode, name); ld_tracing = (mode & RTLD_TRACE) == 0 ? NULL : "1"; if (ld_tracing != NULL) environ = (char **)*get_program_var_addr("environ"); nodelete = mode & RTLD_NODELETE; - noload = mode & RTLD_NOLOAD; + lo_flags = RTLD_LO_DLOPEN; + if (mode & RTLD_NOLOAD) + lo_flags |= RTLD_LO_NOLOAD; + if (ld_tracing != NULL) + lo_flags |= RTLD_LO_TRACE; objlist_init(&initlist); @@ -2006,7 +2021,7 @@ dlopen(const char *name, int mode) obj = obj_main; obj->refcount++; } else { - obj = load_object(name, obj_main, noload); + obj = load_object(name, obj_main, lo_flags); } if (obj) { @@ -2016,7 +2031,7 @@ dlopen(const char *name, int mode) mode &= RTLD_MODEMASK; if (*old_obj_tail != NULL) { /* We loaded something new. */ assert(*old_obj_tail == obj); - result = load_needed_objects(obj); + result = load_needed_objects(obj, RTLD_LO_DLOPEN); init_dag(obj); if (result != -1) result = rtld_verify_versions(&obj->dagmembers); Modified: stable/8/libexec/rtld-elf/rtld.h ============================================================================== --- stable/8/libexec/rtld-elf/rtld.h Thu Dec 17 19:48:54 2009 (r200644) +++ stable/8/libexec/rtld-elf/rtld.h Thu Dec 17 19:53:16 2009 (r200645) @@ -218,6 +218,7 @@ typedef struct Struct_Obj_Entry { bool phdr_alloc : 1; /* Phdr is allocated and needs to be freed. */ bool z_origin : 1; /* Process rpath and soname tokens */ bool z_nodelete : 1; /* Do not unload the object and dependencies */ + bool z_noopen : 1; /* Do not load on dlopen */ bool ref_nodel : 1; /* Refcount increased to prevent dlclose */ bool init_scanned: 1; /* Object is already on init list. */ bool on_fini_list: 1; /* Object is already on fini list. */ @@ -240,6 +241,11 @@ typedef struct Struct_Obj_Entry { #define SYMLOOK_DLSYM 0x02 /* Return newes versioned symbol. Used by dlsym. */ +/* Flags for load_object(). */ +#define RTLD_LO_NOLOAD 0x01 /* dlopen() specified RTLD_NOLOAD. */ +#define RTLD_LO_DLOPEN 0x02 /* Load_object() called from dlopen(). */ +#define RTLD_LO_TRACE 0x04 /* Only tracing. */ + /* * Symbol cache entry used during relocation to avoid multiple lookups * of the same symbol. Modified: stable/8/sys/sys/elf_common.h ============================================================================== --- stable/8/sys/sys/elf_common.h Thu Dec 17 19:48:54 2009 (r200644) +++ stable/8/sys/sys/elf_common.h Thu Dec 17 19:53:16 2009 (r200645) @@ -471,6 +471,7 @@ typedef struct { #define DF_1_BIND_NOW 0x00000001 /* Same as DF_BIND_NOW */ #define DF_1_GLOBAL 0x00000002 /* Set the RTLD_GLOBAL for object */ #define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ +#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ /* Values for n_type. Used in core files. */ From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 17 20:41:27 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75B9A106566C; Thu, 17 Dec 2009 20:41:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B29E8FC0C; Thu, 17 Dec 2009 20:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHKfRlQ049650; Thu, 17 Dec 2009 20:41:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHKfRnQ049646; Thu, 17 Dec 2009 20:41:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912172041.nBHKfRnQ049646@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Dec 2009 20:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200648 - in stable/8/lib/libc: gen include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 20:41:27 -0000 Author: jhb Date: Thu Dec 17 20:41:27 2009 New Revision: 200648 URL: http://svn.freebsd.org/changeset/base/200648 Log: MFC 199606, 199614: Add an internal _once() method. This works identical to pthread_once(3) with the additional property that it is safe for routines in libc to use in both single-threaded and multi-threaded processes. Multi-threaded processes use the pthread_once() implementation from the threading library while single-threaded processes use a simplified "stub" version internal to libc. Added: stable/8/lib/libc/gen/_once_stub.c - copied, changed from r199606, head/lib/libc/gen/_once_stub.c Modified: stable/8/lib/libc/gen/Makefile.inc stable/8/lib/libc/include/libc_private.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/gen/Makefile.inc ============================================================================== --- stable/8/lib/libc/gen/Makefile.inc Thu Dec 17 19:56:09 2009 (r200647) +++ stable/8/lib/libc/gen/Makefile.inc Thu Dec 17 20:41:27 2009 (r200648) @@ -5,7 +5,8 @@ .PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen SRCS+= __getosreldate.c __xuname.c \ - _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \ + _once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \ + _thread_init.c \ alarm.c arc4random.c assert.c basename.c check_utility_compat.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ Copied and modified: stable/8/lib/libc/gen/_once_stub.c (from r199606, head/lib/libc/gen/_once_stub.c) ============================================================================== --- head/lib/libc/gen/_once_stub.c Fri Nov 20 19:19:51 2009 (r199606, copy source) +++ stable/8/lib/libc/gen/_once_stub.c Thu Dec 17 20:41:27 2009 (r200648) @@ -33,11 +33,8 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -/* - * This implements pthread_once() for the single-threaded case. It is - * non-static so that it can be used by _pthread_stubs.c. - */ -int +/* This implements pthread_once() for the single-threaded case. */ +static int _libc_once(pthread_once_t *once_control, void (*init_routine)(void)) { Modified: stable/8/lib/libc/include/libc_private.h ============================================================================== --- stable/8/lib/libc/include/libc_private.h Thu Dec 17 19:56:09 2009 (r200647) +++ stable/8/lib/libc/include/libc_private.h Thu Dec 17 20:41:27 2009 (r200648) @@ -34,6 +34,7 @@ #ifndef _LIBC_PRIVATE_H_ #define _LIBC_PRIVATE_H_ +#include /* * This global flag is non-zero when a process has created one @@ -147,6 +148,12 @@ int _yp_check(char **); void _init_tls(void); /* + * Provides pthread_once()-like functionality for both single-threaded + * and multi-threaded applications. + */ +int _once(pthread_once_t *, void (*)(void)); + +/* * Set the TLS thread pointer */ void _set_tp(void *tp); From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 06:09:44 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C14F106566C; Fri, 18 Dec 2009 06:09:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EECF98FC15; Fri, 18 Dec 2009 06:09:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBI69h0C076832; Fri, 18 Dec 2009 06:09:43 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBI69hN7076830; Fri, 18 Dec 2009 06:09:43 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200912180609.nBI69hN7076830@svn.freebsd.org> From: Brooks Davis Date: Fri, 18 Dec 2009 06:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200662 - stable/8/lib/libkvm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 06:09:44 -0000 Author: brooks Date: Fri Dec 18 06:09:43 2009 New Revision: 200662 URL: http://svn.freebsd.org/changeset/base/200662 Log: MFC r200366 Add a missing else that negated the truncation of ki_ngroups to NGROUPS. Submitted by: Dmitry Pryanishnikov Modified: stable/8/lib/libkvm/kvm_proc.c Directory Properties: stable/8/lib/libkvm/ (props changed) Modified: stable/8/lib/libkvm/kvm_proc.c ============================================================================== --- stable/8/lib/libkvm/kvm_proc.c Fri Dec 18 01:30:11 2009 (r200661) +++ stable/8/lib/libkvm/kvm_proc.c Fri Dec 18 06:09:43 2009 (r200662) @@ -149,7 +149,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcn if (ucred.cr_ngroups > KI_NGROUPS) { kp->ki_ngroups = KI_NGROUPS; kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW; - } + } else kp->ki_ngroups = ucred.cr_ngroups; kvm_read(kd, (u_long)ucred.cr_groups, kp->ki_groups, kp->ki_ngroups * sizeof(gid_t)); From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 18:30:49 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D98AA106566B; Fri, 18 Dec 2009 18:30:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C88FB8FC14; Fri, 18 Dec 2009 18:30:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIIUnp9003581; Fri, 18 Dec 2009 18:30:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIIUn3K003579; Fri, 18 Dec 2009 18:30:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912181830.nBIIUn3K003579@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 18:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200675 - stable/8/sys/dev/if_ndis X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 18:30:50 -0000 Author: jhb Date: Fri Dec 18 18:30:49 2009 New Revision: 200675 URL: http://svn.freebsd.org/changeset/base/200675 Log: MFC 200037: ndis_scan_results() can sleep if the scan results are not ready when ndis_scan() is called. However, ndis_scan() is invoked from softclock() and cannot sleep. Move ndis_scan_results() to the ndis driver's scan_end hook instead. Modified: stable/8/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis.c Fri Dec 18 17:46:57 2009 (r200674) +++ stable/8/sys/dev/if_ndis/if_ndis.c Fri Dec 18 18:30:49 2009 (r200675) @@ -3278,14 +3278,8 @@ ndis_newstate(struct ieee80211vap *vap, static void ndis_scan(void *arg) { - struct ndis_softc *sc = arg; - struct ieee80211com *ic; - struct ieee80211vap *vap; - - ic = sc->ifp->if_l2com; - vap = TAILQ_FIRST(&ic->ic_vaps); + struct ieee80211vap *vap = arg; - ndis_scan_results(sc); ieee80211_scan_done(vap); } @@ -3434,7 +3428,7 @@ ndis_scan_start(struct ieee80211com *ic) return; } /* Set a timer to collect the results */ - callout_reset(&sc->ndis_scan_callout, hz * 3, ndis_scan, sc); + callout_reset(&sc->ndis_scan_callout, hz * 3, ndis_scan, vap); } static void @@ -3458,6 +3452,8 @@ ndis_scan_mindwell(struct ieee80211_scan static void ndis_scan_end(struct ieee80211com *ic) { - /* ignore */ + struct ndis_softc *sc = ic->ic_ifp->if_softc; + + ndis_scan_results(sc); } From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 18:55:15 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89A96106566B; Fri, 18 Dec 2009 18:55:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDB08FC12; Fri, 18 Dec 2009 18:55:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIItFu7005165; Fri, 18 Dec 2009 18:55:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIItFMe005161; Fri, 18 Dec 2009 18:55:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912181855.nBIItFMe005161@svn.freebsd.org> From: Xin LI Date: Fri, 18 Dec 2009 18:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200677 - in stable/8: . share/man/man8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 18:55:15 -0000 Author: delphij Date: Fri Dec 18 18:55:15 2009 New Revision: 200677 URL: http://svn.freebsd.org/changeset/base/200677 Log: MFC r199463: rc.early(8) was removed as of 20090530 so remove manual page reference to it. Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/share/man/man8/Makefile stable/8/share/man/man8/rc.8 Directory Properties: stable/8/share/man/man8/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Fri Dec 18 18:45:36 2009 (r200676) +++ stable/8/ObsoleteFiles.inc Fri Dec 18 18:55:15 2009 (r200677) @@ -14,6 +14,16 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20091218: removal of rc.early(8) link +OLD_FILES+=usr/share/man/man8/rc.early.8.gz +# 20091027: pselect.3 implemented as syscall +OLD_FILES+=usr/share/man/man3/pselect.3.gz +# 20091005: fusword.9 and susword.9 removed +OLD_FILES+=usr/share/man/man9/fusword.9.gz +OLD_FILES+=usr/share/man/man9/susword.9.gz +# 20090909: vesa and dpms promoted to be i386/amd64 common +OLD_FILES+=usr/include/machine/pc/vesa.h +OLD_FILES+=usr/share/man/man4/i386/dpms.4.gz # 20090904: remove lukemftpd OLD_FILES+=usr/libexec/lukemftpd OLD_FILES+=usr/share/man/man5/ftpd.conf.5.gz Modified: stable/8/share/man/man8/Makefile ============================================================================== --- stable/8/share/man/man8/Makefile Fri Dec 18 18:45:36 2009 (r200676) +++ stable/8/share/man/man8/Makefile Fri Dec 18 18:55:15 2009 (r200677) @@ -16,7 +16,6 @@ MAN= crash.8 \ MLINKS= rc.8 rc.atm.8 \ rc.8 rc.d.8 \ - rc.8 rc.early.8 \ rc.8 rc.firewall.8 \ rc.8 rc.local.8 \ rc.8 rc.network.8 \ Modified: stable/8/share/man/man8/rc.8 ============================================================================== --- stable/8/share/man/man8/rc.8 Fri Dec 18 18:45:36 2009 (r200676) +++ stable/8/share/man/man8/rc.8 Fri Dec 18 18:55:15 2009 (r200677) @@ -35,7 +35,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd May 18, 2007 +.Dd November 17, 2009 .Dt RC 8 .Os .Sh NAME @@ -394,20 +394,6 @@ is not set, when going from single-user the script does not do anything. .Pp The -.Nm rc.early -script is run very early in the startup process, immediately before the -file system check. -The -.Nm rc.early -script is deprecated. -Any commands in this -file should be separated out into -.Nm rc.d/ -style scripts and integrated into the -.Nm -system. -.Pp -The .Pa /etc/rc.d/local script can execute scripts from multiple .Nm rc.d/ From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 19:16:45 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2C5E1065679; Fri, 18 Dec 2009 19:16:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A19308FC13; Fri, 18 Dec 2009 19:16:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIJGjQS005684; Fri, 18 Dec 2009 19:16:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIJGjim005683; Fri, 18 Dec 2009 19:16:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912181916.nBIJGjim005683@svn.freebsd.org> From: Xin LI Date: Fri, 18 Dec 2009 19:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200678 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 19:16:45 -0000 Author: delphij Date: Fri Dec 18 19:16:44 2009 New Revision: 200678 URL: http://svn.freebsd.org/changeset/base/200678 Log: MFC r199464: Add a missing .Ed tag. Modified: stable/8/share/man/man4/wi.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/wi.4 ============================================================================== --- stable/8/share/man/man4/wi.4 Fri Dec 18 18:55:15 2009 (r200677) +++ stable/8/share/man/man4/wi.4 Fri Dec 18 19:16:44 2009 (r200678) @@ -253,6 +253,7 @@ Join a specific BSS network with network .Bd -literal -offset indent ifconfig wlan create wlandev wi0 inet 192.168.0.20 \e netmask 0xffffff00 ssid my_net +.Ed .Pp Join a specific BSS network with WEP encryption: .Bd -literal -offset indent From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 19:26:17 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F39B9106566B; Fri, 18 Dec 2009 19:26:16 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E23D18FC0C; Fri, 18 Dec 2009 19:26:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIJQGjK005960; Fri, 18 Dec 2009 19:26:16 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIJQGPA005958; Fri, 18 Dec 2009 19:26:16 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <200912181926.nBIJQGPA005958@svn.freebsd.org> From: Benedict Reuschling Date: Fri, 18 Dec 2009 19:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200679 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 19:26:17 -0000 Author: bcr (doc committer) Date: Fri Dec 18 19:26:16 2009 New Revision: 200679 URL: http://svn.freebsd.org/changeset/base/200679 Log: MFC r200415: Reference the correct man page for firmware(9). PR: docs/140985 Submitted by: Glen Barber (glen dot j dot barber at gmail dot com) Reviewed by: rpaulo Approved by: rpaulo, jkois (mentor) Merged with: user/des/fmerge Modified: stable/8/share/man/man4/iwnfw.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/iwnfw.4 ============================================================================== --- stable/8/share/man/man4/iwnfw.4 Fri Dec 18 19:16:44 2009 (r200678) +++ stable/8/share/man/man4/iwnfw.4 Fri Dec 18 19:26:16 2009 (r200679) @@ -49,4 +49,4 @@ It may be statically linked into the kernel, or loaded as a module. .Sh SEE ALSO .Xr iwn 4 , -.Xr firmware 8 +.Xr firmware 9 From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 19:43:44 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD75F106566B; Fri, 18 Dec 2009 19:43:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC0218FC0A; Fri, 18 Dec 2009 19:43:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIJhiHD006341; Fri, 18 Dec 2009 19:43:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIJhiVb006339; Fri, 18 Dec 2009 19:43:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912181943.nBIJhiVb006339@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 19:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200680 - stable/8/sys/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 19:43:44 -0000 Author: jhb Date: Fri Dec 18 19:43:44 2009 New Revision: 200680 URL: http://svn.freebsd.org/changeset/base/200680 Log: MFC 200084: Properly return an error reply if an NFS remove or link operation fails. Previously the failing operation would allocate an mbuf and construct an error reply, but because the function did not return 0, the NFS server assumed it had failed to generate a reply and would leak the reply mbuf as well as not sending the reply to the NFS client. Modified: stable/8/sys/nfsserver/nfs_serv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/8/sys/nfsserver/nfs_serv.c Fri Dec 18 19:26:16 2009 (r200679) +++ stable/8/sys/nfsserver/nfs_serv.c Fri Dec 18 19:43:44 2009 (r200680) @@ -1810,10 +1810,9 @@ out: } ereply: nfsm_reply(NFSX_WCCDATA(v3)); - if (v3) { + if (v3) nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); - error = 0; - } + error = 0; nfsmout: NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_dvp) { @@ -2187,8 +2186,8 @@ ereply: if (v3) { nfsm_srvpostop_attr(getret, &at); nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); - error = 0; } + error = 0; /* fall through */ nfsmout: From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 20:05:10 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEA2A1065679; Fri, 18 Dec 2009 20:05:10 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD9B38FC18; Fri, 18 Dec 2009 20:05:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIK5A3B006902; Fri, 18 Dec 2009 20:05:10 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIK5AHd006900; Fri, 18 Dec 2009 20:05:10 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912182005.nBIK5AHd006900@svn.freebsd.org> From: Sean Farley Date: Fri, 18 Dec 2009 20:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200683 - stable/8/lib/libutil X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 20:05:11 -0000 Author: scf Date: Fri Dec 18 20:05:10 2009 New Revision: 200683 URL: http://svn.freebsd.org/changeset/base/200683 Log: Merge from head to stable/8: r200423: Remove a dead store. Modified: stable/8/lib/libutil/gr_util.c Directory Properties: stable/8/lib/libutil/ (props changed) Modified: stable/8/lib/libutil/gr_util.c ============================================================================== --- stable/8/lib/libutil/gr_util.c Fri Dec 18 19:50:47 2009 (r200682) +++ stable/8/lib/libutil/gr_util.c Fri Dec 18 20:05:10 2009 (r200683) @@ -117,8 +117,8 @@ gr_make(const struct group *gr) /* Create the group line and fill it. */ if ((line = malloc(line_size)) == NULL) return (NULL); - line_size = snprintf(line, line_size, group_line_format, gr->gr_name, - gr->gr_passwd, (uintmax_t)gr->gr_gid); + snprintf(line, line_size, group_line_format, gr->gr_name, gr->gr_passwd, + (uintmax_t)gr->gr_gid); if (gr->gr_mem != NULL) for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) { strcat(line, gr->gr_mem[ndx]); From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 20:28:04 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD151106566C; Fri, 18 Dec 2009 20:28:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AD228FC16; Fri, 18 Dec 2009 20:28:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIKS4Om007682; Fri, 18 Dec 2009 20:28:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIKS4UZ007678; Fri, 18 Dec 2009 20:28:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182028.nBIKS4UZ007678@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 20:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200686 - in stable/8/sys/boot/i386: libi386 loader X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 20:28:04 -0000 Author: jhb Date: Fri Dec 18 20:28:04 2009 New Revision: 200686 URL: http://svn.freebsd.org/changeset/base/200686 Log: MFC 200216,200219: - Various small whitespace and style fixes. - Improve the algorithm the loader uses to choose a memory range for its heap when using a range above 1MB. Modified: stable/8/sys/boot/i386/libi386/biosmem.c stable/8/sys/boot/i386/libi386/libi386.h stable/8/sys/boot/i386/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/libi386/biosmem.c ============================================================================== --- stable/8/sys/boot/i386/libi386/biosmem.c Fri Dec 18 20:11:29 2009 (r200685) +++ stable/8/sys/boot/i386/libi386/biosmem.c Fri Dec 18 20:28:04 2009 (r200686) @@ -35,14 +35,20 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; static struct bios_smap smap; +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) + void bios_getmem(void) { + uint64_t size; /* Parse system memory map */ v86.ebx = 0; @@ -65,6 +71,26 @@ bios_getmem(void) if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { bios_extmem = smap.length; } + + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; + + /* + * If this segment crosses the 4GB boundary, truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; + + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } } while (v86.ebx != 0); /* Fall back to the old compatibility function for base memory */ @@ -97,5 +123,13 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } - Modified: stable/8/sys/boot/i386/libi386/libi386.h ============================================================================== --- stable/8/sys/boot/i386/libi386/libi386.h Fri Dec 18 20:11:29 2009 (r200685) +++ stable/8/sys/boot/i386/libi386/libi386.h Fri Dec 18 20:28:04 2009 (r200686) @@ -78,9 +78,9 @@ int bc_add(int biosdev); /* Register CD int bc_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */ int bc_bios2unit(int biosdev); /* xlate BIOS device -> bioscd unit */ int bc_unit2bios(int unit); /* xlate bioscd unit -> BIOS device */ -u_int32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */ -int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */ -int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */ +uint32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */ +int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */ +int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */ int bd_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */ ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len); @@ -92,12 +92,15 @@ void bios_addsmapdata(struct preloaded_f void bios_getsmap(void); void bios_getmem(void); -extern u_int32_t bios_basemem; /* base memory in bytes */ -extern u_int32_t bios_extmem; /* extended memory in bytes */ +extern uint32_t bios_basemem; /* base memory in bytes */ +extern uint32_t bios_extmem; /* extended memory in bytes */ extern vm_offset_t memtop; /* last address of physical memory + 1 */ extern vm_offset_t memtop_copyin; /* memtop less heap size for the cases */ - /* when heap is at the top of extended memory */ - /* for other cases - just the same as memtop */ + /* when heap is at the top of */ + /* extended memory; for other cases */ + /* just the same as memtop */ +extern uint32_t high_heap_size; /* extended memory region available */ +extern vm_offset_t high_heap_base; /* for use as the heap */ int biospci_find_devclass(uint32_t class, int index, uint32_t *locator); int biospci_write_config(uint32_t locator, int offset, int width, uint32_t val); Modified: stable/8/sys/boot/i386/loader/main.c ============================================================================== --- stable/8/sys/boot/i386/loader/main.c Fri Dec 18 20:11:29 2009 (r200685) +++ stable/8/sys/boot/i386/loader/main.c Fri Dec 18 20:28:04 2009 (r200686) @@ -102,14 +102,19 @@ main(void) */ bios_getmem(); -#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; +#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || \ + defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /* From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 21:01:56 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 647F3106566B; Fri, 18 Dec 2009 21:01:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51B2C8FC15; Fri, 18 Dec 2009 21:01:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIL1uGE008596; Fri, 18 Dec 2009 21:01:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIL1uZM008593; Fri, 18 Dec 2009 21:01:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182101.nBIL1uZM008593@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 21:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200689 - in stable/8/sys/boot: i386/zfsboot zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 21:01:56 -0000 Author: jhb Date: Fri Dec 18 21:01:56 2009 New Revision: 200689 URL: http://svn.freebsd.org/changeset/base/200689 Log: MFC 200309: - Port bios_getmem() from libi386 to {gpt,}zfsboot() and use it to safely allocate a heap region above 1MB. This enables {gpt,}zfsboot() to allocate much larger buffers than before. - Use a larger buffer (1MB instead of 128K) for temporary ZFS buffers. This allows more reliable reading of compressed files in a raidz/raidz2 pool. Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c stable/8/sys/boot/zfs/zfsimpl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 20:28:48 2009 (r200688) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 21:01:56 2009 (r200689) @@ -27,6 +27,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -90,8 +91,6 @@ __FBSDID("$FreeBSD$"); #define ARGS 0x900 #define NOPT 14 #define NDEV 3 -#define MEM_BASE 0x12 -#define MEM_EXT 0x15 #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) @@ -149,6 +148,19 @@ static struct bootinfo bootinfo; static uint32_t bootdev; static uint8_t ioctrl = IO_KEYBOARD; +vm_offset_t high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; + +static struct bios_smap smap; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) + +static char *heap_next; +static char *heap_end; + /* Buffers that must not span a 64k boundary. */ #define READ_BUF_SIZE 8192 struct dmadat { @@ -162,7 +174,7 @@ static void load(void); static int parse(void); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); +static void bios_getmem(void); static int drvread(struct dsk *, void *, daddr_t, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -237,14 +249,6 @@ memset(void *p, char val, size_t n) static void * malloc(size_t n) { - static char *heap_next; - static char *heap_end; - - if (!heap_next) { - heap_next = (char *) dmadat + sizeof(*dmadat); - heap_end = (char *) (640*1024); - } - char *p = heap_next; if (p + n > heap_end) { printf("malloc failure\n"); @@ -344,14 +348,91 @@ xfsread(const dnode_phys_t *dnode, off_t return 0; } -static inline uint32_t -memsize(void) +static void +bios_getmem(void) { - v86.addr = MEM_EXT; - v86.eax = 0x8800; - v86int(); - return v86.eax; -} + uint64_t size; + + /* Parse system memory map */ + v86.ebx = 0; + do { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe820*/ + v86.eax = 0xe820; + v86.ecx = sizeof(struct bios_smap); + v86.edx = SMAP_SIG; + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); + v86int(); + if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) + break; + /* look for a low-memory segment that's large enough */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && + (smap.length >= (512 * 1024))) + bios_basemem = smap.length; + /* look for the first segment in 'extended' memory */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { + bios_extmem = smap.length; + } + + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; + + /* + * If this segment crosses the 4GB boundary, truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; + + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } + } while (v86.ebx != 0); + + /* Fall back to the old compatibility function for base memory */ + if (bios_basemem == 0) { + v86.ctl = 0; + v86.addr = 0x12; /* int 0x12 */ + v86int(); + + bios_basemem = (v86.eax & 0xffff) * 1024; + } + + /* Fall back through several compatibility functions for extended memory */ + if (bios_extmem == 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe801*/ + v86.eax = 0xe801; + v86int(); + if (!(v86.efl & 1)) { + bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024; + } + } + if (bios_extmem == 0) { + v86.ctl = 0; + v86.addr = 0x15; /* int 0x15 function 0x88*/ + v86.eax = 0x8800; + v86int(); + bios_extmem = (v86.eax & 0xffff) * 1024; + } + + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; + } +} static inline void getstr(void) @@ -536,6 +617,16 @@ main(void) off_t off; struct dsk *dsk; + bios_getmem(); + + if (high_heap_size > 0) { + heap_end = PTOV(high_heap_base + high_heap_size); + heap_next = PTOV(high_heap_base); + } else { + heap_next = (char *) dmadat + sizeof(*dmadat); + heap_end = (char *) PTOV(bios_basemem); + } + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -550,8 +641,8 @@ main(void) bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); + bootinfo.bi_basemem = bios_basemem / 1024; + bootinfo.bi_extmem = bios_extmem / 1024; bootinfo.bi_memsizes_valid++; bootinfo.bi_bios_dev = dsk->drive; Modified: stable/8/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/8/sys/boot/zfs/zfsimpl.c Fri Dec 18 20:28:48 2009 (r200688) +++ stable/8/sys/boot/zfs/zfsimpl.c Fri Dec 18 21:01:56 2009 (r200689) @@ -51,7 +51,7 @@ static char *dnode_cache_buf; static char *zap_scratch; static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_ptr; -#define TEMP_SIZE (1*SPA_MAXBLOCKSIZE) +#define TEMP_SIZE (1024 * 1024) static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf); From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 21:21:14 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E601065679; Fri, 18 Dec 2009 21:21:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B79F8FC16; Fri, 18 Dec 2009 21:21:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBILLEGQ009108; Fri, 18 Dec 2009 21:21:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBILLE3r009105; Fri, 18 Dec 2009 21:21:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182121.nBILLE3r009105@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 21:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200692 - in stable/8/sys/boot/i386: gptboot zfsboot X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 21:21:14 -0000 Author: jhb Date: Fri Dec 18 21:21:14 2009 New Revision: 200692 URL: http://svn.freebsd.org/changeset/base/200692 Log: MFC 200310: Fix a confusing typo in the EDD packet structure used in gptboot and gptzfsboot. I got the segment and offset fields reversed in the structure, but I also succeeded in crossing the assignments so the actual EDD packet ended up correct. Modified: stable/8/sys/boot/i386/gptboot/gptboot.c stable/8/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/8/sys/boot/i386/gptboot/gptboot.c Fri Dec 18 21:12:37 2009 (r200691) +++ stable/8/sys/boot/i386/gptboot/gptboot.c Fri Dec 18 21:21:14 2009 (r200692) @@ -642,8 +642,8 @@ bcmp(const void *b1, const void *b2, siz static struct { uint16_t len; uint16_t count; - uint16_t seg; uint16_t off; + uint16_t seg; uint64_t lba; } packet; @@ -656,8 +656,8 @@ drvread(void *buf, daddr_t lba, unsigned printf("%c\b", c = c << 8 | c >> 24); packet.len = 0x10; packet.count = nblk; - packet.seg = VTOPOFF(buf); - packet.off = VTOPSEG(buf); + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); packet.lba = lba; v86.ctl = V86_FLAGS; v86.addr = 0x13; Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 21:12:37 2009 (r200691) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Dec 18 21:21:14 2009 (r200692) @@ -1049,8 +1049,8 @@ putchar(int c) static struct { uint16_t len; uint16_t count; - uint16_t seg; uint16_t off; + uint16_t seg; uint64_t lba; } packet; #endif @@ -1065,8 +1065,8 @@ drvread(struct dsk *dsk, void *buf, dadd printf("%c\b", c = c << 8 | c >> 24); packet.len = 0x10; packet.count = nblk; - packet.seg = VTOPOFF(buf); - packet.off = VTOPSEG(buf); + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); packet.lba = lba + dsk->start; v86.ctl = V86_FLAGS; v86.addr = 0x13; From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 22:23:28 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27990106566B; Fri, 18 Dec 2009 22:23:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15CAE8FC08; Fri, 18 Dec 2009 22:23:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIMNRih010776; Fri, 18 Dec 2009 22:23:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIMNR53010774; Fri, 18 Dec 2009 22:23:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912182223.nBIMNR53010774@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 22:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200697 - stable/8/sys/boot/i386/libi386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:23:28 -0000 Author: jhb Date: Fri Dec 18 22:23:27 2009 New Revision: 200697 URL: http://svn.freebsd.org/changeset/base/200697 Log: MFC 200357: Don't warn about an RSDP with a corrupt checksum. The kernel does a better job about warning about these things later and this message can be confusing. Modified: stable/8/sys/boot/i386/libi386/biosacpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/libi386/biosacpi.c ============================================================================== --- stable/8/sys/boot/i386/libi386/biosacpi.c Fri Dec 18 22:14:28 2009 (r200696) +++ stable/8/sys/boot/i386/libi386/biosacpi.c Fri Dec 18 22:23:27 2009 (r200697) @@ -125,10 +125,8 @@ biosacpi_search_rsdp(char *base, int len sum = 0; for (idx = 0; idx < RSDP_CHECKSUM_LENGTH; idx++) sum += *(cp + idx); - if (sum != 0) { - printf("acpi: bad RSDP checksum (%d)\n", sum); + if (sum != 0) continue; - } return(rsdp); } } From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 22:23:29 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25AF1106566C; Fri, 18 Dec 2009 22:23:29 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id D50FC8FC0A; Fri, 18 Dec 2009 22:23:28 +0000 (UTC) Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 726CD1701A; Sat, 19 Dec 2009 01:08:21 +0300 (MSK) Date: Sat, 19 Dec 2009 01:08:21 +0300 From: Maxim Dounin To: Xin LI Message-ID: <20091218220821.GF43547@mdounin.ru> References: <200912181855.nBIItFMe005161@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912181855.nBIItFMe005161@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200677 - in stable/8: . share/man/man8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:23:29 -0000 Hello! On Fri, Dec 18, 2009 at 06:55:15PM +0000, Xin LI wrote: > Author: delphij > Date: Fri Dec 18 18:55:15 2009 > New Revision: 200677 > URL: http://svn.freebsd.org/changeset/base/200677 > > Log: > MFC r199463: > > rc.early(8) was removed as of 20090530 so remove manual page reference > to it. Just a side note: gmirror(8) manpage still references rc.early in description of doing kernel dumps on gmirror. It would be great to fix it too. Maxim Dounin From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 18 22:30:18 2009 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB4BA10656A3; Fri, 18 Dec 2009 22:30:18 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 45E058FC15; Fri, 18 Dec 2009 22:30:16 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 54DF7A595C2; Sat, 19 Dec 2009 06:30:15 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id o7euhlPP-peA; Sat, 19 Dec 2009 06:30:02 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id B3308A595A7; Sat, 19 Dec 2009 06:29:57 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=EkI4YRg7Ao21S2ui23ZoMAN7FkYgj6ZINFI9HGcI7urAQ9vropWLvn9IlnUrV2DDg z7Ww+L4IQE25n6h2y/Gpw== Message-ID: <4B2C0259.7000101@delphij.net> Date: Fri, 18 Dec 2009 14:29:45 -0800 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20091214 Thunderbird/3.0 ThunderBrowse/3.2.6.8 MIME-Version: 1.0 To: Maxim Dounin References: <200912181855.nBIItFMe005161@svn.freebsd.org> <20091218220821.GF43547@mdounin.ru> In-Reply-To: <20091218220821.GF43547@mdounin.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable-8@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r200677 - in stable/8: . share/man/man8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:30:18 -0000 On 2009/12/18 14:08, Maxim Dounin wrote: > Hello! > > On Fri, Dec 18, 2009 at 06:55:15PM +0000, Xin LI wrote: > >> Author: delphij >> Date: Fri Dec 18 18:55:15 2009 >> New Revision: 200677 >> URL: http://svn.freebsd.org/changeset/base/200677 >> >> Log: >> MFC r199463: >> >> rc.early(8) was removed as of 20090530 so remove manual page reference >> to it. > > Just a side note: gmirror(8) manpage still references rc.early in > description of doing kernel dumps on gmirror. It would be great > to fix it too. I think we need to fix it with new instruction about the (deprecated) rc.early and rc.local scripts. To be honest I think it's an overkill to have one-liners as a standard alone rc.d script, as it's far too easy for administrator to screw themselves, though. I have a similar script (ignore the Chinese characters which just described how to do this remotely) http://wiki.freebsdchina.org/howto/s/softupdates-enable Cheers, -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 04:25:19 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA0A81065670; Sat, 19 Dec 2009 04:25:19 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E4018FC14; Sat, 19 Dec 2009 04:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJ4PJel019469; Sat, 19 Dec 2009 04:25:19 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ4PJi4019466; Sat, 19 Dec 2009 04:25:19 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912190425.nBJ4PJi4019466@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Dec 2009 04:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200702 - in stable/8/sys/boot/pc98: libpc98 loader X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 04:25:19 -0000 Author: nyan Date: Sat Dec 19 04:25:19 2009 New Revision: 200702 URL: http://svn.freebsd.org/changeset/base/200702 Log: MFC: r200253 and r200255 Reduce diffs against i386. Modified: stable/8/sys/boot/pc98/libpc98/biosmem.c stable/8/sys/boot/pc98/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/pc98/libpc98/biosmem.c ============================================================================== --- stable/8/sys/boot/pc98/libpc98/biosmem.c Sat Dec 19 01:32:34 2009 (r200701) +++ stable/8/sys/boot/pc98/libpc98/biosmem.c Sat Dec 19 04:25:19 2009 (r200702) @@ -34,8 +34,13 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) void bios_getmem(void) @@ -48,5 +53,12 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory, use the last 3MB of 'extended' memory + * as a high heap candidate. + */ + if (bios_extmem >= HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } - Modified: stable/8/sys/boot/pc98/loader/main.c ============================================================================== --- stable/8/sys/boot/pc98/loader/main.c Sat Dec 19 01:32:34 2009 (r200701) +++ stable/8/sys/boot/pc98/loader/main.c Sat Dec 19 04:25:19 2009 (r200702) @@ -96,14 +96,18 @@ main(void) */ bios_getmem(); -#ifdef LOADER_BZIP2_SUPPORT - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; +#if defined(LOADER_BZIP2_SUPPORT) + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /* From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 04:43:25 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62EFE106566C; Sat, 19 Dec 2009 04:43:25 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FD338FC15; Sat, 19 Dec 2009 04:43:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJ4hPas020011; Sat, 19 Dec 2009 04:43:25 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ4hPNv020009; Sat, 19 Dec 2009 04:43:25 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912190443.nBJ4hPNv020009@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Dec 2009 04:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200705 - stable/8/sys/boot/pc98/btx/btx X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 04:43:25 -0000 Author: nyan Date: Sat Dec 19 04:43:25 2009 New Revision: 200705 URL: http://svn.freebsd.org/changeset/base/200705 Log: MFC: r200254 MFi386: Use real mode instead of v86 mode. Modified: stable/8/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/8/sys/boot/pc98/btx/btx/btx.S Sat Dec 19 04:39:21 2009 (r200704) +++ stable/8/sys/boot/pc98/btx/btx/btx.S Sat Dec 19 04:43:25 2009 (r200705) @@ -21,11 +21,11 @@ .set MEM_BTX,0x1000 # Start of BTX memory .set MEM_ESP0,0x1800 # Supervisor stack .set MEM_BUF,0x1800 # Scratch buffer - .set MEM_ESP1,0x1e00 # Link stack - .set MEM_IDT,0x1e00 # IDT - .set MEM_TSS,0x1f98 # TSS - .set MEM_MAP,0x2000 # I/O bit map - .set MEM_TSS_END,0x3fff # Page directory + .set MEM_ESPR,0x5e00 # Real mode stack + .set MEM_IDT,0x5e00 # IDT + .set MEM_TSS,0x5f98 # TSS + .set MEM_MAP,0x6000 # I/O bit map + .set MEM_TSS_END,0x7fff # End of TSS .set MEM_ORG,0x9000 # BTX code .set MEM_USR,0xa000 # Start of user memory /* @@ -34,6 +34,14 @@ .set PAG_SIZ,0x1000 # Page size .set PAG_CNT,0x1000 # Pages to map /* + * Fields in %eflags. + */ + .set PSL_RESERVED_DEFAULT,0x00000002 + .set PSL_T,0x00000100 # Trap flag + .set PSL_I,0x00000200 # Interrupt enable flag + .set PSL_VM,0x00020000 # Virtual 8086 mode flag + .set PSL_AC,0x00040000 # Alignment check flag +/* * Segment selectors. */ .set SEL_SCODE,0x8 # Supervisor code @@ -48,7 +56,6 @@ */ .set TSS_ESP0,0x4 # PL 0 ESP .set TSS_SS0,0x8 # PL 0 SS - .set TSS_ESP1,0xc # PL 1 ESP .set TSS_MAP,0x66 # I/O bit map base /* * System calls. @@ -56,10 +63,20 @@ .set SYS_EXIT,0x0 # Exit .set SYS_EXEC,0x1 # Exec /* - * V86 constants. + * Fields in V86 interface structure. */ - .set V86_FLG,0x208eff # V86 flag mask - .set V86_STK,0x400 # V86 stack allowance + .set V86_CTL,0x0 # Control flags + .set V86_ADDR,0x4 # Int number/address + .set V86_ES,0x8 # V86 ES + .set V86_DS,0xc # V86 DS + .set V86_FS,0x10 # V86 FS + .set V86_GS,0x14 # V86 GS +/* + * V86 control flags. + */ + .set V86F_ADDR,0x10000 # Segment:offset address + .set V86F_CALLF,0x20000 # Emulate far call + .set V86F_FLAGS,0x40000 # Return flags /* * Dump format control bytes. */ @@ -77,13 +94,11 @@ * BIOS Data Area locations. */ .set BDA_MEM,0x501 # Free memory - .set BDA_KEYFLAGS,0x53a # Keyboard shift-state flags .set BDA_POS,0x53e # Cursor position /* * Derivations, for brevity. */ .set _ESP0H,MEM_ESP0>>0x8 # Byte 1 of ESP0 - .set _ESP1H,MEM_ESP1>>0x8 # Byte 1 of ESP1 .set _TSSIO,MEM_MAP-MEM_TSS # TSS I/O base .set _TSSLM,MEM_TSS_END-MEM_TSS # TSS limit .set _IDTLM,MEM_TSS-MEM_IDT-1 # IDT limit @@ -100,7 +115,7 @@ btx_hdr: .byte 0xeb # Machine ID .byte 0xe # Header size .ascii "BTX" # Magic .byte 0x1 # Major version - .byte 0x1 # Minor version + .byte 0x2 # Minor version .byte BTX_FLAGS # Flags .word PAG_CNT-MEM_ORG>>0xc # Paging control .word break-start # Text size @@ -121,13 +136,24 @@ init: cli # Disable interrupts */ mov $MEM_IDT,%di # Memory to initialize mov $(MEM_ORG-MEM_IDT)/2,%cx # Words to zero - push %di # Save rep # Zero-fill stosw # memory - pop %di # Restore +/* + * Update real mode IDT for reflecting hardware interrupts. + */ + mov $intr20,%bx # Address first handler + mov $0x10,%cx # Number of handlers + mov $0x20*4,%di # First real mode IDT entry +init.0: mov %bx,(%di) # Store IP + inc %di # Address next + inc %di # entry + stosw # Store CS + add $4,%bx # Next handler + loop init.0 # Next IRQ /* * Create IDT. */ + mov $MEM_IDT,%di mov $idtctl,%si # Control string init.1: lodsb # Get entry cbw # count @@ -153,7 +179,6 @@ init.3: lea 0x8(%di),%di # Next entry */ init.4: movb $_ESP0H,TSS_ESP0+1(%di) # Set ESP0 movb $SEL_SDATA,TSS_SS0(%di) # Set SS0 - movb $_ESP1H,TSS_ESP1+1(%di) # Set ESP1 movb $_TSSIO,TSS_MAP(%di) # Set I/O bit map base /* * Bring up the system. @@ -253,8 +278,8 @@ exit.2: xor %ax,%ax # Real mode segme exit.3: jz exit.3 # No movb $0xa0,%al outb %al,$0x35 - movb 0,%al - outb %al,$0xf0 + movb $0x00,%al + outb %al,$0xf0 # reboot the machine exit.4: jmp exit.4 /* * Set IRQ offsets by reprogramming 8259A PICs. @@ -285,10 +310,6 @@ setpic: in $0x02,%al # Save master retw # To caller .code32 /* - * Initiate return from V86 mode to user mode. - */ -inthlt: hlt # To supervisor mode -/* * Exception jump table. */ intx00: push $0x0 # Int 0x0: #DE @@ -314,18 +335,12 @@ intx00: push $0x0 # Int 0x0: #DE push $0xc # Int 0xc: #SS jmp except # Stack segment fault push $0xd # Int 0xd: #GP - jmp ex_v86 # General protection + jmp except # General protection push $0xe # Int 0xe: #PF jmp except # Page fault intx10: push $0x10 # Int 0x10: #MF jmp ex_noc # Floating-point error /* - * Handle #GP exception. - */ -ex_v86: testb $0x2,0x12(%esp,1) # V86 mode? - jz except # No - jmp v86mon # To monitor -/* * Save a zero error code. */ ex_noc: pushl (%esp,1) # Duplicate int no @@ -337,24 +352,17 @@ except: cld # String ops inc pushl %ds # Save pushl %es # most pusha # registers - movb $0x6,%al # Push loop count - testb $0x2,0x3a(%esp,1) # V86 mode? - jnz except.1 # Yes pushl %gs # Set GS pushl %fs # Set FS pushl %ds # Set DS pushl %es # Set ES - movb $0x2,%al # Push loop count cmpw $SEL_SCODE,0x44(%esp,1) # Supervisor mode? jne except.1 # No pushl %ss # Set SS - leal 0x50(%esp,1),%eax # Set - pushl %eax # ESP jmp except.2 # Join common code -except.1: pushl 0x50(%esp,1) # Set GS, FS, DS, ES - decb %al # (if V86 mode), and - jne except.1 # SS, ESP -except.2: push $SEL_SDATA # Set up +except.1: pushl 0x50(%esp,1) # Set SS +except.2: pushl 0x50(%esp,1) # Set ESP + push $SEL_SDATA # Set up popl %ds # to pushl %ds # address popl %es # data @@ -363,14 +371,12 @@ except.2: push $SEL_SDATA # Set up movl $MEM_BUF,%edi # Buffer pushl %eax pushl %edx -wait.1: - inb $0x60,%al +wait.1: inb $0x60,%al testb $0x04,%al jz wait.1 movb $0xe0,%al outb %al,$0x62 -wait.2: - inb $0x60,%al +wait.2: inb $0x60,%al testb $0x01,%al jz wait.2 xorl %edx,%edx @@ -399,237 +405,11 @@ wait.2: je except.3 # Yes cmpb $0x1,(%esp,1) # Debug? jne except.2a # No - testl $0x100,0x10(%esp,1) # Trap flag set? + testl $PSL_T,0x10(%esp,1) # Trap flag set? jnz except.3 # Yes except.2a: jmp exit # Exit except.3: leal 0x8(%esp,1),%esp # Discard err, int no iret # From interrupt -/* - * Return to user mode from V86 mode. - */ -intrtn: cld # String ops inc - pushl %ds # Address - popl %es # data - leal 0x3c(%ebp),%edx # V86 Segment registers - movl MEM_TSS+TSS_ESP1,%esi # Link stack pointer - lodsl # INT_V86 args pointer - movl %esi,%ebx # Saved exception frame - testl %eax,%eax # INT_V86 args? - jz intrtn.2 # No - movl $MEM_USR,%edi # User base - movl 0x1c(%esi),%ebx # User ESP - movl %eax,(%edi,%ebx,1) # Restore to user stack - leal 0x8(%edi,%eax,1),%edi # Arg segment registers - testb $0x4,-0x6(%edi) # Return flags? - jz intrtn.1 # No - movl 0x30(%ebp),%eax # Get V86 flags - movw %ax,0x18(%esi) # Set user flags -intrtn.1: leal 0x10(%esi),%ebx # Saved exception frame - xchgl %edx,%esi # Segment registers - movb $0x4,%cl # Update seg regs - rep # in INT_V86 - movsl # args -intrtn.2: xchgl %edx,%esi # Segment registers - leal 0x28(%ebp),%edi # Set up seg - movb $0x4,%cl # regs for - rep # later - movsl # pop - xchgl %ebx,%esi # Restore exception - movb $0x5,%cl # frame to - rep # supervisor - movsl # stack - movl %esi,MEM_TSS+TSS_ESP1 # Link stack pointer - popa # Restore - leal 0x8(%esp,1),%esp # Discard err, int no - popl %es # Restore - popl %ds # user - popl %fs # segment - popl %gs # registers - iret # To user mode -/* - * V86 monitor. - */ -v86mon: cld # String ops inc - pushl $SEL_SDATA # Set up for - popl %ds # flat addressing - pusha # Save registers - movl %esp,%ebp # Address stack frame - movzwl 0x2c(%ebp),%edi # Load V86 CS - shll $0x4,%edi # To linear - movl 0x28(%ebp),%esi # Load V86 IP - addl %edi,%esi # Code pointer - xorl %ecx,%ecx # Zero - movb $0x2,%cl # 16-bit operands - xorl %eax,%eax # Zero -v86mon.1: lodsb # Get opcode - cmpb $0x66,%al # Operand size prefix? - jne v86mon.2 # No - movb $0x4,%cl # 32-bit operands - jmp v86mon.1 # Continue -v86mon.2: cmpb $0xf4,%al # HLT? - jne v86mon.3 # No - cmpl $inthlt+0x1,%esi # Is inthlt? - jne v86mon.7 # No (ignore) - jmp intrtn # Return to user mode -v86mon.3: cmpb $0xf,%al # Prefixed instruction? - jne v86mon.4 # No - cmpb $0x09,(%esi) # Is it a WBINVD? - je v86wbinvd # Yes - cmpb $0x30,(%esi) # Is it a WRMSR? - je v86wrmsr # Yes - cmpb $0x32,(%esi) # Is it a RDMSR? - je v86rdmsr # Yes - cmpb $0x20,(%esi) # Is this a MOV reg,CRx? - je v86mov # Yes -v86mon.4: cmpb $0xfa,%al # CLI? - je v86cli # Yes - cmpb $0xfb,%al # STI? - je v86sti # Yes - movzwl 0x38(%ebp),%ebx # Load V86 SS - shll $0x4,%ebx # To offset - pushl %ebx # Save - addl 0x34(%ebp),%ebx # Add V86 SP - movl 0x30(%ebp),%edx # Load V86 flags - cmpb $0x9c,%al # PUSHF/PUSHFD? - je v86pushf # Yes - cmpb $0x9d,%al # POPF/POPFD? - je v86popf # Yes - cmpb $0xcd,%al # INT imm8? - je v86intn # Yes - cmpb $0xcf,%al # IRET/IRETD? - je v86iret # Yes - popl %ebx # Restore - popa # Restore - jmp except # Handle exception -v86mon.5: movl %edx,0x30(%ebp) # Save V86 flags -v86mon.6: popl %edx # V86 SS adjustment - subl %edx,%ebx # Save V86 - movl %ebx,0x34(%ebp) # SP -v86mon.7: subl %edi,%esi # From linear - movl %esi,0x28(%ebp) # Save V86 IP - popa # Restore - leal 0x8(%esp,1),%esp # Discard int no, error - iret # To V86 mode -/* - * Emulate MOV reg,CRx. - */ -v86mov: movb 0x1(%esi),%bl # Fetch Mod R/M byte - testb $0x10,%bl # Read CR2 or CR3? - jnz v86mov.1 # Yes - movl %cr0,%eax # Read CR0 - testb $0x20,%bl # Read CR4 instead? - jz v86mov.2 # No - movl %cr4,%eax # Read CR4 - jmp v86mov.2 -v86mov.1: movl %cr2,%eax # Read CR2 - testb $0x08,%bl # Read CR3 instead? - jz v86mov.2 # No - movl %cr3,%eax # Read CR3 -v86mov.2: andl $0x7,%ebx # Compute offset in - shl $2,%ebx # frame of destination - neg %ebx # register - movl %eax,0x1c(%ebp,%ebx,1) # Store CR to reg - incl %esi # Adjust IP -/* - * Return from emulating a 0x0f prefixed instruction - */ -v86preret: incl %esi # Adjust IP - jmp v86mon.7 # Finish up -/* - * Emulate WBINVD - */ -v86wbinvd: wbinvd # Write back and invalidate - # cache - jmp v86preret # Finish up -/* - * Emulate WRMSR - */ -v86wrmsr: movl 0x18(%ebp),%ecx # Get user's %ecx (MSR to write) - movl 0x14(%ebp),%edx # Load the value - movl 0x1c(%ebp),%eax # to write - wrmsr # Write MSR - jmp v86preret # Finish up -/* - * Emulate RDMSR - */ -v86rdmsr: movl 0x18(%ebp),%ecx # MSR to read - rdmsr # Read the MSR - movl %eax,0x1c(%ebp) # Return the value of - movl %edx,0x14(%ebp) # the MSR to the user - jmp v86preret # Finish up -/* - * Emulate CLI. - */ -v86cli: andb $~0x2,0x31(%ebp) # Clear IF - jmp v86mon.7 # Finish up -/* - * Emulate STI. - */ -v86sti: orb $0x2,0x31(%ebp) # Set IF - jmp v86mon.7 # Finish up -/* - * Emulate PUSHF/PUSHFD. - */ -v86pushf: subl %ecx,%ebx # Adjust SP - cmpb $0x4,%cl # 32-bit - je v86pushf.1 # Yes - data16 # 16-bit -v86pushf.1: movl %edx,(%ebx) # Save flags - jmp v86mon.6 # Finish up -/* - * Emulate IRET/IRETD. - */ -v86iret: movzwl (%ebx),%esi # Load V86 IP - movzwl 0x2(%ebx),%edi # Load V86 CS - leal 0x4(%ebx),%ebx # Adjust SP - movl %edi,0x2c(%ebp) # Save V86 CS - xorl %edi,%edi # No ESI adjustment -/* - * Emulate POPF/POPFD (and remainder of IRET/IRETD). - */ -v86popf: cmpb $0x4,%cl # 32-bit? - je v86popf.1 # Yes - movl %edx,%eax # Initialize - data16 # 16-bit -v86popf.1: movl (%ebx),%eax # Load flags - addl %ecx,%ebx # Adjust SP - andl $V86_FLG,%eax # Merge - andl $~V86_FLG,%edx # the - orl %eax,%edx # flags - jmp v86mon.5 # Finish up -/* - * trap int 15, function 87 - * reads %es:%si from saved registers on stack to find a GDT containing - * source and destination locations - * reads count of words from saved %cx - * returns success by setting %ah to 0 - */ -int15_87: pushl %esi # Save - pushl %edi # registers - movl 0x3C(%ebp),%edi # Load ES - movzwl 0x4(%ebp),%eax # Load user's SI - shll $0x4,%edi # EDI = (ES << 4) + - addl %eax,%edi # SI - movl 0x11(%edi),%eax # Read base of - movb 0x17(%edi),%al # GDT entry - ror $8,%eax # for source - xchgl %eax,%esi # into %esi - movl 0x19(%edi),%eax # Read base of - movb 0x1f(%edi),%al # GDT entry for - ror $8,%eax # destination - xchgl %eax,%edi # into %edi - pushl %ds # Make: - popl %es # es = ds - movzwl 0x18(%ebp),%ecx # Get user's CX - shll $0x1,%ecx # Convert count from words - rep # repeat... - movsb # perform copy. - popl %edi # Restore - popl %esi # registers - movb $0x0,0x1d(%ebp) # set ah = 0 to indicate - # success - andb $0xfe,%dl # clear CF - jmp v86mon.5 # Finish up /* * Reboot the machine by setting the reboot flag and exiting @@ -638,36 +418,7 @@ reboot: orb $0x1,btx_hdr+0x7 # Set the jmp exit # Terminate BTX and reboot /* - * Emulate INT imm8... also make sure to check if it's int 15/87 - */ -v86intn: lodsb # Get int no - cmpb $0x19,%al # is it int 19? - je reboot # yes, reboot the machine - cmpb $0x15,%al # is it int 15? - jne v86intn.1 # no, skip parse - cmpb $0x87,0x1d(%ebp) # is it the memcpy subfunction? - je int15_87 # yes - cmpw $0x4f53,0x1c(%ebp) # is it the delete key callout? - jne v86intn.1 # no, handle the int normally - movb BDA_KEYFLAGS,%ch # get the shift key state - andb $0x18,%ch # mask off just Ctrl and Alt - cmpb $0x18,%ch # are both Ctrl and Alt down? - je reboot # yes, reboot the machine -v86intn.1: subl %edi,%esi # From - shrl $0x4,%edi # linear - movw %dx,-0x2(%ebx) # Save flags - movw %di,-0x4(%ebx) # Save CS - leal -0x6(%ebx),%ebx # Adjust SP - movw %si,(%ebx) # Save IP - shll $0x2,%eax # Scale - movzwl (%eax),%esi # Load IP - movzwl 0x2(%eax),%edi # Load CS - movl %edi,0x2c(%ebp) # Save CS - xorl %edi,%edi # No ESI adjustment - andb $~0x1,%dh # Clear TF - jmp v86mon.5 # Finish up -/* - * Hardware interrupt jump table. + * Protected Mode Hardware interrupt jump table. */ intx20: push $0x8 # Int 0x20: IRQ0 jmp int_hw # V86 int 0x8 @@ -701,127 +452,267 @@ intx20: push $0x8 # Int 0x20: IRQ0 jmp int_hw # V86 int 0x16 push $0x17 # Int 0x2f: IRQ15 jmp int_hw # V86 int 0x17 + +/* + * Invoke real mode interrupt/function call from user mode with arguments. + */ +intx31: pushl $-1 # Dummy int no for btx_v86 /* - * Reflect hardware interrupts. + * Invoke real mode interrupt/function call from protected mode. + * + * We place a trampoline on the user stack that will return to rret_tramp + * which will reenter protected mode and then finally return to the user + * client. + * + * Kernel frame %esi points to: Real mode stack frame at MEM_ESPR: + * + * -0x00 user %ss -0x04 kernel %esp (with full frame) + * -0x04 user %esp -0x08 btx_v86 pointer + * -0x08 user %eflags -0x0c flags (only used if interrupt) + * -0x0c user %cs -0x10 real mode CS:IP return trampoline + * -0x10 user %eip -0x12 real mode flags + * -0x14 int no -0x16 real mode CS:IP (target) + * -0x18 %eax + * -0x1c %ecx + * -0x20 %edx + * -0x24 %ebx + * -0x28 %esp + * -0x2c %ebp + * -0x30 %esi + * -0x34 %edi + * -0x38 %gs + * -0x3c %fs + * -0x40 %ds + * -0x44 %es + * -0x48 zero %eax (hardware int only) + * -0x4c zero %ecx (hardware int only) + * -0x50 zero %edx (hardware int only) + * -0x54 zero %ebx (hardware int only) + * -0x58 zero %esp (hardware int only) + * -0x5c zero %ebp (hardware int only) + * -0x60 zero %esi (hardware int only) + * -0x64 zero %edi (hardware int only) + * -0x68 zero %gs (hardware int only) + * -0x6c zero %fs (hardware int only) + * -0x70 zero %ds (hardware int only) + * -0x74 zero %es (hardware int only) */ -int_hw: testb $0x2,0xe(%esp,1) # V86 mode? - jz intusr # No - pushl $SEL_SDATA # Address - popl %ds # data - xchgl %eax,(%esp,1) # Swap EAX, int no - pushl %ebp # Address - movl %esp,%ebp # stack frame - pushl %ebx # Save - shll $0x2,%eax # Get int - movl (%eax),%eax # vector - subl $0x6,0x14(%ebp) # Adjust V86 ESP - movzwl 0x18(%ebp),%ebx # V86 SS - shll $0x4,%ebx # * 0x10 - addl 0x14(%ebp),%ebx # + V86 ESP - xchgw %ax,0x8(%ebp) # Swap V86 IP - rorl $0x10,%eax # Swap words - xchgw %ax,0xc(%ebp) # Swap V86 CS - roll $0x10,%eax # Swap words - movl %eax,(%ebx) # CS:IP for IRET - movl 0x10(%ebp),%eax # V86 flags - movw %ax,0x4(%ebx) # Flags for IRET - andb $~0x3,0x11(%ebp) # Clear IF, TF - popl %ebx # Restore - popl %ebp # saved - popl %eax # registers - iret # To V86 mode -/* - * Invoke V86 interrupt from user mode, with arguments. - */ -intx31: stc # Have btx_v86 - pushl %eax # Missing int no -/* - * Invoke V86 interrupt from user mode. - */ -intusr: std # String ops dec - pushl %eax # Expand - pushl %eax # stack - pushl %eax # frame - pusha # Save +int_hw: cld # String ops inc + pusha # Save gp regs pushl %gs # Save - movl %esp,%eax # seg regs - pushl %fs # and - pushl %ds # point - pushl %es # to them + pushl %fs # seg + pushl %ds # regs + pushl %es push $SEL_SDATA # Set up popl %ds # to pushl %ds # address popl %es # data + leal 0x44(%esp,1),%esi # Base of frame + movl %esp,MEM_ESPR-0x04 # Save kernel stack pointer + movl -0x14(%esi),%eax # Get Int no + cmpl $-1,%eax # Hardware interrupt? + jne intusr.1 # Yes +/* + * v86 calls save the btx_v86 pointer on the real mode stack and read + * the address and flags from the btx_v86 structure. For interrupt + * handler invocations (VM86 INTx requests), disable interrupts, + * tracing, and alignment checking while the handler runs. + */ movl $MEM_USR,%ebx # User base movl %ebx,%edx # address - jc intusr.1 # If btx_v86 - xorl %edx,%edx # Control flags - xorl %ebp,%ebp # btx_v86 pointer -intusr.1: leal 0x50(%esp,1),%esi # Base of frame - pushl %esi # Save addl -0x4(%esi),%ebx # User ESP - movl MEM_TSS+TSS_ESP1,%edi # Link stack pointer - leal -0x4(%edi),%edi # Adjust for push - xorl %ecx,%ecx # Zero - movb $0x5,%cl # Push exception - rep # frame on - movsl # link stack - xchgl %eax,%esi # Saved seg regs - movl 0x40(%esp,1),%eax # Get int no - testl %edx,%edx # Have btx_v86? - jz intusr.2 # No movl (%ebx),%ebp # btx_v86 pointer - movb $0x4,%cl # Count - addl %ecx,%ebx # Adjust for pop - rep # Push saved seg regs - movsl # on link stack addl %ebp,%edx # Flatten btx_v86 ptr - leal 0x14(%edx),%esi # Seg regs pointer - movl 0x4(%edx),%eax # Get int no/address - movzwl 0x2(%edx),%edx # Get control flags -intusr.2: movl %ebp,(%edi) # Push btx_v86 and - movl %edi,MEM_TSS+TSS_ESP1 # save link stack ptr - popl %edi # Base of frame - xchgl %eax,%ebp # Save intno/address - movl 0x48(%esp,1),%eax # Get flags - testb $0x2,%dl # Simulate CALLF? - jnz intusr.3 # Yes - decl %ebx # Push flags - decl %ebx # on V86 - movw %ax,(%ebx) # stack -intusr.3: movb $0x4,%cl # Count - subl %ecx,%ebx # Push return address - movl $inthlt,(%ebx) # on V86 stack - rep # Copy seg regs to - movsl # exception frame - xchgl %eax,%ecx # Save flags - movl %ebx,%eax # User ESP - subl $V86_STK,%eax # Less bytes - ja intusr.4 # to - xorl %eax,%eax # keep -intusr.4: shrl $0x4,%eax # Gives segment - stosl # Set SS - shll $0x4,%eax # To bytes - xchgl %eax,%ebx # Swap - subl %ebx,%eax # Gives offset - stosl # Set ESP - xchgl %eax,%ecx # Get flags - btsl $0x11,%eax # Set VM - andb $~0x1,%ah # Clear TF - stosl # Set EFL - xchgl %eax,%ebp # Get int no/address - testb $0x1,%dl # Address? - jnz intusr.5 # Yes - shll $0x2,%eax # Scale + movl %edx,MEM_ESPR-0x08 # Save btx_v86 ptr + movl V86_ADDR(%edx),%eax # Get int no/address + movl V86_CTL(%edx),%edx # Get control flags + movl -0x08(%esi),%ebx # Save user flags in %ebx + testl $V86F_ADDR,%edx # Segment:offset? + jnz intusr.4 # Yes + andl $~(PSL_I|PSL_T|PSL_AC),%ebx # Disable interrupts, tracing, + # and alignment checking for + # interrupt handler + jmp intusr.3 # Skip hardware interrupt +/* + * Hardware interrupts store a NULL btx_v86 pointer and use the + * address (interrupt number) from the stack with empty flags. Also, + * push a dummy frame of zeros onto the stack for all the general + * purpose and segment registers and clear %eflags. This gives the + * hardware interrupt handler a clean slate. + */ +intusr.1: xorl %edx,%edx # Control flags + movl %edx,MEM_ESPR-0x08 # NULL btx_v86 ptr + movl $12,%ecx # Frame is 12 dwords +intusr.2: pushl $0x0 # Fill frame + loop intusr.2 # with zeros + movl $PSL_RESERVED_DEFAULT,%ebx # Set clean %eflags +/* + * Look up real mode IDT entry for hardware interrupts and VM86 INTx + * requests. + */ +intusr.3: shll $0x2,%eax # Scale movl (%eax),%eax # Load int vector -intusr.5: movl %eax,%ecx # Save - shrl $0x10,%eax # Gives segment - stosl # Set CS - movw %cx,%ax # Restore - stosl # Set EIP - leal 0x10(%esp,1),%esp # Discard seg regs - popa # Restore - iret # To V86 mode + jmp intusr.5 # Skip CALLF test +/* + * Panic if V86F_CALLF isn't set with V86F_ADDR. + */ +intusr.4: testl $V86F_CALLF,%edx # Far call? + jnz intusr.5 # Ok + movl %edx,0x30(%esp,1) # Place VM86 flags in int no + movl $badvm86,%esi # Display bad + call putstr # VM86 call + popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + jmp ex_noc # Panic +/* + * %eax now holds the segment:offset of the function. + * %ebx now holds the %eflags to pass to real mode. + * %edx now holds the V86F_* flags. + */ +intusr.5: movw %bx,MEM_ESPR-0x12 # Pass user flags to real mode + # target +/* + * If this is a v86 call, copy the seg regs out of the btx_v86 structure. + */ + movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr + jecxz intusr.6 # Skip for hardware ints + leal -0x44(%esi),%edi # %edi => kernel stack seg regs + pushl %esi # Save + leal V86_ES(%ecx),%esi # %esi => btx_v86 seg regs + movl $4,%ecx # Copy seg regs + rep # from btx_v86 + movsl # to kernel stack + popl %esi # Restore +intusr.6: movl -0x08(%esi),%ebx # Copy user flags to real + movl %ebx,MEM_ESPR-0x0c # mode return trampoline + movl $rret_tramp,%ebx # Set return trampoline + movl %ebx,MEM_ESPR-0x10 # CS:IP + movl %eax,MEM_ESPR-0x16 # Real mode target CS:IP + ljmpw $SEL_RCODE,$intusr.7 # Change to 16-bit segment + .code16 +intusr.7: movl %cr0,%eax # Leave + dec %al # protected + movl %eax,%cr0 # mode + ljmpw $0x0,$intusr.8 +intusr.8: xorw %ax,%ax # Reset %ds + movw %ax,%ds # and + movw %ax,%ss # %ss + lidt ivtdesc # Set IVT + popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + movw $MEM_ESPR-0x16,%sp # Switch to real mode stack + iret # Call target routine +/* + * For the return to real mode we setup a stack frame like this on the real + * mode stack. Note that callf calls won't pop off the flags, but we just + * ignore that by repositioning %sp to be just above the btx_v86 pointer + * so it is aligned. The stack is relative to MEM_ESPR. + * + * -0x04 kernel %esp + * -0x08 btx_v86 + * -0x0c %eax + * -0x10 %ecx + * -0x14 %edx + * -0x18 %ebx + * -0x1c %esp + * -0x20 %ebp + * -0x24 %esi + * -0x28 %edi + * -0x2c %gs + * -0x30 %fs + * -0x34 %ds + * -0x38 %es + * -0x3c %eflags + */ +rret_tramp: movw $MEM_ESPR-0x08,%sp # Reset stack pointer + pushal # Save gp regs + pushl %gs # Save + pushl %fs # seg + pushl %ds # regs + pushl %es + pushfl # Save %eflags + cli # Disable interrupts + std # String ops dec + xorw %ax,%ax # Reset seg + movw %ax,%ds # regs + movw %ax,%es # (%ss is already 0) + lidt idtdesc # Set IDT + lgdt gdtdesc # Set GDT + mov %cr0,%eax # Switch to protected + inc %ax # mode + mov %eax,%cr0 # + ljmp $SEL_SCODE,$rret_tramp.1 # To 32-bit code + .code32 +rret_tramp.1: xorl %ecx,%ecx # Zero + movb $SEL_SDATA,%cl # Setup + movw %cx,%ss # 32-bit + movw %cx,%ds # seg + movw %cx,%es # regs + movl MEM_ESPR-0x04,%esp # Switch to kernel stack + leal 0x44(%esp,1),%esi # Base of frame + andb $~0x2,tss_desc+0x5 # Clear TSS busy + movb $SEL_TSS,%cl # Set task + ltr %cx # register +/* + * Now we are back in protected mode. The kernel stack frame set up + * before entering real mode is still intact. For hardware interrupts, + * leave the frame unchanged. + */ + cmpl $0,MEM_ESPR-0x08 # Leave saved regs unchanged + jz rret_tramp.3 # for hardware ints +/* + * For V86 calls, copy the registers off of the real mode stack onto + * the kernel stack as we want their updated values. Also, initialize + * the segment registers on the kernel stack. + * + * Note that the %esp in the kernel stack after this is garbage, but popa + * ignores it, so we don't have to fix it up. + */ + leal -0x18(%esi),%edi # Kernel stack GP regs + pushl %esi # Save + movl $MEM_ESPR-0x0c,%esi # Real mode stack GP regs + movl $8,%ecx # Copy GP regs from + rep # real mode stack + movsl # to kernel stack + movl $SEL_UDATA,%eax # Selector for data seg regs + movl $4,%ecx # Initialize %ds, + rep # %es, %fs, and + stosl # %gs +/* + * For V86 calls, copy the saved seg regs on the real mode stack back + * over to the btx_v86 structure. Also, conditionally update the + * saved eflags on the kernel stack based on the flags from the user. + */ + movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr + leal V86_GS(%ecx),%edi # %edi => btx_v86 seg regs + leal MEM_ESPR-0x2c,%esi # %esi => real mode seg regs + xchgl %ecx,%edx # Save btx_v86 ptr + movl $4,%ecx # Copy seg regs + rep # from real mode stack + movsl # to btx_v86 + popl %esi # Restore + movl V86_CTL(%edx),%edx # Read V86 control flags + testl $V86F_FLAGS,%edx # User wants flags? + jz rret_tramp.3 # No + movl MEM_ESPR-0x3c,%eax # Read real mode flags + movw %ax,-0x08(%esi) # Update user flags (low 16) +/* + * Return to the user task + */ +rret_tramp.3: popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + addl $4,%esp # Discard int no + iret # Return to user mode + /* * System Call. */ @@ -869,7 +760,7 @@ dump.1: testb $DMP_X32,%ch # Dump long dump.2: testb $DMP_MEM,%ch # Dump memory? jz dump.8 # No pushl %ds # Save - testb $0x2,0x52(%ebx) # V86 mode? + testl $PSL_VM,0x50(%ebx) # V86 mode? jnz dump.3 # Yes verr 0x4(%esi) # Readable selector? jnz dump.3 # No @@ -1060,6 +951,61 @@ putchr.4: movw %dx,(%ebx) # Update pos ret # To caller #endif + .code16 +/* + * Real Mode Hardware interrupt jump table. + */ +intr20: push $0x8 # Int 0x20: IRQ0 + jmp int_hwr # V86 int 0x8 + push $0x9 # Int 0x21: IRQ1 + jmp int_hwr # V86 int 0x9 + push $0xa # Int 0x22: IRQ2 + jmp int_hwr # V86 int 0xa + push $0xb # Int 0x23: IRQ3 + jmp int_hwr # V86 int 0xb + push $0xc # Int 0x24: IRQ4 + jmp int_hwr # V86 int 0xc + push $0xd # Int 0x25: IRQ5 + jmp int_hwr # V86 int 0xd + push $0xe # Int 0x26: IRQ6 + jmp int_hwr # V86 int 0xe + push $0xf # Int 0x27: IRQ7 + jmp int_hwr # V86 int 0xf + push $0x10 # Int 0x28: IRQ8 + jmp int_hwr # V86 int 0x10 + push $0x11 # Int 0x29: IRQ9 + jmp int_hwr # V86 int 0x11 + push $0x12 # Int 0x2a: IRQ10 + jmp int_hwr # V86 int 0x12 + push $0x13 # Int 0x2b: IRQ11 + jmp int_hwr # V86 int 0x13 + push $0x14 # Int 0x2c: IRQ12 + jmp int_hwr # V86 int 0x14 + push $0x15 # Int 0x2d: IRQ13 + jmp int_hwr # V86 int 0x15 + push $0x16 # Int 0x2e: IRQ14 + jmp int_hwr # V86 int 0x16 + push $0x17 # Int 0x2f: IRQ15 + jmp int_hwr # V86 int 0x17 +/* + * Reflect hardware interrupts in real mode. + */ +int_hwr: push %ax # Save + push %ds # Save + push %bp # Save + mov %sp,%bp # Address stack frame + xchg %bx,6(%bp) # Swap BX, int no + xor %ax,%ax # Set %ds:%bx to + shl $2,%bx # point to + mov %ax,%ds # IDT entry + mov (%bx),%ax # Load IP + mov 2(%bx),%bx # Load CS + xchg %ax,4(%bp) # Swap saved %ax,%bx with + xchg %bx,6(%bp) # CS:IP of handler + pop %bp # Restore + pop %ds # Restore + lret # Jump to handler + .p2align 4 /* * Global descriptor table. @@ -1071,7 +1017,7 @@ gdt: .word 0x0,0x0,0x0,0x0 # Null entr .word 0xffff,0x0,0x9200,0x0 # SEL_RDATA .word 0xffff,MEM_USR,0xfa00,0xcf# SEL_UCODE .word 0xffff,MEM_USR,0xf200,0xcf# SEL_UDATA - .word _TSSLM,MEM_TSS,0x8900,0x0 # SEL_TSS +tss_desc: .word _TSSLM,MEM_TSS,0x8900,0x0 # SEL_TSS gdt.1: /* * Pseudo-descriptors. @@ -1140,6 +1086,11 @@ dmpfmt: .byte '\n' # "\n" .byte 0x80|DMP_MEM|DMP_EOL,0x0 # "00 00 ... 00 00\n" .asciz "BTX halted\n" # End /* + * Bad VM86 call panic + */ +badvm86: .asciz "Invalid VM86 Request\n" + +/* * End of BTX memory. */ .p2align 4 From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 05:23:41 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EF991065670; Sat, 19 Dec 2009 05:23:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 921978FC13; Sat, 19 Dec 2009 05:23:39 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nBJ5NQ9R042636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Dec 2009 07:23:26 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nBJ5NQw8047563; Sat, 19 Dec 2009 07:23:26 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nBJ5NQ6P047562; Sat, 19 Dec 2009 07:23:26 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 Dec 2009 07:23:26 +0200 From: Kostik Belousov To: Xin LI Message-ID: <20091219052326.GC2170@deviant.kiev.zoral.com.ua> References: <200912181855.nBIItFMe005161@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7iMSBzlTiPOCCT2k" Content-Disposition: inline In-Reply-To: <200912181855.nBIItFMe005161@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200677 - in stable/8: . share/man/man8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 05:23:41 -0000 --7iMSBzlTiPOCCT2k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 18, 2009 at 06:55:15PM +0000, Xin LI wrote: > Author: delphij > Date: Fri Dec 18 18:55:15 2009 > New Revision: 200677 > URL: http://svn.freebsd.org/changeset/base/200677 >=20 > Log: > MFC r199463: > =20 > rc.early(8) was removed as of 20090530 so remove manual page reference > to it. >=20 > Modified: > stable/8/ObsoleteFiles.inc (contents, props changed) > stable/8/share/man/man8/Makefile > stable/8/share/man/man8/rc.8 > Directory Properties: > stable/8/share/man/man8/ (props changed) >=20 > Modified: stable/8/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 > --- stable/8/ObsoleteFiles.inc Fri Dec 18 18:45:36 2009 (r200676) > +++ stable/8/ObsoleteFiles.inc Fri Dec 18 18:55:15 2009 (r200677) > @@ -14,6 +14,16 @@ > # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS l= ast. > # > =20 > +# 20091218: removal of rc.early(8) link > +OLD_FILES+=3Dusr/share/man/man8/rc.early.8.gz > +# 20091027: pselect.3 implemented as syscall > +OLD_FILES+=3Dusr/share/man/man3/pselect.3.gz > +# 20091005: fusword.9 and susword.9 removed > +OLD_FILES+=3Dusr/share/man/man9/fusword.9.gz > +OLD_FILES+=3Dusr/share/man/man9/susword.9.gz > +# 20090909: vesa and dpms promoted to be i386/amd64 common > +OLD_FILES+=3Dusr/include/machine/pc/vesa.h > +OLD_FILES+=3Dusr/share/man/man4/i386/dpms.4.gz > # 20090904: remove lukemftpd > OLD_FILES+=3Dusr/libexec/lukemftpd > OLD_FILES+=3Dusr/share/man/man5/ftpd.conf.5.gz This is not only a merge of r199463. You also merged several others unrelated revisions to ObsoleteFiles.inc. At least addition of pselect.3 removal is wrong for stable/8, I still not merged r198508 (but plan to do it really soon). I am not sure about other additions. --7iMSBzlTiPOCCT2k Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkssY00ACgkQC3+MBN1Mb4jtAACfb2Iyrw4yAVubTJz99PHJa+/9 /TYAoMLS2IHWtuuZ/aXYAxvMR/7373m5 =ES0S -----END PGP SIGNATURE----- --7iMSBzlTiPOCCT2k-- From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 10:28:24 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAAB61065693; Sat, 19 Dec 2009 10:28:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFA658FC13; Sat, 19 Dec 2009 10:28:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJASOhA029787; Sat, 19 Dec 2009 10:28:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJASOFa029786; Sat, 19 Dec 2009 10:28:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191028.nBJASOFa029786@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 10:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200710 - in stable/8/sys/amd64: amd64 ia32 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:28:25 -0000 Author: kib Date: Sat Dec 19 10:28:24 2009 New Revision: 200710 URL: http://svn.freebsd.org/changeset/base/200710 Log: MFC r200444: For ia32 syscall(), call cpu_set_syscall_retval(). Modified: stable/8/sys/amd64/amd64/vm_machdep.c stable/8/sys/amd64/ia32/ia32_syscall.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/vm_machdep.c Sat Dec 19 06:36:34 2009 (r200709) +++ stable/8/sys/amd64/amd64/vm_machdep.c Sat Dec 19 10:28:24 2009 (r200710) @@ -330,10 +330,14 @@ cpu_set_syscall_retval(struct thread *td case ERESTART: /* - * Reconstruct pc, we know that 'syscall' is 2 bytes. + * Reconstruct pc, we know that 'syscall' is 2 bytes, + * lcall $X,y is 7 bytes, int 0x80 is 2 bytes. + * We saved this in tf_err. * We have to do a full context restore so that %r10 * (which was holding the value of %rcx) is restored * for the next iteration. + * r10 restore is only required for freebsd/amd64 processes, + * but shall be innocent for any ia32 ABI. */ td->td_frame->tf_rip -= td->td_frame->tf_err; td->td_frame->tf_r10 = td->td_frame->tf_rcx; Modified: stable/8/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_syscall.c Sat Dec 19 06:36:34 2009 (r200709) +++ stable/8/sys/amd64/ia32/ia32_syscall.c Sat Dec 19 10:28:24 2009 (r200710) @@ -183,35 +183,7 @@ ia32_syscall(struct trapframe *frame) AUDIT_SYSCALL_EXIT(error, td); } - switch (error) { - case 0: - frame->tf_rax = td->td_retval[0]; - frame->tf_rdx = td->td_retval[1]; - frame->tf_rflags &= ~PSL_C; - break; - - case ERESTART: - /* - * Reconstruct pc, assuming lcall $X,y is 7 bytes, - * int 0x80 is 2 bytes. We saved this in tf_err. - */ - frame->tf_rip -= frame->tf_err; - break; - - case EJUSTRETURN: - break; - - default: - if (p->p_sysent->sv_errsize) { - if (error >= p->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = p->p_sysent->sv_errtbl[error]; - } - frame->tf_rax = error; - frame->tf_rflags |= PSL_C; - break; - } + cpu_set_syscall_retval(td, error); /* * Traced syscall. From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 10:38:29 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6883E1065670; Sat, 19 Dec 2009 10:38:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 559EF8FC18; Sat, 19 Dec 2009 10:38:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJAcTkP030077; Sat, 19 Dec 2009 10:38:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAcSH7030072; Sat, 19 Dec 2009 10:38:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191038.nBJAcSH7030072@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 10:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200711 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:38:29 -0000 Author: avg Date: Sat Dec 19 10:38:28 2009 New Revision: 200711 URL: http://svn.freebsd.org/changeset/base/200711 Log: MFC r200033: mca: improve status checking, recording and reporting Modified: stable/8/sys/amd64/amd64/mca.c stable/8/sys/amd64/include/mca.h stable/8/sys/i386/i386/mca.c stable/8/sys/i386/include/mca.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/mca.c ============================================================================== --- stable/8/sys/amd64/amd64/mca.c Sat Dec 19 10:28:24 2009 (r200710) +++ stable/8/sys/amd64/amd64/mca.c Sat Dec 19 10:38:28 2009 (r200711) @@ -117,48 +117,6 @@ sysctl_mca_records(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, &record, sizeof(record))); } -static struct mca_record * -mca_record_entry(int bank) -{ - struct mca_internal *rec; - uint64_t status; - u_int p[4]; - - status = rdmsr(MSR_MC_STATUS(bank)); - if (!(status & MC_STATUS_VAL)) - return (NULL); - - rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT | M_ZERO); - if (rec == NULL) { - printf("MCA: Unable to allocate space for an event.\n"); - return (NULL); - } - - /* Save exception information. */ - rec->rec.mr_status = status; - if (status & MC_STATUS_ADDRV) - rec->rec.mr_addr = rdmsr(MSR_MC_ADDR(bank)); - if (status & MC_STATUS_MISCV) - rec->rec.mr_misc = rdmsr(MSR_MC_MISC(bank)); - rec->rec.mr_tsc = rdtsc(); - rec->rec.mr_apic_id = PCPU_GET(apic_id); - - /* - * Clear machine check. Don't do this for uncorrectable - * errors so that the BIOS can see them. - */ - if (!(rec->rec.mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { - wrmsr(MSR_MC_STATUS(bank), 0); - do_cpuid(0, p); - } - - mtx_lock_spin(&mca_lock); - STAILQ_INSERT_TAIL(&mca_records, rec, link); - mca_count++; - mtx_unlock_spin(&mca_lock); - return (&rec->rec); -} - static const char * mca_error_ttype(uint16_t mca_error) { @@ -219,11 +177,13 @@ mca_error_request(uint16_t mca_error) } /* Dump details about a single machine check. */ -static void -mca_log(struct mca_record *rec) +static void __nonnull(1) +mca_log(const struct mca_record *rec) { uint16_t mca_error; + printf("MCA: bank %d, status 0x%016llx\n", rec->mr_bank, + (long long)rec->mr_status); printf("MCA: CPU %d ", rec->mr_apic_id); if (rec->mr_status & MC_STATUS_UC) printf("UNCOR "); @@ -329,6 +289,59 @@ mca_log(struct mca_record *rec) printf("MCA: Address 0x%llx\n", (long long)rec->mr_addr); } +static int __nonnull(2) +mca_check_status(int bank, struct mca_record *rec) +{ + uint64_t status; + u_int p[4]; + + status = rdmsr(MSR_MC_STATUS(bank)); + if (!(status & MC_STATUS_VAL)) + return (0); + + /* Save exception information. */ + rec->mr_status = status; + rec->mr_bank = bank; + rec->mr_addr = 0; + if (status & MC_STATUS_ADDRV) + rec->mr_addr = rdmsr(MSR_MC_ADDR(bank)); + rec->mr_misc = 0; + if (status & MC_STATUS_MISCV) + rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); + rec->mr_tsc = rdtsc(); + rec->mr_apic_id = PCPU_GET(apic_id); + + /* + * Clear machine check. Don't do this for uncorrectable + * errors so that the BIOS can see them. + */ + if (!(rec->mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { + wrmsr(MSR_MC_STATUS(bank), 0); + do_cpuid(0, p); + } + return (1); +} + +static void __nonnull(1) +mca_record_entry(const struct mca_record *record) +{ + struct mca_internal *rec; + + rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT); + if (rec == NULL) { + printf("MCA: Unable to allocate space for an event.\n"); + mca_log(record); + return; + } + + rec->rec = *record; + rec->logged = 0; + mtx_lock_spin(&mca_lock); + STAILQ_INSERT_TAIL(&mca_records, rec, link); + mca_count++; + mtx_unlock_spin(&mca_lock); +} + /* * This scans all the machine check banks of the current CPU to see if * there are any machine checks. Any non-recoverable errors are @@ -341,7 +354,7 @@ mca_log(struct mca_record *rec) static int mca_scan(int mcip) { - struct mca_record *rec; + struct mca_record rec; uint64_t mcg_cap, ucmask; int count, i, recoverable; @@ -354,13 +367,13 @@ mca_scan(int mcip) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - rec = mca_record_entry(i); - if (rec != NULL) { + if (mca_check_status(i, &rec)) { count++; - if (rec->mr_status & ucmask) { + if (rec.mr_status & ucmask) { recoverable = 0; - mca_log(rec); + mca_log(&rec); } + mca_record_entry(&rec); } } return (mcip ? recoverable : count); Modified: stable/8/sys/amd64/include/mca.h ============================================================================== --- stable/8/sys/amd64/include/mca.h Sat Dec 19 10:28:24 2009 (r200710) +++ stable/8/sys/amd64/include/mca.h Sat Dec 19 10:38:28 2009 (r200711) @@ -36,6 +36,7 @@ struct mca_record { uint64_t mr_misc; uint64_t mr_tsc; int mr_apic_id; + int mr_bank; }; #ifdef _KERNEL Modified: stable/8/sys/i386/i386/mca.c ============================================================================== --- stable/8/sys/i386/i386/mca.c Sat Dec 19 10:28:24 2009 (r200710) +++ stable/8/sys/i386/i386/mca.c Sat Dec 19 10:38:28 2009 (r200711) @@ -117,48 +117,6 @@ sysctl_mca_records(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, &record, sizeof(record))); } -static struct mca_record * -mca_record_entry(int bank) -{ - struct mca_internal *rec; - uint64_t status; - u_int p[4]; - - status = rdmsr(MSR_MC_STATUS(bank)); - if (!(status & MC_STATUS_VAL)) - return (NULL); - - rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT | M_ZERO); - if (rec == NULL) { - printf("MCA: Unable to allocate space for an event.\n"); - return (NULL); - } - - /* Save exception information. */ - rec->rec.mr_status = status; - if (status & MC_STATUS_ADDRV) - rec->rec.mr_addr = rdmsr(MSR_MC_ADDR(bank)); - if (status & MC_STATUS_MISCV) - rec->rec.mr_misc = rdmsr(MSR_MC_MISC(bank)); - rec->rec.mr_tsc = rdtsc(); - rec->rec.mr_apic_id = PCPU_GET(apic_id); - - /* - * Clear machine check. Don't do this for uncorrectable - * errors so that the BIOS can see them. - */ - if (!(rec->rec.mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { - wrmsr(MSR_MC_STATUS(bank), 0); - do_cpuid(0, p); - } - - mtx_lock_spin(&mca_lock); - STAILQ_INSERT_TAIL(&mca_records, rec, link); - mca_count++; - mtx_unlock_spin(&mca_lock); - return (&rec->rec); -} - static const char * mca_error_ttype(uint16_t mca_error) { @@ -219,11 +177,13 @@ mca_error_request(uint16_t mca_error) } /* Dump details about a single machine check. */ -static void -mca_log(struct mca_record *rec) +static void __nonnull(1) +mca_log(const struct mca_record *rec) { uint16_t mca_error; + printf("MCA: bank %d, status 0x%016llx\n", rec->mr_bank, + (long long)rec->mr_status); printf("MCA: CPU %d ", rec->mr_apic_id); if (rec->mr_status & MC_STATUS_UC) printf("UNCOR "); @@ -329,6 +289,59 @@ mca_log(struct mca_record *rec) printf("MCA: Address 0x%llx\n", (long long)rec->mr_addr); } +static int __nonnull(2) +mca_check_status(int bank, struct mca_record *rec) +{ + uint64_t status; + u_int p[4]; + + status = rdmsr(MSR_MC_STATUS(bank)); + if (!(status & MC_STATUS_VAL)) + return (0); + + /* Save exception information. */ + rec->mr_status = status; + rec->mr_bank = bank; + rec->mr_addr = 0; + if (status & MC_STATUS_ADDRV) + rec->mr_addr = rdmsr(MSR_MC_ADDR(bank)); + rec->mr_misc = 0; + if (status & MC_STATUS_MISCV) + rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); + rec->mr_tsc = rdtsc(); + rec->mr_apic_id = PCPU_GET(apic_id); + + /* + * Clear machine check. Don't do this for uncorrectable + * errors so that the BIOS can see them. + */ + if (!(rec->mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { + wrmsr(MSR_MC_STATUS(bank), 0); + do_cpuid(0, p); + } + return (1); +} + +static void __nonnull(1) +mca_record_entry(const struct mca_record *record) +{ + struct mca_internal *rec; + + rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT); + if (rec == NULL) { + printf("MCA: Unable to allocate space for an event.\n"); + mca_log(record); + return; + } + + rec->rec = *record; + rec->logged = 0; + mtx_lock_spin(&mca_lock); + STAILQ_INSERT_TAIL(&mca_records, rec, link); + mca_count++; + mtx_unlock_spin(&mca_lock); +} + /* * This scans all the machine check banks of the current CPU to see if * there are any machine checks. Any non-recoverable errors are @@ -341,7 +354,7 @@ mca_log(struct mca_record *rec) static int mca_scan(int mcip) { - struct mca_record *rec; + struct mca_record rec; uint64_t mcg_cap, ucmask; int count, i, recoverable; @@ -354,13 +367,13 @@ mca_scan(int mcip) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - rec = mca_record_entry(i); - if (rec != NULL) { + if (mca_check_status(i, &rec)) { count++; - if (rec->mr_status & ucmask) { + if (rec.mr_status & ucmask) { recoverable = 0; - mca_log(rec); + mca_log(&rec); } + mca_record_entry(&rec); } } return (mcip ? recoverable : count); Modified: stable/8/sys/i386/include/mca.h ============================================================================== --- stable/8/sys/i386/include/mca.h Sat Dec 19 10:28:24 2009 (r200710) +++ stable/8/sys/i386/include/mca.h Sat Dec 19 10:38:28 2009 (r200711) @@ -36,6 +36,7 @@ struct mca_record { uint64_t mr_misc; uint64_t mr_tsc; int mr_apic_id; + int mr_bank; }; #ifdef _KERNEL From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 10:44:26 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA654106566B; Sat, 19 Dec 2009 10:44:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8A848FC16; Sat, 19 Dec 2009 10:44:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJAiQro030306; Sat, 19 Dec 2009 10:44:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAiQrW030303; Sat, 19 Dec 2009 10:44:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191044.nBJAiQrW030303@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 10:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200713 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:44:26 -0000 Author: avg Date: Sat Dec 19 10:44:26 2009 New Revision: 200713 URL: http://svn.freebsd.org/changeset/base/200713 Log: MFC r200064: mca: small enhancements related to cpu quirks Modified: stable/8/sys/amd64/amd64/mca.c stable/8/sys/i386/i386/mca.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/mca.c ============================================================================== --- stable/8/sys/amd64/amd64/mca.c Sat Dec 19 10:41:56 2009 (r200712) +++ stable/8/sys/amd64/amd64/mca.c Sat Dec 19 10:44:26 2009 (r200713) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -478,6 +479,8 @@ void mca_init(void) { uint64_t mcg_cap; + uint64_t ctl; + int skip; int i; /* MCE is required. */ @@ -495,15 +498,26 @@ mca_init(void) wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - /* - * Enable logging of all errors. For P6 - * processors, MC0_CTL is always enabled. - * - * XXX: Better CPU test needed here? - */ - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); + /* By default enable logging of all errors. */ + ctl = 0xffffffffffffffffUL; + skip = 0; + + if (cpu_vendor_id == CPU_VENDOR_INTEL) { + /* + * For P6 models before Nehalem MC0_CTL is + * always enabled and reserved. + */ + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 + && CPUID_TO_MODEL(cpu_id) < 0x1a) + skip = 1; + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + /* BKDG for Family 10h: unset GartTblWkEn. */ + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) + ctl &= ~(1UL << 10); + } + if (!skip) + wrmsr(MSR_MC_CTL(i), ctl); /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } Modified: stable/8/sys/i386/i386/mca.c ============================================================================== --- stable/8/sys/i386/i386/mca.c Sat Dec 19 10:41:56 2009 (r200712) +++ stable/8/sys/i386/i386/mca.c Sat Dec 19 10:44:26 2009 (r200713) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -478,6 +479,8 @@ void mca_init(void) { uint64_t mcg_cap; + uint64_t ctl; + int skip; int i; /* MCE is required. */ @@ -495,15 +498,26 @@ mca_init(void) wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - /* - * Enable logging of all errors. For P6 - * processors, MC0_CTL is always enabled. - * - * XXX: Better CPU test needed here? - */ - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); + /* By default enable logging of all errors. */ + ctl = 0xffffffffffffffffUL; + skip = 0; + + if (cpu_vendor_id == CPU_VENDOR_INTEL) { + /* + * For P6 models before Nehalem MC0_CTL is + * always enabled and reserved. + */ + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 + && CPUID_TO_MODEL(cpu_id) < 0x1a) + skip = 1; + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + /* BKDG for Family 10h: unset GartTblWkEn. */ + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) + ctl &= ~(1UL << 10); + } + if (!skip) + wrmsr(MSR_MC_CTL(i), ctl); /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 10:52:32 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C757C106566C; Sat, 19 Dec 2009 10:52:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE1F78FC17; Sat, 19 Dec 2009 10:52:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJAqWFf030569; Sat, 19 Dec 2009 10:52:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAqWq1030567; Sat, 19 Dec 2009 10:52:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191052.nBJAqWq1030567@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 10:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200715 - stable/8/sys/dev/ichsmb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:52:32 -0000 Author: avg Date: Sat Dec 19 10:52:32 2009 New Revision: 200715 URL: http://svn.freebsd.org/changeset/base/200715 Log: MFC r200602: ichsmb: add another pci id Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/8/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 10:45:57 2009 (r200714) +++ stable/8/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 10:52:32 2009 (r200715) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #define ID_82801H 0x283e8086 #define ID_82801I 0x29308086 #define ID_82801JI 0x3a308086 +#define ID_PCH 0x3b308086 #define ID_6300ESB 0x25a48086 #define ID_631xESB 0x269b8086 @@ -164,6 +165,9 @@ ichsmb_pci_probe(device_t dev) case ID_82801JI: device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); break; + case ID_PCH: + device_set_desc(dev, "Intel PCH SMBus controller"); + break; case ID_6300ESB: device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); break; From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 10:54:29 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFF77106566B; Sat, 19 Dec 2009 10:54:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D4B78FC14; Sat, 19 Dec 2009 10:54:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJAsTA4030673; Sat, 19 Dec 2009 10:54:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJAsTuu030667; Sat, 19 Dec 2009 10:54:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191054.nBJAsTuu030667@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 10:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200716 - in stable/8/sys: kern sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 10:54:29 -0000 Author: kib Date: Sat Dec 19 10:54:29 2009 New Revision: 200716 URL: http://svn.freebsd.org/changeset/base/200716 Log: MFC r197963: Put process-directed signals to the process queue unconditionally, selecting the thread to deliver the signal only by the thread returning to usermode. Change cursig() and postsig() to look both into the thread and process signal queues. MFC r197976: Fix typo. MFC r200082: Remove wrong assertion. Debugee is allowed to lose a signal Modified: stable/8/sys/kern/kern_sig.c stable/8/sys/kern/kern_thr.c stable/8/sys/kern/subr_trap.c stable/8/sys/sys/signalvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Sat Dec 19 10:52:32 2009 (r200715) +++ stable/8/sys/kern/kern_sig.c Sat Dec 19 10:54:29 2009 (r200716) @@ -216,6 +216,8 @@ static int sigproptbl[NSIG] = { SA_KILL|SA_PROC, /* SIGUSR2 */ }; +static void reschedule_signals(struct proc *p, sigset_t block); + static void sigqueue_start(void) { @@ -577,20 +579,11 @@ void signotify(struct thread *td) { struct proc *p; - sigset_t set; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); - /* - * If our mask changed we may have to move signal that were - * previously masked by all threads to our sigqueue. - */ - set = p->p_sigqueue.sq_signals; - SIGSETNAND(set, td->td_sigmask); - if (! SIGISEMPTY(set)) - sigqueue_move_set(&p->p_sigqueue, &td->td_sigqueue, &set); if (SIGPENDING(td)) { thread_lock(td); td->td_flags |= TDF_NEEDSIGCHK | TDF_ASTPENDING; @@ -972,24 +965,28 @@ execsigs(struct proc *p) * Manipulate signal mask. */ int -kern_sigprocmask(td, how, set, oset, old) - struct thread *td; - int how; - sigset_t *set, *oset; - int old; +kern_sigprocmask(struct thread *td, int how, sigset_t *set, sigset_t *oset, + int old) { + sigset_t new_block, oset1; + struct proc *p; int error; - PROC_LOCK(td->td_proc); + p = td->td_proc; + PROC_LOCK(p); if (oset != NULL) *oset = td->td_sigmask; error = 0; + SIGEMPTYSET(new_block); if (set != NULL) { switch (how) { case SIG_BLOCK: SIG_CANTMASK(*set); + oset1 = td->td_sigmask; SIGSETOR(td->td_sigmask, *set); + new_block = td->td_sigmask; + SIGSETNAND(new_block, oset1); break; case SIG_UNBLOCK: SIGSETNAND(td->td_sigmask, *set); @@ -997,10 +994,13 @@ kern_sigprocmask(td, how, set, oset, old break; case SIG_SETMASK: SIG_CANTMASK(*set); + oset1 = td->td_sigmask; if (old) SIGSETLO(td->td_sigmask, *set); else td->td_sigmask = *set; + new_block = td->td_sigmask; + SIGSETNAND(new_block, oset1); signotify(td); break; default: @@ -1008,7 +1008,20 @@ kern_sigprocmask(td, how, set, oset, old break; } } - PROC_UNLOCK(td->td_proc); + + /* + * The new_block set contains signals that were not previously + * blocked, but are blocked now. + * + * In case we block any signal that was not previously blocked + * for td, and process has the signal pending, try to schedule + * signal delivery to some thread that does not block the signal, + * possibly waking it up. + */ + if (p->p_numthreads != 1) + reschedule_signals(p, new_block); + + PROC_UNLOCK(p); return (error); } @@ -1981,17 +1994,9 @@ tdsignal(struct proc *p, struct thread * KNOTE_LOCKED(&p->p_klist, NOTE_SIGNAL | sig); prop = sigprop(sig); - /* - * If the signal is blocked and not destined for this thread, then - * assign it to the process so that we can find it later in the first - * thread that unblocks it. Otherwise, assign it to this thread now. - */ if (td == NULL) { td = sigtd(p, sig, prop); - if (SIGISMEMBER(td->td_sigmask, sig)) - sigqueue = &p->p_sigqueue; - else - sigqueue = &td->td_sigqueue; + sigqueue = &p->p_sigqueue; } else { KASSERT(td->td_proc == p, ("invalid thread")); sigqueue = &td->td_sigqueue; @@ -2388,6 +2393,62 @@ stopme: return (td->td_xsig); } +static void +reschedule_signals(struct proc *p, sigset_t block) +{ + struct sigacts *ps; + struct thread *td; + int i; + + PROC_LOCK_ASSERT(p, MA_OWNED); + + ps = p->p_sigacts; + for (i = 1; !SIGISEMPTY(block); i++) { + if (!SIGISMEMBER(block, i)) + continue; + SIGDELSET(block, i); + if (!SIGISMEMBER(p->p_siglist, i)) + continue; + + td = sigtd(p, i, 0); + signotify(td); + mtx_lock(&ps->ps_mtx); + if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, i)) + tdsigwakeup(td, i, SIG_CATCH, + (SIGISMEMBER(ps->ps_sigintr, i) ? EINTR : + ERESTART)); + mtx_unlock(&ps->ps_mtx); + } +} + +void +tdsigcleanup(struct thread *td) +{ + struct proc *p; + sigset_t unblocked; + + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + + sigqueue_flush(&td->td_sigqueue); + if (p->p_numthreads == 1) + return; + + /* + * Since we cannot handle signals, notify signal post code + * about this by filling the sigmask. + * + * Also, if needed, wake up thread(s) that do not block the + * same signals as the exiting thread, since the thread might + * have been selected for delivery and woken up. + */ + SIGFILLSET(unblocked); + SIGSETNAND(unblocked, td->td_sigmask); + SIGFILLSET(td->td_sigmask); + reschedule_signals(p, unblocked); + +} + /* * If the current process has received a signal (should be caught or cause * termination, should interrupt current syscall), return the signal number. @@ -2405,6 +2466,7 @@ issignal(struct thread *td, int stop_all { struct proc *p; struct sigacts *ps; + struct sigqueue *queue; sigset_t sigpending; int sig, prop, newsig; @@ -2416,6 +2478,7 @@ issignal(struct thread *td, int stop_all int traced = (p->p_flag & P_TRACED) || (p->p_stops & S_SIG); sigpending = td->td_sigqueue.sq_signals; + SIGSETOR(sigpending, p->p_sigqueue.sq_signals); SIGSETNAND(sigpending, td->td_sigmask); if (p->p_flag & P_PPWAIT) @@ -2436,6 +2499,7 @@ issignal(struct thread *td, int stop_all */ if (SIGISMEMBER(ps->ps_sigignore, sig) && (traced == 0)) { sigqueue_delete(&td->td_sigqueue, sig); + sigqueue_delete(&p->p_sigqueue, sig); continue; } if (p->p_flag & P_TRACED && (p->p_flag & P_PPWAIT) == 0) { @@ -2448,12 +2512,17 @@ issignal(struct thread *td, int stop_all if (sig != newsig) { ksiginfo_t ksi; + + queue = &td->td_sigqueue; /* * clear old signal. * XXX shrug off debugger, it causes siginfo to * be thrown away. */ - sigqueue_get(&td->td_sigqueue, sig, &ksi); + if (sigqueue_get(queue, sig, &ksi) == 0) { + queue = &p->p_sigqueue; + sigqueue_get(queue, sig, &ksi); + } /* * If parent wants us to take the signal, @@ -2468,7 +2537,7 @@ issignal(struct thread *td, int stop_all * Put the new signal into td_sigqueue. If the * signal is being masked, look for other signals. */ - SIGADDSET(td->td_sigqueue.sq_signals, sig); + SIGADDSET(queue->sq_signals, sig); if (SIGISMEMBER(td->td_sigmask, sig)) continue; signotify(td); @@ -2563,6 +2632,7 @@ issignal(struct thread *td, int stop_all return (sig); } sigqueue_delete(&td->td_sigqueue, sig); /* take the signal! */ + sigqueue_delete(&p->p_sigqueue, sig); } /* NOTREACHED */ } @@ -2609,7 +2679,9 @@ postsig(sig) ps = p->p_sigacts; mtx_assert(&ps->ps_mtx, MA_OWNED); ksiginfo_init(&ksi); - sigqueue_get(&td->td_sigqueue, sig, &ksi); + if (sigqueue_get(&td->td_sigqueue, sig, &ksi) == 0 && + sigqueue_get(&p->p_sigqueue, sig, &ksi) == 0) + return; ksi.ksi_signo = sig; if (ksi.ksi_code == SI_TIMER) itimer_accept(p, ksi.ksi_timerid, &ksi); Modified: stable/8/sys/kern/kern_thr.c ============================================================================== --- stable/8/sys/kern/kern_thr.c Sat Dec 19 10:52:32 2009 (r200715) +++ stable/8/sys/kern/kern_thr.c Sat Dec 19 10:54:29 2009 (r200716) @@ -282,7 +282,7 @@ thr_exit(struct thread *td, struct thr_e } PROC_LOCK(p); - sigqueue_flush(&td->td_sigqueue); + tdsigcleanup(td); PROC_SLOCK(p); /* Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Sat Dec 19 10:52:32 2009 (r200715) +++ stable/8/sys/kern/subr_trap.c Sat Dec 19 10:54:29 2009 (r200716) @@ -90,6 +90,7 @@ userret(struct thread *td, struct trapfr CTR3(KTR_SYSC, "userret: thread %p (pid %d, %s)", td, p->p_pid, td->td_name); +#if 0 #ifdef DIAGNOSTIC /* Check that we called signotify() enough. */ PROC_LOCK(p); @@ -100,6 +101,7 @@ userret(struct thread *td, struct trapfr thread_unlock(td); PROC_UNLOCK(p); #endif +#endif #ifdef KTRACE KTRUSERRET(td); #endif @@ -218,7 +220,14 @@ ast(struct trapframe *framep) ktrcsw(0, 1); #endif } - if (flags & TDF_NEEDSIGCHK) { + + /* + * Check for signals. Unlocked reads of p_pendingcnt or + * p_siglist might cause process-directed signal to be handled + * later. + */ + if (flags & TDF_NEEDSIGCHK || p->p_pendingcnt > 0 || + !SIGISEMPTY(p->p_siglist)) { PROC_LOCK(p); mtx_lock(&p->p_sigacts->ps_mtx); while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0) Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Sat Dec 19 10:52:32 2009 (r200715) +++ stable/8/sys/sys/signalvar.h Sat Dec 19 10:54:29 2009 (r200716) @@ -252,9 +252,10 @@ typedef struct sigqueue { /* Return nonzero if process p has an unmasked pending signal. */ #define SIGPENDING(td) \ - (!SIGISEMPTY((td)->td_siglist) && \ - !sigsetmasked(&(td)->td_siglist, &(td)->td_sigmask)) - + ((!SIGISEMPTY((td)->td_siglist) && \ + !sigsetmasked(&(td)->td_siglist, &(td)->td_sigmask)) || \ + (!SIGISEMPTY((td)->td_proc->p_siglist) && \ + !sigsetmasked(&(td)->td_proc->p_siglist, &(td)->td_sigmask))) /* * Return the value of the pseudo-expression ((*set & ~*mask) != 0). This * is an optimized version of SIGISEMPTY() on a temporary variable @@ -336,6 +337,7 @@ void sigexit(struct thread *td, int sign int sig_ffs(sigset_t *set); void siginit(struct proc *p); void signotify(struct thread *td); +void tdsigcleanup(struct thread *td); int tdsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi); void trapsignal(struct thread *td, ksiginfo_t *); From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 11:05:42 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A572C106566B; Sat, 19 Dec 2009 11:05:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9428B8FC14; Sat, 19 Dec 2009 11:05:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJB5g3n031046; Sat, 19 Dec 2009 11:05:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJB5gtt031044; Sat, 19 Dec 2009 11:05:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912191105.nBJB5gtt031044@svn.freebsd.org> From: Andriy Gapon Date: Sat, 19 Dec 2009 11:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200718 - stable/8/sys/dev/ichsmb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:05:42 -0000 Author: avg Date: Sat Dec 19 11:05:42 2009 New Revision: 200718 URL: http://svn.freebsd.org/changeset/base/200718 Log: MFC r200053,200091: ichsmb: drop default attachment to generic smbus hw Note that r200091 completely overrides r200053 and the merge of the former is recorded for bookkeeping only. r200091 won't be merged to 'more stable' branche(s) because of the POLA. Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/8/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 10:55:41 2009 (r200717) +++ stable/8/sys/dev/ichsmb/ichsmb_pci.c Sat Dec 19 11:05:42 2009 (r200718) @@ -175,12 +175,6 @@ ichsmb_pci_probe(device_t dev) device_set_desc(dev, "Intel 631xESB/6321ESB (ESB2) SMBus controller"); break; default: - if (pci_get_class(dev) == PCIC_SERIALBUS - && pci_get_subclass(dev) == PCIS_SERIALBUS_SMBUS - && pci_get_progif(dev) == PCIS_SERIALBUS_SMBUS_PROGIF) { - device_set_desc(dev, "SMBus controller"); - return (BUS_PROBE_DEFAULT); /* XXX */ - } return (ENXIO); } From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 11:11:57 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A876106568B; Sat, 19 Dec 2009 11:11:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 593008FC19; Sat, 19 Dec 2009 11:11:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBBvUF031284; Sat, 19 Dec 2009 11:11:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBBvAn031282; Sat, 19 Dec 2009 11:11:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912191111.nBJBBvAn031282@svn.freebsd.org> From: Xin LI Date: Sat, 19 Dec 2009 11:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200720 - stable/8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:11:57 -0000 Author: delphij Date: Sat Dec 19 11:11:57 2009 New Revision: 200720 URL: http://svn.freebsd.org/changeset/base/200720 Log: Fix inappropriate merge. Pointed out by: kib Pointy hat to: delphij Modified: stable/8/ObsoleteFiles.inc Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Sat Dec 19 11:10:33 2009 (r200719) +++ stable/8/ObsoleteFiles.inc Sat Dec 19 11:11:57 2009 (r200720) @@ -16,14 +16,6 @@ # 20091218: removal of rc.early(8) link OLD_FILES+=usr/share/man/man8/rc.early.8.gz -# 20091027: pselect.3 implemented as syscall -OLD_FILES+=usr/share/man/man3/pselect.3.gz -# 20091005: fusword.9 and susword.9 removed -OLD_FILES+=usr/share/man/man9/fusword.9.gz -OLD_FILES+=usr/share/man/man9/susword.9.gz -# 20090909: vesa and dpms promoted to be i386/amd64 common -OLD_FILES+=usr/include/machine/pc/vesa.h -OLD_FILES+=usr/share/man/man4/i386/dpms.4.gz # 20090904: remove lukemftpd OLD_FILES+=usr/libexec/lukemftpd OLD_FILES+=usr/share/man/man5/ftpd.conf.5.gz From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 11:14:00 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52F4610656C3; Sat, 19 Dec 2009 11:14:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 405588FC1F; Sat, 19 Dec 2009 11:14:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBE0Ya031367; Sat, 19 Dec 2009 11:14:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBE0lT031362; Sat, 19 Dec 2009 11:14:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191114.nBJBE0lT031362@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 11:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200721 - in stable/8/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:14:00 -0000 Author: kib Date: Sat Dec 19 11:13:59 2009 New Revision: 200721 URL: http://svn.freebsd.org/changeset/base/200721 Log: MFC r198506: In kern_sigsuspend(), manipulate thread signal mask using kern_sigprocmask(). Also, do cursig/postsig loop immediately after waiting for signal, repeating the wait if wakeup was spurious due to race with other thread fetching signal from the process queue before us. MFC r199136: Use cpu_set_syscall_retval(9) to set syscall result, and return EJUSTRETURN from kern_sigsuspend() to prevent syscall return code from modifying wrong frame. Take care of possibility that pending SIGCONT might be cancelled by SIGSTOP, causing postsig() not to deliver any catched signal. Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/kern/kern_sig.c stable/8/sys/sys/signalvar.h stable/8/sys/sys/syscallsubr.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:11:57 2009 (r200720) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:13:59 2009 (r200721) @@ -2579,21 +2579,10 @@ int ofreebsd32_sigsuspend(struct thread *td, struct ofreebsd32_sigsuspend_args *uap) { - struct proc *p = td->td_proc; sigset_t mask; - PROC_LOCK(p); - td->td_oldsigmask = td->td_sigmask; - td->td_pflags |= TDP_OLDMASK; OSIG2SIG(uap->mask, mask); - SIG_CANTMASK(mask); - SIGSETLO(td->td_sigmask, mask); - signotify(td); - while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "opause", 0) == 0) - /* void */; - PROC_UNLOCK(p); - /* always return EINTR rather than ERESTART... */ - return (EINTR); + return (kern_sigsuspend(td, mask)); } struct sigstack32 { Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Sat Dec 19 11:11:57 2009 (r200720) +++ stable/8/sys/kern/kern_sig.c Sat Dec 19 11:13:59 2009 (r200721) @@ -966,14 +966,15 @@ execsigs(struct proc *p) */ int kern_sigprocmask(struct thread *td, int how, sigset_t *set, sigset_t *oset, - int old) + int flags) { sigset_t new_block, oset1; struct proc *p; int error; p = td->td_proc; - PROC_LOCK(p); + if (!(flags & SIGPROCMASK_PROC_LOCKED)) + PROC_LOCK(p); if (oset != NULL) *oset = td->td_sigmask; @@ -995,7 +996,7 @@ kern_sigprocmask(struct thread *td, int case SIG_SETMASK: SIG_CANTMASK(*set); oset1 = td->td_sigmask; - if (old) + if (flags & SIGPROCMASK_OLD) SIGSETLO(td->td_sigmask, *set); else td->td_sigmask = *set; @@ -1021,7 +1022,8 @@ kern_sigprocmask(struct thread *td, int if (p->p_numthreads != 1) reschedule_signals(p, new_block); - PROC_UNLOCK(p); + if (!(flags & SIGPROCMASK_PROC_LOCKED)) + PROC_UNLOCK(p); return (error); } @@ -1454,6 +1456,7 @@ int kern_sigsuspend(struct thread *td, sigset_t mask) { struct proc *p = td->td_proc; + int has_sig, sig; /* * When returning from sigsuspend, we want @@ -1463,16 +1466,29 @@ kern_sigsuspend(struct thread *td, sigse * to indicate this. */ PROC_LOCK(p); - td->td_oldsigmask = td->td_sigmask; + kern_sigprocmask(td, SIG_SETMASK, &mask, &td->td_oldsigmask, + SIGPROCMASK_PROC_LOCKED); td->td_pflags |= TDP_OLDMASK; - SIG_CANTMASK(mask); - td->td_sigmask = mask; - signotify(td); - while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "pause", 0) == 0) - /* void */; + + /* + * Process signals now. Otherwise, we can get spurious wakeup + * due to signal entered process queue, but delivered to other + * thread. But sigsuspend should return only on signal + * delivery. + */ + cpu_set_syscall_retval(td, EINTR); + for (has_sig = 0; !has_sig;) { + while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "pause", + 0) == 0) + /* void */; + thread_suspend_check(0); + mtx_lock(&p->p_sigacts->ps_mtx); + while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0) + has_sig += postsig(sig); + mtx_unlock(&p->p_sigacts->ps_mtx); + } PROC_UNLOCK(p); - /* always return EINTR rather than ERESTART... */ - return (EINTR); + return (EJUSTRETURN); } #ifdef COMPAT_43 /* XXX - COMPAT_FBSD3 */ @@ -1491,21 +1507,10 @@ osigsuspend(td, uap) struct thread *td; struct osigsuspend_args *uap; { - struct proc *p = td->td_proc; sigset_t mask; - PROC_LOCK(p); - td->td_oldsigmask = td->td_sigmask; - td->td_pflags |= TDP_OLDMASK; OSIG2SIG(uap->mask, mask); - SIG_CANTMASK(mask); - SIGSETLO(td->td_sigmask, mask); - signotify(td); - while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "opause", 0) == 0) - /* void */; - PROC_UNLOCK(p); - /* always return EINTR rather than ERESTART... */ - return (EINTR); + return (kern_sigsuspend(td, mask)); } #endif /* COMPAT_43 */ @@ -2662,7 +2667,7 @@ thread_stopped(struct proc *p) * Take the action for the specified signal * from the current set of pending signals. */ -void +int postsig(sig) register int sig; { @@ -2681,7 +2686,7 @@ postsig(sig) ksiginfo_init(&ksi); if (sigqueue_get(&td->td_sigqueue, sig, &ksi) == 0 && sigqueue_get(&p->p_sigqueue, sig, &ksi) == 0) - return; + return (0); ksi.ksi_signo = sig; if (ksi.ksi_code == SI_TIMER) itimer_accept(p, ksi.ksi_timerid, &ksi); @@ -2747,6 +2752,7 @@ postsig(sig) } (*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask); } + return (1); } /* Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Sat Dec 19 11:11:57 2009 (r200720) +++ stable/8/sys/sys/signalvar.h Sat Dec 19 11:13:59 2009 (r200721) @@ -316,6 +316,10 @@ extern int kern_logsigexit; /* Sysctl va #define SIG_STOP_ALLOWED 100 #define SIG_STOP_NOT_ALLOWED 101 +/* flags for kern_sigprocmask */ +#define SIGPROCMASK_OLD 0x0001 +#define SIGPROCMASK_PROC_LOCKED 0x0002 + /* * Machine-independent functions: */ @@ -325,7 +329,7 @@ void gsignal(int pgid, int sig); void killproc(struct proc *p, char *why); void pgsigio(struct sigio **, int signum, int checkctty); void pgsignal(struct pgrp *pgrp, int sig, int checkctty); -void postsig(int sig); +int postsig(int sig); void psignal(struct proc *p, int sig); int psignal_event(struct proc *p, struct sigevent *, ksiginfo_t *); struct sigacts *sigacts_alloc(void); @@ -359,7 +363,8 @@ void sigqueue_delete_stopmask_proc(struc void sigqueue_take(ksiginfo_t *ksi); int kern_sigtimedwait(struct thread *, sigset_t, ksiginfo_t *, struct timespec *); - +int kern_sigprocmask(struct thread *td, int how, + sigset_t *set, sigset_t *oset, int flags); /* * Machine-dependent functions: */ Modified: stable/8/sys/sys/syscallsubr.h ============================================================================== --- stable/8/sys/sys/syscallsubr.h Sat Dec 19 11:11:57 2009 (r200720) +++ stable/8/sys/sys/syscallsubr.h Sat Dec 19 11:13:59 2009 (r200721) @@ -190,8 +190,6 @@ int kern_shmctl(struct thread *td, int s int kern_sigaction(struct thread *td, int sig, struct sigaction *act, struct sigaction *oact, int flags); int kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss); -int kern_sigprocmask(struct thread *td, int how, - sigset_t *set, sigset_t *oset, int old); int kern_sigsuspend(struct thread *td, sigset_t mask); int kern_stat(struct thread *td, char *path, enum uio_seg pathseg, struct stat *sbp); From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 11:31:28 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E800910656BE; Sat, 19 Dec 2009 11:31:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D26B88FC15; Sat, 19 Dec 2009 11:31:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBVSKi031779; Sat, 19 Dec 2009 11:31:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBVSIW031761; Sat, 19 Dec 2009 11:31:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191131.nBJBVSIW031761@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 11:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200722 - in stable/8/sys: amd64/amd64 amd64/ia32 amd64/linux32 arm/arm compat/freebsd32 i386/i386 i386/linux ia64/ia64 kern mips/mips pc98/pc98 powerpc/aim powerpc/booke sparc64/sparc6... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:31:29 -0000 Author: kib Date: Sat Dec 19 11:31:28 2009 New Revision: 200722 URL: http://svn.freebsd.org/changeset/base/200722 Log: MFC r198507: Use kern_sigprocmask() instead of direct manipulation of td_sigmask to reschedule newly blocked signals. MFC r198590: Trapsignal() calls kern_sigprocmask() when delivering catched signal with proc lock held. MFC r198670: For trapsignal() and postsig(), kern_sigprocmask() is called with both process lock and curproc->p_sigacts->ps_mtx locked. Prevent lock recursion on ps_mtx in reschedule_signals(). Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/ia32/ia32_signal.c stable/8/sys/amd64/linux32/linux32_sysvec.c stable/8/sys/arm/arm/machdep.c stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/i386/i386/machdep.c stable/8/sys/i386/linux/linux_sysvec.c stable/8/sys/ia64/ia64/machdep.c stable/8/sys/kern/kern_context.c stable/8/sys/kern/kern_sig.c stable/8/sys/mips/mips/pm_machdep.c stable/8/sys/pc98/pc98/machdep.c stable/8/sys/powerpc/aim/machdep.c stable/8/sys/powerpc/booke/machdep.c stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sun4v/sun4v/machdep.c stable/8/sys/sys/signalvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/amd64/amd64/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -415,7 +415,7 @@ sigreturn(td, uap) ucontext_t uc; struct proc *p = td->td_proc; struct trapframe *regs; - const ucontext_t *ucp; + ucontext_t *ucp; long rflags; int cs, error, ret; ksiginfo_t ksi; @@ -478,7 +478,6 @@ sigreturn(td, uap) td->td_pcb->pcb_fsbase = ucp->uc_mcontext.mc_fsbase; td->td_pcb->pcb_gsbase = ucp->uc_mcontext.mc_gsbase; - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; @@ -486,10 +485,7 @@ sigreturn(td, uap) td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); td->td_pcb->pcb_flags |= PCB_FULLCTX; td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); Modified: stable/8/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_signal.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/amd64/ia32/ia32_signal.c Sat Dec 19 11:31:28 2009 (r200722) @@ -244,10 +244,8 @@ freebsd32_setcontext(struct thread *td, if (ret == 0) { ret = ia32_set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, + &uc.uc_sigmask, NULL, 0); } } } @@ -273,10 +271,8 @@ freebsd32_swapcontext(struct thread *td, if (ret == 0) { ret = ia32_set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, + &uc.uc_sigmask, NULL, 0); } } } @@ -544,9 +540,8 @@ freebsd4_freebsd32_sigreturn(td, uap) } */ *uap; { struct ia32_ucontext4 uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ia32_ucontext4 *ucp; + struct ia32_ucontext4 *ucp; int cs, eflags, error; ksiginfo_t ksi; @@ -610,11 +605,7 @@ freebsd4_freebsd32_sigreturn(td, uap) regs->tf_fs = ucp->uc_mcontext.mc_fs; regs->tf_gs = ucp->uc_mcontext.mc_gs; - PROC_LOCK(p); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); } @@ -631,9 +622,8 @@ freebsd32_sigreturn(td, uap) } */ *uap; { struct ia32_ucontext uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ia32_ucontext *ucp; + struct ia32_ucontext *ucp; int cs, eflags, error, ret; ksiginfo_t ksi; @@ -702,11 +692,7 @@ freebsd32_sigreturn(td, uap) regs->tf_gs = ucp->uc_mcontext.mc_gs; regs->tf_flags = TF_HASSEGS; - PROC_LOCK(p); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); } Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_sysvec.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/amd64/linux32/linux32_sysvec.c Sat Dec 19 11:31:28 2009 (r200722) @@ -565,9 +565,9 @@ linux_sendsig(sig_t catcher, ksiginfo_t int linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_sigframe frame; struct trapframe *regs; + sigset_t bmask; l_sigset_t lmask; int eflags, i; ksiginfo_t ksi; @@ -623,11 +623,8 @@ linux_sigreturn(struct thread *td, struc lmask.__bits[0] = frame.sf_sc.sc_mask; for (i = 0; i < (LINUX_NSIG_WORDS-1); i++) lmask.__bits[i+1] = frame.sf_extramask[i]; - PROC_LOCK(p); - linux_to_bsd_sigset(&lmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&lmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context. @@ -666,9 +663,9 @@ linux_sigreturn(struct thread *td, struc int linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_ucontext uc; struct l_sigcontext *context; + sigset_t bmask; l_stack_t *lss; stack_t ss; struct trapframe *regs; @@ -725,11 +722,8 @@ linux_rt_sigreturn(struct thread *td, st return(EINVAL); } - PROC_LOCK(p); - linux_to_bsd_sigset(&uc.uc_sigmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&uc.uc_sigmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context Modified: stable/8/sys/arm/arm/machdep.c ============================================================================== --- stable/8/sys/arm/arm/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/arm/arm/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -605,7 +605,6 @@ sigreturn(td, uap) const struct __ucontext *sigcntxp; } */ *uap; { - struct proc *p = td->td_proc; struct sigframe sf; struct trapframe *tf; int spsr; @@ -627,11 +626,7 @@ sigreturn(td, uap) set_mcontext(td, &sf.sf_uc.uc_mcontext); /* Restore signal mask. */ - PROC_LOCK(p); - td->td_sigmask = sf.sf_uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &sf.sf_uc.uc_sigmask, NULL, 0); return (EJUSTRETURN); } Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:31:28 2009 (r200722) @@ -2482,7 +2482,7 @@ ofreebsd32_sigprocmask(struct thread *td int error; OSIG2SIG(uap->mask, set); - error = kern_sigprocmask(td, uap->how, &set, &oset, 1); + error = kern_sigprocmask(td, uap->how, &set, &oset, SIGPROCMASK_OLD); SIG2OSIG(oset, td->td_retval[0]); return (error); } @@ -2546,15 +2546,11 @@ int ofreebsd32_sigblock(struct thread *td, struct ofreebsd32_sigblock_args *uap) { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETOR(td->td_sigmask, set); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_BLOCK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } @@ -2562,16 +2558,11 @@ int ofreebsd32_sigsetmask(struct thread *td, struct ofreebsd32_sigsetmask_args *uap) { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETLO(td->td_sigmask, set); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/i386/i386/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -756,7 +756,6 @@ osigreturn(td, uap) struct osigcontext sc; struct trapframe *regs; struct osigcontext *scp; - struct proc *p = td->td_proc; int eflags, error; ksiginfo_t ksi; @@ -856,17 +855,14 @@ osigreturn(td, uap) regs->tf_eip = scp->sc_pc; regs->tf_eflags = eflags; - PROC_LOCK(p); #if defined(COMPAT_43) if (scp->sc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - SIGSETOLD(td->td_sigmask, scp->sc_mask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, (sigset_t *)&scp->sc_mask, NULL, + SIGPROCMASK_OLD); return (EJUSTRETURN); } #endif /* COMPAT_43 */ @@ -883,9 +879,8 @@ freebsd4_sigreturn(td, uap) } */ *uap; { struct ucontext4 uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ucontext4 *ucp; + struct ucontext4 *ucp; int cs, eflags, error; ksiginfo_t ksi; @@ -973,18 +968,13 @@ freebsd4_sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); return (EJUSTRETURN); } #endif /* COMPAT_FREEBSD4 */ @@ -1000,9 +990,8 @@ sigreturn(td, uap) } */ *uap; { ucontext_t uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const ucontext_t *ucp; + ucontext_t *ucp; int cs, eflags, error, ret; ksiginfo_t ksi; @@ -1094,7 +1083,6 @@ sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; @@ -1102,10 +1090,7 @@ sigreturn(td, uap) td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); return (EJUSTRETURN); } Modified: stable/8/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/8/sys/i386/linux/linux_sysvec.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/i386/linux/linux_sysvec.c Sat Dec 19 11:31:28 2009 (r200722) @@ -667,10 +667,10 @@ linux_sendsig(sig_t catcher, ksiginfo_t int linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_sigframe frame; struct trapframe *regs; l_sigset_t lmask; + sigset_t bmask; int eflags, i; ksiginfo_t ksi; @@ -725,11 +725,8 @@ linux_sigreturn(struct thread *td, struc lmask.__bits[0] = frame.sf_sc.sc_mask; for (i = 0; i < (LINUX_NSIG_WORDS-1); i++) lmask.__bits[i+1] = frame.sf_extramask[i]; - PROC_LOCK(p); - linux_to_bsd_sigset(&lmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&lmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context. @@ -767,9 +764,9 @@ linux_sigreturn(struct thread *td, struc int linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_ucontext uc; struct l_sigcontext *context; + sigset_t bmask; l_stack_t *lss; stack_t ss; struct trapframe *regs; @@ -826,11 +823,8 @@ linux_rt_sigreturn(struct thread *td, st return(EINVAL); } - PROC_LOCK(p); - linux_to_bsd_sigset(&uc.uc_sigmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&uc.uc_sigmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/ia64/ia64/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -1119,11 +1119,9 @@ sigreturn(struct thread *td, { ucontext_t uc; struct trapframe *tf; - struct proc *p; struct pcb *pcb; tf = td->td_frame; - p = td->td_proc; pcb = td->td_pcb; /* @@ -1135,17 +1133,13 @@ sigreturn(struct thread *td, set_mcontext(td, &uc.uc_mcontext); - PROC_LOCK(p); #if defined(COMPAT_43) if (sigonstack(tf->tf_special.sp)) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); return (EJUSTRETURN); } Modified: stable/8/sys/kern/kern_context.c ============================================================================== --- stable/8/sys/kern/kern_context.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/kern/kern_context.c Sat Dec 19 11:31:28 2009 (r200722) @@ -89,10 +89,8 @@ setcontext(struct thread *td, struct set if (ret == 0) { ret = set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, + NULL, 0); } } } @@ -118,10 +116,8 @@ swapcontext(struct thread *td, struct sw if (ret == 0) { ret = set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, + &uc.uc_sigmask, NULL, 0); } } } Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/kern/kern_sig.c Sat Dec 19 11:31:28 2009 (r200722) @@ -216,7 +216,7 @@ static int sigproptbl[NSIG] = { SA_KILL|SA_PROC, /* SIGUSR2 */ }; -static void reschedule_signals(struct proc *p, sigset_t block); +static void reschedule_signals(struct proc *p, sigset_t block, int flags); static void sigqueue_start(void) @@ -1020,7 +1020,7 @@ kern_sigprocmask(struct thread *td, int * possibly waking it up. */ if (p->p_numthreads != 1) - reschedule_signals(p, new_block); + reschedule_signals(p, new_block, flags); if (!(flags & SIGPROCMASK_PROC_LOCKED)) PROC_UNLOCK(p); @@ -1392,15 +1392,11 @@ osigblock(td, uap) register struct thread *td; struct osigblock_args *uap; { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETOR(td->td_sigmask, set); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_BLOCK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } @@ -1414,16 +1410,11 @@ osigsetmask(td, uap) struct thread *td; struct osigsetmask_args *uap; { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETLO(td->td_sigmask, set); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } #endif /* COMPAT_43 */ @@ -1839,6 +1830,7 @@ void trapsignal(struct thread *td, ksiginfo_t *ksi) { struct sigacts *ps; + sigset_t mask; struct proc *p; int sig; int code; @@ -1861,9 +1853,11 @@ trapsignal(struct thread *td, ksiginfo_t #endif (*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], ksi, &td->td_sigmask); - SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]); + mask = ps->ps_catchmask[_SIG_IDX(sig)]; if (!SIGISMEMBER(ps->ps_signodefer, sig)) - SIGADDSET(td->td_sigmask, sig); + SIGADDSET(mask, sig); + kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, + SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED); if (SIGISMEMBER(ps->ps_sigreset, sig)) { /* * See kern_sigaction() for origin of this code. @@ -2399,7 +2393,7 @@ stopme: } static void -reschedule_signals(struct proc *p, sigset_t block) +reschedule_signals(struct proc *p, sigset_t block, int flags) { struct sigacts *ps; struct thread *td; @@ -2417,12 +2411,14 @@ reschedule_signals(struct proc *p, sigse td = sigtd(p, i, 0); signotify(td); - mtx_lock(&ps->ps_mtx); + if (!(flags & SIGPROCMASK_PS_LOCKED)) + mtx_lock(&ps->ps_mtx); if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, i)) tdsigwakeup(td, i, SIG_CATCH, (SIGISMEMBER(ps->ps_sigintr, i) ? EINTR : ERESTART)); - mtx_unlock(&ps->ps_mtx); + if (!(flags & SIGPROCMASK_PS_LOCKED)) + mtx_unlock(&ps->ps_mtx); } } @@ -2450,7 +2446,7 @@ tdsigcleanup(struct thread *td) SIGFILLSET(unblocked); SIGSETNAND(unblocked, td->td_sigmask); SIGFILLSET(td->td_sigmask); - reschedule_signals(p, unblocked); + reschedule_signals(p, unblocked, 0); } @@ -2676,7 +2672,7 @@ postsig(sig) struct sigacts *ps; sig_t action; ksiginfo_t ksi; - sigset_t returnmask; + sigset_t returnmask, mask; KASSERT(sig != 0, ("postsig")); @@ -2731,9 +2727,11 @@ postsig(sig) } else returnmask = td->td_sigmask; - SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]); + mask = ps->ps_catchmask[_SIG_IDX(sig)]; if (!SIGISMEMBER(ps->ps_signodefer, sig)) - SIGADDSET(td->td_sigmask, sig); + SIGADDSET(mask, sig); + kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, + SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED); if (SIGISMEMBER(ps->ps_sigreset, sig)) { /* Modified: stable/8/sys/mips/mips/pm_machdep.c ============================================================================== --- stable/8/sys/mips/mips/pm_machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/mips/mips/pm_machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -213,13 +213,11 @@ int sigreturn(struct thread *td, struct sigreturn_args *uap) { struct trapframe *regs; - const ucontext_t *ucp; - struct proc *p; + ucontext_t *ucp; ucontext_t uc; int error; ucp = &uc; - p = td->td_proc; error = copyin(uap->sigcntxp, &uc, sizeof(uc)); if (error != 0) @@ -229,7 +227,7 @@ sigreturn(struct thread *td, struct sigr /* #ifdef DEBUG */ if (ucp->uc_mcontext.mc_regs[ZERO] != UCONTEXT_MAGIC) { - printf("sigreturn: pid %d, ucp %p\n", p->p_pid, ucp); + printf("sigreturn: pid %d, ucp %p\n", td->td_proc->p_pid, ucp); printf(" old sp %x ra %x pc %x\n", regs->sp, regs->ra, regs->pc); printf(" new sp %x ra %x pc %x z %x\n", @@ -253,11 +251,8 @@ sigreturn(struct thread *td, struct sigr regs->mullo = ucp->uc_mcontext.mullo; regs->mulhi = ucp->uc_mcontext.mulhi; - PROC_LOCK(p); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); + return(EJUSTRETURN); } Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/pc98/pc98/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -686,7 +686,6 @@ osigreturn(td, uap) struct osigcontext sc; struct trapframe *regs; struct osigcontext *scp; - struct proc *p = td->td_proc; int eflags, error; ksiginfo_t ksi; @@ -786,17 +785,14 @@ osigreturn(td, uap) regs->tf_eip = scp->sc_pc; regs->tf_eflags = eflags; - PROC_LOCK(p); #if defined(COMPAT_43) if (scp->sc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - SIGSETOLD(td->td_sigmask, scp->sc_mask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, (sigset_t *)&scp->sc_mask, NULL, + SIGPROCMASK_OLD); return (EJUSTRETURN); } #endif /* COMPAT_43 */ @@ -813,9 +809,8 @@ freebsd4_sigreturn(td, uap) } */ *uap; { struct ucontext4 uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ucontext4 *ucp; + struct ucontext4 *ucp; int cs, eflags, error; ksiginfo_t ksi; @@ -903,18 +898,13 @@ freebsd4_sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); return (EJUSTRETURN); } #endif /* COMPAT_FREEBSD4 */ @@ -930,9 +920,8 @@ sigreturn(td, uap) } */ *uap; { ucontext_t uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const ucontext_t *ucp; + ucontext_t *ucp; int cs, eflags, error, ret; ksiginfo_t ksi; @@ -1024,18 +1013,14 @@ sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); return (EJUSTRETURN); } Modified: stable/8/sys/powerpc/aim/machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/powerpc/aim/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -695,7 +695,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, int sigreturn(struct thread *td, struct sigreturn_args *uap) { - struct proc *p; ucontext_t uc; int error; @@ -710,12 +709,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - p = td->td_proc; - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x", td, uc.uc_mcontext.mc_srr0, uc.uc_mcontext.mc_gpr[1]); Modified: stable/8/sys/powerpc/booke/machdep.c ============================================================================== --- stable/8/sys/powerpc/booke/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/powerpc/booke/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -664,7 +664,6 @@ set_mcontext(struct thread *td, const mc int sigreturn(struct thread *td, struct sigreturn_args *uap) { - struct proc *p; ucontext_t uc; int error; @@ -679,12 +678,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - p = td->td_proc; - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x", td, uc.uc_mcontext.mc_srr0, uc.uc_mcontext.mc_gpr[1]); Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/sparc64/sparc64/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -653,11 +653,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR4(KTR_SIG, "sigreturn: return td=%p pc=%#lx sp=%#lx tstate=%#lx", td, mc->mc_tpc, mc->mc_sp, mc->mc_tstate); Modified: stable/8/sys/sun4v/sun4v/machdep.c ============================================================================== --- stable/8/sys/sun4v/sun4v/machdep.c Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/sun4v/sun4v/machdep.c Sat Dec 19 11:31:28 2009 (r200722) @@ -667,11 +667,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR4(KTR_SIG, "sigreturn: return td=%p pc=%#lx sp=%#lx tstate=%#lx", td, mc->mc_tpc, mc->mc_sp, mc->mc_tstate); Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Sat Dec 19 11:13:59 2009 (r200721) +++ stable/8/sys/sys/signalvar.h Sat Dec 19 11:31:28 2009 (r200722) @@ -319,6 +319,7 @@ extern int kern_logsigexit; /* Sysctl va /* flags for kern_sigprocmask */ #define SIGPROCMASK_OLD 0x0001 #define SIGPROCMASK_PROC_LOCKED 0x0002 +#define SIGPROCMASK_PS_LOCKED 0x0004 /* * Machine-independent functions: From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 11:47:01 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BADD106568B; Sat, 19 Dec 2009 11:47:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06C808FC1B; Sat, 19 Dec 2009 11:47:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBl1dH032269; Sat, 19 Dec 2009 11:47:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBl0G2032256; Sat, 19 Dec 2009 11:47:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191147.nBJBl0G2032256@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 11:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200725 - in stable/8: lib/libc/gen lib/libc/sys lib/libthr/thread sys/compat/freebsd32 sys/kern sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:47:01 -0000 Author: kib Date: Sat Dec 19 11:47:00 2009 New Revision: 200725 URL: http://svn.freebsd.org/changeset/base/200725 Log: MFC r198508, r198509: Reimplement pselect() in kernel, making change of sigmask and sleep atomic. MFC r198538: Move pselect(3) man page to section 2. Added: stable/8/lib/libc/sys/pselect.2 - copied unchanged from r198538, head/lib/libc/sys/pselect.2 Deleted: stable/8/lib/libc/gen/pselect.3 stable/8/lib/libc/gen/pselect.c Modified: stable/8/lib/libc/gen/Makefile.inc stable/8/lib/libc/gen/Symbol.map stable/8/lib/libc/sys/Makefile.inc stable/8/lib/libc/sys/Symbol.map stable/8/lib/libthr/thread/thr_syscalls.c stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/compat/freebsd32/syscalls.master stable/8/sys/kern/subr_trap.c stable/8/sys/kern/sys_generic.c stable/8/sys/kern/syscalls.master stable/8/sys/sys/syscallsubr.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/lib/libc/gen/Makefile.inc ============================================================================== --- stable/8/lib/libc/gen/Makefile.inc Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/lib/libc/gen/Makefile.inc Sat Dec 19 11:47:00 2009 (r200725) @@ -22,7 +22,7 @@ SRCS+= __getosreldate.c __xuname.c \ initgroups.c isatty.c isinf.c isnan.c jrand48.c lcong48.c \ lockf.c lrand48.c mrand48.c nftw.c nice.c \ nlist.c nrand48.c opendir.c \ - pause.c pmadvise.c popen.c posix_spawn.c pselect.c \ + pause.c pmadvise.c popen.c posix_spawn.c \ psignal.c pw_scan.c pwcache.c \ raise.c readdir.c readpassphrase.c rewinddir.c \ scandir.c seed48.c seekdir.c sem.c semctl.c \ @@ -63,7 +63,7 @@ MAN+= alarm.3 arc4random.3 \ posix_spawnattr_getpgroup.3 posix_spawnattr_getschedparam.3 \ posix_spawnattr_getschedpolicy.3 posix_spawnattr_init.3 \ posix_spawnattr_getsigdefault.3 posix_spawnattr_getsigmask.3 \ - pselect.3 psignal.3 pwcache.3 \ + psignal.3 pwcache.3 \ raise.3 rand48.3 readpassphrase.3 rfork_thread.3 \ scandir.3 sem_destroy.3 sem_getvalue.3 sem_init.3 \ sem_open.3 sem_post.3 sem_timedwait.3 sem_wait.3 \ Modified: stable/8/lib/libc/gen/Symbol.map ============================================================================== --- stable/8/lib/libc/gen/Symbol.map Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/lib/libc/gen/Symbol.map Sat Dec 19 11:47:00 2009 (r200725) @@ -223,7 +223,6 @@ FBSD_1.0 { posix_madvise; popen; pclose; - pselect; psignal; raise; readdir; @@ -453,7 +452,6 @@ FBSDprivate_1.0 { __opendir2; __pause; _pause; - __pselect; __pw_scan; /* Used by (at least) libutil */ __raise; _raise; Modified: stable/8/lib/libc/sys/Makefile.inc ============================================================================== --- stable/8/lib/libc/sys/Makefile.inc Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/lib/libc/sys/Makefile.inc Sat Dec 19 11:47:00 2009 (r200725) @@ -83,7 +83,8 @@ MAN+= abort2.2 accept.2 access.2 acct.2 mq_setattr.2 \ msgctl.2 msgget.2 msgrcv.2 msgsnd.2 \ msync.2 munmap.2 nanosleep.2 nfssvc.2 ntp_adjtime.2 open.2 \ - pathconf.2 pipe.2 poll.2 posix_openpt.2 profil.2 ptrace.2 quotactl.2 \ + pathconf.2 pipe.2 poll.2 posix_openpt.2 profil.2 \ + pselect.2 ptrace.2 quotactl.2 \ read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \ rtprio.2 .if !defined(NO_P1003_1B) Modified: stable/8/lib/libc/sys/Symbol.map ============================================================================== --- stable/8/lib/libc/sys/Symbol.map Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/lib/libc/sys/Symbol.map Sat Dec 19 11:47:00 2009 (r200725) @@ -211,6 +211,7 @@ FBSD_1.0 { posix_openpt; preadv; profil; + pselect; ptrace; pwritev; quotactl; @@ -779,6 +780,8 @@ FBSDprivate_1.0 { __sys_preadv; _profil; __sys_profil; + _pselect; + __sys_pselect; _ptrace; __sys_ptrace; _pwritev; Copied: stable/8/lib/libc/sys/pselect.2 (from r198538, head/lib/libc/sys/pselect.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libc/sys/pselect.2 Sat Dec 19 11:47:00 2009 (r200725, copy of r198538, head/lib/libc/sys/pselect.2) @@ -0,0 +1,122 @@ +.\" +.\" Copyright 2002 Massachusetts Institute of Technology +.\" +.\" Permission to use, copy, modify, and distribute this software and +.\" its documentation for any purpose and without fee is hereby +.\" granted, provided that both the above copyright notice and this +.\" permission notice appear in all copies, that both the above +.\" copyright notice and this permission notice appear in all +.\" supporting documentation, and that the name of M.I.T. not be used +.\" in advertising or publicity pertaining to distribution of the +.\" software without specific, written prior permission. M.I.T. makes +.\" no representations about the suitability of this software for any +.\" purpose. It is provided "as is" without express or implied +.\" warranty. +.\" +.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS +.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT +.\" SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 27, 2009 +.Dt PSELECT 2 +.Os +.Sh NAME +.Nm pselect +.Nd synchronous I/O multiplexing a la POSIX.1g +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/select.h +.Ft int +.Fo pselect +.Fa "int nfds" +.Fa "fd_set * restrict readfds" +.Fa "fd_set * restrict writefds" +.Fa "fd_set * restrict exceptfds" +.Fa "const struct timespec * restrict timeout" +.Fa "const sigset_t * restrict newsigmask" +.Fc +.Sh DESCRIPTION +The +.Fn pselect +function was introduced by +.St -p1003.1g-2000 +as a slightly stronger version of +.Xr select 2 . +The +.Fa nfds , readfds , writefds , +and +.Fa exceptfds +arguments are all identical to the analogous arguments of +.Fn select . +The +.Fa timeout +argument in +.Fn pselect +points to a +.Vt "const struct timespec" +rather than the (modifiable) +.Vt "struct timeval" +used by +.Fn select ; +as in +.Fn select , +a null pointer may be passed to indicate that +.Fn pselect +should wait indefinitely. +Finally, +.Fa newsigmask +specifies a signal mask which is set while waiting for input. +When +.Fn pselect +returns, the original signal mask is restored. +.Pp +See +.Xr select 2 +for a more detailed discussion of the semantics of this interface, and +for macros used to manipulate the +.Vt "fd_set" +data type. +.Sh RETURN VALUES +The +.Fn pselect +function returns the same values and under the same conditions as +.Fn select . +.Sh ERRORS +The +.Fn pselect +function may fail for any of the reasons documented for +.Xr select 2 +and (if a signal mask is provided) +.Xr sigprocmask 2 . +.Sh SEE ALSO +.Xr kqueue 2 , +.Xr poll 2 , +.Xr select 2 , +.Xr sigprocmask 2 +.Sh STANDARDS +The +.Fn pselect +function conforms to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn pselect +function first appeared in +.Fx 5.0 . +.Sh AUTHORS +The first implementation of +.Fn pselect +function and this manual page were written by +.An Garrett Wollman Aq wollman@FreeBSD.org . Modified: stable/8/lib/libthr/thread/thr_syscalls.c ============================================================================== --- stable/8/lib/libthr/thread/thr_syscalls.c Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/lib/libthr/thread/thr_syscalls.c Sat Dec 19 11:47:00 2009 (r200725) @@ -104,6 +104,8 @@ extern int __sys_accept(int, struct sock extern int __sys_connect(int, const struct sockaddr *, socklen_t); extern int __sys_fsync(int); extern int __sys_msync(void *, size_t, int); +extern int __sys_pselect(int, fd_set *, fd_set *, fd_set *, + const struct timespec *, const sigset_t *); extern int __sys_poll(struct pollfd *, unsigned, int); extern ssize_t __sys_recv(int, void *, size_t, int); extern ssize_t __sys_recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); @@ -366,7 +368,7 @@ ___pselect(int count, fd_set *rfds, fd_s int ret; _thr_cancel_enter(curthread); - ret = __pselect(count, rfds, wfds, efds, timo, mask); + ret = __sys_pselect(count, rfds, wfds, efds, timo, mask); _thr_cancel_leave(curthread); return (ret); Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Sat Dec 19 11:47:00 2009 (r200725) @@ -593,6 +593,41 @@ freebsd32_select(struct thread *td, stru sizeof(int32_t) * 8)); } +int +freebsd32_pselect(struct thread *td, struct freebsd32_pselect_args *uap) +{ + struct timespec32 ts32; + struct timespec ts; + struct timeval tv, *tvp; + sigset_t set, *uset; + int error; + + if (uap->ts != NULL) { + error = copyin(uap->ts, &ts32, sizeof(ts32)); + if (error != 0) + return (error); + CP(ts32, ts, tv_sec); + CP(ts32, ts, tv_nsec); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + tvp = &tv; + } else + tvp = NULL; + if (uap->sm != NULL) { + error = copyin(uap->sm, &set, sizeof(set)); + if (error != 0) + return (error); + uset = &set; + } else + uset = NULL; + /* + * XXX big-endian needs to convert the fd_sets too. + * XXX Do pointers need PTRIN()? + */ + error = kern_pselect(td, uap->nd, uap->in, uap->ou, uap->ex, tvp, + uset, sizeof(int32_t) * 8); + return (error); +} + /* * Copy 'count' items into the destination list pointed to by uap->eventlist. */ Modified: stable/8/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/8/sys/compat/freebsd32/syscalls.master Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/compat/freebsd32/syscalls.master Sat Dec 19 11:47:00 2009 (r200725) @@ -913,3 +913,7 @@ 519 AUE_PDKILL UNIMPL pdkill 520 AUE_PDGETPID UNIMPL pdgetpid 521 AUE_PDWAIT UNIMPL pdwait +522 AUE_SELECT STD { int freebsd32_pselect(int nd, fd_set *in, \ + fd_set *ou, fd_set *ex, \ + const struct timespec32 *ts, \ + const sigset_t *sm); } Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/kern/subr_trap.c Sat Dec 19 11:47:00 2009 (r200725) @@ -245,6 +245,11 @@ ast(struct trapframe *framep) PROC_UNLOCK(p); } + if (td->td_pflags & TDP_OLDMASK) { + td->td_pflags &= ~TDP_OLDMASK; + kern_sigprocmask(td, SIG_SETMASK, &td->td_oldsigmask, NULL, 0); + } + userret(td, framep); mtx_assert(&Giant, MA_NOTOWNED); } Modified: stable/8/sys/kern/sys_generic.c ============================================================================== --- stable/8/sys/kern/sys_generic.c Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/kern/sys_generic.c Sat Dec 19 11:47:00 2009 (r200725) @@ -751,6 +751,58 @@ poll_no_poll(int events) return (events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); } +int +pselect(struct thread *td, struct pselect_args *uap) +{ + struct timespec ts; + struct timeval tv, *tvp; + sigset_t set, *uset; + int error; + + if (uap->ts != NULL) { + error = copyin(uap->ts, &ts, sizeof(ts)); + if (error != 0) + return (error); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + tvp = &tv; + } else + tvp = NULL; + if (uap->sm != NULL) { + error = copyin(uap->sm, &set, sizeof(set)); + if (error != 0) + return (error); + uset = &set; + } else + uset = NULL; + return (kern_pselect(td, uap->nd, uap->in, uap->ou, uap->ex, tvp, + uset, NFDBITS)); +} + +int +kern_pselect(struct thread *td, int nd, fd_set *in, fd_set *ou, fd_set *ex, + struct timeval *tvp, sigset_t *uset, int abi_nfdbits) +{ + int error; + + if (uset != NULL) { + error = kern_sigprocmask(td, SIG_SETMASK, uset, + &td->td_oldsigmask, 0); + if (error != 0) + return (error); + td->td_pflags |= TDP_OLDMASK; + /* + * Make sure that ast() is called on return to + * usermode and TDP_OLDMASK is cleared, restoring old + * sigmask. + */ + thread_lock(td); + td->td_flags |= TDF_ASTPENDING; + thread_unlock(td); + } + error = kern_select(td, nd, in, ou, ex, tvp, abi_nfdbits); + return (error); +} + #ifndef _SYS_SYSPROTO_H_ struct select_args { int nd; @@ -759,9 +811,7 @@ struct select_args { }; #endif int -select(td, uap) - register struct thread *td; - register struct select_args *uap; +select(struct thread *td, struct select_args *uap) { struct timeval tv, *tvp; int error; Modified: stable/8/sys/kern/syscalls.master ============================================================================== --- stable/8/sys/kern/syscalls.master Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/kern/syscalls.master Sat Dec 19 11:47:00 2009 (r200725) @@ -919,5 +919,9 @@ 519 AUE_PDKILL UNIMPL pdkill 520 AUE_PDGETPID UNIMPL pdgetpid 521 AUE_PDWAIT UNIMPL pdwait +522 AUE_SELECT STD { int pselect(int nd, fd_set *in, \ + fd_set *ou, fd_set *ex, \ + const struct timespec *ts, \ + const sigset_t *sm); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: stable/8/sys/sys/syscallsubr.h ============================================================================== --- stable/8/sys/sys/syscallsubr.h Sat Dec 19 11:43:39 2009 (r200724) +++ stable/8/sys/sys/syscallsubr.h Sat Dec 19 11:47:00 2009 (r200725) @@ -148,6 +148,8 @@ int kern_pathconf(struct thread *td, cha int name, u_long flags); int kern_pipe(struct thread *td, int fildes[2]); int kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset); +int kern_pselect(struct thread *td, int nd, fd_set *in, fd_set *ou, + fd_set *ex, struct timeval *tvp, sigset_t *uset, int abi_nfdbits); int kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data); int kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset); From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 11:50:05 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 027D2106568B; Sat, 19 Dec 2009 11:50:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E37BC8FC1A; Sat, 19 Dec 2009 11:50:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBo4H2032475; Sat, 19 Dec 2009 11:50:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBo4wC032464; Sat, 19 Dec 2009 11:50:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191150.nBJBo4wC032464@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 11:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200728 - in stable/8/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:50:05 -0000 Author: kib Date: Sat Dec 19 11:50:04 2009 New Revision: 200728 URL: http://svn.freebsd.org/changeset/base/200728 Log: Regen Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h stable/8/sys/compat/freebsd32/freebsd32_syscall.h stable/8/sys/compat/freebsd32/freebsd32_syscalls.c stable/8/sys/compat/freebsd32/freebsd32_sysent.c stable/8/sys/kern/init_sysent.c stable/8/sys/kern/syscalls.c stable/8/sys/kern/systrace_args.c stable/8/sys/sys/syscall.h stable/8/sys/sys/syscall.mk stable/8/sys/sys/sysproto.h Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_proto.h Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/compat/freebsd32/freebsd32_proto.h Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -453,6 +453,14 @@ struct freebsd32_shmctl_args { char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char buf_l_[PADL_(struct shmid_ds32 *)]; struct shmid_ds32 * buf; char buf_r_[PADR_(struct shmid_ds32 *)]; }; +struct freebsd32_pselect_args { + char nd_l_[PADL_(int)]; int nd; char nd_r_[PADR_(int)]; + char in_l_[PADL_(fd_set *)]; fd_set * in; char in_r_[PADR_(fd_set *)]; + char ou_l_[PADL_(fd_set *)]; fd_set * ou; char ou_r_[PADR_(fd_set *)]; + char ex_l_[PADL_(fd_set *)]; fd_set * ex; char ex_r_[PADR_(fd_set *)]; + char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; + char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; +}; int freebsd32_wait4(struct thread *, struct freebsd32_wait4_args *); int freebsd32_recvmsg(struct thread *, struct freebsd32_recvmsg_args *); int freebsd32_sendmsg(struct thread *, struct freebsd32_sendmsg_args *); @@ -536,6 +544,7 @@ int freebsd32_jail_set(struct thread *, int freebsd32_semctl(struct thread *, struct freebsd32_semctl_args *); int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *); int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); +int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); #ifdef COMPAT_43 @@ -814,6 +823,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL #define FREEBSD32_SYS_AUE_freebsd32_msgctl AUE_MSGCTL #define FREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL +#define FREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT #undef PAD_ #undef PADL_ Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscall.h Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -386,4 +386,5 @@ #define FREEBSD32_SYS_freebsd32_msgctl 511 #define FREEBSD32_SYS_freebsd32_shmctl 512 #define FREEBSD32_SYS_lpathconf 513 -#define FREEBSD32_SYS_MAXSYSCALL 522 +#define FREEBSD32_SYS_freebsd32_pselect 522 +#define FREEBSD32_SYS_MAXSYSCALL 523 Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib */ const char *freebsd32_syscallnames[] = { @@ -529,4 +529,5 @@ const char *freebsd32_syscallnames[] = { "#519", /* 519 = pdkill */ "#520", /* 520 = pdgetpid */ "#521", /* 521 = pdwait */ + "freebsd32_pselect", /* 522 = freebsd32_pselect */ }; Modified: stable/8/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_sysent.c Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/compat/freebsd32/freebsd32_sysent.c Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #include "opt_compat.h" @@ -566,4 +566,5 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 519 = pdkill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ + { AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, AUE_SELECT, NULL, 0, 0, 0 }, /* 522 = freebsd32_pselect */ }; Modified: stable/8/sys/kern/init_sysent.c ============================================================================== --- stable/8/sys/kern/init_sysent.c Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/kern/init_sysent.c Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #include "opt_compat.h" @@ -556,4 +556,5 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 519 = pdkill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ + { AS(pselect_args), (sy_call_t *)pselect, AUE_SELECT, NULL, 0, 0, 0 }, /* 522 = pselect */ }; Modified: stable/8/sys/kern/syscalls.c ============================================================================== --- stable/8/sys/kern/syscalls.c Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/kern/syscalls.c Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200725 2009-12-19 11:47:00Z kib */ const char *syscallnames[] = { @@ -529,4 +529,5 @@ const char *syscallnames[] = { "#519", /* 519 = pdkill */ "#520", /* 520 = pdgetpid */ "#521", /* 521 = pdwait */ + "pselect", /* 522 = pselect */ }; Modified: stable/8/sys/kern/systrace_args.c ============================================================================== --- stable/8/sys/kern/systrace_args.c Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/kern/systrace_args.c Sat Dec 19 11:50:04 2009 (r200728) @@ -3072,6 +3072,18 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } + /* pselect */ + case 522: { + struct pselect_args *p = params; + iarg[0] = p->nd; /* int */ + uarg[1] = (intptr_t) p->in; /* fd_set * */ + uarg[2] = (intptr_t) p->ou; /* fd_set * */ + uarg[3] = (intptr_t) p->ex; /* fd_set * */ + uarg[4] = (intptr_t) p->ts; /* const struct timespec * */ + uarg[5] = (intptr_t) p->sm; /* const sigset_t * */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8154,6 +8166,31 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* pselect */ + case 522: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "fd_set *"; + break; + case 2: + p = "fd_set *"; + break; + case 3: + p = "fd_set *"; + break; + case 4: + p = "const struct timespec *"; + break; + case 5: + p = "const sigset_t *"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/8/sys/sys/syscall.h ============================================================================== --- stable/8/sys/sys/syscall.h Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/sys/syscall.h Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #define SYS_syscall 0 @@ -428,4 +428,5 @@ #define SYS_msgctl 511 #define SYS_shmctl 512 #define SYS_lpathconf 513 -#define SYS_MAXSYSCALL 522 +#define SYS_pselect 522 +#define SYS_MAXSYSCALL 523 Modified: stable/8/sys/sys/syscall.mk ============================================================================== --- stable/8/sys/sys/syscall.mk Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/sys/syscall.mk Sat Dec 19 11:50:04 2009 (r200728) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson +# created from FreeBSD: stable/8/sys/kern/syscalls.master 200725 2009-12-19 11:47:00Z kib MIASM = \ syscall.o \ exit.o \ @@ -376,4 +376,5 @@ MIASM = \ __semctl.o \ msgctl.o \ shmctl.o \ - lpathconf.o + lpathconf.o \ + pselect.o Modified: stable/8/sys/sys/sysproto.h ============================================================================== --- stable/8/sys/sys/sysproto.h Sat Dec 19 11:49:20 2009 (r200727) +++ stable/8/sys/sys/sysproto.h Sat Dec 19 11:50:04 2009 (r200728) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 200491 2009-12-14 00:19:31Z rwatson + * created from FreeBSD: stable/8/sys/kern/syscalls.master 200725 2009-12-19 11:47:00Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -1641,6 +1641,14 @@ struct lpathconf_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; }; +struct pselect_args { + char nd_l_[PADL_(int)]; int nd; char nd_r_[PADR_(int)]; + char in_l_[PADL_(fd_set *)]; fd_set * in; char in_r_[PADR_(fd_set *)]; + char ou_l_[PADL_(fd_set *)]; fd_set * ou; char ou_r_[PADR_(fd_set *)]; + char ex_l_[PADL_(fd_set *)]; fd_set * ex; char ex_r_[PADR_(fd_set *)]; + char ts_l_[PADL_(const struct timespec *)]; const struct timespec * ts; char ts_r_[PADR_(const struct timespec *)]; + char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_exit(struct thread *, struct sys_exit_args *); int fork(struct thread *, struct fork_args *); @@ -1999,6 +2007,7 @@ int __semctl(struct thread *, struct __s int msgctl(struct thread *, struct msgctl_args *); int shmctl(struct thread *, struct shmctl_args *); int lpathconf(struct thread *, struct lpathconf_args *); +int pselect(struct thread *, struct pselect_args *); #ifdef COMPAT_43 @@ -2671,6 +2680,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_msgctl AUE_MSGCTL #define SYS_AUE_shmctl AUE_SHMCTL #define SYS_AUE_lpathconf AUE_LPATHCONF +#define SYS_AUE_pselect AUE_SELECT #undef PAD_ #undef PADL_ From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 12:06:13 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A82B106566B; Sat, 19 Dec 2009 12:06:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36CBD8FC16; Sat, 19 Dec 2009 12:06:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJC6DHR032858; Sat, 19 Dec 2009 12:06:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJC6D5J032851; Sat, 19 Dec 2009 12:06:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912191206.nBJC6D5J032851@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 12:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200729 - in stable/8/sys: ddb dev/syscons kern sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 12:06:13 -0000 Author: kib Date: Sat Dec 19 12:06:12 2009 New Revision: 200729 URL: http://svn.freebsd.org/changeset/base/200729 Log: MFC r199355: Add SI_KERNEL. MFC r199418: Fix pgsignal() call after signature change in r199355. Modified: stable/8/sys/ddb/db_command.c stable/8/sys/dev/syscons/scvidctl.c stable/8/sys/kern/kern_sig.c stable/8/sys/kern/tty.c stable/8/sys/sys/signal.h stable/8/sys/sys/signalvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ddb/db_command.c ============================================================================== --- stable/8/sys/ddb/db_command.c Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/ddb/db_command.c Sat Dec 19 12:06:12 2009 (r200729) @@ -652,7 +652,7 @@ db_kill(dummy1, dummy2, dummy3, dummy4) if (PROC_TRYLOCK(p) == 0) DB_ERROR(("Can't lock process with pid %ld\n", (long) pid)); else { - psignal(p, sig); + pksignal(p, sig, NULL); PROC_UNLOCK(p); } Modified: stable/8/sys/dev/syscons/scvidctl.c ============================================================================== --- stable/8/sys/dev/syscons/scvidctl.c Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/dev/syscons/scvidctl.c Sat Dec 19 12:06:12 2009 (r200729) @@ -321,6 +321,7 @@ sc_set_pixel_mode(scr_stat *scp, struct return ENODEV; #else video_info_t info; + ksiginfo_t ksi; u_char *font; int prev_ysize; int error; @@ -454,8 +455,11 @@ sc_set_pixel_mode(scr_stat *scp, struct tp->t_winsize.ws_col = scp->xsize; tp->t_winsize.ws_row = scp->ysize; if (tp->t_pgrp != NULL) { + ksiginfo_init(&ksi); + ksi.ksi_signo = SIGWINCH; + ksi.ksi_code = SI_KERNEL; PGRP_LOCK(tp->t_pgrp); - pgsignal(tp->t_pgrp, SIGWINCH, 1); + pgsignal(tp->t_pgrp, SIGWINCH, 1, &ksi); PGRP_UNLOCK(tp->t_pgrp); } } Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/kern/kern_sig.c Sat Dec 19 12:06:12 2009 (r200729) @@ -99,7 +99,8 @@ SDT_PROBE_ARGTYPE(proc, kernel, , signal static int coredump(struct thread *); static char *expand_name(const char *, uid_t, pid_t); -static int killpg1(struct thread *td, int sig, int pgid, int all); +static int killpg1(struct thread *td, int sig, int pgid, int all, + ksiginfo_t *ksi); static int issignal(struct thread *td, int stop_allowed); static int sigprop(int sig); static void tdsigwakeup(struct thread *, int, sig_t, int); @@ -377,7 +378,8 @@ sigqueue_add(sigqueue_t *sq, int signo, ksi->ksi_sigq = sq; } - if ((si->ksi_flags & KSI_TRAP) != 0) { + if ((si->ksi_flags & KSI_TRAP) != 0 || + (si->ksi_flags & KSI_SIGQ) == 0) { if (ret != 0) SIGADDSET(sq->sq_kill, signo); ret = 0; @@ -1607,11 +1609,9 @@ kern_sigaltstack(struct thread *td, stac * cp is calling process. */ static int -killpg1(td, sig, pgid, all) - register struct thread *td; - int sig, pgid, all; +killpg1(struct thread *td, int sig, int pgid, int all, ksiginfo_t *ksi) { - register struct proc *p; + struct proc *p; struct pgrp *pgrp; int nfound = 0; @@ -1630,7 +1630,7 @@ killpg1(td, sig, pgid, all) if (p_cansignal(td, p, sig) == 0) { nfound++; if (sig) - psignal(p, sig); + pksignal(p, sig, ksi); } PROC_UNLOCK(p); } @@ -1661,7 +1661,7 @@ killpg1(td, sig, pgid, all) if (p_cansignal(td, p, sig) == 0) { nfound++; if (sig) - psignal(p, sig); + pksignal(p, sig, ksi); } PROC_UNLOCK(p); } @@ -1678,11 +1678,10 @@ struct kill_args { #endif /* ARGSUSED */ int -kill(td, uap) - register struct thread *td; - register struct kill_args *uap; +kill(struct thread *td, struct kill_args *uap) { - register struct proc *p; + ksiginfo_t ksi; + struct proc *p; int error; AUDIT_ARG_SIGNUM(uap->signum); @@ -1690,6 +1689,12 @@ kill(td, uap) if ((u_int)uap->signum > _SIG_MAXSIG) return (EINVAL); + ksiginfo_init(&ksi); + ksi.ksi_signo = uap->signum; + ksi.ksi_code = SI_USER; + ksi.ksi_pid = td->td_proc->p_pid; + ksi.ksi_uid = td->td_ucred->cr_ruid; + if (uap->pid > 0) { /* kill single process */ if ((p = pfind(uap->pid)) == NULL) { @@ -1699,17 +1704,17 @@ kill(td, uap) AUDIT_ARG_PROCESS(p); error = p_cansignal(td, p, uap->signum); if (error == 0 && uap->signum) - psignal(p, uap->signum); + pksignal(p, uap->signum, &ksi); PROC_UNLOCK(p); return (error); } switch (uap->pid) { case -1: /* broadcast signal */ - return (killpg1(td, uap->signum, 0, 1)); + return (killpg1(td, uap->signum, 0, 1, &ksi)); case 0: /* signal own process group */ - return (killpg1(td, uap->signum, 0, 0)); + return (killpg1(td, uap->signum, 0, 0, &ksi)); default: /* negative explicit process group */ - return (killpg1(td, uap->signum, -uap->pid, 0)); + return (killpg1(td, uap->signum, -uap->pid, 0, &ksi)); } /* NOTREACHED */ } @@ -1723,17 +1728,21 @@ struct okillpg_args { #endif /* ARGSUSED */ int -okillpg(td, uap) - struct thread *td; - register struct okillpg_args *uap; +okillpg(struct thread *td, struct okillpg_args *uap) { + ksiginfo_t ksi; AUDIT_ARG_SIGNUM(uap->signum); AUDIT_ARG_PID(uap->pgid); if ((u_int)uap->signum > _SIG_MAXSIG) return (EINVAL); - return (killpg1(td, uap->signum, uap->pgid, 0)); + ksiginfo_init(&ksi); + ksi.ksi_signo = uap->signum; + ksi.ksi_code = SI_USER; + ksi.ksi_pid = td->td_proc->p_pid; + ksi.ksi_uid = td->td_ucred->cr_ruid; + return (killpg1(td, uap->signum, uap->pgid, 0, &ksi)); } #endif /* COMPAT_43 */ @@ -1768,6 +1777,7 @@ sigqueue(struct thread *td, struct sigqu error = p_cansignal(td, p, uap->signum); if (error == 0 && uap->signum != 0) { ksiginfo_init(&ksi); + ksi.ksi_flags = KSI_SIGQ; ksi.ksi_signo = uap->signum; ksi.ksi_code = SI_QUEUE; ksi.ksi_pid = td->td_proc->p_pid; @@ -1783,8 +1793,7 @@ sigqueue(struct thread *td, struct sigqu * Send a signal to a process group. */ void -gsignal(pgid, sig) - int pgid, sig; +gsignal(int pgid, int sig, ksiginfo_t *ksi) { struct pgrp *pgrp; @@ -1793,7 +1802,7 @@ gsignal(pgid, sig) pgrp = pgfind(pgid); sx_sunlock(&proctree_lock); if (pgrp != NULL) { - pgsignal(pgrp, sig, 0); + pgsignal(pgrp, sig, 0, ksi); PGRP_UNLOCK(pgrp); } } @@ -1804,18 +1813,16 @@ gsignal(pgid, sig) * limit to members which have a controlling terminal. */ void -pgsignal(pgrp, sig, checkctty) - struct pgrp *pgrp; - int sig, checkctty; +pgsignal(struct pgrp *pgrp, int sig, int checkctty, ksiginfo_t *ksi) { - register struct proc *p; + struct proc *p; if (pgrp) { PGRP_LOCK_ASSERT(pgrp, MA_OWNED); LIST_FOREACH(p, &pgrp->pg_members, p_pglist) { PROC_LOCK(p); if (checkctty == 0 || p->p_flag & P_CONTROLT) - psignal(p, sig); + pksignal(p, sig, ksi); PROC_UNLOCK(p); } } @@ -1936,7 +1943,19 @@ sigtd(struct proc *p, int sig, int prop) void psignal(struct proc *p, int sig) { - (void) tdsignal(p, NULL, sig, NULL); + ksiginfo_t ksi; + + ksiginfo_init(&ksi); + ksi.ksi_signo = sig; + ksi.ksi_code = SI_KERNEL; + (void) tdsignal(p, NULL, sig, &ksi); +} + +void +pksignal(struct proc *p, int sig, ksiginfo_t *ksi) +{ + + (void) tdsignal(p, NULL, sig, ksi); } int @@ -3138,8 +3157,13 @@ pgsigio(sigiop, sig, checkctty) struct sigio **sigiop; int sig, checkctty; { + ksiginfo_t ksi; struct sigio *sigio; + ksiginfo_init(&ksi); + ksi.ksi_signo = sig; + ksi.ksi_code = SI_KERNEL; + SIGIO_LOCK(); sigio = *sigiop; if (sigio == NULL) { Modified: stable/8/sys/kern/tty.c ============================================================================== --- stable/8/sys/kern/tty.c Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/kern/tty.c Sat Dec 19 12:06:12 2009 (r200729) @@ -355,6 +355,7 @@ tty_wait_background(struct tty *tp, stru { struct proc *p = td->td_proc; struct pgrp *pg; + ksiginfo_t ksi; int error; MPASS(sig == SIGTTIN || sig == SIGTTOU); @@ -396,8 +397,14 @@ tty_wait_background(struct tty *tp, stru * Send the signal and sleep until we're the new * foreground process group. */ + if (sig != 0) { + ksiginfo_init(&ksi); + ksi.ksi_code = SI_KERNEL; + ksi.ksi_signo = sig; + sig = 0; + } PGRP_LOCK(pg); - pgsignal(pg, sig, 1); + pgsignal(pg, ksi.ksi_signo, 1, &ksi); PGRP_UNLOCK(pg); error = tty_wait(tp, &tp->t_bgwait); @@ -1223,6 +1230,8 @@ tty_signal_sessleader(struct tty *tp, in void tty_signal_pgrp(struct tty *tp, int sig) { + ksiginfo_t ksi; + tty_lock_assert(tp, MA_OWNED); MPASS(sig >= 1 && sig < NSIG); @@ -1232,8 +1241,11 @@ tty_signal_pgrp(struct tty *tp, int sig) if (sig == SIGINFO && !(tp->t_termios.c_lflag & NOKERNINFO)) tty_info(tp); if (tp->t_pgrp != NULL) { + ksiginfo_init(&ksi); + ksi.ksi_signo = sig; + ksi.ksi_code = SI_KERNEL; PGRP_LOCK(tp->t_pgrp); - pgsignal(tp->t_pgrp, sig, 1); + pgsignal(tp->t_pgrp, sig, 1, &ksi); PGRP_UNLOCK(tp->t_pgrp); } } Modified: stable/8/sys/sys/signal.h ============================================================================== --- stable/8/sys/sys/signal.h Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/sys/signal.h Sat Dec 19 12:06:12 2009 (r200729) @@ -338,6 +338,7 @@ struct sigaction { /* an asynchronous I/O request.*/ #define SI_MESGQ 0x10005 /* Signal generated by arrival of a */ /* message on an empty message queue. */ +#define SI_KERNEL 0x10006 #endif #if __BSD_VISIBLE #define SI_UNDEFINED 0 Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Sat Dec 19 11:50:04 2009 (r200728) +++ stable/8/sys/sys/signalvar.h Sat Dec 19 12:06:12 2009 (r200729) @@ -233,7 +233,8 @@ typedef struct ksiginfo { #define KSI_TRAP 0x01 /* Generated by trap. */ #define KSI_EXT 0x02 /* Externally managed ksi. */ #define KSI_INS 0x04 /* Directly insert ksi, not the copy */ -#define KSI_COPYMASK KSI_TRAP +#define KSI_SIGQ 0x08 /* Generated by sigqueue, might ret EGAIN. */ +#define KSI_COPYMASK (KSI_TRAP|KSI_SIGQ) #define KSI_ONQ(ksi) ((ksi)->ksi_sigq != NULL) @@ -326,10 +327,11 @@ extern int kern_logsigexit; /* Sysctl va */ int cursig(struct thread *td, int stop_allowed); void execsigs(struct proc *p); -void gsignal(int pgid, int sig); +void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); +void pksignal(struct proc *p, int sig, ksiginfo_t *ksi); void pgsigio(struct sigio **, int signum, int checkctty); -void pgsignal(struct pgrp *pgrp, int sig, int checkctty); +void pgsignal(struct pgrp *pgrp, int sig, int checkctty, ksiginfo_t *ksi); int postsig(int sig); void psignal(struct proc *p, int sig); int psignal_event(struct proc *p, struct sigevent *, ksiginfo_t *); From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 19:22:10 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C4D21065676; Sat, 19 Dec 2009 19:22:10 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0ABDB8FC17; Sat, 19 Dec 2009 19:22:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJJM9nB041417; Sat, 19 Dec 2009 19:22:09 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJJM9gJ041415; Sat, 19 Dec 2009 19:22:09 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912191922.nBJJM9gJ041415@svn.freebsd.org> From: Attilio Rao Date: Sat, 19 Dec 2009 19:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200734 - stable/8/lib/libfetch X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:22:10 -0000 Author: attilio Date: Sat Dec 19 19:22:09 2009 New Revision: 200734 URL: http://svn.freebsd.org/changeset/base/200734 Log: MFC r199801: Fix a socket leak. Sponsored by: Sandvine Incorporated Modified: stable/8/lib/libfetch/ftp.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/ftp.c ============================================================================== --- stable/8/lib/libfetch/ftp.c Sat Dec 19 19:01:24 2009 (r200733) +++ stable/8/lib/libfetch/ftp.c Sat Dec 19 19:22:09 2009 (r200734) @@ -1122,17 +1122,19 @@ ftp_request(struct url *url, const char /* change directory */ if (ftp_cwd(conn, url->doc) == -1) - return (NULL); + goto errsock; /* stat file */ if (us && ftp_stat(conn, url->doc, us) == -1 && fetchLastErrCode != FETCH_PROTO && fetchLastErrCode != FETCH_UNAVAIL) - return (NULL); + goto errsock; /* just a stat */ - if (strcmp(op, "STAT") == 0) + if (strcmp(op, "STAT") == 0) { + ftp_disconnect(conn); return (FILE *)1; /* bogus return value */ + } if (strcmp(op, "STOR") == 0 || strcmp(op, "APPE") == 0) oflag = O_WRONLY; else @@ -1140,6 +1142,10 @@ ftp_request(struct url *url, const char /* initiate the transfer */ return (ftp_transfer(conn, op, url->doc, oflag, url->offset, flags)); + +errsock: + ftp_disconnect(conn); + return (NULL); } /* From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 19:23:25 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B27A51065696; Sat, 19 Dec 2009 19:23:25 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A13AA8FC0A; Sat, 19 Dec 2009 19:23:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJJNPL0041486; Sat, 19 Dec 2009 19:23:25 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJJNPKo041484; Sat, 19 Dec 2009 19:23:25 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912191923.nBJJNPKo041484@svn.freebsd.org> From: Attilio Rao Date: Sat, 19 Dec 2009 19:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200735 - stable/8/lib/libtacplus X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:23:25 -0000 Author: attilio Date: Sat Dec 19 19:23:25 2009 New Revision: 200735 URL: http://svn.freebsd.org/changeset/base/200735 Log: MFC r199802: Fix handling of empty attributes. Sponsored by: Sandvine Incorporated Modified: stable/8/lib/libtacplus/taclib.c Directory Properties: stable/8/lib/libtacplus/ (props changed) Modified: stable/8/lib/libtacplus/taclib.c ============================================================================== --- stable/8/lib/libtacplus/taclib.c Sat Dec 19 19:22:09 2009 (r200734) +++ stable/8/lib/libtacplus/taclib.c Sat Dec 19 19:23:25 2009 (r200735) @@ -1263,8 +1263,13 @@ tac_get_av_value(struct tac_handle *h, c * h->srvr_avs[0] = "foobie=var1" * h->srvr_avs[1] = "foo=var2" * is handled. + * + * Note that for empty string attribute values a + * 0-length string is returned in order to distinguish + * against unset values. + * dump_str() will handle srvr.len == 0 correctly. */ - if (found_seperator == 1 && ch != end) { + if (found_seperator == 1) { srvr.len = end - ch; srvr.data = ch; return dup_str(h, &srvr, NULL); From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 19:25:35 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9552106568B; Sat, 19 Dec 2009 19:25:35 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 979228FC12; Sat, 19 Dec 2009 19:25:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJJPZJi041575; Sat, 19 Dec 2009 19:25:35 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJJPZWl041573; Sat, 19 Dec 2009 19:25:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912191925.nBJJPZWl041573@svn.freebsd.org> From: Attilio Rao Date: Sat, 19 Dec 2009 19:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200736 - stable/8/usr.bin/netstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:25:35 -0000 Author: attilio Date: Sat Dec 19 19:25:35 2009 New Revision: 200736 URL: http://svn.freebsd.org/changeset/base/200736 Log: MFC r199803: Add the possibility to show informations about dropped packets on the input path when showing interfaces informations. Sponsored by: Sandvine Incorporated Modified: stable/8/usr.bin/netstat/if.c Directory Properties: stable/8/usr.bin/netstat/ (props changed) Modified: stable/8/usr.bin/netstat/if.c ============================================================================== --- stable/8/usr.bin/netstat/if.c Sat Dec 19 19:23:25 2009 (r200735) +++ stable/8/usr.bin/netstat/if.c Sat Dec 19 19:25:35 2009 (r200736) @@ -198,6 +198,7 @@ intpr(int interval1, u_long ifnetaddr, v u_long imcasts; u_long oerrors; u_long ierrors; + u_long idrops; u_long collisions; short timer; int drops; @@ -225,8 +226,8 @@ intpr(int interval1, u_long ifnetaddr, v printf("%-7.7s", "Name"); else printf("%-5.5s", "Name"); - printf(" %5.5s %-13.13s %-17.17s %8.8s %5.5s", - "Mtu", "Network", "Address", "Ipkts", "Ierrs"); + printf(" %5.5s %-13.13s %-17.17s %8.8s %5.5s %5.5s", + "Mtu", "Network", "Address", "Ipkts", "Ierrs", "Idrop"); if (bflag) printf(" %10.10s","Ibytes"); printf(" %8.8s %5.5s", "Opkts", "Oerrs"); @@ -285,6 +286,7 @@ intpr(int interval1, u_long ifnetaddr, v imcasts = ifnet.if_imcasts; oerrors = ifnet.if_oerrors; ierrors = ifnet.if_ierrors; + idrops = ifnet.if_iqdrops; collisions = ifnet.if_collisions; timer = ifnet.if_timer; drops = ifnet.if_snd.ifq_drops; @@ -423,6 +425,7 @@ intpr(int interval1, u_long ifnetaddr, v show_stat("lu", 8, ipackets, link_layer|network_layer); show_stat("lu", 5, ierrors, link_layer); + show_stat("lu", 5, idrops, link_layer); if (bflag) show_stat("lu", 10, ibytes, link_layer|network_layer); @@ -513,6 +516,7 @@ struct iftot { char ift_name[IFNAMSIZ]; /* interface name */ u_long ift_ip; /* input packets */ u_long ift_ie; /* input errors */ + u_long ift_id; /* input drops */ u_long ift_op; /* output packets */ u_long ift_oe; /* output errors */ u_long ift_co; /* collisions */ @@ -598,8 +602,9 @@ banner: printf("%17s %14s %16s", "input", interesting ? interesting->ift_name : "(Total)", "output"); putchar('\n'); - printf("%10s %5s %10s %10s %5s %10s %5s", - "packets", "errs", "bytes", "packets", "errs", "bytes", "colls"); + printf("%10s %5s %5s %10s %10s %5s %10s %5s", + "packets", "errs", "idrops", "bytes", "packets", "errs", "bytes", + "colls"); if (dflag) printf(" %5.5s", "drops"); putchar('\n'); @@ -615,6 +620,7 @@ loop: if (!first) { show_stat("lu", 10, ifnet.if_ipackets - ip->ift_ip, 1); show_stat("lu", 5, ifnet.if_ierrors - ip->ift_ie, 1); + show_stat("lu", 5, ifnet.if_iqdrops - ip->ift_id, 1); show_stat("lu", 10, ifnet.if_ibytes - ip->ift_ib, 1); show_stat("lu", 10, ifnet.if_opackets - ip->ift_op, 1); show_stat("lu", 5, ifnet.if_oerrors - ip->ift_oe, 1); @@ -636,6 +642,7 @@ loop: } else { sum->ift_ip = 0; sum->ift_ie = 0; + sum->ift_id = 0; sum->ift_ib = 0; sum->ift_op = 0; sum->ift_oe = 0; @@ -651,6 +658,7 @@ loop: } sum->ift_ip += ifnet.if_ipackets; sum->ift_ie += ifnet.if_ierrors; + sum->ift_id += ifnet.if_iqdrops; sum->ift_ib += ifnet.if_ibytes; sum->ift_op += ifnet.if_opackets; sum->ift_oe += ifnet.if_oerrors; @@ -662,6 +670,7 @@ loop: if (!first) { show_stat("lu", 10, sum->ift_ip - total->ift_ip, 1); show_stat("lu", 5, sum->ift_ie - total->ift_ie, 1); + show_stat("lu", 5, sum->ift_id - total->ift_id, 1); show_stat("lu", 10, sum->ift_ib - total->ift_ib, 1); show_stat("lu", 10, sum->ift_op - total->ift_op, 1); show_stat("lu", 5, sum->ift_oe - total->ift_oe, 1); From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 19:30:28 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A301065670; Sat, 19 Dec 2009 19:30:28 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8638FC16; Sat, 19 Dec 2009 19:30:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJJUS9j041735; Sat, 19 Dec 2009 19:30:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJJURq4041730; Sat, 19 Dec 2009 19:30:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912191930.nBJJURq4041730@svn.freebsd.org> From: Attilio Rao Date: Sat, 19 Dec 2009 19:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200737 - stable/8/usr.bin/gcore X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:30:28 -0000 Author: attilio Date: Sat Dec 19 19:30:27 2009 New Revision: 200737 URL: http://svn.freebsd.org/changeset/base/200737 Log: MFC r199805: Change gcore in order to get rid of the procfs support and use FreeBSD's specific interfaces. Main changes: - now gcore recognizes threads within the the process and handle dumps on a thread scope - the process to be analyzed should be stopped while gcore runs - gcore may not work with processes that are being debugged with gdb or truss - ptrace may let interruptible calls to return EINTR, thus dirtying signals handling within the process Sponsored by: Sandvine Incorporated Modified: stable/8/usr.bin/gcore/Makefile stable/8/usr.bin/gcore/elfcore.c stable/8/usr.bin/gcore/gcore.1 stable/8/usr.bin/gcore/gcore.c Directory Properties: stable/8/usr.bin/gcore/ (props changed) Modified: stable/8/usr.bin/gcore/Makefile ============================================================================== --- stable/8/usr.bin/gcore/Makefile Sat Dec 19 19:25:35 2009 (r200736) +++ stable/8/usr.bin/gcore/Makefile Sat Dec 19 19:30:27 2009 (r200737) @@ -1,6 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +LDADD+= -lutil PROG= gcore SRCS= elfcore.c gcore.c Modified: stable/8/usr.bin/gcore/elfcore.c ============================================================================== --- stable/8/usr.bin/gcore/elfcore.c Sat Dec 19 19:25:35 2009 (r200736) +++ stable/8/usr.bin/gcore/elfcore.c Sat Dec 19 19:30:27 2009 (r200737) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2007 Sandvine Incorporated * Copyright (c) 1998 John D. Polstra * All rights reserved. * @@ -29,8 +30,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include +#include +#include #include #include #include @@ -44,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "extern.h" @@ -69,16 +75,15 @@ static void cb_put_phdr(vm_map_entry_t, static void cb_size_segment(vm_map_entry_t, void *); static void each_writable_segment(vm_map_entry_t, segment_callback, void *closure); -static void elf_corehdr(int fd, pid_t, vm_map_entry_t, int numsegs, - void *hdr, size_t hdrsize); -static void elf_puthdr(vm_map_entry_t, void *, size_t *, - const prstatus_t *, const prfpregset_t *, const prpsinfo_t *, int numsegs); +static void elf_detach(void); /* atexit() handler. */ +static void elf_puthdr(pid_t, vm_map_entry_t, void *, size_t *, int numsegs); static void elf_putnote(void *dst, size_t *off, const char *name, int type, const void *desc, size_t descsz); static void freemap(vm_map_entry_t); -static void readhdrinfo(pid_t, prstatus_t *, prfpregset_t *, prpsinfo_t *); static vm_map_entry_t readmap(pid_t); +static pid_t g_pid; /* Pid being dumped, global for elf_detach */ + static int elf_ident(int efd, pid_t pid __unused, char *binfile __unused) { @@ -93,6 +98,14 @@ elf_ident(int efd, pid_t pid __unused, c return (0); } +static void +elf_detach(void) +{ + + if (g_pid != 0) + ptrace(PT_DETACH, g_pid, (caddr_t)1, 0); +} + /* * Write an ELF coredump for the given pid to the given fd. */ @@ -103,11 +116,20 @@ elf_coredump(int efd __unused, int fd, p struct sseg_closure seginfo; void *hdr; size_t hdrsize; - char memname[64]; - int memfd; Elf_Phdr *php; int i; + /* Attach to process to dump. */ + g_pid = pid; + if (atexit(elf_detach) != 0) + err(1, "atexit"); + errno = 0; + ptrace(PT_ATTACH, pid, NULL, 0); + if (errno) + err(1, "PT_ATTACH"); + if (waitpid(pid, NULL, 0) == -1) + err(1, "waitpid"); + /* Get the program's memory map. */ map = readmap(pid); @@ -122,28 +144,31 @@ elf_coredump(int efd __unused, int fd, p * size is calculated. */ hdrsize = 0; - elf_puthdr(map, (void *)NULL, &hdrsize, - (const prstatus_t *)NULL, (const prfpregset_t *)NULL, - (const prpsinfo_t *)NULL, seginfo.count); + elf_puthdr(pid, map, NULL, &hdrsize, seginfo.count); /* * Allocate memory for building the header, fill it up, * and write it out. */ - if ((hdr = malloc(hdrsize)) == NULL) + if ((hdr = calloc(1, hdrsize)) == NULL) errx(1, "out of memory"); - elf_corehdr(fd, pid, map, seginfo.count, hdr, hdrsize); - /* Write the contents of all of the writable segments. */ - snprintf(memname, sizeof memname, "/proc/%d/mem", pid); - if ((memfd = open(memname, O_RDONLY)) == -1) - err(1, "cannot open %s", memname); + /* Fill in the header. */ + hdrsize = 0; + elf_puthdr(pid, map, hdr, &hdrsize, seginfo.count); + + /* Write it to the core file. */ + if (write(fd, hdr, hdrsize) == -1) + err(1, "write"); + /* Write the contents of all of the writable segments. */ php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; for (i = 0; i < seginfo.count; i++) { + struct ptrace_io_desc iorequest; uintmax_t nleft = php->p_filesz; - lseek(memfd, (off_t)php->p_vaddr, SEEK_SET); + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (caddr_t)php->p_vaddr; while (nleft > 0) { char buf[8*1024]; size_t nwant; @@ -153,12 +178,12 @@ elf_coredump(int efd __unused, int fd, p nwant = sizeof buf; else nwant = nleft; - ngot = read(memfd, buf, nwant); - if (ngot == -1) - err(1, "read from %s", memname); + iorequest.piod_addr = buf; + iorequest.piod_len = nwant; + ptrace(PT_IO, pid, (caddr_t)&iorequest, 0); + ngot = iorequest.piod_len; if ((size_t)ngot < nwant) - errx(1, "short read from %s:" - " wanted %zu, got %zd", memname, + errx(1, "short read wanted %d, got %d", nwant, ngot); ngot = write(fd, buf, nwant); if (ngot == -1) @@ -166,10 +191,10 @@ elf_coredump(int efd __unused, int fd, p if ((size_t)ngot != nwant) errx(1, "short write"); nleft -= nwant; + iorequest.piod_offs += ngot; } php++; } - close(memfd); free(hdr); freemap(map); } @@ -231,30 +256,25 @@ each_writable_segment(vm_map_entry_t map (*func)(entry, closure); } -/* - * Write the core file header to the file, including padding up to - * the page boundary. - */ static void -elf_corehdr(int fd, pid_t pid, vm_map_entry_t map, int numsegs, void *hdr, - size_t hdrsize) +elf_getstatus(pid_t pid, prpsinfo_t *psinfo) { - size_t off; - prstatus_t status; - prfpregset_t fpregset; - prpsinfo_t psinfo; - - /* Gather the information for the header. */ - readhdrinfo(pid, &status, &fpregset, &psinfo); - - /* Fill in the header. */ - memset(hdr, 0, hdrsize); - off = 0; - elf_puthdr(map, hdr, &off, &status, &fpregset, &psinfo, numsegs); - - /* Write it to the core file. */ - if (write(fd, hdr, hdrsize) == -1) - err(1, "write"); + struct kinfo_proc kobj; + int name[4]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PID; + name[3] = pid; + + len = sizeof(kobj); + if (sysctl(name, 4, &kobj, &len, NULL, 0) == -1) + err(1, "error accessing kern.proc.pid.%u sysctl", pid); + if (kobj.ki_pid != pid) + err(1, "error accessing kern.proc.pid.%u sysctl datas", pid); + strncpy(psinfo->pr_fname, kobj.ki_comm, MAXCOMLEN); + strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); } /* @@ -262,13 +282,24 @@ elf_corehdr(int fd, pid_t pid, vm_map_en * be NULL, in which case the header is sized but not actually generated. */ static void -elf_puthdr(vm_map_entry_t map, void *dst, size_t *off, const prstatus_t *status, - const prfpregset_t *fpregset, const prpsinfo_t *psinfo, int numsegs) +elf_puthdr(pid_t pid, vm_map_entry_t map, void *dst, size_t *off, int numsegs) { + struct { + prstatus_t status; + prfpregset_t fpregset; + prpsinfo_t psinfo; + } *tempdata; size_t ehoff; size_t phoff; size_t noteoff; size_t notesz; + size_t threads; + lwpid_t *tids; + int i; + + prstatus_t *status; + prfpregset_t *fpregset; + prpsinfo_t *psinfo; ehoff = *off; *off += sizeof(Elf_Ehdr); @@ -277,14 +308,68 @@ elf_puthdr(vm_map_entry_t map, void *dst *off += (numsegs + 1) * sizeof(Elf_Phdr); noteoff = *off; - elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, - sizeof *status); - elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, - sizeof *fpregset); + + if (dst != NULL) { + if ((tempdata = calloc(1, sizeof(*tempdata))) == NULL) + errx(1, "out of memory"); + status = &tempdata->status; + fpregset = &tempdata->fpregset; + psinfo = &tempdata->psinfo; + } else { + tempdata = NULL; + status = NULL; + fpregset = NULL; + psinfo = NULL; + } + + errno = 0; + threads = ptrace(PT_GETNUMLWPS, pid, NULL, 0); + if (errno) + err(1, "PT_GETNUMLWPS"); + + if (dst != NULL) { + psinfo->pr_version = PRPSINFO_VERSION; + psinfo->pr_psinfosz = sizeof(prpsinfo_t); + elf_getstatus(pid, psinfo); + + } elf_putnote(dst, off, "FreeBSD", NT_PRPSINFO, psinfo, sizeof *psinfo); + + if (dst != NULL) { + tids = malloc(threads * sizeof(*tids)); + if (tids == NULL) + errx(1, "out of memory"); + errno = 0; + ptrace(PT_GETLWPLIST, pid, (void *)tids, threads); + if (errno) + err(1, "PT_GETLWPLIST"); + } + for (i = 0; i < threads; ++i) { + if (dst != NULL) { + status->pr_version = PRSTATUS_VERSION; + status->pr_statussz = sizeof(prstatus_t); + status->pr_gregsetsz = sizeof(gregset_t); + status->pr_fpregsetsz = sizeof(fpregset_t); + status->pr_osreldate = __FreeBSD_version; + status->pr_pid = tids[i]; + + ptrace(PT_GETREGS, tids[i], (void *)&status->pr_reg, 0); + ptrace(PT_GETFPREGS, tids[i], (void *)fpregset, 0); + } + elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, + sizeof *status); + elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, + sizeof *fpregset); + } + notesz = *off - noteoff; + if (dst != NULL) { + free(tids); + free(tempdata); + } + /* Align up to a page boundary for the program segments. */ *off = round_page(*off); @@ -381,70 +466,7 @@ freemap(vm_map_entry_t map) } /* - * Read the process information necessary to fill in the core file's header. - */ -static void -readhdrinfo(pid_t pid, prstatus_t *status, prfpregset_t *fpregset, - prpsinfo_t *psinfo) -{ - char name[64]; - char line[256]; - int fd; - int i; - int n; - - memset(status, 0, sizeof *status); - status->pr_version = PRSTATUS_VERSION; - status->pr_statussz = sizeof(prstatus_t); - status->pr_gregsetsz = sizeof(gregset_t); - status->pr_fpregsetsz = sizeof(fpregset_t); - status->pr_osreldate = __FreeBSD_version; - status->pr_pid = pid; - - memset(fpregset, 0, sizeof *fpregset); - - memset(psinfo, 0, sizeof *psinfo); - psinfo->pr_version = PRPSINFO_VERSION; - psinfo->pr_psinfosz = sizeof(prpsinfo_t); - - /* Read the general registers. */ - snprintf(name, sizeof name, "/proc/%d/regs", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, &status->pr_reg, sizeof status->pr_reg)) == -1) - err(1, "read error from %s", name); - if ((size_t)n < sizeof(status->pr_reg)) - errx(1, "short read from %s: wanted %zu, got %d", name, - sizeof status->pr_reg, n); - close(fd); - - /* Read the floating point registers. */ - snprintf(name, sizeof name, "/proc/%d/fpregs", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, fpregset, sizeof *fpregset)) == -1) - err(1, "read error from %s", name); - if ((size_t)n < sizeof(*fpregset)) - errx(1, "short read from %s: wanted %zu, got %d", name, - sizeof *fpregset, n); - close(fd); - - /* Read and parse the process status. */ - snprintf(name, sizeof name, "/proc/%d/status", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, line, sizeof line - 1)) == -1) - err(1, "read error from %s", name); - if (n > MAXCOMLEN) - n = MAXCOMLEN; - for (i = 0; i < n && line[i] != ' '; i++) - psinfo->pr_fname[i] = line[i]; - strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); - close(fd); -} - -/* - * Read the process's memory map using procfs, and return a list of + * Read the process's memory map using kinfo_getvmmap(), and return a list of * VM map entries. Only the non-device read/writable segments are * returned. The map entries in the list aren't fully filled in; only * the items we need are present. @@ -452,83 +474,44 @@ readhdrinfo(pid_t pid, prstatus_t *statu static vm_map_entry_t readmap(pid_t pid) { - char mapname[64]; - int mapfd; - ssize_t mapsize; - size_t bufsize; - char *mapbuf; - int pos; - vm_map_entry_t map; - vm_map_entry_t *linkp; - - snprintf(mapname, sizeof mapname, "/proc/%d/map", pid); - if ((mapfd = open(mapname, O_RDONLY)) == -1) - err(1, "cannot open %s", mapname); + vm_map_entry_t ent, *linkp, map; + struct kinfo_vmentry *vmentl, *kve; + int i, nitems; + + vmentl = kinfo_getvmmap(pid, &nitems); + if (vmentl == NULL) + err(1, "cannot retrieve mappings for %u process", pid); - /* - * Procfs requires (for consistency) that the entire memory map - * be read with a single read() call. Start with a reasonably sized - * buffer, and double it until it is big enough. - */ - bufsize = 8 * 1024; - mapbuf = NULL; - for ( ; ; ) { - if ((mapbuf = realloc(mapbuf, bufsize + 1)) == NULL) - errx(1, "out of memory"); - mapsize = read(mapfd, mapbuf, bufsize); - if (mapsize != -1 || errno != EFBIG) - break; - bufsize *= 2; - /* This lseek shouldn't be necessary, but it is. */ - lseek(mapfd, (off_t)0, SEEK_SET); - } - if (mapsize == -1) - err(1, "read error from %s", mapname); - if (mapsize == 0) - errx(1, "empty map file %s", mapname); - mapbuf[mapsize] = 0; - close(mapfd); - - pos = 0; map = NULL; linkp = ↦ - while (pos < mapsize) { - vm_map_entry_t ent; - u_long start; - u_long end; - char prot[4]; - char type[16]; - int n; - int len; - - len = 0; - n = sscanf(mapbuf + pos, "%lx %lx %*d %*d %*x %3[-rwx]" - " %*d %*d %*x %*s %*s %16s %*s%*[\n]%n", - &start, &end, prot, type, &len); - if (n != 4 || len == 0) - errx(1, "ill-formed line in %s starting at character %d", mapname, pos + 1); - pos += len; - - /* Ignore segments of the wrong kind, and unwritable ones */ - if (strncmp(prot, "rw", 2) != 0 || - (strcmp(type, "default") != 0 && - strcmp(type, "vnode") != 0 && - strcmp(type, "swap") != 0)) + for (i = 0; i < nitems; i++) { + kve = &vmentl[i]; + + /* + * Ignore segments of the wrong kind and ones which are not + * readable and writable. + */ + if ((kve->kve_protection & KVME_PROT_WRITE) == 0 || + (kve->kve_protection & KVME_PROT_READ) == 0 || + (kve->kve_type != KVME_TYPE_DEFAULT && + kve->kve_type != KVME_TYPE_VNODE && + kve->kve_type != KVME_TYPE_SWAP)) continue; - if ((ent = (vm_map_entry_t)calloc(1, sizeof *ent)) == NULL) + ent = calloc(1, sizeof(*ent)); + if (ent == NULL) errx(1, "out of memory"); - ent->start = start; - ent->end = end; + ent->start = (vm_offset_t)kve->kve_start; + ent->end = (vm_offset_t)kve->kve_end; ent->protection = VM_PROT_READ | VM_PROT_WRITE; - if (prot[2] == 'x') - ent->protection |= VM_PROT_EXECUTE; + if ((kve->kve_protection & KVME_PROT_EXEC) != 0) + ent->protection |= VM_PROT_EXECUTE; *linkp = ent; linkp = &ent->next; } - free(mapbuf); - return map; + free(vmentl); + return (map); } struct dumpers elfdump = { elf_ident, elf_coredump }; Modified: stable/8/usr.bin/gcore/gcore.1 ============================================================================== --- stable/8/usr.bin/gcore/gcore.1 Sat Dec 19 19:25:35 2009 (r200736) +++ stable/8/usr.bin/gcore/gcore.1 Sat Dec 19 19:30:27 2009 (r200737) @@ -32,7 +32,7 @@ .\" @(#)gcore.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd April 18, 1994 +.Dd November 18, 2009 .Dt GCORE 1 .Os .Sh NAME @@ -55,11 +55,6 @@ By default, the core is written to the f The process identifier, .Ar pid , must be given on the command line. -If no executable image is -specified, -.Nm -will use -.Dq Pa /proc//file . .Pp The following options are available: .Bl -tag -width indent @@ -80,8 +75,6 @@ The same effect can be achieved manually .Bl -tag -width /var/log/messages -compact .It Pa core. the core image -.It Pa /proc//file -the executable image .El .Sh HISTORY A @@ -89,12 +82,15 @@ A utility appeared in .Bx 4.2 . .Sh BUGS -Context switches or paging activity that occur while -.Nm -is running may cause the program to become confused. -For best results, use -.Fl s -to temporarily stop the target process. +Because of the +.Xr ptrace 2 +usage +.Nm +may not work with processes which are actively investigated with +.Xr truss 1 +or +.Xr gdb 1 . +Additionally, interruptable sleeps may exit with EINTR. .Pp The .Nm Modified: stable/8/usr.bin/gcore/gcore.c ============================================================================== --- stable/8/usr.bin/gcore/gcore.c Sat Dec 19 19:25:35 2009 (r200736) +++ stable/8/usr.bin/gcore/gcore.c Sat Dec 19 19:30:27 2009 (r200737) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -83,10 +84,11 @@ SET_DECLARE(dumpset, struct dumpers); int main(int argc, char *argv[]) { - int ch, efd, fd, sflag; + int ch, efd, fd, name[4], sflag; char *binfile, *corefile; - char fname[MAXPATHLEN]; + char passpath[MAXPATHLEN], fname[MAXPATHLEN]; struct dumpers **d, *dumper; + size_t len; sflag = 0; corefile = NULL; @@ -109,9 +111,14 @@ main(int argc, char *argv[]) switch (argc) { case 1: pid = atoi(argv[0]); - asprintf(&binfile, "/proc/%d/file", pid); - if (binfile == NULL) - errx(1, "allocation failure"); + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PATHNAME; + name[3] = pid; + len = sizeof(passpath); + if (sysctl(name, 4, passpath, &len, NULL, 0) == -1) + errx(1, "kern.proc.pathname failure"); + binfile = passpath; break; case 2: pid = atoi(argv[1]); From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 19:35:53 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 869C0106568F; Sat, 19 Dec 2009 19:35:53 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73AE58FC19; Sat, 19 Dec 2009 19:35:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJJZr0x041929; Sat, 19 Dec 2009 19:35:53 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJJZr2H041924; Sat, 19 Dec 2009 19:35:53 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912191935.nBJJZr2H041924@svn.freebsd.org> From: Attilio Rao Date: Sat, 19 Dec 2009 19:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200738 - in stable/8: crypto/openssh usr.sbin/cron/cron usr.sbin/inetd usr.sbin/syslogd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:35:53 -0000 Author: attilio Date: Sat Dec 19 19:35:53 2009 New Revision: 200738 URL: http://svn.freebsd.org/changeset/base/200738 Log: MFC r199804: Avoid sshd, crond, inetd and syslogd to be killed in an high-pressure swapping environment. Sponsored by: Sandvine Incorporated Modified: stable/8/crypto/openssh/sshd.c stable/8/usr.sbin/cron/cron/cron.c stable/8/usr.sbin/inetd/inetd.c stable/8/usr.sbin/syslogd/syslogd.c Directory Properties: stable/8/crypto/openssh/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) Modified: stable/8/crypto/openssh/sshd.c ============================================================================== --- stable/8/crypto/openssh/sshd.c Sat Dec 19 19:30:27 2009 (r200737) +++ stable/8/crypto/openssh/sshd.c Sat Dec 19 19:35:53 2009 (r200738) @@ -47,6 +47,7 @@ __RCSID("$FreeBSD$"); #include #include +#include #include #ifdef HAVE_SYS_STAT_H # include @@ -1292,6 +1293,10 @@ main(int ac, char **av) /* Initialize configuration options to their default values. */ initialize_server_options(&options); + /* Avoid killing the process in high-pressure swapping environments. */ + if (madvise(NULL, 0, MADV_PROTECT) != 0) + debug("madvise(): %.200s", strerror(errno)); + /* Parse command-line arguments. */ while ((opt = getopt(ac, av, "f:p:b:k:h:g:u:o:C:dDeiqrtQRT46")) != -1) { switch (opt) { Modified: stable/8/usr.sbin/cron/cron/cron.c ============================================================================== --- stable/8/usr.sbin/cron/cron/cron.c Sat Dec 19 19:30:27 2009 (r200737) +++ stable/8/usr.sbin/cron/cron/cron.c Sat Dec 19 19:35:53 2009 (r200738) @@ -24,6 +24,7 @@ static const char rcsid[] = #include "cron.h" +#include #include #if SYS_TIME_H # include @@ -134,6 +135,9 @@ main(argc, argv) } } + if (madvise(NULL, 0, MADV_PROTECT) != 0) + log_it("CRON", getpid(), "WARNING", "madvise() failed"); + pidfile_write(pfh); database.head = NULL; database.tail = NULL; Modified: stable/8/usr.sbin/inetd/inetd.c ============================================================================== --- stable/8/usr.sbin/inetd/inetd.c Sat Dec 19 19:30:27 2009 (r200737) +++ stable/8/usr.sbin/inetd/inetd.c Sat Dec 19 19:35:53 2009 (r200738) @@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$"); */ #include #include +#include #include #include #include @@ -497,6 +498,9 @@ main(int argc, char **argv) } } + if (madvise(NULL, 0, MADV_PROTECT) != 0) + syslog(LOG_WARNING, "madvise() failed: %s", strerror(errno)); + for (i = 0; i < PERIPSIZE; ++i) LIST_INIT(&proctable[i]); Modified: stable/8/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/8/usr.sbin/syslogd/syslogd.c Sat Dec 19 19:30:27 2009 (r200737) +++ stable/8/usr.sbin/syslogd/syslogd.c Sat Dec 19 19:35:53 2009 (r200738) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -352,6 +353,9 @@ main(int argc, char *argv[]) pid_t ppid = 1, spid; socklen_t len; + if (madvise(NULL, 0, MADV_PROTECT) != 0) + dprintf("madvise() failed: %s\n", strerror(errno)); + bindhostname = NULL; while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nop:P:sS:Tuv")) != -1) From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 19 20:50:49 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26085106568F; Sat, 19 Dec 2009 20:50:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14A388FC26; Sat, 19 Dec 2009 20:50:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJKomU1043516; Sat, 19 Dec 2009 20:50:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJKomEA043514; Sat, 19 Dec 2009 20:50:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912192050.nBJKomEA043514@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Dec 2009 20:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200741 - stable/8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 20:50:49 -0000 Author: kib Date: Sat Dec 19 20:50:48 2009 New Revision: 200741 URL: http://svn.freebsd.org/changeset/base/200741 Log: MFC r198538: Move pselect(3) man page to section 2. Modified: stable/8/ObsoleteFiles.inc (contents, props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Sat Dec 19 20:45:23 2009 (r200740) +++ stable/8/ObsoleteFiles.inc Sat Dec 19 20:50:48 2009 (r200741) @@ -16,6 +16,8 @@ # 20091218: removal of rc.early(8) link OLD_FILES+=usr/share/man/man8/rc.early.8.gz +# 20091027: pselect.3 implemented as syscall +OLD_FILES+=usr/share/man/man3/pselect.3.gz # 20090904: remove lukemftpd OLD_FILES+=usr/libexec/lukemftpd OLD_FILES+=usr/share/man/man5/ftpd.conf.5.gz