]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoExtract the general-purpose code from tmpfs to perform uiomove from
kib [Wed, 21 Aug 2013 17:23:24 +0000 (17:23 +0000)]
Extract the general-purpose code from tmpfs to perform uiomove from
the page queue of some vm object.

Discussed with: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation

11 years agoCheck strtoumax(3) for ERANGE in case of non-prefixed string.
pluknet [Wed, 21 Aug 2013 16:46:06 +0000 (16:46 +0000)]
Check strtoumax(3) for ERANGE in case of non-prefixed string.

OK'd by: silence on current@
MFC after: 1 week

11 years agoAddendum to r254141: Allow recursion on the free pages queues lock in
alc [Wed, 21 Aug 2013 15:31:43 +0000 (15:31 +0000)]
Addendum to r254141: Allow recursion on the free pages queues lock in
vm_page_alloc_freelist().

Reported and tested by: sbruno
Sponsored by: EMC / Isilon Storage Division

11 years agoAdd support for uarts other than the serial console in TI OMAP SoCs.
ian [Wed, 21 Aug 2013 14:33:02 +0000 (14:33 +0000)]
Add support for uarts other than the serial console in TI OMAP SoCs.

The TI uart hardware is ns16550-compatible, except that before it can
be used the clocks and power have to be enabled and a non-standard
mode control register has to be set to put the device in uart mode
(as opposed to irDa or other serial protocols).  This adds the extra
code in an extension to the standard ns8250 probe routine, and the
rest of the driver is just the standard ns8250 code.

11 years agoMake the uart ns8250 high-level interface public rather than static.
ian [Wed, 21 Aug 2013 14:26:15 +0000 (14:26 +0000)]
Make the uart ns8250 high-level interface public rather than static.
This makes it easier to implement new drivers which are "mostly ns8250"
but with some small difference such as needing to enable clocks or poke
a non-standard register at probe or attach time.

11 years agoFix 'make depend'.
uqs [Wed, 21 Aug 2013 08:01:52 +0000 (08:01 +0000)]
Fix 'make depend'.

11 years agoFix the (unused for now) SCSI_PROTO_iSCSI define to match style(9).
trasz [Wed, 21 Aug 2013 07:45:47 +0000 (07:45 +0000)]
Fix the (unused for now) SCSI_PROTO_iSCSI define to match style(9).

11 years agoMake the noop clock successfully do nothing, because doing nothing and
ian [Wed, 21 Aug 2013 04:49:58 +0000 (04:49 +0000)]
Make the noop clock successfully do nothing, because doing nothing and
returning an error status (which the NULL method pointers caused) isn't
nearly as useful.

11 years agoDefine the uart clocks so that they can be en/disabled at runtime.
ian [Wed, 21 Aug 2013 04:20:17 +0000 (04:20 +0000)]
Define the uart clocks so that they can be en/disabled at runtime.

11 years agoEnhance the ZFS vdev layer to maintain both a logical and a physical
gibbs [Wed, 21 Aug 2013 04:10:24 +0000 (04:10 +0000)]
Enhance the ZFS vdev layer to maintain both a logical and a physical
minimum allocation size for devices.  Use this information to
automatically increase ZFS's minimum allocation size for new top-level
vdevs to a value that more closely matches the optimum device
allocation size.

Use GEOM's stripesize attribute, if set, as the physical sector
size of the GEOM.

Calculate the minimum blocksize of each metaslab class.  Use the
calculated value instead of SPA_MINBLOCKSIZE (512b) when determining
the likelyhood of compression yeilding a reduction in physical space
usage.

Report devices with sub-optimal block size configuration in "zpool
status".  Also properly fail attempts to attach devices with a
logical block size greater than 8kB, since this will cause corruption
to ZFS's label area.

Sponsored by: Spectra Logic Corporaion
MFC after: 2 weeks

Background
==========
Many modern devices use physical allocation units that are much
larger than the minimum logical allocation size accessible by
external commands.  Two prevalent examples of this are 512e disk
drives (512b logical sector, 4K physical sector) and flash devices
(512b logical sector, 4K or larger allocation block size, and 128k
or larger erase block size).  Operations that modify less than the
physical sector size result in a costly read-modify-write or garbage
collection sequence on these devices.

Simply exporting the true physical sector of the device to ZFS would
yield optimal performance, but has two serious drawbacks:

1) Existing pools created with devices that have different logical
   and physical block sizes, but were configured to use the logical
   block size (e.g. because the OS version used for pool construction
   reported the logical block size instead of the physical block
   size) will suddenly find that the vdev allocation size has
   increased.  This can be easily tolerated for active members of
   the array, but ZFS would prevent replacement of a vdev with
   another identical device because it now appears that the smaller
   allocation size required by the pool is not supported by the new
   device.

2) The device's physical block size may be too large to be supported
   by ZFS.  The optimal allocation size for the vdev may be quite
   large.  For example, a RAID controller may export a vdev that
   requires read-modify-write cycles unless accessed using 64k
   aligned/sized requests.  ZFS currently has an 8k minimum block
   size limit.

Reporting both the logical and physical allocation sizes for vdevs
solves these problems.  A device may be used so long as the logical
block size is compatible with the configuration.  By comparing the
logical and physical block sizes, new configurations can be optimized
and administrators can be notified of any existing pools that are
sub-optimal.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h:
Add the SPA_ASHIFT constant.  ZFS currently has a hard upper
limit of 13 (8k) for ashift and this constant is used to
both document and enforce this limit.

sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h:
Add the VDEV_AUX_ASHIFT_TOO_BIG error code.

Add fields for exporting the configured, logical, and
physical ashift to the vdev_stat_t structure.

Add VDEV_STAT_VALID() macro which can be used to verify the
presence of required vdev_stat_t fields in nvlist data.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:
Provide a SYSCTL_PROC handler for "max_auto_ashift".  Since
the limit is only referenced long after boot when a create
operation occurs, there's no compelling need for it to be
a boot time configurable tunable.  This also allows the
validation code for the max_auto_ashift value to be contained
within the sysctl handler.

Populate the new fields in the vdev_stat_t structure.

Fail vdev opens if the vdev reports an ashift larger than
SPA_MAXASHIFT.

Propogate vdev_logical_ashift and vdev_physical_ashift between
child and parent vdevs as is done for vdev_ashift.

In vdev_open(), restore code that fails opens for devices
where vdev_ashift grows.  This can only happen now if the
device's logical ashift grows, which means it really isn't
safe to use the device.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c:
Update the vdev_open() API so that both logical (what was
just ashift before) and physical ashift are reported.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h:
Add two new fields, vdev_physical_ashift and vdev_logical_ashift,
to vdev_t.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:
Add vdev_ashift_optimize().  Call it anytime a new top-level
vdev is allocated.

cddl/contrib/opensolaris/cmd/zpool/zpool_main.c:
Add text for the VDEV_AUX_ASHIFT_TOO_BIG error.

For each sub-optimally configured leaf vdev, report configured
and native block sizes.

cddl/contrib/opensolaris/cmd/zpool/zpool_main.c:
cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c:
Introduce a new zpool status: ZPOOL_STATUS_NON_NATIVE_ASHIFT.
This status is reported on healthy pools containing vdevs
configured to use a block size smaller than their reported
physical block size.

cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c:
Update find_vdev_problem() and supporting functions to
provide the full vdev_stat_t structure to problem checking
routines, and to allow decent into replacing vdevs.

Add a vdev_non_native_ashift() validator which is used on
the full vdev tree to check for ZPOOL_STATUS_NON_NATIVE_ASHIFT.

cddl/contrib/opensolaris/lib/libzpool/common/kernel.c:
cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h:
Enhance sysctl userland stubs now that a SYSCTL_PROC handler
is used in vdev.c.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h:
When the group membership of a metaslab class changes (i.e.
when a vdev is added or removed from a pool), walk the group
list to determine the smallest block size currently available
and record this in the metaslab class.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c:
Add the metaslab_class_get_minblocksize() accessor.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:
In zio_compress_data(), take the minimum blocksize as an
input parameter instead of assuming SPA_MINBLOCKSIZE.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:
In l2arc_compress_buf(), pass SPA_MINBLOCKSIZE as the minimum
blocksize of the device.  The l2arc code performs has it's own
code for deciding if compression is worth while, so this
effectively disables zio_compress_data() from second guessing
the original decision.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c:
In zio_write_bp_init(), use the minimum blocksize of the
normal metaslab class when compressing data.

11 years agoUse an if/else sequence rather than unrelated if statements, so that a
ian [Wed, 21 Aug 2013 04:08:58 +0000 (04:08 +0000)]
Use an if/else sequence rather than unrelated if statements, so that a
device compatible with multiple drivers matches the more specific driver
first and doesn't overwrite it later with the more generic.  Move the
generic ns16550 to the end of the list.

11 years agoCheck for generic ns16550 after all other types. A device may be compatible
ian [Wed, 21 Aug 2013 04:05:06 +0000 (04:05 +0000)]
Check for generic ns16550 after all other types.  A device may be compatible
with 16550 but also have a more specific/capable driver earlier in the list.

11 years agoMFV r254421:
delphij [Wed, 21 Aug 2013 00:04:31 +0000 (00:04 +0000)]
MFV r254421:

Illumos ZFS issues:
  3996 want a libzfs_core API to rollback to latest snapshot

11 years agoMFV r254220:
delphij [Tue, 20 Aug 2013 22:31:13 +0000 (22:31 +0000)]
MFV r254220:

Illumos ZFS issues:
  4039 zfs_rename()/zfs_link() needs stronger test for XDEV

11 years agoPull in r182983 from upstream clang trunk:
dim [Tue, 20 Aug 2013 20:51:32 +0000 (20:51 +0000)]
Pull in r182983 from upstream clang trunk:

  Fix handling of braced-init-list as reference initializer within
  aggregate initialization. Previously we would incorrectly require an
  extra set of braces around such initializers.

Pull in r188718 from upstream clang trunk:

  Handle init lists and _Atomic fields.

  Fixes PR16931.

These fixes are needed for the atomic_flag type to work correctly in our
stdatomic.h.

Requested by: theraven

11 years agoPull in r188716 from upstream clang trunk:
dim [Tue, 20 Aug 2013 20:46:29 +0000 (20:46 +0000)]
Pull in r188716 from upstream clang trunk:

  PR16727: don't try to evaluate a potentially value-dependent
  expression when checking for missing parens in &&/|| expressions.

This fixes an assertion encountered when building the lang/sdcc port.

Reported by: kwm

