Compare commits

...
Author SHA1 Message Date
Glen Barber 657eb59810 Update releng/10.2 to -RELEASE status, and prepare for final
10.2-RELEASE builds.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-12 14:17:41 +00:00
Glen Barber 7be98fc39b Anticipate the expected 10.2-RELEASE date.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-12 14:08:06 +00:00
Glen Barber 570ccb4f1e Set static abitag to the current value of __FreeBSD_version.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-12 14:02:56 +00:00
Glen Barber c79d446a91 Update releng/10.2 to RC2 in preparation for the next set of builds.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-06 22:01:09 +00:00
Xin LI 01353e2a2c MFS r286384: MFC r286375:
Now that stable/8 is EOL, stop building INDEX-8.

Approved by:	re (gjb)
2015-08-06 19:52:28 +00:00
Glen Barber b3f0a45570 Fix a typo.
Submitted by:	pkelsey
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-06 14:13:44 +00:00
Glen Barber 1bffa67872 MFS r286340 (bapt):
Fix segfault in pw(8) when modifying the UID of
  a user.

PR:		202111
Approved by:	re (delphij)
Sponsored by:	The FreeBSD Foundation
2015-08-06 01:39:23 +00:00
Glen Barber 88b2998919 Document SA-15:18, SA-15:19.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-05 22:31:41 +00:00
Xin LI 13ffe15f87 Fix patch(1) shell injection vulnerability via ed(1). [SA-15:18]
Fix routed remote denial of service vulnerability. [SA-15:19]

Approved by:	re (so blanket)
2015-08-05 22:05:12 +00:00
Glen Barber 711155282a Switch the pkg(8) repository to use the release package set
to populate dvd1.iso.

This is a direct commit to releng/10.2.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-05 19:56:23 +00:00
Edward Tomasz Napierala 7eee39f5c6 MFS r286322:
Make the kern.racct.enable tunable actually work.

This is a direct commit to 10-STABLE - 11-CURRENT is not affected,
because tunables are automatically fetched there.

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2015-08-05 16:58:04 +00:00
Glen Barber 88aeaa9419 Cleanup pass through the relnotes file:
- Reword a few entries for consistency throughout the document.
- Remove the 'role="arm"' from the arm-specific section, as it
  is redundant.
- s/&man.geom.4;/GEOM/ in a title, because it looks ridiculous.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-04 19:43:48 +00:00
Glen Barber f28c7f02dc MFS r286286:
MFC r286285:
 Ensure the local MANIFEST is always used when verifying remote
 distribution sets.

Approved by:	re (glebius)
Sponsored by:	The FreeBSD Foundation
2015-08-04 13:42:44 +00:00
Konstantin Belousov c1930470fa MFC r285878 (stable/10 r286145):
Revert r173708's modifications to vm_object_page_remove().
This fixes inconsistencies encountered by vm_object_unwire() or
by the buffer cache when the file is truncated.

Approved by:	re (gjb)
2015-08-04 05:18:24 +00:00
Warner Losh d2cabdbe3f MF-stable/10 r286263:
Only match devices that belong to this driver.
Approved by:	re@ (gjb@)
2015-08-04 00:11:38 +00:00
Glen Barber dedc865338 Remove another stray empty section.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-03 19:08:47 +00:00
Glen Barber 3529d36108 Fix a whitespace nit.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-03 19:08:45 +00:00
Glen Barber 510368b3eb Remove a few empty sections.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-03 19:08:43 +00:00
Glen Barber c10769881b Add a ports-versions section.
Document a few interesting package versions for 10.2-RELEASE.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-03 19:08:40 +00:00
Glen Barber 3554c60c1e Document r283990, mpr(4) updated to version 9.255.01.00-fbsd.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-03 19:08:38 +00:00
Glen Barber d6976bba8f Document r284935, hptnr(4) updated to version 1.1.4.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-03 19:08:35 +00:00
Glen Barber d0d645a964 Document r284879, htp27xx(4) updated to version 1.2.7.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-03 19:08:33 +00:00
Glen Barber 55e9fe578b Document r281963, snd_hda(4) support for ThinkPad X1 20BS model.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-03 19:08:31 +00:00
Glen Barber dbbb095574 Document r278407, r279924, uart(4) updates for ThinkPad AMT
serial devices.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-08-03 19:08:29 +00:00
Glen Barber e51fe428c0 Forced commit to mark the real 10.2-RC2 point.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-31 16:46:30 +00:00
Glen Barber 1b85e15826 MFS r286132:
MFC r286131:
 Pull pmspcv (pms(4)) from GENERIC.  It has PCI ID conflicts
 with ahd(4), mvs(4), and likely other drivers.

Approved by:	re (implicit, release blocker)
Sponsored by:	The FreeBSD Foundation
2015-07-31 16:44:57 +00:00
Glen Barber d949e56827 Update releng/10.2 to RC2 in preparation for the next set of builds.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-31 00:00:59 +00:00
Glen Barber 7c43c220cc Document r286084, tar(1) sparse file fix.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-30 23:58:55 +00:00
Glen Barber af837691de Document r285830, specifically that the default pkg(8) repository
was switched from 'latest' to 'quarterly' for 10.2-RELEASE.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-30 23:58:53 +00:00
Bryan Drewery f17781a883 MFS r286082:
MFC r285972:

    MFV r285970:

      Apply upstream changeset bf4f6ec64e:

      Fix issue 356: properly skip a sparse file entry in a tar file.

PR:		201506
Relnotes:	yes
Approved by:	re (gjb)
2015-07-30 18:00:37 +00:00
Glen Barber 8fdb8a30cd MFS 286079:
MFC r285999 (kp):
  pf: Always initialise pf_fragment.fr_flags

  When we allocate the struct pf_fragment in pf_fillup_fragment() we
  forgot to initialise the fr_flags field. As a result we sometimes
  mistakenly thought the fragment to not be a buffered fragment.
  This resulted in panics because we'd end up freeing the pf_fragment
  but not removing it from V_pf_fragqueue (believing it to be part of
  V_pf_cachequeue).  The next time we iterated V_pf_fragqueue we'd use
  a freed object and panic.

  While here also fix a pf_fragment use after free in pf_normalize_ip().
  pf_reassemble() frees the pf_fragment, so we can't use it any more.

Approved by:	re (glebius)
Sponsored by:	The FreeBSD Foundation
2015-07-30 17:06:28 +00:00
Marius Strobl 17154057bb MFC: r285843 (r286059 in stable/10)
- Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signaling
  uart_bus_attach() during its test that 20 iterations weren't sufficient
  for clearing all pending interrupts, assuming this means that hardware
  is broken and doesn't deassert interrupts. However, under pressure, 20
  iterations also can be insufficient for clearing all pending interrupts,
  leading to a panic as intr_event_handle() tries to schedule an interrupt
  handler not registered. Solve this by introducing a flag that is set in
  test mode and otherwise restores pre-r253161 behavior of uart_intr(). The
  approach of additionally registering uart_intr() as handler as suggested
  in PR 194979 is not taken as that in turn would abuse special pccard and
  pccbb handling code of intr_event_handle(). [1]
- Const'ify uart_driver_name.
- Fix some minor style bugs.

PR:		194979 [1]
Reviewed by:	marcel (earlier version)
Approved by:	re (gjb)
2015-07-30 03:06:11 +00:00
Marius Strobl 48d5f14b84 MFC: r285839 (r286055 in stable/10)
o Revert the other functional half of r239864, i. e. the merge of r134227
  from x86 to use smp_ipi_mtx spin lock not only for smp_rendezvous_cpus()
  but also for the MD cache invalidation, TLB demapping and remote register
  reading IPIs due to the following reasons:
  - The cross-IPI SMP deadlock x86 otherwise is subject to can't happen on
    sparc64. That's because on sparc64, spin locks don't disable interrupts
    completely but only raise the processor interrupt level to PIL_TICK. This
    means that IPIs still get delivered and direct dispatch IPIs such as the
    cache invalidation etc. IPIs in question are still executed.
  - In smp_rendezvous_cpus(), smp_ipi_mtx is held not only while sending an
    IPI_RENDEZVOUS, but until all CPUs have processed smp_rendezvous_action().
    Consequently, smp_ipi_mtx may be locked for an extended amount of time as
    queued IPIs (as opposed to the direct ones) such as IPI_RENDEZVOUS are
    scheduled via a soft interrupt. Moreover, given that this soft interrupt
    is only delivered at PIL_RENDEZVOUS, processing of smp_rendezvous_action()
    on a target may be interrupted by f. e. a tick interrupt at PIL_TICK, in
    turn leading to the target in question trying to send an IPI by itself
    while IPI_RENDEZVOUS isn't fully handled, yet, and, thus, resulting in a
    deadlock.
o As mentioned in the commit message of r245850, on least some sun4u platforms
  concurrent sending of IPIs by different CPUs is fatal. Therefore, hold the
  reintroduced MD ipi_mtx also while delivering cross-traps via MI helpers,
  i. e. ipi_{all_but_self,cpu,selected}().
o Akin to x86, let the last CPU to process cpu_mp_bootstrap() set smp_started
  instead of the BSP in cpu_mp_unleash(). This ensures that all APs actually
  are started, when smp_started is no longer 0.
o In all MD and MI IPI helpers, check for smp_started == 1 rather than for
  smp_cpus > 1 or nothing at all. This avoids races during boot causing IPIs
  trying to be delivered to APs that in fact aren't up and running, yet.
  While at it, move setting of the cpu_ipi_{selected,single}() pointers to
  the appropriate delivery functions from mp_init() to cpu_mp_start() where
  it's better suited and allows to get rid of the global isjbus variable.
o Given that now concurrent IPI delivery no longer is possible, also nuke
  the delays before completely disabling interrupts again in the CPU-specific
  cross-trap delivery functions, previously giving other CPUs a window for
  sending IPIs on their part. Actually, we now should be able to entirely get
  rid of completely disabling interrupts in these functions. Such a change
  needs more testing, though.
o In {s,}tick_get_timecount_mp(), make the {s,}tick variable static. While not
  necessary for correctness, this avoids page faults when accessing the stack
  of a foreign CPU as {s,}tick now is locked into the TLBs as part of static
  kernel data. Hence, {s,}tick_get_timecount_mp() always execute as fast as
  possible, avoiding jitter.

PR:		201245
Approved by:	re (gjb)
2015-07-30 02:45:35 +00:00
Wei Hu b2350b85d0 MFC r285928 Do not enable UDP checksum offloading when running on the
Hyper-V on Windows Server 2012 and earlier hosts.

Submitted by: whu
Reviewed by: royger
Approved by: re (gjb)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D3102
2015-07-30 02:22:38 +00:00
Glen Barber 912427ec2e Set the default VHD file format to the fixed-size image for the
10.2-RELEASE, as the issue preventing the dynamic-size image from
booting is not yet resolved.

This is a direct commit to releng/10.2.

Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2015-07-29 23:34:38 +00:00
Glen Barber a3997f1fd7 Add ixl(4) to the hardware notes.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-29 20:17:29 +00:00
Glen Barber ff9ee7fe0f Update copyright after r286023.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-29 20:17:26 +00:00
Christian Brueffer b63345c2aa MFC: r285859 (via r286019)
Auto-generate hardware notes for pms(4).

Approved by:	re (gjb)
2015-07-29 17:28:04 +00:00
Christian Brueffer 210d38d51b MFC: r285858, r286017
Add a basic manpage for the pms driver.

Approved by:	re (gjb)
2015-07-29 17:25:18 +00:00
Gleb Smirnoff 60c70d52c3 Merge r285939-285941,285943,286004 from stable/10:
- Protect against ioctl() vs ioctl() races.
- Always lock hash row of a source node when updating
  its 'states' counter. [1]
- Don't dereference NULL is pf_get_mtag() fails. [2]
- During module unload drop locks before destroying UMA zone.

PR:		182401 [1]
PR:		200222 [2]
Approved by:	re (gjb)
2015-07-29 14:16:25 +00:00
Glen Barber 9325ec5c9b MFS r285863 (jhb):
Partially revert r284034.  In particular, revert the final change in
 this MFC (281874).  It broke suspend and resume on several Thinkpads
 (though not all) in 10 even though it works fine on the same laptops
 in HEAD.

PR:		201239
Reported by:	Kevin Oberman and several others
Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2015-07-29 00:57:54 +00:00
Glen Barber 65a38c76e0 Document SA-15:14 through SA-15:16.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-28 20:42:36 +00:00
Xin LI ffa1526de3 Fix patch(1) shell injection vulnerability. [SA-15:14]
Fix resource exhaustion in TCP reassembly. [SA-15:15]

Fix OpenSSH multiple vulnerabilities. [SA-15:16]

Approved by:	re (so blanket)
2015-07-28 19:59:04 +00:00
Konstantin Belousov 39e669c66e MFC r285134 (by mjg):
fd: de-k&r-ify functions + some whitespace fixes

MFC r285269:
Handle copyout for the fcntl(F_OGETLK) using oflock structure.

Approved by:	re (gjb)
2015-07-28 17:00:03 +00:00
Glen Barber 0e44459f83 Fix the description for r274486.
Submitted by:	glebius
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-28 15:05:19 +00:00
Ed Maste 783f60ceab MFS r285951: Avoid creating invalid UEFI device path
The UEFI loader on the 10.1 release install disk (disc1) modifies an
existing EFI_DEVICE_PATH_PROTOCOL instance in an apparent attempt to
truncate the device path.  In doing so it creates an invalid device
path.

Perform the equivalent action without modification of structures
allocated by firmware.

PR:		197641
Submitted by:	Chris Ruffin <chris.ruffin at intel.com>
Approved by:	re (gjb)
2015-07-28 13:11:31 +00:00
Ed Maste 99ad22d517 MFS r285950: mfiutil: increase buffer size to accommodate sprintf string
PR:		201289
Approved by:	re (gjb)
2015-07-28 12:52:22 +00:00
Jim Harris 8b144d547a MFS r285918:
MFC r285816:

  nvme: ensure csts.rdy bit is cleared before returning from nvme_ctrlr_disable

Approved by:	re (gjb)
Sponsored by:	Intel
2015-07-27 17:53:11 +00:00
Jim Harris f75ffb5474 MFS r285917:
MFC r285815:

  nvme: properly handle case where pci_alloc_msix does not alloc all vectors

Approved by:	re (gjb)
Sponsored by:	Intel
2015-07-27 17:52:17 +00:00
Jim Harris 714d9ebd31 MFS r285916:
MFC r285796:

  nvmecontrol: read controller identify data before any log page operations

Approved by:	re (gjb)
Sponsored by:	Intel
2015-07-27 17:51:12 +00:00
Jim Harris bb99254900 MFS r285915:
MFC r285767:

  nvd: set d_delmaxsize to full capacity of NVMe namespace

  The NVMe specification has no ability to specify a maximum delete size
  that is less than the full capacity of the namespace - so just using the
  namespace size is the correct value here.

  This fixes reported issues where ZFS trim on init looked like it was
  hanging the system - previously the default I/O max size (128KB on
  Intel NVMe controllers) was used for delete operations which worked out
  to only about 8MB/s.  With this patch I can add an 800GB DC P3700
  drive to a ZFS pool in about 15-20 seconds.

Approved by:	re (gjb)
Sponsored by:	Intel
2015-07-27 17:50:05 +00:00
Glen Barber 4ee944dac3 Document r285721, bsdinstall aligns zfs partitions on 1Mb boundaries.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-26 19:47:46 +00:00
Glen Barber f7d5d85757 Document r285750, ssh(1) hostname canonicalization before looking
for the host in known_hosts.
Add Dell, Inc. to sponsors.ent.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-26 19:47:43 +00:00
Glen Barber b852012527 Document r285769, bsdinstall(8) updates to workaround various
problematic BIOSes when booting from GPT, and partition scheme
selection in the UFS partition menu.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-26 19:47:41 +00:00
Glen Barber ff16f31ff7 Document r273838, PLPMTUD blackhole detection (RFC 4821).
Submitted by:	sbruno
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-26 19:47:38 +00:00
Glen Barber 80b2dd3094 Further refine the PAE_TABLES entry, based on feedback from
alc.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-26 17:57:53 +00:00
Xin LI 3a56c532eb MFS r285856:
MFC r285701:

Use fixed date/time (the time choosen was the time the import was done
on -HEAD) in libntp so we can make reproducible build.

PR:		bin/201661
Differential Revision:	https://reviews.freebsd.org/D3122

While I'm there also remove libmd from linkage as reported in bin/201738

PR:		bin/201738
Submitted by:	John Marshall
Approved by:	re (gjb)
2015-07-24 22:08:57 +00:00
Glen Barber 459ffcadd8 Add a local entity for the pms(4) driver.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-24 22:00:44 +00:00
Glen Barber 868a917dd9 Fix rendering of a URL.
Update entities to reflect 10.2-RELEASE in preparation for
adding the hardware, relnotes, and installation pages to the
website.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-24 19:50:55 +00:00
Ed Maste 7fb72ef215 MFS r285849: Fix minor errors found by coverity.
PR:		201594
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2015-07-24 19:37:30 +00:00
Glen Barber dec5f6f9a3 Update the pkg.conf(5) for the dvd1.iso packages to use the
'quarterly' branch, which was missed in r285830.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-24 19:16:16 +00:00
Glen Barber 6f2265a0d3 - Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
builds.
- Update newvers.sh to reflect RC1.
- Update __FreeBSD_version to reflect 10.2.
- Update default pkg(8) configuration to use the quarterly branch.[1]

Discussed with:	re, portmgr [1]
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2015-07-23 23:31:40 +00:00
65 changed files with 1131 additions and 631 deletions

No files matched your search

