kib [Tue, 19 Jun 2012 10:04:36 +0000 (10:04 +0000)]
MFC r236976:
For incompleted block allocations or frees, the inode block count usage
must be recalculated. The blk_check pass of suj checker explicitely marks
inodes which owned such blocks as needing block count adjustment. But
ino_adjblks() is only called by cg_trunc pass, which is performed before
blk_check. As result, the block use count for such inodes is left wrong.
This causes full fsck run after journaled run to still find inconsistencies
like 'INCORRECT BLOCK COUNT I=14557 (328 should be 0)' in phase 1.
Fix this issue by running additional adj_blk pass after blk_check, which
updates the field.
mjacob [Sun, 17 Jun 2012 21:28:11 +0000 (21:28 +0000)]
MFC of r236427
Clean up and complete the incomplete deferred enable code.
Make the default role NONE if target mode is selected. This
allows ctl(8) to switch to/from target mode via knob settings.
If we default to role 'none', this causes a reset of the
24XX f/w which then causes initiators to wake up and notice
when we come online.
dougb [Sun, 17 Jun 2012 21:06:36 +0000 (21:06 +0000)]
Improve the functionality of the PORTS_MODULES knob by adding
LOCALBASE/bin and sbin to PATH, which allows dependencies to be found;
adding SRC_BASE and OSVERSION to match the new kernel, and putting the
related builds under MAKEOBJDIRPREFIX so that they only need to be built
once per kernel.
In addition to the PR this includes ideas/contributions from crees
and matthew.
PR: ports/161452
Submitted by: Garrett Cooper <yanegomi@gmail.com>
marius [Sun, 17 Jun 2012 11:16:14 +0000 (11:16 +0000)]
MFC: r237107
- As a baind-aid, disable ATAPI DMA when using ATA_CAM for these controllers
as well as it causes the kernel to hang during boot.
Reported and tested by: Kevin Oberman
- Use NULL instead of 0 for a pointer.
marius [Sun, 17 Jun 2012 09:42:56 +0000 (09:42 +0000)]
MFC: r237101
Fix a braino in r236469 (MFC'ed to stable/9 in r236468); the number of
DMA tags required for handling MAXPHYS should be based on PAGE_SIZE rather
than SYM_CONF_DMA_BOUNDARY.
While at it, reuse the SYM_CONF_MAX_SG macro for specifying the maximum
number of DMA tags so sym(4) itself doesn't size memory beyond what's
required for handling MAXPHYS.
kib [Sun, 17 Jun 2012 07:14:58 +0000 (07:14 +0000)]
MFC r236848:
Use the previous stack entry protection and max protection to correctly
propagate the stack execution permissions when stack is grown down.
kib [Sat, 16 Jun 2012 13:22:55 +0000 (13:22 +0000)]
MFC r236456:
Use plain store for atomic_store_rel on x86, instead of implicitly
locked xchg instruction. IA32 memory model guarantees that store has
release semantic, since stores cannot pass loads or stores.
kib [Fri, 15 Jun 2012 10:38:14 +0000 (10:38 +0000)]
MFC r226342 (by marcel):
In elf32_trans_prot() and when compiling for amd64 or ia64, add
PROT_EXECUTE when PROT_READ is needed. By default i386 allows
execution when reading is allowed and JDK 1.4.x depends on that.
MFC r226343 (by marcel):
In sys_obreak() and when compiling for amd64 or ia64, when the process
is ILP32 (i.e. i386) grant execute permissions by default. The JDK 1.4.x
depends on being able to execute from the heap on i386.
MFC r226347 (by marcel):
In freebsd32_mmap() and when compiling for amd64 or ia64, also
ask for execute permissions when read permissions are wanted.
This is needed for JDK 1.4.x on i386.
MFC r226348 (by marcel):
Wrap mprotect(2).
MFC r226349 (by marcel):
Wrap mprotect(2) so that we can add execute permissions when read
permissions are requested. This is needed on amd64 and ia64 for
JDK 1.4.x.
MFC r226353 (by marcel):
Use PTRIN().
MFC r226388:
Control the execution permission of the readable segments for
i386 binaries on the amd64 and ia64 with the sysctl, instead of
unconditionally enabling it.
MFC note: the syscall tables were regenerated in r226349 and committed
together with changes to non-generated files. The merge includes
syscall tables regenerated after the merge, for stable/9.
mav [Fri, 15 Jun 2012 06:13:12 +0000 (06:13 +0000)]
MFC r236737:
Add IDs for Marvell 88SE9220/9230/9235 PCIe 2.0 x2 6Gbps SATA controllers.
Marvell 88SE9230 was confirmed to work, the rest two are just guessed.
ghelmer [Thu, 14 Jun 2012 21:48:14 +0000 (21:48 +0000)]
MFC 235739-235740,236402:
Apply style(9) to return and switch/case statements.
Add checks for memory allocation failures in appropriate places, and
avoid creating bad entries in the grp list as a result of memory allocation
failures while building new entries.
Style(9) improvements: remove unnecessary parenthesis, improve order
of local variable declarations, remove bogus casts, and resolve long
lines.
obrien [Thu, 14 Jun 2012 20:44:56 +0000 (20:44 +0000)]
MFC: r236338, r236339, r236346, r236347, r236365, & r236977
* Deprecate the FreeBSD make's ":U" (to-upper case) and ":L" (to-lower case)
modifiers for ":tu" and ":tl".
* make it easier to test newly-built make.
* Add "-V '${VAR}'" variable expansion from Portable Berkeley Make.
* regression test for '-V' command line option and the :t[lu] modifiers.
marius [Thu, 14 Jun 2012 20:05:12 +0000 (20:05 +0000)]
MFC: r236495
- Prepend the device description with "AT91" to reflect its nature. [1]
- Move DMA tag and map creature to at91_spi_activate() where the other
resource allocation also lives. [1]
- Flesh out at91_spi_deactivate(). [1]
- Work around the "Software Reset must be Written Twice" erratum.
- For now, run the bus at the slowest speed possible in order to work
around data corruption on transit even seen with 9 MHz on ETHERNUT5
(15 MHz maximum) and AT45DB321D (20 MHz maximum). This also serves as
a poor man's work-around for the "NPCSx rises if no data data is to be
transmitted" erratum of RM9200. Being able to use the appropriate bus
speed would require:
1) Adding a proper work-around for the RM9200 bug consisting of taking
the chip select control away from the SPI peripheral and managing it
directly as a GPIO line.
2) Taking the maximum frequencies supported by the actual board and the
slave devices into account and basing the whole thing on the master
clock instead of hardcoding a divisor as previously done.
3) Fixing the above mentioned data corruption.
- KASSERT that TX/RX command and data sizes match on transfers.
- Introduce a mutex ensuring that only one child device is running a SPI
transfer at a time. [1]
- Add preliminary, #ifdef'ed out support for setting the chip select. [1]
- Use the RX instead of the TX commando size when setting up the RX side
of a transfer.
- For controllers having SPI_SR_TXEMPTY, i.e. !RM9200, also wait for the
completion of the TX part of transfers before stopping the whole thing
again.
- Use DEVMETHOD_END. [1]
- Use NULL instead of 0 for pointers. [1, partially]
marius [Thu, 14 Jun 2012 19:55:19 +0000 (19:55 +0000)]
MFC: r236579
The workaround added in r151650 for handling firmwares that don't allow
a single device to be opened multiple times concurrently unfortunately
isn't sufficient with ZFS. This is due to the fact, that ZFS may open
different partitions of a single device simultaneously. So the best we
can do in this case is to cache the lastly used device path and close
and open devices in ofwd_strategy() as needed.
glebius [Thu, 14 Jun 2012 07:51:37 +0000 (07:51 +0000)]
Merge 236560 and following 236563,236598 from head:
Optimise kern_sendfile(): skip cycling through the entire mbuf chain in
m_cat(), storing pointer to last mbuf in chain in local variable and
attaching new mbuf to the end of chain.
Submitter reports that CPU load dropped for > 10% on a web server
serving large files with this optimisation.
glebius [Thu, 14 Jun 2012 07:40:18 +0000 (07:40 +0000)]
Merge r236671 from head:
Merge revision 1.715 from OpenBSD:
date: 2010/12/24 20:12:56; author: henning; state: Exp; lines: +3 -3
in pf_src_connlimit, the indices to sk->addr were swapped.
tracked down and diff sent by Robert B Mills <rbmills at sdf.lonestar.org>
thanks, very good work! ok claudio
mav [Wed, 13 Jun 2012 20:31:30 +0000 (20:31 +0000)]
MFC r230188i (by das):
Correct some bugs that resulted from arm/_fpmath.h being blindly copied
from the x86 version, which has a completely different long double
format.
dim [Wed, 13 Jun 2012 19:53:29 +0000 (19:53 +0000)]
MFC r233098:
Make sure libgcc_s is finished building in _startup_libs before
building libcxxrt with high -j levels. The workaround in
libc++/Makefile isn't necessary once that race is solved.
jhb [Wed, 13 Jun 2012 19:04:39 +0000 (19:04 +0000)]
Ensure that the beginning of the DSS is aligned on a chunk boundary.
If the _end symbol used an address with the low bit set, then the initial
arena could end up with corrupted rb trees causing a crash during the
first call to malloc().
This is a direct commit to stable/9 as it does not affect the version
of malloc in HEAD.
pluknet [Wed, 13 Jun 2012 14:47:03 +0000 (14:47 +0000)]
MFC r234188,r234463,r234465:
- Update the swi_add prototype after struct ithd was split up into
struct intr_event and struct intr_thread. [1]
- Update the rest of struct ithd references.
- net_ih and softclock_ih cookies have gone away.
- Document swi_remove(9).
dim [Tue, 12 Jun 2012 21:03:24 +0000 (21:03 +0000)]
MFC r236578:
Fix build of aicasm when CC=clang. This was due to a side-effect of the
EARLY_BUILD macro: the -Qunused-arguments flag isn't passed anymore when
building this particular program. However, with clang 3.1 and -Werror,
such unused argument warnings are flagged as errors, causing buildkernel
to fail at this stage, due to the -nostdinc flag passed during linking.
Since the -nostdinc flag isn't actually needed, just remove it.
mav [Tue, 12 Jun 2012 08:08:33 +0000 (08:08 +0000)]
MFC r236847:
Partially revert r236666:
Return PROTO_ATA protocol in response to XPT_PATH_INQ.
smartmontools uses it to identify ATA devices and I don't know any other
place now where it is important. It could probably use XPT_GDEV_TYPE
instead for more accurate protocol information, but let it live for now.
kib [Mon, 11 Jun 2012 21:35:27 +0000 (21:35 +0000)]
MFC r235783:
Add the code for new Intel GPU driver, which supports GEM, KMS and
works with new generations of GPUs (IronLake, SandyBridge and
supposedly IvyBridge).
kib [Mon, 11 Jun 2012 21:33:02 +0000 (21:33 +0000)]
MFC r235782:
A rewrite of the i810 bits of the agp(4) driver. New driver supports
operations required by GEMified i915.ko. It also attaches to SandyBridge
and IvyBridge CPU northbridges now.
kib [Mon, 11 Jun 2012 21:25:20 +0000 (21:25 +0000)]
MFC r235375:
Add new pager type, OBJT_MGTDEVICE. It provides the device pager
which carries fictitous managed pges. In particular, the consumers of
the new object type can remove all mappings of the device page with
pmap_remove_all().
The range of physical addresses used for fake page allocation shall be
registered with vm_phys_fictitious_reg_range() interface to allow the
PHYS_TO_VM_PAGE() to work in pmap.
kib [Mon, 11 Jun 2012 21:19:59 +0000 (21:19 +0000)]
MFC r235372:
Add a facility to register a range of physical addresses to be used
for allocation of fictitious pages, for which PHYS_TO_VM_PAGE()
returns proper fictitious vm_page_t. The range should be de-registered
after consumer stopped using it.
De-inline the PHYS_TO_VM_PAGE() since it now carries code to iterate
over registered ranges.
MFC r235776 (by andrew):
In PHYS_TO_VM_PAGE() when VM_PHYSSEG_DENSE is set the check if we are past
the end of vm_page_array was incorrect causing it to return NULL. This
value is then used in vm_phys_add_page causing a data abort.
kib [Mon, 11 Jun 2012 21:12:52 +0000 (21:12 +0000)]
MFC r235366:
Split the code from vm_page_getfake() to initialize the fake page struct
vm_page into new interface vm_page_initfake(). Handle the case of fake
page re-initialization with changed memattr.
hselasky [Mon, 11 Jun 2012 17:23:24 +0000 (17:23 +0000)]
MFC r236439:
Add appropriate checks for ic_bsschan being set to IEEE80211_CHAN_ANYC in
some of the USB WLAN drivers. This fixes a panic when using monitor mode.
rmacklem [Mon, 11 Jun 2012 12:34:14 +0000 (12:34 +0000)]
MFC: r235381
Fix two cases in the new NFS server where a tsleep() is
used, when the code should actually protect the tested
variable with a mutex. Since the tsleep()s had a 10sec
timeout, the race would have only delayed the allocation
of a new clientid for a client. The sleeps will also
rarely occur, since having a callback in progress when
a client acquires a new clientid, is unlikely.
in practice, since having a callback in progress when
a fresh clientid is being acquired by a client is unlikely.
delphij [Mon, 11 Jun 2012 07:11:34 +0000 (07:11 +0000)]
MFC r236572:
Replace the use of wall clock time with monotonically increasing
clock. In general, gettimeofday() is not appropriate interface
when accounting for elasped time because it can go backward, in
which case the policy code could errornously consider the limit
as exceeded.
Reported by: Mahesh Arumugam
Submitted by: Dorr H. Clark via gnn
Sponsored by: Citrix / NetScaler
dim [Sun, 10 Jun 2012 13:28:14 +0000 (13:28 +0000)]
MFC r236528:
During buildworld and buildkernel, define EARLY_BUILD in the earlier
stages (build-tools, cross-tools, etc) of the build, so we can detect in
bsd.*.mk whether to pass compiler-specific flags to ${CC}.
In particular, this commit will allow using WITH_CLANG_IS_CC when the
base compiler is still gcc, and when ${CC}, ${CXX} and ${CPP} are left
at their defaults. The early stages will then be built using gcc, and
no clang-specific flags will be passed to it. The later stages will be
built as usual.
The EARLY_BUILD define can also serve other uses, such as building the
world stage C++ executables with libc++ instead of libstdc++: during the
early build stages, we cannot assume libc++ is already available, so we
must still build with libstdc++ at that time.
mm [Sun, 10 Jun 2012 07:40:26 +0000 (07:40 +0000)]
MFC r236155:
Import illumos changeset 13570:3411fd5f1589
1948 zpool list should show more detailed pool information
Display per-vdev information with "zpool list -v".
The added expandsize property has currently no value on FreeBSD.
This changeset allows adding expansion support to individual vdevs
in the future.
kib [Sat, 9 Jun 2012 08:04:08 +0000 (08:04 +0000)]
MFC r236043:
Add a vn_bmap_seekhole(9) vnode helper which can be used by any
filesystem which supports VOP_BMAP(9) to implement SEEK_HOLE/SEEK_DATA
commands for lseek(2).
mav [Sat, 9 Jun 2012 07:53:57 +0000 (07:53 +0000)]
r236666:
ATA/SATA controllers have no idea about protocol of the connected device
until transport will do some probe actions (at least soft reset).
Make ATA/SATA SIMs to not report bogus and confusing PROTO_ATA protocol.
Make ATA/SATA transport to fill that gap by reporting protocol to SIM with
XPT_SET_TRAN_SETTINGS and patching XPT_GET_TRAN_SETTINGS results if needed.
mav [Sat, 9 Jun 2012 07:43:11 +0000 (07:43 +0000)]
MFC r236437:
Rewrite enabling NCQ for SATA devices in a way more alike to SCSI TCQ.
This allows to control it with `camcontrol negotiate adaX -T (en|dis)able`
on the fly, same as for SCSI devices.
mav [Sat, 9 Jun 2012 07:31:04 +0000 (07:31 +0000)]
NFC r236393:
Use AC_GETDEV_CHANGED async to notify ada driver about DMA and NCQ status
change. Now that allows switching between PIO and DMA modes on the fly.
mav [Sat, 9 Jun 2012 07:28:11 +0000 (07:28 +0000)]
MFC r236234:
Allow to change number of openings (used tags) for ATA/SATA devices
via `camcontrol tags ... -N ...`. There is no need to tune it in
usual cases, but some users want to have it for debugging purposes.
mav [Sat, 9 Jun 2012 06:43:26 +0000 (06:43 +0000)]
MFC r235897:
- Add low-level support for SATA Enclosure Management Bridge (SEMB)
devices -- SATA equivalents of the SCSI SES/SAF-TE devices.
- Add some utility functions for SCSI SAF-TE devices access.
mav [Fri, 8 Jun 2012 20:30:37 +0000 (20:30 +0000)]
MFC r235982:
Add tunable/sysctl kern.cam.pmp.hide_special, controlling whether special
PMP ports such as PMP configuration or SEMB should be exposed or hidden.
These ports were always hidden before as useless and sometimes promatic.
But with updated ses driver supporting SEMB it is no longer so straight.
Keep ports hidden by default to avoid probe request ttimeouts if SEP is
not connected to PMP's SEMB via I2C, that is very often situation.