11 years agoEnable VFP on ARMADA XP.
andrew [Tue, 20 Aug 2013 20:40:20 +0000 (20:40 +0000)]
Enable VFP on ARMADA XP.

11 years agoDisplay P/N information in the description.
np [Tue, 20 Aug 2013 18:22:04 +0000 (18:22 +0000)]
Display P/N information in the description.

Submitted by: gnn
MFC after: 3 days

11 years agoStop an ipoib interface before detaching it.
jhb [Tue, 20 Aug 2013 18:08:06 +0000 (18:08 +0000)]
Stop an ipoib interface before detaching it.

PR: kern/181225
Submitted by: Shahar Klein
Obtained from: Mellanox
MFC after: 1 week

11 years agoForce keyboards which don't have the required
hselasky [Tue, 20 Aug 2013 16:21:05 +0000 (16:21 +0000)]
Force keyboards which don't have the required
HID fields to use the USB BOOT protocol for now.

PR: usb/181425
Submitted by: Andrey Zholos <aaz@q-fu.com>
MFC after: 4 weeks

11 years agoCorrect a typo in the event mask mnemonic.
bz [Tue, 20 Aug 2013 14:59:31 +0000 (14:59 +0000)]
Correct a typo in the event mask mnemonic.

Reviewed by: gnn
MFC after: 3 days

11 years agoCatch up with various changes to if_data and make this compile again
bz [Tue, 20 Aug 2013 14:37:06 +0000 (14:37 +0000)]
Catch up with various changes to if_data and make this compile again
on HEAD.  Seems to be one of the the only tools giving us access to
ifi_baudrate and ifi_baudrate_pf values.

MFC after: 3 days

11 years agoAfter r241616 properly export ifi_baudrate_pf in the 32bit compat case.
bz [Tue, 20 Aug 2013 14:35:17 +0000 (14:35 +0000)]
After r241616 properly export ifi_baudrate_pf in the 32bit compat case.

MFC after: 3 days

11 years agoMake the standard sdhci(4) driver work for the TI OMAP family SoCs.
ian [Tue, 20 Aug 2013 12:33:35 +0000 (12:33 +0000)]
Make the standard sdhci(4) driver work for the TI OMAP family SoCs.
The MMCHS hardware is pretty much a standard SDHCI v2.0 controller with a
couple quirks, which are now supported by sdhci(4) as of r254507.

This should work for all TI SoCs that use the MMCHS hardware, but it has
only been tested on AM335x right now, so this enables it on those platforms
but leaves the existing ti_mmchs driver in place for other OMAP variants
until they can be tested.

This initial incarnation lacks DMA support (coming soon).  Even without it
this improves performance pretty noticibly over the ti_mmchs driver,
primarily because it now does multiblock IO.

11 years agoAdded sysctl to turn off calls to vmem_check().
pho [Tue, 20 Aug 2013 11:06:56 +0000 (11:06 +0000)]
Added sysctl to turn off calls to vmem_check().

Sponsored by: EMC / Isilon storage division
Discussed with:  jeff

11 years agoFix the zeroing loop. I must have been drunk when I wrote this...
des [Tue, 20 Aug 2013 07:19:58 +0000 (07:19 +0000)]
Fix the zeroing loop.  I must have been drunk when I wrote this...

MFC after: 3 days

11 years agoDo not create superpage mappings in the iommu.
neel [Tue, 20 Aug 2013 06:46:40 +0000 (06:46 +0000)]
Do not create superpage mappings in the iommu.

This is a workaround to hide the fact that we do not have any code to
demote a superpage mapping before we unmap a single page that is part
of the superpage.

11 years agoExtract the location of the remapping hardware units from the ACPI DMAR table.
neel [Tue, 20 Aug 2013 06:20:05 +0000 (06:20 +0000)]
Extract the location of the remapping hardware units from the ACPI DMAR table.

Submitted by: Gopakumar T (gopakumar_thekkedath@yahoo.co.in)

11 years agoFix breakage caused by r254466 in minidumpsys().
neel [Tue, 20 Aug 2013 02:09:26 +0000 (02:09 +0000)]
Fix breakage caused by r254466 in minidumpsys().

r254466 increased the KVA from 512GB to 2TB which requires 4 PDP pages as
opposed to a single one before the change. This broke minidumpsys() since
it assumed that the entire KVA could be addressed via a single PDP page.

Fix this by obtaining the address of the PDP page from the PML4 entry
associated with the KVA being dumped.

Reported by: pho
Submitted by: kib
Pointy hat to: neel

11 years ago - Increase the active lru refresh interval to 10 minutes. This has been
jeff [Mon, 19 Aug 2013 23:54:24 +0000 (23:54 +0000)]
 - Increase the active lru refresh interval to 10 minutes.  This has been
   shown to negatively impact some workloads and the goal is only to
   eliminate worst case behaviors for very long periods of paging
   inactivity.  Eventually we should determine a more complex scaling
   factor for this feature.
 - Rate limit low memory callback handlers to limit thrashing.  Set the
   default to 10 seconds.

Sponsored by: EMC / Isilon Storage Division

11 years ago - Use an arbitrary but reasonably large import size for kva on architectures
jeff [Mon, 19 Aug 2013 23:02:39 +0000 (23:02 +0000)]
 - Use an arbitrary but reasonably large import size for kva on architectures
   that don't support superpages.  This keeps the number of spans and internal
   fragmentation lower.
 - When the user asks for alignment from vmem_xalloc adjust the imported size
   by 2*align to be certain we can satisfy the allocation.  This comes at
   the expense of potential failures when the backend can't supply enough
   memory but could supply the requested size and alignment.