+3
View File
@@ -16,6 +16,9 @@ from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of
stable/10, and then rebuild without this option. The bootstrap process from
older version of current is a bit fragile.
20150817:
10.2-RELEASE.
20150703:
The default Unbound configuration now enables remote control
using a local socket. Users who have already enabled the
@@ -585,13 +585,23 @@ static int
archive_read_format_tar_skip(struct archive_read *a)
{
int64_t bytes_skipped;
int64_t request;
struct sparse_block *p;
struct tar* tar;
tar = (struct tar *)(a->format->data);
bytes_skipped = __archive_read_consume(a,
tar->entry_bytes_remaining + tar->entry_padding +
tar->entry_bytes_unconsumed);
/* Do not consume the hole of a sparse file. */
request = 0;
for (p = tar->sparse_list; p != NULL; p = p->next) {
if (!p->hole)
request += p->remaining;
}
if (request > tar->entry_bytes_remaining)
request = tar->entry_bytes_remaining;
request += tar->entry_padding + tar->entry_bytes_unconsumed;
bytes_skipped = __archive_read_consume(a, request);
if (bytes_skipped < 0)
return (ARCHIVE_FATAL);
@@ -0,0 +1,135 @@
/*-
* Copyright (c) 2014 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD");
/*
* To test skip a sparse file entry, this test does not read file data.
*/
DEFINE_TEST(test_read_format_gtar_sparse_skip_entry)
{
#ifndef __FreeBSD__ /* Backport test. */
const char *refname = "test_read_format_gtar_sparse_skip_entry.tar.Z.uu";
#else
const char *refname = "test_read_format_gtar_sparse_skip_entry.tar.Z";
#endif
struct archive *a;
struct archive_entry *ae;
const void *p;
size_t s;
int64_t o;
#ifndef __FreeBSD__ /* Backport test. */
copy_reference_file(refname);
#else
extract_reference_file(refname);
#endif
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_filename(a, refname, 10240));
/* Verify regular first file. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("a", archive_entry_pathname(ae));
assertEqualInt(10737418244, archive_entry_size(ae));
#ifndef __FreeBSD__ /* Backport test. */
assertEqualInt(archive_entry_is_encrypted(ae), 0);
assertEqualIntA(a, archive_read_has_encrypted_entries(a),
ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
#endif
/* Verify regular second file. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("b", archive_entry_pathname(ae));
assertEqualInt(4, archive_entry_size(ae));
#ifndef __FreeBSD__ /* Backport test. */
assertEqualInt(archive_entry_is_encrypted(ae), 0);
assertEqualIntA(a, archive_read_has_encrypted_entries(a),
ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
#endif
/* End of archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify archive format. */
assertEqualIntA(a, ARCHIVE_FILTER_COMPRESS, archive_filter_code(a, 0));
assertEqualIntA(a, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE,
archive_format(a));
/* Close the archive. */
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
/*
* Read just one block of a sparse file and skip it.
*/
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_filename(a, refname, 10240));
/* Verify regular first file. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("a", archive_entry_pathname(ae));
assertEqualInt(10737418244, archive_entry_size(ae));
#ifndef __FreeBSD__ /* Backport test. */
assertEqualInt(archive_entry_is_encrypted(ae), 0);
assertEqualIntA(a, archive_read_has_encrypted_entries(a),
ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
#endif
assertEqualInt(0, archive_read_data_block(a, &p, &s, &o));
assertEqualInt(4096, s);
assertEqualInt(0, o);
/* Verify regular second file. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("b", archive_entry_pathname(ae));
assertEqualInt(4, archive_entry_size(ae));
#ifndef __FreeBSD__ /* Backport test. */
assertEqualInt(archive_entry_is_encrypted(ae), 0);
assertEqualIntA(a, archive_read_has_encrypted_entries(a),
ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
#endif
/* End of archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify archive format. */
assertEqualIntA(a, ARCHIVE_FILTER_COMPRESS, archive_filter_code(a, 0));
assertEqualIntA(a, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE,
archive_format(a));
/* Close the archive. */
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
@@ -0,0 +1,15 @@
begin 644 -
M'YV04,+@05(F#)DR<EZ$`<"PH<.'$"-*G$BQHL6*,#+:L$$#!(",,6[4@.$1
MI$B2'S.JS#A#A@P0,63,L`$C!HP9-VB\K"FCAHT8`$#@N4BTJ-&C2"/6F4,G
MC)R48^J424HQZE2J$E=F+*G5(]:O8,.*'3M6!LDY:?24Z6'S!DX:,7#(H$%#
MP0R2;>BD:;,V!@T8-6)NE&'#10T<-#;>R(%CAEV28_3R9?LW\(P8-F[`<#%C
M)@T<->#6>`PBC.2^E07;J#'#Q>J-F5DJ<`GBB),J+N;`<3JGC(LV8=2\D<-V
M]DO;N'7S]MTFC9OA/6#,CE'[=N[=<GJ[<!-F<AB[-:HGQZY=3D$V:-6RA>$V
M9]RY=<G*GT^_OOW[^/.#13Z%?!DC:;!1AD+Z%6B12AMUE%)((W'%($I:U603
M#!W%-%---^6T4PPM8184#`:&"-9233V5D57SH2A?A%RMY)6(,,8HHPP*2/=7
M#C8HT-9;[_VE0'PR!BGDD$06:>212"9YD1EOO*&`DE!&*>645%9IY9589JGE
MEEQVZ>678(8IYIADEFGFF6BFJ>::;+;IYIMPQBGGG'36:>>=>.:IYYY\]NGG
MGX`&*NB@A!9JJ)YB](D@1PZ>U&B#*468484RT11###7<8!8(&-)4PX=^DN@4
B5%*E6.J*746JTHN'2LFDDZW&*NNLM-9JZZVXYJKKKKR&!0``
`
end
+7 -2
View File
@@ -82,6 +82,7 @@ struct KbdintAuthctxt
void *ctxt;
KbdintDevice *device;
u_int nreq;
u_int devices_done;
};
#ifdef USE_PAM
@@ -168,11 +169,15 @@ kbdint_next_device(Authctxt *authctxt, KbdintAuthctxt *kbdintctxt)
if (len == 0)
break;
for (i = 0; devices[i]; i++) {
if (!auth2_method_allowed(authctxt,
if ((kbdintctxt->devices_done & (1 << i)) != 0 ||
!auth2_method_allowed(authctxt,
"keyboard-interactive", devices[i]->name))
continue;
if (strncmp(kbdintctxt->devices, devices[i]->name, len) == 0)
if (strncmp(kbdintctxt->devices, devices[i]->name,
len) == 0) {
kbdintctxt->device = devices[i];
kbdintctxt->devices_done |= 1 << i;
}
}
t = kbdintctxt->devices;
kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL;
+26 -16
View File
@@ -1246,29 +1246,39 @@ verify_host_key(char *host, struct sockaddr *hostaddr, Key *host_key)
{
int flags = 0;
char *fp;
Key *plain = NULL;
fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX);
debug("Server host key: %s %s", key_type(host_key), fp);
free(fp);
/* XXX certs are not yet supported for DNS */
if (!key_is_cert(host_key) && options.verify_host_key_dns &&
verify_host_key_dns(host, hostaddr, host_key, &flags) == 0) {
if (flags & DNS_VERIFY_FOUND) {
if (options.verify_host_key_dns == 1 &&
flags & DNS_VERIFY_MATCH &&
flags & DNS_VERIFY_SECURE)
return 0;
if (flags & DNS_VERIFY_MATCH) {
matching_host_key_dns = 1;
} else {
warn_changed_key(host_key);
error("Update the SSHFP RR in DNS with the new "
"host key to get rid of this message.");
if (options.verify_host_key_dns) {
/*
* XXX certs are not yet supported for DNS, so downgrade
* them and try the plain key.
*/
plain = key_from_private(host_key);
if (key_is_cert(plain))
key_drop_cert(plain);
if (verify_host_key_dns(host, hostaddr, plain, &flags) == 0) {
if (flags & DNS_VERIFY_FOUND) {
if (options.verify_host_key_dns == 1 &&
flags & DNS_VERIFY_MATCH &&
flags & DNS_VERIFY_SECURE) {
key_free(plain);
return 0;
}
if (flags & DNS_VERIFY_MATCH) {
matching_host_key_dns = 1;
} else {
warn_changed_key(plain);
error("Update the SSHFP RR in DNS "
"with the new host key to get rid "
"of this message.");
}
}
}
key_free(plain);
}
return check_host_key(host, hostaddr, options.port, host_key, RDRW,
+1 -1
View File
@@ -8,7 +8,7 @@
#
FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
-1
View File
@@ -30,6 +30,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddbd64f13f978f2f3aede40c98633216c330
# REFUSE korean polish portuguese russian ukrainian vietnamese
# List of INDEX files to build and the DESCRIBE file to use for each
INDEX INDEX-8 DESCRIBE.8
INDEX INDEX-9 DESCRIBE.9
INDEX INDEX-10 DESCRIBE.10
+1 -1
View File
@@ -62,5 +62,5 @@ static const struct {
.descsz = sizeof(int32_t),
.type = ABI_NOTETYPE,
.name = NOTE_FREEBSD_VENDOR,
.desc = __FreeBSD_version
.desc = 1002000
};
+1
View File
@@ -121,6 +121,7 @@ TESTS= \
test_read_format_gtar_gz.c \
test_read_format_gtar_lzma.c \
test_read_format_gtar_sparse.c \
test_read_format_gtar_sparse_skip_entry.c \
test_read_format_iso_Z.c \
test_read_format_iso_multi_extent.c \
test_read_format_iso_xorriso.c \
+1 -1
View File
@@ -6,7 +6,7 @@
#
VMTARGETS= vm-image
VMFORMATS?= vhd vmdk qcow2 raw
VMFORMATS?= vhdf vmdk qcow2 raw
VMSIZE?= 20G
VMBASE?= vm
@@ -31,6 +31,7 @@
<year>2012</year>
<year>2013</year>
<year>2014</year>
<year>2015</year>
<holder role="mailto:[email protected]">The &os; Documentation
Project</holder>
</copyright>
@@ -765,6 +766,8 @@
&hwlist.nsp;
&hwlist.pms;
&hwlist.pst;
&hwlist.siis;
@@ -897,6 +900,8 @@
&hwlist.ixgbe;
&hwlist.ixl;
&hwlist.jme;
&hwlist.kue;
@@ -349,8 +349,9 @@
other copies are kept updated on the Internet and should be
consulted as the <quote>current errata</quote> for this
release. These other copies of the errata are located at
<uri
xlink:href="&url.base;/releases/">&url.base;/releases/</uri>
the <uri
xlink:href="&url.base;/releases/">&os;&nbsp;&release.current;
page</uri>
(as well as any sites which keep up-to-date mirrors of this
location).</para>
</note>
+186 -68
View File
@@ -194,9 +194,9 @@
has been fixed.</para>
<para revision="281161" contrib="sponsor"
sponsor="&limelight;">A new flag, <literal>-R</literal>, has
been added to the &man.netstat.8; utility, which is used to
dump <acronym>RSS</acronym>/flow information.</para>
sponsor="&limelight;">The &man.netstat.8; utility has been
updated to include a new flag, <literal>-R</literal>, which is
used to dump <acronym>RSS</acronym>/flow information.</para>
<para revision="281936" contrib="sponsor" sponsor="&ff;">The
&man.ar.1; utility has been updated to set
@@ -230,9 +230,10 @@
compatibility with the <acronym>GNU</acronym> &man.date.1;
utility behavior.</para>
<para revision="284523">A new flag, <literal>-c</literal>, has
been added to the &man.mkimg.1; utility, which allows
specifying the capacity of the target disk image.</para>
<para revision="284523">The &man.mkimg.1; utility has been
updated to include a new flag, <literal>-c</literal>, which
allows specifying the capacity of the target disk
image.</para>
<para revision="285092">The &man.pw.8; utility has been updated
with a new flag, <literal>-R</literal>, that sets the root
@@ -269,12 +270,37 @@
<para revision="285612">The <application>ntp</application>
suite has been updated to version 4.2.8p3.</para>
<para revision="285750" contrib="sponsor" sponsor="&dell;">The
&man.ssh.1; utility has been updated to re-implement hostname
canonicalization before locating the host in
<filename>known_hosts</filename>.</para>
<para revision="286084">The &man.tar.1; utility has been updated
to fix an issue that would prevent compressing sparse
files.</para>
</sect2>
<sect2 xml:id="userland-installer">
<title>Installation and Configuration Tools</title>
<para>&nbsp;</para>
<para revision="285769" contrib="sponsor"
sponsor="&scaleengine;">Support for detecting and implementing
a workaround for various laptops and motherboards that do not
boot properly from <acronym>GPT</acronym>-partitioned disks
has been added to &man.bsdinstall.8;. Additionally, the
<literal>active</literal> flag will be set on the partition
when needed.</para>
<para revision="285721" contrib="sponsor"
sponsor="&scaleengine;">Support for detecting and implementing
aligning partitions on 1Mb boundaries has been added to
&man.bsdinstall.8;.</para>
<para revision="285769" contrib="sponsor"
sponsor="&scaleengine;">Support for selecting the partitioning
scheme when installing on the <acronym>UFS</acronym>
filesystem has been added to &man.bsdinstall.8;.</para>
</sect2>
<sect2 xml:id="userland-rc">
@@ -353,13 +379,16 @@
<para revision="282065" contrib="sponsor" sponsor="&ff;">The
<literal>PAE_TABLES</literal> kernel configuration option has
been added for &os;/&arch.i386;, which instructs &man.pmap.9;
to use <acronym>PAE</acronym> format for page tables with
32-bit physical addresses. Unlike the <literal>PAE</literal>
option, <literal>PAE_TABLES</literal> preserves kernel binary
interface (<acronym>KBI</acronym>) compatibility with
non-<literal>PAE</literal> kernels, allowing
non-<literal>PAE</literal> kernel modules and drivers to work
with a <literal>PAE_TABLES</literal>-enabled kernel.
to use <acronym>PAE</acronym> format for page tables while
maintaining a 32-bit physical address size elsewhere in the
kernel. The use of this option can enhance application-level
security by enabling the creation of <quote>no execute</quote>
mappings on modern &arch.i386; processors. Unlike the
<literal>PAE</literal> option, <literal>PAE_TABLES</literal>
preserves kernel binary interface (<acronym>KBI</acronym>)
compatibility with non-<literal>PAE</literal> kernels,
allowing non-<literal>PAE</literal> kernel modules and drivers
to work with a <literal>PAE_TABLES</literal>-enabled kernel.
Additionally, system limits are tuned for 4GB maximum
<acronym>RAM</acronym>, avoiding kernel virtual address space
(<acronym>KVA</acronym>) exhaustion.</para>
@@ -473,14 +502,20 @@
<sect2 xml:id="drivers-storage">
<title>Storage Drivers</title>
<para revision="281957">The &man.hptnr.4; driver has been
updated to version 1.1.1.</para>
<para revision="283990">The &man.mpr.4; driver has been
updated to version 9.255.01.00-fbsd.</para>
<para revision="284879">The &man.hpt27xx.4; driver has been
updated to version 1.2.7.</para>
<para revision="284935">The &man.hptnr.4; driver has been
updated to version 1.1.4.</para>
</sect2>
<sect2 xml:id="drivers-network">
<title>Network Drivers</title>
<para revision="274486">The &man.pfil.9; interface default hash
<para revision="274486">The &man.pf.4; interface default hash
has been changed from <literal>Jenkins</literal> to
<literal>Murmur3</literal>, providing a 3-percent performance
increase in packets-per-second.</para>
@@ -520,7 +555,18 @@
<sect2 xml:id="hardware-support">
<title>Hardware Support</title>
<para>&nbsp;</para>
<para revision="278407">The &man.uart.4; driver has been updated
to include support for the <acronym>AMT</acronym> serial
interface found on the Lenovo&reg; ThinkPad&trade; T61.</para>
<para revision="279924">The &man.uart.4; driver has been updated
to include support for the <acronym>AMT</acronym> serial
interface found on the Lenovo&reg; ThinkPad&trade;
T400.</para>
<para revision="281963">The &man.snd.hda.4; driver has been
updated to support the Lenovo&reg; ThinkPad&trade; X1 20BS
model.</para>
</sect2>
<sect2 xml:id="hardware-virtualization">
@@ -568,16 +614,15 @@
<sect2 xml:id="hardware-arm">
<title>ARM Support</title>
<para revision="278079" arch="arm">Support to turn off the
BeagleBone Black system with the &man.shutdown.8;
<literal>-p</literal> flag or by invoking &man.poweroff.8; has
been added.</para>
<para revision="278079">Support to turn off the BeagleBone Black
system with the &man.shutdown.8; <literal>-p</literal> flag or
by invoking &man.poweroff.8; has been added.</para>
<para revision="278599" arch="arm">Support for the Exynos 5420
Octa system has been added.</para>
<para revision="278599">Support for the Exynos 5420 Octa system
has been added.</para>
<para revision="278599" arch="arm">The <acronym>SMP</acronym>
option has been enabled for all Exynos 5 systems supported by
<para revision="278599">The <acronym>SMP</acronym> option has
been enabled for all Exynos 5 systems supported by
&os;.</para>
<para revision="278608">The <literal>bcm2835_cpufreq</literal>
@@ -585,11 +630,11 @@
frequency and voltage control on the Raspberry Pi
<acronym>SOC</acronym>.</para>
<para revision="283500" arch="arm">Support for the Toradex
Apalis i.MX6 development board has been added.</para>
<para revision="283500">Support for the Toradex Apalis i.MX6
development board has been added.</para>
<para revision="283500" arch="arm">Audio transmission drivers
have been added for Digital Audio Multiplexer
<para revision="283500">Audio transmission drivers have been
added for Digital Audio Multiplexer
(<acronym>AUDMUXM</acronym>), Smart Direct Memory Access
Controller (<acronym>SDMA</acronym>), and Syncronous Serial
Interface (<acronym>SSI</acronym>).</para>
@@ -639,10 +684,11 @@
targets and portals without requiring active
discovery.</para>
<para revision="275249" contrib="sponsor" sponsor="&ff;">Support
<para revision="275249" contrib="sponsor" sponsor="&ff;">The
&man.mount.nfs.8; utility has been updated to include support
for the <literal>timeo</literal>, <literal>actimeo</literal>,
<literal>noac</literal>, and <literal>proto</literal> options
have been added to &man.mount.nfs.8;.</para>
<literal>noac</literal>, and <literal>proto</literal>
options.</para>
</sect2>
<sect2 xml:id="storage-zfs">
@@ -662,7 +708,7 @@
</sect2>
<sect2 xml:id="storage-geom">
<title>&man.geom.4;</title>
<title>GEOM</title>
<para revision="275891" contrib="sponsor" sponsor="&ix;">The
&man.ctl.4; subsystem has been updated, increasing the ports
@@ -670,10 +716,11 @@
and <acronym>LUN</acronym> limit from <literal>256</literal>
to <literal>1024</literal>.</para>
<para revision="282861">Support for the
<para revision="282861">The &man.gpart.8; utility has been
updated to include support for the
<literal>apple-boot</literal>, <literal>apple-hfs</literal>,
and <literal>apple-ufs</literal> <acronym>MBR</acronym>
partitioning schemes have been added to &man.gpart.8;.</para>
partitioning schemes.</para>
</sect2>
</sect1>
@@ -710,12 +757,6 @@
<filename>ttyu2</filename>, and <filename>ttyu3</filename> by
default, if the callin port is an active console port.</para>
</sect2>
<sect2 xml:id="boot-menu">
<title>Boot Menu Changes</title>
<para>&nbsp;</para>
</sect2>
</sect1>
<sect1 xml:id="network">
@@ -725,9 +766,81 @@
&os;.</para>
<sect2 xml:id="network-protocols">
<title>Network Procols</title>
<title>Network Protocols</title>
<para>&nbsp;</para>
<para revision="273838" contrib="sponsor"
sponsor="&limelight;">Support for <acronym>PLPMTUD</acronym>
blackhole detection (<acronym>RFC</acronym> 4821) has been
added to the &man.tcp.4; stack, disabled by default. New
control tunables have been added:</para>
<informaltable frame="none" pgwide="0">
<tgroup cols="2">
<colspec colwidth="1*"/>
<colspec colwidth="1*"/>
<thead>
<row>
<entry>Tunable</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>net.inet.tcp.pmtud_blackhole_detection</literal></entry>
<entry>Enables or disables <acronym>PLPMTUD</acronym>
blackhole detection</entry>
</row>
<row>
<entry><literal>net.inet.tcp.pmtud_blackhole_mss</literal></entry>
<entry><acronym>MSS</acronym> to try for IPv4</entry>
</row>
<row>
<entry><literal>net.inet.tcp.v6pmtud_blackhole_mss</literal></entry>
<entry><acronym>MSS to try for IPv6</acronym></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>New monitoring &man.sysctl.8;s haven been added:</para>
<informaltable frame="none" pgwide="0">
<tgroup cols="2">
<colspec colwidth="1*"/>
<colspec colwidth="1*"/>
<thead>
<row>
<entry>Tunable</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>net.inet.tcp.pmtud_blackhole_activated</literal></entry>
<entry>Number of times the code was activated to attempt
downshifting the <acronym>MSS</acronym></entry>
</row>
<row>
<entry><literal>net.inet.tcp.pmtud_blackhole_min_activated</literal></entry>
<entry>Number of times the blackhole
<acronym>MSS</acronym> was used in an attempt to
downshift</entry>
</row>
<row>
<entry><literal>net.inet.tcp.pmtud_blackhole_failed</literal></entry>
<entry>Number of times that the blackhole failed to
connect after downshifting the
<acronym>MSS</acronym></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect2>
</sect1>
@@ -738,35 +851,30 @@
Collection, package infrastructure, and package maintenance and
installation tools.</para>
<sect2 xml:id="ports-infrastructure">
<title>Infrastructure Changes</title>
<sect2 xml:id="ports-versions">
<title>Ports and Package Versions</title>
<para>&nbsp;</para>
</sect2>
<para>The <filename role="package">ports-mgmt/pkg</filename>
package has been updated to version 1.5.4 in the
<literal>quarterly</literal> branch, and version 1.5.5 in the
<literal>head</literal> branch.</para>
<sect2 xml:id="ports-packages ">
<title>Packaging Changes</title>
<para>The <filename
role="package">x11-servers/xorg-server</filename> package
for &os;&nbsp;&release.current; has been updated to version
1.14.7_5.</para>
<para>&nbsp;</para>
</sect2>
</sect1>
<para>The <filename role="package">x11/xorg</filename> package
for &os;&nbsp;&release.current; has been updated to version
7.7_2.</para>
<sect1 xml:id="doc">
<title>Documentation</title>
<para>The <filename role="package">x11/gnome3</filename> package
for &os;&nbsp;&release.current; has been updated to version
3.14.2.</para>
<para>This section covers changes to the &os;&nbsp;Documentation
Project sources and toolchain.</para>
<sect2 xml:id="doc-sources">
<title>Documentation Source Changes</title>
<para>&nbsp;</para>
</sect2>
<sect2 xml:id="doc-toolchain">
<title>Documentation Toolchain Changes</title>
<para>&nbsp;</para>
<para>The <filename role="package">x11/kde4</filename> package
for &os;&nbsp;&release.current; has been updated to version
4.14.3.</para>
</sect2>
</sect1>
@@ -790,6 +898,16 @@
&os;/&arch.i386; memory stick installation images are now
created using the &man.mkimg.1; utility, matching the way
the &os;/&arch.amd64; images are created.</para>
<para revision="285830" contrib="sponsor" sponsor="&ff;">The
default &man.pkg.8; repository set in
<filename>/etc/pkg/FreeBSD.conf</filename> now defaults to
the <literal>quarterly</literal> package set. To use the
<literal>latest</literal> branch (as was the previous
default), the comment at the top of
<filename>/etc/pkg/FreeBSD.conf</filename> explains how to
disable the default repository and specify an alternative
repository.</para>
</sect2>
</sect1>
</article>
+11 -8
View File
@@ -6,7 +6,7 @@
<!-- Version of the OS we're describing. This needs to be updated
with each new release. -->
<!ENTITY release.current "10.1-STABLE">
<!ENTITY release.current "10.2-RELEASE">
<!-- The previous version used for comparison in the "What's New"
section. For -CURRENT, we might point back to the last
@@ -16,16 +16,16 @@
<!-- The previous stable release, useful for pointing user's at the
release they SHOULD be running if they don't want the bleeding
edge. -->
<!ENTITY release.prev.stable "10.0-RELEASE">
<!ENTITY release.prev.stable "10.1-RELEASE">
<!-- The next version to be released, usually used for snapshots. -->
<!ENTITY release.next "10.2-RELEASE">
<!ENTITY release.next "10.3-RELEASE">
<!-- The name of this branch. -->
<!ENTITY release.branch "10.1-STABLE">
<!ENTITY release.branch "10.2-STABLE">
<!-- The URL for obtaining this version of FreeBSD. -->
<!ENTITY release.url "https://www.FreeBSD.org/snapshots/">
<!ENTITY release.url "https://www.FreeBSD.org/releases/">
<!-- The URL for Security Advisories and Errata Notices. -->
<!ENTITY security.url "https://www.FreeBSD.org/security/advisories">
@@ -37,10 +37,10 @@
or "release" -->
<!-- WARNING: Do not forget to also change the release type in
doc.relnotes.mk when updating this -->
<!ENTITY release.type "snapshot">
<!ENTITY % release.type.current "INCLUDE">
<!ENTITY release.type "release">
<!ENTITY % release.type.current "IGNORE">
<!ENTITY % release.type.snapshot "IGNORE">
<!ENTITY % release.type.release "IGNORE">
<!ENTITY % release.type.release "INCLUDE">
<![%release.type.current;[
<!ENTITY release '&release.current;'>
@@ -76,3 +76,6 @@
<!ENTITY arch.pc98 "pc98">
<!ENTITY arch.powerpc "powerpc">
<!ENTITY arch.sparc64 "sparc64">
<!-- Manual page references added after the doc tag -->
<!ENTITY man.pms.4 "<citerefentry xmlns='http://docbook.org/ns/docbook'><refentrytitle>pms</refentrytitle><manvolnum>4</manvolnum></citerefentry>">
+37
View File
@@ -133,6 +133,43 @@
<entry><para>resource exhaustion due to sessions stuck in
<literal>LAST_ACK</literal> state.</para></entry>
</row>
<row>
<entry><link
xlink:href="&security.url;/FreeBSD-SA-15:14.bsdpatch.asc">FreeBSD-SA-15:14.bsdpatch</link></entry>
<entry>28&nbsp;July&nbsp;2015</entry>
<entry><para>Shell injection vulnerability</para></entry>
</row>
<row>
<entry><link
xlink:href="&security.url;/FreeBSD-SA-15:15.tcp.asc">FreeBSD-SA-15:15.tcp</link></entry>
<entry>28&nbsp;July&nbsp;2015</entry>
<entry><para>resource exhaustion in <acronym>TCP</acronym>
reassembly</para></entry>
</row>
<row>
<entry><link
xlink:href="&security.url;/FreeBSD-SA-15:16.openssh.asc">FreeBSD-SA-15:16.openssh</link></entry>
<entry>28&nbsp;July&nbsp;2015</entry>
<entry><para>Multiple vulnerabilities</para></entry>
</row>
<row>
<entry><link
xlink:href="&security.url;/FreeBSD-SA-15:18.bsdpatch.asc">FreeBSD-SA-15:18.bsdpatch</link></entry>
<entry>5&nbsp;August&nbsp;2015</entry>
<entry><para>Shell injection vulnerability</para></entry>
</row>
<row>
<entry><link
xlink:href="&security.url;/FreeBSD-SA-15:19.routed.asc">FreeBSD-SA-15:19.routed</link></entry>
<entry>5&nbsp;August&nbsp;2015</entry>
<entry><para>Remote denial of service
vulnerability</para></entry>
</row>
</tbody>
</tgroup>
</informaltable>
+1
View File
@@ -15,6 +15,7 @@
<!ENTITY darpa "DARPA">
<!ENTITY darpa_afrl "DARPA, AFRL">
<!ENTITY dell "Dell, Inc.">
<!ENTITY ff "The&nbsp;&os;&nbsp;Foundation">
<!ENTITY ff.url "https://www.FreeBSDFoundation.org/">
+1 -1
View File
@@ -1,6 +1,6 @@
# $FreeBSD$
release: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_2",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
+2 -1
View File
@@ -298,6 +298,8 @@ logpage(int argc, char *argv[])
open_dev(argv[optind], &fd, 1, 1);
}
read_controller_data(fd, &cdata);
/*
* The log page attribtues indicate whether or not the controller
* supports the SMART/Health information log page on a per
@@ -307,7 +309,6 @@ logpage(int argc, char *argv[])
if (log_page != NVME_LOG_HEALTH_INFORMATION)
errx(1, "log page %d valid only at controller level",
log_page);
read_controller_data(fd, &cdata);
if (cdata.lpa.ns_smart == 0)
errx(1,
"controller does not support per namespace "
+6
View File
@@ -160,6 +160,12 @@ input(struct sockaddr_in *from, /* received from this IP address */
trace_rip("Recv", "from", from, sifp, rip, cc);
if (sifp == 0) {
trace_pkt(" discard a request from an indirect router"
" (possibly an attack)");
return;
}
if (rip->rip_vers == 0) {
msglim(&bad_router, FROM_NADDR,
"RIP version 0, cmd %d, packet received from %s",
+1
View File
@@ -382,6 +382,7 @@ MAN= aac.4 \
${_pflog.4} \
${_pfsync.4} \
pim.4 \
pms.4 \
polling.4 \
ppbus.4 \
ppc.4 \
+126
View File
@@ -0,0 +1,126 @@
.\" Copyright (c) 2015 Christian Brueffer
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd July 29, 2015
.Dt PMS 4
.Os
.Sh NAME
.Nm pms
.Nd "PMC-Sierra PM8001/8081/8088/8089/8074/8076/8077 SAS/SATA HBA Controller driver"
.Sh SYNOPSIS
To compile the driver into the kernel,
place the following line in the
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device pms"
.Ed
.Pp
Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
pms_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
driver provides support for the PMC-Sierra PM8001/8081/8088/8089/8074/8076/8077
range of SAS/SATA HBA controllers.
.Sh HARDWARE
The
.Nm
driver supports the following hardware:
.Pp
.Bl -bullet -compact
.It
Tachyon TS Fibre Channel Card
.It
Tachyon TL Fibre Channel Card
.It
Tachyon XL2 Fibre Channel Card
.It
Tachyon DX2 Fibre Channel Card
.It
Tachyon DX2+ Fibre Channel Card
.It
Tachyon DX4+ Fibre Channel Card
.It
Tachyon QX2 Fibre Channel Card
.It
Tachyon QX4 Fibre Channel Card
.It
Tachyon DE4 Fibre Channel Card
.It
Tachyon QE4 Fibre Channel Card
.It
Tachyon XL10 Fibre Channel Card
.It
PMC Sierra SPC SAS-SATA Card
.It
PMC Sierra SPC-V SAS-SATA Card
.It
PMC Sierra SPC-VE SAS-SATA Card
.It
PMC Sierra SPC-V 16 Port SAS-SATA Card
.It
PMC Sierra SPC-VE 16 Port SAS-SATA Card
.It
PMC Sierra SPC-V SAS-SATA Card 12Gig
.It
PMC Sierra SPC-VE SAS-SATA Card 12Gig
.It
PMC Sierra SPC-V 16 Port SAS-SATA Card 12Gig
.It
PMC Sierra SPC-VE 16 Port SAS-SATA Card 12Gig
.It
Adaptec Hialeah 4/8 Port SAS-SATA HBA Card 6Gig
.It
Adaptec Hialeah 4/8 Port SAS-SATA RAID Card 6Gig
.It
Adaptec Hialeah 8/16 Port SAS-SATA HBA Card 6Gig
.It
Adaptec Hialeah 8/16 Port SAS-SATA RAID Card 6Gig
.It
Adaptec Hialeah 8/16 Port SAS-SATA HBA Encryption Card 6Gig
.It
Adaptec Hialeah 8/16 Port SAS-SATA RAID Encryption Card 6Gig
.It
Adaptec Delray 8 Port SAS-SATA HBA Card 12Gig
.It
Adaptec Delray 8 Port SAS-SATA HBA Encryption Card 12Gig
.It
Adaptec Delray 16 Port SAS-SATA HBA Card 12Gig
.It
Adaptec Delray 16 Port SAS-SATA HBA Encryption Card 12Gig
.El
.Sh SEE ALSO
.Xr cam 4 ,
.Xr camcontrol 8
.Sh HISTORY
The
.Nm
device driver first appeared in
.Fx 10.2 .
+2 -1
View File
@@ -160,7 +160,8 @@ device ida # Compaq Smart RAID
device mfi # LSI MegaRAID SAS
device mlx # Mylex DAC960 family
device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s
device pmspcv # PMC-Sierra SAS/SATA Controller driver
#XXX PCI ID conflicts with ahd(4) and mvs(4)
#device pmspcv # PMC-Sierra SAS/SATA Controller driver
#XXX pointer/int warnings
#device pst # Promise Supertrak SX6000
device twe # 3ware ATA RAID
+18 -5
View File
@@ -63,13 +63,14 @@ static int
efipart_init(void)
{
EFI_BLOCK_IO *blkio;
EFI_DEVICE_PATH *devpath, *node;
EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node;
EFI_HANDLE *hin, *hout, *aliases, handle;
EFI_STATUS status;
UINTN sz;
CHAR16 *path;
u_int n, nin, nout;
int err;
size_t devpathlen;
sz = 0;
hin = NULL;
@@ -98,9 +99,15 @@ efipart_init(void)
if (EFI_ERROR(status)) {
continue;
}
node = devpath;
while (!IsDevicePathEnd(NextDevicePathNode(node)))
devpathlen = DevicePathNodeLength(node);
while (!IsDevicePathEnd(NextDevicePathNode(node))) {
node = NextDevicePathNode(node);
devpathlen += DevicePathNodeLength(node);
}
devpathlen += DevicePathNodeLength(NextDevicePathNode(node));
status = BS->HandleProtocol(hin[n], &blkio_guid,
(void**)&blkio);
if (EFI_ERROR(status))
@@ -117,10 +124,16 @@ efipart_init(void)
*/
if (DevicePathType(node) == MEDIA_DEVICE_PATH &&
DevicePathSubType(node) == MEDIA_CDROM_DP) {
node->Type = END_DEVICE_PATH_TYPE;
node->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
status = BS->LocateDevicePath(&blkio_guid, &devpath,
devpathcpy = malloc(devpathlen);
memcpy(devpathcpy, devpath, devpathlen);
node = devpathcpy;
while (!IsDevicePathEnd(NextDevicePathNode(node)))
node = NextDevicePathNode(node);
SetDevicePathEndNode(node);
tmpdevpath = devpathcpy;
status = BS->LocateDevicePath(&blkio_guid, &tmpdevpath,
&handle);
free(devpathcpy);
if (EFI_ERROR(status))
continue;
hout[nout] = handle;
+1 -1
View File
@@ -32,7 +32,7 @@
TYPE="FreeBSD"
REVISION="10.2"
BRANCH="BETA2"
BRANCH="RELEASE"
if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
fi
+20 -2
View File
@@ -343,7 +343,15 @@ netvsc_attach(device_t dev)
IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO;
ifp->if_capenable |=
IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO;
ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO;
/*
* Only enable UDP checksum offloading when it is on 2012R2 or
* later. UDP checksum offloading doesn't work on earlier
* Windows releases.
*/
if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1)
ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO;
else
ifp->if_hwassist = CSUM_TCP | CSUM_TSO;
ret = hv_rf_on_device_add(device_ctx, &device_info);
if (ret != 0) {
@@ -1110,7 +1118,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP);
} else {
ifp->if_capenable |= IFCAP_TXCSUM;
ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP);
/*
* Only enable UDP checksum offloading on
* Windows Server 2012R2 or later releases.
*/
if (hv_vmbus_protocal_version >=
HV_VMBUS_VERSION_WIN8_1) {
ifp->if_hwassist |=
(CSUM_TCP | CSUM_UDP);
} else {
ifp->if_hwassist |= CSUM_TCP;
}
}
}
+1
View File
@@ -278,6 +278,7 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg)
disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns);
disk->d_sectorsize = nvme_ns_get_sector_size(ns);
disk->d_mediasize = (off_t)nvme_ns_get_size(ns);
disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns);
if (TAILQ_EMPTY(&disk_head))
disk->d_unit = 0;
+40 -16
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (C) 2012-2014 Intel Corporation
* Copyright (C) 2012-2015 Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -207,7 +207,7 @@ nvme_ctrlr_fail_req_task(void *arg, int pending)
}
static int
nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr)
nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val)
{
int ms_waited;
union cc_register cc;
@@ -216,18 +216,19 @@ nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr)
cc.raw = nvme_mmio_read_4(ctrlr, cc);
csts.raw = nvme_mmio_read_4(ctrlr, csts);
if (!cc.bits.en) {
nvme_printf(ctrlr, "%s called with cc.en = 0\n", __func__);
if (cc.bits.en != desired_val) {
nvme_printf(ctrlr, "%s called with desired_val = %d "
"but cc.en = %d\n", __func__, desired_val, cc.bits.en);
return (ENXIO);
}
ms_waited = 0;
while (!csts.bits.rdy) {
while (csts.bits.rdy != desired_val) {
DELAY(1000);
if (ms_waited++ > ctrlr->ready_timeout_in_ms) {
nvme_printf(ctrlr, "controller did not become ready "
"within %d ms\n", ctrlr->ready_timeout_in_ms);
nvme_printf(ctrlr, "controller ready did not become %d "
"within %d ms\n", desired_val, ctrlr->ready_timeout_in_ms);
return (ENXIO);
}
csts.raw = nvme_mmio_read_4(ctrlr, csts);
@@ -246,11 +247,12 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr)
csts.raw = nvme_mmio_read_4(ctrlr, csts);
if (cc.bits.en == 1 && csts.bits.rdy == 0)
nvme_ctrlr_wait_for_ready(ctrlr);
nvme_ctrlr_wait_for_ready(ctrlr, 1);
cc.bits.en = 0;
nvme_mmio_write_4(ctrlr, cc, cc.raw);
DELAY(5000);
nvme_ctrlr_wait_for_ready(ctrlr, 0);
}
static int
@@ -267,7 +269,7 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr)
if (csts.bits.rdy == 1)
return (0);
else
return (nvme_ctrlr_wait_for_ready(ctrlr));
return (nvme_ctrlr_wait_for_ready(ctrlr, 1));
}
nvme_mmio_write_8(ctrlr, asq, ctrlr->adminq.cmd_bus_addr);
@@ -295,7 +297,7 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr)
nvme_mmio_write_4(ctrlr, cc, cc.raw);
DELAY(5000);
return (nvme_ctrlr_wait_for_ready(ctrlr));
return (nvme_ctrlr_wait_for_ready(ctrlr, 1));
}
int
@@ -930,7 +932,8 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
{
union cap_lo_register cap_lo;
union cap_hi_register cap_hi;
int i, num_vectors, per_cpu_io_queues, rid;
int i, per_cpu_io_queues, rid;
int num_vectors_requested, num_vectors_allocated;
int status, timeout_period;
ctrlr->dev = dev;
@@ -988,7 +991,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
}
/* One vector per IO queue, plus one vector for admin queue. */
num_vectors = ctrlr->num_io_queues + 1;
num_vectors_requested = ctrlr->num_io_queues + 1;
/*
* If we cannot even allocate 2 vectors (one for admin, one for
@@ -997,15 +1000,36 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
if (pci_msix_count(dev) < 2) {
ctrlr->msix_enabled = 0;
goto intx;
} else if (pci_msix_count(dev) < num_vectors) {
} else if (pci_msix_count(dev) < num_vectors_requested) {
ctrlr->per_cpu_io_queues = FALSE;
ctrlr->num_io_queues = 1;
num_vectors = 2; /* one for admin, one for I/O */
num_vectors_requested = 2; /* one for admin, one for I/O */
}
if (pci_alloc_msix(dev, &num_vectors) != 0) {
num_vectors_allocated = num_vectors_requested;
if (pci_alloc_msix(dev, &num_vectors_allocated) != 0) {
ctrlr->msix_enabled = 0;
goto intx;
} else if (num_vectors_allocated < num_vectors_requested) {
if (num_vectors_allocated < 2) {
pci_release_msi(dev);
ctrlr->msix_enabled = 0;
goto intx;
} else {
ctrlr->per_cpu_io_queues = FALSE;
ctrlr->num_io_queues = 1;
/*
* Release whatever vectors were allocated, and just
* reallocate the two needed for the admin and single
* I/O qpair.
*/
num_vectors_allocated = 2;
pci_release_msi(dev);
if (pci_alloc_msix(dev, &num_vectors_allocated) != 0)
panic("could not reallocate any vectors\n");
if (num_vectors_allocated != 2)
panic("could not reallocate 2 vectors\n");
}
}
/*
@@ -1022,7 +1046,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
* vendors wishing to import this driver into kernels based on
* older versions of FreeBSD.
*/
for (i = 0; i < num_vectors; i++) {
for (i = 0; i < num_vectors_allocated; i++) {
rid = i + 1;
ctrlr->msi_res[i] = bus_alloc_resource_any(ctrlr->dev,
SYS_RES_IRQ, &rid, RF_ACTIVE);
+42 -6
View File
@@ -258,6 +258,32 @@ cbb_pci_probe(device_t brdev)
return (ENXIO);
}
/*
* Still need this because the pci code only does power for type 0
* header devices.
*/
static void
cbb_powerstate_d0(device_t dev)
{
u_int32_t membase, irq;
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
/* Save important PCI config data. */
membase = pci_read_config(dev, CBBR_SOCKBASE, 4);
irq = pci_read_config(dev, PCIR_INTLINE, 4);
/* Reset the power state. */
device_printf(dev, "chip is in D%d power mode "
"-- setting to D0\n", pci_get_powerstate(dev));
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
/* Restore PCI config data. */
pci_write_config(dev, CBBR_SOCKBASE, membase, 4);
pci_write_config(dev, PCIR_INTLINE, irq, 4);
}
}
/*
* Print out the config space
*/
@@ -295,15 +321,15 @@ cbb_pci_attach(device_t brdev)
sc->cbdev = NULL;
sc->exca[0].pccarddev = NULL;
sc->domain = pci_get_domain(brdev);
sc->bus.sec = pci_read_config(brdev, PCIR_SECBUS_2, 1);
sc->bus.sub = pci_read_config(brdev, PCIR_SUBBUS_2, 1);
sc->pribus = pcib_get_bus(parent);
#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
pci_write_config(brdev, PCIR_PRIBUS_2, sc->pribus, 1);
pcib_setup_secbus(brdev, &sc->bus, 1);
#else
sc->bus.sec = pci_read_config(brdev, PCIR_SECBUS_2, 1);
sc->bus.sub = pci_read_config(brdev, PCIR_SUBBUS_2, 1);
#endif
SLIST_INIT(&sc->rl);
cbb_powerstate_d0(brdev);
rid = CBBR_SOCKBASE;
sc->base_res = bus_alloc_resource_any(brdev, SYS_RES_MEMORY, &rid,
@@ -448,6 +474,11 @@ cbb_chipinit(struct cbb_softc *sc)
if (pci_read_config(sc->dev, PCIR_LATTIMER, 1) < 0x20)
pci_write_config(sc->dev, PCIR_LATTIMER, 0x20, 1);
/* Restore bus configuration */
pci_write_config(sc->dev, PCIR_PRIBUS_2, sc->pribus, 1);
pci_write_config(sc->dev, PCIR_SECBUS_2, sc->bus.sec, 1);
pci_write_config(sc->dev, PCIR_SUBBUS_2, sc->bus.sub, 1);
/* Enable DMA, memory access for this card and I/O acces for children */
pci_enable_busmaster(sc->dev);
pci_enable_io(sc->dev, SYS_RES_IOPORT);
@@ -875,10 +906,15 @@ cbb_pci_resume(device_t brdev)
* from D0 and back to D0 cause the bridge to lose its config space, so
* all the bus mappings and such are preserved.
*
* The PCI layer handles standard PCI registers like the
* command register and BARs, but cbb-specific registers are
* handled here.
* For most drivers, the PCI layer handles this saving. However, since
* there's much black magic and arcane art hidden in these few lines of
* code that would be difficult to transition into the PCI
* layer. chipinit was several years of trial and error to write.
*/
pci_write_config(brdev, CBBR_SOCKBASE, rman_get_start(sc->base_res), 4);
DEVPRINTF((brdev, "PCI Memory allocated: %08lx\n",
rman_get_start(sc->base_res)));
sc->chipinit(sc);
/* reset interrupt -- Do we really need to do this? */
+31 -76
View File
@@ -590,19 +590,9 @@ pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg)
cfg->nummaps = PCI_MAXMAPS_0;
break;
case PCIM_HDRTYPE_BRIDGE:
cfg->bridge.br_seclat = REG(PCIR_SECLAT_1, 1);
cfg->bridge.br_subbus = REG(PCIR_SUBBUS_1, 1);
cfg->bridge.br_secbus = REG(PCIR_SECBUS_1, 1);
cfg->bridge.br_pribus = REG(PCIR_PRIBUS_1, 1);
cfg->bridge.br_control = REG(PCIR_BRIDGECTL_1, 2);
cfg->nummaps = PCI_MAXMAPS_1;
break;
case PCIM_HDRTYPE_CARDBUS:
cfg->bridge.br_seclat = REG(PCIR_SECLAT_2, 1);
cfg->bridge.br_subbus = REG(PCIR_SUBBUS_2, 1);
cfg->bridge.br_secbus = REG(PCIR_SECBUS_2, 1);
cfg->bridge.br_pribus = REG(PCIR_PRIBUS_2, 1);
cfg->bridge.br_control = REG(PCIR_BRIDGECTL_2, 2);
cfg->subvendor = REG(PCIR_SUBVEND_2, 2);
cfg->subdevice = REG(PCIR_SUBDEV_2, 2);
cfg->nummaps = PCI_MAXMAPS_2;
@@ -4947,6 +4937,16 @@ void
pci_cfg_restore(device_t dev, struct pci_devinfo *dinfo)
{
/*
* Only do header type 0 devices. Type 1 devices are bridges,
* which we know need special treatment. Type 2 devices are
* cardbus bridges which also require special treatment.
* Other types are unknown, and we err on the side of safety
* by ignoring them.
*/
if ((dinfo->cfg.hdrtype & PCIM_HDRTYPE) != PCIM_HDRTYPE_NORMAL)
return;
/*
* Restore the device to full power mode. We must do this
* before we restore the registers because moving from D3 to
@@ -4957,44 +4957,16 @@ pci_cfg_restore(device_t dev, struct pci_devinfo *dinfo)
*/
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0)
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
pci_restore_bars(dev);
pci_write_config(dev, PCIR_COMMAND, dinfo->cfg.cmdreg, 2);
pci_write_config(dev, PCIR_INTLINE, dinfo->cfg.intline, 1);
pci_write_config(dev, PCIR_INTPIN, dinfo->cfg.intpin, 1);
pci_write_config(dev, PCIR_MINGNT, dinfo->cfg.mingnt, 1);
pci_write_config(dev, PCIR_MAXLAT, dinfo->cfg.maxlat, 1);
pci_write_config(dev, PCIR_CACHELNSZ, dinfo->cfg.cachelnsz, 1);
pci_write_config(dev, PCIR_LATTIMER, dinfo->cfg.lattimer, 1);
pci_write_config(dev, PCIR_PROGIF, dinfo->cfg.progif, 1);
pci_write_config(dev, PCIR_REVID, dinfo->cfg.revid, 1);
switch (dinfo->cfg.hdrtype & PCIM_HDRTYPE) {
case PCIM_HDRTYPE_NORMAL:
pci_write_config(dev, PCIR_MINGNT, dinfo->cfg.mingnt, 1);
pci_write_config(dev, PCIR_MAXLAT, dinfo->cfg.maxlat, 1);
break;
case PCIM_HDRTYPE_BRIDGE:
pci_write_config(dev, PCIR_SECLAT_1,
dinfo->cfg.bridge.br_seclat, 1);
pci_write_config(dev, PCIR_SUBBUS_1,
dinfo->cfg.bridge.br_subbus, 1);
pci_write_config(dev, PCIR_SECBUS_1,
dinfo->cfg.bridge.br_secbus, 1);
pci_write_config(dev, PCIR_PRIBUS_1,
dinfo->cfg.bridge.br_pribus, 1);
pci_write_config(dev, PCIR_BRIDGECTL_1,
dinfo->cfg.bridge.br_control, 2);
break;
case PCIM_HDRTYPE_CARDBUS:
pci_write_config(dev, PCIR_SECLAT_2,
dinfo->cfg.bridge.br_seclat, 1);
pci_write_config(dev, PCIR_SUBBUS_2,
dinfo->cfg.bridge.br_subbus, 1);
pci_write_config(dev, PCIR_SECBUS_2,
dinfo->cfg.bridge.br_secbus, 1);
pci_write_config(dev, PCIR_PRIBUS_2,
dinfo->cfg.bridge.br_pribus, 1);
pci_write_config(dev, PCIR_BRIDGECTL_2,
dinfo->cfg.bridge.br_control, 2);
break;
}
pci_restore_bars(dev);
/*
* Restore extended capabilities for PCI-Express and PCI-X
@@ -5062,58 +5034,41 @@ pci_cfg_save(device_t dev, struct pci_devinfo *dinfo, int setstate)
uint32_t cls;
int ps;
/*
* Only do header type 0 devices. Type 1 devices are bridges, which
* we know need special treatment. Type 2 devices are cardbus bridges
* which also require special treatment. Other types are unknown, and
* we err on the side of safety by ignoring them. Powering down
* bridges should not be undertaken lightly.
*/
if ((dinfo->cfg.hdrtype & PCIM_HDRTYPE) != PCIM_HDRTYPE_NORMAL)
return;
/*
* Some drivers apparently write to these registers w/o updating our
* cached copy. No harm happens if we update the copy, so do so here
* so we can restore them. The COMMAND register is modified by the
* bus w/o updating the cache. This should represent the normally
* writable portion of the 'defined' part of type 0/1/2 headers.
* writable portion of the 'defined' part of type 0 headers. In
* theory we also need to save/restore the PCI capability structures
* we know about, but apart from power we don't know any that are
* writable.
*/
dinfo->cfg.subvendor = pci_read_config(dev, PCIR_SUBVEND_0, 2);
dinfo->cfg.subdevice = pci_read_config(dev, PCIR_SUBDEV_0, 2);
dinfo->cfg.vendor = pci_read_config(dev, PCIR_VENDOR, 2);
dinfo->cfg.device = pci_read_config(dev, PCIR_DEVICE, 2);
dinfo->cfg.cmdreg = pci_read_config(dev, PCIR_COMMAND, 2);
dinfo->cfg.intline = pci_read_config(dev, PCIR_INTLINE, 1);
dinfo->cfg.intpin = pci_read_config(dev, PCIR_INTPIN, 1);
dinfo->cfg.mingnt = pci_read_config(dev, PCIR_MINGNT, 1);
dinfo->cfg.maxlat = pci_read_config(dev, PCIR_MAXLAT, 1);
dinfo->cfg.cachelnsz = pci_read_config(dev, PCIR_CACHELNSZ, 1);
dinfo->cfg.lattimer = pci_read_config(dev, PCIR_LATTIMER, 1);
dinfo->cfg.baseclass = pci_read_config(dev, PCIR_CLASS, 1);
dinfo->cfg.subclass = pci_read_config(dev, PCIR_SUBCLASS, 1);
dinfo->cfg.progif = pci_read_config(dev, PCIR_PROGIF, 1);
dinfo->cfg.revid = pci_read_config(dev, PCIR_REVID, 1);
switch (dinfo->cfg.hdrtype & PCIM_HDRTYPE) {
case PCIM_HDRTYPE_NORMAL:
dinfo->cfg.subvendor = pci_read_config(dev, PCIR_SUBVEND_0, 2);
dinfo->cfg.subdevice = pci_read_config(dev, PCIR_SUBDEV_0, 2);
dinfo->cfg.mingnt = pci_read_config(dev, PCIR_MINGNT, 1);
dinfo->cfg.maxlat = pci_read_config(dev, PCIR_MAXLAT, 1);
break;
case PCIM_HDRTYPE_BRIDGE:
dinfo->cfg.bridge.br_seclat = pci_read_config(dev,
PCIR_SECLAT_1, 1);
dinfo->cfg.bridge.br_subbus = pci_read_config(dev,
PCIR_SUBBUS_1, 1);
dinfo->cfg.bridge.br_secbus = pci_read_config(dev,
PCIR_SECBUS_1, 1);
dinfo->cfg.bridge.br_pribus = pci_read_config(dev,
PCIR_PRIBUS_1, 1);
dinfo->cfg.bridge.br_control = pci_read_config(dev,
PCIR_BRIDGECTL_1, 2);
break;
case PCIM_HDRTYPE_CARDBUS:
dinfo->cfg.bridge.br_seclat = pci_read_config(dev,
PCIR_SECLAT_2, 1);
dinfo->cfg.bridge.br_subbus = pci_read_config(dev,
PCIR_SUBBUS_2, 1);
dinfo->cfg.bridge.br_secbus = pci_read_config(dev,
PCIR_SECBUS_2, 1);
dinfo->cfg.bridge.br_pribus = pci_read_config(dev,
PCIR_PRIBUS_2, 1);
dinfo->cfg.bridge.br_control = pci_read_config(dev,
PCIR_BRIDGECTL_2, 2);
dinfo->cfg.subvendor = pci_read_config(dev, PCIR_SUBVEND_2, 2);
dinfo->cfg.subdevice = pci_read_config(dev, PCIR_SUBDEV_2, 2);
break;
}
if (dinfo->cfg.pcie.pcie_location != 0)
pci_cfg_save_pcie(dev, dinfo);
+20 -21
View File
@@ -549,22 +549,18 @@ void
pcib_setup_secbus(device_t dev, struct pcib_secbus *bus, int min_count)
{
char buf[64];
int error, rid, sec_reg;
int error, rid;
switch (pci_read_config(dev, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) {
case PCIM_HDRTYPE_BRIDGE:
sec_reg = PCIR_SECBUS_1;
bus->sub_reg = PCIR_SUBBUS_1;
break;
case PCIM_HDRTYPE_CARDBUS:
sec_reg = PCIR_SECBUS_2;
bus->sub_reg = PCIR_SUBBUS_2;
break;
default:
panic("not a PCI bridge");
}
bus->sec = pci_read_config(dev, sec_reg, 1);
bus->sub = pci_read_config(dev, bus->sub_reg, 1);
bus->dev = dev;
bus->rman.rm_start = 0;
bus->rman.rm_end = PCI_BUSMAX;
@@ -849,16 +845,20 @@ pcib_set_mem_decode(struct pcib_softc *sc)
static void
pcib_cfg_save(struct pcib_softc *sc)
{
#ifndef NEW_PCIB
device_t dev;
uint16_t command;
dev = sc->dev;
command = pci_read_config(dev, PCIR_COMMAND, 2);
if (command & PCIM_CMD_PORTEN)
sc->command = pci_read_config(dev, PCIR_COMMAND, 2);
sc->pribus = pci_read_config(dev, PCIR_PRIBUS_1, 1);
sc->bus.sec = pci_read_config(dev, PCIR_SECBUS_1, 1);
sc->bus.sub = pci_read_config(dev, PCIR_SUBBUS_1, 1);
sc->bridgectl = pci_read_config(dev, PCIR_BRIDGECTL_1, 2);
sc->seclat = pci_read_config(dev, PCIR_SECLAT_1, 1);
#ifndef NEW_PCIB
if (sc->command & PCIM_CMD_PORTEN)
pcib_get_io_decode(sc);
if (command & PCIM_CMD_MEMEN)
if (sc->command & PCIM_CMD_MEMEN)
pcib_get_mem_decode(sc);
#endif
}
@@ -870,18 +870,21 @@ static void
pcib_cfg_restore(struct pcib_softc *sc)
{
device_t dev;
#ifndef NEW_PCIB
uint16_t command;
#endif
dev = sc->dev;
pci_write_config(dev, PCIR_COMMAND, sc->command, 2);
pci_write_config(dev, PCIR_PRIBUS_1, sc->pribus, 1);
pci_write_config(dev, PCIR_SECBUS_1, sc->bus.sec, 1);
pci_write_config(dev, PCIR_SUBBUS_1, sc->bus.sub, 1);
pci_write_config(dev, PCIR_BRIDGECTL_1, sc->bridgectl, 2);
pci_write_config(dev, PCIR_SECLAT_1, sc->seclat, 1);
#ifdef NEW_PCIB
pcib_write_windows(sc, WIN_IO | WIN_MEM | WIN_PMEM);
#else
command = pci_read_config(dev, PCIR_COMMAND, 2);
if (command & PCIM_CMD_PORTEN)
if (sc->command & PCIM_CMD_PORTEN)
pcib_set_io_decode(sc);
if (command & PCIM_CMD_MEMEN)
if (sc->command & PCIM_CMD_MEMEN)
pcib_set_mem_decode(sc);
#endif
}
@@ -915,11 +918,7 @@ pcib_attach_common(device_t dev)
* Get current bridge configuration.
*/
sc->domain = pci_get_domain(dev);
#if !(defined(NEW_PCIB) && defined(PCI_RES_BUS))
sc->bus.sec = pci_read_config(dev, PCIR_SECBUS_1, 1);
sc->bus.sub = pci_read_config(dev, PCIR_SUBBUS_1, 1);
#endif
sc->bridgectl = pci_read_config(dev, PCIR_BRIDGECTL_1, 2);
sc->secstat = pci_read_config(dev, PCIR_SECSTAT_1, 2);
pcib_cfg_save(sc);
/*
+3
View File
@@ -106,6 +106,7 @@ struct pcib_softc
#define PCIB_DISABLE_MSI 0x2
#define PCIB_DISABLE_MSIX 0x4
#define PCIB_ENABLE_ARI 0x8
uint16_t command; /* command register */
u_int domain; /* domain number */
u_int pribus; /* primary bus number */
struct pcib_secbus bus; /* secondary bus numbers */
@@ -121,7 +122,9 @@ struct pcib_softc
uint32_t iobase; /* base address of port window */
uint32_t iolimit; /* topmost address of port window */
#endif
uint16_t secstat; /* secondary bus status register */
uint16_t bridgectl; /* bridge control register */
uint8_t seclat; /* secondary bus latency timer */
};
#define PCIB_SUPPORTED_ARI_VER 1
-10
View File
@@ -39,15 +39,6 @@
typedef uint64_t pci_addr_t;
/* Config registers for PCI-PCI and PCI-Cardbus bridges. */
struct pcicfg_bridge {
uint8_t br_seclat;
uint8_t br_subbus;
uint8_t br_secbus;
uint8_t br_pribus;
uint16_t br_control;
};
/* Interesting values for PCI power management */
struct pcicfg_pp {
uint16_t pp_cap; /* PCI power management capabilities */
@@ -188,7 +179,6 @@ typedef struct pcicfg {
uint8_t slot; /* config space slot address */
uint8_t func; /* config space function number */
struct pcicfg_bridge bridge; /* Bridges */
struct pcicfg_pp pp; /* Power management */
struct pcicfg_vpd vpd; /* Vital product data */
struct pcicfg_msi msi; /* PCI MSI */
+21 -27
View File
@@ -19,6 +19,7 @@
*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
******************************************************************************/
/* $FreeBSD$ */
/******************************************************************************
This program is part of PMC-Sierra initiator/target device driver.
The functions here are commonly used by different type of drivers that support
@@ -756,37 +757,30 @@ STATIC int agtiapi_ProbeCard( device_t dev,
int thisCard )
{
int idx;
static U32 cardMap[4] = { 0, 0, 0, 0 };
u_int16_t agtiapi_vendor; // PCI vendor ID
u_int16_t agtiapi_dev; // PCI device ID
AGTIAPI_PRINTK("agtiapi_ProbeCard: start\n");
if ( ! atomic_cmpset_32( &cardMap[thisCard], 0, 5 ) ) { // card already ran
AGTIAPI_PRINTK( "We'll only ID this card once -- %d\n", thisCard );
return 2; // error return value; card already ran this function
}
else {
agtiapi_dev = pci_get_device( dev ); // get PCI device ID
for( idx = 0; idx < COUNT(ag_card_type); idx++ )
{
if( ag_card_type[idx].deviceId == agtiapi_dev )
{ // device ID match
memset( (void *)&agCardInfoList[ thisCard ], 0,
sizeof(ag_card_info_t) );
thisCardInst->cardIdIndex = idx;
thisCardInst->pPCIDev = dev;
thisCardInst->cardNameIndex = ag_card_type[idx].cardNameIndex;
thisCardInst->cardID =
pci_read_config( dev, ag_card_type[idx].membar, 4 ); // memAddr
AGTIAPI_PRINTK("agtiapi_ProbeCard: We've got PMC SAS, probe successful %p / %p\n",
thisCardInst->pPCIDev, thisCardInst );
device_printf( dev,
"agtiapi PCI Probe Vendor ID : 0x%x Device ID : 0x%x\n",
pci_get_vendor(dev), agtiapi_dev );
device_set_desc( dev, ag_card_names[ag_card_type[idx].cardNameIndex] );
return 0;
}
agtiapi_vendor = pci_get_vendor( dev ); // get PCI vendor ID
agtiapi_dev = pci_get_device( dev ); // get PCI device ID
for( idx = 0; idx < COUNT(ag_card_type); idx++ )
{
if ( ag_card_type[idx].deviceId == agtiapi_dev &&
ag_card_type[idx].vendorId == agtiapi_vendor)
{ // device ID match
memset( (void *)&agCardInfoList[ thisCard ], 0,
sizeof(ag_card_info_t) );
thisCardInst->cardIdIndex = idx;
thisCardInst->pPCIDev = dev;
thisCardInst->cardNameIndex = ag_card_type[idx].cardNameIndex;
thisCardInst->cardID =
pci_read_config( dev, ag_card_type[idx].membar, 4 ); // memAddr
AGTIAPI_PRINTK("agtiapi_ProbeCard: We've got PMC SAS, probe successful %p / %p\n",
thisCardInst->pPCIDev, thisCardInst );
device_set_desc( dev, ag_card_names[ag_card_type[idx].cardNameIndex] );
return 0;
}
}
return 7;
return 1;
}
+12 -30
View File
@@ -214,7 +214,6 @@ STATIC void agtiapi_CheckIOTimeout(void *data);
static unsigned char cardMap[AGTIAPI_MAX_CARDS] = { 0, 0, 0, 0 };
static ag_card_info_t agCardInfoList[ AGTIAPI_MAX_CARDS ]; // card info list
static void agtiapi_cam_action( struct cam_sim *, union ccb * );
static void agtiapi_cam_poll( struct cam_sim * );
@@ -695,37 +694,20 @@ Note:
static int agtiapi_probe( device_t dev )
{
int retVal;
if ( pci_get_vendor(dev) == PCI_VENDOR_ID_PMC_SIERRA ||
pci_get_vendor(dev) == PCI_VENDOR_ID_HIALEAH )
int thisCard;
ag_card_info_t *thisCardInst;
thisCard = device_get_unit( dev );
if ( thisCard >= AGTIAPI_MAX_CARDS )
{
int thisCard = device_get_unit( dev );
// AGTIAPI_PRINTK("agtiapi_probe: thisCard %d\n", thisCard);
if( thisCard >= AGTIAPI_MAX_CARDS)
{
device_printf( dev, "Too many PMC-Sierra cards detected ERROR!\n" );
return (ENXIO); // maybe change to different return value?
}
ag_card_info_t *thisCardInst = &agCardInfoList[ thisCard ];
retVal = agtiapi_ProbeCard( dev, thisCardInst, thisCard );
if ( retVal ) {
// error on probe
if( retVal == 2 ) return 0; // another thread ran probe on this card
device_printf( dev,
"agtiapi_probe: PCI DEVICE NOT SUPPORTED by this driver!!"
"Vendor ID : 0x%x Device ID : 0x%x\n",
pci_get_vendor(dev), pci_get_device( dev ) );
return (ENXIO); // maybe change to different return value?
}
else {
// AGTIAPI_PRINTK( "agtiapi_ProbeCard: returned with pointer values "
// "%p / %p\n",
// thisCardInst->pPCIDev, thisCardInst );
cardMap[thisCard] = 11; // record this card is present
return( BUS_PROBE_DEFAULT ); // successful probe
}
device_printf( dev, "Too many PMC-Sierra cards detected ERROR!\n" );
return (ENXIO); // maybe change to different return value?
}
return (ENXIO);
thisCardInst = &agCardInfoList[ thisCard ];
retVal = agtiapi_ProbeCard( dev, thisCardInst, thisCard );
if ( retVal )
return (ENXIO); // maybe change to different return value?
return( BUS_PROBE_DEFAULT ); // successful probe
}
+6 -3
View File
@@ -98,6 +98,7 @@ struct uart_softc {
int sc_polled:1; /* This UART has no interrupts. */
int sc_txbusy:1; /* This UART is transmitting. */
int sc_isquelch:1; /* This UART has input squelched. */
int sc_testintr:1; /* This UART is under int. testing. */
struct uart_devinfo *sc_sysdev; /* System device (or NULL). */
@@ -134,7 +135,7 @@ struct uart_softc {
};
extern devclass_t uart_devclass;
extern char uart_driver_name[];
extern const char uart_driver_name[];
int uart_bus_attach(device_t dev);
int uart_bus_detach(device_t dev);
@@ -156,14 +157,16 @@ void uart_tty_intr(void *arg);
static __inline int
uart_rx_empty(struct uart_softc *sc)
{
return ((sc->sc_rxget == sc->sc_rxput) ? 1 : 0);
}
static __inline int
uart_rx_full(struct uart_softc *sc)
{
return ((sc->sc_rxput + 1 < sc->sc_rxbufsz)
? (sc->sc_rxput + 1 == sc->sc_rxget) : (sc->sc_rxget == 0));
return ((sc->sc_rxput + 1 < sc->sc_rxbufsz) ?
(sc->sc_rxput + 1 == sc->sc_rxget) : (sc->sc_rxget == 0));
}
static __inline int
+10 -6
View File
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
#include "uart_if.h"
devclass_t uart_devclass;
char uart_driver_name[] = "uart";
const char uart_driver_name[] = "uart";
SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs =
SLIST_HEAD_INITIALIZER(uart_sysdevs);
@@ -248,13 +248,14 @@ static int
uart_intr(void *arg)
{
struct uart_softc *sc = arg;
int cnt, ipend;
int cnt, ipend, testintr;
if (sc->sc_leaving)
return (FILTER_STRAY);
cnt = 0;
while (cnt < 20 && (ipend = UART_IPEND(sc)) != 0) {
testintr = sc->sc_testintr;
while ((!testintr || cnt < 20) && (ipend = UART_IPEND(sc)) != 0) {
cnt++;
if (ipend & SER_INT_OVERRUN)
uart_intr_overrun(sc);
@@ -265,7 +266,7 @@ uart_intr(void *arg)
if (ipend & SER_INT_SIGCHG)
uart_intr_sigchg(sc);
if (ipend & SER_INT_TXIDLE)
uart_intr_txidle(sc);
uart_intr_txidle(sc);
}
if (sc->sc_polled) {
@@ -274,7 +275,8 @@ uart_intr(void *arg)
}
return ((cnt == 0) ? FILTER_STRAY :
((cnt == 20) ? FILTER_SCHEDULE_THREAD : FILTER_HANDLED));
((testintr && cnt == 20) ? FILTER_SCHEDULE_THREAD :
FILTER_HANDLED));
}
serdev_intr_t *
@@ -421,7 +423,7 @@ uart_bus_attach(device_t dev)
/*
* Protect ourselves against interrupts while we're not completely
* finished attaching and initializing. We don't expect interrupts
* until after UART_ATTACH() though.
* until after UART_ATTACH(), though.
*/
sc->sc_leaving = 1;
@@ -501,7 +503,9 @@ uart_bus_attach(device_t dev)
pps_init(&sc->sc_pps);
sc->sc_leaving = 0;
sc->sc_testintr = 1;
filt = uart_intr(sc);
sc->sc_testintr = 0;
/*
* Don't use interrupts if we couldn't clear any pending interrupt
+2 -1
View File
@@ -166,7 +166,8 @@ device ida # Compaq Smart RAID
device mfi # LSI MegaRAID SAS
device mlx # Mylex DAC960 family
device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s
device pmspcv # PMC-Sierra SAS/SATA Controller driver
#XXX PCI ID conflicts with ahd(4) and mvs(4)
#device pmspcv # PMC-Sierra SAS/SATA Controller driver
device pst # Promise Supertrak SX6000
device twe # 3ware ATA RAID
+24 -28
View File
@@ -418,9 +418,10 @@ kern_fcntl_freebsd(struct thread *td, int fd, int cmd, long arg)
struct flock fl;
struct __oflock ofl;
intptr_t arg1;
int error;
int error, newcmd;
error = 0;
newcmd = cmd;
switch (cmd) {
case F_OGETLK:
case F_OSETLK:
@@ -438,31 +439,31 @@ kern_fcntl_freebsd(struct thread *td, int fd, int cmd, long arg)
switch (cmd) {
case F_OGETLK:
cmd = F_GETLK;
break;
newcmd = F_GETLK;
break;
case F_OSETLK:
cmd = F_SETLK;
break;
newcmd = F_SETLK;
break;
case F_OSETLKW:
cmd = F_SETLKW;
break;
newcmd = F_SETLKW;
break;
}
arg1 = (intptr_t)&fl;
break;
case F_GETLK:
case F_SETLK:
case F_SETLKW:
case F_GETLK:
case F_SETLK:
case F_SETLKW:
case F_SETLK_REMOTE:
error = copyin((void *)(intptr_t)arg, &fl, sizeof(fl));
arg1 = (intptr_t)&fl;
break;
error = copyin((void *)(intptr_t)arg, &fl, sizeof(fl));
arg1 = (intptr_t)&fl;
break;
default:
arg1 = arg;
break;
}
if (error)
return (error);
error = kern_fcntl(td, fd, cmd, arg1);
error = kern_fcntl(td, fd, newcmd, arg1);
if (error)
return (error);
if (cmd == F_OGETLK) {
@@ -746,7 +747,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg)
if ((flp->l_start > 0 &&
foffset > OFF_MAX - flp->l_start) ||
(flp->l_start < 0 &&
foffset < OFF_MIN - flp->l_start)) {
foffset < OFF_MIN - flp->l_start)) {
FILEDESC_SUNLOCK(fdp);
error = EOVERFLOW;
fdrop(fp, td);
@@ -954,13 +955,13 @@ funsetown(struct sigio **sigiop)
struct pgrp *pg = (sigio)->sio_pgrp;
PGRP_LOCK(pg);
SLIST_REMOVE(&sigio->sio_pgrp->pg_sigiolst, sigio,
sigio, sio_pgsigio);
sigio, sio_pgsigio);
PGRP_UNLOCK(pg);
} else {
struct proc *p = (sigio)->sio_proc;
PROC_LOCK(p);
SLIST_REMOVE(&sigio->sio_proc->p_sigiolst, sigio,
sigio, sio_pgsigio);
sigio, sio_pgsigio);
PROC_UNLOCK(p);
}
SIGIO_UNLOCK();
@@ -1214,18 +1215,14 @@ struct close_args {
#endif
/* ARGSUSED */
int
sys_close(td, uap)
struct thread *td;
struct close_args *uap;
sys_close(struct thread *td, struct close_args *uap)
{
return (kern_close(td, uap->fd));
}
int
kern_close(td, fd)
struct thread *td;
int fd;
kern_close(struct thread *td, int fd)
{
struct filedesc *fdp;
struct file *fp;
@@ -2312,10 +2309,10 @@ closef(struct file *fp, struct thread *td)
fdp = td->td_proc->p_fd;
FILEDESC_XLOCK(fdp);
for (fdtol = fdtol->fdl_next;
fdtol != td->td_proc->p_fdtol;
fdtol = fdtol->fdl_next) {
fdtol != td->td_proc->p_fdtol;
fdtol = fdtol->fdl_next) {
if ((fdtol->fdl_leader->p_flag &
P_ADVLOCK) == 0)
P_ADVLOCK) == 0)
continue;
fdtol->fdl_holdcount++;
FILEDESC_XUNLOCK(fdp);
@@ -2933,8 +2930,7 @@ filedesc_to_leader_alloc(struct filedesc_to_leader *old, struct filedesc *fdp, s
struct filedesc_to_leader *fdtol;
fdtol = malloc(sizeof(struct filedesc_to_leader),
M_FILEDESC_TO_LEADER,
M_WAITOK);
M_FILEDESC_TO_LEADER, M_WAITOK);
fdtol->fdl_refcount = 1;
fdtol->fdl_holdcount = 0;
fdtol->fdl_wakeup = 0;
+1
View File
@@ -78,6 +78,7 @@ int racct_enable = 1;
#endif
SYSCTL_NODE(_kern, OID_AUTO, racct, CTLFLAG_RW, 0, "Resource Accounting");
TUNABLE_INT("kern.racct.enable", &racct_enable);
SYSCTL_UINT(_kern_racct, OID_AUTO, enable, CTLFLAG_RDTUN, &racct_enable,
0, "Enable RACCT/RCTL");
SYSCTL_UINT(_kern_racct, OID_AUTO, pcpu_threshold, CTLFLAG_RW, &pcpu_threshold,
+3
View File
@@ -666,6 +666,9 @@ static struct witness_order_list_entry order_lists[] = {
*/
{ "intrcnt", &lock_class_mtx_spin },
{ "icu", &lock_class_mtx_spin },
#if defined(SMP) && defined(__sparc64__)
{ "ipi", &lock_class_mtx_spin },
#endif
#ifdef __i386__
{ "allpmaps", &lock_class_mtx_spin },
{ "descriptor tables", &lock_class_mtx_spin },
-1
View File
@@ -1549,7 +1549,6 @@ extern struct pf_state *pf_find_state_all(struct pf_state_key_cmp *,
extern struct pf_src_node *pf_find_src_node(struct pf_addr *,
struct pf_rule *, sa_family_t, int);
extern void pf_unlink_src_node(struct pf_src_node *);
extern void pf_unlink_src_node_locked(struct pf_src_node *);
extern u_int pf_free_src_nodes(struct pf_src_node_list *);
extern void pf_print_state(struct pf_state *);
extern void pf_print_flags(u_int8_t);
+24 -36
View File
@@ -79,25 +79,22 @@ static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS);
static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0,
"TCP Segment Reassembly Queue");
static VNET_DEFINE(int, tcp_reass_maxseg) = 0;
#define V_tcp_reass_maxseg VNET(tcp_reass_maxseg)
SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN,
&VNET_NAME(tcp_reass_maxseg), 0,
static int tcp_reass_maxseg = 0;
SYSCTL_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN,
&tcp_reass_maxseg, 0,
"Global maximum number of TCP Segments in Reassembly Queue");
SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments,
SYSCTL_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments,
(CTLTYPE_INT | CTLFLAG_RD), NULL, 0, &tcp_reass_sysctl_qsize, "I",
"Global number of TCP Segments currently in Reassembly Queue");
static VNET_DEFINE(int, tcp_reass_overflows) = 0;
#define V_tcp_reass_overflows VNET(tcp_reass_overflows)
SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows,
static int tcp_reass_overflows = 0;
SYSCTL_INT(_net_inet_tcp_reass, OID_AUTO, overflows,
CTLFLAG_RD,
&VNET_NAME(tcp_reass_overflows), 0,
&tcp_reass_overflows, 0,
"Global number of TCP Segment Reassembly Queue Overflows");
static VNET_DEFINE(uma_zone_t, tcp_reass_zone);
#define V_tcp_reass_zone VNET(tcp_reass_zone)
static uma_zone_t tcp_reass_zone;
/* Initialize TCP reassembly queue */
static void
@@ -105,36 +102,27 @@ tcp_reass_zone_change(void *tag)
{
/* Set the zone limit and read back the effective value. */
V_tcp_reass_maxseg = nmbclusters / 16;
V_tcp_reass_maxseg = uma_zone_set_max(V_tcp_reass_zone,
V_tcp_reass_maxseg);
tcp_reass_maxseg = nmbclusters / 16;
tcp_reass_maxseg = uma_zone_set_max(tcp_reass_zone,
tcp_reass_maxseg);
}
void
tcp_reass_init(void)
tcp_reass_global_init(void)
{
V_tcp_reass_maxseg = nmbclusters / 16;
tcp_reass_maxseg = nmbclusters / 16;
TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments",
&V_tcp_reass_maxseg);
V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent),
&tcp_reass_maxseg);
tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
/* Set the zone limit and read back the effective value. */
V_tcp_reass_maxseg = uma_zone_set_max(V_tcp_reass_zone,
V_tcp_reass_maxseg);
tcp_reass_maxseg = uma_zone_set_max(tcp_reass_zone,
tcp_reass_maxseg);
EVENTHANDLER_REGISTER(nmbclusters_change,
tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY);
}
#ifdef VIMAGE
void
tcp_reass_destroy(void)
{
uma_zdestroy(V_tcp_reass_zone);
}
#endif
void
tcp_reass_flush(struct tcpcb *tp)
{
@@ -145,7 +133,7 @@ tcp_reass_flush(struct tcpcb *tp)
while ((qe = LIST_FIRST(&tp->t_segq)) != NULL) {
LIST_REMOVE(qe, tqe_q);
m_freem(qe->tqe_m);
uma_zfree(V_tcp_reass_zone, qe);
uma_zfree(tcp_reass_zone, qe);
tp->t_segqlen--;
}
@@ -159,7 +147,7 @@ tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS)
{
int qsize;
qsize = uma_zone_get_cur(V_tcp_reass_zone);
qsize = uma_zone_get_cur(tcp_reass_zone);
return (sysctl_handle_int(oidp, &qsize, 0, req));
}
@@ -207,7 +195,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m)
*/
if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) &&
tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) {
V_tcp_reass_overflows++;
tcp_reass_overflows++;
TCPSTAT_INC(tcps_rcvmemdrop);
m_freem(m);
*tlenp = 0;
@@ -226,7 +214,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m)
* Use a temporary structure on the stack for the missing segment
* when the zone is exhausted. Otherwise we may get stuck.
*/
te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT);
te = uma_zalloc(tcp_reass_zone, M_NOWAIT);
if (te == NULL) {
if (th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) {
TCPSTAT_INC(tcps_rcvmemdrop);
@@ -277,7 +265,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m)
TCPSTAT_ADD(tcps_rcvdupbyte, *tlenp);
m_freem(m);
if (te != &tqs)
uma_zfree(V_tcp_reass_zone, te);
uma_zfree(tcp_reass_zone, te);
tp->t_segqlen--;
/*
* Try to present any queued data
@@ -314,7 +302,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m)
nq = LIST_NEXT(q, tqe_q);
LIST_REMOVE(q, tqe_q);
m_freem(q->tqe_m);
uma_zfree(V_tcp_reass_zone, q);
uma_zfree(tcp_reass_zone, q);
tp->t_segqlen--;
q = nq;
}
@@ -353,7 +341,7 @@ present:
else
sbappendstream_locked(&so->so_rcv, q->tqe_m);
if (q != &tqs)
uma_zfree(V_tcp_reass_zone, q);
uma_zfree(tcp_reass_zone, q);
tp->t_segqlen--;
q = nq;
} while (q && q->tqe_th->th_seq == tp->rcv_nxt);
+2 -2
View File
@@ -376,7 +376,6 @@ tcp_init(void)
tcp_tw_init();
syncache_init();
tcp_hc_init();
tcp_reass_init();
TUNABLE_INT_FETCH("net.inet.tcp.sack.enable", &V_tcp_do_sack);
V_sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole),
@@ -386,6 +385,8 @@ tcp_init(void)
if (!IS_DEFAULT_VNET(curvnet))
return;
tcp_reass_global_init();
/* XXX virtualize those bellow? */
tcp_delacktime = TCPTV_DELACK;
tcp_keepinit = TCPTV_KEEP_INIT;
@@ -433,7 +434,6 @@ void
tcp_destroy(void)
{
tcp_reass_destroy();
tcp_hc_destroy();
syncache_destroy();
tcp_tw_destroy();
+1 -4
View File
@@ -679,11 +679,8 @@ char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *,
char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *,
const void *);
int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *);
void tcp_reass_init(void);
void tcp_reass_global_init(void);
void tcp_reass_flush(struct tcpcb *);
#ifdef VIMAGE
void tcp_reass_destroy(void);
#endif
void tcp_input(struct mbuf *, int);
u_long tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *);
u_long tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *);
+74 -69
View File
@@ -655,7 +655,10 @@ pf_find_src_node(struct pf_addr *src, struct pf_rule *rule, sa_family_t af,
((af == AF_INET && n->addr.v4.s_addr == src->v4.s_addr) ||
(af == AF_INET6 && bcmp(&n->addr, src, sizeof(*src)) == 0)))
break;
if (n != NULL || returnlocked == 0)
if (n != NULL) {
n->states++;
PF_HASHROW_UNLOCK(sh);
} else if (returnlocked == 0)
PF_HASHROW_UNLOCK(sh);
return (n);
@@ -699,6 +702,7 @@ pf_insert_src_node(struct pf_src_node **sn, struct pf_rule *rule,
LIST_INSERT_HEAD(&sh->nodes, *sn, entry);
(*sn)->creation = time_uptime;
(*sn)->ruletype = rule->action;
(*sn)->states = 1;
if ((*sn)->rule.ptr != NULL)
counter_u64_add((*sn)->rule.ptr->src_nodes, 1);
PF_HASHROW_UNLOCK(sh);
@@ -715,37 +719,13 @@ pf_insert_src_node(struct pf_src_node **sn, struct pf_rule *rule,
}
void
pf_unlink_src_node_locked(struct pf_src_node *src)
pf_unlink_src_node(struct pf_src_node *src)
{
#ifdef INVARIANTS
struct pf_srchash *sh;
sh = &V_pf_srchash[pf_hashsrc(&src->addr, src->af)];
PF_HASHROW_ASSERT(sh);
#endif
PF_HASHROW_ASSERT(&V_pf_srchash[pf_hashsrc(&src->addr, src->af)]);
LIST_REMOVE(src, entry);
if (src->rule.ptr)
counter_u64_add(src->rule.ptr->src_nodes, -1);
counter_u64_add(V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS], 1);
}
void
pf_unlink_src_node(struct pf_src_node *src)
{
struct pf_srchash *sh;
sh = &V_pf_srchash[pf_hashsrc(&src->addr, src->af)];
PF_HASHROW_LOCK(sh);
pf_unlink_src_node_locked(src);
PF_HASHROW_UNLOCK(sh);
}
static void
pf_free_src_node(struct pf_src_node *sn)
{
KASSERT(sn->states == 0, ("%s: %p has refs", __func__, sn));
uma_zfree(V_pf_sources_z, sn);
}
u_int
@@ -755,10 +735,12 @@ pf_free_src_nodes(struct pf_src_node_list *head)
u_int count = 0;
LIST_FOREACH_SAFE(sn, head, entry, tmp) {
pf_free_src_node(sn);
uma_zfree(V_pf_sources_z, sn);
count++;
}
counter_u64_add(V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS], count);
return (count);
}
@@ -1550,7 +1532,7 @@ pf_purge_expired_src_nodes()
PF_HASHROW_LOCK(sh);
LIST_FOREACH_SAFE(cur, &sh->nodes, entry, next)
if (cur->states == 0 && cur->expire <= time_uptime) {
pf_unlink_src_node_locked(cur);
pf_unlink_src_node(cur);
LIST_INSERT_HEAD(&freelist, cur, entry);
} else if (cur->rule.ptr != NULL)
cur->rule.ptr->rule_flag |= PFRULE_REFS;
@@ -1565,27 +1547,31 @@ pf_purge_expired_src_nodes()
static void
pf_src_tree_remove_state(struct pf_state *s)
{
u_int32_t timeout;
struct pf_src_node *sn;
struct pf_srchash *sh;
uint32_t timeout;
timeout = s->rule.ptr->timeout[PFTM_SRC_NODE] ?
s->rule.ptr->timeout[PFTM_SRC_NODE] :
V_pf_default_rule.timeout[PFTM_SRC_NODE];
if (s->src_node != NULL) {
sn = s->src_node;
sh = &V_pf_srchash[pf_hashsrc(&sn->addr, sn->af)];
PF_HASHROW_LOCK(sh);
if (s->src.tcp_est)
--s->src_node->conn;
if (--s->src_node->states == 0) {
timeout = s->rule.ptr->timeout[PFTM_SRC_NODE];
if (!timeout)
timeout =
V_pf_default_rule.timeout[PFTM_SRC_NODE];
s->src_node->expire = time_uptime + timeout;
}
--sn->conn;
if (--sn->states == 0)
sn->expire = time_uptime + timeout;
PF_HASHROW_UNLOCK(sh);
}
if (s->nat_src_node != s->src_node && s->nat_src_node != NULL) {
if (--s->nat_src_node->states == 0) {
timeout = s->rule.ptr->timeout[PFTM_SRC_NODE];
if (!timeout)
timeout =
V_pf_default_rule.timeout[PFTM_SRC_NODE];
s->nat_src_node->expire = time_uptime + timeout;
}
sn = s->nat_src_node;
sh = &V_pf_srchash[pf_hashsrc(&sn->addr, sn->af)];
PF_HASHROW_LOCK(sh);
if (--sn->states == 0)
sn->expire = time_uptime + timeout;
PF_HASHROW_UNLOCK(sh);
}
s->src_node = s->nat_src_node = NULL;
}
@@ -3571,15 +3557,12 @@ pf_create_state(struct pf_rule *r, struct pf_rule *nr, struct pf_rule *a,
s->creation = time_uptime;
s->expire = time_uptime;
if (sn != NULL) {
if (sn != NULL)
s->src_node = sn;
s->src_node->states++;
}
if (nsn != NULL) {
/* XXX We only modify one side for now. */
PF_ACPY(&nsn->raddr, &nk->addr[1], pd->af);
s->nat_src_node = nsn;
s->nat_src_node->states++;
}
if (pd->proto == IPPROTO_TCP) {
if ((pd->flags & PFDESC_TCP_NORM) && pf_normalize_tcp_init(m,
@@ -3677,14 +3660,32 @@ csfailed:
if (nk != NULL)
uma_zfree(V_pf_state_key_z, nk);
if (sn != NULL && sn->states == 0 && sn->expire == 0) {
pf_unlink_src_node(sn);
pf_free_src_node(sn);
if (sn != NULL) {
struct pf_srchash *sh;
sh = &V_pf_srchash[pf_hashsrc(&sn->addr, sn->af)];
PF_HASHROW_LOCK(sh);
if (--sn->states == 0 && sn->expire == 0) {
pf_unlink_src_node(sn);
uma_zfree(V_pf_sources_z, sn);
counter_u64_add(
V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS], 1);
}
PF_HASHROW_UNLOCK(sh);
}
if (nsn != sn && nsn != NULL && nsn->states == 0 && nsn->expire == 0) {
pf_unlink_src_node(nsn);
pf_free_src_node(nsn);
if (nsn != sn && nsn != NULL) {
struct pf_srchash *sh;
sh = &V_pf_srchash[pf_hashsrc(&nsn->addr, nsn->af)];
PF_HASHROW_LOCK(sh);
if (--nsn->states == 0 && nsn->expire == 0) {
pf_unlink_src_node(nsn);
uma_zfree(V_pf_sources_z, nsn);
counter_u64_add(
V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS], 1);
}
PF_HASHROW_UNLOCK(sh);
}
return (PF_DROP);
@@ -5911,13 +5912,14 @@ done:
((pd.pf_mtag = pf_get_mtag(m)) == NULL)) {
action = PF_DROP;
REASON_SET(&reason, PFRES_MEMORY);
} else {
if (pqid || (pd.tos & IPTOS_LOWDELAY))
pd.pf_mtag->qid = r->pqid;
else
pd.pf_mtag->qid = r->qid;
/* Add hints for ecn. */
pd.pf_mtag->hdr = h;
}
if (pqid || (pd.tos & IPTOS_LOWDELAY))
pd.pf_mtag->qid = r->pqid;
else
pd.pf_mtag->qid = r->qid;
/* add hints for ecn */
pd.pf_mtag->hdr = h;
}
#endif /* ALTQ */
@@ -5956,9 +5958,11 @@ done:
log = 1;
DPFPRINTF(PF_DEBUG_MISC,
("pf: failed to allocate tag\n"));
} else {
pd.pf_mtag->flags |=
PF_FASTFWD_OURS_PRESENT;
m->m_flags &= ~M_FASTFWD_OURS;
}
pd.pf_mtag->flags |= PF_FASTFWD_OURS_PRESENT;
m->m_flags &= ~M_FASTFWD_OURS;
}
ip_divert_ptr(*m0, dir == PF_IN ? DIR_IN : DIR_OUT);
*m0 = NULL;
@@ -6340,13 +6344,14 @@ done:
((pd.pf_mtag = pf_get_mtag(m)) == NULL)) {
action = PF_DROP;
REASON_SET(&reason, PFRES_MEMORY);
} else {
if (pd.tos & IPTOS_LOWDELAY)
pd.pf_mtag->qid = r->pqid;
else
pd.pf_mtag->qid = r->qid;
/* Add hints for ecn. */
pd.pf_mtag->hdr = h;
}
if (pd.tos & IPTOS_LOWDELAY)
pd.pf_mtag->qid = r->pqid;
else
pd.pf_mtag->qid = r->qid;
/* add hints for ecn */
pd.pf_mtag->hdr = h;
}
#endif /* ALTQ */
+11 -22
View File
@@ -188,6 +188,7 @@ static volatile VNET_DEFINE(int, pf_pfil_hooked);
VNET_DEFINE(int, pf_end_threads);
struct rwlock pf_rules_lock;
struct sx pf_ioctl_lock;
/* pfsync */
pfsync_state_import_t *pfsync_state_import_ptr = NULL;
@@ -1090,20 +1091,18 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td
switch (cmd) {
case DIOCSTART:
PF_RULES_WLOCK();
sx_xlock(&pf_ioctl_lock);
if (V_pf_status.running)
error = EEXIST;
else {
int cpu;
PF_RULES_WUNLOCK();
error = hook_pf();
if (error) {
DPFPRINTF(PF_DEBUG_MISC,
("pf: pfil registration failed\n"));
break;
}
PF_RULES_WLOCK();
V_pf_status.running = 1;
V_pf_status.since = time_second;
@@ -1112,27 +1111,23 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td
DPFPRINTF(PF_DEBUG_MISC, ("pf: started\n"));
}
PF_RULES_WUNLOCK();
break;
case DIOCSTOP:
PF_RULES_WLOCK();
sx_xlock(&pf_ioctl_lock);
if (!V_pf_status.running)
error = ENOENT;
else {
V_pf_status.running = 0;
PF_RULES_WUNLOCK();
error = dehook_pf();
if (error) {
V_pf_status.running = 1;
DPFPRINTF(PF_DEBUG_MISC,
("pf: pfil unregistration failed\n"));
}
PF_RULES_WLOCK();
V_pf_status.since = time_second;
DPFPRINTF(PF_DEBUG_MISC, ("pf: stopped\n"));
}
PF_RULES_WUNLOCK();
break;
case DIOCADDRULE: {
@@ -3256,6 +3251,8 @@ DIOCCHANGEADDR_error:
break;
}
fail:
if (sx_xlocked(&pf_ioctl_lock))
sx_xunlock(&pf_ioctl_lock);
CURVNET_RESTORE();
return (error);
@@ -3433,7 +3430,7 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk)
&psnk->psnk_dst.addr.v.a.addr,
&psnk->psnk_dst.addr.v.a.mask,
&sn->raddr, sn->af)) {
pf_unlink_src_node_locked(sn);
pf_unlink_src_node(sn);
LIST_INSERT_HEAD(&kill, sn, entry);
sn->expire = 1;
}
@@ -3446,18 +3443,10 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk)
PF_HASHROW_LOCK(ih);
LIST_FOREACH(s, &ih->states, entry) {
if (s->src_node && s->src_node->expire == 1) {
#ifdef INVARIANTS
s->src_node->states--;
#endif
if (s->src_node && s->src_node->expire == 1)
s->src_node = NULL;
}
if (s->nat_src_node && s->nat_src_node->expire == 1) {
#ifdef INVARIANTS
s->nat_src_node->states--;
#endif
if (s->nat_src_node && s->nat_src_node->expire == 1)
s->nat_src_node = NULL;
}
}
PF_HASHROW_UNLOCK(ih);
}
@@ -3728,6 +3717,7 @@ pf_load(void)
VNET_LIST_RUNLOCK();
rw_init(&pf_rules_lock, "pf rulesets");
sx_init(&pf_ioctl_lock, "pf ioctl");
pf_dev = make_dev(&pf_cdevsw, 0, 0, 0, 0600, PF_NAME);
if ((error = pfattach()) != 0)
@@ -3741,9 +3731,7 @@ pf_unload(void)
{
int error = 0;
PF_RULES_WLOCK();
V_pf_status.running = 0;
PF_RULES_WUNLOCK();
swi_remove(V_pf_swi_cookie);
error = dehook_pf();
if (error) {
@@ -3762,6 +3750,7 @@ pf_unload(void)
wakeup_one(pf_purge_thread);
rw_sleep(pf_purge_thread, &pf_rules_lock, 0, "pftmo", 0);
}
PF_RULES_WUNLOCK();
pf_normalize_cleanup();
pfi_cleanup();
pfr_cleanup();
@@ -3769,9 +3758,9 @@ pf_unload(void)
pf_cleanup();
if (IS_DEFAULT_VNET(curvnet))
pf_mtag_cleanup();
PF_RULES_WUNLOCK();
destroy_dev(pf_dev);
rw_destroy(&pf_rules_lock);
sx_destroy(&pf_ioctl_lock);
return (error);
}
+1 -3
View File
@@ -433,6 +433,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent,
}
*(struct pf_fragment_cmp *)frag = *key;
frag->fr_flags = 0;
frag->fr_timeout = time_second;
frag->fr_maxlen = frent->fe_len;
TAILQ_INIT(&frag->fr_queue);
@@ -1298,9 +1299,6 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kif *kif, u_short *reason,
}
}
#endif
if (frag != NULL && (frag->fr_flags & PFFRAG_DROP))
goto drop;
h = mtod(m, struct ip *);
} else {
/* non-buffering fragment cache (drops or masks overlaps) */
+34 -16
View File
@@ -39,13 +39,15 @@
#ifndef LOCORE
#include <sys/param.h>
#include <sys/cpuset.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/sched.h>
#include <sys/smp.h>
#include <machine/intr_machdep.h>
#include <machine/pcb.h>
#include <machine/tte.h>
#define IDR_BUSY 0x0000000000000001ULL
@@ -96,6 +98,7 @@ struct ipi_tlb_args {
};
#define ita_va ita_start
struct pcb;
struct pcpu;
extern struct pcb stoppcbs[];
@@ -108,8 +111,9 @@ extern cpu_ipi_selected_t *cpu_ipi_selected;
typedef void cpu_ipi_single_t(u_int, u_long, u_long, u_long);
extern cpu_ipi_single_t *cpu_ipi_single;
void mp_init(u_int cpu_impl);
void mp_init(void);
extern struct mtx ipi_mtx;
extern struct ipi_cache_args ipi_cache_args;
extern struct ipi_rd_args ipi_rd_args;
extern struct ipi_tlb_args ipi_tlb_args;
@@ -139,23 +143,37 @@ ipi_all_but_self(u_int ipi)
{
cpuset_t cpus;
if (__predict_false(smp_started == 0))
return;
cpus = all_cpus;
sched_pin();
CPU_CLR(PCPU_GET(cpuid), &cpus);
mtx_lock_spin(&ipi_mtx);
cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi);
mtx_unlock_spin(&ipi_mtx);
sched_unpin();
}
static __inline void
ipi_selected(cpuset_t cpus, u_int ipi)
{
if (__predict_false(smp_started == 0 || CPU_EMPTY(&cpus)))
return;
mtx_lock_spin(&ipi_mtx);
cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi);
mtx_unlock_spin(&ipi_mtx);
}
static __inline void
ipi_cpu(int cpu, u_int ipi)
{
if (__predict_false(smp_started == 0))
return;
mtx_lock_spin(&ipi_mtx);
cpu_ipi_single(cpu, 0, (u_long)tl_ipi_level, ipi);
mtx_unlock_spin(&ipi_mtx);
}
#if defined(_MACHINE_PMAP_H_) && defined(_SYS_MUTEX_H_)
@@ -165,11 +183,11 @@ ipi_dcache_page_inval(void *func, vm_paddr_t pa)
{
struct ipi_cache_args *ica;
if (smp_cpus == 1)
if (__predict_false(smp_started == 0))
return (NULL);
sched_pin();
ica = &ipi_cache_args;
mtx_lock_spin(&smp_ipi_mtx);
mtx_lock_spin(&ipi_mtx);
ica->ica_mask = all_cpus;
CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask);
ica->ica_pa = pa;
@@ -182,11 +200,11 @@ ipi_icache_page_inval(void *func, vm_paddr_t pa)
{
struct ipi_cache_args *ica;
if (smp_cpus == 1)
if (__predict_false(smp_started == 0))
return (NULL);
sched_pin();
ica = &ipi_cache_args;
mtx_lock_spin(&smp_ipi_mtx);
mtx_lock_spin(&ipi_mtx);
ica->ica_mask = all_cpus;
CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask);
ica->ica_pa = pa;
@@ -199,11 +217,11 @@ ipi_rd(u_int cpu, void *func, u_long *val)
{
struct ipi_rd_args *ira;
if (smp_cpus == 1)
if (__predict_false(smp_started == 0))
return (NULL);
sched_pin();
ira = &ipi_rd_args;
mtx_lock_spin(&smp_ipi_mtx);
mtx_lock_spin(&ipi_mtx);
CPU_SETOF(cpu, &ira->ira_mask);
ira->ira_val = val;
cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira);
@@ -216,7 +234,7 @@ ipi_tlb_context_demap(struct pmap *pm)
struct ipi_tlb_args *ita;
cpuset_t cpus;
if (smp_cpus == 1)
if (__predict_false(smp_started == 0))
return (NULL);
sched_pin();
cpus = pm->pm_active;
@@ -227,7 +245,7 @@ ipi_tlb_context_demap(struct pmap *pm)
return (NULL);
}
ita = &ipi_tlb_args;
mtx_lock_spin(&smp_ipi_mtx);
mtx_lock_spin(&ipi_mtx);
ita->ita_mask = cpus;
ita->ita_pmap = pm;
cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap,
@@ -241,7 +259,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va)
struct ipi_tlb_args *ita;
cpuset_t cpus;
if (smp_cpus == 1)
if (__predict_false(smp_started == 0))
return (NULL);
sched_pin();
cpus = pm->pm_active;
@@ -252,7 +270,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va)
return (NULL);
}
ita = &ipi_tlb_args;
mtx_lock_spin(&smp_ipi_mtx);
mtx_lock_spin(&ipi_mtx);
ita->ita_mask = cpus;
ita->ita_pmap = pm;
ita->ita_va = va;
@@ -266,7 +284,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end)
struct ipi_tlb_args *ita;
cpuset_t cpus;
if (smp_cpus == 1)
if (__predict_false(smp_started == 0))
return (NULL);
sched_pin();
cpus = pm->pm_active;
@@ -277,7 +295,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end)
return (NULL);
}
ita = &ipi_tlb_args;
mtx_lock_spin(&smp_ipi_mtx);
mtx_lock_spin(&ipi_mtx);
ita->ita_mask = cpus;
ita->ita_pmap = pm;
ita->ita_start = start;
@@ -292,10 +310,10 @@ ipi_wait(void *cookie)
{
volatile cpuset_t *mask;
if ((mask = cookie) != NULL) {
if (__predict_false((mask = cookie) != NULL)) {
while (!CPU_EMPTY(mask))
;
mtx_unlock_spin(&smp_ipi_mtx);
mtx_unlock_spin(&ipi_mtx);
sched_unpin();
}
}
+1 -1
View File
@@ -503,7 +503,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
}
#ifdef SMP
mp_init(cpu_impl);
mp_init();
#endif
/*
+41 -58
View File
@@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$");
#include <machine/atomic.h>
#include <machine/bus.h>
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/md_var.h>
#include <machine/metadata.h>
#include <machine/ofw_machdep.h>
@@ -113,12 +114,13 @@ struct ipi_rd_args ipi_rd_args;
struct ipi_tlb_args ipi_tlb_args;
struct pcb stoppcbs[MAXCPU];
struct mtx ipi_mtx;
cpu_ipi_selected_t *cpu_ipi_selected;
cpu_ipi_single_t *cpu_ipi_single;
static vm_offset_t mp_tramp;
static u_int cpuid_to_mid[MAXCPU];
static int isjbus;
static volatile cpuset_t shutdown_cpus;
static void ap_count(phandle_t node, u_int mid, u_int cpu_impl);
@@ -138,7 +140,7 @@ static cpu_ipi_single_t spitfire_ipi_single;
SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL);
void
mp_init(u_int cpu_impl)
mp_init(void)
{
struct tte *tp;
int i;
@@ -157,24 +159,6 @@ mp_init(u_int cpu_impl)
}
for (i = 0; i < PAGE_SIZE; i += sizeof(vm_offset_t))
flush(mp_tramp + i);
/*
* On UP systems cpu_ipi_selected() can be called while
* cpu_mp_start() wasn't so initialize these here.
*/
if (cpu_impl == CPU_IMPL_ULTRASPARCIIIi ||
cpu_impl == CPU_IMPL_ULTRASPARCIIIip) {
isjbus = 1;
cpu_ipi_selected = jalapeno_ipi_selected;
cpu_ipi_single = jalapeno_ipi_single;
} else if (cpu_impl == CPU_IMPL_SPARC64V ||
cpu_impl >= CPU_IMPL_ULTRASPARCIII) {
cpu_ipi_selected = cheetah_ipi_selected;
cpu_ipi_single = cheetah_ipi_single;
} else {
cpu_ipi_selected = spitfire_ipi_selected;
cpu_ipi_single = spitfire_ipi_single;
}
}
static void
@@ -219,7 +203,7 @@ foreach_ap(phandle_t node, void (*func)(phandle_t node, u_int mid,
* Probe for other CPUs.
*/
void
cpu_mp_setmaxid()
cpu_mp_setmaxid(void)
{
CPU_SETOF(curcpu, &all_cpus);
@@ -277,6 +261,25 @@ sun4u_startcpu(phandle_t cpu, void *func, u_long arg)
void
cpu_mp_start(void)
{
u_int cpu_impl, isjbus;
mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN);
isjbus = 0;
cpu_impl = PCPU_GET(impl);
if (cpu_impl == CPU_IMPL_ULTRASPARCIIIi ||
cpu_impl == CPU_IMPL_ULTRASPARCIIIip) {
isjbus = 1;
cpu_ipi_selected = jalapeno_ipi_selected;
cpu_ipi_single = jalapeno_ipi_single;
} else if (cpu_impl == CPU_IMPL_SPARC64V ||
cpu_impl >= CPU_IMPL_ULTRASPARCIII) {
cpu_ipi_selected = cheetah_ipi_selected;
cpu_ipi_single = cheetah_ipi_single;
} else {
cpu_ipi_selected = spitfire_ipi_selected;
cpu_ipi_single = spitfire_ipi_single;
}
intr_setup(PIL_AST, cpu_ipi_ast, -1, NULL, NULL);
intr_setup(PIL_RENDEZVOUS, (ih_func_t *)smp_rendezvous_action,
@@ -360,7 +363,7 @@ cpu_mp_announce(void)
}
static void
cpu_mp_unleash(void *v)
cpu_mp_unleash(void *v __unused)
{
volatile struct cpu_start_args *csa;
struct pcpu *pc;
@@ -407,7 +410,6 @@ cpu_mp_unleash(void *v)
membar(StoreLoad);
csa->csa_count = 0;
smp_started = 1;
}
void
@@ -464,6 +466,9 @@ cpu_mp_bootstrap(struct pcpu *pc)
while (csa->csa_count != 0)
;
if (smp_cpus == mp_ncpus)
atomic_store_rel_int(&smp_started, 1);
/* Start per-CPU event timers. */
cpu_initclocks_ap();
@@ -530,7 +535,7 @@ cpu_ipi_stop(struct trapframe *tf __unused)
}
static void
cpu_ipi_preempt(struct trapframe *tf)
cpu_ipi_preempt(struct trapframe *tf __unused)
{
sched_preempt(curthread);
@@ -573,9 +578,11 @@ spitfire_ipi_single(u_int cpu, u_long d0, u_long d1, u_long d2)
u_int mid;
int i;
mtx_assert(&ipi_mtx, MA_OWNED);
KASSERT(cpu != curcpu, ("%s: CPU can't IPI itself", __func__));
KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) & IDR_BUSY) == 0,
("%s: outstanding dispatch", __func__));
mid = cpuid_to_mid[cpu];
for (i = 0; i < IPI_RETRIES; i++) {
s = intr_disable();
@@ -601,12 +608,6 @@ spitfire_ipi_single(u_int cpu, u_long d0, u_long d1, u_long d2)
intr_restore(s);
if ((ids & (IDR_BUSY | IDR_NACK)) == 0)
return;
/*
* Leave interrupts enabled for a bit before retrying
* in order to avoid deadlocks if the other CPU is also
* trying to send an IPI.
*/
DELAY(2);
}
if (kdb_active != 0 || panicstr != NULL)
printf("%s: couldn't send IPI to module 0x%u\n",
@@ -624,10 +625,12 @@ cheetah_ipi_single(u_int cpu, u_long d0, u_long d1, u_long d2)
u_int mid;
int i;
mtx_assert(&ipi_mtx, MA_OWNED);
KASSERT(cpu != curcpu, ("%s: CPU can't IPI itself", __func__));
KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) &
IDR_CHEETAH_ALL_BUSY) == 0,
("%s: outstanding dispatch", __func__));
mid = cpuid_to_mid[cpu];
for (i = 0; i < IPI_RETRIES; i++) {
s = intr_disable();
@@ -644,12 +647,6 @@ cheetah_ipi_single(u_int cpu, u_long d0, u_long d1, u_long d2)
intr_restore(s);
if ((ids & (IDR_BUSY | IDR_NACK)) == 0)
return;
/*
* Leave interrupts enabled for a bit before retrying
* in order to avoid deadlocks if the other CPU is also
* trying to send an IPI.
*/
DELAY(2);
}
if (kdb_active != 0 || panicstr != NULL)
printf("%s: couldn't send IPI to module 0x%u\n",
@@ -669,13 +666,14 @@ cheetah_ipi_selected(cpuset_t cpus, u_long d0, u_long d1, u_long d2)
u_int cpu;
int i;
mtx_assert(&ipi_mtx, MA_OWNED);
KASSERT(!CPU_EMPTY(&cpus), ("%s: no CPUs to IPI", __func__));
KASSERT(!CPU_ISSET(curcpu, &cpus), ("%s: CPU can't IPI itself",
__func__));
KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) &
IDR_CHEETAH_ALL_BUSY) == 0,
("%s: outstanding dispatch", __func__));
if (CPU_EMPTY(&cpus))
return;
ids = 0;
for (i = 0; i < IPI_RETRIES * mp_ncpus; i++) {
s = intr_disable();
@@ -709,12 +707,6 @@ cheetah_ipi_selected(cpuset_t cpus, u_long d0, u_long d1, u_long d2)
}
if (CPU_EMPTY(&cpus))
return;
/*
* Leave interrupts enabled for a bit before retrying
* in order to avoid deadlocks if the other CPUs are
* also trying to send IPIs.
*/
DELAY(2 * mp_ncpus);
}
if (kdb_active != 0 || panicstr != NULL)
printf("%s: couldn't send IPI (cpus=%s ids=0x%lu)\n",
@@ -732,10 +724,12 @@ jalapeno_ipi_single(u_int cpu, u_long d0, u_long d1, u_long d2)
u_int busy, busynack, mid;
int i;
mtx_assert(&ipi_mtx, MA_OWNED);
KASSERT(cpu != curcpu, ("%s: CPU can't IPI itself", __func__));
KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) &
IDR_CHEETAH_ALL_BUSY) == 0,
("%s: outstanding dispatch", __func__));
mid = cpuid_to_mid[cpu];
busy = IDR_BUSY << (2 * mid);
busynack = (IDR_BUSY | IDR_NACK) << (2 * mid);
@@ -754,12 +748,6 @@ jalapeno_ipi_single(u_int cpu, u_long d0, u_long d1, u_long d2)
intr_restore(s);
if ((ids & busynack) == 0)
return;
/*
* Leave interrupts enabled for a bit before retrying
* in order to avoid deadlocks if the other CPU is also
* trying to send an IPI.
*/
DELAY(2);
}
if (kdb_active != 0 || panicstr != NULL)
printf("%s: couldn't send IPI to module 0x%u\n",
@@ -778,13 +766,14 @@ jalapeno_ipi_selected(cpuset_t cpus, u_long d0, u_long d1, u_long d2)
u_int cpu;
int i;
mtx_assert(&ipi_mtx, MA_OWNED);
KASSERT(!CPU_EMPTY(&cpus), ("%s: no CPUs to IPI", __func__));
KASSERT(!CPU_ISSET(curcpu, &cpus), ("%s: CPU can't IPI itself",
__func__));
KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) &
IDR_CHEETAH_ALL_BUSY) == 0,
("%s: outstanding dispatch", __func__));
if (CPU_EMPTY(&cpus))
return;
ids = 0;
for (i = 0; i < IPI_RETRIES * mp_ncpus; i++) {
s = intr_disable();
@@ -811,12 +800,6 @@ jalapeno_ipi_selected(cpuset_t cpus, u_long d0, u_long d1, u_long d2)
if ((ids & (IDR_NACK <<
(2 * cpuid_to_mid[cpu]))) == 0)
CPU_CLR(cpu, &cpus);
/*
* Leave interrupts enabled for a bit before retrying
* in order to avoid deadlocks if the other CPUs are
* also trying to send IPIs.
*/
DELAY(2 * mp_ncpus);
}
if (kdb_active != 0 || panicstr != NULL)
printf("%s: couldn't send IPI (cpus=%s ids=0x%lu)\n",
+2 -5
View File
@@ -31,8 +31,6 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/pcpu.h>
#include <sys/proc.h>
#include <sys/sched.h>
@@ -46,7 +44,6 @@ __FBSDID("$FreeBSD$");
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/intr_machdep.h>
#include <machine/smp.h>
@@ -326,7 +323,7 @@ tick_get_timecount_up(struct timecounter *tc)
static u_int
stick_get_timecount_mp(struct timecounter *tc)
{
u_long stick;
static u_long stick;
sched_pin();
if (curcpu == 0)
@@ -340,7 +337,7 @@ stick_get_timecount_mp(struct timecounter *tc)
static u_int
tick_get_timecount_mp(struct timecounter *tc)
{
u_long tick;
static u_long tick;
sched_pin();
if (curcpu == 0)
+1 -1
View File
@@ -58,7 +58,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
#define __FreeBSD_version 1001519 /* Master, propagated to newvers */
#define __FreeBSD_version 1002000 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
+5 -23
View File
@@ -1063,9 +1063,9 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset, vm_size_t size,
*/
flags = OBJPR_NOTMAPPED;
else if (old_msync)
flags = OBJPR_NOTWIRED;
flags = 0;
else
flags = OBJPR_CLEANONLY | OBJPR_NOTWIRED;
flags = OBJPR_CLEANONLY;
vm_object_page_remove(object, OFF_TO_IDX(offset),
OFF_TO_IDX(offset + size + PAGE_MASK), flags);
}
@@ -1894,7 +1894,6 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end,
int options)
{
vm_page_t p, next;
int wirings;
VM_OBJECT_ASSERT_WLOCKED(object);
KASSERT((object->flags & OBJ_UNMANAGED) == 0 ||
@@ -1928,15 +1927,9 @@ again:
VM_OBJECT_WLOCK(object);
goto again;
}
if ((wirings = p->wire_count) != 0 &&
(wirings = pmap_page_wired_mappings(p)) != p->wire_count) {
if ((options & (OBJPR_NOTWIRED | OBJPR_NOTMAPPED)) ==
0) {
if (p->wire_count != 0) {
if ((options & OBJPR_NOTMAPPED) == 0)
pmap_remove_all(p);
/* Account for removal of wired mappings. */
if (wirings != 0)
p->wire_count -= wirings;
}
if ((options & OBJPR_CLEANONLY) == 0) {
p->valid = 0;
vm_page_undirty(p);
@@ -1957,19 +1950,8 @@ again:
if (p->dirty)
goto next;
}
if ((options & OBJPR_NOTMAPPED) == 0) {
if ((options & OBJPR_NOTWIRED) != 0 && wirings != 0)
goto next;
if ((options & OBJPR_NOTMAPPED) == 0)
pmap_remove_all(p);
/* Account for removal of wired mappings. */
if (wirings != 0) {
KASSERT(p->wire_count == wirings,
("inconsistent wire count %d %d %p",
p->wire_count, wirings, p));
p->wire_count = 0;
atomic_subtract_int(&cnt.v_wire_count, 1);
}
}
vm_page_free(p);
next:
vm_page_unlock(p);
-1
View File
@@ -207,7 +207,6 @@ struct vm_object {
*/
#define OBJPR_CLEANONLY 0x1 /* Don't remove dirty pages. */
#define OBJPR_NOTMAPPED 0x2 /* Don't unmap pages. */
#define OBJPR_NOTWIRED 0x4 /* Don't remove wired pages. */
TAILQ_HEAD(object_q, vm_object);
+2 -4
View File
@@ -43,12 +43,10 @@
#define LINENUM_MAX LONG_MAX
#define SCCSPREFIX "s."
#define GET "get -e %s"
#define SCCSDIFF "get -p %s | diff - %s >/dev/null"
#define RCSSUFFIX ",v"
#define CHECKOUT "co -l %s"
#define RCSDIFF "rcsdiff %s > /dev/null"
#define CHECKOUT "/usr/bin/co"
#define RCSDIFF "/usr/bin/rcsdiff"
#define ORIGEXT ".orig"
#define REJEXT ".rej"
+63 -37
View File
@@ -31,8 +31,10 @@
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <ctype.h>
#include <errno.h>
#include <libgen.h>
#include <limits.h>
#include <stddef.h>
@@ -132,12 +134,14 @@ reallocate_lines(size_t *lines_allocated)
static bool
plan_a(const char *filename)
{
int ifd, statfailed;
int ifd, statfailed, devnull, pstat;
char *p, *s, lbuf[INITLINELEN];
struct stat filestat;
ptrdiff_t sz;
size_t i;
size_t iline, lines_allocated;
pid_t pid;
char *argp[4] = {NULL};
#ifdef DEBUGGING
if (debug & 8)
@@ -165,13 +169,14 @@ plan_a(const char *filename)
}
if (statfailed && check_only)
fatal("%s not found, -C mode, can't probe further\n", filename);
/* For nonexistent or read-only files, look for RCS or SCCS versions. */
/* For nonexistent or read-only files, look for RCS versions. */
if (statfailed ||
/* No one can write to it. */
(filestat.st_mode & 0222) == 0 ||
/* I can't write to it. */
((filestat.st_mode & 0022) == 0 && filestat.st_uid != getuid())) {
const char *cs = NULL, *filebase, *filedir;
char *filebase, *filedir;
struct stat cstat;
char *tmp_filename1, *tmp_filename2;
@@ -179,43 +184,26 @@ plan_a(const char *filename)
tmp_filename2 = strdup(filename);
if (tmp_filename1 == NULL || tmp_filename2 == NULL)
fatal("strdupping filename");
filebase = basename(tmp_filename1);
filedir = dirname(tmp_filename2);
/* Leave room in lbuf for the diff command. */
s = lbuf + 20;
#define try(f, a1, a2, a3) \
(snprintf(s, buf_size - 20, f, a1, a2, a3), stat(s, &cstat) == 0)
if (try("%s/RCS/%s%s", filedir, filebase, RCSSUFFIX) ||
try("%s/RCS/%s%s", filedir, filebase, "") ||
try("%s/%s%s", filedir, filebase, RCSSUFFIX)) {
snprintf(buf, buf_size, CHECKOUT, filename);
snprintf(lbuf, sizeof lbuf, RCSDIFF, filename);
cs = "RCS";
} else if (try("%s/SCCS/%s%s", filedir, SCCSPREFIX, filebase) ||
try("%s/%s%s", filedir, SCCSPREFIX, filebase)) {
snprintf(buf, buf_size, GET, s);
snprintf(lbuf, sizeof lbuf, SCCSDIFF, s, filename);
cs = "SCCS";
} else if (statfailed)
fatal("can't find %s\n", filename);
free(tmp_filename1);
free(tmp_filename2);
(snprintf(lbuf, sizeof(lbuf), f, a1, a2, a3), stat(lbuf, &cstat) == 0)
/*
* else we can't write to it but it's not under a version
* control system, so just proceed.
*/
if (cs) {
if (try("%s/RCS/%s%s", filedir, filebase, RCSSUFFIX) ||
try("%s/RCS/%s%s", filedir, filebase, "") ||
try("%s/%s%s", filedir, filebase, RCSSUFFIX)) {
if (!statfailed) {
if ((filestat.st_mode & 0222) != 0)
/* The owner can write to it. */
fatal("file %s seems to be locked "
"by somebody else under %s\n",
filename, cs);
"by somebody else under RCS\n",
filename);
/*
* It might be checked out unlocked. See if
* it's safe to check out the default version
@@ -223,21 +211,59 @@ plan_a(const char *filename)
*/
if (verbose)
say("Comparing file %s to default "
"%s version...\n",
filename, cs);
if (system(lbuf))
"RCS version...\n", filename);
switch (pid = fork()) {
case -1:
fatal("can't fork: %s\n",
strerror(errno));
case 0:
devnull = open("/dev/null", O_RDONLY);
if (devnull == -1) {
fatal("can't open /dev/null: %s",
strerror(errno));
}
(void)dup2(devnull, STDOUT_FILENO);
argp[0] = strdup(RCSDIFF);
argp[1] = strdup(filename);
execv(RCSDIFF, argp);
exit(127);
}
pid = waitpid(pid, &pstat, 0);
if (pid == -1 || WEXITSTATUS(pstat) != 0) {
fatal("can't check out file %s: "
"differs from default %s version\n",
filename, cs);
"differs from default RCS version\n",
filename);
}
}
if (verbose)
say("Checking out file %s from %s...\n",
filename, cs);
if (system(buf) || stat(filename, &filestat))
fatal("can't check out file %s from %s\n",
filename, cs);
say("Checking out file %s from RCS...\n",
filename);
switch (pid = fork()) {
case -1:
fatal("can't fork: %s\n", strerror(errno));
case 0:
argp[0] = strdup(CHECKOUT);
argp[1] = strdup("-l");
argp[2] = strdup(filename);
execv(CHECKOUT, argp);
exit(127);
}
pid = waitpid(pid, &pstat, 0);
if (pid == -1 || WEXITSTATUS(pstat) != 0 ||
stat(filename, &filestat)) {
fatal("can't check out file %s from RCS\n",
filename);
}
} else if (statfailed) {
fatal("can't find %s\n", filename);
}
free(tmp_filename1);
free(tmp_filename2);
}
filemode = filestat.st_mode;
if (!S_ISREG(filemode))
fatal("%s is not a normal file--can't patch\n", filename);
+1 -1
View File
@@ -9,4 +9,4 @@
#include <paths.h>
#define _PATH_ED "/bin/ed"
#define _PATH_RED "/bin/red"
+15 -3
View File
@@ -1,4 +1,3 @@
/*-
* Copyright 1986, Larry Wall
*
@@ -1409,13 +1408,14 @@ do_ed_script(void)
char *t;
off_t beginning_of_this_line;
FILE *pipefp = NULL;
int continuation;
if (!skip_rest_of_patch) {
if (copy_file(filearg[0], TMPOUTNAME) < 0) {
unlink(TMPOUTNAME);
fatal("can't create temp file %s", TMPOUTNAME);
}
snprintf(buf, buf_size, "%s%s%s", _PATH_ED,
snprintf(buf, buf_size, "%s%s%s", _PATH_RED,
verbose ? " " : " -s ", TMPOUTNAME);
pipefp = popen(buf, "w");
}
@@ -1433,7 +1433,19 @@ do_ed_script(void)
(*t == 'a' || *t == 'c' || *t == 'd' || *t == 'i' || *t == 's')) {
if (pipefp != NULL)
fputs(buf, pipefp);
if (*t != 'd') {
if (*t == 's') {
for (;;) {
continuation = 0;
t = strchr(buf, '\0') - 1;
while (--t >= buf && *t == '\\')
continuation = !continuation;
if (!continuation ||
pgets(true) == 0)
break;
if (pipefp != NULL)
fputs(buf, pipefp);
}
} else if (*t != 'd') {
while (pgets(true)) {
p_input_line++;
if (pipefp != NULL)
+1 -1
View File
@@ -258,7 +258,7 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then
DISTDIR_IS_UNIONFS=1
mount_nullfs -o union "$BSDINSTALL_FETCHDEST" "$BSDINSTALL_DISTDIR"
else
export DISTRIBUTIONS="MANIFEST $ALL_DISTRIBUTIONS"
export DISTRIBUTIONS="$ALL_DISTRIBUTIONS"
export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST"
fi
+1 -1
View File
@@ -110,7 +110,7 @@ static int
foreign_show_cfg(int fd, uint32_t opcode, uint8_t cfgidx, int diagnostic)
{
struct mfi_config_data *config;
char prefix[26];
char prefix[64];
int error;
uint8_t mbox[4];
+5
View File
@@ -1785,3 +1785,8 @@ typedef union mpinfou {
# endif
#endif /* !defined(_KERNEL) && !defined(PARSESTREAM) */
/*
* FreeBSD specific: Explicitly specify date/time for reproducible build.
*/
#define MKREPRO_DATE "Jul 04 2015"
#define MKREPRO_TIME "15:42:16"
+2 -2
View File
@@ -27,8 +27,8 @@ SRCS= cmd_args.c ntp_config.c ntp_control.c ntp_crypto.c ntp_filegen.c \
refclock_tt560.c refclock_ulink.c refclock_wwv.c refclock_wwvb.c \
refclock_zyfer.c version.c
DPADD= ${LIBPARSE} ${LIBNTP} ${LIBM} ${LIBMD} ${LIBOPTS} ${LIBPTHREAD}
LDADD= ${LIBPARSE} ${LIBNTP} -lm -lmd ${LIBOPTS} -lpthread
DPADD= ${LIBPARSE} ${LIBNTP} ${LIBM} ${LIBOPTS} ${LIBPTHREAD}
LDADD= ${LIBPARSE} ${LIBNTP} -lm ${LIBOPTS} -lpthread
CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/ntpd \
-I${.CURDIR}/../../../contrib/ntp/include \
+4 -1
View File
@@ -1808,6 +1808,9 @@ process_file(char *filename)
if (cnts == NULL) {
/* Nothing we can do */
printf("Nothing to do -- no counters built\n");
if (io) {
fclose(io);
}
return;
}
lace_cpus_together();
@@ -2044,7 +2047,7 @@ get_cpuid_set(void)
printf("No memory3 allocation fails at startup?\n");
exit(-1);
}
memset(more, sz, 0);
memset(more, 0, sz);
memcpy(more, valid_pmcs, sz);
pmc_allocated_cnt *= 2;
free(valid_pmcs);
+1 -1
View File
@@ -388,7 +388,7 @@ pw_user(int mode, char *name, long id, struct cargs * args)
edited = 1;
}
if (id > 0 && isdigit((unsigned char)*arg->val)) {
if (id > 0) {
pwd->pw_uid = (uid_t)id;
edited = 1;
if (pwd->pw_uid != 0 && strcmp(pwd->pw_name, "root") == 0)