Sponsored by: EMC / Isilon Storage Division

11 years agoEnable VFP on the Zedboard.
andrew [Mon, 19 Aug 2013 22:25:36 +0000 (22:25 +0000)]
Enable VFP on the Zedboard.

11 years agoSubversion requires atomic functions we only support on arm with clang.
andrew [Mon, 19 Aug 2013 17:44:19 +0000 (17:44 +0000)]
Subversion requires atomic functions we only support on arm with clang.

11 years agoRemove incorrect 'const' qualifier from pointers to dynamic string
jhb [Mon, 19 Aug 2013 17:09:14 +0000 (17:09 +0000)]
Remove incorrect 'const' qualifier from pointers to dynamic string
buffers I added in the previous commit.

Pointy hat to: jhb
MFC after: 1 month

11 years agoBump __FreeBSD_version to 1000046 after the addition of M_PROTO[9-12]
andre [Mon, 19 Aug 2013 16:47:06 +0000 (16:47 +0000)]
Bump __FreeBSD_version to 1000046 after the addition of M_PROTO[9-12]
and removal of M_NOFREE|M_FRAG|M_FIRSTFRAG|M_LASTFRAG mbuf flags.

11 years agoDo not use pv_kva on ARMv6/v7 and save some space on each vm_page. It's only
raj [Mon, 19 Aug 2013 16:16:49 +0000 (16:16 +0000)]
Do not use pv_kva on ARMv6/v7 and save some space on each vm_page.  It's only
relevant for older ARM variants (with virtual cache).

Submitted by: Zbigniew Bodek <zbb@semihalf.com>
Reviewed by: gber
Sponsored by: The FreeBSD Foundation, Semihalf

11 years agoSimplify and clean up pmap_clearbit()
raj [Mon, 19 Aug 2013 15:58:39 +0000 (15:58 +0000)]
Simplify and clean up pmap_clearbit()

There is no need for calling vm_page_dirty() when clearing "modified" flag as
it is already set for that page in pmap_fault_fixup() or pmap_enter() thanks
to "modified" bit emulation.

Also, there is no need for checking PTE "referenced" or "writeable" flags.  If
there is a request to clear a particular flag we should just do it.

Submitted by: Zbigniew Bodek <zbb@semihalf.com>
Reviewed by: gber
Sponsored by: The FreeBSD Foundation, Semihalf

11 years agoAllow UART_POLL_FREQ to be set as a kernel option as well as via tunable
ian [Mon, 19 Aug 2013 15:51:30 +0000 (15:51 +0000)]
Allow UART_POLL_FREQ to be set as a kernel option as well as via tunable
(the code was already set up for this, just needs to be in conf/options).

Also, if reporting that polling is being used, report the frequency too.

11 years agoFix ARMv6/v7 mapping's wired status.
raj [Mon, 19 Aug 2013 15:36:23 +0000 (15:36 +0000)]
Fix ARMv6/v7 mapping's wired status.

Last input argument in pmap_modify_pv() should be a mask of flags to be set.
In pmap_change_wiring() however, the straight wired status was used, which
does not represent valid flags (and is of type boolean).

This commit fixes the issue so that wired flag is passed to pmap_modify_pv()
properly.

Submitted by: Zbigniew Bodek <zbb@semihalf.com>
Reviewed by: gber
Sponsored by: The FreeBSD Foundation, Semihalf

11 years agoClear all L2 PTE protection bits before their configuration.
raj [Mon, 19 Aug 2013 15:12:36 +0000 (15:12 +0000)]
Clear all L2 PTE protection bits before their configuration.

Revise L2_S_PROT_MASK to include all of the protection bits.  Notice that
clearing these bits does not always take away the corresponding permissions
(for example, permission is granted when the bit is cleared). The bits are
cleared but are to be set or left cleared accordingly in pmap_set_prot(),
pmap_enter_locked(), etc.

Clear L2_XN along with L2_S_PROT_MASK in pmap_set_prot() so that all
permissions related bits are cleared before actual configuration.

Submitted by: Zbigniew Bodek <zbb@semihalf.com>
Reviewed by: gber
Sponsored by: The FreeBSD Foundation, Semihalf

11 years agoSimplify pv_entry removal or ARMv6/v7:
raj [Mon, 19 Aug 2013 14:56:17 +0000 (14:56 +0000)]
Simplify pv_entry removal or ARMv6/v7:

- PGA_WRITEABLE indicates that there *might be* a writable mapping for the
  particular page, so to avoid frequent sweeping of the pv_entries whenever
  pmap_nuke_pv(), pmap_modify_pv(), etc. is called, it is sufficient to
  clear that flag if there are no managed mappings for that page anymore
  (notice that only pmap_enter is authorized to set this flag).
- Avoid redundant checking for PVF_WIRED flag when this flag cannot be set
  anyway.
- Clear PGA_WRITEABLE only once for each vm_page instead of multiple,
  redundant clearing it in loop when there are no writeable mappings
  to that page anymore.

Submitted by: Zbigniew Bodek <zbb@semihalf.com>
Reviewed by: gber
Sponsored by: The FreeBSD Foundation, Semihalf

11 years agoReorder the mbuf defines to make more sense and group related flags
andre [Mon, 19 Aug 2013 14:25:11 +0000 (14:25 +0000)]
Reorder the mbuf defines to make more sense and group related flags
together.

Add M_FLAG_PRINTF for use with printf(9) %b indentifier.

Use the generic mbuf flags print names in the net80211 code and adjust
the protocol specific bits for their new positions.

Change SCTP M_PROTO mapping from 5 to 1 to fit within the 16bit field
they use internally to store some additional information.

Discussed with: trociny, glebius

11 years agoMigrate the net80211 protocol specific use of M_FRAG, M_FIRSTFRAG and
andre [Mon, 19 Aug 2013 14:07:31 +0000 (14:07 +0000)]
Migrate the net80211 protocol specific use of M_FRAG, M_FIRSTFRAG and
M_LASTFRAG flags to protocol specific flags.

Remove the now unused M_FRAG, M_FIRSTFRAG and M_LASTFRAG mbuf flags.

Discussed with: trociny, glebius, adrian

11 years agoAdd entry for packages-9.2-release directory.
gjb [Mon, 19 Aug 2013 14:04:35 +0000 (14:04 +0000)]
Add entry for packages-9.2-release directory.

Approved by: re (implicit)

11 years agoAdd four additional M_PROTOFLAGS[9-12] for protocol specific use.
andre [Mon, 19 Aug 2013 13:56:14 +0000 (13:56 +0000)]
Add four additional M_PROTOFLAGS[9-12] for protocol specific use.

Discussed with: trociny, glebius, adrian

11 years agoAdd m_clrprotoflags() to clear protocol specific mbuf flags at up and
andre [Mon, 19 Aug 2013 13:27:32 +0000 (13:27 +0000)]
Add m_clrprotoflags() to clear protocol specific mbuf flags at up and
downwards layer crossings.

Consistently use it within IP, IPv6 and ethernet protocols.

Discussed with: trociny, glebius

11 years agoAdd support for parameterised device tree sources to the device tree compiler.
theraven [Mon, 19 Aug 2013 12:37:13 +0000 (12:37 +0000)]
Add support for parameterised device tree sources to the device tree compiler.

Reviewed by: brooks
Sponsored by: DARPA, AFRL

11 years agoMove the SCTP specific definition of M_NOTIFICATION onto a protocol
andre [Mon, 19 Aug 2013 12:30:18 +0000 (12:30 +0000)]
Move the SCTP specific definition of M_NOTIFICATION onto a protocol
specific mbuf flag from sys/mbuf.h to netinet/sctp_os_bsd.h.  It is
only relevant within SCTP.

Discussed with: tuexen

11 years agoRemove the unused M_NOFREE mbuf flag. It didn't have any in-tree users
andre [Mon, 19 Aug 2013 11:16:53 +0000 (11:16 +0000)]
Remove the unused M_NOFREE mbuf flag.  It didn't have any in-tree users
for a very long time, if ever.

Should such a functionality ever be needed again the appropriate and
much better way to do it is through a custom EXT_SOMETHING external mbuf
type together with a dedicated *ext_free function.

Discussed with: trociny, glebius

11 years agoMove the global M_SKIP_FIREWALL mbuf flags to a protocol layer specific
andre [Mon, 19 Aug 2013 11:08:36 +0000 (11:08 +0000)]
Move the global M_SKIP_FIREWALL mbuf flags to a protocol layer specific
flag instead.  The flag is only used within the IP and IPv6 layer 3
protocols.

Because some firewall packages treat IPv4 and IPv6 packets the same the
flag should have the same value for both.

Discussed with: trociny, glebius

11 years agoMove ip_reassemble()'s use of the global M_FRAG mbuf flag to a protocol layer
andre [Mon, 19 Aug 2013 10:34:10 +0000 (10:34 +0000)]
Move ip_reassemble()'s use of the global M_FRAG mbuf flag to a protocol layer
specific flag instead.  The flag is only relevant while the packet stays in
the IP reassembly queue.

Discussed with: trociny, glebius

11 years agoRemove unused M_FRAG, M_FIRSTFRAG and M_LASTFRAG tagging from ip_fragment().
andre [Mon, 19 Aug 2013 10:30:15 +0000 (10:30 +0000)]
Remove unused M_FRAG, M_FIRSTFRAG and M_LASTFRAG tagging from ip_fragment().
There wasn't any real driver (and hardware) support for it.  Modern hardware
does full fragmentation/segmentation offload instead.

11 years agoRemove unused and incomplete support for delayed fragment checksums
andre [Mon, 19 Aug 2013 10:20:20 +0000 (10:20 +0000)]
Remove unused and incomplete support for delayed fragment checksums
from bce(4), bxe(4), mge(4) and ti(4) drivers.

11 years agoEnable VFP on the Arndale Board.
andrew [Mon, 19 Aug 2013 08:28:35 +0000 (08:28 +0000)]
Enable VFP on the Arndale Board.

11 years agoStyle changes and typos fixed.
rpaulo [Mon, 19 Aug 2013 05:48:42 +0000 (05:48 +0000)]
Style changes and typos fixed.

11 years agoPass pidfile to bsnmpd if it's been changed (parts cut/pasted from
peter [Mon, 19 Aug 2013 05:37:49 +0000 (05:37 +0000)]
Pass pidfile to bsnmpd if it's been changed (parts cut/pasted from
rc.d/rarpd and rc.d/wpa_supplicant)

11 years agoRevert r254508.
peter [Mon, 19 Aug 2013 05:12:38 +0000 (05:12 +0000)]
Revert r254508.

11 years agoFix some ppc64 dtrace bugs, and enable systrace_freebsd32 for ppc64.
jhibbits [Mon, 19 Aug 2013 05:10:46 +0000 (05:10 +0000)]
Fix some ppc64 dtrace bugs, and enable systrace_freebsd32 for ppc64.

11 years agoAdd the optional ability to run as a different user.
peter [Mon, 19 Aug 2013 04:56:03 +0000 (04:56 +0000)]
Add the optional ability to run as a different user.

Obtained from: Antique freebsd.org cluster archive images

11 years agoAllow a hardware driver to pass clock frequencies into the sdhci driver.
ian [Mon, 19 Aug 2013 01:29:13 +0000 (01:29 +0000)]
Allow a hardware driver to pass clock frequencies into the sdhci driver.

The sdhci spec says that if the base or timeout clock frequency in the
capabilities register is zero, the driver must obtain the frequency "from
another source."  This change defines that other source to be the low-level
hardware driver, which can pre-set the frequencies in slot.max_clk and
slot.timeout_clk before calling sdhci_init_slot().

This helps with a growing number of SoCs that have sdhci base clock
frequencies that either won't fit into the range allowed by the number of
bits available in the capabilities register, or the frequency is runtime-
configurable.

11 years agoDon't return ENOTSUPP here - the net80211 pluggable ioctl API will treat
adrian [Sun, 18 Aug 2013 23:40:30 +0000 (23:40 +0000)]
Don't return ENOTSUPP here - the net80211 pluggable ioctl API will treat
this as the final item in the linker set and not try others.

This stopped the fast frames IOCTLs from being called.

11 years agoWhen code from r254064 in pmap_ts_referenced() drops pv lock and
kib [Sun, 18 Aug 2013 21:36:22 +0000 (21:36 +0000)]
When code from r254064 in pmap_ts_referenced() drops pv lock and
blocks on a pmap lock, pmap_release() might proceed in parallel and
destroy the pmap mutex, since unlocked pv lock allows to remove pv
entry owned by the pmap.

For now, gate the pmap_release() on write-locked pvh_global_lock.
Since pmap_ts_release() does not unlock the global lock,
pmap_release() would not destroy pmap mutex until the
pmap_ts_referenced() finished.  We cannot enter pmap_ts_referenced()
and encounter a pv entry for the destroyed pmap if pmap_release()
passed the global lock gate, since pmap_remove_pages() would finish
earlier.

Reported by: jeff, pho
Reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation

11 years agoReturn the correct status if ieee80211_ff_check() consumes the mbuf.
adrian [Sun, 18 Aug 2013 20:40:13 +0000 (20:40 +0000)]
Return the correct status if ieee80211_ff_check() consumes the mbuf.

I broke this when converting the net80211 TX path to use if_transmit.

11 years agoImplement fdclosedir(3) function, which is equivalent to the closedir(3)
pjd [Sun, 18 Aug 2013 20:11:34 +0000 (20:11 +0000)]
Implement fdclosedir(3) function, which is equivalent to the closedir(3)
function, but returns directory file descriptor instead of closing it.

Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by: Google Summer of Code 2013

11 years agoRemove redundant space.
pjd [Sun, 18 Aug 2013 20:06:35 +0000 (20:06 +0000)]
Remove redundant space.

11 years agoChange the return type of the fallback implementation of the
tijl [Sun, 18 Aug 2013 19:37:35 +0000 (19:37 +0000)]
Change the return type of the fallback implementation of the
atomic_compare_exchange_* macros in stdatomic.h to _Bool.

11 years agoAdd a new SDHCI_QUIRK_DONT_SHIFT_RESPONSE for hardware that pre-shifts
ian [Sun, 18 Aug 2013 19:08:53 +0000 (19:08 +0000)]
Add a new SDHCI_QUIRK_DONT_SHIFT_RESPONSE for hardware that pre-shifts
the response bits the way we do in software.  While the hardware is just
doing the sensible thing rather than leaving it to the software, it's in
violation of the spec by doing so.  Grrrr.

11 years agoIncrease the max KVA available for general consumption on the Exynos 5.
cognet [Sun, 18 Aug 2013 18:08:12 +0000 (18:08 +0000)]
Increase the max KVA available for general consumption on the Exynos 5.

Submitted by: Ruslan Bukin <br@bsdpad.com>

11 years agoEnable VFP in the Versatile PB (QEMU) kernel. Tested on QEMU 1.6.0.
andrew [Sun, 18 Aug 2013 17:18:52 +0000 (17:18 +0000)]
Enable VFP in the Versatile PB (QEMU) kernel. Tested on QEMU 1.6.0.

11 years agoEnable VFP on the CubieBoard and CubieBoard 2.
andrew [Sun, 18 Aug 2013 16:16:36 +0000 (16:16 +0000)]
Enable VFP on the CubieBoard and CubieBoard 2.

11 years agoRegenerate after r254491.
pjd [Sun, 18 Aug 2013 13:38:39 +0000 (13:38 +0000)]
Regenerate after r254491.

11 years agoThe cap_rights_limit(2) system calls needs a wrapper for 32bit binaries
pjd [Sun, 18 Aug 2013 13:37:54 +0000 (13:37 +0000)]
The cap_rights_limit(2) system calls needs a wrapper for 32bit binaries
running under 64bit kernels as the 'rights' argument has to be split
into two registers or the half of the rights will disappear.

Reported by: jilles
Sponsored by: The FreeBSD Foundation

11 years agoMove the PAIR32TO64() macro and the RETVAL_HI/RETVAL_LO defines to a
pjd [Sun, 18 Aug 2013 13:34:11 +0000 (13:34 +0000)]
Move the PAIR32TO64() macro and the RETVAL_HI/RETVAL_LO defines to a
header file for use by other .c files.

Sponsored by: The FreeBSD Foundation

11 years agoDisallow opening a POSIX message queue for execute.
jilles [Sun, 18 Aug 2013 13:27:04 +0000 (13:27 +0000)]
Disallow opening a POSIX message queue for execute.

O_EXEC was formerly ignored, so equivalent to O_RDONLY.

Reject O_EXEC with [EINVAL] like the invalid mode 3.

11 years agodup3(3): Replace copyright notice.
jilles [Sun, 18 Aug 2013 13:25:18 +0000 (13:25 +0000)]
dup3(3): Replace copyright notice.

Although I copied dup(2) to create dup3(3), I removed almost all the
non-boilerplate, so dup3(3) is copyright me.

Reported by: bjk

11 years agoEnable VFP support on EFIKA MX.
andrew [Sun, 18 Aug 2013 11:54:20 +0000 (11:54 +0000)]
Enable VFP support on EFIKA MX.

11 years agoCast argument of is*() ctype functions to unsigned char.
pjd [Sun, 18 Aug 2013 11:25:42 +0000 (11:25 +0000)]
Cast argument of is*() ctype functions to unsigned char.

Without the cast there is ambiguity between 0xFF and -1 (EOF).

Suggested by: jilles
Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by: Google Summer of Code 2013

11 years agoMake the "FD" column one character wider, so that "trace" can also align
pjd [Sun, 18 Aug 2013 10:44:37 +0000 (10:44 +0000)]
Make the "FD" column one character wider, so that "trace" can also align
properly.

11 years agoConsistently use 'af' as an argument name for address family.
pjd [Sun, 18 Aug 2013 10:38:59 +0000 (10:38 +0000)]
Consistently use 'af' as an argument name for address family.
Now both gethostbyname2(3) and gethostbyaddr(3) use the same argument name.
The same argument name is also used in implementations of those functions.

11 years agoMake example more correct (errstr is a pointer, not boolean).
pjd [Sun, 18 Aug 2013 10:33:46 +0000 (10:33 +0000)]
Make example more correct (errstr is a pointer, not boolean).

11 years agoRegenerate after r254481.
pjd [Sun, 18 Aug 2013 10:31:30 +0000 (10:31 +0000)]
Regenerate after r254481.

11 years agoImplement 32bit versions of the cap_ioctls_limit(2) and cap_ioctls_get(2)
pjd [Sun, 18 Aug 2013 10:30:41 +0000 (10:30 +0000)]
Implement 32bit versions of the cap_ioctls_limit(2) and cap_ioctls_get(2)
system calls as unsigned longs have different size on i386 and amd64.

Reported by: jilles
Sponsored by: The FreeBSD Foundation

11 years agoAdd process descriptors support to the GENERIC kernel. It is already being
pjd [Sun, 18 Aug 2013 10:21:29 +0000 (10:21 +0000)]
Add process descriptors support to the GENERIC kernel. It is already being
used by the tools in base systems and with sandboxing more and more tools
the usage should only increase.

Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by: Google Summer of Code 2013
MFC after: 1 month

11 years agoBetter organize the filecaps structure, which reduces its size from 32 bytes
pjd [Sun, 18 Aug 2013 09:45:52 +0000 (09:45 +0000)]
Better organize the filecaps structure, which reduces its size from 32 bytes
to 24 bytes on 64bit archs.

11 years agoAdd in missing events for Sandy Bridge Xeon.
adrian [Sun, 18 Aug 2013 06:08:52 +0000 (06:08 +0000)]
Add in missing events for Sandy Bridge Xeon.

* Add in MEM_LOAD_UOPS_LLC_HIT_RETIRED for both sandy bridge and sandy
  bridge Xeon.  Right now it only is enabled for Sandy Bridge.
* D2/0F is actually a combination rather than a separate counter, so
  just flip that on for the CPU types that support it.

There's an errata for using this on SB Xeon hardware - I've documented
it in kern/181346.

Tested:

* Sandy Bridge
* Sandy Bridge Xeon

Sponsored by: Netflix, Inc.

11 years agoUse sysctl(ICMPV6CTL_ND6_DRLIST) instead of SIOCGDRLST_IN6 ioctl.
hrs [Sat, 17 Aug 2013 22:13:26 +0000 (22:13 +0000)]
Use sysctl(ICMPV6CTL_ND6_DRLIST) instead of SIOCGDRLST_IN6 ioctl.

11 years agoUpdate the SDT(9) man page with the macros added in 254468. Also change the
markj [Sat, 17 Aug 2013 22:06:30 +0000 (22:06 +0000)]
Update the SDT(9) man page with the macros added in 254468. Also change the
existing examples to not pass an mbuf as a probe argument. There's no
obvious reason to have it there, and it doesn't really jibe with the example
added in this revision.

MFC after: 1 week

11 years agoAdd a "translated type" argument to SDT_PROBE_ARGTYPE() and add some macros
markj [Sat, 17 Aug 2013 22:02:26 +0000 (22:02 +0000)]
Add a "translated type" argument to SDT_PROBE_ARGTYPE() and add some macros
which allow one to define SDT probes that specify translated types. The idea
is to make it easy to write SDT probe definitions that can work across
multiple operating systems. In particular, this makes it possible to port
illumos SDT probes to FreeBSD without changing their argument types, so long
as the appropriate translators are defined. Then DTrace scripts written for
Solaris/illumos will work on FreeBSD without any changes.

MFC after: 1 week

11 years agoRemove a couple of unused macros.
markj [Sat, 17 Aug 2013 21:53:37 +0000 (21:53 +0000)]
Remove a couple of unused macros.

MFC after: 3 days

11 years agoBump up the maximum addressable memory on amd64 systems from 1TB to 4TB.
neel [Sat, 17 Aug 2013 19:49:08 +0000 (19:49 +0000)]
Bump up the maximum addressable memory on amd64 systems from 1TB to 4TB.
Bump up the KVA size proportionally from 512GB to 2TB.

The number of page table pages used by the direct map is now calculated at
run time based on 'Maxmem'. This means the small memory systems will not
see any additional tax in terms of page table pages for the direct map.

However all amd64 systems, regardless of the memory size, will use 3 more
pages to accomodate the bump in the KVA size.

More details available here:
http://lists.freebsd.org/pipermail/freebsd-hackers/2013-June/043015.html
http://lists.freebsd.org/pipermail/freebsd-current/2013-July/043143.html

Tested with the following configurations:
- Sandybridge server with 64GB of memory.
- bhyve VM with 64MB of memory.
- bhyve VM with a 8GB of memory with the memory segment above 4GB cuddling
  right up against the 4TB maximum memory limit.

Discussed on: hackers@, current@
Submitted by: Chris Torek (torek@torek.net)

11 years agoCorrect implementation of atomic_flag_test_and_set
emaste [Sat, 17 Aug 2013 19:34:41 +0000 (19:34 +0000)]
Correct implementation of atomic_flag_test_and_set

The function sets the flag and returns the previous value (7.17.8.1).

11 years agoEnable VFP support for BeagleBone.
ian [Sat, 17 Aug 2013 19:29:51 +0000 (19:29 +0000)]
Enable VFP support for BeagleBone.

11 years agolibc: Access _logname_valid more efficiently.
jilles [Sat, 17 Aug 2013 19:24:58 +0000 (19:24 +0000)]
libc: Access _logname_valid more efficiently.

The variable _logname_valid is not exported via the version script;
therefore, change C and i386/amd64 assembler code to remove indirection
(which allowed interposition). This makes the code slightly smaller and
faster.

Also, remove #define PIC_GOT from i386/amd64 in !PIC mode. Without PIC,
there is no place containing the address of each variable, so there is no
possible definition for PIC_GOT.

11 years ago- Remove struct ifinfo *iflist. It is no longer used.
hrs [Sat, 17 Aug 2013 19:23:35 +0000 (19:23 +0000)]
- Remove struct ifinfo *iflist.  It is no longer used.
- Suppress warnings about increase of alignment requirement.

11 years agoRename device vfp to option VFP and retire the ARM_VFP_SUPPORT option. This
andrew [Sat, 17 Aug 2013 18:51:38 +0000 (18:51 +0000)]
Rename device vfp to option VFP and retire the ARM_VFP_SUPPORT option. This
simplifies enabling as previously both options were required to be enabled,
now we only need a single option.

While here enable VFP on the PandaBoard.

11 years ago- Use getnameinfo(3) instead of gethostbyaddr(3) or inet_ntop(3).
hrs [Sat, 17 Aug 2013 17:23:42 +0000 (17:23 +0000)]
- Use getnameinfo(3) instead of gethostbyaddr(3) or inet_ntop(3).

- Fill sin6_scope_id from in6p.sin6_addr.s6_addr[2].  struct inpcb has
  struct in6_addr for the endpoint addresses, so sin6_scope_id must be filled.

11 years agoDo not use potentially stale thread in kthread_add()
bryanv [Sat, 17 Aug 2013 17:02:43 +0000 (17:02 +0000)]
Do not use potentially stale thread in kthread_add()

When an existing process is provided, the thread selected to use
to initialize the new thread could have exited and be reaped.
Acquire the proc lock earlier to ensure the thread remains valid.

Reviewed by: jhb, julian (previous version)
MFC after: 3 days

11 years agoRemove the armfpe config options. These files don't exist on FreeBSD.
andrew [Sat, 17 Aug 2013 15:21:17 +0000 (15:21 +0000)]
Remove the armfpe config options. These files don't exist on FreeBSD.

11 years agoRemove the ARMFPE option. It is unsupported, and appears to be broken as
andrew [Sat, 17 Aug 2013 15:09:14 +0000 (15:09 +0000)]
Remove the ARMFPE option. It is unsupported, and appears to be broken as
arm_fpe_core_changecontext is not a function.

11 years agoCorrect function name and return value.
pjd [Sat, 17 Aug 2013 14:55:31 +0000 (14:55 +0000)]
Correct function name and return value.